List of values (LOV) based on PL/SQL

Is it possible to create a LOV based on PL/SQL ?
I want to do this because I have at least 5 LOV based on the same query (when you are using bind variables).
This is the normal query (ex.: LOV_FREQ_CODES) :
SELECT c.code ||' - '|| c.description AS display,
c.code AS return
FROM codes c,
code_types ct
WHERE c.code_type = ct.id
AND ct.code_type_description = 'Frequency' (should be a Bind Variable)
Thx

Look into "Pipelined Table Functions" (http://www.oracle.com/technology/sample_code/tech/pl_sql/htdocs/x/Table_Functions_Cursor_Expressions/Pipelined_Table_Functions.htm)
Basically you have your codes tables and a function (get_code). The function is passed a parameter (bind variable). The function then fires a query using the parameter value to render rows which are "pipelined" are a return value of the function. So you LOV query would look like:
SELECT c.code ||' - '|| c.description AS display,
c.code AS return
FROM codes c, TABLE(get_code('Frequency')) ct
WHERE c.code_type = ct.idMike

Similar Messages

  • How to get data from list of values (LOV) to be displayed in a text field ?

    Hi guys,
    I am very new to Oracle APEX so please spare me if it is a silly question. How can I get the selected values from a set of list of values (LOV) displayed in a text field (or text area or so) ? Fox example, in my form I create 4 items: STATE, COUNTY, STREET, ZIPCODE and all of them are LOV (list of values). I also create 2 buttons (ADD & REMOVE). Then I create a test field (or text area name SELECTED RECORD). Now here is what I want to do with my form:
    When I set the values for all 4 fields, I will click on the ADD button then I want those values be displayed in the text field.
    For example, if the selected values are:
    STATE = Alabama
    COUNTY = Abbeville
    STREET= 1 Street
    ZIPCODE = 36310
    And the ADD button is pressed. Then in the text field I want it displays like this:
    Alabama,Abbeville,1 Street,36310
    If I choose other values and click ADD again, a new line will be added into the text fields (text area). If I click the REMOVE button, then it will clear those two line in the text field.
    Would it be possible to do it? Any help will be greatly appreciated. Thanks in advance.

    If you can live with the page being submitted and refreshed, make your ADD button do a submit with a request value of ADD and make your REMOVE button do a submit with a request value of REMOVE.
    Then create two computations (one firing with a condition of Request = ADD and the other firing with a condition of Request = REMOVE).
    In the ADD one, concatenate the values together into the text area (most likely a PL/SQL computation wiill be what you want). In the REMOVE one, set it to null with a PL/SQL computation.
    If you want it done without submitting the page, make the buttons each do a redirect to a URL but instead you will have to write two short javascript functions in the page HTML header to manipulate the field values. Each button would call each javascript function in an onclick event.

  • Problem with list of value (LOV) in BI publisher.

    I have created a report in BI publisher with two parameters (tier, accnum) and two list of value (LOV) for the menu to select from a drop down list.
    while crateing the parameters I selected the options: *1) can select all and all value passed*
    but in the view when I select 'ALL' option from the list, its showing the following error message:
    ORA-00933: SQL command not properly ended.
    but if I select a particular tier and accnum it is worikg fine.
    I have used the following query in the dataset:-
    select ACCOUNT.ACCOUNT_NUM as ACCOUNT_NUM,
    ACCOUNT.LAST_BILL_DTM as LAST_BILL_DTM,
    ACCOUNT.ACCOUNT_NAME as ACCOUNT_NAME,
    ACCOUNTATTRIBUTES.DISTRICT_ID as DISTRICT_ID,
    ACCOUNTATTRIBUTES.TIER as TIER
    from GEN_OWNER.ACCOUNTATTRIBUTES ACCOUNTATTRIBUTES,
    GEN_OWNER.ACCOUNT ACCOUNT
    where ACCOUNT.ACCOUNT_NUM=ACCOUNTATTRIBUTES.ACCOUNT_NUM
    and ACCOUNTATTRIBUTES.TIER=:tier
    and ACCOUNTATTRIBUTES.ACCOUNT_NUM =:accnum

    and ACCOUNTATTRIBUTES.ACCOUNT_NUM in (:accnum)use in clause

  • How to change background color in List of Values (LOV) ?

    Hiya
    In Forms 10g, the background color in list of values (LOV) is White whereas it was grey in Form 6i. Also, the position of 3 buttons i.e. Find, OK and Cancel on LOV is different than what it used to be in Forms 6i.
    Is it possible to change the background color and the position of buttons of LOV in Forms 10g ?
    Cheers
    Mayur

    I would like to share the outcome of this issue.
    I had posted this same issue on Metalink yesterday. They (Metalink guys) have confirmed that its an bug in Oracle 10g DS R2 and it would be fixed in subsequent releases.
    Following is an official response from Metalink:
    This issue has been addressed to Oracle Development to be investigated/fixed in the published Bug:
    Bug 1559776 <BACKGROUND COLOR SETTING FOR LOV OBJECT DOES NOT WORK ON WEB>
    Cheers
    Mayur

  • BEx query based on virtual cube donu00B4t display a valid List of Value (LOV)

    Hello
    I have a problem with an invalid LOV. The scenario is the following; There´s a BEx query based on a virtual cube. The query has an exit variable on caracteristic that is based on 0CALMONTH.
    At Universe Designer I simply create a connection, a universe based on this query and export.
    At Web Intelligence (also at Live Office), when I try to execute de query, the prompt to fill my exit variable display a list of value that doesn´t match with the values of the caracteristic at the cube.
    Actually, the list at the prompt starts with 01.0000 and finishes with 05.0968.
    In Universe Designer, the option to edit the list of values is not available. But I think that editing the LOV is not the correct way.
    I´ve tried creating a new query based on the DSO that is the source of the virtual cube. In this case, I had a valid list. Unfortunately, I can´t use this DSO.
    Did anyone already have this problem?

    Hi James,
    can you explain what you mean with "input length for that filed" ?
    The field in the table is varchar2(120). I coudn't found options for the List of value.
    Thanks for your response
    Carsten
    null

  • List of values population based on session state

    Firstly, sorry if this is not too clear or just stupid, im new to this.
    What I am trying to do is create a list of values on a page that goes to a lookup table and returns description of the code entered.
    so far so good
    however the tricky bit is that the codes meen different things when applied to different objects.
    Now I have got a variable in the session state for the page that can id the object type as G or H namly P39_DISPLAY
    Can you do something like ...
    IF :P39_DISPLAY = 'G' THEN
    select lookup_code||' - '||meaning d, lookup_code r from ip_lookups
    where lookup_type = 'PRC'
    and upper(enabled) = 'YES'
    and start_date_active <= sysdate
    and nvl(end_date_active, sysdate+1) >= sysdate
    ELSE
    select lookup_code||' - '||meaning d, lookup_code r from ip_lookups
    where lookup_type = 'RRC'
    and upper(enabled) = 'YES'
    and start_date_active <= sysdate
    and nvl(end_date_active, sysdate+1) >= sysdate
    END IF;
    I have tried this but getting ORA errors all over the place
    Any ideas?

    very true, but it is only my third post ;)
    I have a table with
    val1 val2 va3 val4
    I'm using a select list to populate val4
    value 4 is a two digit code
    00-->99
    the meanings of the codes are dependant on the object type. the object type value code is passed from another page into this page.
    As far as the table is concerned the object type is irrelivent because its just looking for a code.
    However the users require a description in order to use the right code.
    So I'm using the variable to pull back the discription of the code based on object type.
    I'm giving your idea a bash, created two LOVs. I will test to see if the condition statements stop database entry, I think it might.

  • Display specific value from List of Values(LOV)

    Hi All,
    Is this possible in BOXI R2 that i created a List of Values like below:
    1. P1AF
    2. P1XA
    3. P2AF
    4. P2XA
    5. P2XD
    6. P3AF
    7. P3XA
    8. P3XD
    and i would like to show only 1 & 2 values for specific users. Or switch on /off some values without accessing the database.

    Can you confirm that this question is posted to the correct forum, or if it should go into another? 
    If this is Universe Designer related, you can review your LOV's by:
    1. right-click on the object in the universe designer, and select Properties dialog
    2. Select Properties tab,
    3. Select 'Display'
    4. then shift or control select the LOV's that you want to be viewable,
    5. enable the checkmark next to 'Show Selected Only'
    6. Click OK, and then save and re-export the universe.

  • Problem in using the List of Values(LOV)

    We created a folder 'Testing FCG' in the Business View Manager.
    1) In this we created a new connection of TCD371 Database ( conn) ,
    2) We created a new Data Foundation(DF)  using the existing connection and we added table 'cdhpmember' in the DF
    3) We created a new business element(BE) using DF and we added the column like Firstname,Groupkey and Gendercode
    4) We created a Business View (BV) using DE and we added DE to the BV
    5) We created a LOV(Memkey) using BV and we selected memberkey field
    6) We tried to implement the memberkey field into crystal report as a dynamic parameter
    7) When we try to run the report we got the error like this
    Promting failed with the following error message: 'List of Values failure: failed to get values. [Cause of error:CSELOVDataSource::setReportInstanceCUID The List of Values did not schedule sucessfully and must be re-scheduled.]'.
    Error source : prompt.dll Error code: 0x8004380D
    Could any of you give your input on this error?

    Either store it in the session scope, or pass it as a (hidden?) parameter along the request.

  • Dynamically changing the select list in an LOV based on the login user

    We have a field in a form which is a combobox.The form is to be linked to different profiles of users.Based on the logged in user we would like to restrict the select list in the LOV.ie user1 should see a LOV which is different from that seen by user2.Is this possible.If so how can this be done?Kindly reply.
    Thanks & Regds,
    Jayanthi

    Thanks for ur reply.But my problem is that i have a table having details of some products which includes spareparts also(Name,id,price etc).In my form i have the combobox field which should have a list of these products which the user can select.Now depending on the user's profile he should see only his related products(One profile of users should view only the products but not the spares while the other should view only spares.)The details of both the products and spares are in the same table.we have a criteria to differentiate between the products and the spares.The LOV should display at run time, either products or spares depending on his profile as he logs in. Hope u understood my problem.
    Regds,
    Jayanthi
    Hello Jayanthi,
    I had a similar situation in my last project.
    While you can solve this by modifying your query, this will always come around as may be later some other criteria to restrict based on User/His Role/Something else. Hence I fixed it at design level itself. Though I can't give my situation I can tell you the solution applying my logic.
    Altering your Product Table and adding one more database Column say Product_Category and updating the table with Product Category =1 for Products and 2 for Spares. You can extend this further for other types.
    Create a new Table say User_Groups that will have
    Group_id
    Group_Name
    User_Id columns and will contain all the User ids inserted groupwise.
    Create one last Table Group_Product_Map
    That will have
    Group_id
    Category_id
    This will store each Group_Id followed by Category_id of Products to which these group members will have access to.
    Now write a database function getCategory( p_User) which will query User_Groups table to get Group_Id
    and further query Group_Product_Map Table based on group_id to get Category_Id.
    This function will return category_id.
    Huh!
    So your LOV will have a query as select *(or whatever) from Product where category_id = getCategory(portal30.wwctx_api.get_user)
    Hope this helps
    Madhav

  • How to make text field in tabular form as List of value (LOV)

    So the problem is next:
    I should to make field in tabular form as LOV(list of value (combobox)) to load there data form db. Could smb take me an advise how to make it.
    Thanks.

    So thanks, I did it, it works. How now to make next: I selected Id from list and in the next column appears name with ID from DB. so how to make ondemand process i know (thanks to you), but how to get value from LOV that I selected to give it to Dynamic Action.
    Thanks

  • How to maintain List Of Values (LOV's) for BPEL Processes

    We are integrating two systems.Source and destination systems store data in different formats. For example State is stored as a string in source and its stored as an number in destination system. In BPEL we are trying to transform this information and send it to destination system so that it understands the incoming data.
    A sample of transformation we need to do is as shown below.
    State in Source     Sate in Destination
    Texas               1
    Nebraska          2
    But we have so many fields that we need to transform as we are doing for State.
    What is the best way of handling these domain mappings in BPEL. I want to know is there any efficient way we can handle this in BPEL as we do in J2EE applications(Maintaining them in Domain tables and making them available for all functionalities).
    We are looking to hold all these domain mappings at one place and use in all the processes we design.Can anyone suggest a better way to handle this for BPEL processes.

    Hi,
    I am using the lookup-xml for maintaining list of values.But dont know whats the problem unable to get the output.
    Example: this is just a sample one which i am testing.
    My xml file is placed in c folder with the name "StateList.xml" which contains the following info.
    <?xml version="1.0"?>
    <Countries>
    <Country><Abbreviation>CO</Abbreviation><FullName>CO</FullName></Country>
    <Country><Abbreviation>CT</Abbreviation><FullName>Connecticut</FullName></Country>
    <Country><Abbreviation>ID</Abbreviation><FullName>Idaho</FullName></Country>
    <Country><Abbreviation>NJ</Abbreviation><FullName>New Jersey</FullName></Country>
    <Country><Abbreviation>AP</Abbreviation><FullName>Andhra Pradesh</FullName></Country>
    </Countries>
    And in BPEL, in the transformation i am taking the input and assigning this lookup value to the output variable as follows :
    <ns1:result>
    <xsl:value-of select="orcl:lookup-xml('file:/c:/StateList.xml','/Countries/Country','Abbreviation','FullName',/ns1:HelloWorldPavanaProcessRequest/ns1:input)"/>
    </ns1:result>
    But unable to get the result.Kindly help me out in this.
    Regards,
    Pavana

  • Can't get a blank entry in Choice List of Values (LOV)

    Using Jdev 11.1.1.3 but will be upgrading to 11.1.1.5 in few weeks.
    Need to display a Choice List that is bound a view object with static data. The List should show a blank item since users don’t need to select any.
    I am able to display the LOV in the page but can’t seem to get a blank item as a first item.
    Here is what I did:
    1.     Created the VO with static data. Initially didn’t include it in the Application Module based on the developer guide sec 5.3 but later added to get it in the data control list.
    (Note the application doesn’t need to use any database and simply is using Web Service but for test I am using a DB)
    2.     To configured the VO, tried to add a View Accessor to the VO, but couldn’t select a data source until I added the VO to the App Module !
    3.     In attributes tab added an LOV and specified the data source. In UI Hints ensure the “Include “No Selection” Item” was selected.
    (Initially didn’t shuttle the attribute to the right in the UI hints.)
    4.     In the List UI hints ensured that “Include “No Selection” Item” was selected.
    5.     Dragged the VO Data control to the page and selected ADF Select One Choice.
    6.     On running the List DID NOT include a blank item !? How to get one?
    In pageDef got:
    <list IterBinding="GenderListVO1Iterator" ListOperMode="navigation"
    ListIter="GenderListVO1Iterator" id="GenderListVO1"
    DTSupportsMRU="true">
    <AttrNames>
    <Item Value="Gender"/>
    </AttrNames>
    </list>
    I even added the tag NullValueFlag="start" to the PageDef but no blank entry.
    In Page got:
    <af:selectOneChoice value="#{bindings.GenderListVO1.inputValue}"
    label="#{bindings.GenderListVO1.label}"
    required="#{bindings.GenderListVO1.hints.mandatory}"
    shortDesc="#{bindings.GenderListVO1.hints.tooltip}"
    id="soc3">
    <f:selectItems value="#{bindings.GenderListVO1.items}" id="si7"/>
    </af:selectOneChoice>
    If I don't use the VO and code all items in the JSPX page with a blank item that get a blank entry (didn't test with the Web Service yet since not ready).
    What is the issue with VO?
    ( I am also considering a number of SelectManyChecks on the same page but might be difficult)
    Thanks for the reply.
    Edited by: user8769031 on Jun 10, 2011 11:12 AM

    Thanks for the hint, but in my case the attribute is not required. I never see a blank entry. The only way I was able to get a blank is to add a blank item to the static list in the VO. The VO XML file has:
    <LOVUIHints
    ListType="105"
    MRUCount="0"
    ListRangeSize="-1"
    NullValueFlag="start"
    NullValueId="LOVUIHints_NullValueId">
    The Include "No selection" item is not working as expected.

  • List of Value (LOV) Embedded Comma, Semicolon, Colon

    I have an LOV that is to return an Employee Name in the format "Last_Name, First_Name Middle_Name" with a comma after the last name and a space between the First_Name and Middle_Name. Basically, my LOV is Employee_Name and Employee_Id.
    However, I cannot get the "comma" to appear after the Last_Name. I can get an asteric (as in the following code) but cannot get a comma, semicolon or colon. Is there something special I have to do to get the comma?RETURN  'SELECT  DECODE((FIRST_NAME_TX
                 ||  MIDDLE_NAME_TX
                 ||  LAST_NAME_TX),NULL,''Not Available''
                  ,  LAST_NAME_TX||''* ''
                 ||  FIRST_NAME_TX||'' ''
                 ||  MIDDLE_NAME_TX) EMPLOYEE_NAME
                  ,  EMPLOYEE_ID
               FROM  EMPLOYEE
              WHERE  LOGICAL_DELETE_IND = ''N''
              ORDER  BY EMPLOYEE_NAME ' ;

    In my case using REPLACE function solved the problem:
    Let's assume that the +<full_name>+ has the comma that the tabular form fails to dispaly.
    Instead of using in LOV:
    select <full_name> d, <id> r
    from <your_table>
    I used:
    select REPLACE(<full_name>, ',', '<my_string>') d, <id> r
    from <your_table>
    The +<my_string>+ conists of *& # 44* with no spaces in between. I have to explain it this way because even on this site +<my_string>+ gets replaced with a comma and you can't see how I did it.
    Hope this helps.
    Zhanna

  • Interactive Report - One column based on a list of values

    I have an Interactive Report that's part of a Form with Report. The form works fine, but I have a problem with the interactive report. One of the fields is based on a list of values. That is, the data in the table in the State field has numeric state codes, 1 to 51. The form part has no problem with this, as it's a select list based on a list of values LOV query, so the user selects the actual name of the state.
    The interactive report, however, displays the numeric codes, which is what is actually in the table. I am looking in the column definition for some way to tell it to convert the value to the state name, but I do not see it. There is a List of Values place, but that seems to be for filtering purposes instead of for return vs. display value.
    3.2.

    Tharpa,
    I'm not sure if what I am about to suggest will work in 3.2. However, in 4.1, I am using LOVs with IRRs without any issue.
    For example, if I have an address field of state code, I have a named LOV (LOV_STATE). I go into the report attributes for this column. There, I find a section named "List of Values" In here, I pick the "column filter type" of "Use Named List of Values to Filter Exact Match". (Presumably, this will work with Static List too). When the column is displayed, I see the State name displayed.
    -Joe
    Edited by: Joe Upshaw on Mar 14, 2012 1:58 PM

  • Dynamic LOV based on report column

    HI,
    I've a standard report with Two columns. Column1 is standard Report Column and Column 2 is a LOV based on an SQL Query.
    Now I need to filter the LOV (add a where clause) based on the value in the column1.
    For example, consider Column1 as "country" and column2 as "state". so the in column2(LOV), user should see only the list of states belongs to the corresponding country(Column1)
    Please note that the report is based on an SQL query
    Any clue on how to do this.
    I'm using APEX4.1.
    Thanks in advance
    Prasanth

    I think you are looking for this https://forums.oracle.com/forums/search.jspa?threadID=&q=tabular+form+cascade&objID=f137&dateRange=all&userID=&numResults=15&rankBy=10001
    please search the forum before posting a question
    Thanks

Maybe you are looking for