SQL Select on Static LOV

Hi,
Im using XML Publisher to produce PDF Reports from my APEX application. Im using XLIFF to translate my application.
I need to decode some code values that may be multi-lingual from my application with SQL to produce the reports in XML Publisher.
Is it possible to access your Static Application LOVs from SQL? (Maybe some APEX Function??)
If it is possible can you also access your translated Static LOVs from SQL?
Thanks in advance!
-Immanuel

If you are running 3.0, the views are exposed in Utilities > APEX Views.
I just checked and we have specifically excluded the translated applications from the views - we will rectify that in some way in a future release. For now, I suggest you:
<ol><li>search your install for this file - apex_views.sql</li>
<li>copy the create statement for APEX_APPLICATION_LOV_ENTRIES</li>
<li>change the name of the view (so that you won't overwrite the one you have)</li>
<li>remove the following from the where clause
and not exists (
select 1 from wwv_flow_language_map
where translation_flow_id = f.id)
</li>
<li>run the statement as FLOWS_030000 (using either SQL*Plus or SQL Developer)</li>
<li>grant access on the new view to public (and create a public synonym if you don't want to qualify with FLOWS_030000)</LI>
</ol>
You will now have a view that will have all your lov values and you can join by the translated application id to find the rows you need. Given that this is so specific, you could even customize your new view further to provide you just what you need, without all the extra columns.
Hope it helps -
-- Sharon

Similar Messages

  • SQL query a Static LOV

    Hey everyone
    I'm trying to create a pivot report using a technique I'm reading on Ask Tom. In order to get it working I need to return the display values from a static LOV in a sub select statement without using the column attributes functionality available on page 422 of Apex.
    My static LOV has the following structure
    Display Return
    Monitorable 5
    Pay modifier/enabler 4
    Paid now and later 3
    Paid later 2
    Paid now 1
    My sub query has the following SQL where PAID_ID is equal to the return value of my Static LOV.
    select
    SCA.SCORE_ID AS "SCORE_ID",
    (SELECT MM1.TITLE FROM MET_METRICS MM1 WHERE MM1.MET_ID = SCA.MET_ID) AS "METRIC",
    (SELECT BU1.BU
    FROM MET_BU BU1,
    MET_SCORECARD MS1
    WHERE MS1.BU_ID = BU1.BU_ID
    AND MS1.SCORECARD_ID = SCA.SCORECARD_ID) AS "BUSINESS UNIT",
    SCA.PAID_ID AS "PAID_ID"
    from MET_SCORECARD_ALLOC SCA
    WHERE SCA.DELETED_BY IS NULL
    I'd like to replace PAID_ID with the display value of my LOV WITHOUT using the Column Attributes functionality available of page 422 of Apex.
    Is anyone able to advise whether it's possible to perform a join on the LOV directly in my sql query?
    Any assistance would be very much appreciated :)
    Dave

    Create a view for you LOV in de database :
    create or replace view v_display_return
    as
    select 'Monitorable' d, 5 v from dual
    union all
    select 'Pay modifier/enabler' d, 4 v from dual
    union all
    select 'Paid now and later' d, 3  v from dual
    union all
    select 'Paid later' d, 2  v from dual
    union all
    select 'Paid now' d, 1  v from dual
    ;Then you can use the view as the source of your LOV AND join it in your query.

  • Bug Report: Static LOV's and PDF Printing with Tabular Forms

    I have a tabular form, which acts as an editable report. Some columns are 'Standard Report Column' and some are Select Lists, using Static LOV's with the contents of
    Yes;Y,No;NThe purpose of the page is to allow users to edit yes/no attributes of a row. Then, they can print the report.
    To make the current sort of the report reflect what is being printed to PDF, I've used a Report Layout associated with the report region, as oposed to a report query. A report query in this case would not reflect the sort of the report (all columns are sortable asc/desc).
    Anyway, I link my report with the layout created, and go to run it. I get this message.
    ORA-06550: line 1, column 50: PLS-00103: Encountered the symbol "," when expecting one of the following: := . ( @ % ; The symbol ":= was inserted before "," to continue.
         Error      ERR-1000 Unable to determine LOV from "declare function x return varchar2 is begin Yes;Y,No;N return null; end; begin wwv_flow_utilities.g_query := x; end;".
    OK      
    report error:
    ORA-20001: Error fetching column value: ORA-01403: no data foundI'm guessing the product is trying to take my static LOV and place it in a function to be able to generate which value is being displayed as text, from the select lists. However, it doesn't work.
    I've been able to get around it - by adding a YES_NO domain to my domain_codes table (a table which associates abreviations with full meanings), I can set by select lists to be query based select lists using the SQL select code_meaning, code from domain_codes where domain = 'YES_NO_CODE'. This still allows the user to dropdown Yes/No fields, and the PDF printing doesn't break.
    It is just me, or can't the PDF printing handle static LOV's in tabular forms/reports?

    Hi Patrick.
    I've tried STATIC:Yes;Y,No;Nwhile stating it is a Select List (static LOV). The values that are rendered on the page are
    [STATIC:Yes]
    [No        ]
    ----------I tried the same thing with STATIC2 instead of STATIC, and the same thing happened.
    It also broke if I tried STATIC or STATIC2 under Select List (query based LOV). This is within a report where there is no hyperlink to say 'Create/Edit static list' or 'Create Dynamic List', as there is under select list items.
    However, I am finding that for some reason, the values being sent to the PDF are not the values in the database (Y/N), but the showing values (Yes/No). This happens when I use the domain_code select query as the query based LOV.
    Furthermore, I cannot get any columns not rendering on the page to be generated in the PDF. I have a column that groups items depending on values, and I want this grouping to display in the PDF instead on the original value, ideally.
    Cheers,
    K.

  • Referencing static LOV from plsql

    I have a number of static LOV's. How can I reference these in PL/SQL.
    For example, I am creating a report using PL/SQL so that I can create the exact layout I require. The data uses a number of list of values so I need to convert the value fields into the displays fields from the list of values using PL/SQL.
    How?

    Jezzer,
    It will depend on your version. If you are using 2.2 or 3.0, you could use the view APEX_APPLICATION_LOV_ENTRIES to access your lov values. It will automatically be limited to the workspace that your schema is associated with and then you can further qualify with the APPLICATION_ID and LIST_OF_VALUES_NAME. To see the view, navigate to Utilities > Application Express Views and query on lov.
    -- Sharon

  • Sql problem in apex LOV

    I am not able to use this SQL statement for apex LOV, any ideas?
    select username, id
    from abusers
    order by decode(id,0, NULL ,username) NULLS FIRST ;
    I get the following error message:
    1 error has occurred
    * LOV query is invalid, a display and a return value are needed, the column names need to be different. If your query contains an in-line query, the first FROM clause in the SQL statement must not belong to the in-line query.
    Re: How to concatenate two sql statements?

    Hi
    Remove the semi-colon at the end.
    Cheers
    Ben
    http://www.munkyben.wordpress.com
    Don't forget to mark replies helpful or correct ;)

  • Selecting both static and dynamic values in a report.

    Hello,
    I am using the following LOV for a select list in a form based on another post (Re: Static and Dynamic LOV ordering
    It is presenting five static values along with a dynamic LOV.
    select d, r
    from (select n, d, r
    from (select 1 as n, 'NAME_A' d, 1 r
    from dual
    union all
    select 1 as n, 'NAME_B' d, 2 r
    from dual
    union all
    select 1 as n, 'NAME_C' d, 3 r
    from dual
    union all
    select 1 as n, 'NAME_D' d, 4 r
    from dual
    union all
    select 1 as n, 'NAME_E' d, 5 r
    from dual
    union all
    select 2 as n,
    (LNAME || ', ' || FNAME || ' (' ||
    to_char(DOB, 'MM/DD/YYYY') || ')') display_value,
    ID return_value
    from my_name_table)
    ORDER BY n, r asc)
    The static display and return values do not exist in my_name_table, but the static return values are recorded in my_main_table when the user submits the form.
    The tables look like this:
    my_main_table:
    record_id
    name_id
    my_name_table:
    name_id
    fname
    lname
    How can I present the display values associated with the static return values recorded in my_main_table along with the dynamic display values in a report? I am currently presenting the dynamic portion in a report using the following select statment:
    select
    (my_name_table.LNAME||', '||my_name_talbe.FNAME) AS Name
    from my_name_table
    WHERE my_main_table.NAME_ID = my_name_table.NAME_ID
    I have the additional problem that the static return values are not in my_name_table so the join in the last statement will not find the static values in my_name_table.
    Edited by: mterlesky on Feb 24, 2009 9:51 AM

    1. You will need to add an outer join to return all the values in the Main table.
    2. Then decode the values for the static LOV.
    Something like (this is not tested, but should give you the idea)
    select
    decode(my_main_table.NAME_ID,1,'NAME_A',2,'NAME_B',3,'NAME_C',4,'NAME_D',5,'NAME_B',(my_name_table.LNAME||', '||my_name_talbe.FNAME)) AS Name
    from my_name_table
    WHERE my_main_table.NAME_ID = my_name_table.NAME_ID(+)
    This will all break if any of your static LOV ID values clash with your dynamic LOV ID values.
    I am now going to give you a long lecture about hard coding values ..... ;)
    Related info: http://simonhunt.blogspot.com/2009/02/how-to-cope-with-list-of-values-lovs.html
    I hope that helps
    Shunt

  • SQL to get a LOV based on a value range (zips based on zipcode range)

    I have a requirement to capture state,county,city and zipcode values based on AR Tax tables. I created an DFF with Input field for State, County and City and corresponding LOVs based on the tax tables. I am not sure how to proceed with zipcode (I am not a FORMS expert, that further makes it complicated :) )
    For those who are aware of the tax tables - AR_LOCATION_VALUES and AR_LOCATION_RATES, there are no list of zipcode values. zipcodes are maintained at the city record level as a range FROM_ZIP_CODE and TO_ZIP_CODE. So a CITY record for GA.FULTON.ATLANTA has a from_zip of 30301 and to_zip of 30321-9999. I am not worried of the ( +4 ) values, all I care is the 5 digit zip and zip will increment by 1. For this scenario I want to show each zip code as a value in my LOV..so I want to show 30301, 30302, 30303....30320, 30321. Is there a SQL to generate such LOV based on range?
    Any SQL experts out there with ideas?
    Thx, Suresh

    William Robertson wrote:
    Nice, but I think he wants the zip range as 30301 - 30321, discarding the '-9999' (apparently known over there as the '+4' component of the zipcode).Thanks William, i missed out on that detail (though it makes a heck of a lot more sense than generating a LOV with 60,000+ elements :) )
    TUBBY_TUBBZ?
    with
       parsed_data as
       select
          lower_bound,
          substr(range_string, 1, instr(range_string, '-') - 1) as high_bound
       from
          select
             30301          as lower_bound,
             '30321-99999'  as range_string
          from dual
    select
       lower_bound + level - 1
    from
       parsed_data
    connect by level <= high_bound - lower_bound + 1;
    LOWER_BOUND+LEVEL-1
                  30301
                  30302
                  30303
                  30304
                  30305
                  30306
                  30307
                  30308
                  30309
                  30310
                  30311
                  30312
                  30313
                  30314
                  30315
                  30316
                  30317
                  30318
                  30319
                  30320
                  30321
    21 rows selected.
    Elapsed: 00:00:00.01Would be the proper approach based on having a lower bound and having to parse the upper bound from a range string.
    William Robertson wrote:
    Now if I had a clue how to use MODEL...You're not alone in that boat :)

  • How to pass the bind variable value to the sql statement of the LOV

    Hi,
    I am using Forms 10g builder.
    I have a text item which will be populated by a LOV when i press a button, but i have a bind variable in the SQL statement of the LOV. That bind variable should be replaced by a value which is derived from a radio group in the same data block.
    For Ex: ( )radio1 ( )radio2
    before i click on the push button, I'll select one of the radio button above,so my question is how to assign this radio group value to the bind variable in the sql statement in the LOV?
    Pl any hint is appreciated!
    Thanks
    Reddy

    The variable can be taken into account in the SELECT order contained in the Record Group used by the LOV.
    e.g. Select ... From ... Where column = :block.radio_group ...Francois

  • Static LOV functions differently in 9.0.2 from 9.0.1

    In my previous Portal applications under IAS 9.0.1 I had several static LOV's that contained the following structure:
    DISPLAY VALUE RETURN VALUE
    Login User Name #PORTAL.wwctx_api.get_user
    This worked as expected, the user sees the display of 'Login User Name' in a drop down list on a form, but the users login name was actually inserted into the table when Insert is selected.
    I've since upgraded IAS to 9.0.2 (no patchsets installed)
    This same LOV no longer works. What gets insert into the table is the string "PORTAL.wwctx_api.get_user" and not the users name, as before.
    I know I can kluge something similar into a dynamic LOV but does anyone know why this function call no longer works? I have several similar LOV's that get sequence number nextval's in a similar fashion and they no longer work either.
    Thanks

    A TAR has been created concerning this issue, 2841152.996. If anyone has had similar results, please review it at http://metalink.oracle.com/metalink/plsql/tar_main.single_tar?p_tarNumber=2841152.996&p_countryCode=840&p_show=Show++

  • STATIC LOV COLORS

    I have created a select list in a report with
    static LOV.
    Does anyone know how to change the font
    color of each option in the select list?
    Example for options 1,2,3
    something like this:
    <font color="red">1</font> .... red
    <font color="green">2</font> ... green
    <font color="blue">3</font> ... blue
    Thanks

    Thanks marife
    for the good suggestion. It seems that the colour
    pattern works absolutely fine but the problem is that
    it creates another line for each option and
    makes the select list a bit difficult difficult to read.
    By the way i am using htmldb_item.select_list
    and not an actual select list.
    If you have any better suggestions let know
    thanks,
    Ody

  • Item(select list) with LOV and Report with link = changed value item

    Hello,
    On one page I have:
    - Item 'P_name' (select list) with LOV to select name of a person;
    - Items 'factory' and Report 'factory'(standard created with 'Form with Report' on the same page).
    Situation:
    All works fine. I selected first a LOV Item 'P_name' (say 'Jane'). But....
    Only when I select a record (to change the values) from the report 'factory' then LOV Item 'P_name' become empty. Report used a link to the same page to fill the report items 'factory' and make also the LOV item empty.
    Question:
    I have made a process that write the name 'Jane' to table.
    I see two possibilities:
    - LOV Item value => fill the LOV item with 'Jane' from the table before region. Is this possible?
    - Report => What is the buttonname of reportlink? I can use this name in the processes.
    Thanks Walter!

    1) what i meant was for you to test this ridiculously huge LOV outside of htmldb, but it occurred to me last night that you could, in fact, be hitting a limit of ours. after some poking around, i have confirmed that. select list items in htmldb are currently limited to 10,000 rows. this was initially done for performance reasons, but they're now opening up the restriction. if you really need to work with that many rows where the user is allowed to pick from a set of values, consider using a popup item type instead. it'd help your app performance as well (in my test cases, it stank to have to wait for my 10k select list rows to come down to my browser).
    2) sorry to not have been more clear about this, but when you set your item's "Source Type" back to "Database Column", you'd have to specify that column in the "Source or value expression" field. also, you can't put a sql query into that "Post Calculation Computation" field. as i said before, "you can take a look at the attribute-level help for that field to see implementation examples."
    3) stick with "Always..." for now if you're using our auto-dml process(es)
    regards,
    raj

  • Bug in Static LOV definition in tabular form?

    I have always defined static LOVs as follows
    STATIC:Yes;Y,No;N
    but now with V4.0+ the select list at runtime appears as follows:
    STATIC:Yes
    No
    Suddenly the literal "STATIC" is appearing in the first display field.
    If I omit the word "STATIC:" from the definition, it seems to work fine. Was this an intentional change in the definition of static LOVs? If so, you then the developers need to update the help text for LOVs.
    PaulP

    bump...

  • Very Urgent!!  Static LOV with Sort by Option with column names

    Hi All,
    Can we have am Static LOV with an order by option according to the column names in an Report..
    If so can you share with me, waiting for your reply and thanks in Advance..
    Select
    name,
    creator,
    date_created,
    NVL(Comp_type,Del_TYPE) FORMAT,
    from Table_name
    So i want to order by the following columns wrt Static Lov both Assending and Descending Order by
    like Name(Asc), Name(Desc),Creator(Asc),Creator(Desc) and so on for other columns
    Thanks and Regards,
    Suri

    where u are callling perform field_cat in ur program ?
    flow will be like this
    perform fcat.
    perform alv_display.
    form fcat.
    add code here for fcat.
    endform.
    form alv_display.
    call alv here
    endform.
    Regards
    Peram

  • Graph using static lov

    I am using a static lov which has a code and description. I select an entry from this lov and it's code is stored in a table.
    I now want to create a chart on the contents of this table, but need to translate the code stored in the table to the description stored in the static lov.
    Is it possible to do this? If so, any hints!?
    Toby

    So you have a table with a code value in it. The description of the code value is in a static LOV item. I would suggest creating a table in the database with the code and description. Then use a dynamic LOV instead of the static LOV and of course for completeness sake create a foreign key from the table you currently have to your new LOV table.
    Now to get the description of a code, you just do a SELECT on your code/description table. This would be helpful for a chart title maybe?
    Your LOV item on your page will visually display the description, but when referenced it will have the value of the code. So have your SELECT statement in your chart reference your LOV in its WHERE clause.
    Mike

  • Dynamic/Static LOV

    Hi,
    Im havin a little trouble trying to do the following:
    I have a LOV that does a query, but besides the query I want also to have an static option on the LOV that represents all the options, any idea how can I achieve this?
    thanks

    I'm not quite sure if I have understood your requirement; you want to have a LOV which always shows the same records?
    If so there comes 2 possibilities to my mind:
    - You could create a record group at runtime, populate this record group with your desired values, and assign your record group to your LOV.
    or
    - create a table where you store your static values you want to show, and do a query on the table. Maybe you could add a realm to the table, as if you wish to use your static LOV elsewhere you could also simple use your static LOV table...
    maybe
    select key_col, name_col
    from static_lov
    where realm = 'FORM1_LOV1'regards

Maybe you are looking for

  • Unhappy about this iPod Touch Issue...

    So here's the story. My girlfriend bought me for Christmas last year 2010 an iPod Touch (refurbished). 2 months go by of being happy and all, then suddenly the audio jack goes bad. If you BEND the bottom piece of the wire where it connects into the i

  • JDeveloper Visual Editor not rendering ADF Faces

    Hi guys, thanks for read my post. I'm working on a MVC application, and using ADF Faces in view. I did any changes, editing my jsf pages sources. Now JDeveloper doesn't show the design view of no one jsf pages. I followed the steps enumerated by Didi

  • How do I add a hyperlink in keynote

    Same question. How do I add a hyperlink to a keynote slide?

  • How to get essbase substitution variable in ODI

    Hi All, I have a problem that I need to get the substitution variable from Essbase /EAS to work on some SQL statement in ODI. How can I do in ODI ??? Thanks for all .. Thomas

  • Keeping Unique 1D Size in 2D array

    Is there a way to force Labview to maintain the original array dimension independently from one another when creating 2D or even possibly 3D arrays?  It appears to be autosized every set of inputs to the maximum size.  But I want to maintain each set