Building a Tabular Form Manually - More then 50 entries in a Selectlist

Hi 2 all!
I discovered a problem by creating a tabular form manually using this tutorial:
http://www.oracle.com/technology/products/database/application_express/howtos/tabular_form.html#MANUAL
When i use the apex_item.select_list_from_query function, my SQL Query returns more than fifty rows and this results in an oracle error.
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
Does anyone know how to display more than 50 entries in such a selection list?
Best regards,
Mike
Message was edited by:
ups_mike

F01 - F50 refers to the editable columns you can have in a tabular form. It's not related to how many options you can have in a select list. So you can have a mix of text fields, select lists, date fields, etc in each row, up to 50 items / fields per row. All of this is subject to the 32000 character limit for each row though.
Regards,
Marc

Similar Messages

  • Building a Tabular Form Manually

    Hi all,
    My Problem:
    1: created a sql report with the following query:
    SELECT
    HTMLDB_ITEM.HIDDEN(1,id) id,
    HTMLDBCHECK,
    HTMLDB_ITEM.SELECT_LIST_FROM_LOV(3,lademittel,'PACKAGING','NO','NO')"Lademittel",
    HTMLDB_ITEM.text(5,anzahl,5) Anzahl,
    HTMLDB_ITEM.TEXT(6,INHALT,10) Inhalt,
    HTMLDB_ITEM.TEXT(7,NETTO,5) Netto,
    HTMLDB_ITEM.TEXT(8,BRUTTO,5) Brutto,
    HTMLDB_ITEM.TEXT(9,FRACHTPFL,5) Frachtpfl,
    HTMLDB_ITEM.TEXT(10,LADEMETER,5) Lademeter,
    HTMLDB_ITEM.TEXT(11,VOLUMEN,5) Volumen,
    HTMLDB_ITEM.TEXT(12,LIEFERSCHEIN,10) Lieferschein,
    HTMLDB_ITEM.TEXT(13,ZEICHEN,10) Zeichen,
    HTMLDB_ITEM.TEXT(14,WARENWERT,5) Warenwert,
    HTMLDB_ITEM.SELECT_LIST_FROM_LOV(15,Gefgut_Klasse,'DANGEROUSMEDIUMCLASSES','NO','NO')"Gef-Klasse",
    SDGNUMMER,
    BENUTZER,
    HTMLDB_ITEM.CHECKBOX(40,HTMLDBCHECK) " "
    FROM TBPOSITIONENQUEUE WHERE BENUTZER = :F100_USERID ORDER BY ID
    I furthermore changed the report to sql query updateable report.
    2: created a process to insert a new row:
    INSERT INTO TBPOSITIONENQUEUE (LADEMITTEL, GEFGUT_KLASSE, BENUTZER) VALUES (0,0, :F100_USERID);
    2: created a process to delete selected rows:
    BEGIN
    FOR I IN 1..HTMLDB_APPLICATION.G_F40.COUNT
    LOOP
    DELETE FROM TBPOSITIONENQUEUE
    WHERE HTMLDBCHECK = HTMLDB_APPLICATION.G_F40(i) AND BENUTZER =
    :F100_USERID;
    END LOOP;
    END;
    3: created a process to update ALL rows (NOT only selected rows ):
    for i in 1..htmldb_application.g_f01.count
    loop
    update tbpositionenqueue
    set --lademittel = htmldb_application.g_f03(i),
    anzahl = htmldb_application.g_f05(i),
    inhalt = htmldb_application.g_f06(i),
    netto = htmldb_application.g_f07(i),
    brutto = htmldb_application.g_f08(i),
    frachtpfl = htmldb_application.g_f09(i),
    lademeter = htmldb_application.g_f10(i),
    volumen = htmldb_application.g_f11(i),
    lieferschein = htmldb_application.g_f12(i),
    zeichen = htmldb_application.g_f13(i),
    warenwert = htmldb_application.g_f14(i)
    --gefgut_klasse = htmldb_application.g_f15(i)
    where id = htmldb_application.g_f01(i);
    end loop;
    Deleting and adding rows is working so far but if I want to update a row the error "ORA-01722 invalid number" is raised. I think the error appeared because the where condition in the update statement was not given the expected primary key value back. Instead the return value was either nothing or just one primary key. (I tested it with another process and the same loop returning the value to a diplay only item)
    So I think my loop is referencing the wrong rows... I guess because of the check box and so the g_f01 array is referencing only selected rows... but I want to keep the query as it is WITH the checkboxes...
    Anybody who can help me on this?
    Thanks in advance
    Markus

    Arie,
    the columns in the table are all varchar2 types - besides id and some other columns that needs to be numeric because of a LOV - because I have to check the submitted values later on in a validation. If the users enters a string value into for example column 'brutto' there should be no problem. (Allthough there should be of course only a numeric value in this column but I wanted another error message than the standard unattractive and brutal one ;-)
    Anotherthing thing: I changed my code to the following:
    update tbpositionenqueue
    set --lademittel = htmldb_application.g_f03(i),
    anzahl = htmldb_application.g_f05(2),
    inhalt = htmldb_application.g_f06(2),
    netto = htmldb_application.g_f07(2),
    brutto = htmldb_application.g_f08(2),
    frachtpfl = htmldb_application.g_f09(2),
    lademeter = htmldb_application.g_f10(2),
    volumen = htmldb_application.g_f11(2),
    lieferschein = htmldb_application.g_f12(2),
    zeichen = htmldb_application.g_f13(2),
    warenwert = htmldb_application.g_f14(2)
    --gefgut_klasse = htmldb_application.g_f15(i)
    where id = 126
    126 is the primary key value of one row. With this values the (single) row is updated without any problems.
    Message was edited by:
    Markus

  • Learning to build tabular form manually

    Hi,
    I am attempting to understand how to build a tabular form manually. I have gone through the Oracle How To document ...
    http://www.oracle.com/technology/products/database/application_express/howtos/tabular_form.html
    and then I found another example at
    http://www.devshed.com/c/a/Oracle/Adding-Processes-to-HTML-DB-Applications/2/
    I have gotten the query below to work up to a point, when I uncomment the line that is commented I get the following error ...
    1 error has occurred
    Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the ''generic columns'' checkbox below the region source to proceed without parsing. ORA-00904: "TEMP": invalid identifier
    Can anyone tell me what the problem is.
    This is the query ...
    SELECT empno
          , APEX_ITEM.HIDDEN(1,empno)
          , APEX_ITEM.TEXT(2,ename,10,10) ename
          , APEX_ITEM.TEXT(3,job,9,9) position
          , APEX_ITEM.SELECT_LIST_FROM_LOV(9,mgr,'managers',NULL, 'NO') mgr
          , APEX_ITEM.DATE_POPUP(4,rownum,hiredate,'Month dd, yyyy') hd
          , APEX_ITEM.TEXT(5,sal,12) sal
          , APEX_ITEM.TEXT(6,comm,12) comm
          , APEX_ITEM.SELECT_LIST_FROM_QUERY(7,deptno,'SELECT deptno d , empno r FROM emp WHERE deptno > 0 ORDER BY 1') deptno  
          --, APEX_ITEM.CHECKBOX(8,empno,DECODE(temp,'Y','CHECKED',NULL)) temp
       FROM emp
    ORDER BY 1Thank You
    Ben

    Thank You,
    I thought if someone used the emp table as an example they wouldnt change its structure. Makes it very confusing.
    Ben

  • How to build a tabular form with a by the user insertable primary key

    I have build a build a tabular form with the wizzard. Wat should I do to make the primary key insertable by the user.
    When I change the PK from 'hidden' to 'text field', I get a checksum error when i am trying to insert.

    Fred: When you use the tabular form wizard, notice the help text on the right hand side of each page. The help page where you define the type of primary key (Existing trigger, PL/SQL function, existing sequence) clearly states
    Tabular forms do not support user entered primary key values
    Makes sense when you think about it. The MRU process needs to determine whether to update a record or insert a new record. It does that by comparing the checksums (and/or) pk values from when the page was first rendered and then when you make changes and submit it. Newly inserted rows will have a blank PK/checksum.
    If you allow user to change the PK, how will the system know which rows are new and which ones are old?
    For example, lets say you have
    create table t
    pk int primary key,
    data varchar2(10)
    )You have 2 rows
    1 red
    2 yellow
    If the PK were to be editable, user could go in and change the above to
    2 red
    1 yellow
    Now what? Would you like the system to create a new row with 1/yellow or change the existing pk=1 row to yellow? Same with the other row.
    Bottom line: The built-in processes dont support this. You can always write your own manual tabular form and implement whatever you logic you wish in your After Submit processes.
    Hope this helps.

  • Creating a complex tabular form manually

    Hi,
    I am trying to create a tabular form manually. The tabular form consists of
    rows , with each row containing
    1. Select List (of employee names)
    2. JOB (Text box)
    3. Salary (text box)
    I have a add button to add a row, a row similar in appearance to the above, i.e it consists of a select list of "employee names", "job" text box and "salary" text box.
    I should to be able to specify the id for these items in each row that I add, I need to specify id for each item in each row that I add since, there is a lov image attached to each row, that would capture any data entered by the user in that row and take him to a popup page with the values specified in the main page.
    Can anyone tell me how to specify id to the items I add (i.e when I create a new row).I also dont find any id created to the items in the form that I have created manually. Please note i am using the APEX_ITEM package to create the tabular form manually.

    Hi Andy,
    I would like to explain what I have done and kindly let me know if this is right.
    I created a tabular multirow form using APEX built in component, since I wanted to add validations and I could not get a handle to UpdateMRU, I decided to create the tabular multirow forms manually using the example on the APEX howtos link.
    I find that the multirow form which i created manually does not have any id associated with the items.
    1. Please let me know if I need to add validations is there only one way i.e to create the multi row tabular form manually?
    2.How do I specify the ids for each item. The APEX_ITEM APIs dont provide any way to add ids to items?
    3.Is it possible to add validations to the multi row form generated using APEX wizard?In the sense , for eg, I have the employee table presented as multi row table, when a user adds a new row or modifies an existing row, he should not be allowed to add an employee with the same name, Now where do I do this valiation and how can I show the error against that row?
    4. What I need to do further is. I have an image on each row (akin to a button) that would spring up a popup page with search options , so that I can repopulate values back into the parent page, to do this I need to pass the ids of the ITEMS to and fro from the parent to the child and back.
    I would like to understand how to approach the above issues.
    Would appreciate if you could let me know on the same.
    Thanks.

  • Add row not working when creating tabular form manually

    Hi friends,
    I am trying to create a manual tabular form( with the help of Denes's example). When adding a new row by clicking
    the add button new row is added and i can enter data in that row. This works fine when there is only one page.
    Now i have 30 rows in 2 pages. Now when i tried to add a new row by pressing the add button nothing is happening.
    In my add button i have given redirect to the same page and request as ADD and the report query is as below.
    SELECT apex_item.checkbox (1,
                               EQUIPMENT_ID,
                               'onclick="highlight_row(this,' || ROWNUM || ')"',
                               NULL,
                               'f01_' || LPAD (ROWNUM, 4, '0')
                              )Tick,
       EQUIPMENT_ID,
              apex_item.hidden (2,EQUIPMENT_ID)
    ||apex_item.text (3,
                              EQUIPMENT_ROLE,
                              80,
                              100,
                              'style="width:170px"',
                              'f03_' || LPAD (ROWNUM, 4, '0')
                             )|| apex_item.hidden (4, wwv_flow_item.md5(EQUIPMENT_ID,EQUIPMENT_ROLE,EQUIPMENT_VERSION,                       
                             SNMP_PORT,RO_COMMUNITY_STRING ,RW_COMMUNITY_STRING,COMMISIONED_STATE,CUSTOMER_ID,
                             SITE_ID
                             ))EQUIPMENT_ROLE,
    apex_item.text (5,
                             EQUIPMENT_VERSION,
                              80,
                              100,
                              'style="width:170px"',
                              'f05_' || LPAD (ROWNUM, 4, '0')
                             ) EQUIPMENT_VERSION,
    apex_item.text (6,
                             SNMP_PORT,
                              80,
                              100,
                              'style="width:170px"',
                              'f06_' || LPAD (ROWNUM, 4, '0')
                             ) SNMP_PORT,
    apex_item.text (7,
                             RO_COMMUNITY_STRING,
                              80,
                              100,
                              'style="width:170px"',
                              'f07_' || LPAD (ROWNUM, 4, '0')
                             ) RO_COMMUNITY_STRING,
    apex_item.text (8,
                             RW_COMMUNITY_STRING,
                              80,
                              100,
                              'style="width:170px" ',
                              'f08_' || LPAD (ROWNUM, 4, '0')
                             ) RW_COMMUNITY_STRING,
    apex_item.text (9,
                             COMMISIONED_STATE,
                              80,
                              100,
                              'style="width:170px" ',
                              'f09_' || LPAD (ROWNUM, 4, '0')
                             ) COMMISIONED_STATE,
    apex_item.text (10,
                             CUSTOMER_ID,
                              80,
                              100,
                              'style="width:170px" ',
                              'f10_' || LPAD (ROWNUM, 4, '0')
                             ) CUSTOMER_ID,
    apex_item.text (11,
                             SITE_ID,
                              80,
                              100,
                              'style="width:170px"',
                              'f11_' || LPAD (ROWNUM, 4, '0')
                             ) SITE_ID
          FROM EQUIPMENTS_FEAT_MVIEW
          UNION ALL
          SELECT     apex_item.checkbox
                                    (1,
                                     NULL,
                                     'onclick="highlight_row(this,' || ROWNUM || ')"',
                                     NULL,
                                     'f1_' || LPAD (9900 + LEVEL, 4, '0')
                                    ) delete_checkbox,
                     NULL,
                        apex_item.hidden (2, NULL)
                     ||apex_item.text (3,
                                        NULL,
                                        80,
                                        100,
                                        'style="width:170px"',
                                        'f3_' || LPAD (9900 + LEVEL, 4, '0')
                                 ) || apex_item.hidden (4, NULL)EQUIPMENT_ROLE ,
                      apex_item.text (5,
                                 NULL,
                                 80,
                                 100,
                                 'style="width:170px"',
                                 'f05_' || LPAD (9900 + LEVEL, 4, '0')
                                 )EQUIPMENT_VERSION,
                      apex_item.text (6,
                                  NULL,
                                  80,
                                  100,
                                  'style="width:170px"',
                                  'f06_' || LPAD (9900 + LEVEL, 4, '0')
                                 )SNMP_PORT,
                     apex_item.text (7,
                                NULL,
                               80,
                                100,
                                'style="width:170px"',
                               'f07_' || LPAD (9900 + LEVEL, 4, '0')
                                 ) RO_COMMUNITY_STRING,
                      apex_item.text (8,
                                  NULL,
                                  80,
                                  100,
                                  'style="width:170px"',
                                  'f08_' || LPAD (9900 + LEVEL, 4, '0')
                                 )RW_COMMUNITY_STRING,
                     apex_item.text (9,
                                  NULL,
                                  80,
                                  100,
                                  'style="width:170px"',
                                  'f09_' || LPAD (9900 + LEVEL, 4, '0')
                                 )COMMISIONED_STATE,
                       apex_item.text (10,
                                  NULL,
                                  80,
                                  100,
                                  'style="width:170px"',
                                  'f10_' || LPAD (9900 + LEVEL, 4, '0')
                                 )CUSTOMER_ID,         
                     apex_item.text (11,
                                  NULL,
                                  80,
                                  100,
                                  'style="width:170px"',
                                  'f11_' || LPAD (9900 + LEVEL, 4, '0')
                                 )SITE_ID
                         FROM DUAL
                        WHERE :request = 'ADD'
    CONNECT BY LEVEL <= 1How can i solve this problem . Please help,
    Thanks,
    Jeev

    Hi,
    The blank row that you get from your second select statement would appear at the end of the report. Put that statement first and it should be at the top of the first page
    Andy

  • Validation of tabular form clears all the entries in that form

    Hi all,
    I have master-details form, where I have created details using Apex collections. Now I added validations on that detail form and I am getting proper validation message, but the form itself clears the data for that record if it is the new record. Is there a way to do validation and keeps the data without clearing the form? Thanks.
    SHY

    Hi;
    After countless searches on google, I chanced upon a solution that works for 100% of all cases. it is to define a set focus function:
    function setFocus(cellID) {
    document.getElementById(cellID).focus();
    then call the function after the alert setting a timeout: the function is executed after the cell is exited and this sets focus back to cell.
    myVar = setTimeout("setFocus(vName)",1)
    Works on IE and FF. I found the solution on this page: http://bytes.com/topic/javascript/answers/147801-set-focus-after-showing-alert
    Thank all.

  • How to create a manual tabular form with DELETE capability

    Since the wizard tabular form does not allow the use of checkboxes, I am building my tabular form manually following the HOW-TO document. I will need to be able to delete rows in the form in addition to inserting and updating. Is there a document somewhere that describes how to do this? The how-to doesn't cover it and I have searched the forums to no avail.
    Thanks.
    Darin

    To create dynamic checkbox you can do the following:
    SELECT HTMLDB_ITEM.CHECKBOX(1,"your database field name", 'unchecked or checked') " "
    FROM YOUR_TABLE_NAME OR DUAL;
    ...then...
    In order to extrapolate the checkbox value you use following array:
    htmldb_application.g_f01("subscript value)"
    This array will contain value of checkbox. At this point you can do this:
    if htmldb_application.g_f01("subscript value)" = 'Y'
    THEN
    INSERT DATA...
    DELETE DATA...
    END IF;
    Hope this somewhat helps...
    NOTE: I have entered a lot of pseudo values/code but I believe you can fill in the blanks for what you need.

  • Manual Tabular Form - Items not rendered

    Hi,
    i'm trying to build a manual tabular form:
    I added a blnak page with a Report Region using a SQL Query in a Classic Report:
    select      apex_item.text(1,"EMPNO") as "EMPNO",
    apex_item.text(2,"ENAME") as "ENAME",
    apex_item.text(3,"JOB") as "JOB",
    apex_item.text(4,"MGR") as "MGR",
    apex_item.text(5,"HIREDATE") as "HIREDATE"
    from      "EMP" "EMP"The items are not rendered in the report, but the HTML Text is displayed instead.
    See http://tinypic.com/r/2e6bqdu/5
    I played around with "Display As" in the Column Attributes - no luck.
    I used this links as reference:
    http://apex.oracle.com/pls/otn/f?p=31517:170:2228543603318893:::::
    http://www.oracle.com/technetwork/developer-tools/apex/tabular-form-090805.html (To build a tabular form manually:)
    http://apexjscss.blogspot.com/2010/05/manual-tabular-form.html
    Am i missing something ?
    APEX 4.1 on 11gr2
    regards,
    gw

    The "Display As" for each column should be "Standard Report Column".
    Seems the default "Display as" for standard reports has changed:
    I created your standard report in a 3.2 environment and the report defaulted the "Display As" for each column to "Standard Report Column".
    I created your standard report in my own 4.0 environment and in the hosted apex.oracle.com environment and the report defaulted the "Display As" for each column to "Display as Text (escape special characters, does not save state)"

  • Date popup validation in manual tabular form

    Hey all-
    I'm creating a tabular form manually (i.e., with apex_collection) per instructions at OBE (http://www.oracle.com/technology/products/database/application_express/ppt/odtug2008_marcie_young.pdf). Working fine, except I'm having a problem with apex_item.date_popup.
    One of the fields I need to collect from the tabular form is a date. For the SQL report, the relevant item is apex_item.date_popup(9, null, c008, 'YYYY-MM-DD', 20, 10) (and c008 is the relevant column from the collection). The trouble comes in if a user types a bogus date into the date popup. I have validation code to check this, but before running that code, I have to store the user's new entries into the collection. So basically my steps are:
    1. display the tabular form w/ a SQL report containing apex_item.date_popup
    2. use an update collection PL/SQL process to store the user data into the collection (process point = On Submit and Before Computation)
    3. use a validation PL/SQL process to verify the data in the collection before processing the update
    All that works, and the validation identifies the bad date. But then the page tries to render the tabular form again (so the user can fix the bad date), but the apex_item.date_popup(9, null, c008, 'YYYY-MM-DD', 20, 10) column fails b/c of the bad date. I need a way to programmatically create a date popup and populate it with (potentially) invalid data. Any ideas?
    Thanks
    Rob

    Problem solved. Tossed the lackluster apex_item.date_popup and replaced w/ jQuery datepicker.
    Rob

  • 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

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

  • Manual tabular form "Update Process"

    Hello,
    i made a tabular form manually,
    now i want to add an update process, but its not working?
    I created a Button "P_UPDATE" and i added a Process which listens to the P_UPDATE Button.
    i used the following PL/SQL script:
    for i in 1..htmldb_application.g_f01.count
    loop
    update MATCHUMSATZ
    set PARTNER_ID = replace(htmldb_application.g_f10(i),'%'||'null%',NULL),
    RECH_DATUM = replace(htmldb_application.g_f02(i),'%'||'null%',null),
    RECH_NR= htmldb_application.g_f06(i),
    PROV_GRUNDLAGE= htmldb_application.g_f08(i),
    KUNDE= htmldb_application.g_f14(i),
    VERTRIEBSART_ID = replace(htmldb_application.g_f17(i),'%'||'null%',NULL)
    where id = htmldb_application.g_f01(i);
    end loop;
    This is an example which i customized from: http://www.oracle.com/technology/products/database/application_express/howtos/tabular_form.html
    I suppose that 'htmldb_application.g_f01' is the ID of the table 'MATCHUMSATZ'.
    Why is there replace() and sometimes not ?
    Would be glad if anybody could help me!
    Phil

    Hi Phil,
    You can add in the in-built MRU update process that will do this for you. When you add a process, select Data Manipulation then Multi Row Update, then follow the prompts to link it to your table.
    In your code snippet, htmldb_application.g_f01 refers to the first column in your form (even if this is hidden). Normally this is the Primary Key for the table on which the form is based. htmldb_application.g_f02 refers to the second column and so on, although you can assign any number from 1 to 50 to each field when you create the sql statement.
    The replace() function is used because some of the fields will contain %null% which needs to be converted to null before updating the table.
    Regards
    Andy

  • Manual Tabular Form using checksum

    I have a manual tabular form which updates OK but when I add the htmldb_item.mds_checksum it does not always work. It does not pass the MD5 checksum test in the update process. Sometimes it works some times it does not. No one else is updating this data so it should pass the checksum error.
    I need a manual tabular form so I can to retrieve this same data in a collection if the page is submitted for a cascading dropdown in another region. That is correct?
    Of course, I could do the cascading dropdown another way instead of select list on submit. This is puzzling me.
    Here is the sql query:
    select htmldb_item.hidden(1,sub_id) sub_id,
    htmldb_item.display_and_save(2,column_id) column_id,
    htmldb_item.display_and_save(3,column_name) column_name,
    htmldb_item.display_and_save(4,primary_key) primary_key,
    htmldb_item.display_and_save(5,required) required,
    htmldb_item.select_list(6,isselected,'Yes;Y,No;N') isselected,
    htmldb_item.md5_checksum(isselected) cks
    from sub_columns
    where sub_id = :P26_SUB_ID
    order by 2
    Here is the update process:
    declare
    l_cks wwv_flow_global.vc_arr2;
    j pls_integer := 1;
    begin
    -- Get original MD5 checksum
    select wwv_flow_item.md5(isselected) cks
    BULK COLLECT INTO
    l_cks
    from sub_columns
    where sub_id = :P26_SUB_ID;
    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.');
    end if;
    end loop;
    -- update Subscription
    for i in 1..htmldb_application.g_f01.count
    loop
    update sub_columns
    set isselected = replace(htmldb_application.g_f06(i),'%'||'null%',NULL)
    where sub_id = :P26_SUB_ID and
    column_id = htmldb_application.g_f02(i);
    end loop;
    commit;
    end;
    Any help would be appreciated. I just don't see what I am doing wrong and I don't see any other way to do it.

    I had already read this paper before doing the tabular form manually. I tried to follow it as closely as I could. My tabular form is a little different since I have a where clause in my SQL and only updating one field. The other fields are display_and_save. And I was branching to a different page than the page containing the tabular form. I would think none of these differences should make it not work. I did change to branch to the same page. That made no difference.
    I did not need to do an insert so I skipped doing that step and then went to Adding Optimistic Locking. It is failuring in my update process with this code:
    -- Get original MD5 checksum
    select wwv_flow_item.md5(isselected) cks
    BULK COLLECT INTO
    l_cks
    from sub_columns
    where sub_id = :P26_SUB_ID;
    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.');
    end if;
    end loop;
    I get the Error process message and then the above -20001 error message when I click on the Submit button. Is there something wrong with my above code? I would assume I would need to add the where clause to the above select since I am only updating whose records.
    I had created a submit button with action submit page and redirect to URL. The process executes on the condition when the submit button is pressed.
    I need to get this working soon. I would assume other people have done a similar thing. I have tried many things. Another thing I notice is if I tell it to not display the first column, sub_id, and the last column, cks, (unselecting display in Report Attributes section) then the update does not work. I must be doing something wrong but I don't know what.
    I created the page with component, report, SQL Report, and region type SQL Query.

  • 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

Maybe you are looking for