admin管理员组文章数量:1122832
I have a form on a page where I want to populate item values by uploading a CSV file containing item names and their corresponding values. I am creating a collection based on the CSV content. How can I set the form item names with the corresponding values from the Collection?
I am trying to call the process on pre rendering after header.
DECLARE
l_field_name VARCHAR2(32767);
l_field_value VARCHAR2(32767);
BEGIN
FOR rec IN (SELECT * FROM APEX_COLLECTIONS WHERE collection_name = 'POPULATE') LOOP
l_field_name := rec.c001;
l_field_value := rec.c002;
EXECUTE IMMEDIATE 'BEGIN :1 := :2; END;'
USING OUT l_field_name, l_field_value;
END LOOP;
END;
but there value is not updating.
I have a form on a page where I want to populate item values by uploading a CSV file containing item names and their corresponding values. I am creating a collection based on the CSV content. How can I set the form item names with the corresponding values from the Collection?
I am trying to call the process on pre rendering after header.
DECLARE
l_field_name VARCHAR2(32767);
l_field_value VARCHAR2(32767);
BEGIN
FOR rec IN (SELECT * FROM APEX_COLLECTIONS WHERE collection_name = 'POPULATE') LOOP
l_field_name := rec.c001;
l_field_value := rec.c002;
EXECUTE IMMEDIATE 'BEGIN :1 := :2; END;'
USING OUT l_field_name, l_field_value;
END LOOP;
END;
but there value is not updating.
Share Improve this question edited Nov 22, 2024 at 13:42 Abneesh Kumar asked Nov 22, 2024 at 12:34 Abneesh KumarAbneesh Kumar 32 bronze badges1 Answer
Reset to default 0Page items are available as pl/sql variables in the apex context. You can reference them using bind variable syntax and assign a value using the assignment operator :=
:P1_MYPAGEITEM := 'Foobar';
Alternatively, use APEX_UTIL.SET_SESSION_STATE.
For your case, it sounds like you need the 2nd option:
DECLARE
l_field_name VARCHAR2(32767);
l_field_value VARCHAR2(32767);
BEGIN
FOR rec IN (SELECT * FROM APEX_COLLECTIONS WHERE collection_name = 'POPULATE') LOOP
l_field_name := rec.c001;
l_field_value := rec.c002;
APEX_UTIL.SET_SESSION_STATE(p_name => l_field_name,p_value => l_field_value);
END LOOP;
END;
本文标签: Populating Form Items with Values from an Uploaded CSV File in Oracle APEXStack Overflow
版权声明:本文标题:Populating Form Items with Values from an Uploaded CSV File in Oracle APEX - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736303756a1931994.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论