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

Similar Messages

  • Limitations in using a function within a select statement

    I have a function which retrieves various data elements from the
    database and formats it accordingly. The data (varchar2)
    returned could be in excess of 2,000 characters length.
    I need to use the returned data as part of a view. I am able to
    use the function in a "select" statement, but when I use it with
    returned data in excess of 2,000 chars, I get the following
    error:
    ORA-06502: PL/SQL: numeric or value error
    This error is occurring whenever the returned data is in excess
    of 2,000 characters.
    Is there an alternative method to what I am proposing, I have
    tried alternative data types but if I am able to use it in a
    "select" statement, I get the above error when the returned
    length exceeds 2,000 chars.
    Thanks
    Peter

    are u using oracle 7. varchar2 limit in 8 is 4000.

  • Use PipeLine function as datasource

    Hi all.
    Does anybody use PipeLine function as datasource for Bi EE ? Do you have any experience ?

    For more discuss :
    I was read article from Venkatakrishnan
    http://oraclebizint.wordpress.com/2007/09/21/oracle-bi-ee-101323-ref-cursors-and-pipelined-functions/
    and in that case all lok's fine and work. But in my case I was neded disable aggregate and order by functionality , becouse have some Issues. can anybody comment this situation :What's wrong in using PipeLine and BIee ?

  • Display select list from query on manual tabular form

    Hello,
    I'm trying to display a select list from query on a manual tabular form. I'm using a collection to store the data. I can't seem to get the query to work. I can display the item as a text item. Any help would be appreciated. Thanks, Elizabeth.
    SELECT
    -- Notice how I'm keeping the idx value the same as the column value in the collection. This helps to keep things organized
    -- I also apply an id to each entry
    -- I append the error value to the empname and sal
    -- The Seq_id. Usefull when hiding rows (for delete) and then submitting from
    apex_item.hidden(1,x.seq_id, null, x.seq_id || '_seq_id') ||
    -- The Primary Key of the column
    apex_item.hidden(2, x.ceah_people_id, null, x.seq_id || '_ceah_people_id') || x.ceah_people_id ceah_people_id,
    -- Employee Name
    case when x.seq_id = -1
    then
    apex_item.select_list_from_query (3,
    NULL,
    'select distinct language_name d, '
    || 'language_id r from foreign_language',
    'style="width:170px" ' ,
    'YES',
    '0',
    '- Select Language -',
    'x.seq_id_' || LPAD (9900 + LEVEL, 4, '0'),
    NULL,
    'NO'
    else
    apex_item.text (3,(select language_name from foreign_language where x.language_id = foreign_language.language_id),
    80,
    100,
    'style="width:170px" readonly="readonly"',
    'f32_' || LPAD (ROWNUM, 4, '0')
    end
    || err.language_id language_id,
    /* apex_item.text(3,x.language_id,null, null, null, x.seq_id || '_language_id') || err.language_id language_id,
    -- Employee Salary
    apex_item.text(4,x.proficiency, null, null, null, x.seq_id || '_proficiency') || err.proficiency ||
    -- Store the sql action type as well.
    apex_item.hidden(50,x.sql_action_typ, null, x.seq_id || '_sql_action_typ_id') proficiency,
    -- Last but not least the row error
    err.row_error
    FROM (SELECT ac.c001 seq_id,
    ac.c002 ceah_people_id,
    ac.c003 language_id,
    ac.c004 proficiency,
    ac.c049 modifiable_flag,
    ac.c050 sql_action_typ
    FROM apex_collections ac
    WHERE ac.collection_name = 'DATA_COLLECTION'
    ORDER BY ac.seq_id) x,
    -- Error Collection
    (SELECT ac.seq_id seq_id,
    ac.c002 ceah_people_id,
    ac.c003 language_id,
    ac.c004 proficiency,
    ac.c050 row_error -- Useful when individual data is correct, however the row of data is not. Ex: start/end dates
    FROM apex_collections ac
    WHERE ac.collection_name = 'ERROR_COLLECTION'
    ORDER BY ac.seq_id) err
    WHERE x.seq_id = err.seq_id(+)

    I got so frustrated I started over. I'm following the how to create a manual form.
    http://www.oracle.com/technology/products/database/application_express/howtos/tabular_form.html#MANUAL
    The problem I'm now having is even though I display items as hidden, there is a column holder on the report for them. If I go into the report attributes and toggle the show attribute off I cannot reference an items value in my logic. I used /&nbsp/ for the column heading but I still get the little sort arrow where the column heading should be. I tried to toggle the sort attribute off but the sort arrow still shows up. How can I use the apex_item.hidden and not get a place holder for the column on a report? Thanks, Elizabeth
    Here is the code I'm using to generate the report:
    select x.ceah_people_lang_id,
    x.language_id,
    x.proficiency,
    x.ceah_people_id
    from (
    select apex_item.hidden(1,ceah_people_lang_id) ceah_people_lang_id,
    apex_item.select_list_from_query(2,language_id,'select language_name, language_id from foreign_language') language_id,
    apex_item.select_list_from_query(3,proficiency,'select name, id from proficiency') proficiency,
    apex_item.hidden(4,ceah_people_id) ceah_people_id
    from ceah_people_language where ceah_people_language.ceah_people_id = :P152_person_id
    union all
    select apex_item.hidden(1,null) ceah_people_lang_id,
    apex_item.select_list_from_query(2,null,'select language_name, language_id from foreign_language') language_id,
    apex_item.select_list_from_query(3,null,'select name, id from proficiency') proficiency,
    apex_item.hidden(4,null) ceah_people_id
    from dual) x

  • Generic solution for cascading select lists/lovs

    After implementing several times a select list/lov, which is depending on another item on the same page (see the AJAX example from Carl Backstrom), I thought that it was time to come up with a more generic solution where I don't have to implement javascript code and on-demand processes for each lov anymore.
    I want to contribute my findings to the APEX community. More details about my solution can be found at
    http://inside-apex.blogspot.com/2006/11/generic-solution-for-depending-select.html
    Any feedback is welcome!
    Patrick
    My APEX blog http://inside-apex.blogspot.com

    Hi Bjorn,
    the "First schema provisioned" property is just available in "normal" workspaces, not in the "internal" workspace. But it's just the schema-name where the tables/... of your application are stored.
    About your problem. Which version do you use? V2.0?
    V2.0 doesn't have the APEX dictionary views, I think they have been created in V2.2.
    So the only way to use my solution is to use the version which is stored into the FLOWS_... schema. But it has to be modified before.
    1.) In the ApexLib.js file, all ocurrences of $x have to be replaced by html_GetElement => $x doesn't exist in V2.0
    2.) Replace the FLOWS_020200 thru FLOWS_020000 in the header of the package (ApexLib_for_flows_020200.pks and .pkb)
    3) Maybe you have to remove the where-clause restriction NVL(UPPER(ITEM_COMMENT), '@') NOT LIKE '%$APEXLIB_IGNORE_LOV$%', I'm not sure if the comment column exists in V2.0. Don't have a possibility to check that now.
    I will come up with a solution on sunday or monday.
    Patrick

  • Interactive Report with Select List LOV's

    Hi All -
    I need to develop an Interactive Report which displays reports based on values selected from a select list (LOV's) on this IR report.
    Following is what I am working on.
    This page has 2 select lists with the corresponding LOV values:
    Date From ==> Q1, 2010
    Q2, 2010
    Q3, 2010
    Q4, 2010               
    Date To ==> Q1, 2010
    Q2, 2010
    Q3, 2010
    Q4, 2010     
    When the user visits this report page first time, "Date From" and "Date To" select lists have null values and the report should display all the records.
    Once the user selects values from "Date From" and "Date To" select lists then the report should be filtered based on the values selected i.e.
    If the user selects *"Date From"* ==> Q1, 2010 and *"Date To"* ==> Q3, 2010, then the report should show all the records whose reporting period falls between "Jan 1, 2010" to "Sept 30, 2010" i.e Q1-Q3 2010 only.
    And the Reporting date format stored in the table is "18-OCT-2010", "12-APR-2010" etc ....
    How can this be achieved. Please share your expertise.
    Thanks,
    -Seenu

    Hi,
    First Create 2 Select List with List Of Queries in LOV Region like
    +'STATIC2:Q1-2010;01-Jan-2010,Q2-2010;01-Apr-2010,Q3-2010;01-Jun-2010,Q4-2010;01-Oct-2010'+ in Date From List lets name it P10_DF and
    +'STATIC2:Q1-2010;31-Mar-2010,Q2-2010;30-Jun-2010,Q3-2010;30-Jun-2010,Q4-2010;31-Dec-2010'+ in Date To List P10_DT.
    (Enable Display Null Value on both the select list)
    Then Now in the Report Source add Where Query some thing like
    select FIELD1,FIELD2 from TBL_REPORTS where Report_Date>=NVL( *:P10_DF* ,'01-Jan-2010') and Report_Date<=NVL( *:P10_DT* ,'31-Dec-2010')
    And also create a button to submit the values
    NOTE: This is not tested but this is how i will come about it in the specified scenario. You can try this and post the results...
    Good Luck.
    Regards,
    Afsar

  • TypeError: s.text(...).addClass is not a function on a Select list item jquery mobile theme

    Hi.
    i got a page with jquery mobile template, i got an select list item based on customers , when i touch the field, it display correcty all my customers, but when i try to pick some records i just get the error (i am using firefox firebug to see the error):
    TypeError: s.text(...).addClass is not a function
    ...ollapsiblebound",!0).bind("expand collapse",function(t){var n=t.type==="collapse...
    here is my query :
    select
    nombre_cliente || ' ' || apellidos_cliente a, codigo_cliente b
    from sti_cliente
    where
    codigo_compania in (select distinct codigo_compania from STI_COMPANIA_SUCURSAL_USUARIO where upper(codigo_usuario) = upper(:APP_USER))
    and estado_cliente = 'A'
    and (MANEJA_INVENTARIO_CONSIGNACION = 'S'
    and (codigo_compania, codigo_vendedor) in (select codigo_compania, codigo_vendedor from VTA_MAESTRO_VENDEDORES where codigo_usuario = upper(:APP_USER)) or cliente_contado = 'S')
    order by nombre_cliente, apellidos_cliente
    i have supress a dynamic action based on the field, but seems the problem is something within the query.
    i am running on :
    Application Express 4.2.4.00.08
    Application Express Listener version : 2.0.5.287.04.27
    Application Express Listener server info: Grizzly/1.9.49
    thanks for any tip.

    PLEASE DO NOT post to long since expired threads.  The poster is probably NOT following this thread and your response doesn't really help them with their issue...
    Elephants wear tu-tus so they can hide in pine trees. Did you ever see an elephant in a pine tree? No? Well then, you know it works.
    Thank you,
    Tony Miller
    LuvMuffin Software
    Ruckersville, VA

  • Calling an  pipeline function in a Select query

    Hello gurus ,
    i have a query calling pipeline function
    WITH t AS
         (SELECT dep_code, emp_id
            FROM test1
           WHERE dep_code = 'C1' AND emp_id = '123')
    SELECT *
      FROM TABLE
              (CAST
                  ((pk_get_emp_dtls.fn_t_get_emp_dtls (t.dep_code,
                                                       t.empid,
                                                       TRUNC (SYSDATE)
                   ) AS ps_ot_emp_dtls
           t;in this above query i want to use the emp id ,dept code from the with clause as parameters in the function pk_get_emp_dtls.fn_t_get_emp_dtls
    but error occures SQL command not ended properly
    Regards,
    Friend
    Edited by: most wanted!!!! on Nov 14, 2012 6:17 AM

    I see Solomon beat me to it...
    SQL> create or replace type o_emp as object (empno number, ename varchar2(10))
      2  /
    Type created.
    SQL>
    SQL> create or replace type t_emp as table of o_emp
      2  /
    Type created.
    SQL>
    SQL> create or replace function get_emp(p_deptno in number) return t_emp pipelined as
      2    v_emp o_emp := o_emp(null,null);
      3    cursor cur_emp is
      4      select empno, ename
      5      from   emp
      6      where  deptno = p_deptno;
      7  begin
      8    for i in cur_emp
      9    loop
    10      v_emp.empno := i.empno;
    11      v_emp.ename := i.ename;
    12      pipe row (v_emp);
    13    end loop;
    14    return;
    15  end;
    16  /
    Function created.
    SQL>
    SQL>
    SQL> with t as (select deptno from dept where dname = 'SALES')
      2  select x.*
      3  from   t, table(get_emp(t.deptno)) x
      4  /
         EMPNO ENAME
          7499 ALLEN
          7521 WARD
          7654 MARTIN
          7698 BLAKE
          7844 TURNER
          7900 JAMES
    6 rows selected.
    SQL> with t as (select deptno from dept where dname = 'SALES')
      2  select x.*
      3  from   table(get_emp(t.deptno)) x, t
      4  /
    from   table(get_emp(t.deptno)) x, t
    ERROR at line 3:
    ORA-00904: "T"."DEPTNO": invalid identifier

  • Using pipelined functions with bind variables in Apex...

    Hy all:
    I have a table which has about 10 million records and it is hanging up the system when it is trying to retrieve the data from that table... so what I have done is I created a pripelined
    function and then trying to retrieve data using an SQL statement ... when I try to use a bind variable to filter by the date and location it is binding according to the location
    but not by date ... can anyone help me in this please!!
    Help greatly appreciated !
    Thanks in advance !

    Hi Denes:
    Create or replace type ohe1 as object (
    IMLITM NCHAR(50), IMAITM NCHAR(50), IMDSC1 NCHAR(60), COUNCS NUMBER(22), LIPQOH NUMBER(22),
    LIMCU NCHAR(24), LILOCN NCHAR(40), LILOTN NCHAR(60), LILOTS NCHAR(2), IOMMEJ NUMBER(22))
    CREATE OR REPLACE TYPE OHE AS TABLE OF Ohe1
    CREATE OR REPLACE FUNCTION GET_ohe
    return OHE PIPELINED
    IS
    m_rec ohe1:= ohe1 (NULL,NULL,NULL,0,0,NULL,NULL,NULL,NULL,0);
    begin
    for c in (select f1.LITM LITM, F1.AITM AITM, F1.DSC1 DSC1, F5.UNCS UNCS,
    F21.QOH QOH, F21.MCU MCU, F21.LOCN LOCN, F21.LOTN LOTN, F21.LOTS LOTS,
    F8.MEJ MEJ FROM F1 F1, F2 F2, F21 F21, F5 F5, F8 F8
    WHERE (F5.EDG='07') AND (F21.QOH != 0) AND F2.IBITM = F1.IMITM
    AND F21.ITM = F2.ITM AND F21.ITM = F5.ITM AND F21.MCU = F5.MCU
    AND F21.MCU = F2.MCU AND F21.LOTN = F8.LOTN AND F21.MCU = F8.MCU)
    loop
    m_rec.LITM:=c.LITM;
    m_rec.AITM:=c.AITM;
    m_rec.DSC1:=c.DSC1;
    m_rec.UNCS:=c.UNCS;
    my_record.QOH:=c.QOH;
    my_record.MCU:=c.MCU;
    my_record.LOCN:=c.LOCN;
    my_record.LOTN:=c.LOTN;
    my_record.LOTS:=c.LOTS;
    my_record.MEJ:=c.MEJ;
    PIPE ROW (my_record);
    end loop;
    return;
    end;
    select LITM , AITM , DSC1 , UNCS*.0001 UNCS, QOH*.0001 QOH, (UNCS*.0001)*(QOH*.0001) AMOUNT,
    MCU MCU, LOCN LOCN, LOTN LOTN, LOTS LOTS, jdate(DECODE(MEJ,0,100001,MEJ)) MEJ FROM
    TABLE (GET_ohe)
    WHERE trim(LIMCU)= TRIM(:OHE_BRANCHID)
    AND (jdate(DECODE(MEJ,0,10001,MEJ)) >=:FROMEXPDT
    AND jdate(DECODE(MEJ,0,10001,MEJ)) <=:TOEXPDATE)
    The MEJ is a julian date and I am trying to convert it into a date ..... using the function jdate! and the pipelined function is created without any errors
    and I am able to get the data with correct branch location bind variable but only problem is it is not binding the date filters in the sql.....
    Thanks
    Edited by: user10183758 on Oct 16, 2008 8:17 AM

  • Trouble using a function in the where clause

    Hello,
    I am using a function found at ask.tom.oracle.com which converts a long data type to a character. The function is returning an error when it is placed in the where clause. The sql statement , error message and the function from ask tom are shown below. Does anyone know how to fix this?
    <pre>
    SELECT A.FLDPHYSICAL,
    A.FLDEXPOSURE,
    A.FLDDATEDUE,
    A.FLDDATELAST,
    A.FLDEMPLOYEE,
    B.FLDBDATE,
    B.FLDMAILSTOP,
    B.FLDREC_NUM,
    B.FLDLNAME,
    B.FLDMI,
    B.FLDFNAME,
    B.FLDBDATE,
    B.FLDDEPT,
    B.FLDSTATUS,
    B.FLDSSN,
    B.FLDHOMEPHON,
    B.FLDWORKPHON,
    B.FLDID,
    B.FLDDIVISION
    FROM REQEXAM A,
    EMPLOYEE B,
    EMPLOYEE_MEMO C
    WHERE A.FLDEMPLOYEE = B.FLDREC_NUM
    AND b.flduserstr = c.fldrec_num
    AND OHM_PKG.GET_LONG('EMPLOYEE_MEMO', 'FLDDATA', C.ROWID) LIKE '%CDL YES%'
    AND A.FLDDATEDUE > '01/01/1900'
    AND A.FLDPHYSICAL ='CDP'
    ORDER BY B.FLDDIVISION,
    B.FLDLNAME,
    B.FLDFNAME,
    B.FLDMI,
    A.FLDDATEDUE
    The error message
    Error at Command Line:26 Column:4
    Error report:
    SQL Error: ORA-00904: "OHM_PKG"."GET_LONG": invalid identifier
    00904. 00000 - "%s: invalid identifier"
    create or replace
    PACKAGE OHM_PKG AS
    /* TODO enter package declarations (types, exceptions, methods etc) here */
    function getlong( p_tname in varchar2,p_cname in varchar2,p_rowid in rowid ) return varchar2;
    END OHM_PKG;
    create or replace
    PACKAGE BODY OHM_PKG AS
    function getlong( p_tname in varchar2,p_cname in varchar2,p_rowid in rowid ) return varchar2 as
    l_cursor integer default dbms_sql.open_cursor;
    l_n number;
    l_long_val varchar2(4000);
    l_long_len number;
    l_buflen number := 4000;
    l_curpos number := 0;
    begin
    dbms_sql.parse( l_cursor,
    'select ' || p_cname || ' from ' || p_tname ||
    ' where rowid = :x',
    dbms_sql.native );
    dbms_sql.bind_variable( l_cursor, ':x', p_rowid );
    dbms_sql.define_column_long(l_cursor, 1);
    l_n := dbms_sql.execute(l_cursor);
    if (dbms_sql.fetch_rows(l_cursor)>0)
    then
    dbms_sql.column_value_long(l_cursor, 1, l_buflen, l_curpos ,
    l_long_val, l_long_len );
    end if;
    dbms_sql.close_cursor(l_cursor);
    return l_long_val;
    end getlong;
    END OHM_PKG;
    </prev>

    Remove the '_' from the function's name as below:
    AND OHM_PKG.GETLONG('EMPLOYEE_MEMO', 'FLDDATA', C.ROWID) LIKE '%CDL YES%'

  • How to Populate table using values from a muti-select list

    I have a muti-select list in a page, the user can select some of the values from the muti-select list. How to populate a table in a process using the selected values.
    Thanks.
    XP

    XP,
    you can also have a look at the following thread.
    Re: Shuttle Control In APEX 3
    Patrick
    My APEX Blog: http://inside-apex.blogspot.com
    The ApexLib Framework: http://apexlib.sourceforge.net
    The APEX Builder Plugin: http://sourceforge.net/projects/apexplugin/

  • Using Pipelined Functions

    Hi,
    Can any one please provide me a good example to try out pipelined function in oracle pl/sql ?
    Thanks

    I'm curious. In your biography you state "I am a software programmer working in IT field from last 7-8 years. I am a OCP in Application Development Track"
    So how come that you are not familiar with Oracle Documentation and it's full text search capability, which would have given you a reference, such as this?
    C.

  • Trouble using ISBLANK Function

    I am trying to calculate the days outstanding for payments.
    Checked to see if an invoice date was entered (A)
    If A had date entered I wanted to run various calculations on the dates.
    What I started off with was:
    IF(A = “*”, (Run Days to Payment Calculation), (Run Days Outstanding Calculation))
    I thought that I could use the Asterix wildcard to determine if A2 was blank. But, that failed. I was looking at the ISBLANK function but did not see how to make that work.
    FYI: Here is what I had planned for the other two calculations that are to be nested in the IF statement.
    Days to Payment:
    =DATEDIF(A, G2, “D”)
    (G2=Payment Date)
    Days Outstanding:
    =DATEDIF(A, (NOW()), “D”)

    What let you think that the asterisk behaves as a wildcard ?
    The use of Functions is described (what a surprise) in "*iWork Formulas and Functions User Guide*" which every user may download thru the Help menu.
    Here is a quick and dirty example.
    =IF(ISBLANK(A),"the cell in column A is empty","the cell in column A is filled")
    Yvan KOENIG (VALLAURIS, France) jeudi 17 décembre 2009 21:19:59

  • A select list from query question

    Hello all - I've looked in detail at a great deal of posts on this subject and believe what I am trying to achieve is not unusual or out of scope. Therefore it's likely me mis-interpreting something and I'd be grateful for anybody's input.
    I have the following as a column in a report
    apex.select_list_from_query( 21,
              a.reserved_by,
              'select g.user_name,g.user_id
              from users g, user_roles h
         where g.user_id=h.user_id and h.role_id in (2,3)'
         , null ,
         'YES',
         '-1',
         '- Not Reserved -') slov1 ,
    If 'reserved_by' is null, I want '- Not Reserved -' to appear in the select list, otherwise I want the value in user_name. Where reserved_by is not null, I get the appropriate user_name returning the appropriate user_id. Where reserved_by is null, I get null returning null in the select list.
    '- Not Reserved -' which is the value I've tried to assign to p_null_text, also appears in the select list and returns '-1' . However '-Not Reserved-' only appears as an extra option, rather than becoming the display value for reserved by=null.
    So, if the values in reserved_by are 'user1','user2' and null and the P_query returns
    'user1',1
    'user2',2
    'user3',3
    my select list for the row having reserved_by=NULL looks like
    user1
    user2
    user3
    - Not Reserved -
    NULL (ie blank).
    Following a suggestion in a thread from 2005(!), I changed the p_query to
    'select g.user_name,g.user_id
    from users g, user_roles h
    where g.user_id=h.user_id
    and h.role_id in (2,3) union ALL
    SELECT ''- Not Reserved -'' user_name, 0 user_id from dual',
    null, NO'
    and set p_show_null to 'NO'. This achieves the functionality I want. So perhaps, though I can't figure out what I was doing wrong with the 'correct' usage. Anyway, I'll post this in case it proves useful to others!
    Toby

    Hi Apex Experts,
    can some one suggest me an alternate way to achieving this. I really have no idea on how to take this forward. :(
    Any help/pointers will be highly appreciated.
    Thanks,
    Satya.
    Edited by: Chaitu_Apex on May 13, 2010 3:50 AM

  • Select List LOV will not accept query that seems to be valid

    Hi,
    I modified an LOV query to add the number of results to the display_value return column. I have verified that the query works in SQL Workshop/SQL Commands, but when I paste it into the LOV it will not save changes. It says the LOV query is invalid....
    To get it to apply I had to turn it into a Named LOV, and the page would load, but I get the error:
    Error: ORA-06550: line 1, column 77: PL/SQL: ORA-01744: inappropriate INTO ORA-06550: line 1, column 7: PL/SQL: SQL Statement ignored performing List of Values query:
    The query I am trying to perform is:
    select STATUS.STATUS_NAME||' ('||
    (select count(*)
    from TICKET
    where TICKET.USER_ID = (select USER_ID from LOGIN where upper(LOGIN.USER_NAME) = upper(:APP_USER))
    and TICKET.STATUS_ID = STATUS.STATUS_ID)||')' display_value,
    STATUS.STATUS_ID return_value
    from STATUS
    order by STATUS_ID
    Here are the results when ran in SQL Commands:
    DISPLAY_VALUE RETURN_VALUE
    Defined (7) 0
    Accepted (1) 1
    In Process (0) 2
    Completed (1) 3
    Cancelled (0) 4
    Thanks in advance for any help.

    David,
    Try the following and let me know what you get:
    SELECT status.status_name || ' (' ||
       (SELECT COUNT(*)
        FROM ticket
        WHERE ticket.user_id IN
          (SELECT user_id
           FROM login
           WHERE UPPER(login.user_name) = UPPER(:app_user))
       AND ticket.status_id = status.status_id)
    || ')' display_value,
       status.status_id return_value
    FROM status
    ORDER BY status_idAlso, if you find you're using the user's id a lot, I would recommend creating an application level item called USER_ID (make it protected). Then I would add a little code in the post authentication process that sets the value of that item.
    I'm not sure that there would really be much of a performance benefit, but you would have effectively SPODified (Single Point of Definition) the lookup allowing you to reference it where ever you need making your code look better and the maintenance easier.
    Then the query would look like this:
    SELECT status.status_name || ' (' ||
       (SELECT COUNT(*)
        FROM ticket
        WHERE ticket.user_id = :USER_ID)
       AND ticket.status_id = status.status_id)
    || ')' display_value,
       status.status_id return_value
    FROM status
    ORDER BY status_idRegards,
    Dan

Maybe you are looking for

  • In Report,order by clause is not working

    Hi All, For the report i prepared the query in this one am using the order by clause,i run the query in the sql plus working fine am getting the data based on the order by clause.when i use the same query for the report am getting the data but not in

  • I downloaded the ios 7.0.4 n tried to update it through itunes ....bt it doesnt work and its showing some error...!!!!

    i dwnloaded the ios 7.0.4 on my laptop n tried to update my iphone through lap bt it din wrk its showing some error tht m nt really awre of...some please help me out...!!!!

  • Mouse lags

    My apologies if this has been discussed elsewhere. I have looked but to no avail. I am using the 2011 new iMac i5 with 12 GB of RAM and I have tried a wired A4tech Mouse (heavy lag) and a Genius wireless mouse. I am using Windows 7 via boot camp. I o

  • Next Payment run in F110

    Hi Can we make 'next payment date' in F110 as default with 'Posting date +1' & non editable. Thanks.

  • More Time

    Hi,   I have 2 programs. Program 1--> Standard Program Program 2--> Clone of Standard Program One of my friend is running both the programs. Program 1 is taking around 5 to secs to execute. But Program 2 with same input as Program 1 is taking more ti