Identified error transformation ccBPM

Hi, i have development multimapping with ccBPM (name CreateMigoGoodsIssue). The steps following:
Receiver: Message with more rows of database
Transformation1: of 1 to N
ForEach: by rows database
Send1: Invoke synchronous RFC
Transformation2: Receive 2 messages for generate 1 message request for update database
Send2: Invoke synchronous JDBC
Image ccBPM is: http://www.freeimagehosting.net/2ef32
The problem is that running the ccBPM and the SXI_MONITOR can see the red flag in the outbound status column I and runs only once foreach. I visualized the RWB and the other status messages appear for delivery. Apparently the problem is in the Transformation2 because it eliminated the ccBPM and everything works fine, the strange thing is that used two messages that are generated in the BPM and I've tested in the ER the mapping Transformation2 operation and everything works fine. As I can identify the error that is occurring.
Image error SXI_MONITOR is: http://www.freeimagehosting.net/5a1d9
Thank you very much for the support.

Hi, I checked the workflow log and there is a HANDLE_SERVICE_EXCEPTION exception that says "Unmodeled exception when executing service for node 0000000028", view image  http://www.freeimagehosting.net/d81e3  . The node 0000000028 represents the step Transformation2 in which use the Mapping that maps operation two service interface (AssignGoodsIssueRequest_Abs and AssignGoodsIssueResponse_Abs) to service interface AssignUpdateDatabaseRequest_Abs, view image http://www.freeimagehosting.net/657be .
Details of error that can be seen in the workflow log says "com/sap/xi/tf/_BAPI_GOODSMVT_CREATE_Request_and_Bcom.sap.aii.mappingtool.tf7.IllegalInstanceException: Cannot create target element /ns0:Messages/ns0:Message1/ns2:UpdateDatabaseRequest/Statement/Mig", but is truncated. I have used two messages that are obtained in the BPM to test the mapping operation and the response is correct. I modified the mapping operation to use a service operation at the source and one target and there if it works. the problem is when I have two service interface in the source and one in source. A that caused this error?, As I can see the full log?.
Thank you very much for your support.

