Bug: APEX_ITEM.TEXT_FROM_LOV

Hi,
I think I found a small bug in APEX_ITEM.TEXT_FROM_LOV
I have a LOV that has over 2500 entries... If I were to concatenate all the display values it would exceed 60,000 characters and the max length of a single display value is 92
When I call APEX_ITEM.TEXT_FROM_LOV I get the following message:
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
I've done some tests and it doesn't appear to be the length of a particular display value, but rather the length of the concatenated set of characters (I could be completely wrong on this).
Martin

That is a known limitation with that function. You should decode the value using SQL in your query in this case.
Scott

Similar Messages

  • APEX_ITEM.TEXT_FROM_LOV: gives ORA-01403

    Hi,
    my requirement is to display the text from the lov here i used an lov like ''select ename as display eno as return from employees''. Here ename is varchar2 and eno is number.
    I created a sql report using this query to create a manual tabular form using collections
    """SELECT apex_item.hidden(47,c047,NULL,'f47_'|| '#ROWNUM#')
    || apex_item.hidden(48,c048,NULL,'f48_'|| '#ROWNUM#')
    || apex_item.hidden(49,seq_id,NULL,'f49_'|| '#ROWNUM#')
    || apex_item.hidden(1,c001,NULL,'f01_'|| '#ROWNUM#')
    || apex_item.checkbox(
    50,
         seq_id,
         NULL,
         CASE
         WHEN c047 ='D' THEN seq_id
         END,
         'f50_' || '#ROWNUM#'
    ) AS delete_checkbox,
    apex_item.display_and_save(
    2,
    c002,
    'f02_' || '#ROWNUM#'
    ) AS col_2,
    apex_item.display_and_save(
    3,
    c003,
    'f03_' || '#ROWNUM#'
    ) AS col_3,
    apex_item.display_and_save(
    4,
    c004,
    'f04_' || '#ROWNUM#'
    ) AS col_4,
    apex_item.display_and_save(
    5,
    c005,
    'f05_' || '#ROWNUM#'
    ) AS col_5,
    apex_item.display_and_save(
    6,
    c006,
    'f06_' || '#ROWNUM#'
    ) AS col_6,
    apex_item.display_and_save(
    7,
    c007,
    'f07_' || '#ROWNUM#'
    ) AS col_7,
    apex_item.display_and_save(
    8,
    c008,
    'f08_' || '#ROWNUM#'
    ) AS col_8,
    apex_item.select_list_from_query(
    9,
    NVL(c009,' '),
    'SELECT DISTINCT STATUS AS display, STATUS AS return from ISSUES1 ORDER by DISPLAY',
    NULL,
    'YES',
    'f09_' || '#ROWNUM#'
    ) AS col_9,
    APEX_ITEM.TEXT_FROM_LOV(
    c010,
    'EMPLOYEES!'
    ) AS col_10,
    apex_item.display_and_save(
    11,
    c011,
    'f11_' || '#ROWNUM#'
    ) AS col_11,
    apex_item.date_popup(
    12,
    ROWNUM,c012,'dd-MON-yyyy'
    ) AS col_12,
    apex_item.text(
    13,
    c013,
    20,
    50,
    NULL,
    'f13_' || '#ROWNUM#'
    ) AS col_13
    FROM apex_collections
    where collection_name ='ASS' AND c009='ASSIGNED' and c006 in(select issue_type from department_issues where department_id in(select department_id from employees1 where upper(employee_name)=upper(:app_user)))
    order by c003""""
    whenever i tried to update the tabular form it raising an error "ORA-01403 no data found".
    If i replaced
    APEX_ITEM.TEXT_FROM_LOV(
    c010,
    'EMPLOYEES!'
    ) AS col_10, with
    apex_item.select_list_from_lov(
    10,
    c010,
    'EMPLOYEES!',
    NULL,
    'NO',
    'f10_' || '#ROWNUM#'
    then it is updating without errors.
    can anyone tell me about this problem??
    APEX VERSION - 4.1
    DATABASE VERSION - 11gr2

    Thanks for your reply
    This is my update process to collections
    DECLARE
    l_collection_name APEX_COLLECTIONS.COLLECTION_NAME%TYPE;
    l_original_md5 VARCHAR2(32);
    l_latest_md5 VARCHAR2(32);
    BEGIN
    l_collection_name := 'COLLECTIONS';
    FOR x IN 1 .. apex_application.g_f49.count
    LOOP
    IF apex_application.g_f01(x) IS NOT NULL --ID exists, check to see if record was updated
    THEN
    SELECT c048
    INTO l_original_md5
    FROM apex_collections
    WHERE collection_name = l_collection_name AND seq_id = apex_application.g_f49(x);
    l_latest_md5 := wwv_flow_item.md5(
    apex_application.g_f01(x),
    apex_application.g_f02(x),
    apex_application.g_f03(x),
    apex_application.g_f04(x),
    apex_application.g_f05(x),
    apex_application.g_f06(x),
    apex_application.g_f07(x),
    apex_application.g_f08(x),
    apex_application.g_f09(x),
    apex_application.g_f10(x),
    apex_application.g_f11(x),
    apex_application.g_f12(x),
    apex_application.g_f13(x)
    IF l_original_md5 != l_latest_md5
    THEN
    apex_collection.update_member(
    p_collection_name => l_collection_name,
    p_seq => apex_application.g_f49(x),
    p_c001 => apex_application.g_f01(x),
    p_c002 => apex_application.g_f02(x),
    p_c003 => apex_application.g_f03(x),
    p_c004 => apex_application.g_f04(x),
    p_c005 => apex_application.g_f05(x),
    p_c006 => apex_application.g_f06(x),
    p_c007 => apex_application.g_f07(x),
    p_c008 => apex_application.g_f08(x),
    p_c009 => apex_application.g_f09(x),
    p_c010 => apex_application.g_f10(x),
    p_c011 => to_date(apex_application.g_f11(x),'dd-MON-yyyy'),
    p_c012 => to_date(apex_application.g_f12(x),'dd-MON-yyyy'),
    p_c013 => apex_application.g_f13(x),
    p_c047 => 'U',
    p_c048 => apex_application.g_f48(x)
    END IF;
    END IF;
    END LOOP;
    END;
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

  • BUG: apex_item.textarea default values

    ApEx Team....
    I doubt this was intentional, but perhaps it was. I certainly won't discredit the idea.
    In 4.0.1.00.03, I describe the APEX_ITEM package spec and find that the TEXTAREA function has two parameters, p_rows and p_cols, which have defaults of 40 and 4, respectively. I would venture to say that these defaults are likely reversed inadvertently. I used the defaults to create a textarea and found it a bit difficult to use in practice.
    >
    function textarea (
    -- Generates an HTML input type of text. Basically a single hight form field.
    -- Arguments:
    -- p_idx = The form element name, e.g. 1 equals f01, 2 equals f02, etc.
    -- Typically the p_idx argument is constant for a given column.
    -- p_value = Text displayed in HTML textarea.
    -- p_rows = Height of the textarea (HTML rows attribute)
    -- p_cols = Width of text displayed on screen (HTML cols attribute)
    -- p_attributes = Extra HTML arguments you wish to add
    -- p_item_id = Will set the ID of the item to this value (id="..."). Must be unique! Try concatenating some string with rownum. Required for 508 compliance
    -- p_item_label = Creates an invisible label for an item. Used for Section 508 Compliance. Class is hideMe508.
    -- example(s):
    -- select htmldb_item.textarea(1,ename) from emp
    p_idx in number,
    p_value in varchar2 default null,
    p_rows in number default 40,
    p_cols in number default 4,
    p_attributes in varchar2 default null,
    p_item_id in varchar2 default null,
    p_item_label in varchar2 default null)
    return varchar2
    >
    After setting these parameters explicitly, I got a textarea of my liking.
    I looked through the 4.0.2 release notes and did not find this listed as something it addresses, so I thought I'd post something.
    Shane.

    Hi Shane,
    thanks for letting us know. You are right, these defaults do not make sense. I have filed bug# 10376966.
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Pop-up footnote bug

    Hi everyone.
    I'm been making EPUB 3 books and inserting footnotes along the text. iBooks displays this notes in a pop-up window and it works just fine. But now I'm facing what seems to be a bug. One particular note ended up on the first line of the page and it doesn't work. First, I thought it was some error in the code and I went to check. But the code was just like the others. Then, I tried this: I changed the font-size, on iBooks, and so the footnote jumped to another line; then just like magic, the footnote started to work!
    It seems to me like the pop-up couldn't get enough space to show up. When it droped just a litle bit below (when the font-size was changed), the it worked. Does anyone ever faced this same problem? Is this really a bug? Is there any workaround?
    Thanks in advance!

    Just tried this and unfortunately, Apex did appear to sort of drop the ball on this one in a sense.
    Popup LOVs that are of the kind "Not Enterable, Show Display Value and Store Return Value" used to be called "Popup Key LOVs" in v3 (and they are still called this in v4 when used on a tabular form or master-detail form in the detail region).
    These are actually generated at runtime as TWO page items, not one. So assume you declared your field as "P123_MYLOVITEM", at runtime if you were to view the page HTML source, you would see "P123_MYLOVITEM_HIDDENVALUE" (which you did not explicitly declare) is a hidden item which contains the actual return value and "P123_MYLOVITEM" is an input text item that is disabled and is what you see on the screen.
    This is where Apex does have a bit of a hole to plug (and until they plug the hole, you will have to if you must use this kind of popup LOV).
    During page rendering, Apex internally generates the default value of the displayed item to the display value that corresponds to the hidden item's value according to your LOV definition. During selection of a popup LOV entry, Apex separately returns the return value to the hidden item and the display value to the displayed page item. But apart from those scenarios, there is nothing otherwise that really links P123_MYLOVITEM_DISPLAY to P123_MYLOVITEM which is why your DA doesn't appear to do what you want it to (set the displayed value).
    You probably will have to add additional javascript or more DAs to re-fetch the displayed value from the LOV (look at APEX_ITEM.TEXT_FROM_LOV) based on the current value of the LOV item.

  • Is there a way to set the ID of a collection item and not worry about fxx?

    Hi Everyone, I am not certain if I am phrasing this properly, so bear with me.
    I have a tabular form based on a collection.   There are a variety of items, textareas, select lovs, and radio groups in this tabular form.  Some of the items have a set id which correspond to the collection field...so for example,
    c010 has id='f10'+seq
    c012 has id='f12'+seq
    when any field is changed, a dynamic action is executed.
    dynamic action:  COLUMN CHANGE
    event: CHANGE
    selection type: JQUERY SELECTOR
    jquery selector: input[name='f10'],input[name='f11'],input[name='f12'],.shark_info, .hms_info
    true action1: set value, javascript expression, set P110_ID = this.triggeringElement.id AFFECTED ITEM P110_VALUE
    true action2: execute pl/sql code
    begin 
    null; 
    end;
    page items to submit: P110_ID
    true action3: set value, javascript expression, set P110_VALUE = this.triggeringElement.value AFFECTED ITEM P110_VALUE
    true action4: set value: PL/SQL expression, set P110_SEQ = rtrim(substr(:P110_ID,5,4),'0')    AFFECTED ITEM: P110_SEQ
    true action5: execute pl/sql code
    declare 
      v_attr number; 
    begin  
      v_attr := TO_NUMBER (SUBSTR (:P110_id, 2, 2)); 
      apex_collection.update_member_attribute 
                       (p_collection_name      => 'SPECIES_COLLECTION', 
                        p_seq                  => :P110_SEQ, 
                        p_attr_number          => v_attr, 
                        p_attr_value           => :P110_VALUE); 
    end; 
    page items to submit: P110_ID, P110_VALUE, P110_SEQ
    true action6:  refresh region
    The value of v_attr is set to a substr of P110_ID....and p110_id is based on the ID of the item. 
    I have one item, a radio group called c024.   It is not called as an apex_item because the radio group (for whatever reason) would not work.  Therefore, in order for c024 to correspond to attribute 24, I must make certain that there are 23 editable items appearing before it...or at least that is the only way to get it to work.
    I am wondering if there is a way to assign the ID='f24'+seq manually in much the same way that I assigned the CSS class=.SHARK_INFO to this item.
    any clues appreciated.
    thanks,
    Karen
    ps.  the query for the tabular form is:  (and really, anything without an alias could be removed, but is there to ensure that c024 = f24.  ugh.  Is there a better way?
    SELECT
    apex_item.text(1,seq_id,'','','id="f01_'||seq_id,'','') "DeleteRow",
    seq_id,
    seq_id display_seq_id,
    c003,
    c004,
    c005,
    c006,
    apex_item.text_from_LOV(c004,'SPECIES')||'-'||apex_item.text_from_LOV(c005,'GRADE')||'-'||apex_item.text_from_LOV(c006,'MARKETCODE')||'-'||apex_item.text_from_LOV_query(c007,'select unit_of_measure d, unit_of_measure r from species_qc') unit,
    apex_item.select_list_from_LOV(8,c008,'DISPOSITIONS','onchange="getAllDisposition('||seq_id||')"','YES','0','  -- Select Favorite --  ','f08_'||seq_id,'') Disposition,
    apex_item.select_list_from_LOV(9,c009,'GEARS','style="background-color:#FBEC5D; "onFocus="checkGearPreviousFocus('||seq_id||');"onchange="getAllGears('||seq_id||')"','YES','3333','-- Select Favorite --','f09_'||seq_id,'') Gear,
    apex_item.text(10,TO_NUMBER(c010),5,null, 'onchange="setTotal('||seq_id||')"','f10_'||seq_id,'') Quantity,
    apex_item.text(11,TO_NUMBER(c011),5,null,'onchange="getPriceBoundaries('||seq_id||')"','f11_'||seq_id,'') Price,
    apex_item.text(12, TO_NUMBER(c012),5,null, 'onchange="changePrice
    ('||seq_id||')" onKeyDown="selectDollarsFocus('||seq_id||',event);"','f12_'||seq_id,'') Dollars,
    decode(c013,'Y',apex_item.text(14, c014,30,null,'style="background-color:#FBEC5D;" onClick="onFocusAreaFished('||seq_id||');"','f14_'||seq_id,''),'N','N/A') Area_Fished,
    c014,
    c015,
    c016,
    c017 additional_measure_flag,
    decode(c017,'Y',apex_item.text(18, c018,4,null,'style="background-color:#FBEC5D; "onBlur="setUnitQuantity('||seq_id||')"','f18_'||seq_id,''),'N','N/A') UNIT_QUANTITY,
    decode(c017,'Y',apex_item.text(19,'CN',3,null,'readOnly=readOnly;','f19_'||seq_id,''),'N','N/A') UNIT_COUNT,
    c024 fins_attached,
    apex_item.textarea(28,c028,3,null,'class="hms_info"','f28_'||seq_id,'') Explanation,
    decode(c024,'N',apex_item.select_list_from_LOV(29,c029,'HMSNATURE','class="hms_info"''onchange="saveNature('||seq_id||')"','YES','A','-- Select Nature of Sale --','f29_'||seq_id,''),'U',apex_item.select_list_from_LOV(29,c029,'HMSNATURE','onchange="saveNature('||seq_id||')"','YES','A','-- Select Nature of Sale --','f29_'||seq_id,''),'Y','N/A') Nature_Of_Sale,
    c030,
    c031,
    c032,
    c033,
    c034,
    c035,
    c036,
    c037,
    c038,
    c039,
    apex_item.select_list_from_LOV(40,c040,'HMS_AREA_CODE','style="background-color:#FBEC5D;" class="hms_info"
    ',null,null,null,'f40_'||seq_id,'')  HMS_AREA_CODE,
    c020,
    apex_item.text(41,TO_NUMBER(c041),5,null, 'class="hms_info"','f41_'||seq_id,'') Sale_Price,
    c042,
    c043,
    c044,
    c050
    from apex_collections
    where collection_name = 'SPECIES_COLLECTION' order by seq_id

    I hope it's the done thing to add to an old thread, instead of starting a new one.
    I'd like to be able to clear my form history, but not clear my search history.
    I'm using Firefox 7.0.1, but it still seems to be a combined option.
    Would it be possible to separate the two options in later versions?
    I've found two extensions that might help, but it would be nice to simply have two separate options.
    https://addons.mozilla.org/en-US/firefox/addon/form-history-control/
    https://addons.mozilla.org/en-US/firefox/addon/clear-form-history/
    Thanks in advance.

  • Help using a dynamic action to update tabular form items (specifically radio button) based on collection

    Hi Everyone, I have posted this question in the past and made huge progress with Denes Kubicek's help:  https://apex.oracle.com/pls/apex/f?p=31517:294:115851992029365::::: based on my earlier question posted: https://forums.oracle.com/forums/thread.jspa?threadID=2537494
    I am struggling with one item in my tabular form.  It is a radio button.  The choices all appear properly, but the value is not saved in the collection (and hence, not saved in the table).  All other items in the tabular form save properly.
    here is what I have for the query.   It is item c024 (which maps to ;'f03'), which is defined as a radio LOV based on an existing LOV.
    Currently I have:
    2 page items:
    P110_ID
    P110_VALUE
    Dynamic action called CHANGE COLUMN:
    event: CHANGE
    selection type: jQUERY Selector
    jQuery:
    jQuery Select = input[name='f03'],select[name'f08'],select[name='f09'],input[name='f10'],input[name='f11'],input[name='f12'],select[name='f40'],input[name='f21'],input[name='f22'],input[name='f23'],input[name='f50']
    event scope: Dynamic
    true action#1: set value P110_ID javascript expression this.triggeringElement.id
    true action#2: set value P110_VALUE javascript expression this.triggeringElement.value
    true action#3: execute pl/sql code
    declare
      v_member number;
      v_seq number;
    begin
      v_member := TO_NUMBER (SUBSTR (:p110_id, 2, 2));
      select ltrim(substr(:p110_ID,5,4),'0') into v_seq from dual;
      safis_collections.update_column(v_seq,
                                    v_member,
                                    :p110_value);
    true ation#4 refresh region :LANDINGS_COLLECTION
    the tabular form is based on the query:
    SELECT
    apex_item.text(1,seq_id,'','','id="f01_'||seq_id,'','') "DeleteRow",
    seq_id,
    seq_id display_seq_id,
    apex_item.text_from_LOV(c004,'SPECIES')||'-'||apex_item.text_from_LOV(c005,'GRADE')||'-'||apex_item.text_from_LOV(c006,'MARKETCODE')||'-'||apex_item.text_from_LOV_query(c007,'select unit_of_measure d, unit_of_measure r from species_qc') unit,
    apex_item.select_list_from_LOV(8,c008,'DISPOSITIONS','onchange="getAllDisposition('||seq_id||')"','YES','0','  -- Select Favorite --  ','f08_'||seq_id,'') Disposition,
    apex_item.select_list_from_LOV(9,c009,'GEARS','style="background-color:#FBEC5D; "onFocus="checkGearPreviousFocus('||seq_id||');"onchange="getAllGears('||seq_id||')"','YES','3333','-- Select Favorite --','f09_'||seq_id,'') Gear,
    apex_item.text(10,TO_NUMBER(c010),5,null, 'onchange="setTotal('||seq_id||')"','f10_'||seq_id,'') Quantity,
    apex_item.text(11,TO_NUMBER(c011),5,null,'onchange="getPriceBoundaries('||seq_id||')"','f11_'||seq_id,'') Price,
    apex_item.text(12, TO_NUMBER(c012),5,null, 'onchange="changePrice
    ('||seq_id||')" onKeyDown="selectDollarsFocus('||seq_id||',event);"','f12_'||seq_id,'') Dollars,
    decode(c013,'Y',apex_item.text(14, c014,30,null,'style="background-color:#FBEC5D;" onClick="onFocusAreaFished('||seq_id||');"','f14_'||seq_id,''),'N','N/A') Area_Fished,
    decode(c017,'Y',apex_item.text(18, c018,4,null,'style="background-color:#FBEC5D; "onBlur="setUnitQuantity('||seq_id||')"','f18_'||seq_id,''),'N','N/A') UNIT_QUANTITY,
    decode(c017,'Y',apex_item.text(19,'CN',3,null,'readOnly=readOnly;','f19_'||seq_id,''),'N','N/A') UNIT_COUNT,
    c024 hms_flag,
    decode(c050,'Y',apex_item.checkbox(21,'Y','id="f21_'||seq_id||'" style="background-color:#FBEC5D; " onClick="alterYes('||seq_id||');" onKeyPress="alterYes('||seq_id||');"',c021),'N','N/A') FinsAttached,
    decode(c050,'Y',apex_item.checkbox(22,'N','id="f22_'||seq_id||'" style="background-color:#FBEC5D;" onClick="alterNo('||seq_id||');" onKeyPress="alterNo('||seq_id||');"',c022),'N','N/A') FinsNotAttached,
    decode(c050,'Y',apex_item.checkbox(23,'U','id="f23_'||seq_id||'" style="background-color:#FBEC5D;" onClick="alterUnk('||seq_id||');" onKeyPress="alterUnk('||seq_id||');"',c023),'N','N/A') FinsUnknown,
    decode(c050,'Y',apex_item.textarea(28,c028,3,null,null,'f28_'||seq_id,''),'N','N/A') Explanation,
    decode(c024,'N',apex_item.select_list_from_LOV(29,c029,'HMSNATURE','onchange="saveNature('||seq_id||')"','YES','A','-- Select Nature of Sale --','f29_'||seq_id,''),'U',apex_item.select_list_from_LOV(29,c029,'HMSNATURE','onchange="saveNature('||seq_id||')"','YES','A','-- Select Nature of Sale --','f29_'||seq_id,''),'Y','N/A') Nature_Of_Sale,
    decode(c020,'Y',
    apex_item.select_list_from_LOV(40,c040,'HMS_AREA_CODE','style="background-color:#FBEC5D;"',null,null,null,'f40_'||seq_id,''),
    'N','N/A') HMS_AREA_CODE,
    c020,c050,
    decode(c020,'Y',
    apex_item.text(41,TO_NUMBER(c041),5,null,null,'f41_'||seq_id,''),
    'N','N/A') Sale_Price
    from apex_collections
    where collection_name = 'SPECIES_COLLECTION' order by seq_id
    I have noticed the following:
    when I change column C011 (price) the following values are set in the dynamic action:
    P110_ID = f11_1
    P110_VALUE = whatever I change the price to.
    when I change the column C024 (hms_flag), the following values are set:
    P110_ID = f03_0001
    P110_VALUE = whatever I change hms_flag to.
    the region is refreshed in my dynamic action, and the change for hms_flag does not hold.  I have tested the SQL query that generates the value for v_SEQ in the dynamic action.   In both a change to price and HMS_FLAG it appears valid
    select ltrim(substr(:p110_ID,5,4),'0') into v_seq from dual;
    if f11_1, v_seq:= 1
    if f03_0001, v_seq := 1
    thank you!

    solved.  sort of. 
    field c024 references f03.
    the Dynamic ACtion, step 4 calculates v_member by taking a substring of P110_ID...and in all other fields, the column and the field (fxx) are the same value....except for c024.
    I am not certain exactly how to resolve, but see the problem.

  • Conditional Select List in a Report maintained using a Multi Row Update

    I have a SQL Report that is maintained with a "Multi Row Update" process. One of the columns needs to be ether a "Select List" based on a named LOV or just "Text" (Read Only) based on the value in the column. I have the UI working using a case statement and apex_items in me SQL but the Report Column is not marked "Edit" and the "Multi Row Update" process just ignores changes.
    Any help would be great!

    Just curious, why is the first parameter to in third TEXT_FROM_ITEM invocation NULL instead of 20? Also check your first parameter in your ELSE. Shouldn't it be a global number as well?
    Did you try adding a hidden item to your SELECT statement? Something like:
    (case
    when CSSN.KTTR_BILL_STAT_UID = KT_UTIL_PKG.get_kttr_uid_from_ref_val('SESSION_BILL_STAT','SESSION_BILL_STAT_1') then
    apex_item.select_list_from_lov(20,CSSN.KTTR_BILL_STAT_UID,'KTTR_SESSION_BILL_STAT_PRPR','','NO')
    when CSSN.KTTR_BILL_STAT_UID = KT_UTIL_PKG.get_kttr_uid_from_ref_val('SESSION_BILL_STAT','SESSION_BILL_STAT_2') then
    apex_item.select_list_from_lov(20,CSSN.KTTR_BILL_STAT_UID,'KTTR_SESSION_BILL_STAT_PRPR','','NO')
    when CSSN.KTTR_BILL_STAT_UID is null then
    apex_item.text_from_lov(20,'KTTR_SESSION_BILL_STAT')
    else
    apex_item.text_from_lov(20,CSSN.KTTR_BILL_STAT_UID,'KTTR_SESSION_BILL_STAT')
    end) as KTTR_BILL_STAT_DISP,
    apex_item.hidden(30,CSSN.KTTR_BILL_STAT_UID) MIRRORThen in either an Javascript onBlur event on KTTR_BILL_STAT_DISP or in a Page Process assign the value of KTTR_BILL_STAT_DISP to MIRROR.
    Mike

  • Sorting of columns in report with values from lookup table (LOV)

    Hi,
    I have a report where I looku the values using a number of LOVs. I'd like to enable sorting on those columns in the report whihc works BUT the report get's sorted on the numric looku pvalue instead of the description for example COUNTRY_ID instead of COUNTRY_DESC.
    I have played around with the function APEX_ITEM.ITEM_TET_FROM_LOV in my SQL query:
    select ID, NAME,
    APEX_ITEM.TEXT_FROM_LOV(COUNTRY_ID, 'COUNTRY_LOOKUP') COUNTRY,
    from VAR
    But I get the following error:
    report error:
    ORA-06550: line 1, column 13:
    PLS-00103: Encountered the symbol "COLLECT" when expecting one of the following:
    := . ( @ % ;
    ORA-06550: line 1, column 82:
    PLS-00103: Encountered the symbol ";" when expecting one of the following:
    . ( , % from
    So I am thinking that I am doing something very wrong? Is there another way to accomplish this?
    Andy

    you need to use htmldb_item.text_from_lov in your query.
    this will then deocde the key value to the description within the query itself and therefore allow you to do your sorting.

  • Column based on LOV in a classic report

    In a classic report i want to display a value coming from an lov, based on the value of a column. I can't seem to make this work however, not even on apex.oracle.com. I too am on apex 4.1.
    What i've tried is to set the column to display as text, based on lov. I've tried named static and dynamic lovs, and tried to supply an own lov definition, both static and dynamic. Even apex_item doesn't seem to work.
    As a test, i has set this up on apex.oracle.com:
    Classic report:
    Region source:
    select status, descr, apex_item.text_from_lov(status, 'lov_status') status2
    from
    select 15 status, 'test for status 1' descr from dual
    union all
    select 30 status, 'test for status 2' descr from dual
    union all
    select 45 status, 'test for status 3' descr from dual
    Column attributes for column status:
    Display As: Display as Text (based on LOV, does not save state)
    List of Values -> Named LOV: LOV_STATUS
    LOV_STATUS (shared components -> lists of values):
    this is a static lov, with these values:
    15;'Status One'
    30;'Status Two'
    45;'Status Three'
    60;'Status Four'
    (which could also be used as a non-named lov like: STATIC2:15;'Status One',30;'Status Two',45;'Status Three',60;'Status Four')
    Both column status as status2 simply keep displaying their value, and not the 'display value' i'd expect coming from the lov.
    I could use decode or case, yes. But using an lov keeps it cleaner, especially when there are more than 3 or 4 values, and could be reused in more reports.
    Am i using or doing this wrong?

    Hi Tom,
    revert the order of your LOV items ( so first description and then ID ),
    like for example :
    STATIC2:'Status One';15,'Status Two';30,'Status Three';45,'Status Four';60
    That does the trick ( tried it ).
    If you want to see an example check page 2 of the only app on apex.oracle.com
    WS : bklerk
    User : demo
    PWD : demo123
    Regards
    Bas

  • Creating collection vs. materialized view - better performance?

    Hi, I am trying to improve the performance of our application and am looking at everything possible. I am wondering if the use of multiple, complex collections is slowing down our application. Would the use of materialized views, as opposed to collections improve things? thanks Karen

    to provide more info....
    here is the process which creates the list of species based on favorite species identified (and followed by the query to select from this collection)
    declare
    yes_are NUMBER;
    pCount NUMBER;
    l_seq_id NUMBER;
    yes_hms NUMBER;
    found_area NUMBER;
    found_unit NUMBER;
    unitmeasure VARCHAR2(2);
    pbCount NUMBER;
    pbPrice NUMBER;
    begin
    --create license collection so that if error on a submit the information retains
    if apex_collection.collection_exists('LICENSE_COLLECTION') then
    apex_collection.delete_collection('LICENSE_COLLECTION');
    end if;
    --create vessel collection so that if error on a submit the information retains
    if apex_collection.collection_exists('SUPVES_COLLECTION') then
    apex_collection.delete_collection('SUPVES_COLLECTION');
    end if;
    apex_collection.create_or_truncate_collection('FP_COLLECTION');
    --create collection to save landings
    apex_collection.create_or_truncate_collection('SPECIES_COLLECTION');
    --loop through the favorite species and populate with pre-existing data
    for rec IN (select *
    from frequent_species
    where permit_id = :G_PERMIT_ID
    order by fav_order)
    LOOP
    -- check to see if there is a priceboard entry for the favorite species
    select count(*) into pbCount
    from price_board
    where permit_id = :G_PERMIT_ID and
    species_itis = rec.species_itis and
    grade_code = rec.grade_code and
    market_code = rec.market_code and
    unit_of_measure = rec.unit_measure and
    price is not null;
    -- if there is a price board entry
    if pbCount = 1 then
    --get the default price for that species combination
    select price into pbPrice
    from price_board
    where permit_id = :G_PERMIT_ID and
    species_itis = rec.species_itis and
    grade_code = rec.grade_code and
    market_code = rec.market_code and
    unit_of_measure = rec.unit_measure and
    price is not null;
    --add landings row with price board data
    l_seq_id := apex_collection.add_member('SPECIES_COLLECTION',
    null,
    null,
    null,
    rec.species_itis,
    rec.grade_code,
    rec.market_code,
    rec.unit_measure,
    nvl(rec.disposition_code,:G_FIRST_DISPOSITION),
    0, null,pbPrice,null);
    -- no price board entry
    else
    -- add landings row without any priceboard data
    l_seq_id := apex_collection.add_member('SPECIES_COLLECTION',
    null,
    null,
    null,
    rec.species_itis,
    rec.grade_code,
    rec.market_code,
    rec.unit_measure,
    nvl(rec.disposition_code,:G_FIRST_DISPOSITION),
    0, null,null,null);
    end if;
    apex_collection.update_member_attribute(p_collection_name=>'SPECIES_COLLECTION',
    p_seq => l_seq_id,
    p_attr_number =>14,
    p_attr_value => 'ERROR');
    --set first disposition
    :G_FIRST_DISPOSITION := nvl(rec.disposition_code,:G_FIRST_DISPOSITION);
    found_area:=0;
    -- All rows need to be checked to determine if additional info is needed based on partner_options table
    -- check if AREA will be needed
    select count(*) into found_area
    from partner_options
    where partner_id = :G_ISSUING_AGENCY and
    substr(species_itis,1,6) = rec.species_itis and
    option_type = 'ARE' and
    nvl(inactivate_option_date, sysdate) >= sysdate;
    -- landing row requires AREA data
    if found_area > 0 then
    apex_collection.update_member_attribute(p_collection_name=>'SPECIES_COLLECTION',
    p_seq => l_seq_id,
    p_attr_number =>13,
    p_attr_value => 'Y');
    -- landing row does NOT require AREA data
    else
    apex_collection.update_member_attribute(p_collection_name=>'SPECIES_COLLECTION',
    p_seq => l_seq_id,
    p_attr_number =>13,
    p_attr_value => 'N');
    end if;
    found_unit := 0;
    -- check if COUNT will be needed
    select count(*) into found_unit
    from partner_options
    where partner_id = :G_ISSUING_AGENCY and
    substr(species_itis,1,6) = rec.species_itis and
    option_type = 'LBC' and
    nvl(inactivate_option_date, sysdate) >= sysdate;
    -- landing row requires UNIT data
    if found_unit > 0 then
    select unit_measure into unitmeasure
    from partner_options
    where partner_id = :G_ISSUING_AGENCY and
    substr(species_itis,1,6) = rec.species_itis and
    option_type = 'LBC' and nvl(inactivate_option_date, sysdate) >= sysdate;
    apex_collection.update_member_attribute(p_collection_name=>'SPECIES_COLLECTION',
    p_seq => l_seq_id,
    p_attr_number =>17,
    p_attr_value => 'Y');
    apex_collection.update_member_attribute(p_collection_name=>'SPECIES_COLLECTION',
    p_seq => l_seq_id,
    p_attr_number =>19,
    p_attr_value => unitmeasure);
    --landing row does NOT require UNIT data
    else
    apex_collection.update_member_attribute(p_collection_name=>'SPECIES_COLLECTION',
    p_seq => l_seq_id,
    p_attr_number =>17,
    p_attr_value => 'N');
    end if;
    -- check if HMS
    SELECT count(*) into yes_hms
    FROM HMSSpecies a
    where hmsspeciesitis = rec.species_itis;
    -- landing row requires HMS data
    if yes_hms > 0 and rec.grade_code = '10' then
    apex_collection.update_member_attribute(p_collection_name=>'SPECIES_COLLECTION',
    p_seq=> l_seq_id,
    p_attr_number=>20,
    p_attr_value=>'Y');
    else
    -- landing row does NOT require HMS data
    apex_collection.update_member_attribute(p_collection_name=>'SPECIES_COLLECTION',
    p_seq=> l_seq_id,
    p_attr_number=>20,
    p_attr_value=>'N');
    end if;
    end loop;
    end;
    and the query for the region:
    SELECT
    apex_item.text(1,seq_id,'','','id="f01_#ROWNUM#"','','') "DeleteRow",
    apex_item.text_from_LOV(c004,'SPECIES')||'-'||apex_item.text_from_LOV(c005,'GRADE')||'-'||apex_item.text_from_LOV(c006,'MARKETCODE')||'-'||apex_item.text_from_LOV_query(c007,'select unit_of_measure d, unit_of_measure r from species_qc') unit,
    apex_item.select_list_from_LOV(6,c008,'DISPOSITIONS','onchange="getAllDisposition(#ROWNUM#)"','YES','0',' -- Select Favorite -- ','f06_#ROWNUM#','') Disposition,
    apex_item.select_list_from_LOV(7,c009,'GEARS','style="background-color:#FBEC5D; "onFocus="checkGearPreviousFocus(#ROWNUM#);"onchange="getAllGears(#ROWNUM#)"','YES','0','-- Select Favorite --','f07_#ROWNUM#','') Gear,
    apex_item.text(8,TO_NUMBER(c010),5,null,'onchange="setTotal(#ROWNUM#)"','f08_#ROWNUM#','') Quantity,
    apex_item.text(9,TO_NUMBER(c011),5,null,'onchange="getPriceBoundaries(#ROWNUM#)"','f09_#ROWNUM#','') Price,
    apex_item.text(10, TO_NUMBER(c012),5,null, 'onchange="changePrice(#ROWNUM#)" onKeyPress="selectDollarsFocus(#ROWNUM#);"','f10_#ROWNUM#','') Dollars,
    apex_item.select_list_from_LOV_XL(11, c014,'AREAFISHED','style="background-color:#FBEC5D; "onchange="getAllAreaFished(#ROWNUM#)"','YES','ERROR','-- Select Area Fished --','f11_#ROWNUM#','') Area_Fished,
    apex_item.text(12, c018,4,null,'style="background-color:#FBEC5D; "onBlur="setUnitQuantity(#ROWNUM#)"','f12_#ROWNUM#','') UNIT_QUANTITY,
    apex_item.text(13, 'CN',3,null,'readOnly=readOnly','f13_#ROWNUM#','') UNIT_COUNT,
    apex_item.checkbox(14,'Y','id="f14_#ROWNUM#" style="background-color:#FBEC5D; " onClick="alterYes(#ROWNUM#);" onKeyPress="alterYes(#ROWNUM#);"',c021) FinsAttached,
    apex_item.checkbox(15,'N','id="f15_#ROWNUM#" style="background-color:#FBEC5D; " onClick="alterNo(#ROWNUM#);" onKeyPress="alterNo(#ROWNUM#);"',c022) FinsNotAttached,
    apex_item.checkbox(16,'U','id="f16_#ROWNUM#" style="background-color:#FBEC5D; " onClick="alterUnk(#ROWNUM#);" onKeyPress="alterUnk(#ROWNUM#);"',c023) FinsUnknown
    from apex_collections
    where collection_name = 'SPECIES_COLLECTION' order by seq_id
    /

  • What's the deal with 'no data found in tabular form' in apex 4.1

    We recently upgraded to 4.1 to resolve some of the issue found in 4.0. I have a form that populates a collection....it had previously worked in earlier versions and now I receive the following error when I try and SAVE.
    any thoughts?
    Contact your application administrator.
    no data found in tabular form

    HI Joel, thanks for getting back to me.
    We recently moved from apex 4.0 to 4.1. I have an application that makes use of collections. All was working in 4.0, but now I am having problems with 4.1. I would be happy to move place application in more convenient spot, but need specific instructions as I am not certain how to do that.
    basically, I have a report region, FAVORITES based on a collection (source listed below):
    SELECT apex_item.checkbox (1,seq_id, 'onclick="highlight_row(this,'
    || seq_id
    ||')"', NULL, ':', 'f01_'
    || LPAD (seq_id, 4, '0') ) delete_checkbox,
    apex_item.hidden(2,seq_id) seq_id,
    apex_item.hidden(3,seq_id),
    apex_item.text_from_LOV(c004,'SPECIES')SPECIES_ITIS,
    apex_item.text_from_LOV(c005,'GRADE')GRADE,
    apex_item.text_from_LOV(c006,'MARKETCODE') MARKET_CATEGORY,
    apex_item.text_from_LOV_query(c007,'select unit_of_measure d, unit_of_measure r from species_qc') unit,
    apex_item.text(8,c008,5) fav_order,
    apex_item.select_list_from_lov
    (9,
    c009,
    'DISPOSITIONS',
    'style="width:200px;background-color:#FBEC5D; "',
    'YES',
    '0',
    '- Select Disposition -',
    'f09_' || LPAD (seq_id, 4, '0'),
    NULL,
    'NO'
    ) disposition_code
    from apex_collections
    where collection_name = 'C_DEALER_SPECIES_FAV' order by seq_id desc, c008
    The collection appears and I am able to add rows to this collection. The problem is when I SAVE. The following is executed (and again, works fine in 4.0).
    declare
    dispositionCode varchar2(3);
    begin
    delete from frequent_species where permit_id = :G_permit_id;
    for rec in (select c004,c005, c006, c007,c008,c009,:G_permit_id from apex_collections where collection_name = 'C_DEALER_SPECIES_FAV')
    loop
    if rec.c009 = '0' then
    dispositionCode := null;
    else
    dispositionCode := rec.c009;
    end if;
    insert into FREQUENT_SPECIES (species_itis, grade_code, market_code, unit_measure, fav_order, disposition_code,permit_id) values(rec.c004,rec.c005, rec.c006, rec.c007,rec.c008,dispositionCode,:G_permit_id);
    end loop;
    exception when no_data_found then null;
    end;
    I receive the message:
    Contact your application administrator.
    no data found in tabular form
    Return to application.
    Let me know what you think. thanks for your help. Karen

  • Refer to the 'key' in a LOV

    Hi All
    how do i refer to the 'key' in a LOV (key - value)?
    for example: my LOV is : 1;one,2;two,3;three.
    :PX_ITEM will return the 'value' (one, two, three). how do i refer to (1, 2, 3) ?
    thanx

    Hi Liron,
    Yes - I'm assuming that the data is available from a table. As I don't know your tables, I've used "descriptionfieldname", "idfieldname" and "table" - replace these to return the name of the field that contains the description you want in the column heading, the name of the field that contains the LOV key ID and the name of the table that contains the LOV data.
    I don't know why apex_item.text_from_lov doesn't work from with the header definition (it could be because this is normally used to create the tabular form?) - hence suggesting that you retrieve the text you need using a normal select statement.
    Regards
    Andy

  • How do I edit the display position of the assignment icon?

    Hi everyone,
    I am using Oracle Busines Process Architect 11gR1.
    The filter is the standard Oracle BPA Filter, and I am working with functions in BPMN models.
    I am building a high level business process chart with "drill down" into more detailed processes via assignments linking to more detailed breakdowns. By default the assignment icon (the icon you click on to take you to the assigned diagram) appears on the bottom right corner, which can be confusing when two high level functions are placed side by side.
    I know with attributes there are options to place them at various points around the object, or free form placement, is there similiar functionality for the assignment icon?
    Thanks in advance!!!

    Hi Varad,
    I tried your suggestion, but nothing shows.. My pn_person_name item is a simple text item. I've tried displaying it in the same region as the other search criteria and still nothing...
    I know that pn_person_code is changing as I've added this to the region title and it changes...
    Also, given that I have a named LOV for the "select short_name from investors" query, I would prefer if I could reuse this already 'coded' query instead of having to specify it in this page - hence I thought that apex_item.text_from_lov(:p10_recipient,'LOV_INVESTORS', 'aaa') would be ideal...
    Thx
    Caron

  • Interactive Report Slow with Filters

    Hello,
    I have a report that uses the query below:
    select
    a."ID",
    a."USER_ID",
    a."DATE_OF_SERVICE",
    to_char(a.DATE_OF_SERVICE,'MM/DD/YYYY HH12:MI:SS') as datetime,
    a."CLIENT_NAME_LAST_FIRST" as ClientName,
    a."CCSS",
    a."CD_90801_UNITS",
    a."CD_90804_UNITS_B",
    a."CD_90806_UNITS",
    a."CD_90808_UNITS_B",
    a."CD_90812_UNITS",
    a."CD_90814_UNITS_B",
    a."CD_90846_UNITS",
    a."CD_90847_UNITS",
    a."CD_90853_UNITS",
    a."OTHER",
    a."PP",
    a."PP_UNITS",
    a."APS_BILLING_UNITS",
    a."MST_SUPE_HOURS",
    a."OTHER_HOURS",
    a."ADMIN_HOURS",
    a."PSB_HOURS",
    a."POS",
    a."MST",
    a."TOTAL_HOURS",
    a."TOTAL_UNITS",
    a."COMMENTS",
    a."ENTRY_DT",
    decode(a.PATIENT_ID,1,'Administrative Client',2,'Private Pay Client',3,'APS Administrative Client',5,'APS Suicide Assessment Client',7,'APS Therapy Client',9,'MST/PSB Supervision',11,'Other Client',(b.LNAME||', '||b.FNAME||' '||b.MI)) AS Patient_Name,
    (c.LAST_NAME||', '||c.FIRST_NAME||' '||c.MI) AS Prov_Full_Name,
    c.USER_ID as ProviderID,
    a.CORRECTION,
    a.CORRECT_DT_ACT,
    a.STATUS,
    APEX_ITEM.TEXT_FROM_LOV(a.PROFILE_ID, 'APPLICATION PROFILES') PROFILE_NAME,
    a.PROFILE_ID,
    a.SUR_ID,
    a.SUR_PROFILE_ID,
    a.COPAY_COLLECTED,
    a.NO_COPAY_REASON,
    APEX_ITEM.TEXT_FROM_LOV(a.SUR_ID, 'PROV_SHORT_LOV') Surrogate
    from BILLING a, PATIENT b, USERS c
    WHERE a.PATIENT_ID = b.ID (+)
    AND a.USER_ID = c.USER_ID
    AND (a.PROFILE_ID = :G_PROFILE_ID
    OR :G_PROFILE_ID = '100'
    OR (:G_PROFILE_ID = '106' AND a.PROFILE_ID = '102')
    OR (:G_PROFILE_ID = '121' AND a.PROFILE_ID = '120')
    AND ENTRY_DT > SYSDATE - 90
    AND DATE_OF_SERVICE > SYSDATE - 90The page loads quickly initially, but when any filters are used in the report, it takes a long time to refresh the report.
    I have used debug to see what is taking so long but the only "long" operation is the one that binds the maximum number of rows that is set in the Report Definition.
    Does anyone have any suggestions on how to make the biggest improvement on the performance (indexes, SQL, something in the IR itself)?
    Any help is greatly appreciated.
    Thanks,
    Matt

    One suggestion, since you just need the name columns from your alias C, I would get them using an inline select to save on the cost of your join in your select.
    Thank you,
    Tony Miller
    Webster, TX
    There are two kinds of pedestrians -- the quick and the dead.

  • Bug or feature: APEX_ITEM.DISPLAY_AND_SAVE (1, DATE) is sort by alphanumeric...???

    Hi,
    my select is like this:
    select
         APEX_ITEM.DISPLAY_AND_SAVE (1, STICHTAG) as STICHTAG, --Datatype is date
         APEX_ITEM.DISPLAY_AND_SAVE (2, Name) as Name,
         APEX_ITEM.DISPLAY_AND_SAVE (3, Animal) as animal
    From XYZ;
    If i want to sort asc/ desc by STICHTAG...Apex sort it by alphanumeric...not by the higest or lowes date...Why APEX do it and how can i fix it and sort by higest or lowest date?
    THX,
    René

    RWErene81 wrote:
    my select is like this:
    select
         APEX_ITEM.DISPLAY_AND_SAVE (1, STICHTAG) as STICHTAG, --Datatype is date
         APEX_ITEM.DISPLAY_AND_SAVE (2, Name) as Name,
         APEX_ITEM.DISPLAY_AND_SAVE (3, Animal) as animal
    From XYZ;
    If i want to sort asc/ desc by STICHTAG...Apex sort it by alphanumeric...not by the higest or lowes date...Why APEX do it and how can i fix it and sort by higest or lowest date?
    Previously asked and answered: Date format in apex items
    This is not a bug. The contents of the column is a character string generated by APEX_ITEM.DISPLAY_AND_SAVE.

Maybe you are looking for

  • Printing only single page -SAPSCRIPT

    Hi, I am printing checks and in the page attributes NEXT Page is EMPTY. still it is printing scedond page which I don't need. Any ideas? rgds Praveen

  • PDF Form opening on Acrobat X

    I cannot open a downloaded PDF Form on Acrobat X on Mac, but it opens on Acrobat Reader. My Plug.in AcroForm is loaded. Any hint or halp available? Message given by ACROBAT X: "Unable to read the form. Do not save and exit the program as it might cau

  • Inconsistent entries between driver_aliases and path_to_inst

    Hi, I see the following in my solaris intel box. bash-2.03# grep iprb /etc/driver_aliases iprb "pci8086,1229" iprb "pci8086,1029" bash-2.03# grep iprb /etc/path_to_inst "/pci@0,0/pci8086,100c@6" 0 "iprb" bash-2.03# 100c is the inte pro/1000 gig NIC a

  • Mainstage2.1.3 Crashing With OSX 10.7.4

    I am going on tour in early August and this needs to be rock solid. Do I need to use a separate hard drive for my concerts and Logic libraries?

  • Maintenance Cycle - ChaRM - Operation type SDMN

    HI, Gurus. I need to come back the status of the operation SDMN (Maintenance Cycle). The status was changed to "Being Completed" but this operation doesn't be closed. How i can change (rollback) the status to "Go Live"? Below, the error messagens: "P