Error in the Dynamic query in AME

Hi Experts,
I am using the below query but i am facing the error "Ensure the query selects exactly 1 column" in AME Approval group under Dynamic query.
But the query returns only one column when i ran in toad.
select 'person_id:'||a.person_id  from
(SELECT to_number(EXTRACT(column_value,'/e/text()')) person_id
from (select (XXSYK_GET_PERSON_ID(:transactionId)) col1 from dual) x,
TABLE(XMLSEQUENCE(EXTRACT(XMLTYPE('<ROW><e>'||REPLACE(col1,',','</e><e>')||'</e></ROW>'),'//e')))
)A
Thanks,
Sadeesh

Thanks !!!!

Similar Messages

  • Oracle Repors 3.2(using the Dynamic query)

    How can I create a report with dynamic queries?
    For example, I have a form with several check_boxes which represent the field_names.My user selecting the fields by checking the check_boxes in the form. After finishing the user's selection, i want to generate a query based on the fields chosen by the user and a report needs to be generated based on the dynamic query.
    Can anyone has any idea on this requirement? Quick response is appreciated. Thanks.

    hello,
    this sounds like the perfect oportunity for using the runtime customization feature of oracle reports 6i.
    using that you can either custimize an existing report using an XML file or -which fits more your requirement- encode a report-definition in XML and run the XML file.
    you could dynamically create that file according to the users selection and then run this file.
    you find more about runtime customization in the documentation of reports 6i.
    regards,
    the oracle reports team

  • Table name stored in another table and how to Build the Dynamic Query

    TblMasterTable
    Id
    Unqid
    Tbl_TemplateNameid
    Tbl_Template1
    Unqid
    Field1
    Filed2
    Tbl_Template2
    Unqid
    Field1
    Filed2
    Filed3
    Tbl_Template3
    Unqid
    Field1
    Filed2
    Filed3
    Filed4
    Filed5
    TblMasterTable contains the reference for the table names.
    TblMasterTable contains the data
    1 12     Tbl_Template1
    2 22     Tbl_Template2
    3 12     Tbl_Template1
    4 343 Tbl_Template3
    I want to build the query to retrieve all the Template table records based on the TblmasterTable data for a given id.

    This is possible but you need to understand the performance implications of Dynamic SQL before proceeding with this approach.
    <br>
    use this logic:<br>
    declare sqlstring varchar2(500):=null <br>
    select 'select stuff from '|| tbl_templatenameid into sqlstring from MasterTable where id=someid;<br>
    execute immediate sqlstring;
    <br>
    <br>
    I have really seen very few cases where this approach is justified.
    <br>
    <br>
    Dave<br>
    lehr.servehttp.com

  • Error in the simple Query

    Dear Experts,
    Not able to Execute this simple query :
    Select T1.JobID , T1.BudgetValue,T1.ActualValue FROM [dbo].[Enprise_JobCost_ActualBudgetView] T1 WHERE T1.TransType = '[%0]'
    Regards

    Hello,
    View - A View in simple terms is a subset of a 'virtual table. It can be used to retrieve data from the tables, Insert, Update or Delete from the tables. The Results of using View are not permanently  stored in the database.
    Stored Procedure -  A stored procedure is a group of SQL statements which can be stored into the database and can be shared over the netwrok with different users.
    http://www.geekinterview.com/question_details/65914
    Better make a UDT for your requirement.
    Thanks
    Manvendra Singh Niranjan

  • Error in the SAP query for Assets?

    Hi,
    I am trying to make 2 queries related to the assets but it is not selecting the data may I know why and where I am doing wrong.
    I have joined the tables ANLA, ANLC, ANLP and ANLB.
    Fields that have been selected are as follows:
    Asset Subnumber ANLA-ANLN2
    Asset Class ANLA-ANLKL
    Asset description ANLA-TXT50
    Company Code ANLA-BUKRS
    Serial number ANLA-SERNR
    Main Asset Number ANLA-ANLN1
    Asset Subnumber ANLA-ANLN2
    Asset Class ANLA-ANLKL
    Asset description ANLA-TXT50
    Company Code ANLA-BUKRS
    Serial number ANLA-SERNR
    Main Asset Number ANLA-ANLN1
    Fiscal Year ANLC-GJAHR
    Ordinary depreciation posted in the current year ANLC-NAFAG
    Planned ordinary depreciation for the year ANLC-NAFAP
    Accumulated ordinary depreciation ANLC-KNAFA
    Cumulative acquisition and production costs ANLC-KANSW
    Asset Subnumber ANLA-ANLN2
    Asset Class ANLA-ANLKL
    Asset description ANLA-TXT50
    Company Code ANLA-BUKRS
    Serial number ANLA-SERNR
    Main Asset Number ANLA-ANLN1
    Fiscal Year ANLC-GJAHR
    Ordinary depreciation posted in the current year ANLC-NAFAG
    Planned ordinary depreciation for the year ANLC-NAFAP
    Accumulated ordinary depreciation ANLC-KNAFA
    Cumulative acquisition and production costs ANLC-KANSW
    Transactions for the year affecting asset values ANLP-ANSWL
    Planned ordinary depreciation for the year ANLP-NAFAP
    Ordinary depreciation posted in the current year ANLP-NAFAG
    Ordinary depreciation to be posted ANLP-NAFAZ
    Asset acquisition year (currently not used) ANLP-ZUJHR
    Depreciation calculation period ANLP-PERAF
    Original useful life in years ANLB-NDURJ
    Depreciation key ANLB-AFASL
    Please tell me where SAP query is no working and what shall I do to make it work.
    Thanks and regards
    Nitin

    Thanks !!!!

  • How to get the dynamic query result

    If in one query, there is the amount range dimension, based on different dimension value combination, the customer revenue should be refreshed into different range, how to make it by cube?
    eg.
    Customer Store    Material  Month    Amount
    C001     M & S    Tennis    2005/01   "10"
    C001     Douglas  Tennis    2005/02   "60"
    C002     M & S    Soccer    2005/01    "1"
    C002     M & S    Soccer    2005/02    "50"
    C002     M & S    Tennis    2005/02    "50"
    C003     Douglas  Tennis    2005/01    20
    Query condition:
    Time Customer Amount Range     Amount
    2005 C001     0~50_____________0
    2005 C001     51~100___________70
    2005 C001     100 +____________0
    2005 C002     0~50_____________0
    2005 C002     51~100___________0
    2005 C002     100+_____________101
    2005 C003     0~50_____________20
    2005 C003     51~100___________0
    2005 C003     100+_____________0
    However, if I drill down Time into month, the result is total different, I only list the result related to customer C001
    Time     Customer  Amount Range    Amount
    2005/01  C001      0~50____________10
    2005/01  C001      51~100__________0
    2005/01  C001      100 +___________0
    2005/02  C001      0~50____________0
    2005/02  C001      51~100__________60
    2005/02  C001      100 +___________0
    Any good solution on that? Thanks for any input.
    Message was edited by: Lei Shao

    Hi, Sen,
    I used your solution in my infocube and query, where I created a structure with 'between'. However, it is still the simple summation in different amount range.
    Just like the following:
    Sales ORG / Sales Office / Sales Rep / Amount
    East      / Atlanta      / 1001      / 3
    East      / Atlanta      / 1002      / 4
    So the query result is the same:
    S-ORG / S-Office / S-Rep / Amount Range / Amount
    East  / Atlanta  / 1001  / 0~5          / 3
    East  / Atlanta  / 1001  / 5+           / 0
    East  / Atlanta  / 1002  / 0~5          / 4
    East  / Atlanta  / 1002  / 5+           / 0
    When I remove 'drill down' for Sales Rep, the result is:
    S-ORG / S-Office / Amount Range / Amount
    East  / Atlanta  / 0~5          / 7
    East  / Atlanta  / 5+           / 0
    However our expection for the result is different, because in business traction, if we remove sales rep, the sales org and sales office will get the sub-total like this: (we can image it with ABAP program sub-total)
    Sales ORG / Sales Office / Amount
    East      / Atlanta      / 7
    So our expection for the result is:
    S-ORG / S-Office / Amount Range / Amount
    East  / Atlanta  / 0~5          / 0
    East  / Atlanta  / 5+           / 7
    Therefore, any good suggestion for this?
    Thanks a lot
    Regards,
    LS

  • TOPLINK-6119 ERROR for the following query,

    any ideas as how to modify or make the query work? thanks,
    Query:
    ====
    ReadAllQuery query5 = new ReadAllQuery();
    query5.setReferenceClass( Instrument.class );
    query5.setSelectionCriteria( new ExpressionBuilder().get( "shortName" ).equal( shortName ) );
    query5.addBatchReadAttribute( query5.getExpressionBuilder().anyOf( "customFields" )
    .get( "stringValue" ).equal( "XYZ987" ) );
    Exception stack
    ===========
    Database exception: Exception [TOPLINK-6119] (Oracle TopLink - 10g Release 3 (10.1.3.3.0) (Build 070620)): oracle.toplink.exceptions.QueryException
    Exception Description: The join expression
    Relation operator =
    Query Key stringValue
    Query Key customFields
    Base QUERY OBJECT
    Constant XYZ987 is not valid, or for a mapping type that does not support joining.
    Query: ReadAllQuery(com.integral.finance.instrument.Instrument).
         at com.integral.persistence.PersistenceFactory.handleException(PersistenceFactory.java:793)
         at oracle.toplink.publicinterface.Session.handleException(Session.java:1951)
         at oracle.toplink.publicinterface.Session.executeQuery(Session.java:1021)
         at oracle.toplink.publicinterface.Session.executeQuery(Session.java:950)
         at com.integral.finance.instrument.test.InstrumentCustomFieldPTestC.testInstrument(InstrumentCustomFieldPTestC.java:588)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at junit.framework.TestCase.runTest(TestCase.java:154)
         at junit.framework.TestCase.runBare(TestCase.java:127)
         at junit.framework.TestResult$1.protect(TestResult.java:106)
         at junit.framework.TestResult.runProtected(TestResult.java:124)
         at junit.framework.TestResult.run(TestResult.java:109)
         at junit.framework.TestCase.run(TestCase.java:118)
         at junit.framework.TestSuite.runTest(TestSuite.java:208)
         at junit.framework.TestSuite.run(TestSuite.java:203)
         at junit.textui.TestRunner.doRun(TestRunner.java:116)
         at com.intellij.rt.execution.junit.IdeaTestRunner.doRun(IdeaTestRunner.java:69)
         at junit.textui.TestRunner.doRun(TestRunner.java:109)
         at com.intellij.rt.execution.junit.IdeaTestRunner.startRunnerWithArgs(IdeaTestRunner.java:24)
         at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:118)
         at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)

    Hello,
    Your are adding a selection criteria through the addBatchReadAttribute api which isn't allowed. It is expecting only a query key type expression.
    Try:
      ReadAllQuery query5 = new ReadAllQuery();
      query5.setReferenceClass( Instrument.class );
      ExpressionBuilder exb = query5.getExpressionBuilder();
      Expression batchExpression = exb.anyOf( "customFields" );
      Expression expression = exb.get( "shortName" ).equal( shortName );
      expression = expression.and( batchExpression.get( "stringValue" ).equal ("XYZ987") );
      query5.setSelectionCriteria( expression );
      query5.addBatchReadAttribute( batchExpression );This will return all Instrument objects with the require shortName and having a customField with the stringName of "XYZ987". It will use batching to return all referenced customFields (not just the ones with a stringName of "XYZ987").
    Best Regards,
    Chris

  • SAP MII 14.0 SP5 Patch 11 - Error has occurred while processing data stream Dynamic Query role is not assigned to the Data Server

    Hello All,
    We are using a two tier architecture.
    Our Corp server calls the refinery server.
    Our CORP MII server uses user id abc_user to connect to the refinery data server.
    The user id abc_user has the SAP_xMII_Dynamic_Query role.
    The data server also has the checkbox for allow dynamic query enabled.
    But we are still getting the following error
    Error has occurred while processing data stream
    Dynamic Query role is not assigned to the Data Server; Use query template
    Once we add the SAP_xMII_Dynamic_Query role to the data server everything works fine. Is this feature by design ?
    Thanks,
    Kiran

    Thanks Anushree !!
    I thought that just adding the role to the user and enabling the dynamic query checkbox on the data server should work.
    But we even needed to add the role to the data server.
    Thanks,
    Kiran

  • Getting the MDX query select error when running a webi report on BI query

    Getting the following error when running a webi report on BI query :
    A database error occured. The database error text is: The MDX query SELECT  { [Measures].[D8JBFK099LLUVNLO7JY49FJKU] }  ON COLUMNS , NON EMPTY [ZCOMPCODE].[LEVEL01].MEMBERS ON ROWS FROM [ZTEST_CUB/REP_20100723200521]  failed to execute with the error Unknown error. (WIS 10901).
    I have gone through many threads related to this error. But not able find the steps to follow for resoultion.
    Please help in this regard.
    Thanks,
    Jeethender

    The Fix Pack is also for Client Tools--it is a separate download.  Please see the text below for ADAPT01255422
    ADAPT01255422
    Description:
    Web Intelligence generates an incorrect MDX statement when a characteristic and a prompt are used.
    The following database error happens: "The MDX query ... failed to execute with the error
    Unknown error (WIS 10901)."
    New Behavior:
    This problem is resolved.
    This information is also available in the Fixed Issues document for any Fix Pack greater than 2.2.

  • Case expression error with a select query in the condition

    Consider the two query below:
    1. The first one use a case expression :
    select case when 3 > (select 1 from dual)*2 then 1 else 0 end from dual
    2. The equivalent with a decode expression:
    select
    decode(sign(3-(select 1 from dual)*2),1,1,0) from dual
    The first query return an ORA-00905 error but not the second one. It seems that the arithmetic operation (select 1 from dual)*2 cause the error. The folowing query doesn't return this error:
    select case when 3 > (select 2 from dual) then 1 else 0 end from dual
    I run the test with Oracle 8.1.7.3 Enterprise Edition. Is it a known bug ?
    Thomas

    ora8174>select case when 3 > (select 1 from dual)*2 then 1 else 0 end from dual;
    select case when 3 > (select 1 from dual)*2 then 1 else 0 end from dual
    ERROR at line 1:
    ORA-00905: missing keyword
    ora8174>select case when 3 > cast((select 1 from dual)*2 as number) then 1 else 0 end from dual;
    CASEWHEN3>CAST((SELECT1FROMDUAL)*2ASNUMBER)THEN1ELSE0END
                                                           1
    1 row selected.
    ora8174>select case when 3 > to_number((select 1 from dual)*2) then 1 else 0 end from dual;
    CASEWHEN3>TO_NUMBER((SELECT1FROMDUAL)*2)THEN1ELSE0END
                                                        1
    1 row selected.
    ora8174>@connect
    Connected.
    ora9204>select case when 3 > (select 1 from dual)*2 then 1 else 0 end from dual;
    CASEWHEN3>(SELECT1FROMDUAL)*2THEN1ELSE0END
                                             1
    1 row selected.

  • Syntax Error in the Query

    Dear All,
    Please tell me syntax error in the below query. When I'm going to write numeric number in this filed "$[ OVPM.DocNUm ]". It's working fine. But when I'm writing this it give me error.Please clear me where am wrong????I
    SELECT T0.[AcctNum] FROM VPM1 T0 WHERE T0.[DocNum] =$ [OVPM.DocNUm ]
    Regards
    Edited by: Anwar Ali Sohail on Sep 27, 2011 11:43 AM

    HI
    Try This
    SELECT T0.[CheckNum] FROM VPM1 T0  INNER JOIN OVPM T1 ON T0.DocNum = T1.DocEntry WHERE T0.[DocNum] = $[OVPM.DocNum]
    OR
    SELECT T0.[AcctNum] FROM VPM1 T0  INNER JOIN OVPM T1 ON T0.DocNum = T1.DocEntry WHERE T0.[DocNum] = $[OVPM.DocNum]
    Edited by: kambadasan on Sep 27, 2011 4:26 PM

  • Issue in attaching dynamic Query to the View Object

    Hi,
    We are having a View Object attached to the JRAD page.
    The View object is build thru as Expert mode. There is no any CDATA
    SQLQUERY stored in the VO.xml file.
    We are building the query dynamically and attaching it to the VO in
    RUNTIME.
    The code is as below
    // getFcstQuery() is method used to return the dynamic query
    String query = getFcstQuery();
    // Setting the Query to View Object
    getViewDef().setQuery(query);
    setQuery(query);
    The JRAD page has sorting option on 5 columns. so when a sorting is
    done the data are interchanged between the clients.
    For example how the query will be build id
    Say for the first user the query will be as
    "select ename,eno,dno from emp where eno=1 "
    for the second user the query may be
    "select ename,eno,dno from emp where eno=2 "
    Now if both the user hit the sorting on any of the column the data is
    interchagned between this both users.
    Please provide solution if possible.
    Thanks in advance
    Balamohan

    Hi Steve,
    We are using 5 tables in building the query.
    Say,
    1) summary
    2) transactions
    3) transactions_history
    4) rules
    5) rules_temp
    but only 2 tables are used at a time
    for read only we are using
    summary table
    for edit only mode we are using
    1) transactions and
    2) rules
    tables
    for edit and recalculate mode we are using
    1) transactions and
    2) rules_temp
    tables
    for one more condition we are using
    1) transactions_history and
    2) rules
    tables
    From all the above combination we are getting 5 columns. All the columns are defined the above combination tables. So using the same region. based on the conditions the combination of tables will change.
    Becoz of this we are building the query dynamically.
    Thanks
    Balamohan

  • Enhancing a Dynamic Query Object

    Hi All,
    I've added a new field to the contract header using the EEWB, I then added the field to an append on the dynamic query object BTQSrvCon. The entry in CRMC_REPDY and the BADI implementation of BADI CRM_RF_SEARCH_EEW have been created automatically.
    This is working fine when I use the 'IS' separator on the search screen and enter the field exactly.
    I would like to use the dynamic query separators (contains, starts with etc.) but when I try I get the error message
    Search contains fields where wild card search is not allowed
    Has anyone implemented this functionality?
    Thanks,
    Gregor

    The range operator is in the generated code:
    method IF_EX_CRM_RF_SEARCH_EEW~EXTEND_RF_QUERY.
    INCLUDE crm_object_names_con.
    DATA: lv_fieldname       TYPE name_komp,
           ls_qupart          LIKE LINE  OF ct_quparts,
           ls_qupart_and      LIKE LINE  OF ct_quparts,
           ls_range_value     TYPE crmt_bsp_range.
    READ TABLE it_range_value INDEX 1
       INTO ls_range_value.
    IF sy-subrc <> 0.
       RETURN.
    ENDIF.
    CHECK NOT ls_range_value-low IS INITIAL.
    CALL METHOD cl_crm_report_qupart=>get_qupart_by_token
       EXPORTING
         iv_token  = 'AND'
       IMPORTING
         ev_qupart = ls_qupart_and-querypart.
    lv_fieldname = flt_val.
    CALL METHOD cl_crm_report_qupart=>get_qupart_by_token
       EXPORTING
         iv_entityname = gc_objectname_reporting-ORDERADM_H
         iv_fieldname  = lv_fieldname
         iv_token      = 'RAN'
         it_rangetab   = it_range_value
       IMPORTING
         ev_qupart     = ls_qupart-querypart.
    APPEND ls_qupart     TO ct_quparts.
    APPEND ls_qupart_and TO ct_quparts.
    endmethod.
    I've put a break in the code which is not being triggered so something may be up with the BADI implementation.

  • Is it possible to enhance the dynamic search with Option field with custom

    Hi All,
    is it possible to enhance dynamic search with OPTION parameter like Equals to , Between etc, instead of these are we able to add our own? If yes, then which are steps need to perform.
    Thanking you.
    Regards,
    VjMHyd

    Just to test is this possible i wrote a sample program
    data: lr_dquery type REF TO cl_crm_bol_dquery_service.
    data: lv_status TYPE CRMT_PROCESS_DESCRIPTION.
    data: mv_bol_core type REF TO cl_crm_bol_core,
            lr_result_obj type ref to if_bol_bo_col,
            lv_opp_id type string,
            lr_entity type ref to cl_crm_bol_entity.
    MV_BOL_CORE = CL_CRM_BOL_CORE=>GET_INSTANCE( ).
    MV_BOL_CORE->START_UP( 'BT' ).
    *data: lv_opp_id type string.
    lr_dquery = cl_crm_bol_dquery_service=>GET_INSTANCE( 'BTQOpp'  ).
    if lr_dquery is bound.
    *   prepare the selection paramters
      lr_dquery->add_selection_param(
        exporting
          iv_attr_name =  'OBJECT_ID'   " Component name
          iv_sign      =   'I'  " Inclusion/exclusion criterion SIGN for range tables
          iv_option    =   'PI'  " Selection operator OPTION for range tables
          iv_low       =   lv_opp_id
    *   Get the dynamic result object and read the opportunity status from there
      lr_result_obj ?= lr_dquery->get_query_result( ).
      lr_entity ?= lr_result_obj->get_first( ).
      if lr_entity is bound.
        lr_entity->get_property_as_value( exporting iv_attr_name = 'STATUS'
                                    importing ev_result = lv_status ).
      endif.
    endif.
    BREAK-POINT.
    No syntax error but junk values returned as I had not written the logic for retrieval based on this operator. This means that if you add the selection_param to the dynamic query and then handle that same thing in the GENIL class for the component then you would be able to retrieve the values based on this.
    On the UI , you would be retrieving all the operators for the parameters. There for that particular field you have to add the new operator for your case. And this would be send to the Dquery class and added as a selection param. When the query is executed, if the genil class has been updated to handle this parameter, you should be able to retrieve the results.
    Regards
    Kavindra
    Edited by: joshi_kavindra on Jan 19, 2012 2:45 PM
    Edited by: joshi_kavindra on Jan 19, 2012 2:53 PM

  • Conditional URL ( CASE )  within a Dynamic Query

    I need extra eyes or help in RE-FORMATTING the following SELECT STMT. My approach was to formulate the following query to get a functioning URL to the page that displayed the corrections made on that record (if it was corrected)...which I did. So now I'm trying to move the CASE portion into a dynamic query report. I'm having difficulties rewriting the CASE into the dynamic query due to placement of single-quotes. Is there an easy way to do this...or do I still need to find the correct placement of quotes? HELP!
    select "ID",
    "EMP_ID",
    "ENTRY_DATE",
    "JOB_TITLE",
    "START_DATE",
    "END_DATE",
    "MODIFIED_DATE",
    "lkup_1"."DESCRIPTION" as "Status",
    CASE
    WHEN rec_status = 'CR' -- corrected record
    THEN '<a href="'
                      || 'f?p=&APP_ID.:90:&SESSION.::&DEBUG.::'
                      || 'P90_RID,P90_TIMESTAMP:'
                      || rid ||',' || TO_CHAR(modified_date,'MM/DD/YYYY')
                      || ">'
    || 'See Update(s)'
    || '</a>'
    || '</a>'
    ELSE NULL
    END LINK,
    "lkup_2"."DESCRIPTION" as "Action",
    "CATEGORY",
    apex_item.checkbox(1,rid) as "Confirm"
    from "JOB_SUMMARIES",
    "LOOKUPS" "lkup_1",
    "LOOKUPS" "lkup_2"
    where "REC_STATUS" <> 'CF'
    and "REC_STATUS" = "lkup_1"."CODE"
    and "ACTION" = "lkup_2"."CODE"(+)
    Here is what I sort of come up with, but I'm getting dizzy looking at it so many times!
    ' CASE '||
    ' WHEN rec_status = ' || '''' || '''CR''' || '''' ||
    ' THEN ' || '''' || '<a href="' || '''' ||
             '            ||' || '''' || 'f?p=&APP_ID.:90:&SESSION.::&DEBUG.::' || '''' ||
             '            ||' || '''' || 'P90_RID,P90_TIMESTAMP:' || '''' ||
             '            ||' || ' id ||' || '''' || ''',''' || '''' || '|| TO_CHAR(modified_date,' || '''' || 'MM/DD/YYYY' || '''' || ')' || '''' ||
             '            ||' || '''' || ">' || '''' ||
    ' ||' || '''' || 'See Update(s)' || '''' ||
    ' ||' || '''' || '</a>' || '''' ||
    ' ||' || '''' || '</a>' || '''' ||
    ' ELSE NULL '||
    ' END LINK, '||
    I'm still getting an error which is:
    1 error has occurred
    * Query cannot be parsed within the Builder. If you believe your query is syntactically correct,
    check the ''generic columns'' checkbox below the region source to proceed without parsing.
    ORA-00905: missing keyword

    I still cannot get the insertion of the CASE to compile...I keep getting MISSING EXPRESSION error.
    1 error has occurred
    * Query cannot be parsed within the Builder. If you believe your query is syntactically correct,
    check the ''generic columns'' checkbox below the region source to proceed without parsing.
    ORA-00936: missing expression
    Here is my dynamic query and I want to place the CASE as indicated. The numerous quotes or the Q syntax is really messing up my attempts to get this page working. I have a dynamic query because I am allowing search parameters. And I thought it would be nice to have a LINK to another page that displayed changed column values if a user CORRECTED one of their records. All changes must be verified and accepted by a REVIEWER.
    declare
    q varchar2(32767); -- query
    w varchar2(4000) ; -- where clause
    we varchar2(1) := 'N'; -- identifies if where clause exists
    begin
    q := 'select "ID", '||
    ' "EMP_ID", '||
    ' "ENTRY_DATE", '||
    ' "JOB_TITLE", '||
    ' "START_DATE", '||
    ' "END_DATE", '||
    ' "lkup_1"."DESCRIPTION" as "Status", '||
    >WANT TO PLACE CASE RIGHT HERE
    ' "lk_up2"."DESCRIPTION" as "Action", '||
    ' "CATEGORY", '||
    ' apex_item.checkbox(1,rid) as "Confirm" '||
    ' from "#OWNER#"."JOB_SUMMARIES", '||
    ' "#OWNER#"."LOOKUPS" "lkup_1", '||
    ' "#OWNER#"."LOOKUPS" "lkup_2" '||
    ' where "REC_STATUS" <> ' || '''' || 'CF' || '''' ||
    ' and "REC_STATUS" = "lkup_1"."CODE" '||
    ' and "ACTION" = "lkup_2"."CODE"(+) ';
    if :P16_EMP_ID != '-1'
    then
    w := ' AND EMP_ID = :P16_EMP_ID ';
    we := 'Y';
    end if;
    if :P16_RECORD_STATUS != '-1'
    then
    w := w || ' AND REC_STATUS = :P16_RECORD_STATUS ';
    we := 'Y';
    end if;
    if :P16_CATEGORY != '-1'
    then
    w := w || ' AND CATEGORY = :P16_CATEGORY ';
    we := 'Y';
    end if;
    if we = 'Y'
    then q := q || w;
    end if;
    return q;
    end;
    Edited by: JSandoval on Aug 10, 2009 3:42 PM

Maybe you are looking for