Similar Messages

  • Dynamic SQL Issue ORA-00904:invalid identifier error

    Here is my SP
    create or replace procedure srini_ref_cursor_test(p_county_code IN VARCHAR2,
    p_ref_cur out PK_FR_TYPES.cursor_type) is
    query_str varchar2(5000);
    begin
    query_str := 'SELECT * FROM dw_county where county_name = :P ';
    open p_ref_cur for query_str USING p_county_code;
    insert into srini_query_str_test values (query_str);
    commit;
    end srini_ref_cursor_test;
    When I pass the p_county_code = Adams working find.
    create or replace procedure srini_ref_cursor_test(p_county_code IN VARCHAR2,
    p_ref_cur out PK_FR_TYPES.cursor_type) is
    query_str varchar2(5000);
    begin
    query_str := 'SELECT * FROM dw_county where county_name in ('||p_county_code||')';
    open p_ref_cur for query_str;
    insert into srini_query_str_test values (query_str);
    commit;
    end srini_ref_cursor_test;
    When I pass the p_county_code = Adams for above SP I got the following error
    ORA-00904: "ADAMS": invalid identifier error
    With out Bind variables how Can I pass the Char type values in Dynamic SQL ?
    I would like to pass multipule values to p_county_code like 'Adams','Ashley' etc
    How Can I do this ?
    Thank for great help.
    Srini

    How do I write the Dynamic SQL for
    SELECT * FROM DW_COUNTY WHERE COUNTY_NAME LIKE 'Ad%'
    The usual way...
    hr@ORA10G>
    hr@ORA10G> var str varchar2(1000);
    hr@ORA10G> var cr refcursor;
    hr@ORA10G>
    hr@ORA10G> exec :str := 'select * from employees where first_name like ''A%''';
    PL/SQL procedure successfully completed.
    hr@ORA10G> -- note the escape character for each single quote
    hr@ORA10G> print str
    STR
    select * from employees where first_name like 'A%'
    hr@ORA10G>
    hr@ORA10G> exec open :cr for :str;
    PL/SQL procedure successfully completed.
    hr@ORA10G> print cr
    EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL                     PHONE_NUMBER      HIRE_DATE JOB_ID    SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID
            103 Alexander            Hunold                    AHUNOLD                   590.423.4567         03-JAN-90 IT_PROG          9000                       102            60
            115 Alexander            Khoo                      AKHOO                     515.127.4562         18-MAY-95 PU_CLERK         3100                       114            30
            121 Adam                 Fripp                     AFRIPP                    650.123.2234         10-APR-97 ST_MAN           8200                       100            50
            147 Alberto              Errazuriz                 AERRAZUR                  011.44.1344.429278   10-MAR-97 SA_MAN          12000             .3        100            80
            158 Allan                McEwen                    AMCEWEN                   011.44.1345.829268   01-AUG-96 SA_REP           9000            .35        146            80
            167 Amit                 Banda                     ABANDA                    011.44.1346.729268   21-APR-00 SA_REP           6200             .1        147            80
            175 Alyssa               Hutton                    AHUTTON                   011.44.1644.429266   19-MAR-97 SA_REP           8800            .25        149            80
            185 Alexis               Bull                      ABULL                     650.509.2876         20-FEB-97 SH_CLERK         4100                       121            50
            187 Anthony              Cabrio                    ACABRIO                   650.509.4876         07-FEB-99 SH_CLERK         3000                       121            50
            196 Alana                Walsh                     AWALSH                    650.507.9811         24-APR-98 SH_CLERK         3100                       124            50
    10 rows selected.
    hr@ORA10G>
    hr@ORA10G>pratz

  • Invalid State Identifier Error

    Hi All,
    I have implemented breadcrumb by using "a href="javascript:history.back()". The naviagtion is upto 5 repots and hence the breadcrumb will have 5 links. The issue is sometimes i get "Invalid State identifier" error with some random number when i click on any link in the breadcrumb.
    Unable to trace the root cause of this issue. Please provide your thoughts.
    Regards,
    Swati

    Thanks!!! Do you have any idea about Invalid state error? I have tried inserting the following as suggested by Oracle but doesnt help much.
    <StatePool>
    <MemoryExpireMinutes> 1440 </MemoryExpireMinutes>
    <DiskCleanupIntervalMinutes> 1440 </DiskCleanupIntervalMinutes>
    </StatePool>
    Regards,
    Swati

  • BDC -  How we can identify errors in Transaction method?.

    Hi ,
    How we can identify errors in Transaction method?.
    Regards
    Nikhil V Kumar

    HI
    CALL TRANSACTION 'FK01' USING IT_BDCDATA MODE 'A'
                            UPDATE 'S'
                            MESSAGES INTO IT_MESSAGES.
    IF SY-SUBRC <> 0.
    PERFORM FORMAT_MESSAGES.
    form FORMAT_MESSAGES .
    DATA: L_MSG(100).
    LOOP AT IT_MESSAGES.
    CALL FUNCTION 'FORMAT_MESSAGE'
    EXPORTING
       ID              = IT_MESSAGES-MSGID
       LANG            = SY-LANGU
       NO              = IT_MESSAGES-MSGNR
       V1              = IT_MESSAGES-MSGV1
       V2              = IT_MESSAGES-MSGV2
       V3              = IT_MESSAGES-MSGV3
       V4              = IT_MESSAGES-MSGV4
    IMPORTING
       MSG             = L_MSG
    EXCEPTIONS
       NOT_FOUND       = 1
       OTHERS          = 2
    write:/ l_msg.
      endloop.
    endform.                    " FORMAT_MESSAGES
    HOPE THIS HELPS,
    PRIYA.

  • New Repository variable failing with 'Unresolved Identifier' error

    Hi,
    I created a new repository variable and when used in the Segments/Reports it is failing with 'Unresolved Identifier' error. This is happening intermittently and sometimes it is getting the results as expected, Can you please let me know where I am wrong?
    Thanks,
    Viswanath K M

    Couple things to check here are :
    1) Make sure you have spelled the variable name correct.
    2) Make sure you are using the repository variables with appropriate data type columns.
    Regards,
    -Amith.

  • NEED HELP STRUCTURING A SUBSELECT - INVALIS IDENTIFIER ERROR

    This is my 1st post to this PL/SQL forum. I've used TSQL up to now; first job with PL/SQL and Oracle DB. I'm getting a "INVALID IDENTIFIER" error on the ORDER BY line (next to last line in code) in the following code. I haven't doen a lot of subselects and none with grouping. All I'm trying to do is get a count of states my customers are in... Any ideas what might be causing the problem, or a better way to structure this? (I tried the subselect in the SELECT statement as well with no luck there either)
    -- count and list All states by state zipcode resolution
    SELECT st.state, COUNT(*) AS count_by_state
    FROM ADM.USR u
    INNER JOIN
    SELECT
    CASE
    WHEN zipcode BETWEEN 99501 AND 99950 THEN 'AK' -- Alaska
    WHEN zipcode BETWEEN 35004 AND 36925 THEN 'AL' -- Alabama
    WHEN zipcode BETWEEN 71601 AND 72959 THEN 'AR' -- Arkansas
    WHEN zipcode BETWEEN 75502 AND 75502 THEN 'AR' -- Arkansas( Texarkana)
    WHEN zipcode BETWEEN 85001 AND 86556 THEN 'AZ' -- Arizona
    WHEN zipcode BETWEEN 82001 AND 83128 THEN 'WY' -- Wyoming
    ELSE NULL
    END AS state
    FROM CUST.USR_PRFL
    ORDER BY state) st ON u.usr_id = st.usr_id
    GROUP BY st.state;
    Edited by: 927929 on Apr 16, 2012 7:05 AM
    Edited by: 927929 on Apr 16, 2012 7:07 AM

    try
    SELECT st.state, COUNT(*) AS count_by_state
    FROM ADM.USR u
    INNER JOIN CUST.USR_PRFL up ON u.usr_id = up.usr_id
    INNER JOIN
    SELECT
    CASE
    WHEN zipcode BETWEEN 99501 AND 99950 THEN 'AK' -- Alaska
    WHEN zipcode BETWEEN 35004 AND 36925 THEN 'AL' -- Alabama
    WHEN zipcode BETWEEN 71601 AND 72959 THEN 'AR' -- Arkansas
    WHEN zipcode BETWEEN 75502 AND 75502 THEN 'AR' -- Arkansas( Texarkana)
    WHEN zipcode BETWEEN 85001 AND 86556 THEN 'AZ' -- Arizona
    WHEN zipcode BETWEEN 82001 AND 83128 THEN 'WY' -- Wyoming
    ELSE NULL
    END AS state
    FROM CUST.USR_PRFL
    --ORDER BY state
    ) st
    -- any relation beetwen? like "ON u.usr_id = up.usr_id" above
    GROUP BY st.state
    ORDER BY state;

  • Not-identified error when trying to make a connection in CS4

    Hello;
    When I try to make a Db connection to mysql in DW CS4,using connections,the +-button and fill in the pop up,I am getting the following message:
    "a not-identified error has occurred".
    The database name,password and all the other information is ok.So I really do not know what is happening.
    Is there someone there who has an answer for this problem??
    many thanks for the help!

    Igorbuitendijk wrote:
    The testing serverfolder is:http://www.checksite.eu:2222/public_htmlThe URL prefix is:http://www.checksite.eu:2222/public_html
    When I leave out the 2222,Dreamweaver can't make a connection to the server.
    I don't know about the use of port 2222, but your testing server definition is completely wrong.
    The testing server folder must be a physical path, not a URL. And the URL prefix must be a valid URL. public_html is the name of the web server's document root, it should never be part of a URL.
    Judging from the details you have given here, you are using your remote server for testing. In the Testing server section of the site definition, set Access to FTP. The value of Host directory should be what your hosting company tells you to use when logging in. For some hosting companies, you use public_html on its own. Other companies tell you to leave the value blank or to use just /.
    The URL prefix is just the URL for the site.

  • Invalid Identifier error in Discoverer Workbook

    Hi All,
    I have created a workbook in Discoverer desktop containing 2 worksheets(2 Reports)in it.
    After creating the first report I ran it and able to see the out put.
    Then created the 2nd report and successfully gave the output.
    After that if i switch to the first report(1st sheet) in the workbook it gives "ORA:09004 Invalid Identifier" Error and I am not able to run the report.
    Then i closed the workbook and tried reopening. But that time it gives the following error,
    "Unable to find the error text for this exception"
    "Attempt to open workbook failed"
    I have saved the workbook in the database.
    Can anyone tell me what is the cause for this error? What is the solution for this errors? Whether the workbook will be lost permanently?
    Thanks
    Alaka

    Hi,
    What is "m_Xml" ?
    Give us something we can use to reproduce the issue.
    The query you gave cannot be run.
    (btw, tags must be in lowercase)                                                                                                                                                                                                                                                                                                                           

  • Invalide identifier error, when use subselect

    Hi all,
    I got "ORA-0094: sp.spriden_pidm invalid identifier "error when runing the following query.
    select (select t.name from
    (select rownum row_number, s.spriden_last_name name
    from spriden s
    where s.spriden_pidm = sp.spriden_pidm) t
    where t.row_number = 1) last_name
    from spriden sp
    where sp.spriden_pidm = 70105;
    Any one has an idea why this is happening?
    Thanks

    Unless I am missing something here, this looks like a straight pivot query to me.
    SQL> with my_test AS (SELECT 1 id, 'June' contact_name FROM dual UNION ALL
      2                   SELECT 1, 'Email' FROM dual UNION ALL
      3                   SELECT 1, 'Mark' FROM dual UNION ALL
      4                   SELECT 2, 'Tom' FROM dual),
      5       my_test_2 AS (SELECT 1 id, trunc(sysdate) act_date FROM dual UNION ALL
      6                     SELECT 1, trunc(sysdate-1) FROM dual UNION ALL
      7                     SELECT 2, trunc(sysdate-1) FROM dual)
      8  SELECT id, act_date,
      9         MAX(DECODE(rn, 1, contact_name)) nc1,
    10         MAX(DECODE(rn, 2, contact_name)) nc2,
    11         MAX(DECODE(rn, 3, contact_name)) nc3
    12  FROM (SELECT m.id, contact_name, act_date,
    13               ROW_NUMBER() OVER (PARTITION BY m.id
    14                                  ORDER BY contact_name) rn
    15        FROM my_test m, my_test_2 m2
    16        WHERE m.id = m2.id and
    17              m2.act_date = trunc(sysdate-1))
    18  GROUP BY id, act_date;
            ID ACT_DATE    NC1   NC2   NC3
             1 11-Sep-2008 Email June  Mark
             2 11-Sep-2008 TomAssuming that you have a known maximum number of possible values in my_test for a given id this should work. You may need to use something other than the contact_name in the order by in the row_number function if you require the values in specific columns, but given your sample data, I have no idea what that might be.
    John

  • Why do I get a "DATE1 : ORA-00904 Invalid identifier" error ?

    Hi,
    Despite my efforts, I can't see why I get a "DATE1 : ORA-00904 Invalid identifier' error whith this request.
    {code}With S1 as (
    SELECT TRUNC(DATE1, 'MM'),
    ROUND(SUM(VALEUR), 2)
    FROM EVV_E036
    GROUP BY TRUNC(DATE1, 'MM')
    ORDER BY TRUNC(DATE1, 'MM'))
    SELECT n,
    NVL(ROUND(SUM(Valeur),2), 0)
    FROM (select add_months(to_date('01/01/2006', 'dd/mm/yyyy'), level - 1) n FROM dual connect by level <= 12) months
    LEFT JOIN S1
    ON months.n = TRUNC(DATE1, 'MM')
    GROUP BY n
    ORDER BY n{code}
    The line in error is this one : {code}ON months.n = TRUNC(DATE1, 'MM'){code}
    Any idea much appreciated !
    Regards,
    Christian

    hi,
    I have done this and get no more errors. Now I see that the values I get are equal to 0. Or, I do get values different from 0 in my table ! I can't see why the left join gives 0. I have to dig this and come back tomorrow.
    With S1 as (
    SELECT TRUNC(DATE1, 'MM') Date1,
           ROUND(SUM(VALEUR), 2) Debit
    FROM   EVV_E036
    WHERE  CLEF_VAR = (SELECT CLEF_VAR FROM SITE_ECHELLE WHERE SITE = 'E036')
    AND    DATE1 BETWEEN TO_DATE ('01/01/2007000000', 'DD/MM/YYYYHH24MISS') AND TO_DATE ('31/12/2007235959', 'DD/MM/YYYYHH24MISS')
    GROUP  BY TRUNC(DATE1, 'MM')
    ORDER  BY TRUNC(DATE1, 'MM'))
    SELECT n,
           NVL(ROUND(SUM(Debit),2), 0)
    FROM   (select add_months(to_date('01/01/2006', 'dd/mm/yyyy'), level - 1) n FROM dual connect by level <= 12) months
    LEFT JOIN S1
         ON months.n = date1
    GROUP BY n
    ORDER BY n

  • Invalid identified error in procedure

    hi
    I have a package that has a declare variable ,vfilename. I set the value of the variable vfilename to a file name for eg 'abc.txt' when the package scenario is callled. Now this file is the source for an interface that loads from this file to a target table. The interface has source datastore resource defined as a variable.
    After running this interface a procedure is called that will update a metadata table where the record has file_name col value=vfilename.
    to do this in the ODI procedure I am calling a plsql procedure as below
    Begin
    update_load_status(#vfilename)
    end;
    When this procedure runs I get an error as below
    904 : 42000 : java.sql.SQLException: ORA-00904: "abc"."TXT": invalid identifier
    If I call the procedure by hard coding the value i.e update_load_status('abc.txt'). It works fine.
    I have tried concat etc but still the value is not getting passed correctly and I am getting the invalid identified error. Is there a way to get around this?

    If you are saying this code -update_load_status('abc.txt'). work
    then call the variable this way
    Begin
    update_load_status('#vfilename');
    end;

  • IKM MTI , invalid identifier error

    Hi,
    I am using employees table as my source and inserting data into employees_1,employees_2 and employees_3 target tables using IKM Multi Table insert.
    I get an invalid identifier error on insert new rows step of the last interface:-
    ODI-1228: Task INT_EMP3 (Integration) fails on the target ORACLE connection TARGET.
    Caused By: java.sql.SQLSyntaxErrorException: ORA-00904: "C11_DEPARTMENT_ID": invalid identifier
    Usually this error occurs when there is a type mismatch. I have checked the data type but there is no mismatch.
    The code generated is :-
    insert all
    when 1=1 then
    into TARGET.EMPLOYEES_1
    (EMPLOYEE_ID, FIRST_NAME, LAST_NAME, EMAIL, PHONE_NUMBER, HIRE_DATE, JOB_ID, SALARY, COMMISSION_PCT, MANAGER_ID, DEPARTMENT_ID)
    values
    (C1_EMPLOYEE_ID, C2_FIRST_NAME, C3_LAST_NAME, C4_EMAIL, C5_PHONE_NUMBER, C6_HIRE_DATE, C7_JOB_ID, C8_SALARY, C9_COMMISSION_PCT, C10_MANAGER_ID, C11_DEPARTMENT_ID)
    when 1=1 then
    into TARGET.EMPLOYEES_2
    (EMPLOYEE_ID, FIRST_NAME, LAST_NAME, EMAIL, PHONE_NUMBER, HIRE_DATE, JOB_ID, SALARY, COMMISSION_PCT, MANAGER_ID, DEPARTMENT_ID)
    values
    (C1_EMPLOYEE_ID, C2_FIRST_NAME, C3_LAST_NAME, C4_EMAIL, C5_PHONE_NUMBER, C6_HIRE_DATE, C7_JOB_ID, C8_SALARY, C9_COMMISSION_PCT, C10_MANAGER_ID, C11_DEPARTMENT_ID)
    when 1=1 then
    into TARGET.EMPLOYEES_3
    (EMPLOYEE_ID, FIRST_NAME, LAST_NAME, EMAIL, PHONE_NUMBER, HIRE_DATE, JOB_ID, SALARY, COMMISSION_PCT, MANAGER_ID, DEPARTMENT_ID)
    values
    (C1_EMPLOYEE_ID, C2_FIRST_NAME, C3_LAST_NAME, C4_EMAIL, C5_PHONE_NUMBER, C6_HIRE_DATE, C7_JOB_ID, C8_SALARY, C9_COMMISSION_PCT, C10_MANAGER_ID, C11_DEPARTMENT_ID)
    select     
         C1_EMPLOYEE_ID EMPLOYEE_ID,
         C2_FIRST_NAME FIRST_NAME,
         C3_LAST_NAME LAST_NAME,
         C4_EMAIL EMAIL,
         C5_PHONE_NUMBER PHONE_NUMBER,
         C6_HIRE_DATE HIRE_DATE,
         C7_JOB_ID JOB_ID,
         C8_SALARY SALARY,
         C9_COMMISSION_PCT COMMISSION_PCT,
         C10_MANAGER_ID MANAGER_ID,
         C11_DEPARTMENT_ID DEPARTMENT_ID
    from     ODI_WORK_PRERNA.C$_0EMPLOYEES_1
    where     (1=1)
    When i run this code at the back end after removing the column alias from the select statement, the query works fine. Otherwise it throws the same error at the backend as well.
    Please let me know how to resolve this issue.
    Thanks,
    Prerna
    P.S. For now i modified the km to generate a query without column alias and the interface is working fine. But i want to know why am i getting this error with the column alias.

    If you see the insert statement the values you are defining are C1_column_name:
    into TARGET.EMPLOYEES_1
    (EMPLOYEE_ID, FIRST_NAME, LAST_NAME, EMAIL, PHONE_NUMBER, HIRE_DATE, JOB_ID, SALARY, COMMISSION_PCT, MANAGER_ID, DEPARTMENT_ID)
    values
    *(C1_EMPLOYEE_ID, C2_FIRST_NAME, C3_LAST_NAME, C4_EMAIL, C5_PHONE_NUMBER, C6_HIRE_DATE, C7_JOB_ID, C8_SALARY, C9_COMMISSION_PCT, C10_MANAGER_ID, C11_DEPARTMENT_ID)*
    But when you are selecting data the alias names are different :
    select     
    C1_EMPLOYEE_ID EMPLOYEE_ID,
    C2_FIRST_NAME FIRST_NAME,
    C3_LAST_NAME LAST_NAME,
    C4_EMAIL EMAIL,
    C5_PHONE_NUMBER PHONE_NUMBER,
    C6_HIRE_DATE HIRE_DATE,
    C7_JOB_ID JOB_ID,
    C8_SALARY SALARY,
    C9_COMMISSION_PCT COMMISSION_PCT,
    C10_MANAGER_ID MANAGER_ID,
    C11_DEPARTMENT_ID DEPARTMENT_ID
    from     ODI_WORK_PRERNA.C$_0EMPLOYEES_1
    where     (1=1)
    It is a SQL problem. There is another example you can check i.e.
    Select Employee_id from ( select employee_id c1_employee_id from employees);
    When Employee_ID comes to the outer query its name is changed to c1_employee_id , so this sql will give you same error as invalid identifier.
    Change the IKM again and provide same names or even remove the alias.
    Hope it helps

  • Error In ccBPM : Correlation Error

    Hi All,
    We are working on a scenario where in the first received structure in ccBPM waits second structure using correlation.
    And further we need to merge both of them together using transformation (Message Mapping) inside ccBPM . Interestingly in our case both the messages are choosen from earlier stages of the ccBPM  for merging  . Now we are facing correlation error saying "correlation is to be activated in the proceeding step" which we have already done . So the ccBPM is still under error .
    Please help us on the same .
    Here is the approximate representation of ccBPM  steps :-
    1.) Start--->Receive>  Other BPM steps > <1st message to be merged>-><2nd message to be merged>----->Transformation for merging -
    > end
    The 1st message and the 2nd meesage is what we are merging inside ccBPM .The messagesare from the previous steps of the ccBPM. We are not able to correlate the messages.
    Regards
    Nishant

    u have multiple files, then every file will initiate a BPM instance.
    And in turn every BPM instance is waiting for a message ,messages coming  are not able to go for exact BPM instance..
    FYI , no correlation on the messages.... (i guess)
    @but you need to give clear picture of whats happening with all the steps and business requirement before anybody can comment on this.
    1) is this issue at co relating the return message or in merging the co related message....

  • Report parameters being passed in URL - invalid identifier error

    Hi
    Id anyone aware of any format in which we should be passing values in the url to the report deployed on the server?
    A parameter that takes in the format 'e123','e234' - example for emp_id parameter.
    If we pass in this form, even a single value as 'e123' in the url to run the report -
    The value e123 is taken in single quotes and it displays the error
    REP-300: "e123": invalid identifier
    That is, it displays the error as if the string was entered in double quotes.

    Hi, Aaron.
    I tried what you said, and my code wouldn't parse correctly. Let me show you the whole module of PL/SQL that I'm dealing with here. I did not write this. This is something I'm maintaining and updating. The part that chokes is near the bottom.
    declare
    l_sql varchar2(4000) := 'select user_name,total from (select user_name,count(*) total from eba_ver2_cust_activity ' ;
    begin
    if :P23_START_DATE is not null and :P23_END_DATE is not null then
    l_sql := l_sql || ' where ACTIVITY_DATE between ''' || to_char(to_date(:P23_START_DATE,'dd-mon-yyyy'),'dd-mon-yyyy')
    || ''' and ' || '''' || to_char(to_date(:P23_END_DATE,'dd-mon-yyyy') ,'dd-mon-yyyy') || '''' ;
    elsif :P23_START_DATE is not null then
    l_sql := l_sql || ' where ACTIVITY_DATE >= ''' || to_char(to_date(:P23_START_DATE,'dd-mon-yyyy'),'dd-mon-yyyy') ||
    elsif :P23_END_DATE is not null then
    l_sql := l_sql || ' where ACTIVITY_DATE <= ''' || to_char(to_date(:P23_END_DATE,'dd-mon-yyyy'),'dd-mon-yyyy') || ''''
    end if;
    if :P23_ACTIVITY_TYPE != '%null%' and :P23_ACTIVITY_TYPE is not null then
    if :P23_START_DATE is not null or :P23_END_DATE is not null then
    l_sql := l_sql || ' and activity_type_id = ' || :P23_ACTIVITY_TYPE ;
    else
    l_sql := l_sql || ' where activity_type_id = ' || :P23_ACTIVITY_TYPE ;
    end if;
    end if;
    l_sql := l_sql || ' group by user_name )' ;
    return l_sql ;
    end ;
    I appreciate all the help. As for the job market for Apex programmers around here, I wouldn't know. I was a COBOL programmer for many years. I'm approaching retirement, and this will probably be my last IT job.
    Steve "the n00b" in Raleigh NC

  • Multi-row sub query returns  ORA-00904 :invalid identifier error

    I am creating a report from two tables that I am not joining. I want a single line for every row in table1 that meets a date range. Table2 can contain none or many rows for each recored in table1. I want to get up to two fields from table2.
    I was using a case statement to check if there was data and then an in-line query or subquery. Once again, the idea is to have a single line on the report for each table1 record.
    I get this error with the code below. It seems the nested multi-row subquery can not see the a.cr_mas_cr_no identifier.
    ORA-00904: "a"."cr_mas_cr_no": invalid identifier
    Any help is greatly appreciated,
    Sam
    select
    a.cr_mas_cr_no "CRNO", a.cr_mas_type "TYPE", a.cr_mas_status "CR Status",
    a.cr_mas_date_logged "Logged date", a.CR_REL_REQ_APP_DATE "RTP approved",a.CR_REL_REQ_RTP_DATE "RTP Date",
    a.cr_accepted_date "Complete", a.cr_mas_submitted_by "Requester",
    select doc_user FROM crrm_cr_documents WHERE doc_cr_number =a.cr_mas_cr_no and rownum = 1 and DOC_TYPE = 'BD' ) "Bus Design",
    (select doc_user FROM crrm_cr_documents WHERE doc_cr_number = a.cr_mas_cr_no and rownum = 1 and DOC_TYPE = 'TD' ) "Tech Design",
    (select doc_user FROM crrm_cr_documents WHERE doc_cr_number = a.cr_mas_cr_no and rownum = 1 and DOC_TYPE = 'TE' ) "User acceptance test",
    case
    when (select count(appr_user) from crrm_cr_approvals where appr_cr_no = a.cr_mas_cr_no and appr_type = 'RTP') > 0
    then (select appr_user from (select * from crrm_cr_approvals where appr_cr_no = a.cr_mas_cr_no and appr_type = 'RTP') where rownum = 1)
    end
    "RTP #1",
    case
    when (select count(appr_user) from crrm_cr_approvals where appr_cr_no = a.cr_mas_cr_no and appr_type = 'RTP') > 1
    then (select appr_user from (select * from crrm_cr_approvals where appr_cr_no = a.cr_mas_cr_no and appr_type = 'RTP') where rownum = 2)
    end
    "RTP #2",
    a.CR_REL_REQ_RTP_BY "Released by",
    a.CR_ACCEPTED_BY "Post RTP User Acceptance",
    a.cr_mas_title "Title", a.cr_mas_id "ID"
    from
    crrm_crmaster a
    where
    (a.CR_REL_REQ_RTP_DATE >= :P1109_BEGDATE and (a.CR_REL_REQ_RTP_DATE <= :P1109_ENDDATE) and
    (a.cr_mas_status = 'Complete' or (a.cr_mas_status = 'Release Approved'and a.CR_REL_REQ_APP_DATE < :P1109_ENDDATE))
    Message was edited by:
    slavanaway

    Iceman,
    Thanks for the reply I will try your suggestion.
    I will try and explain why I think two subqueries (an in-line query with a subquery?) are required. I will use the creation of the column RTP #1 as the example as the RTP #2 column is only different in the rownum selected.
    Looking only at the lines that fail, here is my analysis. (If I rem out the two case lines the query runs, I just don't get two columns of data I need.) I will only examine the first case as the second is changed to extract the second approval via the rownum = 2 criteria. The first statement checks there is at least one RTP approval stored for the request and then gets the user who approved the request if the test is true.
    case when
    (select count(appr_user) from crrm_cr_approvals where appr_cr_no =a.cr_mas_cr_no and appr_type = 'RTP') > 0
    then
    The above part works fine and the correct count of approvals is returned.
    (select appr_user from (select * from crrm_cr_approvals where appr_cr_no=a.cr_mas_cr_no and appr_type = 'RTP') where rownum = 1)
    end
    "RTP #1",
    I moved the parenthesis to the correct location. There can be multiple approvals for a given parent record. Some parent records need one, some need two approvals. If I replace
    (select appr_user from (select * from crrm_cr_approvals where appr_cr_no =a.cr_mas_cr_no and appr_type = 'RTP') where rownum = 1)
    with
    (select appr_user from approvals where appr_cr_no =a.cr_mas_cr_no and appr_type = 'RTP' and rownum = 1)
    The correct result is returned because it returns exactly one row as rownum=1 limits the query. When rownum = 2 then the query returns null as the rownum never gets to two as the rownum column is built via the set created by the second subquery.
    The subquery builds a set of approvals for a specific "cr_no" and appr_type of "RTP". the outer query then looks at the rownum of the second query
    Here is where I got the rownum information from;
    http://www.oracle.com/technology/oramag/oracle/06-sep/o56asktom.html
    So here is what I think is happening;
    1. Main query From and Where are processed. This should provide the "set" for the query
    2.The from subqueries for RTP #1 and RTP #2 should be able to access the a.cr_mas_cr_no field and build a set from the approvals table.
    3.The RTP #1/2 subquery (inline maybe a better description?) would then get the correct row from the from subquery.
    The error "invalid identifier" refers to the a.cr_mas_cr_no field. I assume it means it can not resolve the table alias inside the subquery.
    So maybe your grouping would help, I will try.
    Sam

Maybe you are looking for

  • Trouble deleting photos

    I can no longer delete photos or drag them into the trash unless I am in edit function. Also, when I select a photo to edit, iPhoto jumps to the first picture in my library and opens that one for editing. Then I have to scroll back to the picture I w

  • Error on profile access

    In my own personal folder, I get the following "Message from webpage" error when I click the Profile link; "Could not get the profile statistics for You do not have rights to access the folder,48..". Others report the same issue, with the folder numb

  • Applications no long minimize when double clicking top bar in snow leopard

    Applications no long minimize when double clicking top bar in snow leopard. Got to be a snow leopard thingy because I just switched. whats the new deal now. Snow leopard has already screwedup just about all my 3rd party apps. they just cant keep up.

  • How do I teach Mavericks' Dictation new words? Is this even possible?

    I've been fiddling with the dictation feature in Mavericks and am having a blast with it. I never felt that the cost of Dragon Naturally Speaking was worth it for me as I'm a fast typist. However, the fact that dictation is now available at no cost w

  • HT1937 updated iphone gone wrong please help

    i updated my iphone4 and all its doing now is going to start up with the apple logo then turning off again can any one help????