Column Substitution in LOVs

Hi,
I have created a SQL Query (updateable report). Within this query, I have a two LOV type (Select Lists) columns.
My question is, as you would normally use column substitution within the "Link" section of a column's attributes, i.e #COL1#, is it possible to use this functionality or some other means within a LOV?
For example, if I have two select lists (LOVS), COL1, COL2, is it possible for the report row you are on to use the value of COL1 within a List of Values in COL2 columns attributes?
I need something like:
COL2 Attributes
============
select column_name d, column_name r
from user_tab_columns
where table_name = NVL(:TABLE_NM_SEL,#COL1#)
order by column_id
Any ideas/assistance would be appreciated.
Thanks.
Tony.

Tony,
You can not do it this way.
Suggestion:
1. Create your sql query using apex_item, there you may create LOV's dependant on each
other.
2. Create a table function which does the same but you have a nice sql in your report.
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.opal-consulting.de/training
http://htmldb.oracle.com/pls/otn/f?p=31517:1
-------------------------------------------------------------------

Similar Messages

  • How Get the column name of LOV with code??

    Hi i now that exist a SET_COLUMN and i cant change the value the any column, now i want to know the value column in the LOV in any moment. Somebody us made that? i contact a metalink and their tell me that is not possible that not exist a GET....
    Thanks.

    yea but i am not used record group only a LOV with values static. you thiks that i know the values is true but i need with code change the values but before i need know the value.

  • Conditional column display in report using column substitution string

    Hi everone,
    I was wondering if it's possible to display a column conditionally, based on a values in another column of the same report.
    Can you use the column substitution strings or does the condition strictly require SQL, PL/SQL
    or page item values?
    kind regards,
    Cleo

    I dont think we can add a condition to display the column in a report based on the other column of the same report,
    Just add a (CASE WHEN <your condition satisfies> THEN column ELSE null END) in your report source for the column you want to display conditionally.
    --Mahesh                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to accessing current row report column value in Lov Query?

    Hi,
    which access methods (eg. bind variables, substitutions, ...) for getting the current row report column value can be used in the "Lov Query" property of a report column?
    As what I know of and what I have read on the forum there are no bind variables for the report columns. For the "Link Text" property it seems that the column values exist as substitution strings (#COLUMN_NAME#). But they don't work in the Lov Query. => And would be good because of a hard parse each time the Lov query is executed.
    The following post (Re: Simulating a correlated sub query in lov
    is showing a solution to use package variables for temporary storage of the referenced value, but the only problem with that solution is that if a new record is added with the "Add rows to tabular form" process the package variable still contains the value from the last queried row! Is there a way (variable, APEX package, ...) to determine if the lov query is executed for a new record so that the package can return null?
    I know that I could write the package in a way that the value is immediately cleared when lov_pkg.keyval is called (one time read), but then I would have to create several variables if I'm accessing the value multiple times in the query or in another query => I think an one time read solution would be very obscurely.
    Thanks for your help
    Patrick
    http://inside-apex.blogspot.com

    Hi Patrick,
    I agree that it's a waste to continually use Ajax to go back to the server to get the contents of a dynamic select list.
    There are no bind variables for any row item - but what you do have, as per my previous post, is the value of the data entered by the user in the first row. You can pass this into your application process (using get.add("VARIABLENAME", value)), which can use it to retrieve the correct LOV in your Ajax code - this will give you a "bind variable" that your process can use.
    What you could do, however, is generate hidden select lists on your page - one for each possible LOV list and replace the contents of the new row's select list with the contents of the appropriate hidden select list. This is easy to do with javascript (using innerHTML functions). Obviously, though, the usefulness of this depends on the number and size of the select lists.
    Even if you don't generate them to start with, you can keep a copy of any select lists returned by Ajax in the DOM for use on new rows. So, if you have retrieved a select list, you will have a copy of it in DOM which you can then copy into the new row. If you don't have the list in DOM, use Ajax to get it, store a copy of it and copy it into the new row.
    Which method you use will depend on the number/size of select lists needed. If they are few in number and/or size, I would suggest generating hidden lists. If they are large, use Ajax to get them once, store them and then retrieve them from the DOM when needed.
    There is another thread here where Arie recommends going to the server every time to make sure you get the most up-to-date data for the lists. If you want to follow this advice, for this reason, use get.add("VARIABLENAME", value) to pass the value to your process. If this is not an issue, you can use one of the other methods I outlined above.
    Regards
    Andy

  • Error while associating a report column with a LOV

    Hi All,
    I have a region based on a SQL Report. One of the columns of this report is based upon a LOV. While running the page, i get the following error -
    report error:
    ORA-20001: Error fetching column value: ORA-06502: PL/SQL: numeric or value error.
    I have checked, the report is fetching the correct data.
    Also, the LOV base table has data corresponding to the value of the column of the report.
    What could be the problem. Please suggest.
    Thanks
    Monika

    Hi Scott,
    I'm also facing the same problem as Monika.
    I have an LOV with the following query which returns 8774 records, when I copied and pasted those records into a text file it shows as 220KB in size.
    SELECT
    p.name d,
    p.pers_id r
    FROM people p,
    people_contacts pc
    WHERE SYSDATE BETWEEN NVL(start_date,SYSDATE) AND NVL(end_date,SYSDATE)
    AND     p.used_by_orc = 'Y'
    AND     pc.pers_id = p.pers_id
    AND     pc.group_id IN ('ORC','SHARED')
    ORDER BY 1
    After searching the forum, I think there's a 32K limitation on the fetched rows in tabular forms, can you please let me know how to overcome this problem?
    I'm selecting the persid in the (tabular form) SQL query updatable report.
    I'm trying to display the field as Name instead of PERSID by changing it to select list(based on named LOV) or whichever way it can work.
    Please help me.
    Thanks in advance.
    - Pradeep

  • Sorting a column according to LOV displayattribute's value?

    Hi,
    a quick question over an issue that probably some of you have already encountered.
    How to sort an af:column in a table according to the content (displayname) of the LOV associated with the FK attribute?
    e.g. field Orders.CustomerId with a LOV that takes values from a Customers table, LOV value: Customers.Id, LOV display attribute: Customers.Name
    If I click on the CustomerId column on the parent af:table (Orders), the column gets ordered according to Orders.CustomerID (or Customers.Id, they're the same of course) which is meaningless to the user.
    How to actually make the column ordered according to what the user actually sees, thus Customers.Name?
    Tried fiddling with af:column's sortProperty but got nowhere.
    Is there a way to get this behaviour?
    thx in advance

    Hi,
    Sorry. I overlooked the question. In this case, you might want to modify the VO query to include the FK attribute as well and change the sortProperty of the table to the new attribute.
    For ex.
    Emp (with Dname) VO query
    select emp.empno......dept.dname
    from emp emp, dept dept
    where emp.deptno=dept.deptnoFor the deptno column in the af:table, change something like
    <af:column sortProperty="Dname"  headerText="#{bindings.DeptView1.hints.Deptno.label}" id="c3">Also make sure, you set the Updatable property of the Dname attribute in the vo to never.
    -Arun
    Untested

  • 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

  • Use value from tabular form column in the LOV where clause of another column

    Hi
    Using APEX 4.2 on 11g
    In a tabular form I want to filter the values in a Popup Key LOV based on the value of another column (same row).
    i.e. I want to get the value of one column and use it in the where clause for the Popup LOV on the same row.
    e.g. where COL 2 is a popup LOV
    COL 1
    COL 2
    1
    LOV SQL: SELECT a FROM b WHERE c = <value from COL 1>
    2
    LOV SQL: SELECT a FROM b WHERE c = <value from COL 1>
    3
    LOV SQL: SELECT a FROM b WHERE c = <value from COL 1>
    The value in COL 1 does not change once the row is created. It is a hidden ID field.
    Is this possible?
    Nick

    Anyone have any ideas?
    I thought getting the value from one column and using it in another column would be commonly used functionality... I just can't seem to work it out.

  • Bug: Report Column based on LOV character string buffer too small error

    When using a column type of "Display as Text (based on LOV, does not save state)" with a result set that is rather large causes a character or string buffer too small oracle error.
    See the below page for an example.
    The example page below has a single report off a table called "HUGE_TABLE" which has two columns: display and code
    Code contains a number between 0 and 100000.
    Display contains the number in code appended to a block of text.
    When I display the report with no Display As Text (based on LOV does not save state) it displays fine.
    If I make the "Code" column display as text based on LOV and make the LOV
    "SELECT display, code FROM huge_table"
    I get the error you see on the page.
    http://apex.oracle.com/pls/otn/f?p=32149:1
    Thanks.

    Thanks for your help Scott.
    So from what I've gathered from my own tests and the discussions you linked me to the LOVs based on SQL queries are being converted into "static LOV" strings before being used.
    As such they are limited to the PL/SQL VARCHAR2 max size of 32767
    Which means given the static reduction of the string 'STATIC:' that we have 32760 characters left.
    Which is where your SUM( LENGTH( display ) + LENGTH( return ) + 2 ) comes in.
    In short, if:
    sum( length( display ) + length( return ) + 2 ) + 7 > 32767
    would evaluate to true then you have a problem. :)
    I'll use this to track down my problems and switch them over to inline queries.
    Thanks.
    Cheers,
    Joe

  • Urgent - Report Column based on LOV - Value not found in LOV

    Hi All,
    Recently, we have upgraded to HTMLDB 2.0 from HTMLDB 1.5.
    I have a SQL report. One of the columns is based upon LOV - Display as Text (Based on LOV, does not save state).
    For the "Ids" of the report, it should display the corresponding "Names" from the LOV.
    But, for the cases, where no record exist in LOV for some Id, then it is directly showing the Id instead of "-" (which i have specified in Display Null Text) in the report column attributes.
    Before upgrade, it was working fine.
    Any idea where is the issue.
    Please help.
    Thanks in advance,
    Monika

    Hi,
    Can anybody help me in sorting out this issue please.
    For your reference, i have made a test case on
    http://apex.oracle.com/pls/otn/f?p=20451:4:3519837362944582:::::
    Here, there are 2 tables
    1. MY_EMP_COUNTRY(emoid, empname, cntry_id)
    2. MY_COUNTRY_LOOKUP(id, name,active)
    LOV is created on table 2
    select name d, id r
    from my_country_lookup
    where active = 'Y'
    And, on the page a SQL report is created
    select empname, cntry_id
    from my_emp_country
    where, cntry_id is based upon the LOV.
    Since, in lookup table, cntry_id = 4 is set inactive, it is not picked up by the LOV and hence on the report instead of showing the NULL text it is showing the cntry_id (4).
    The attributes of report column cntry id -
    Named LOV = CNTRY_LOV
    Display Null = YES
    NULL text = -
    Display Extra Value = YES
    Am I missing anything.
    thanks,
    Monika

  • Sorting report by column based on LOV problem...

    All,
    I have an issue with a report I have written.
    I have an LOV based on a sql where which returns an ID as a return value and a CODE as a display value.
    Lets say the LOV returns the following results:
    Return, Display
    1, V
    2, A
    3, T
    When I click on the item column heading to sort the report based on that column the records are in the order 1, 2, 3 and not A, T, V.
    So it looks like it is sorting the results based on the return value and not the display value.
    Is this a feature of displaying items based on LOVs in reports and then sorting on them or am I missing something.
    Hopefully, someone can help me out here as it is driving me mad.
    Regards
    ChrisR

    Chris,
    This didn't change in 3.1 and that is definitely not a bug but a feature. The solution I
    propose is a simple workaround for the special cases of LOV display columns or columns
    where you have an image but still want to do sorting.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/apex/f?p=107:7
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Another shortcoming in BIP: Can show only 1 column in an LOV.

    <h1>Another thing I noticed: In BIP LOVs cannot show the 2 columns that Oracle Reports shows. Please see below image comparing the 2 situs.</h1>
    !http://img59.imageshack.us/img59/1636/lov2colproblem.gif!
    <h1>Any workaround for this? Because now in BIP the user sees only codes and not the description/names. So how does the user select what he wants just by looking at a code. He should see the name as well.</h1>

    There are two options.
    You choose'd, the parameter type as MENU
    you got to use it other way.
    select NAME, CODE from TABLE
    BIP shows,  NAME and internally  CODE will be passed inside the parameter.If you want to show both in MENU format, do this.
    select NAME||CODE "NAME", CODE from TABLEIf you want more Advanced Type LOV,
    Choose, Search in the parameter type.
    it will automatically show all the columns

  • Error thrown when re-sizing the columns in a LOV Popup

    Hi
    I am using ADF 11 R1PS1.
    I am trying to resize the column of a table in a LOV Poup and if I do any action in the LOV after doing it, I get the following error:
    java.lang.IllegalArgumentException: Target component scoped id and component change is required
    at org.apache.myfaces.trinidad.change.SessionChangeManager$QualifiedComponentChange.(SessionChangeManager.java:438)
    at org.apache.myfaces.trinidad.change.SessionChangeManager.addComponentChangeImpl_aroundBody0(SessionChangeManager.java:184)
    at org.apache.myfaces.trinidad.change.SessionChangeManager$AjcClosure1.run(SessionChangeManager.java:1)
    at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)
    at oracle.retail.collab.framework.SessionChangeManagerInterceptor.addComponentChangeImpl(SessionChangeManagerInterceptor.java:59)
    at org.apache.myfaces.trinidad.change.SessionChangeManager.addComponentChangeImpl(SessionChangeManager.java:103)
    at org.apache.myfaces.trinidad.change.BaseChangeManager.addComponentChange(BaseChangeManager.java:54)
    at oracle.adf.view.rich.render.RichRenderer.addAttributeChange(RichRenderer.java:2484)
    at oracle.adf.view.rich.render.RichRenderer.decode(RichRenderer.java:286)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.__rendererDecode(UIXComponentBase.java:1107)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.decode(UIXComponentBase.java:701)
    at oracle.adfinternal.view.faces.renderkit.rich.table.BaseTableRenderer.decodeColumns(BaseTableRenderer.java:1705)
    at oracle.adfinternal.view.faces.renderkit.rich.TableRenderer.decodeInternal(TableRenderer.java:124)
    at oracle.adf.view.rich.render.RichRenderer.decode(RichRenderer.java:293)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.__rendererDecode(UIXComponentBase.java:1107)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.decode(UIXComponentBase.java:701)
    at org.apache.myfaces.trinidad.component.UIXTable.decode(UIXTable.java:137)
    at org.apache.myfaces.trinidad.component.UIXCollection.processDecodes(UIXCollection.java:187)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:988)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:974)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes(UIXComponentBase.java:799)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:988)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:974)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes(UIXComponentBase.java:799)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:988)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:974)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes(UIXComponentBase.java:799)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:988)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:974)
    at oracle.adf.view.rich.component.UIXPopup.processDecodes(UIXPopup.java:60)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:988)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:974)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes(UIXComponentBase.java:799)
    at org.apache.myfaces.trinidad.component.UIXEditableValue.processDecodes(UIXEditableValue.java:236)
    This started happening once we upgraded from the previous version of ADF.
    Any input is greatly appreciated
    Anwar

    This is a known ADF Bug - 9431318

  • Multiple displayed columns in an LOV

    Hi,
    Does anyone know if it is possible to have an LOV with more than 1 column of information being displayed?
    Thanks, Larry

    If you are only interested in displaying the columns you can always do it by creating the following query
    select value_column, column1&#0124; &#0124;' '&#0124; &#0124;column2&#0124; &#0124;' '&#0124; &#0124;column3 display_column from tablename
    this will give you multiple values in display column eg.
    select 'gsmith' username, 'Gregory'&#0124; &#0124;' '&#0124; &#0124;'Smith' fullname from dual;
    results in LOV which would display Gregory Smith
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Larry Vivolo ([email protected]):
    Hi,
    Does anyone know if it is possible to have an LOV with more than 1 column of information being displayed?
    Thanks, Larry<HR></BLOCKQUOTE>
    null

  • Maximum number of columns allowed in LOV

    I have some technical doubts
    1)What is the maximum number a lov allows?
    2)Maximum length of record group query?
    3)Maximum number of items assigned using LOV?
    Please reply immediate
    Thanks in advance
    Manoj M

    I have some technical doubts
    1)What is the maximum number a lov allows?i doubt for this it also takes 20 values as per my knowledge in oracle apps
    2)Maximum length of record group query?a meaningful query in record group up to unlimited extent will be accepted
    3)Maximum number of items assigned using LOV? by taking a parameter you can assign the same lov to different items
    >
    Please reply immediate
    Thanks in advance
    Manoj M

Maybe you are looking for