Manual tabular form -- add rows

Hi everybody, I am making a manually tabular form following the Denes Kubicek tutorials:
http://apex.oracle.com/pls/otn/f?p=31517:170:1304244099066416::NO
and
http://apex.oracle.com/pls/otn/f?p=31517:190:1304244099066416::NO
The SQL for the tabular form is:
SELECT apex_item.checkbox (31,
idint,
'onclick="highlight_row(this,' || ROWNUM || ')"',
NULL,
'f31_' || LPAD (ROWNUM, 4, '0')
) delete_checkbox,
idint,
apex_item.text (32,
tipus_modif,
1,
1,
'style="width:20px" ',
'f32_' || LPAD (ROWNUM, 4, '0')
) tipus
FROM GPPC_DETALLS_ESMENA_PROP_V
where esmena_idint = :P18_IDINT
and tipus_modif ='A'
The Report is created correct. Now I modify the "Form Region" template like this:
<table class="t6FormRegion" id="MY_TAB" border="0" cellpadding="0" #REGION_ATTRIBUTES# summary="">
<tr><td class="t6Header">#TITLE#</td></tr>
<tr><td class="t6ButtonHolder">#CLOSE#   #PREVIOUS##NEXT##DELETE##EDIT##CHANGE##CREATE##CREATE2##EXPAND##COPY##HELP#</td></tr>
<tr><td class="t6Body">#BODY#</td></tr>
<tr><td><img src="#IMAGE_PREFIX#themes/theme_6/t.gif" width="400" height="1" alt="" /></td></tr>
</table>
Now I add a Button URL with the code:
javascript:va_AddTableRow(this,'MY_TAB',1);
and add this Javascript in the region header of the SQL Report
<script>
function va_AddTableRow(pThis,pThat,pNum){
var tt = html_GetElement(pThat);
for(i=0;i<pNum;i++){
var ogTR = tt.rows[1];
var trClone = ogTR.cloneNode(true);
trClone.firstChild.innerHTML='(null)';
var last_child=trClone.lastChild.getElementsByTagName('input')
for (var j=0;j<last_child.length;j++)
if (last_child[j].type=="hidden" && last_child[j].name=="f01")
last_child[j].value="";
if(document.all){
myNewRow = tt.insertRow(tt.rows.length);
oReplace = myNewRow.replaceNode(trClone);
}else{
tt.appendChild(trClone);
</script>
In this moment, when I push the botton appears the text (nulll) in the same region but not as a new line in the SQL report, what is the problem??
Thank you for your help

Alberto,
When you get a chance, see if maybe this (old version) of my app does something similar to what you need/want.
[http://apex.oracle.com/pls/otn/f?p=26115:3]
It's not working right now though, I keep getting the Oracle error:
ORA-01116: error in opening database file 17252 ORA-01110: data file 17252: '/u03/oradata/marvlprd/MARVLPRD/datafile/o1_mf_flow_172_23qtsjpr_.dbf' ORA-27041: unable to open file Linux Error: 23: Too many open files in system Additional information: 3
So, as way of an explanation (until Joel gets the Linux process fixed), I have a simple little screen that I use for letting the users specifiy search criteria. Each line has four columns, what field they want to search, a condition (equals or not equals), the text to search for, and an optional 'And/or' argument. If the 'And/Or' gets populated, a new blank line automatically gets created. There is also a red 'X' on each line so they users can delete a line if they want.
Not sure if this is what you need, but this page uses the same set of javascript code, so perhaps when it's working again, you can see if there are any similarities or differences.
Also, for reference, so you can see the code and variables, etc., the workspace is wbfergus, and the id and password are both htmldb-apex.
Bill Ferguson

Similar Messages

  • 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,
    Ujwala

    Ujwala
    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

  • 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
    MR

    Hi 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

  • 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,
    Zkay

    Hi,
    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

  • Query for create manual tabular form using apex collection using item textfield with autocomplete

    can we create a manual tabular form inside item textfield with autocomplete ?
    how it is possible?
    with Apex_item API used for this item.
    i used this code for creat  cascading select list
    select seq_id,
    APEX_ITEM.SELECT_LIST_FROM_QUERY(
            p_idx                       =>   1,
            p_value                     =>   c001,
            p_query                     =>   'SELECT C001 D
         , C002 R
      FROM APEX_COLLECTIONS
    WHERE COLLECTION_NAME = ''col1''',
            p_attributes                =>   'style="width:150px" onchange="f__name(this,parseInt(#ROWNUM#));"',
            p_show_null                 =>   'Yes',
            p_null_value                =>   null,
            p_null_text                 =>   '- Select name -',
            p_item_id                   =>   'f01_'|| LPAD (ROWNUM, 4, '0'),
            p_item_label                =>   'Label for f01_#ROWNUM#',
            p_show_extra                =>   'NO') name,
    APEX_ITEM.SELECT_LIST_FROM_QUERY(
            p_idx                       =>   2,
            p_value                     =>   c002,
            p_query              =>   ' SELECT null d, null r FROM dual WHERE 1 = 2
            p_attributes                =>   'style="width:150px"',
            p_show_null                 =>   'Yes',
            p_null_value                =>   null,
            p_null_text                 =>   '- Select name -',
            p_item_id                   =>   'f02_'|| LPAD (ROWNUM, 4, '0'),
            p_item_label                =>   'Label for f02_#ROWNUM#',
            p_show_extra                =>   'NO')name2,
    from apex_collections
    where
    collection_name = 'COLLECTION1'
    It is fine .
    but i want item in tabular form  textfield with autocomplete and remove select list. my requirement is using textfield with autocomplete select a employee name and second item textfield with autocomplete display dependent perticular employee related multiple task.
    how it is created.i have no idea related textfield with autocomplete.Please help me....

    pt_user1
    I understand that the add row button is currently doing a submit.
    To not submit the page you need a dynamic action on the page.
    Does the javascript function addRow do what you want?
    Otherwise have a look at the following two threads Add row in manual tabular form using dynamic action and Accessing Tabular Form & Add Elements to Collection without Page Submit.
    You're process could be something like:
    Add the new values to the collection using the idea's in the second thread and at the same time add the new row.
    And as second action refresh your tabular form.
    If you get stuck set up what you have done on apex.oracle.com using the tables from the demo application.
    Nicolette

  • Manual tabular forms  Denes example

    Hi,
    I implemented Denes Kubiceks' Manual Tabular Form (page # 170) to work. The only problem is that in his example pressing the ADD ROW button presents two new input records. I need only one new input record but I cannot figure out how he does it? Can someone point me in the right direction?

    Ok i figured it out in the tabular query there is a CONNECT BY LEVEL <=2. I changed that to 1 and it now gives me only one input record. Great example once you figure it out.

  • Sort Nulls First with Manual Tabular Form????

    I just created a manual tabular form and it appears to be in working order. Now I need to order the report results on 2 columns (which I have working using the sort sequence in the column attributes), but I also need the blank row (added row) to appear on top of the results.
    What do I need to do to add the blank row on top?? Sort Null: First does not work in my case.
    Thank you,
    Tammy

    select
      apex_item.hidden(1,null) log_id,
      apex_item.text(2,null) empty_field,
      apex_item.text(3,null) log_date,
      apex_item.text(4,null) z_time,
      apex_item.text(5,null) log_lead,
      apex_item.text(6,null) log_event,
      apex_item.text(7,null) project_id,
      apex_item.text(8,null) status,
      apex_item.checkbox(9,null) chkbx,
      apex_item.hidden(10,null) seq_id
    from dual
    connect by level < 4
    union all
    select
      apex_item.hidden(1,c001) log_id,
      apex_item.text(2,c002) empty_field,
      apex_item.text(3,c003) log_date,
      apex_item.text(4,c004) z_time,
      apex_item.text(5,c005) log_lead,
      apex_item.text(6,c006) log_event,
      apex_item.text(7,c007) project_id,
      apex_item.text(8,c008) status,
      apex_item.checkbox(9,seq_id) chkbx,
      apex_item.hidden(10,seq_id) seq_id
    from apex_collections
    where collection_name = 'LOG_ENTRIES'

  • Manual tabular form - popup

    I have a couple of problems with the manual tabular form I have created and would appreciate some help,
    First the htmldb_item.popup_from_query is not populating the field when I select the item:
    The query looks something like this:
    Select x.data1,
    x.data2,
    x.data3,
    x.CKS
    From (
    Select htmldb_item.display_and_save(1, data1) data1,
    htmldb_item.text(3, data2, 50) data2,
    htmldb_item.select_list(4,data3,'Yes;Y,No;N') data3
    htmldb_item.md5_checksum(data1,data2, data3) CKS
    FROM my_table
    UNION ALL
    Select htmldb_item.popup_from_query(1, NULL, 'select code || CHR(45) || description descrip, code from PRODUCT_STREAM', 2, 2) data1,
    htmldb_item.text(3, NULL, 50) data2,
    htmldb_item.select_list(4,'N','Yes;Y,No;N')data3,
    htmldb_item.md5_checksum(null,null,null) CKS
    FROM dual
    ) x;
    When this page is run, the existing data is displayed with a blank line at the bottom as expected, it I click on the popup icon a list of codes is displayed, but I cannot click on any of the items to populate the data1 field. If I change the query on the top of the union so the first data1 is also htmldb_item.popup_from_query then it works fine, but data1 cannot (user requirement) be changed by the user, how can I fix this so the popup list works.
    Second thing:
    CKS is showing as another column in the tab form, if I uncheck show it doesn’t work anymore, there us no data showing in the column just the heading, and I can get rid of the text but there is still allocated size for it.

    Why do you have to write the tabular form manually? Why not use the tabular wizard and have the form, including checksums, generated for you? In HTML DB 1.6 you can include options to automatically add new empty rows to your tabular form and have a row selector with delete functionality.
    Neither the manual tabular forms nor the automatically generated tabular forms support mixing display types for columns. Having a display-and-save display type for existing rows and a popup for new rows doesn’t work. All rows, including new ones, have to use the same display type to work properly. If it’s a requirement to have this data1 column be read-only for existing rows, then you need to create a separate form for adding new rows. So e.g. you could have a tabular form only for existing data and an add-row button that takes the user to a data entry form on another page.
    You’re checksum btw shows up in it’s own column because you defined it to be an extra column in your SQL statement. Since it’s just rendering a hidden form field, you could append the checksum to another column:
    htmldb_item.select_list(4,'N','Yes;Y,No;N') ||
    htmldb_item.md5_checksum(null,null,null) data3
    When using manual tabular forms, the column alias names are irrelevant. But again, I’d recommend using the built-in functionality.
    Regards,
    Marc

  • 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.
    Benz

    I 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
    -------------------------------------------------------------------

  • Manual Tabular form

    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
    phani

    Phani,
    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
    phani

    Hi 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;

  • 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 /&nbsp/ 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

  • Document.getElementById Manual Tabular Form

    Hi,
    I’m working with APEX 4.1 and a manual tabular form.
    I have a page level validation process that fires and ensures that the value in column 1 does not match the value in column 6. When it does it pops up an error message along the lines of: The project MY PROJECT (Row2) cannot be a default of itself.
    That all works as it should but the bit I cannot figure out how to do is a background colour change in either the column 1 field of the invalid row or the entire invalid row.
    The code (function returning and error) I’m using is:
    DECLARE
    l_error VARCHAR2 (4000);
    BEGIN
    FOR i IN 1 .. apex_application.g_f49.count
    LOOP
    IF apex_application.g_f01(i) = NVL (apex_application.g_f06(i), -1)
    THEN
    l_error := l_error
    || CASE
    WHEN l_error IS NULL
    THEN NULL
    ELSE '
    END
    || ' The project '
    -- Project name
    || apex_application.g_f02(i)
    || ' '
    -- I believe it is this bit that is wrong
    || '<a onclick="document.getElementById('''
    || 'f02_'
    || LPAD (i, 4, '0')
    || ''').style.background =''#FCCFCC'';'
    || '$f_First_field('''
    || 'f02_'
    || LPAD (i, 4, '0')
    || ''')'
    || '" href="#"'
    || '>'*/
    -- Get the row
    || '(Row ' || i || ')'
    || '</a>'
    || ' cannot be it''s own default. '
    END IF;
    END LOOP;
    RETURN LTRIM (l_error, '</br>');
    END;
    Would someone be so kind as to point out the error of my ways?
    Many thanks for your time,
    Danny
    Edited by: DannyC on Oct 14, 2011 1:29 AM

    Hi Sanjay,
    Change the Report Column display type to Standard Report Column.
    Cheers

  • Tabular form - Multi row delete error

    Apex 4.0.2
    We have a simple CRUD type of application on a bunch of tables built using Apex v1.6 that has, over the years, been upgraded to v4.0.2 and it is working mostly fine. It uses all out-of-the-box standard components, forms, classic reports, nothing too fancy. Recently one of the tabular forms started to misbehave, the multi-row-delete process raises a No Data Found error. The tabular form is based on a view with a INSTEAD OF trigger to handle the DML. Manually deleting the row in SQL*Plus works fine delete from mytab here pk_id = :pk_id but selecting the same row in Apex and clicking Delete raises the error.
    How does one go about troubleshooting & fixing this sort of thing? I tried re-saving the region in the Builder, exporting/importing the entire app, nothing. Running in Debug mode doesn't really provide any additional information, just that the MRD process failed. Tabular forms are the most frustrating, opaque component in Apex, wish they were easier to troubleshoot.
    Any ideas?

    Hello Vikas,
    >> How does one go about troubleshooting & fixing this sort of thing?
    By given us a bit more information :)
    • Is it a manual Tabular Form (using the ITEM API) or a wizard created one?
    • Are the Insert/Update operations work correctly? If not, what is the type of your PK column(s)?
    • If the problem is limited to the Delete operation, maybe the problem lies with the checkbox column. Are you sure that on page it is rendered as the f01 column?
    • As triggers are involved, can you save the PK that the trigger sees? Is it the expected value?
    • Are there any other processes that are fired before the DML process? If so, maybe the problem is with them. You can temporarily disable them and see if it change anything.
    >> Tabular forms are the most frustrating, opaque component in Apex, wish they were easier to troubleshoot
    Yes, I agree. However, I believe that 4.1 made some serious advancement where Tabular Form is concerned. Having simplified Tabular Form related Validations and Process should make things easier, and as a result, prone to less errors. Still, the main problem is that the type of error you are talking about is usually the result of metadata problems and these are indeed very hard to track.
    Regards,
    Arie.
    &diams; Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.
    &diams; Author of Oracle Application Express 3.2 – The Essentials and More

  • Two Manual Tabular forms in a same page

    Since i have to create two tabular forms in a same page, i created tabular forms manually.
    Both the forms are working fine if the columns are not defined as conditional display.
    Based on item value set by user, few fields should be either displayed as text field (editable) or read only (display).
    I created two columns for a same field one as editable another one as non editable.
    Based on item value any one of the column will be displayed.
    Since the manual tabular form update process is using 'apex_application.g_f02', if any one of the column is not visible,
    multiple row update is failing.
    can any one please help me or suggest me to solve this.
    Edited by: Ravi on Apr 19, 2012 9:02 AM

    I'm guessing you have a page item that is used to control display of the columns as display only or editable.
    If that's true and the page item tells you to display the editable column, then you end up with say a g_f02 and a g_fo3, where you otherwise might only have a g_fo2.
    Use the value of the page item in your update process to control which tabular form element to use.

Maybe you are looking for

  • SGD Exchange Rate Difference JE appears in Customer Aging Report

    Dear Experts, SAP Version: 8.81 Local Currency: SGD We perform Exchange Rate Difference for a USD BP to calculate the unrealized gain/loss during month-end, JE created successfully. Next, we go to Customer Aging Report and select this USD BP. When i

  • No bootable disk windows 8 boot up error

    i installed windows 8 on my mac and it runs fine, but when i go to boot it says there is not a bootable drive, and to insert a bootabe cd/dvd and when i put in my windows install disk it boots right up fine, im not sure what the problem is

  • Connecting to smb servers

    Will Yosemite address the Mavericks problem in connecting to smb servers?

  • Wrong timezone when importing invitation ics from Lotus Notes

    Dear all, I have the problem that the timezone is not correctly detected when importing invitations from  Lotus Notes (PRODID:-//Lotus Development Corporation//NONSGML Notes 8.5.2//EN_C) The event is one hour too late, I cal thinks it is "standard ti

  • Managing Content in CRM

    Hi , i am a Basis person. one of our CRM guys came to me and asked me to redirect a document attachment out of the Database. reason being that the size of the document is so large that if we start saving it in the DB, the DB will grow to a unmanageab