Question about manual tabular forms
Hello. I have a manual tabular form which has a some select_list_from_query items, text_from_lov_query, hidden, etc. I have not found a way to have one of the select lists based on one of the hidden items. Is it possible for the select list query to use other items from the form's select statement? In the code sample below I would like group_number to be based on the board_group_type_id.
Thank you,
-Carmine
select
htmldb_item.hidden(4,board_group_type_id) board_group_type_id,
htmldb_item.select_list_from_query(7,group_number,
'select m.valid_group_number d, m.valid_group_number r
from board_group_type b, map_group_numbers m
where b.board_group_type_id = m.board_group_type_id
and b.board_group_type_id = '|| TO_CHAR(board_group_type_id) ||
' order by 1',
NULL,'NO') group_number
from board_groups
where system_id = :P0_PROFILE_NAME
Bump...Anyone?
Thank you,
-Carmine
Similar Messages
-
Manually tabular form question
hi all
i built a manually tabular form.
i want that this tabular for will used only to update , and without the option of insert new row .
two questions i have here according to the document :
there is something called
Adding Optimistic Lockingoptimistic locking
is that possible to do it if it's only an update form?
i've tried to do it and not really succeeded.
second question is about collection
again is this possible to do it if i built only an update form ?
thanks for quick responseHi Naama,
>> i've created the package , it's show like it done but then i cannot see it.what seems to be the problem ?
I have no idea, but this is definitely something local in your database. Just drop the package and re-create it. If the Object Browser doesn’t show you the package, try to use SQL*Plus.
>> what is the meaning of this package?
is this package active only in the tabular manually form ?.
This is a regular PL/SQL package, and with the proper privileges, can be used anywhere on the database, with or without APEX connection.
This package is “special” because it’s includes all you need to manage Optimistic Locking, which is characteristic to Web based applications. Other than that, you can use it whenever you need to manipulate the related table(s).
>> the apex know in which part to relate in the package right ?
APEX don’t know anything. When you are building a manual tabular form, it is also your responsibility to construct the proper DML processes. If you want your tabular form to support insert/update/delete you’ll need to construct three processes, each with the proper DML statement, each condition by the proper button. In your private case, as you need to support update only, you’ll need to build only one DML process (PL/SQL anonymous block), which will call the proper update procedure from the package.
>> thank you
Naama
Wow! You signed your name correctly :) You should amend your handle to reflect that.
Best Regards,
Arie. -
Manual Tabular Form Formatting Questions
Hello, this is my first time using a tabular form and am now trying to tackle creating a manual tabular form. So, now I have some questions on formatting.
1. Is it proper on this forum to lump several similar questions together or should these be separate postings?
2. I have a hidden column that I do not want to display on the screen at all. However, I need access to the column later when saving. I am currently using the htmldb_item.hidden function to retrieve the field. This works. However, the column still displays but the value does not display. I then tried to uncheck the show attribute for the column to unchecked. Unfortunately, if this is not selected, when using the htmldb_application.g_f01 function, I would receive an error as if the column did not exist. How do I make the column totally hidden so that it does not display at all?
3. I have a number column where I want the column to display in dollars (i.e. $100, 000). I tried to set the number format on the column in the report attributes. However, no luck. To retrieve the column, I am using the function htmldb_item.text to retrieve the column. I am not sure if I should be able to format the column in the report attributes or if the htmldb_item.text function has a parameter that I could use for formatting. Suggestions?
4. Similarily, I would like to right justify this column. How is this accomplished?
ThanksHi everyone,
Is there any way to not to display the hidden columns in the manual tabular forms,when we create the manual tabular form using htmldb_item.hidden.
But need to refer that column in the process.
In the wizard generated tabular form if the column is of type HIDDEN we dont see that column on the report.
How can i achieve the same in manual tabular forms..
Thanks -
Query for create manual tabular form using apex collection add row button functionality
Hello everyone
My requirement is i created a tabular form manually using apex collection but if i click on add row button then previously selected data refreshed and added new row in this form it is fine.but i don't want to refreshed previously selected data and click on add row button then add new row .how it is possible? plz help
Thanks & Regards,
UjwalaUjwala
Instead of starting a new thread with the same question as Query for create manual tabular form using apex collection add row button functionality.
Could you answer the question about what you see while debug the javascript code.
If you don't understand the question or have trouble debug javascript let us know.
Nicolette -
Delete Functionality in manual tabular form
Hi everyone,
I have created 2 tabular forms on the same page.everthing is working fine.Both the tabular form are able to insert and update.I am getting problem to implement the DELETE functionality in those tabular form.
I inserted this code htmldb_item.checkbox(6, id) del in the region and i created a delete process.But i am getting (no data found) error.
could anyone help me in solving this.
thanks
phani
===========================================================
DELETE PROCESS:
FOR i in 1..HTMLDB_APPLICATION.G_F01.count
LOOP
DELETE FROM (TABLE NAME)
WHERE id = HTMLDB_APPLICATION.G_F06(i);
END LOOP;
=============================================================
TABULAR FORM 1:
REGION:
select x.column1,
x.column2,
x.column3,
x.column4,
x.column5,
x.del,
x.cks
from (
select htmldb_item.hidden(1,column1) column1,
htmldb_item.text(2,column2,10) column2,
htmldb_item.text(3,column3,10) column3,
htmldb_item.text(4,column4,10) column4,
wwv_flow_item.date_popup(5,null,column5) column5,
htmldb_item.checkbox(6,column1) del,
htmldb_item.md5_checksum(column2,column3,column4,column5) cks
from TABLENAME
union all
select htmldb_item.hidden(1,null) column1,
htmldb_item.text(2,null,10) column2,
htmldb_item.text(3,null,10) column3,
htmldb_item.text(4,null,10) column4,
wwv_flow_item.date_popup(5,null,null) column5,
htmldb_item.checkbox(6,null) del,
htmldb_item.md5_checksum(null,null,null,null) cks
from dual) x
==================================================================
PROCESS:
declare
l_cks wwv_flow_global.vc_arr2;
j pls_integer := 1;
begin
-- Get original MD5 checksum
select wwv_flow_item.md5(column2,column3,column4,column5) cks
BULK COLLECT INTO
l_cks
from TABLE;
-- Compare the original checksum, l_cks,
-- with submitted checksum, htmldb_application.g_fcs.
-- If they are different, raise an error.
-- for i in 1..l_cks.count
-- loop
-- if htmldb_application.g_fcs(i) != l_cks(i) then
-- rollback;
-- raise_application_error(
-- -20001,
-- 'Current version of data in database has changed '||
-- 'since user initiated update --process.');
--return;
-- end if;
-- end loop;
-- update
for i in 1..htmldb_application.g_f01.count
loop
if htmldb_application.g_f01(i) is not null then
update TABLENAME
set column2= htmldb_application.g_f02(i),
column3 = htmldb_application.g_f03(i),
column4 = htmldb_application.g_f04(i),
column5 = htmldb_application.g_f05(i)
where column1 = htmldb_application.g_f01(i);
else
if htmldb_application.g_f03(i) is not null then
insert into TABLE
(column2,
column3,
column4,
column5
values
(htmldb_application.g_f02(i),
htmldb_application.g_f03(i),
htmldb_application.g_f04(i),
htmldb_application.g_f05(i));
end if;
end if;
end loop;
end;
I created the other tabular form on the same page with
htmldb_application.g_f11(i)
htmldb_application.g_f12(i)
htmldb_application.g_f13(i)
htmldb_application.g_f14(i)
used the same code.Have you got any response on this? I would like to know how to do it too. I am trying to implement a manual tabular form on a page and need this functionality.
I do know one thing. After attending the ODTUG conference last week, Raj said something about you have to process check boxes and radio groups separately from the rest of the form.
Thanks,
Michelle -
Creating a manual tabular form on an empty table
Hi all,
I am trying to create a manual tabular form on an empty table. Is it possible to display textboxes and column headers, when I run the report I get "no data found".
Regards,Hi Denes and thank you for your valuable input.
My problem is in fact that, I have created the tabular form by using a report region with a SQL query, something like,
select apex_item.display_and_save(1, p.bolge) bolge,
apex_item.display_and_save(2, p.hafta) hafta,
apex_item.display_and_save(3, p.yil) yil,
apex_item.display_and_save(4, p.mamul) mamul,
apex_item.display_and_save(5, p.tahmin1) tahmin1,
apex_item.display_and_save(6, p.tahmin2) tahmin2,
apex_item.display_and_save(7, p.tahmin3) tahmin3,
apex_item.display_and_save(8, p.tahmin4) tahmin4,
apex_item.display_and_save(9, p.tahmin5) tahmin5,
apex_item.display_and_save(10, p.tahmin6) tahmin6,
apex_item.display_and_save(11, p.revize4) revize4,
apex_item.display_and_save(12, p.revize5) revize5,
apex_item.display_and_save(13, p.revize6) revize6
from portal_link.v_planlama p
The problem is that, since there is no data in the table, when I run the page, I cant get the form to be rendered, and I get a nice "no data found". There should be a way to get the form rendered, hence making it available for data input.
Regards,
Onur -
Issue with APEX_ITEM.CHECKBOX in Manual Tabular Form report
Hi,
I have a simple manual tabular form report with query :
SELECT
APEX_ITEM.CHECKBOX(1,order_id) ,
APEX_ITEM.TEXT(3,Ord_number) ,
APEX_ITEM.TEXT(4,ord_flag)
from
tbl_order
and a process to update the value of Ord_number & ord_flag columns for the selected (Checked) rows.
FOR i in 1..apex_application.g_f01.count
loop
UPDATE
tbl_order
SET
Ord_number = apex_application.g_f03(i),
ord_flag = apex_application.g_f04(i)
WHERE
order_id = apex_application.g_f01(i);
END LOOP;
But the values getting updated wrongly , how can I ensure the exact values is retrieved in apex_application.g_f03(i) & apex_application.g_f04(i) ?
Regards.
BenzI think the row selector is there if you create an tabular form. However, you can create it yourself following this example:
http://apex.oracle.com/pls/otn/f?p=31517:170
Basically,
apex_item.checkbox (30,
'#ROWNUM#',
'onclick="highlight_row(this,' || ROWNUM || ')"',
NULL,
'f30_' || LPAD (ROWNUM, 4, '0')
) delete_checkboxDenes Kubicek
http://deneskubicek.blogspot.com/
http://www.opal-consulting.de/training
http://apex.oracle.com/pls/otn/f?p=31517:1
http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
------------------------------------------------------------------- -
Can't get Delete Process to work on Manual Tabular Form
Help. My insert and update process works just fine. I can't get the delete process to work. I've searched the forum and found a couple of examples on what to do, but I can't get the examples to work. I get an ORA-01403: no data found error.
Report SQL:
select apex_item.checkbox (1, ceah_people_lang_id,'unchecked') delete_checkbox,
--'onclick="highlight_row(this,' || ROWNUM || ')"',
--null,
--'F1_' || LPAD (ROWNUM, 4, '0')) delete_checkbox,
Delete Process:
declare
begin
for i in 1..apex_application.g_f02.count
loop
--if apex_application.g_f01(i) = 'Y'
--then
delete from ceah_people_language
where ceah_people_lang_id = to_number(apex_application.g_f01(i));
--end if;
end loop;
end;
I've spent more time than I care to admit on the manual tabular form. Any help would be appreciated. Thanks, Elizabethselect apex_item.checkbox (1, ceah_people_lang_id,'unchecked') delete_checkbox,
--'onclick="highlight_row(this,' || ROWNUM || ')"',
--null,
--'F1_' || LPAD (ROWNUM, 4, '0')) delete_checkbox,
apex_item.hidden(2,ceah_people_lang_id)
||
apex_item.select_list_from_query(3,language_id,'select language_name, language_id from foreign_language') language_id,
apex_item.hidden(4,ceah_people_id) ||
apex_item.select_list_from_query(5,proficiency,'select name, id from proficiency') proficiency
from ceah_people_language where ceah_people_language.ceah_people_id = :P152_person_id
union all
select apex_item.checkbox
(1,
null,
'onclick="highlight_row(this,' || ROWNUM || ')"',
null,
'F1_' || LPAD (ROWNUM, 4, '0')) delete_checkbox,
apex_item.hidden(2,null) ||
apex_item.select_list_from_query(3,null,'select language_name, language_id from foreign_language',
'style="width:170px" ' ,
'YES',
'0',
'- Select Foreign Language -',
'f3_' || LPAD (9900 + ROWNUM, 4, '0'),
NULL,
'NO'
) language_id,
apex_item.hidden(4,null) ||
apex_item.select_list_from_query(5,null,'select name, id from proficiency',
'style="width:170px" ' ,
'YES',
'0',
'- Select Proficiency -',
'f5_' || LPAD (9900 + ROWNUM, 4, '0'),
NULL,
'NO'
) proficiency
from dual where :request = 'ADD_ROWS'
connect by level <= 2 -
How to Multi Row Update function in Manual Tabular Form
Hi All,
In my application I am using manual tabular form, for Update and insert i have written pl/sql process,
but i want to make use of MULTI_ROW_UPDATE function for update and insert operations.
How can I implement default tabular form behaviour in manual tabular form.
I am using:
Oracle Database 11g
ApEx Version 4.0
please help me, it's urgent.
thanks
MRHi Joao,
First Can u pl let us know your view is based on how many
tables?
If it is a simple view ,you can open the form in update mode
passing a parameter to it thru a procedure or thru a url or what
ever you feel like(form to form,etc)..I will give you an example
on how to open the form in update mode like below..
1.develop a form based on a simple view
2.Call that form Thru a simple URL
3.In the above you are opening a form with module id
ex:1234567890 in update mode and change portal30 to suit
accordingly..
4.You are passing a parameter called "ABCDEF" TO "NAME" Field to
that form for querrying..
5.Now the form will be opened in update mode and all the fields
are pertaining to the parameter "ABCDEF" and you can update the
fields....
II..Now regarding the check boxes i need to know which version
of the portal are u using..As for as my knowledge goes (up to
3.0.6) there are lot of bugs with the check boxes and check box
checked value is always "yes"(if u want to insert in to the data
base).So try not to depend on checkboxes and instead Combo is
the right answer till oracle portal is free of bugs.
No triggers are required for your requirement....
Hope i have answered your problem ...If any please revert back
with full details
Thanks
Vishnu Singireddy -
Apex_item.radiogroup using an LOV in a manual tabular form
I'm on APEX 4.0.0.00.46 and I'm sure there must be an obvious solution that I'm missing here, but I'm having a problem setting up an apex_item.radiogroup on a manual tabular form. This is the basic query that I'm using:
select apex_item.radiogroup(37,my_field) as my_field
from my_table
When I use the above query as my Region Source, it compiles fine. However, it seems as though the query won't pull in the value that currently exists in the table unless I set the Column Attribute called 'Display As' for the field to 'Standard Report Column'. When I do this, it seems to remove the capability to incorporate a LOV into the radio group. I'm attempting to incorporate a query like this into the radiogroup:
select 'YES' d, 'Y' r
from dual
UNION ALL
select 'NO' d, 'N' r
from dual
So, to recap, I can set up a Radio Group (query based LOV), but if I do, the query of the table will not pull in the current value from the table. If I change the 'Display As' Column Attribute to 'Standard Report Column', I can no longer incorporate the LOV. Please help if you have any ideas.I am not 100% sure what you are trying to do but I think I am close. Try using
SELECT apex_item.radio_group_from_query
(37,
my_field,
'SELECT ''YES'' d, ''Y'' r FROM dual
UNION ALL
SELECT ''NO'' d, ''N'' r FROM dual'
) AS my_field
FROM my_tableDenes Kubicek
http://deneskubicek.blogspot.com/
http://www.apress.com/9781430235125
http://apex.oracle.com/pls/otn/f?p=31517:1
http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
------------------------------------------------------------------- -
Problem in saving BLOB on a manual tabular form
Hi All,
I have a manual tabular form which has one column as file browse (blob). When I browse and select some file to save with the row, it saves only the name of the file, not the actual file.
The example form is available on apex.oracle.com. The page has a process called SAVE which is supposed to save the record with blob.
Workspace: bobforum
user: forum
password: abc123
Application: 39196
Page: 1
I will appreciate if someone can help.
Thanks,
ZkayHi,
What I did check, apex_application.g_fnn array do not work for this.
From Google I did found that it has work in previous APEX version.
Something has changed and e.g. Denis example for multiple file browser do not work anymore.
http://htmldb.oracle.com/pls/otn/f?p=31517:161
I did manage upload files to wwv_flow_files table when using apex_application.g_xnn.
I did add derived column to report. To HTML expression I did place
<input type="file" name="x0#ROWNUM#" />
This way you could have report that shows max 20 rows in pagination page.
But I did not find way to identify file uploaded to flow files.
In After submit process apex_application.g_xnn seems have null value,
so I could not query wwv_flow_files by name column and insert file to my own table.
Regards,
Jari -
Hi everyone,
I have created a maual tabular form with the help of (HOW TO) document in OTN.For that I wrote maual update and manual delete process and evething is working fine.But in the manual update process i did not include the code to compare the checksum of the submitted data with the old data (still its working fine).But in my application i have created several manual tabular forms like this .Do the application get any problem in the futher as i am not checking the checksum.If i compare the checksum i am getting error.I decoded that error by
inserting the checksum values to a (test table).The checksum values for a row is changing even if there is no change in the data of the table.
any suggestions please
Here is my code
declare
l_cks wwv_flow_global.vc_arr2;
j pls_integer := 1;
begin
-- Get original MD5 checksum
-- select wwv_flow_item.md5( column1,column2,column3,column4) cks
-- BULK COLLECT INTO
--l_cks
-- from table;
-- Compare the original checksum, l_cks,
-- with submitted checksum, htmldb_application.g_fcs.
-- If they are different, raise an error.
-- for i in 1..l_cks.count
--loop
--if htmldb_application.g_fcs(i) != l_cks(i) then
-- rollback;
--raise_application_error(
-- -20001,
-- 'Current version of data in database has changed '||
-- 'since user initiated update process.');
-- return;
--end if;
--end loop;
-- update EMP
for i in 1..htmldb_application.g_f07.count
loop
if htmldb_application.g_f07(i) is not null then
update table
set
column2 = replace(htmldb_application.g_f08(i),'%'||'null%',NULL)
where column1 = htmldb_application.g_f07(i);
else
if htmldb_application.g_f08(i) is not null then
insert into table
( column1 ,
column2,
column3)
values
replace(htmldb_application.g_f08(i),'%'||'null%',NULL));
end if;
end if;
end loop;
end;
Thanks
phaniPhani,
I don't understand what you have working, what does not work, and what that code does (much of it is commented out). Can you put an example on apex.oracle.com that shows the problem?
Scott -
Checksum error in Manual Tabular Form
Hi everyone,
I have created 2 (manual tabular forms) on a same page but i am getting checksum error for one of the tabular form.
Here is my code:
1 st Tabular Form:
select
x.del,
x.ECGEXST_ID,
x.LEAD_CD,
x.ST_ID,
x.ENTERED_DTS,
X.ENTERED_BY_NM,
X.UPDATED_DTS,
X.UPDATED_BY_NM,
x.cks
from (
select
htmldb_item.checkbox(1,ECGEXST_ID) del,
htmldb_item.hidden(2,ECGEXST_ID) ECGEXST_ID,
htmldb_item.select_list_from_query (3, LEAD_CD,'select lead_cd , lead_cd from lslead order by display_seq ',15) LEAD_CD,
htmldb_item.select_list_from_query(5,ST_ID,'select lkup_dsc,lkup_id from lkup where lkup_grp_id = 17',25) ST_ID,
wwv_flow_item.display_and_save(6,to_char(ENTERED_DTS,'MM/DD/YYYY')) ENTERED_DTS,
au.LAST_NM || ', ' || au.FIRST_NM ENTERED_BY_NM,
wwv_flow_item.display_and_save(7,to_char(UPDATED_DTS,'MM/DD/YYYY')) UPDATED_DTS,
au1.LAST_NM || ', ' || au1.FIRST_NM UPDATED_BY_NM,
htmldb_item.md5_checksum(ECGEXDT_ID,LEAD_CD,ST_ID,ENTERED_DTS,ENTERED_BY_MSPR_ID) cks
from ECGEXST,
app_user au,app_user au1 where au.MSPR_ID(+) = ECGEXST.ENTERED_BY_MSPR_ID and au1.MSPR_ID(+) = ECGEXST.UPDATED_BY_MSPR_ID
and ECGEXDT_ID = :P65_ECGEXDT_ID
union all
select
htmldb_item.checkbox(1,null) del,
htmldb_item.hidden(2,null) ECGEXST_ID,
htmldb_item.select_list_from_query (3,null,'select lead_cd , lead_cd from lslead order by display_seq ',15) LEAD_CD,
htmldb_item.select_list_from_query(5,null,'select lkup_dsc,lkup_id from lkup where lkup_grp_id = 17',25) ST_ID,
wwv_flow_item.display_and_save(6,null) ENTERED_DTS,
null ENTERED_BY_NM,
wwv_flow_item.display_and_save(7,null) UPDATED_DTS,
null UPDATED_BY_NM,
htmldb_item.md5_checksum(null,null,null,null,null) cks
from dual) x
UPDATE PROCESS:
declare
l_cks wwv_flow_global.vc_arr2;
j pls_integer := 1;
val1 varchar2(100);
val2 varchar2(100);
begin
-- Get original MD5 checksum
select wwv_flow_item.md5(ECGEXDT_ID,LEAD_CD,ST_ID,ENTERED_DTS,ENTERED_BY_MSPR_ID) cks
BULK COLLECT INTO
l_cks
from ECGEXST where ECGEXDT_ID = :P65_ECGEXDT_ID;
-- Compare the original checksum, l_cks,
-- with submitted checksum, htmldb_application.g_fcs.
-- If they are different, raise an error.
for i in 1..l_cks.count
loop
if htmldb_application.g_fcs(i) != l_cks(i) then
rollback;
raise_application_error(
-20001,
'Current version of data in database has changed '||
'since user initiated update process.');
-- return;
end if;
end loop;
-- update ECGRSTST
for i in 1..htmldb_application.g_f02.count
loop
if htmldb_application.g_f02(i) is not null then
update ECGEXST
set
ECGEXDT_ID = :P65_ECGEXDT_ID,
LEAD_CD = replace(htmldb_application.g_f03(i),'%'||'null%',NULL),
ST_ID = replace(htmldb_application.g_f05(i),'%'||'null%',NULL)
where ECGEXST_ID = htmldb_application.g_f02(i);
else
if htmldb_application.g_f03(i) is not null then
insert into ECGEXST
(ECGEXST_ID ,
ECGEXDT_ID,
LEAD_CD,
ST_ID)
values
(ECGEXST_SEQ.nextval,
:P65_ECGEXDT_ID,
replace(htmldb_application.g_f03(i),'%'||'null%',NULL),
replace(htmldb_application.g_f05(i),'%'||'null%',NULL));
end if;
end if;
end loop;
end;
The first tabular form is working fine.But for the second tabular form i am getting the checksum error.I have created a test table and checked the checksum values.The checksum values are changing.
Here is the code of my 2nd tabularform:
select
x.del,
x.ECGEXT_ID,
x.LEAD_CD,
x.T_ID,
x.ENTERED_DTS,
X.ENTERED_BY_NM,
X.UPDATED_DTS,
X.UPDATED_BY_NM,
x.cks
from (
select
htmldb_item.checkbox(11,ECGEXT_ID) del,
htmldb_item.hidden(12,ECGEXT_ID) ECGEXT_ID,
htmldb_item.select_list_from_query (13, LEAD_CD,'select lead_cd , lead_cd from lslead order by display_seq ',15) LEAD_CD,
htmldb_item.select_list_from_query(15,T_ID,'select lkup_dsc,lkup_id from lkup where lkup_grp_id = 18',25) T_ID,
wwv_flow_item.display_and_save(16,to_char(ENTERED_DTS,'MM/DD/YYYY')) ENTERED_DTS,
au.LAST_NM || ', ' || au.FIRST_NM ENTERED_BY_NM,
wwv_flow_item.display_and_save(17,to_char(UPDATED_DTS,'MM/DD/YYYY')) UPDATED_DTS,
au1.LAST_NM || ', ' || au1.FIRST_NM UPDATED_BY_NM,
htmldb_item.md5_checksum(ECGEXDT_ID,LEAD_CD,T_ID,ENTERED_DTS,ENTERED_BY_MSPR_ID) cks
from ECGEXT,
app_user au,app_user au1 where au.MSPR_ID(+) = ECGEXT.ENTERED_BY_MSPR_ID and au1.MSPR_ID(+) = ECGEXT.UPDATED_BY_MSPR_ID
and ECGEXDT_ID = :P65_ECGEXDT_ID
union all
select
htmldb_item.checkbox(11,null) del,
htmldb_item.hidden(12,null) ECGEXT_ID,
htmldb_item.select_list_from_query (13,null,'select lead_cd , lead_cd from lslead order by display_seq ',15) LEAD_CD,
htmldb_item.select_list_from_query(15,null,'select lkup_dsc,lkup_id from lkup where lkup_grp_id = 18',25) T_ID,
wwv_flow_item.display_and_save(16,null) ENTERED_DTS,
null ENTERED_BY_NM,
wwv_flow_item.display_and_save(17,null) UPDATED_DTS,
null UPDATED_BY_NM,
htmldb_item.md5_checksum(null,null,null,null,null) cks
from dual) x
UPDATE PROCESS:
declare
l_cks wwv_flow_global.vc_arr2;
j pls_integer := 1;
val1 varchar2(100);
val2 varchar2(100);
begin
-- Get original MD5 checksum
select wwv_flow_item.md5(ECGEXDT_ID,LEAD_CD,T_ID,ENTERED_DTS,ENTERED_BY_MSPR_ID) cks
BULK COLLECT INTO l_cks
from ECGEXT where ECGEXDT_ID = :P65_ECGEXDT_ID;
-- Compare the original checksum, l_cks,
-- with submitted checksum, htmldb_application.g_fcs.
-- If they are different, raise an error.
for i in 1..l_cks.count
loop
if htmldb_application.g_fcs(i) != l_cks(i) then
-- val1 := htmldb_application.g_fcs(i);
-- val2 := l_cks(i);
-- insert into test2 (val_1,val_2) values (val1,val2);
rollback;
raise_application_error(
-20001,
'Current version of data in database has changed '||
'since user initiated update process.');
return;
end if;
end loop;
-- update ECGRSTST
for i in 1..htmldb_application.g_f12.count
loop
if htmldb_application.g_f12(i) is not null then
update ECGEXT
set
ECGEXDT_ID = :P65_ECGEXDT_ID,
LEAD_CD = replace(htmldb_application.g_f13(i),'%'||'null%',NULL),
T_ID = replace(htmldb_application.g_f15(i),'%'||'null%',NULL)
where ECGEXT_ID = htmldb_application.g_f12(i);
else
if htmldb_application.g_f13(i) is not null then
insert into ECGEXT
(ECGEXT_ID ,
ECGEXDT_ID,
LEAD_CD,
T_ID)
values
(ECGEXT_SEQ.nextval,
:P65_ECGEXDT_ID,
replace(htmldb_application.g_f13(i),'%'||'null%',NULL),
replace(htmldb_application.g_f15(i),'%'||'null%',NULL));
end if;
end if;
end loop;
end;
please help me in solving this.The same code its good for one tabular form and for the other it giving the checksum error.
Thanks in advance
phaniHi patrick,
Thanks for the reply i am getting the checksum error even if i used my primary key in the select statement of the MD5 checksum.
My primary key in the second tabular form is
htmldb_item.hidden(12,ECGEXT_ID) ECGEXT_ID
so i changed the process to:
for i in 1..htmldb_application.g_f12.count
loop
if htmldb_application.g_f12(i) is not null
then
select wwv_flow_item.md5(ECGEXDT_ID,LEAD_CD,T_ID,ENTERED_DTS,ENTERED_BY_MSPR_ID) cks
BULK COLLECT INTO l_cks
from ECGEXT where ECGEXT_ID = htmldb_application.g_f12(i);
-- Compare the original checksum, l_cks,
-- with submitted checksum, htmldb_application.g_fcs.
-- If they are different, raise an error.
if htmldb_application.g_fcs(i) != l_cks(i) then
-- val1 := htmldb_application.g_fcs(i);
-- val2 := l_cks(i);
-- insert into test2 (val_1,val_2) values (val1,val2);
rollback;
raise_application_error(
-20001,
'Current version of data in database has changed '||
'since user initiated update process.');
end if;
end if;
end loop;
It's not possible to use BULK COLLECT to get the MD5 checksum of all >>>rows. Because the index positions in the MD5 array and the >>>apex_application.g_fxx array index will probably not match, especially if you >>>don't order or if you are on a second page.How come the first tabular form is running i used the bulk collect in the first tabular form
HERE IS THE CODE FOR THE FIRST TABULAR FORM:
-- Get original MD5 checksum
select wwv_flow_item.md5(ECGEXDT_ID,LEAD_CD,ST_ID,ENTERED_DTS,ENTERED_BY_MSPR_ID) cks
BULK COLLECT INTO
l_cks
from ECGEXST where ECGEXDT_ID = :P65_ECGEXDT_ID;
-- Compare the original checksum, l_cks,
-- with submitted checksum, htmldb_application.g_fcs.
-- If they are different, raise an error.
for i in 1..l_cks.count
loop
if htmldb_application.g_fcs(i) != l_cks(i) then
rollback;
raise_application_error(
-20001,
'Current version of data in database has changed '||
'since user initiated update process.');
-- return;
end if;
end loop; -
Select List in Manual Tabular Form based on a previous column
I have a manual tabular form that have several columns One column (vendor) is a select list that should be based on a previous column (Vendor Type - Internal/External). So if the user selects Internal for Vendor Type, the Vendor column's select list should only contain those vendors with type of Internal. By the way, it also uses APEX collections.
select
apex_item.hidden (1,C015) STATUS,
apex_item.checkbox (2,SEQ_ID,'title="check to delete"') CHECKBOX,
case
when (c001 is not null and c002 is not null) then
'<a onclick="return false;" href="f?p='||:APP_ID||':20:'||:APP_SESSION||'::NO:20:P20_ID,P20_REQ_ID,P20_SEQ_ID:'||C001||','||C002||','||SEQ_ID||'"><img alt="" src="/i/ed-item.gif"></a>'
end ||
apex_item.hidden (4,C001) ID,
apex_item.hidden (5,C002) JOB_QUOTE_ID,
apex_item.date_popup2 (6,C003,'MM/DD/YYYY',11,2000,'onChange="f_set_end_date(this.id,'|| ROWNUM || ');"') ||
apex_item.select_list_from_query (7,C004,'select svcs_description d, svcs_code r from csrsr_service_codes order by 1 asc',null,'YES',null,'-Select-') || '<BR />' ||
apex_item.date_popup2 (8,C005,'MM/DD/YYYY',11) ||
apex_item.text (9,C006,8,15,'style="text-align:right;"') || '<BR />' ||
apex_item.select_list (10,C007,'Staff;S,External;E',null,'YES',null,'-Select-') ||
apex_item.select_list_from_query_xl(11,C008,'select vendor_name d, vendor_number r from csrsr_vendors_v',null,'YES',null,'-Select-') || '<BR />' ||
apex_item.text (12,C009,50,100,'colspan=2') COL12,
apex_item.text (13,to_char(to_number(C010),'FML999G999G999G999G990D00'),10,15,'style="text-align:right;"') AMT1,
apex_item.text (14,to_char(to_number(C011),'FML999G999G999G999G990D00'),10,15,'style="text-align:right;"') AMT2,
apex_item.text (15,to_char(to_number(C012),'FML999G999G999G999G990D00'),10,15,'style="text-align:right;"') AMT3,
apex_item.text (16,to_char(to_number(C013),'FML999G999G999G999G990D00'),10,15,'style="text-align:right;"') AMT4,
apex_item.hidden (24,C001) ||
apex_item.hidden (25,C002) ||
apex_item.hidden (3,SEQ_ID) ||
apex_item.text (17,to_char(to_number(C014),'FML999G999G999G999G990D00'),10,15,'style="text-align:right;"') CHBK_AMT,
'value' COLTYPE
from
apex_collections
where
collection_name = 'CSRSR_JOBCOSTS_C' and
C015 in ('O','U','N')
union all
select
apex_item.hidden (1,null) STATUS,
apex_item.checkbox (2,null,'title="check to delete"') CHECKBOX,
apex_item.hidden (24,null) ||
apex_item.hidden (4,null) ID,
apex_item.hidden (25,null) ||
apex_item.hidden (5,null) JOB_QUOTE_ID,
apex_item.date_popup2 (6,null,'MM/DD/YYYY',11,2000,'onChange="f_set_end_date(this.id,'|| ROWNUM || ');"') ||
apex_item.select_list_from_query (7,null,'select svcs_description d, svcs_code r from csrsr_service_codes order by 1 asc',null,'YES',null,'-Select-') || '<BR />' ||
apex_item.date_popup2 (8,null,'MM/DD/YYYY',11) ||
apex_item.text (9,null,8,15,'style="text-align:right;"') || '<BR />' ||
apex_item.select_list (10,null,'Staff;S,External;E',null,'YES',null,'-Select-') ||
apex_item.select_list_from_query_xl(11,null,'select vendor_name d, vendor_number r from csrsr_vendors_v',null,'YES',null,'-Select-') || '<BR />' ||
apex_item.text (12,null,50,100,'colspan=2') COL12,
apex_item.text (13,null,10,15,'style="text-align:right;"') AMT1,
apex_item.text (14,null,10,15,'style="text-align:right;"') AMT2,
apex_item.text (15,null,10,15,'style="text-align:right;"') AMT3,
apex_item.text (16,null,10,15,'style="text-align:right;"') AMT4,
apex_item.hidden (24,null) ||
apex_item.hidden (25,null) ||
apex_item.hidden (3,null) ||
apex_item.text (17,null,10,15,'style="text-align:right;"') CHBK_AMT,
'value' COLTYPE
from
dual
How can I accomplish this?
Application Express 4.1.2
Oracle 10g Rel 2
RobertHi,
Then you are probably looking cascading select list in tabular form?
http://dbswh.webhop.net/htmldb/f?p=BLOG:READ:0::::ARTICLE:2003800346210117
Regards,
Jari -
Display select list from query on manual tabular form
Hello,
I'm trying to display a select list from query on a manual tabular form. I'm using a collection to store the data. I can't seem to get the query to work. I can display the item as a text item. Any help would be appreciated. Thanks, Elizabeth.
SELECT
-- Notice how I'm keeping the idx value the same as the column value in the collection. This helps to keep things organized
-- I also apply an id to each entry
-- I append the error value to the empname and sal
-- The Seq_id. Usefull when hiding rows (for delete) and then submitting from
apex_item.hidden(1,x.seq_id, null, x.seq_id || '_seq_id') ||
-- The Primary Key of the column
apex_item.hidden(2, x.ceah_people_id, null, x.seq_id || '_ceah_people_id') || x.ceah_people_id ceah_people_id,
-- Employee Name
case when x.seq_id = -1
then
apex_item.select_list_from_query (3,
NULL,
'select distinct language_name d, '
|| 'language_id r from foreign_language',
'style="width:170px" ' ,
'YES',
'0',
'- Select Language -',
'x.seq_id_' || LPAD (9900 + LEVEL, 4, '0'),
NULL,
'NO'
else
apex_item.text (3,(select language_name from foreign_language where x.language_id = foreign_language.language_id),
80,
100,
'style="width:170px" readonly="readonly"',
'f32_' || LPAD (ROWNUM, 4, '0')
end
|| err.language_id language_id,
/* apex_item.text(3,x.language_id,null, null, null, x.seq_id || '_language_id') || err.language_id language_id,
-- Employee Salary
apex_item.text(4,x.proficiency, null, null, null, x.seq_id || '_proficiency') || err.proficiency ||
-- Store the sql action type as well.
apex_item.hidden(50,x.sql_action_typ, null, x.seq_id || '_sql_action_typ_id') proficiency,
-- Last but not least the row error
err.row_error
FROM (SELECT ac.c001 seq_id,
ac.c002 ceah_people_id,
ac.c003 language_id,
ac.c004 proficiency,
ac.c049 modifiable_flag,
ac.c050 sql_action_typ
FROM apex_collections ac
WHERE ac.collection_name = 'DATA_COLLECTION'
ORDER BY ac.seq_id) x,
-- Error Collection
(SELECT ac.seq_id seq_id,
ac.c002 ceah_people_id,
ac.c003 language_id,
ac.c004 proficiency,
ac.c050 row_error -- Useful when individual data is correct, however the row of data is not. Ex: start/end dates
FROM apex_collections ac
WHERE ac.collection_name = 'ERROR_COLLECTION'
ORDER BY ac.seq_id) err
WHERE x.seq_id = err.seq_id(+)I got so frustrated I started over. I'm following the how to create a manual form.
http://www.oracle.com/technology/products/database/application_express/howtos/tabular_form.html#MANUAL
The problem I'm now having is even though I display items as hidden, there is a column holder on the report for them. If I go into the report attributes and toggle the show attribute off I cannot reference an items value in my logic. I used / / for the column heading but I still get the little sort arrow where the column heading should be. I tried to toggle the sort attribute off but the sort arrow still shows up. How can I use the apex_item.hidden and not get a place holder for the column on a report? Thanks, Elizabeth
Here is the code I'm using to generate the report:
select x.ceah_people_lang_id,
x.language_id,
x.proficiency,
x.ceah_people_id
from (
select apex_item.hidden(1,ceah_people_lang_id) ceah_people_lang_id,
apex_item.select_list_from_query(2,language_id,'select language_name, language_id from foreign_language') language_id,
apex_item.select_list_from_query(3,proficiency,'select name, id from proficiency') proficiency,
apex_item.hidden(4,ceah_people_id) ceah_people_id
from ceah_people_language where ceah_people_language.ceah_people_id = :P152_person_id
union all
select apex_item.hidden(1,null) ceah_people_lang_id,
apex_item.select_list_from_query(2,null,'select language_name, language_id from foreign_language') language_id,
apex_item.select_list_from_query(3,null,'select name, id from proficiency') proficiency,
apex_item.hidden(4,null) ceah_people_id
from dual) x
Maybe you are looking for
-
Embedding a SWF inside a MovieClip - width = 0
I have a class that extends a MovieClip and receives a MovieClip inside it. The movieclip is embedded like this: [Embed(source='assets/emi_dir.swf')] protected var MyMovie:Class; and I add it on the Parent constructor like this: public function Item(
-
A new version of our web site uses Berkeley DB with an environment and CDB mode, under FreeBSD 6.3. Our mod_perl2 code accesses the system via the BerkeleyDB (no space) interface module. It seems to be working but we haven't pushed it very hard yet.
-
Hi, I recently tried to anwser to a forums question located at this URL: /message/8930166#8930166 [original link is broken] I inserted some code snippets and encountered the problem that I was not able to send my posting to the forums (there occured
-
I get error message file is corrupt for firefox 3.6
every time i try to download firefox 3.6 i get to extraction and i get an error message "file is corrupt." i do not like using the firefox beta version. can you try to help me figure out why i can not download or install or use 3.6. or can you come u
-
Import film from Archos 705 wifi to imovie 8
After filming with my Archos705 + bullet camera, I would like to export those film in Imovie 7. Avi format is not compatible with Imovie 7 ! Somebody can give me the format I have to use to be able to read the film in Imovie WITHOUT pixelisation ! Be