APEX_ITEM.SELECT_LIST_FROM_QUERY Function

Quotation from online documentation:
The following example demonstrates a select list based on a SQL query.
SELECT APEX_ITEM.SELECT_LIST_FROM_QUERY(3,job,'SELECT DISTINCT job FROM emp') FROM emp
1) it can not compile at all ...
2) inner select does not make sense because as is described few lines above ... it has to return pairs (value,key)
3) I have lost half an hour and this function always returned null...
Have anybody used it at all?
Can you please post some working example?

Hi,
It worked for me but after I made some changes like this:
SELECT APEX_ITEM.SELECT_LIST_FROM_QUERY
(3, job_code,'SELECT DISTINCT job_name, job_code FROM emp') FROM emp.
ApEx help for this function has the following:
SQL query that is expected to select two columns, a display column, and a return column.
For example:
SELECT dname, deptno FROM dept
Note that this is used only by the SELECT_LIST_FROM_QUERY function."
Val

Similar Messages

  • Get value from  APEX_ITEM.SELECT_LIST_FROM_QUERY - column on a report.

    Hello.
    Help. Help. Help.
    I have to get value from APEX_ITEM.SELECT_LIST_FROM_QUERY - column on a report.
    SELECT DISTINCT ROLE AS GET_ROLE,
    JOB AS GET_JOB,
    APEX_ITEM.SELECT_LIST_FROM_QUERY
    ( 1, '%', 'SELECT DISTINCT CODE c,
    MODE m
    FROM T2
    WHERE ROLE = ' || ROLE ) AS GET_CODE
    FROM T1
    WHERE AGE >30 AND
    SEX = 'M' ;
    I was trying to use javascript :
    for (var i = 0; i < selectlist_name.options.length; i++)
    if (selectlist_name.options[ i ].selected)
    result=selectlist_name.options;
    But I don't know is that correct:
    "selectlist_name" - APEX_ITEM.F01
    (of my APEX_ITEM.SELECT_LIST_FROM_QUERY)?

    Just as a note, but you want to make sure your APEX_ITEM call is closed. The code snippet you posted isn't complete.
    APEX_ITEM.SELECT_LIST_FROM_QUERY(6,c020, 'select DISTRIBUTION_NAME, DISTRIBUTION_NAME from DISTRIBUTIONS','style="", SEQ_ID   <-- No closing )In the documentation - http://www.utoug.org/i/doc/api099.htm - (though it isn't necessarily the easiest to read) it gives this explanation of the syntax:
    APEX_ITEM.SELECT_LIST_FROM_QUERY(
    p_idx IN NUMBER,
    p_value IN VARCHAR2 DEFAULT,
    p_query IN VARCHAR2,
    p_attributes IN VARCHAR2 DEFAULT,
    p_show_null IN VARCHAR2 DEFAULT,
    p_null_value IN VARCHAR2 DEFAULT,
    p_null_text IN VARCHAR2 DEFAULT,
    p_item_id IN VARCHAR2 DEFAULT,
    p_item_label IN VARCHAR2 DEFAULT,
    p_show_extra IN VARCHAR2 DEFAULT)
    RETURN VARCHAR2;
    What you want to look at is p_value to set an initial value. It should come from your data, but you could consider doing an NVL or DECODE to substitute your default.
    In this case it would modify your query to be:
    SELECT distinct apex_item.hidden(1, seq_id), c003,c004,c005, c006,
          APEX_ITEM.SELECT_LIST_FROM_QUERY(6,c020, 'select DISTRIBUTION_NAME, DISTRIBUTION_NAME from DISTRIBUTIONS','style=""),
          SEQ_ID
      FROM APEX_collections
    WHERE collection_name = 'ARGYLL_INVOICES'
    order by seq_id If the value is always NULL, you can use the p_show_null, p_null_value, and p_null_text to put in a "default"
    SELECT distinct apex_item.hidden(1, seq_id), c003,c004,c005, c006,
          APEX_ITEM.SELECT_LIST_FROM_QUERY(6,NVL(c020,0), 'select DISTRIBUTION_NAME, DISTRIBUTION_NAME from DISTRIBUTIONS','style="",YES, 100, 'Default'),
          SEQ_ID
      FROM APEX_collections
    WHERE collection_name = 'ARGYLL_INVOICES'
    order by seq_id

  • Select_list_from_query function null value

    How does one remove the null value when using the select_list_query function?
    So if I have the following:
    SELECT HTMLDB_ITEM.SELECT_LIST_FROM_QUERY(3,id,'SELECT id FROM emp')
    FROM emp
    It currently adds the extra null '%' value.
    Where would I plug in the p_show_null value in the function or is this not possible?

    Thanks for the help. I found out it was the positioning of the NO parameter value.
    If I simply added one 'NO' after the query, it would not recognize it but when I added 2 'NO' 's as displayed below then it removed the null value.
    SELECT HTMLDB_ITEM.SELECT_LIST_FROM_QUERY(3,id,'SELECT id FROM emp', 'NO', 'NO')
    FROM emp
    Thanks again.

  • Setting current values in Multiple Select List in SQL Query based Report

    Hi,
    I have a report based on a sql query that contains a multiple select list. Unfortunately I cannot get the multiple select list to display the current values (p_value) correctly. I have created a page item, :p311_current_versions, that is set using a pre-header process and it returns a value with a colon delimited format e.g. '10.1.2.1.0:10.1.2.2.0'. Then this item is used in the sql query to set the current value (p_value) of the apex_item.select_list_from_query function. However when the table is displayed, instead of having two entries, 10.1.2.1.0 and 10.1.2.2.0 selected, it has an extra entry '10.1.2.1.0:10.1.2.2.0' selected.
    Here is my code:
    select distinct a.product, a.version from (
    select distinct
    apex_item.display_and_save(2,product)||apex_item.hidden(1,env_product_id) PRODUCT,
    APEX_ITEM.SELECT_LIST_FROM_QUERY(3,decode(product, 'HTTP Server' , :p311_current_versions, version), 'SELECT distinct version d, version r FROM ebs_tech_stack where
    product ='''||PRODUCT||'''',
    decode(PRODUCT, 'HTTP Server' ,'multiple="multiple" style="width:170px"','style="width:170px"'),
    'NO') as version
    from ebs_environment_tech_stack
    where environment_id = :p311_umgebung_id) a order by a.product
    If anyone can help me figure out how to set the current values correctly I'd be really grateful!!
    Thanks in advance,
    Jean

    Jean,
    I don't think this is possible using the apex_item package. The select_list_from_query function accepts only a single value for the second parameter.
    Scott

  • PL/SQL select list from query

    Hello,
    I am trying to modifying a PL/SQL process. Wherever there was a reference to the Application ID, I wanted to change it to refer to the Application Alias.
    Here is the original code:
    declare
       cursor app_cur is
          select aa.application_id||' - '||aa.application_name app_name,
                 aa.application_id
            from apex_applications aa
           where exists (select 1
                           from profiles p
                          where p.application_id = aa.application_id);
       cursor user_app_cur (p_user number, p_app number) is
          select to_char(profile_id)
            from user_app_profiles
           where user_id = p_user
             and application_id = p_app;
       v_profile   varchar2(10);
       v_count     number := 0;
       v_class     varchar2(15);
    begin
       htp.p('<table class="t3standardalternatingrowcolors" cellpadding="0" cellspacing="0">');
       htp.p('<tr><th class="t3header" >Application</th><th class="t3header" >Profile</th></tr>');
       for app in app_cur loop
          v_count := v_count + 1;
          if mod(v_count,2) = 1 then
             v_class := 't3dataalt';
          else
             v_class := 't3data';
          end if;
          open  user_app_cur(:P3_USER_ID, app.application_id);
          fetch user_app_cur
           into v_profile;
          if user_app_cur%notfound then
             v_profile := 'NONE';
          end if;
          close user_app_cur;
          htp.p('<tr><td class="'||v_class||'">'||app.app_name||
                '</td><td class="'||v_class||'">'||
                apex_item.select_list_from_query(40, v_profile,
                  'select description, profile_id from profiles where application_id = '||app.application_id,
               null, 'YES', 'NONE', 'No Profile Assigned', null, null, 'NO')||
                apex_item.hidden(41,app.application_id) ||
              '</td></tr>');
       end loop;
       htp.p('</table>');
    end;Here is my revised code:
    declare
       cursor app_cur is
          select aa.alias||' - '||aa.application_name app_name,
                 aa.alias
            from apex_applications aa
           where exists (select 1
                           from profiles p
                          where p.application_alias = aa.alias);
       cursor user_app_cur (p_user number, p_app varchar2) is
          select to_char(profile_id)
            from user_app_profiles
           where user_id = p_user
             and application_alias = p_app;
       v_profile   varchar2(10);
       v_count     number := 0;
       v_class     varchar2(15);
    begin
       htp.p('<table class="t3standardalternatingrowcolors" cellpadding="0" cellspacing="0">');
       htp.p('<tr><th class="t3header" >Application</th><th class="t3header" >Profile</th></tr>');
       for app in app_cur loop
          v_count := v_count + 1;
          if mod(v_count,2) = 1 then
             v_class := 't3dataalt';
          else
             v_class := 't3data';
          end if;
          open  user_app_cur(:P3_USER_ID, app.alias);
          fetch user_app_cur
           into v_profile;
          if user_app_cur%notfound then
             v_profile := 'NONE';
          end if;
          close user_app_cur;
          htp.p('<tr><td class="'||v_class||'">'||app.app_name||
                '</td><td class="'||v_class||'">'||
                apex_item.select_list_from_query(40, v_profile,
                  'select description, profile_id from profiles where application_alias = '||app.alias,
               null, 'YES', 'NONE', 'No Profile Assigned', null, null, 'NO')||
                apex_item.hidden(41,app.alias) ||
              '</td></tr>');
       end loop;
       htp.p('</table>');
    end;Here is the error:
    ORA-06550: line 1, column 153: PL/SQL: ORA-00904: "F109NEWNAME": invalid identifier ORA-06550: line 1, column 7: PL/SQL: SQL Statement ignored
    I think that the problem is in the table/LOV generation near the end, but I don't fully understand the apex_item.select_list_from_query function as it is written (I didn't write it).
    Any help is greatly appreciated.
    Thanks,
    Matt

    Hi Matt,
    This line:
    'select description, profile_id from profiles where application_alias = '||app.aliaswould become:
    select description, profile_id from profiles where application_alias = F109NEWNAMEif F109NEWNAME was the app_alias. SQL would see F109NEWNAME as a variable as it is not in quotes. Therefore, you should change the line to:
    'select description, profile_id from profiles where application_alias = ''' || app.alias || ''''to end up with:
    select description, profile_id from profiles where application_alias = 'F109NEWNAME'which would make more sense
    Andy

  • 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

  • Error (ORA-01403) saveing data form a report with apex_item items

    Hi all,
    I've a problem saveing data that's inserted into a report which I created using apex_item items. Reproducing the exact issue on apex.oracle.com will take me a lot of time, and I don't know if I really can reproduce this matter... So I hope I can explain my problem clearly enough, here...
    The global story of the application is that its an application used for measureing objects. For these objects there are templates, with default properties. When measureing an object, the user must fill in those properties for the object. The report is build dynamicly, becouse each object has different properties and each property could be of an other kind (number, text, list, counter [=number field with add and substract buttons], and date). Depending on the type of the property, the report has to show an other item to fill.
    The query for constructing this report is like this:
    select defprop.proptyp_id,
    apex_item.hidden(41,defprop.id) defprop_id,
    defprop.nam,
    decode(proptyp.id,
                    1, apex_item.text(p_idx=>42,p_value=>''||
                        decode(defprop.srt, 'CONSTANT', (select WRD
                                                                            from    measurement_prop
                                                                            where    defprop_ID = defprop.id
                                                                            AND        measurement_id IN
                                                                                (SELECT ID
                                                                                FROM measurement
                                                                                WHERE OBJ_ID = obj.id
                                                                                AND DAT IN
                                                                                    (SELECT latest_date
                                                                                    from object_instance
                                                                                    WHERE ID = obj.id)))
                     ||'' ,p_attributes=>'class=case5_num'),
                    2, apex_item.text(p_idx=>42,p_value=>''||
                        decode(defprop.srt, 'CONSTANT', (select WRD
                                                                            from    measurement_prop
                                                                            where    defprop_ID = defprop.id
                                                                            AND        measurement_id IN
                                                                                (SELECT ID
                                                                                FROM measurement
                                                                                WHERE OBJ_ID = obj.id
                                                                                AND DAT IN
                                                                                    (SELECT latest_date
                                                                                    from object_instance
                                                                                    WHERE ID = obj.id)))
                     ||''),
                    3, apex_item.select_list_from_query(p_idx=>42,p_value=>''||
                        decode(defprop.srt, 'CONSTANT', (select WRD
                                                                            from    measurement_prop
                                                                            where    defprop_ID = defprop.id
                                                                            AND        measurement_id IN
                                                                                (SELECT ID
                                                                                FROM measurement
                                                                                WHERE OBJ_ID = obj.id
                                                                                AND DAT IN
                                                                                    (SELECT latest_date
                                                                                    from object_instance
                                                                                    WHERE ID = obj.id)))
                     ||'', p_query=> 'select wrd, id from property_typewrd where proptyp_id = ' || proptyp.id ||' order by vlgnum', p_show_null=> 'NO'),
                    4, apex_item.text(p_idx=>42,p_value=>''||
                        decode(defprop.srt, 'CONSTANT', (select WRD
                                                                            from    measurement_prop
                                                                            where    defprop_ID = defprop.id
                                                                            AND        measurement_id IN
                                                                                (SELECT ID
                                                                                FROM measurement
                                                                                WHERE OBJ_ID = obj.id
                                                                                AND DAT IN
                                                                                    (SELECT latest_date
                                                                                    from object_instance
                                                                                    WHERE ID = obj.id)))
                     ||'',p_attributes=>'class=case5_num')
                    || '<a name="add_f02" href="#"><img alt="add" src="#WORKSPACE_IMAGES#plusBig.gif"/></a>    '
                    || '<a name="sub_f02" href="#"><img alt="sub" src="#WORKSPACE_IMAGES#minusBig.gif"/></a>',
                    5, apex_item.date_popup(p_idx=>42, p_value=>''||
                        decode(defprop.srt, 'CONSTANT', (select WRD
                                                                            from    measurement_prop
                                                                            where    defprop_ID = defprop.id
                                                                            AND        measurement_id IN
                                                                                (SELECT ID
                                                                                FROM measurement
                                                                                WHERE OBJ_ID = obj.id
                                                                                AND DAT IN
                                                                                    (SELECT latest_date
                                                                                    from object_instance
                                                                                    WHERE ID = obj.id)))
                     ||''),
                    oms
                ) waarde
    from default_property defprop,
    object_instance obj,
    property_type proptyp
    where defprop.stdobjver_id = obj.stdobjver_id
    and defprop.proptyp_id = proptyp.id
    and obj.id = :P2200_ID_INVThis report works fine. Depending on the type of the property it shows a numberic field, text field, selectlist (with right values), counter field or date field.
    If the default property is set to a 'CONSTANT' value, the last known value is filled in.
    With a javascript I check the numberic field value and achieve the counterfield to add or substract values when 'plus' or 'minus' is clicked.
    This javascript is placed in the field 'Execute when Page Loads' in the page properties in APEX. Here is the code:
    /*Execute when page loads*/
    /*Allow only numbers */
    number_elem = $('input[name=f42].case5_num');
    number_elem.keypress(function(event) {
      if (event.which && (event.which < 46 || event.which > 57 || event.which == 47) && event.keyCode != 8) {
          event.preventDefault();
      if (event.which == 46 && $(this).val().indexOf('.') != -1) {
          event.preventDefault();
    //for mouse events, remove any non numeric characters
    number_elem.bind('mouseup mousedown mouseleave', function(event) {
       this.value = this.value.replace(/[^0-9]/g, '');
    /* Subtract Button */
    $('a[name="sub_f42"]').click( function() {
      number_elem = $(this).siblings('input[name=f42].case5_num');
      currVal = number_elem.val();
    if ( isNaN( currVal) ){
       elemVal = 0;
    else {
       elemVal = Number(currVal);
    if (elemVal > 0)
         number_elem.val(elemVal-1);
    else
    { elemVal = 0; }
    /* Add Button */
    $('a[name="add_f02"]').click( function() {
      number_elem = $(this).siblings('input[name=f42].case5_num');
      currVal = number_elem.val();
    if ( isNaN( currVal) ){
       elemVal = 0;
    else {
       elemVal = Number(currVal);
    number_elem.val(elemVal+1);
    });Those two codes makes my report works fine. So far I'm happy. But now I want the data, which the user fills in the items, to be saved.
    So I created a process that should do this for me (it wil run after the user hits a button), here is the code:
    declare
         v_objmet_id number := 0;     
    begin
         select measurment_seq.nextval
         into v_objmet_id
         from dual;
         insert into measurment
         ( id
         , obj_id
         , dat
         values
         ( v_objmet_id
         , :P2200_ID_INV
         , :P2200_METDAT_INV
         /*Loop trough the values (g_f42 holds the value of the property)*/     
         for i in 1 .. apex_application.g_f42.count loop
              /*g_f41 holds the key to the default property*/
              if apex_application.g_f41(i) is not null and
                   apex_application.g_f41(i) > 0 then
                   insert into measurment_prop
                   ( measrument_id
                   , defprop_id
                   , wrd)
                   values
                   ( v_objmet_id
                   , apex_application.g_f41(i)
                   , apex_application.g_f42(i)
              end if;
         end loop;
    end;After running this process, the application branches back to the page, clearing the cache and set some items I use for filtering an other report with their own values.
    Both the process and the branche have a 'when button pressed' condition, where the same button is filled in. The branche fires on submit: after processing.
    When I hit the button to save the data, I get an error: ORA-01403: no data found
    In the debug info I can find there is encountered an unhandeled exception in the process, but I don't know what's going wrong...
    I thought it could be something with the date field, I want to save, so I put it in a to_date() with the right format, but I still got the error...
    I've also checked if the query which fetches the nextval of the sequence is correct, and it is, no typeing error in the sequence name, or something.
    I'm using APEX 4.0.2
    Edited by: Mir on 28-jun-2011 10:25
    Changed some code of the javascript, it directed to the wrong item ID, now its correct

    My problem is solved. The error occured when application item g_f41 was accessed, so my application couldn't find the data, the user putted in there. I now pasted this part of the sql, to the other apex_item field, so it became one field and now it works correctly:
    select [...]
    apex_item.hidden(41,defprop.id) ||
    decode(proptyp.id,
                    1, apex_item.text(p_idx=>42,p_value=>''||
                        decode(defprop.srt, 'CONSTANT', (select WRD
                                                                            from    measurement_prop
                                                                            where    defprop_ID = defprop.id
                                                                            AND        measurement_id IN
                                                                                (SELECT ID
                                                                                FROM measurement
                                                                                WHERE OBJ_ID = obj.id
                                                                                AND DAT IN
                                                                                    (SELECT latest_date
                                                                                    from object_instance
                                                                                    WHERE ID = obj.id)))
    [... etc ...]

  • Apex_item.date_popup giving ORA-01403: no data found

    Hi,
    I'm having a problem with apex_item.date_popup(). We're using apex 4.0.2.
    The apex_item.text and apex_item.select_list_from_query are working fine.
    I have a table "dba_comp_veld". Querying this table it gives:
    select COMP_VELD_ID, COMP_VELD_NAAM, COMP_VELD_TYPE, COMP_VELD_TYPE_POPUP, COMP_VELD_TYPE_DATE from dba_comp_veld where comp_id = 81;
    COMP_VELD_ID COMP_VELD_NAAM COMP_VELD_TYPE COMP_VELD_TYPE_DATE
    81 SID T
    82 Poort T
    85 Owner T
    83 Server P
    84 Alias T
    86 Rdbms T
    101 Datum D 20-APR-11
    So, when the COMP_VELD_TYPE = D then I want to user apex_item.date_popup.
    In the page-region (PL/SQL) the source is:
    declare
    nServer number;
    BEGIN
    select min(server_nummer) into nServer from dba_servers;
    for rec in (select COMP_VELD_ID, COMP_VELD_NAAM, COMP_VELD_TYPE, COMP_VELD_TYPE_POPUP, COMP_VELD_TYPE_DATE from dba_comp_veld where comp_id = 81)
    LOOP
    htp.prn(rec.comp_veld_naam||' :');
    case rec.comp_veld_type
    when 'T' then
    htp.prn(APEX_ITEM.TEXT(rec.comp_veld_id, ' ') );
    when 'D' then
    htp.prn(APEX_ITEM.DATE_POPUP(rec.comp_veld_id,'',rec.COMP_VELD_TYPE_DATE,'DD-MON-YY') );
    when 'P' then
    case rec.COMP_VELD_TYPE_POPUP
    when 'DBA_SERVERS' then
    htp.prn(APEX_ITEM.SELECT_LIST_FROM_QUERY(rec.comp_veld_id,nServer,'SELECT NAAM d, server_nummer r FROM dba_servers order by 1',null,'NO'));
    else null;
    end case;
    else null;
    end case;
    htp.prn('
    END LOOP;
    END;
    All the items are displayed ok, except the DATE_POPUP(). I'm getting a ORA-01403: no data found.
    Why? the field rec.COMP_VELD_TYPE_DATE is having a date-value.
    reg.
    Chris
    Edited by: J3v16 on 20-apr-2011 23:43

    Hi Hari,
    I'm just checking my Ayuthentication Scheme (instead of my Authorization scheme) and it seems to be the origin of the "no_data_found" message.
    The thing is that we make a Validation against one internal user table wich defines the office where the user work. That table had the username in lowercases and even the user wrote its username in the login page, using lowercases, the SELECT returned an "no_data_found".
    If the username field in our table is un UPPERCASE, the same function, typing the username in lowercase, returns OK.
    Thanks a lot for your interest
    Agustin

  • Two questions on apex_item.text when date field

    Hi, I have a tabular collection with a date field. I need to have validation on the date field, so wanted to create and authorization (is this the best way). In order to do so, I needed to create an application item (again...is this the best way?).
    I am very new to javascript and use of the ONCHANGE. Is there a way to have a the value of this apex_item.text placed into that application_item? I have tried the following, but it does not work.
    select apex_item.text(6,c006,10,null,
    ||'style="width:100px;background-color:#FBEC5D; "'
    ||'onchange="f_set_start_date(this,f6_'||LPAD (seq_id, 4,'0')||')"') start
    from apex_collection...where.....
    Also, is there a way to force a format for an apex_item.text. I would like it to be in the format dd-mon-yyyy.
    thanks again.

    Hi Ravi, the javascript is located in the page header.
    the Javascript (and this is long as the form has many (8) cascading LOVs) is:
    <script language="JavaScript" type="text/javascript">
    htmldb_delete_message='Are you sure you want to delete the selected records?';
    // Row - Highglight Function
    var rowStyle = new Array(10);
    var rowActive = new Array(10);
    var rowStyleHover = new Array(10);
    rowStyle[1]='';
    rowStyleHover[1]='';
    rowActive[1]='N';
    function highlight_row(checkBoxElemement,currentRowNum)
    if(checkBoxElemement.checked==true)
    for( var i = 0; i
    < checkBoxElemement.parentNode.parentNode.childNodes.length; i++ )
    if (checkBoxElemement.parentNode.parentNode.childNodes.tagName=='TD')
    if(rowActive=='Y')
    rowStyle[currentRowNum] = rowStyleHover[currentRowNum];
    else
    {rowStyle[currentRowNum] =
    checkBoxElemement.parentNode.parentNode.childNodes[i].style.backgroundColor;
    checkBoxElemement.parentNode.parentNode.childNodes[i].style.backgroundColor
    = '#FFFF66';
    rowStyleHover[currentRowNum] = '#FFFF66';
    else
    for( var i = 0; i
    < checkBoxElemement.parentNode.parentNode.childNodes.length; i++ )
    if (checkBoxElemement.parentNode.parentNode.childNodes[i].tagName=='TD')
    checkBoxElemement.parentNode.parentNode.childNodes[i].style.backgroundColor = '';
    rowStyleHover[currentRowNum] = '';
    document.wwv_flow.f11.checked=false;
    // Funntion to Check and un-check rows Rows
    function checkAllDetail(pAllCheckbox)
    if (pAllCheckbox.checked)
    for (var i = 0; i<document.wwv_flow.f11.length; i++)
    if (!document.wwv_flow.f11[i].checked)
    document.wwv_flow.f11[i].checked=true;
    highlight_row(document.wwv_flow.f11[i],i);
    } else
    for (var i = 0; i<document.wwv_flow.f11.length; i++)
    if (document.wwv_flow.f11[i].checked)
    document.wwv_flow.f11[i].checked=false;
    highlight_row(document.wwv_flow.f11[i],'');
    }; // checkAllDetail
    // Cascading Select List Function
    function f_set_casc_sel_list_item(pThis,pSelect){
    var l_Return = null;
    var l_Select = html_GetElement(pSelect);
    var get = new htmldb_Get(null,$x('pFlowId').value,
    'APPLICATION_PROCESS=tab_casc_sel_list',0);
    get.add('TAB_CASCADING_ITEM',$x(pThis).value);
    gReturn = get.get('XML');
    //alert(gReturn);
    if(gReturn && l_Select){
    var l_Count = gReturn.getElementsByTagName("option").length;
    l_Select.length = 0;
    for(var i=0;i<l_Count;i++){
    var l_Opt_Xml = gReturn.getElementsByTagName("option")[i];
    appendToSelect(l_Select, l_Opt_Xml.getAttribute('value'),
    l_Opt_Xml.firstChild.nodeValue)
    get = null;
    // cascading list for Market Category
    function f_set_casc_sel_list_item_mkt(pThis,pSelect){
    var l_Return = null;
    var l_Select = html_GetElement(pSelect);
    var get = new htmldb_Get(null,$x('pFlowId').value,
    'APPLICATION_PROCESS=tab_casc_sel_list_mkt',0);
    get.add('TAB_CASCADING_ITEM',$x(pThis).value);
    gReturn = get.get('XML');
    //alert(gReturn);
    if(gReturn && l_Select){
    var l_Count = gReturn.getElementsByTagName("option").length;
    l_Select.length = 0;
    for(var i=0;i<l_Count;i++){
    var l_Opt_Xml = gReturn.getElementsByTagName("option")[i];
    appendToSelect(l_Select, l_Opt_Xml.getAttribute('value'),
    l_Opt_Xml.firstChild.nodeValue)
    get = null;
    // cascading list for Grade
    function f_set_casc_sel_list_item_grd(pThis,pSelect){
    var l_Return = null;
    var l_Select = html_GetElement(pSelect);
    var get = new htmldb_Get(null,$x('pFlowId').value,
    'APPLICATION_PROCESS=tab_casc_sel_list_grd',0);
    get.add('TAB_CASCADING_ITEM',$x(pThis).value);
    gReturn = get.get('XML');
    //alert(gReturn);
    if(gReturn && l_Select){
    var l_Count = gReturn.getElementsByTagName("option").length;
    l_Select.length = 0;
    for(var i=0;i<l_Count;i++){
    var l_Opt_Xml = gReturn.getElementsByTagName("option")[i];
    appendToSelect(l_Select, l_Opt_Xml.getAttribute('value'),
    l_Opt_Xml.firstChild.nodeValue)
    get = null;
    // cascading list for PORT
    function f_set_casc_sel_list_item_port(pThis,pSelect){
    var l_Return = null;
    var l_Select = html_GetElement(pSelect);
    var get = new htmldb_Get(null,$x('pFlowId').value,
    'APPLICATION_PROCESS=tab_casc_sel_list_port',0);
    get.add('TAB_CASCADING_ITEM',$x(pThis).value);
    gReturn = get.get('XML');
    //alert(gReturn);
    if(gReturn && l_Select){
    var l_Count = gReturn.getElementsByTagName("option").length;
    l_Select.length = 0;
    for(var i=0;i<l_Count;i++){
    var l_Opt_Xml = gReturn.getElementsByTagName("option")[i];
    appendToSelect(l_Select, l_Opt_Xml.getAttribute('value'),
    l_Opt_Xml.firstChild.nodeValue)
    get = null;
    // Cascading Select List INSTATE
    function f_set_casc_sel_list_item_distance(pThis,pSelect){
    var l_Return = null;
    var l_Select = html_GetElement(pSelect);
    var get = new htmldb_Get(null,$x('pFlowId').value,
    'APPLICATION_PROCESS=tab_casc_sel_list_instate',0);
    get.add('TAB_CASCADING_DISTANCE',$x(pThis).value);
    gReturn = get.get('XML');
    //alert(gReturn);
    if(gReturn && l_Select){
    var l_Count = gReturn.getElementsByTagName("option").length;
    l_Select.length = 0;
    for(var i=0;i<l_Count;i++){
    var l_Opt_Xml = gReturn.getElementsByTagName("option")[i];
    appendToSelect(l_Select, l_Opt_Xml.getAttribute('value'),
    l_Opt_Xml.firstChild.nodeValue)
    get = null;
    // cascading list for AREA
    function f_set_casc_sel_list_item_area(pThis,pSelect){
    var l_Return = null;
    var l_Select = html_GetElement(pSelect);
    var get = new htmldb_Get(null,$x('pFlowId').value,
    'APPLICATION_PROCESS=tab_casc_sel_list_area',0);
    get.add('TAB_CASCADING_INSTATE',$x(pThis).value);
    gReturn = get.get('XML');
    //alert(gReturn);
    if(gReturn && l_Select){
    var l_Count = gReturn.getElementsByTagName("option").length;
    l_Select.length = 0;
    for(var i=0;i<l_Count;i++){
    var l_Opt_Xml = gReturn.getElementsByTagName("option")[i];
    appendToSelect(l_Select, l_Opt_Xml.getAttribute('value'),
    l_Opt_Xml.firstChild.nodeValue)
    get = null;
    // cascading list for SUB-AREA
    function f_set_casc_sel_list_subarea(pThis,pSelect){
    var l_Return = null;
    var l_Select = html_GetElement(pSelect);
    var get = new htmldb_Get(null,$x('pFlowId').value,
    'APPLICATION_PROCESS=tab_casc_sel_list_subarea',0);
    get.add('TAB_CASCADING_AREA',$x(pThis).value);
    get.add('TAB_CASCADING_INSTATE',$x(pThis).value);
    gReturn = get.get('XML');
    //alert(gReturn);
    if(gReturn && l_Select){
    var l_Count = gReturn.getElementsByTagName("option").length;
    l_Select.length = 0;
    for(var i=0;i<l_Count;i++){
    var l_Opt_Xml = gReturn.getElementsByTagName("option")[i];
    appendToSelect(l_Select, l_Opt_Xml.getAttribute('value'),
    l_Opt_Xml.firstChild.nodeValue)
    get = null;
    // cascading list for LOCAL-AREA
    function f_set_casc_sel_list_local(pThis,pSelect){
    var l_Return = null;
    var l_Select = html_GetElement(pSelect);
    var get = new htmldb_Get(null,$x('pFlowId').value,
    'APPLICATION_PROCESS=tab_casc_sel_list_local',0);
    get.add('TAB_CASCADING_SUBAREA',$x(pThis).value);
    gReturn = get.get('XML');
    //alert(gReturn);
    if(gReturn && l_Select){
    var l_Count = gReturn.getElementsByTagName("option").length;
    l_Select.length = 0;
    for(var i=0;i<l_Count;i++){
    var l_Opt_Xml = gReturn.getElementsByTagName("option")[i];
    appendToSelect(l_Select, l_Opt_Xml.getAttribute('value'),
    l_Opt_Xml.firstChild.nodeValue)
    get = null;
    // cascading list for GEAR
    function f_set_casc_sel_list_gear(pThis,pSelect){
    var l_Return = null;
    var l_Select = html_GetElement(pSelect);
    var get = new htmldb_Get(null,$x('pFlowId').value);
    get.add('TAB_CASCADING_GEAR',$x(pThis).value);
    gReturn = get.get('XML');
    //alert(gReturn);
    if(gReturn && l_Select){
    var l_Count = gReturn.getElementsByTagName("option").length;
    l_Select.length = 0;
    for(var i=0;i<l_Count;i++){
    var l_Opt_Xml = gReturn.getElementsByTagName("option")[i];
    appendToSelect(l_Select, l_Opt_Xml.getAttribute('value'),
    l_Opt_Xml.firstChild.nodeValue)
    get = null;
    // cascading list for start_date
    function f_set_start_date(pThis,pSelect){
    alert("hello");
    var l_Return = null;
    var l_Select = html_GetElement(pSelect);
    var get = new htmldb_Get(null,$x('pFlowId').value);
    get.add('TAB_START_DATE',$x(pThis).value);
    gReturn = get.get('XML');
    //alert(gReturn);
    if(gReturn && l_Select){
    var l_Count = gReturn.getElementsByTagName("option").length;
    l_Select.length = 0;
    for(var i=0;i<l_Count;i++){
    var l_Opt_Xml = gReturn.getElementsByTagName("option")[i];
    appendToSelect(l_Select, l_Opt_Xml.getAttribute('value'),
    l_Opt_Xml.firstChild.nodeValue)
    get = null;
    function appendToSelect(pSelect, pValue, pContent) {
    var l_Opt = document.createElement("option");
    l_Opt.value = pValue;
    if(document.all){
    pSelect.options.add(l_Opt);
    l_Opt.innerText = pContent;
    }else{
    l_Opt.appendChild(document.createTextNode(pContent));
    pSelect.appendChild(l_Opt);
    function KeyCheck(e)
    var KeyID = (window.event) ? event.keyCode : e.keyCode;
    //alert(KeyID); // If you want to check out the values for other buttons
    if (KeyID == 120)
    doSubmit('SAVE'); // SAVE F9
    if (KeyID == 121)
    doSubmit('COMPLETE'); // complete F10
    </script>
    The actual (long) query is (and the date value is C006):
    select apex_item.hidden (1,seq_id) checkbox,
    apex_item.hidden (2,seq_id)||
    apex_item.select_list_from_query(3,c003,'select partner_name d,
    state_code r
    from partners
    where state_code is not null
    order by partner_name',
    'style="width:100px;background-color:#FBEC5D; "'
    ||'onchange="f_set_casc_sel_list_item_port(this,f4_'
    ||LPAD (seq_id, 4,'0')||')"',
    'YES',
    '0',
    '- Select State -',
    'f3_' || LPAD (seq_id,4, '0'),
    NULL,
    'NO'
    ) STATE,
    apex_item.select_list_from_query_xl(4,c004,'select fips_place_name, port
    from valid_ports
    where fips_state = '
    ||nvl(c003,0)
    ||' order by fips_place_name',
    'style="width:150px;background-color:#FBEC5D;"',
    'YES',
    '0',
    '- Select PORT -',
    'f4_' || LPAD (seq_id, 4, '0'),
    NULL,
    'NO' ) PORT,
    apex_item.POPUP_FROM_LOV(5,c005,'VESSELS',
    NULL,NULL,NULL,NULL,NULL,
    'style="width:100px;'
    ||'background-color:#FBEC5D; "') vessel_id,
    apex_item.text(6,c006,10,null,
    'style="background-color:#FBEC5D;"'
    ||'onchange="f_set_start_date(this,f6_'
    ||LPAD(seq_id, 4,'0')||')"') trip_start_date,
    apex_item.text(7,c007,5,null,
    'style="background-color:#FBEC5D"') trip_start_time,
    apex_item.text(8,c008,10,null,
    'style="background-color:#FBEC5D"') trip_end_date,
    apex_item.text(9,c009,5,null,
    'style="background-color:#FBEC5D"') trip_end_time,
    apex_item.SELECT_LIST_FROM_LOV(10,c010,'TRIP_TYPE',
    'style="width:100px;background-color:#FBEC5D; "') trip_type,
    apex_item.SELECT_LIST_FROM_LOV(11,c011,'YES_NO',4) multiple_fishermen,
    apex_item.text(12,c012,3,null,
    'style="background-color:#FBEC5D"') days_at_sea,
    apex_item.text(13,c013,4,null,
    'style="background-color:#FBEC5D"') nbr_of_crew,
    apex_item.hidden(14,c014) supplier_trip_id,
    apex_item.hidden(15,c015) trip_nbr,
    apex_item.text(16,c016) partner_vtr
    from apex_collections where collection_name = 'TRIP_C'

  • ORA-20001 in APEX_ITEM.SELECT_LIST_FROM_LOV

    Hi everyone,
    I'm getting a ORA-20001 error from within HTMLDB_ITEM when trying to invoke APEX_ITEM.SELECT_LIST_FROM_LOV. I'm running XE and ApEx 3.2.1.00.12. After getting the error in a report query I was doing, I figured I'd try to narrow the issue down. If I either do this:
    SELECT   apex_item.select_list_from_lov(1, '1', 'FUNDLOV') FROM DUAL;or this:
    BEGIN
       DBMS_OUTPUT.put_line(apex_item.select_list_from_lov(1, '1', 'FUNDLOV'));
    END;I get the following error message:
    ORA-20001: Query must begin with SELECT or WITH
    ORA-06512: at "APEX_030200.WWV_FLOW_ASSERT", line 283
    ORA-06512: at "APEX_030200.WWV_FLOW_UTILITIES", line 6368
    ORA-06512: at "APEX_030200.WWV_FLOW_ITEM", line 853
    ORA-06512: at "APEX_030200.HTMLDB_ITEM", line 421
    ORA-06512: at line 2
    I get the same message whether I'm in ApEx's SQL Commands window or running it in Toad. I can invoke other APEX_ITEM functions like checkbox, text, etc. no problem.
    My FUNDLOV query looks like this:
    select DESCRIPTION display_value, RECORD_ID return_value
    from CSBG_FUNDING_LEVEL
    order by 1and it runs without any problem in ApEx or Toad so I don't believe the LOV query is the problem.
    Any idea what the problem may be? Thanks!
    John

    Unless I'm doing something wrong, the ORA-20001 issue appears to be affecting APEX_ITEM.SELECT_LIST_FROM_LOV_XL as well - and I'm also seeing strange behavior in APEX_ITEM.SELECT_LIST_FROM_QUERY.
    Running this query:
    SELECT description, record_id FROM csbg_funding_level;Returns:
    DESCRIPTION.....RECORD_ID
    Operated without CSBG.....1
    1% - 24%.....2
    25% - 49%.....3
    50% - 74%.....4
    75% - 100%.....5
    Yet running this:
    SELECT   apex_item.select_list_from_query(1, 1, 'SELECT description, record_id FROM csbg_funding_level', NULL, 'NO')
      FROM   DUAL;Returns:
    <select name="f01" ><option value="1" selected="selected">1</option></select>Where are all of the option tags that ought to be getting rendered for the rows in the query results?
    I could be wrong, but there appears to be some bugs in SELECT_LIST_FROM_LOV, SELECT_LIST_FROM_LOV_XL and SELECT_LIST_FROM_QUERY.
    Any thoughts? Thanks,
    John

  • Exception when using apex_item.select_list_from_lov

    I have a query where I want to use a select list to enable the user to change the value of an attribute. However, when i try using apex_item.select_list_from_lov or apex_item.select_list_from_query I get an exception. My report region shows ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    I tried querying a smaller table, and then it works. Is there a size limit for select_list_from_query and select_list_from_lov? And if so, what is it? The list of values and the query works fine when using them in select list items (in a form). It also works fine when using apex_item.popup_from_lov.
    Camilla

    Camilla,
    Those functions return a varchar2 value so you are limited to 4000 characters for a column of that type selected in SQL. You can use the select_list_from_query_xl or select_list_from_lov_xl, which return a CLOB. In any case the size of the HTML generated for the row must be less than 32K.
    Scott

  • Apex_item select list to be displayed with multiple default values

    I am using APEX 4.2.
    For one of our requirements , we are displaying a report which uses "apex_item.select_list_from_query" multiselect field.
    The above function accepts a parameter, 'p_value' using which we can specify the default value to be highlighted.
    Is there any way to highlight multiple values on the select list by default, when the page is loaded, based on a sql output.
    Sample Scenario:
    Say colour is a multiselect field. Full list of values available : R, B, G, Y, O
    On day1, for record1 i am choosing R and B. which I am saving in the backend when the page is submitted.
    On day2 : I login again to see the report. When the report is loaded, I should see the values 'R' and 'B' highlighted or in a different font format , differentiated from the rest.
    Thanks in advance for your replies.
    Regards,
    Raasi
    Edited by: 878815 on Mar 11, 2013 10:23 PM

    878815 wrote:
    I am using apex_item.select_list_from query. and then a piece of javascript to concatenate as a colon delimited string. This is the function I am using in the report sql,
    apex_item.hidden(20,null)||apex_item.select_list_from_query(6,null,'<sql>','multiple size = "6" onChange="Multi(this)"','NO' ) as col_1I think 'multiple size' is a custom attribute and APEX have no clue about it.
    javascript code:
    function Multi(p_this)
    var l_selected=html_SelectValue(p_this);
    if (l_selected.constructor == Array) l_selected=l_selected.join(':');
    p_this.parentNode.firstChild.value = l_selected;
    return l_selected;
    };What is this apex_item.hidden used for.. placeholder?
    May be populate the hidden item with default value as colon delimited string and on page load use some JavaScript to read that string and set/highlight the select list.
    It would be easy if you can replicate the issue on apex.oracle.com

  • Problem with APEXT_ITEM.SELECT_LIST_FROM_QUERY in Apex 4.0.1

    Hi ,
    In my Interactive Report I have One Column like ..
    ,APEX_ITEM.SELECT_LIST_FROM_QUERY(3,LR_NAME,'select table_name from all_synonyms where owner = ''MJP_APPLICATION'' and substr(table_name,1,2) not in (''FN'',''SP'',''SE'',''P_'') ') LR_NAME
    but it showing following Error message when I run the page(inner query returning 75 Row's)
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small+_
    If I put limit on the number of rows of select list like ..
    ,APEX_ITEM.SELECT_LIST_FROM_QUERY(3,LR_NAME,'select table_name from all_synonyms where owner = ''MJP_APPLICATION'' and substr(table_name,1,2) not in (''FN'',''SP'',''SE'',''P_'') and rownum < 25 ') LR_NAME
    then its working fine may I know what is the reason
    thanks & regards,
    Avinash Nagawade

    Actually I am adding new row with the help of Union Query
    see the query
    select
         SCHEDULE_ID DELETE_TRANSACTION
    , APEX_ITEM.RADIOGROUP(1,SCHEDULE_ID,:P9_X,'','onClick="highlightrow(this)" ') as "--"
    ,APEX_ITEM.HIDDEN(1,'U')|| APEX_ITEM.HIDDEN(2,SCHEDULE_ID) "-"
    *,APEX_ITEM.SELECT_LIST_FROM_QUERY_XL(4,EMP_NO,'select emp_name,emp_no*
    from gen_employee') "EMP_NO"
    ,APEX_ITEM.TEXT(5,PURPOSE,40,40) "PURPOSE"
    ,APEX_ITEM.TEXT(6,SCHEDULE_FLAG,2,2) "FLAG"
    ,APEX_ITEM.TEXT(7,TOTAL_AMOUNT) "TOTAL_AMOUNT"
    FROM mjp_paybill.pay_schedule_main
    union
    select NULL DELETE_TRANSACTION
    , APEX_ITEM.RADIOGROUP(1,null,:P9_X,'','onClick="highlightrow(this)" ') as "--"
    ,APEX_ITEM.HIDDEN(1,'I') || APEX_ITEM.HIDDEN(2,NULL) "SCHEDULE_ID"
    *,APEX_ITEM.SELECT_LIST_FROM_QUERY_XL(4,NULL,'select emp_name,emp_no from gen_employee') "EMP_NO"*
    ,APEX_ITEM.TEXT(5,NULL,40,40) "PURPOSE"
    ,APEX_ITEM.TEXT(6,null,2,2) "FLAG"
    ,APEX_ITEM.TEXT(7,NULL) "TOTAL_AMOUNT"
    from dual
    WHERE :P9_HIDDEN IS NOT NULL
    ORDER BY 1 DESC

  • Apex report performance is very poor with apex_item.checkbox row selector.

    Hi,
    I'm working on a report that includes some functionality to be able to select multiple records for further processing.
    The report is based on a view that contains a couple of hundred thousand records.
    When i make a selection from this view in sqlplus , the performance is acceptable but the apex report based on the same view performes very poorly.
    I've noticed that when i omit the apex_item.checkbox from my report query, performance is on par with sqlplus. (factor 10 or so quicker).
    Explain plan appears to be the same with or without checkbox function in the select.
    My query is:
    select apex_item.checkbox(1,tan_id) Select ,
    brt_id
    , tan_id
    , message_id
    , conversation_id
    , action
    , to_acn_code
    , information
    , brt_created
    , tan_created
    from (SELECT brt.id brt_id, -- view query
    MAX (TAN.id) tan_id,
    brt.message_id,
    brt.conversation_id,
    brt.action,
    TAN.to_acn_code,
    TAN.information,
    brt.created brt_created,
    TAN.created tan_created
    FROM (SELECT brt_id, id, to_acn_code, information, created
    FROM xxcjib_transactions
    WHERE tan_type = 'DELIVER' AND status = 'FINISHED') TAN,
    xxcjib_berichten brt
    WHERE brt.id = TAN.brt_id
    GROUP BY brt.id,
    brt.message_id,
    brt.conversation_id,
    brt.action,
    TAN.to_acn_code,
    TAN.information,
    brt.created,
    TAN.created)
    What could be the reason for the poor performance of the apex report?
    And is there another way to select multiple report records without the apex_item.checkbox function?
    I'm using apex 3.2 on oracle 10g database.
    Thanks,
    Niels Ingen Housz
    Edited by: user11986529 on 19-mrt-2010 4:06

    Thanks for your reply.
    Unfortunately changing the pagination doesnt make much of a difference in this case.
    Without the checkbox the query takes 2 seconds.
    With checkbox it takes well over 30 seconds.
    The second report region on this page based on another view seems to perform reasonably well with or without the checkbox.
    It has about the same number of records but with a different view query.
    There are also a couple of filter items in the where clause of the report queries (same for both reports) based on date and acn_code and both reports have a selectlist item displayed in their regions based on a simple lov. These filter items don't seem to be of influence on the performance.
    I have also recreated the report on a seperate page without any other page items or where clause and the same thing occurs.
    With the checkbox its very very slow (more like 20 times slower).
    Without it , the report performs well.
    And another thing, when i run the page with debug on i don't see the actual report query:
    0.08: show report
    0.08: determine column headings
    0.08: activate sort
    0.08: parse query as: APEX_CMA_ONT
    0.09: print column headings
    0.09: rows loop: 30 row(s)
    and then the region is displayed.
    I am using databaselinks in the views b.t.w
    Edited by: user11986529 on 19-mrt-2010 7:11

  • Error while Creating Report Region using APEX_ITEM

    Hello Friends,
    I am trying to make a Cascading Select List in Tabular Form. but getting error while compiling the region source:
    Error : Query cannot be parsed, please check the syntax of your query. (ORA-00907: missing right parenthesis)
    Can some one take a look at my region source :
    <Code here>
    SELECT apex_item.hidden(31,SEQ_ID) || apex_item.select_list_from_query(32,
                        c001,
                        'select POLE,POLE_ID from CAP_PLAN_POLE_DETAILS',
                        'style="width:220px" '
                        || 'onchange="f_set_casc_sel_list_item(this,'|| 'f33_'|| LPAD (seq_id, 4, '0')|| ')"',
                        'YES',
                        '0',
                        '- Select Pole -',
                        'f32_' || LPAD (seq_id, 4, '0'),
                        NULL,
    'NO'
    ) POLE_CODE_ID,
    apex_item.select_list_from_query(33,
                        c002,
                        'SELECT COUNTRY,COUNTRY_ID FROM CAP_PLAN_COUNTRY_DETAILS WHERE POLE_ID=c001',
                        'style="width:220px"',
                        'YES',
                        '0',
    '- Select Country -',
                        'f33_' || LPAD (seq_id, 4, '0'),
    NULL,
    'NO'
                        ) COUNTRY_CODE_ID,
    apex_item.text(34,c003) LEGAL_ENTITY,
    apex_item.text(35,c004) BUSINESS,
    apex_item.text(36,c005) COUNT_OF_NAMED_USERS,
    apex_item.text(37,c006) COUNT_OF_CONCURRENT_USERS,
    apex_item.text(38,c007) INVENTORY_ORG
    FROM apex_collections
    WHERE collection_name = 'SITE_DETAILS'
    UNION ALL
    select
    apex_item.hidden(31,null) ||
    apex_item.select_list_from_query(32,
    0,
    'select POLE,POLE_ID from CAP_PLAN_POLE_DETAILS',
    'style="width:220px" '
    || 'onchange="f_set_casc_sel_list_item(this,'
    || 'f33_'
    || LPAD (9900 + LEVEL, 4, '0')
    || ')"',
    'YES',
    '0',
    '- Select Pole -',
    'f32_' || LPAD (9900 + LEVEL, 4, '0'),
    NULL,
    'NO'
    ) POLE_CODE_ID,
    apex_item.select_list_from_query(33,
    NULL,
    'SELECT COUNTRY,COUNTRY_ID FROM CAP_PLAN_COUNTRY_DETAILS WHERE POLE_ID=0,
    'style="width:220px"',
    'YES',
    '0',
    '- Select Country -',
    'f33_' || LPAD (9900 + LEVEL, 4, '0'),
    NULL,
    'NO'
    ) COUNTRY_CODE_ID,
    apex_item.text(34,null) LEGAL_ENTITY,
    apex_item.text(35,null) BUSINESS,
    apex_item.text(36,null) COUNT_OF_NAMED_USERS,
    apex_item.text(37,null) COUNT_OF_CONCURRENT_USERS,
    apex_item.text(38,null) INVENTORY_ORG
    from dual
    WHERE :request = 'ADD'
    CONNECT BY LEVEL = 2
    <Code here>
    error looked simple but I could not make it. :(
    Appreciate any ideas..
    Thanks..
    Edited by: Chaitu_Apex on Mar 13, 2010 5:48 AM

    SELECT apex_item.hidden(31,SEQ_ID) || apex_item.select_list_from_query(32,
                         c001,
                         'select POLE,POLE_ID from CAP_PLAN_POLE_DETAILS',
                         'style="width:220px" '
                         || 'onchange="f_set_casc_sel_list_item(this,'|| 'f33_'|| LPAD (seq_id, 4, '0')|| ')"',
                         'YES',
                         '0',
                         '- Select Pole -',
                         'f32_' || LPAD (seq_id, 4, '0'),
                          NULL,
                                     'NO'
                                    ) POLE_CODE_ID,
    apex_item.select_list_from_query(33,
                         c002,
                         'SELECT COUNTRY,COUNTRY_ID FROM CAP_PLAN_COUNTRY_DETAILS WHERE POLE_ID=c001',
                         'style="width:220px"',
                         'YES',
                         '0',
                                     '- Select Country -',
                         'f33_' || LPAD (seq_id, 4, '0'),
                                      NULL,
                                     'NO'
                         ) COUNTRY_CODE_ID,
    apex_item.text(34,c003) LEGAL_ENTITY,
    apex_item.text(35,c004) BUSINESS,
    apex_item.text(36,c005) COUNT_OF_NAMED_USERS,
    apex_item.text(37,c006) COUNT_OF_CONCURRENT_USERS,
    apex_item.text(38,c007) INVENTORY_ORG
    FROM apex_collections
    WHERE collection_name = 'SITE_DETAILS'
    UNION ALL
    select
    apex_item.hidden(31,null) ||
    apex_item.select_list_from_query(32,
                                     0,
                                    'select POLE,POLE_ID from CAP_PLAN_POLE_DETAILS',
                                    'style="width:220px" '
                                    || 'onchange="f_set_casc_sel_list_item(this,'
                                    || 'f33_'
                                    || LPAD (9900 + LEVEL, 4, '0')
                                    || ')"',
                                    'YES',
                                    '0',
                                    '- Select Pole -',
                                    'f32_' || LPAD (9900 + LEVEL, 4, '0'),
                                    NULL,
                                    'NO'
                                   ) POLE_CODE_ID,
    apex_item.select_list_from_query(33,
                                    NULL,
                                   'SELECT COUNTRY,COUNTRY_ID FROM CAP_PLAN_COUNTRY_DETAILS WHERE POLE_ID=0,
                                   'style="width:220px"',
                                   'YES',
                                   '0',
                                   '- Select Country -',
                                   'f33_' || LPAD (9900 + LEVEL, 4, '0'),
                                    NULL,
                                   'NO'
                                   ) COUNTRY_CODE_ID,
    apex_item.text(34,null) LEGAL_ENTITY,
    apex_item.text(35,null) BUSINESS,
    apex_item.text(36,null) COUNT_OF_NAMED_USERS,
    apex_item.text(37,null) COUNT_OF_CONCURRENT_USERS,
    apex_item.text(38,null) INVENTORY_ORG
    from dual
        WHERE :request = 'ADD'
    CONNECT BY LEVEL = 2Hi Jari,
    Thanks for the response.
    Also please check the above sql and let me know what I have missed.
    Thanks,

Maybe you are looking for

  • No longer able to export in JPEG-B

    I have this vexing issue that I cannot figure out. I can no longer export as JPEG-B. It has vanished from the list of available formats to export to. I have tried deleting the preferences and restarting the system. But no luck. Anyone have any sugges

  • Vendor master data error - check issue manueal

    Hi all, i got the following message when i create vendor master data, same message as error when i try to post manual check. " Changes for vendor 500011 not yet confirmed Diagnosis The change to sensitive fields of vendor 500011 have not been confirm

  • TS1363 how do i get my ipad to sync

    how do i get my ipad to sync

  • Why won't the Adobe Acrobat free trial download button work - nothing happens when I click it?

    I've tried any number of ways to enter the site and download the free Adobe Acrobat version and nothing happens.   I don't get any response to my clicks.

  • Boot camp support

    Hi guys, I'm a little confused by by the boot camp instructions I've just read. I understand everything about installing windows on my mac, I just have one little question. I have a legal copy of 64 bit windows 7 that came with my last computer. Can