LOV query with 2 columns in the display_value

Hello,
I need a LOV where 2 values let's say "First Name" and "Last Name" need to be combined into the display_value of this LOV.
How can i do this?
I have already tried the following but this doesn't seem to work:
select FName & " " & LName display_value, PersonId return_value
from tbl_Persons
order by 1
Thanks in advance,
Bram.

Use the ||..
select FName ||' '|| LName display_value, PersonId return_value
from tbl_Persons
order by 1

Similar Messages

  • ADF how can i execute a query with parameters when the page renders

    hi
    i am using ADF web 11g
    i need to execute a query with parameters when the page renders
    thanks

    hello,
    I'm a fan of Java code, I really am.
    But when you use ADF, you decided to move to a more declarative environment.
    So why not do it declarative, the adf way?
    In your pagedef insert a action binding.
    This can be anything, a call to the application module, a call on the iterator(Like executeWithparams, etc.)
    Create an invokeAction in your pagedef and set the condition.
    This example refreshes(Action 2 is execute query) the data.
    First the method binding:
        <action IterBinding="PersoonIterator" id="Execute" InstanceName="LSAppModuleDataControl.Persoon"
                DataControl="LSAppModuleDataControl" RequiresUpdateModel="true" Action="2"/>And the invoke action
        <invokeAction Binds="Execute" id="refreshData"/>This always refreshes the data on page entry, but anything is possible, you can set condictions for the invokeAction.
    -Anton
    PS Yes I know that pagedefs become backing beans in the end and yes that is Java code, but if you wanna play the ADF way, the goal is the reduction of Java code and the increased performance of declarative programming.

  • LOV Query with decode

    Hi All,
    I have following Query for my LOV.
    SELECT DECODE (PTY_COMP_FLG, 1, PTY_COMP_E_NAME,
    PTY_E_FIRST_NAME || ' ' || PTY_E_LAST_NAME)
    PTY_NAME,
    PTY_NUM
    FROM RE_PARTY
    WHERE PTY_TYPE = 1
    ORDER BY 1
    I get the following error.
    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.
    Please help me out of this.
    Thanks in advance.
    Regards
    Arif
    Message was edited by:
    Arif

    Check the query once again, as it should work.
    Ex:
    SELECT DECODE (EMPNO,2839,ENAME,JOB||' '||'NO MANAGER') Display_Value,
    EMPNO Return_Value
    FROM EMP
    WHERE JOB <> 'MANAGER'
    ORDER BY 1
    Its just a query tried in LOV and it is working.
    Regards
    Ckengs

  • Problem with columns in the middle of my book

    I am writing my second book with Pages 2.02 and have run into a problem with columns. I want to add a long list of items as a list with check boxes for readers to check off. If I paste in enough text for three or four pages of two columns it gets messed up in various ways - the text flows into the following text if I don't use section breaks at the end instead of layout breaks, if I use section breaks it solves that one, but if I add anything to the list it changes all the columns across the pages so that one or several of the pages has way less in the right column than in the left. So far the left column fills the entire page all the time, but the right column has lots of spaces. If I switch back and forth from one column to two, it fixes it. If I add text before the list section it messes everything up again and because there is a section break I end up with a little bit of text on the last page and a huge gap before the single column part that follows.
    Does anyone know how to get reliable results that will not mess me up when adding content before the list or in the list itself?
    PowerBook G4   Mac OS X (10.4.8)  

    Hi Cymru,
    Thank you for thinking about my problems. I guess I s half asleep when I posted and it didn't make sense.
    I have so far 77 pages of the book divided into several chapters via section breaks. Inside the 5th section there is almost two pages of paragraphs. Those paragraphs could become 3.75 pages or who knows how long before the list of items. The list of items is 226 items separated by carriage returns and go from one word with 5 characters to 7 words and 34 characters. It needs to be a list with check boxes before them so that the user can check off the items that apply. It is a workbook about turning bipolar into an advantage and is currently 8.5 x 11 and printed on my laser printer for now, but when completed will be more like 8 x 10, so it needs to resize without major hassles.
    I have tried every combination of breaks to get the list to flow in two columns, but perhaps have not done the correct combination. I show invisibles and layout. At the end of my paragraphs I do a paragraph return. I then do either a section break or a layout break, followed by a paragraph return and another layout or section break. I then put my curser before the paragraph break, but after the first section/paragraph break, and set columns to 2, evenly divided by default with 3.2026" columns and .3375" gutter, but I want them to change with page size in the future.
    Once set up, I copy the text out of BBEdit and paste into the left column. It takes up several pages because it is formatted to do double spaces, so I use one of my styles to make it bold and single spaces. I then apply list style with image bullets and one of the default box images that came with Pages. There are 5 items in each column on the first page because it is close to the bottom, but flows into the next two pages. (with text edits it might end up 20 items in each column on the first page) The second page has 39 items in each column and the last page has 8 items in the left column only, but if with section breaks take up the whole page and the next paragraphs start on the next page. If I then add items to the list, every page gets messed up and the second page ends up with 39 on the left column and less items in the right column for each added item.
    If I use layout breaks instead of section breaks, the paragraphs following my lists (now with only one column) end up under the list. What that means is I can see my bold items, but beneath them are my paragraphs that belong after the list. I can see the layout break at the end of the list, but the columns that are shown as part of the 'view layout' are visible right over the single column text also for the rest of the page. The only way to solve that is to go with section breaks and put up with the gap from the end of the list to the following paragraphs.
    I hope this makes more sense.
    Tom
    PowerBook G4   Mac OS X (10.4.8)  

  • Spooling the output of a Query with out displaying the rows

    Hello All,
    Is it possible to spool the output of
    a query/dbms_output.put_line with out displaying
    the Query output on the console.
    In my case,list of rows in the output is huge, I want
    to eliminate displaying the output of query
    so that spooling will complete faster.
    Thanks in advance.
    -Srini

    You can do:
    SET TERMOUT OFFIn your script before doing the spool command.
    You will have to write your query as a .SQL script and run it from SQL*Plus in order for it to work the way you expect.
    sqlplus -s username/password @query_script.SQL

  • LOV query with bind variable

    Hi,
    I have a LOV with a query has a bind variable:
    select comp_plan_id,name from cn_comp_plans_all
    where sysdate between start_date and nvl(end_date,sysdate+1)
    and org_id = : 1
    So I create a CO for this LOV , and in processRequest(), I pass the value of this bind varible.
    Now in the base page,
    if comp plan crteria is blank, this LOV works fine.
    if comp plan criteria has value: 2007 PTE COMP PLAN 1001
    I get this error:
    oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT * FROM (select comp_plan_id,name from cn_comp_plans_all
    where sysdate between start_date and nvl(end_date,sysdate+1)
    and org_id =:1) QRSLT WHERE (( UPPER(NAME) like :2 AND (NAME like :3 OR NAME like :4 OR NAME like :5 OR NAME like :6)))
    Because '2007 PTE COMP PLAN 1001' has 5 tokens, the generated query automatically add 'Name' 5 times.
    Can anyone help?
    thanks
    Lei

    Complete error is:
    java.sql.SQLException: Invalid column type
    Exception Details.
    oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT * FROM (select comp_plan_id,name,org_id from cn_comp_plans_all
    where sysdate between start_date and nvl(end_date,sysdate+1)
    and org_id = :1) QRSLT WHERE (( UPPER(NAME) like :2 AND (NAME like :3 OR NAME like :4 OR NAME like :5 OR NAME like :6)))
         at oracle.apps.fnd.framework.OAException.wrapperException(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageErrorHandler.processErrors(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at OA.jspService(_OA.java:75)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:453)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:591)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:515)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:711)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    ## Detail 0 ##
    java.sql.SQLException: Invalid column type
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:138)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:175)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:240)
         at oracle.jdbc.driver.OraclePreparedStatement.setObjectCritical(OraclePreparedStatement.java:7895)
         at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:7572)
         at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:8183)
         at oracle.jdbc.driver.OraclePreparedStatement.setObjectAtName(OraclePreparedStatement.java:8206)
         at oracle.jbo.server.OracleSQLBuilderImpl.bindParamValue(OracleSQLBuilderImpl.java:3916)
         at oracle.jbo.server.BaseSQLBuilderImpl.bindParametersForStmt(BaseSQLBuilderImpl.java:3335)
         at oracle.jbo.server.ViewObjectImpl.bindParametersForCollection(ViewObjectImpl.java:13746)
         at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:801)
         at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:666)
         at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:3655)
         at oracle.jbo.server.OAJboViewObjectImpl.executeQueryForCollection(Unknown Source)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQueryForCollection(Unknown Source)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:742)
         at oracle.jbo.server.ViewRowSetImpl.executeQueryForMasters(ViewRowSetImpl.java:891)
         at oracle.jbo.server.ViewRowSetImpl.executeQueryForMode(ViewRowSetImpl.java:805)
         at oracle.jbo.server.ViewRowSetImpl.executeQuery(ViewRowSetImpl.java:799)
         at oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java:3575)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQuery(Unknown Source)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.initQuery(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.setCriteriaOnVO(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAListOfValuesHelper.processRequestAfterController(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAListOfValuesHelper.processRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.beans.layout.OAListOfValuesBean.processRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at OA.jspService(_OA.java:75)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:453)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:591)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:515)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:711)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)

  • Simple Query with subquery returns the 'wrong' result

    DB version: 11.2
    We created about 27 schemas in the last 4 days. The below query confirms that.
    SQL > select username, created from dba_users where created > sysdate-4;
    USERNAME                       CREATED
    MANHSMPTOM_DEV_01              12 Jul 2012 11:55:16
    PRSM01_OAT_IAU                 13 Jul 2012 01:51:03
    F_SW                           11 Jul 2012 17:52:42
    FUN_CDD_HK_SIT                 09 Jul 2012 15:33:57
    CEMSCOMPTOM_UAT_01             12 Jul 2012 11:43:45
    STORM02_OAT_IAU                13 Jul 2012 02:06:29
    27 rows selected.  -------------> Truncated outputFrom DBA_TS_QUOTAS.max_bytes column , we can determine the space quota allocated for a user/schema
    SQL > desc dba_ts_quotas
    Name                                      Null?    Type
    TABLESPACE_NAME                           NOT NULL VARCHAR2(30)
    USERNAME                                  NOT NULL VARCHAR2(30)
    BYTES                                              NUMBER
    MAX_BYTES                                          NUMBER
    BLOCKS                                             NUMBER
    MAX_BLOCKS                                         NUMBER
    DROPPED                                            VARCHAR2(3)So, I wanted to see the allocated space for the users created in the last 4 days. The below query should return only 27 records because the subquery returns only 27 records. Instead it returned 66 records !
    select username, tablespace_name, max_bytes/1024/1024 quotaInMB
    from dba_ts_quotas
    where username in (select username from dba_users where created > sysdate-4);Any idea why ? I know it is not a bug with oracle. Its just I haven't been eating fish lately.

    Hi,
    J.Kiechle wrote:
    So, I wanted to see the allocated space for the users created in the last 4 days.DBA_TS_QUOTAS doesn't give the allocated space but rather the maximum allowed for a given user.
    J.Kiechle wrote:
    The below query should return only 27 records because the subquery returns only 27 records. Instead it returned 66 records !What if your user John has Quotas on 3 tablespace TBS1, TBS2 and TBS3 ?
    You cannot expect the outer query to only retrieve at most 27 rows just because the inner query returns 27 rows.
    For allocated space by tablespace for recently created users, you'd better query dba_segments. something like :select owner, tablespace_name, trunc(sum(bytes)/1024/1024) alloc_mb
    from dba_segments
    where owner in (select username from dba_users where created > sysdate - 4)
    group by owner, tablespace_name
    order by owner, tablespace_name;

  • Query with column rename not working! (SQLServer/JDBC-ODBC bridge)

    Hi,
    I was wondering if anybody could help. I am translating some stuff from ASP to JSP and ran into an SQL query that goes like this:
    String SQLQuery = "SELECT myTable.myColumn renamedColumn FROM myTable";
    which is perfectly legal in SQL Server. I get the stuff from myTable, no problem, and the column's name is locally indeed renamedColumn.
    Under the sun.jdbc.odbc.JdbcOdbcDriver, however, trying to do something like:
    string myResult = results.getString("renamedColumn");
    throws an SQL exception with the message "Index not found".
    And if I don't rename the column and try:
    myResult = results.getString("myTable.myColumn");
    also gives the same problem.
    Anybody know what to do?
    [P.S, the reason why I have to rename my column is because I have two tables with an identical column name and need both for a search page]

    Try retrieving by index instead of column name:
    E.G.
    string myResult = results.getString(1);

  • BCM- Problem with column in the communication history section

    Hi.
    I currently use BCM and I have a issue right now. When I try to add the columns ''TO'' and ''FROM'', it just show as blank and when I save and close and re-enter in the communication history, the columns are gone. Is there a way to fic this issue?
    I am using Office 365 (2013) and exchange online.
    Thanks

    Hi,
    What is your current view in BCM?
    The issue may be caused by the corrupted view, please run Outlook with the switch "/cleanviews" to check the result:
    Press Win + R, type "outlook.exe /cleanviews" in the blank box, press Enter.
    Then Outlook will start and reset custom views, then add the columns to check the result whether the issu persists.
    Regards,
    Melon Chen
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Query with = only provides the 'less than' portion of the results

    I have a query that checks dates to be >= start date and <= end date.
    The results are always >= start date and < end date.
    The same where clause in sqlplus works just fine. Is this a bug in BI Publisher?

    Correct, the ipad I was testing with is the ipad air that came out in Oct/Nov 2013 I believe.   Though the iphone 5s is the latest version as well that I was using to test.
    I had 2 expresses connected wirelessly and 2 extremes (both connected via ethernet).   Based on your point about the wirelessly extended I ended up taking one of the Expresses and connecting that via ethernet to extend the network.  When I re-ran the same tests I had the following based on two tests:
    Ipad air:  58.77/38.06   and 55.64/38.35
    Iphone 5s:   37.48/29.12  and 60.08/29.12   (big difference)
    I've done a factory reset a number of times on these devices.  I just tried it again for the one remaining airport express that I'm unable to connect on a regular basis via ethernet.  I need this one connected to the network as I use it for the airplay feature for audio to our sound system.  That thing absolutely does not show up unless I connect it first to ethernet.  

  • Query with column is null is very slow

    I have a query - select * from grv3que where gq_process_date is null;
    that is very slow when returned 4 records (the table has total 60000 records).
    SQL> desc grv3que
    Name Null? Type
    GQ_ID NOT NULL NUMBER(15)
    GQ_MESSAGE LONG
    GQ_RECEIVE_DATE DATE
    GQ_PROCESS_DATE DATE
    GQ_CONTROL_ID NOT NULL VARCHAR2(20)
    and it has two indexes:
    SQL> select index_name, index_type from dba_indexes where table_name='GRV3QUE';
    INDEX_NAME INDEX_TYPE
    PK_GRV3QUE NORMAL
    IDX_GQ_PROCESS_DATE NORMAL
    Analyzing the table/indexes didn't help on the performance.
    Could you help us how to tune the query? Thanks in advance!!!

    DOM@DOM11gR1>create table t1
      2  as
      3  select rownum col1
      4  ,      case when mod(rownum,250000) = 0 then null else sysdate end col2
      5  from   dual
      6  connect by rownum <= 1000000;
    Table created.
    Elapsed: 00:00:02.03
    DOM@DOM11gR1>
    DOM@DOM11gR1>create index i_t1_1 on t1 (col2);
    Index created.
    Elapsed: 00:00:01.03
    DOM@DOM11gR1>
    DOM@DOM11gR1>explain plan for
      2  select *
      3  from   t1
      4  where  col2 is null;
    Explained.
    Elapsed: 00:00:00.02
    DOM@DOM11gR1>
    DOM@DOM11gR1>select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 3617692013
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |    28 |   616 |   696   (2)| 00:00:09 |
    |*  1 |  TABLE ACCESS FULL| T1   |    28 |   616 |   696   (2)| 00:00:09 |
    Predicate Information (identified by operation id):
    PLAN_TABLE_OUTPUT
       1 - filter("COL2" IS NULL)
    Note
       - dynamic sampling used for this statement
    17 rows selected.
    Elapsed: 00:00:00.01
    DOM@DOM11gR1>
    DOM@DOM11gR1>select nvl2(null,1,2), nvl2('X',1,2) from dual;
    NVL2(NULL,1,2) NVL2('X',1,2)
                 2             1
    Elapsed: 00:00:00.01
    DOM@DOM11gR1>
    DOM@DOM11gR1>create index i_t1_2 on t1 (nvl2(col2,null,1));
    Index created.
    Elapsed: 00:00:00.07
    DOM@DOM11gR1>
    DOM@DOM11gR1>explain plan for
      2  select *
      3  from   t1
      4  where  nvl2(col2,null,1) = 1;
    Explained.
    Elapsed: 00:00:00.00
    DOM@DOM11gR1>
    DOM@DOM11gR1>select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 2708798483
    | Id  | Operation                   | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |        |    28 |   616 |     2   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| T1     |    28 |   616 |     2   (0)| 00:00:01 |
    |*  2 |   INDEX RANGE SCAN          | I_T1_2 |  4596 |       |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    PLAN_TABLE_OUTPUT
       2 - access(NVL2("COL2",NULL,1)=1)
    Note
       - dynamic sampling used for this statement
    18 rows selected.
    Elapsed: 00:00:00.02
    DOM@DOM11gR1>select *
      2  from t1
      3   where  nvl2(col2,null,1) = 1;
          COL1 COL2
        500000
        750000
       1000000
        250000
    Elapsed: 00:00:00.01
    DOM@DOM11gR1>

  • 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

  • What is wrong with this dynamic LOV query?

    I am trying to create a dynamic LOV which contains calendar week numbers, given a bind var containing the year. If the year given is this year I want the LOV to contain all weeks up to but not including this week, if the year given is in the past I want the LOV to contain all weeks in that year.
    Here is my query;
    select display_value, week_num from
    (select decode(
    :P31_YEAR,
    to_char(sysdate, 'YYYY'), to_number(to_char(sysdate, 'IW')),
    1+to_number(to_char(to_date('31/12/' || :P31_YEAR, 'DD/MM/YYYY'), 'IW'))
    ) max_weeks,
    level week_num,
    'Week ' || level display_value
    from dual
    connect by level < 54
    ) where week_num < max_weeks
    When I try to create the dynamic LOV Apex tells me the query is invalid. It runs in TOAD and as far as I can see follows the LOV query rules.

    Try this:
    select display_value d, week_num r from
    (select decode(
    nvl(:P13_YEAR,'2007'),
    to_char(sysdate, 'YYYY'), to_number(to_char(sysdate, 'IW')),
    1+to_number(to_char(to_date('31/12/' || nvl(:P13_YEAR,'2007'), 'DD/MM/YYYY'), 'IW'))
    ) max_weeks,
    level week_num,
    'Week ' || level display_value
    from dual
    connect by level < 54
    ) where week_num < max_weeks
    Scott

  • Concatenation of 2 return value LOV query

    LOV query with 2 columns in the return_value

    Dear Neha Sharma!
    Try this kind of query as source for your LOV:
    SELECT col1 || ':' || col2 AS return_value, col3 AS display_value
    FROM   your_table;To use only one of the both returnvalues you may split up the returnvalue with REGEXP_REPLACE
    REGEXP_REPLACE(return_value, '^(\S+):(\S+)$' , '\1')This will give you the first part of returnvalue -> col1. To get col2 use \2 as the last parameter of REGEXP_REPLACE.
    Yours sincerely
    Florian W.
    Edited by: Florian W. on 24.06.2009 07:45
    Edited by: Florian W. on 01.07.2009 07:47

  • Trouble using pipelined function in an select list lov query

    I'm trying to use a pipelined function in a select list lov query but i cet the error
    "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."
    my query is as follows :
    SELECT gt.navn d, gt.GEOGRAPHY_TYPE_ID r
    FROM GEOGRAPHY_TYPE gt
    WHERE gt.kode NOT IN (1)
    and gt.kode in (select lov_value from table(RAPPORT_FILTER_PKG.GET_RAPPORT_FILTER_VALUE_PIP (
    SYS_CONTEXT ('rapport_filter_ctx','filter_id'),'GEOGRAPHY_TYPES')) )
    ORDER BY gt.navn DESC
    if i use a discrete values '80' instead of the call to
    SYS_CONTEXT ('rapport_filter_ctx','filter_id')
    i don't get eny errors, but then the LOV isn't as dynamic as i has to be
    any idears???
    Edited by: [email protected] on Dec 1, 2008 8:50 AM
    Edited by: [email protected] on Dec 1, 2008 11:17 AM

    nope that doesn't do it either
    contains a syntax errror at
    SYS_CONTEXT (('rapport_filter_ctx',:P500_RAPPORT_FILTER_ID),'GEOGRAPHY_TYPES'))
    my theory is that it's got something to do with the way APEX binds values because
    the query
    SELECT gt.navn d, gt.GEOGRAPHY_TYPE_ID r
    FROM GEOGRAPHY_TYPE gt
    WHERE gt.kode NOT IN (1)
    and gt.kode in (select r from table(RAPPORT_FILTER_PKG.GET_RAPPORT_FILTER_VALUE_PIP ('80','GEOGRAPHY_TYPES')) )
    ORDER BY gt.navn DESC
    works fine in both TOAD and in APEX but as soon as i replace th '80' with :P500_RAPPORT_FILTER_ID then, apex won't accept the code??????
    Edited by: [email protected] on Dec 3, 2008 7:54 AM

Maybe you are looking for

  • Final Cut Pro Training NY

    I was looking into an Apple Certification for FCP6 and there a few authorized centers here in the NYC area and I was wondering if anyone has had any experience with them in terms of quality? Soho Editors, The Edit Center and the Manhattan Edit Worksh

  • Songs disappeared

    I have a 3G iPod and have never had a problem until now. My iPod says I have zero songs on it although it recognizes that I still am using all but 5.0 of the 37.2 GB available. My iPod won't connect to iTunes. I keep getting the magnifying glass over

  • Javafx application integration in a web page

    Hello, I did javafx application with a database, and now I want to publish on the net. I have uploaded the files: - project.html - project.jar - project. jnlp - project.jar.pack.gz - index.html: <html> <head> <meta http-equiv="Content-Type" content="

  • My iPad is about 4 yrs old.  It is constantly shutting down on me. ???

    Does not totally shut down, just back to main screen.

  • Query based Authorization

    Hi, We have 3 queries Q1, Q2, Q3 We need for Profile 1 - Q1 and Q2 Profile 2 - Q2 and Q3 Any idea how to do this without including the actual name of the query in the authorization object Thanks