ORA-22922: nonexistent LOB value in outer join in XMLDB parsing query

Hi,
We are in a situation where i must use outer join with the address type fragment in the XML reader query,
Here is the oracle installation details
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
"CORE     11.2.0.3.0     Production"
However once i add the (+) sign i get an error, other wise it runs absolutely fine without the (+) s
ORA-29400: data cartridge error
ORA-22922: nonexistent LOB value
29400. 00000 - "data cartridge error\n%s"
*Cause:    An error has occurred in a data cartridge external procedure.
This message will be followed by a second message giving
more details about the data cartridge error.
*Action:   See the data cartridge documentation
for an explanation of the second error message.
Query:
=======
select
from PWAYWORKFILE_TABLE,
xmltable(
xmlnamespaces(DEFAULT 'http://www.cccis.com/Pathways/Workfile'
, 'http://www.cccis.com/Pathways/CommonType' as "pct")
, '$XS/PwayWorkfile' passing WORKFILE as "XS"
columns
CURESTID VARCHAR2 (4000) PATH 'EstimateComp/LastOutboxEstID',
Est_Fragment XMLTYPE PATH 'EstimateComp/EstList/VehEstimate'
) m,
XMLTABLE(
xmlnamespaces(DEFAULT 'http://www.cccis.com/Pathways/Workfile'
, 'http://www.cccis.com/Pathways/CommonType' as "pct")
, '$PY/VehEstimate' passing m.Est_Fragment as "PY"
columns
NUMBERLINES VARCHAR2 (4000) PATH '@NumberLines',
LINEESTIMATEID VARCHAR2 (4000) PATH 'EstimateID',
EstLine_Fragment XMLTYPE PATH 'EstimateLines/EstimateLine'
) (+) l,
XMLTABLE(
xmlnamespaces(DEFAULT 'http://www.cccis.com/Pathways/Workfile'
, 'http://www.cccis.com/Pathways/CommonType' as "pct")
, '$NY/EstimateLine' passing l.EstLine_Fragment as "NY"
columns
LINENUMBER VARCHAR2 (4000) PATH '@LineNumber',
LINEBLOCKID VARCHAR2 (4000) PATH 'LineBlockID',
LABORCATEGORY VARCHAR2 (4000) PATH 'LaborCategory',
LABORHOURS VARCHAR2 (4000) PATH 'LaborHours',
LINEOPERATION VARCHAR2 (4000) PATH 'LineOperation',
MANUALLABORINCLUDE VARCHAR2 (4000) PATH 'ManualLaborInclude',
MANUALPAINTINCLUDE VARCHAR2 (4000) PATH 'ManualPaintInclude',
MANUALPRICEINCLUDE VARCHAR2 (4000) PATH 'ManualPriceInclude',
OEMPRICE VARCHAR2 (4000) PATH 'Calculation/OEMPrice',
SINGLEOHINCL VARCHAR2 (4000) PATH 'DataList/DBMotorData/LaborInclType/@SINGLEOHINCL',
DOUBLEOHINCL VARCHAR2 (4000) PATH 'DataList/DBMotorData/LaborInclType/@DOUBLEOHINCL',
PPAGEINCL VARCHAR2 (4000) PATH 'DataList/DBMotorData/LaborInclType/@PPAGEINCL',
SUPPLIERID VARCHAR2 (4000) PATH 'DataList/RPSPart/SupplierID'
) (+) j
where
l.LINEESTIMATEID = 51 or
l.LINEESTIMATEID = m.CURESTID or
l.LINEESTIMATEID = (CASE
WHEN m.CURESTID = 101 THEN 51
WHEN m.CURESTID > 101 THEN m.CURESTID -1
ELSE -1 END);
Please note that the PWAYWORKFILE_TABLE is objection relationally stored with XMLs.
Please suggest what kind of error i am getting and what possible steps might resolve the same, let me know if i missed any details which might shade more light on the same.
Regards,
Arghyadip

Which outer join gives you the error? I don't see any address information in the SQL, hence my question. The first outer join, on table alias L is not needed. The WHERE clause you have setup requires that L.LINEESTIMATEID has a value and so NULL will not evaluate to TRUE and the row will be filtered out. This means you will only be returning rows where there exists rows in the L table, hence the outer join is not needed.
Are all your columns really VARCHAR2(4000)? You say it is object-relational, but was something defined as a CLOB?
You did not provide much in order to duplicate your error so I am just guessing at causes to identify the error.
Also see #9 in
{message:id=9360002}

Similar Messages

  • ORA-22922: nonexistent LOB value  during import

    During the import of a dump file of a database with a table holding
    several CLOB column I get the error message 'ORA-22922: nonexistent LOB value'
    the import is partially rolled back and fails in the end.
    How can I get around this problem? Is there any way to check the locators in the
    original database table if there is any LOB value missing?

    Which version of RDBMS you are using. The following link talks about the issue being fixed in 8.1.7
    http://asktom.oracle.com/pls/ask/f?p=4950:8:11560397072454048249::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:715689791379

  • ORA-22922: nonexistent LOB value

    hi, we are working With orascle stream in 11.2.0.4 database version.
    and we use  DML  HANDLER for a table that contain CLOB, in handler procedure, we store or save LCR into  our table MTAB1, that contain a column with anydata type.
    then we send this LCR to a procedure to get data and we have the error when try:
             v_anydata := pi_lcr.GET_VALUE('new','RESOLUTION_TEXT');
                         rc := v_anydata.GETCLOB(po_clob_resolution);
    if we comment this seccion of the procedure all its ok.
    and if we call procedure to get data directly in handler, its ok..
    1.  STAGE A -- ERROR
    source                                                      TARGET                                                                           send LCR to procedure
    CAPTURE LCR ---> PROPAGATE---->  APPLY -->DML HANDLER--->Save LCR into a TABLE X ----->CALL_GET_DATA  
    STAGE B -- OK
    source                                                      TARGET                            send LCR to procedure
    CAPTURE LCR ---> PROPAGATE---->  APPLY -->DML HANDLER--->CALL_GET_DATA  
    please your help to solve the issue
    regards:

    THis question would be better placed in the general database forum, this forum is used for multimedia support in the database, adn we do use lobs, but are not recovery experts.

  • Process Flow Error: nonexistent LOB value

    Hi,
    I would like to send an email of all mapping statuses of the day. I created function to retrieve all messages from OWB$WB_RT_AUDIT_MESSAGE_LINES. Sometimes it works and another time it fails. After a little investigation I got the cause of this failure: length of the message exceed the limitation of VARCHAR2 (4000 bytes).
    Then I created another function for testing as follows:
    CREATE OR REPLACE FUNCTION FTEST_VAR RETURN CLOB IS
    tmpVar CLOB;
    BEGIN
    tmpVar := 'test';
    RETURN tmpVar;
    END FTEST_VAR;
    From SQLPlus I was able to query this function:
    SQL>select ftest_var tst from dual;
    TST
    test
    Then I created a process flow like this:
    START1->FTEST_VAR->EMAIL->END_SUCCESS
    In the process flow I created a variable EMAILBODY to bind to the output of FTEST_VAR and then bind EMAILBODY to the MESSAGE_BODY of the EMAIL.
    I deployed and run the process flow. It failed with this error message:
    ORA-22922: nonexistent LOB value
    ORA-06512: at line 1                                        
    Could anybody please shed a light on this?
    TIA
    Prat

    I am trying to setup pretty much the same type of flow to email job messages using a CLOB.  Were you able to find a solution?
    Thanks!

  • ORA-01417: a table may be outer joined to at most one other table

    Hi All,
    I want to display the data even if there is no corresposding data in the fac_pos table.
    when using outer joins getting error message.
    Any work around for this ? Please suggest. :-)
    SQL> SELECT case when flen.FPID is not null then
      2        'do the calculations here'
      3        else
      4        'no value in the FAC_POS table so do the ELSE PART'
      5       end CASE ,
      6       mtf.EXT_FID
      7          FROM
      8       D_F_MAP  MTF,
      9             FAC   EFAC,
    10             TRADING       EST,
    11             FAC_POS         FLEN,
    12             USERS_MAP custmap
    13       WHERE mtf.SRC_FID  = efac.FID (+)
    14         AND mtf.SRC_DID  = efac.DID  (+)
    15         AND efac.TFID = est.TFID 
    16         AND mtf.EXT_FID (+) = flen.FID              
    17         AND mtf.EXT_DID (+)  = flen.DID 
    18      AND custmap.SRC_CUST_ID   =  est.SID  (+)     
    19         AND custmap.EXT_CUST_ID  =  flen.CUSTID (+)
    20      and est.TFID =14;
    no rows selected
    SQL> SELECT case when flen.FPID is not null then
      2        'do the calculations here'
      3        else
      4          'no value in the FAC_POS table so do the ELSE PART'
      5       end CASE ,
      6       flen.CUSTID FROM TRADING EST, USERS_MAP,FAC_POS FLEN,FAC EFAC, D_F_MAP  MTF
      7  WHERE
      8   EST.SID = USERS_MAP.SRC_CUST_ID        (+) AND
      9   USERS_MAP.EXT_CUST_ID   =  flen.CUSTID (+) AND
    10   MTF.SRC_DID (+) = EFAC.DID         AND
    11   MTF.SRC_FID (+) = EFAC.FID        AND
    12   efac.TFID = est.TFID         AND
    13   mtf.EXT_FID (+) = flen.FID                 AND         
    14   mtf.EXT_DID (+)  = flen.DID     AND
    15   est.TFID =14
    16  /
    MTF.SRC_FID (+) = EFAC.FID        AND
    ERROR at line 11:
    ORA-01417: a table may be outer joined to at most one other table
    create table D_F_MAP
      SOURCE  VARCHAR2(10) not null,
      SRC_DID VARCHAR2(8) not null,
      SRC_FID VARCHAR2(10) not null,
      EXT_DID VARCHAR2(20),
      EXT_FID VARCHAR2(20)
    create table FAC
      TFID  NUMBER,
      SRC   VARCHAR2(10),
      DID   NUMBER,
      FID   NUMBER,
      CSAMT NUMBER
    create table FAC_POS
      FPID   NUMBER,
      CUSTID NUMBER,
      SRC    VARCHAR2(10),
      DID    NUMBER,
      FID    NUMBER,
      SPOS   NUMBER
    create table PASS_OVER
      TFID VARCHAR2(20) not null,
      FLG  VARCHAR2(1)
    create table TRADING
      TFID  NUMBER not null,
      SRC   VARCHAR2(10),
      TDATE DATE,
      BID   NUMBER,
      SID   NUMBER
    create table USERS_MAP
      SRC_CUST_ID VARCHAR2(8) not null,
      EXT_CUST_ID VARCHAR2(20),
      SRC         VARCHAR2(10) not null
    insert into D_F_MAP (SOURCE, SRC_DID, SRC_FID, EXT_DID, EXT_FID)
    values ('KP', '854', '7754', '101', '1202');
    insert into D_F_MAP (SOURCE, SRC_DID, SRC_FID, EXT_DID, EXT_FID)
    values ('KP', '4545', '4444', '504', '1604');
    insert into D_F_MAP (SOURCE, SRC_DID, SRC_FID, EXT_DID, EXT_FID)
    values ('KP', '7858', '9646', '604', '1705');
    insert into D_F_MAP (SOURCE, SRC_DID, SRC_FID, EXT_DID, EXT_FID)
    values ('MS', '8799', '4544', '987', '1654');
    insert into FAC (TFID, SRC, DID, FID, CSAMT)
    values (10, 'KP', 854, 7754, 85000);
    insert into FAC (TFID, SRC, DID, FID, CSAMT)
    values (11, 'KP', 854, 7754, 44000);
    insert into FAC (TFID, SRC, DID, FID, CSAMT)
    values (12, 'KP', 4545, 4444, 47000);
    insert into FAC (TFID, SRC, DID, FID, CSAMT)
    values (13, 'KP', 7858, 9646, 80000);
    insert into FAC (TFID, SRC, DID, FID, CSAMT)
    values (14, 'MS', 8799, 4544, 60000);
    insert into FAC (TFID, SRC, DID, FID, CSAMT)
    values (15, 'KP', 854, 7754, 66000);
    insert into FAC_POS (FPID, CUSTID, SRC, DID, FID, SPOS)
    values (94, 5555, 'EXT', 504, 1604, 6000);
    insert into FAC_POS (FPID, CUSTID, SRC, DID, FID, SPOS)
    values (90, 1111, 'EXT', 101, 1202, 1000);
    insert into FAC_POS (FPID, CUSTID, SRC, DID, FID, SPOS)
    values (91, 2222, 'EXT', 302, 3652, 1000);
    insert into FAC_POS (FPID, CUSTID, SRC, DID, FID, SPOS)
    values (92, 3333, 'EXT', 987, 1654, 6000);
    insert into FAC_POS (FPID, CUSTID, SRC, DID, FID, SPOS)
    values (93, 4444, 'EXT', 604, 1705, 9000);
    insert into TRADING (TFID, SRC, TDATE, BID, SID)
    values (10, 'KP', to_date('10-02-2009', 'dd-mm-yyyy'), 1548, 96751);
    insert into TRADING (TFID, SRC, TDATE, BID, SID)
    values (11, 'KP', to_date('02-02-2009', 'dd-mm-yyyy'), 5468, 7895);
    insert into TRADING (TFID, SRC, TDATE, BID, SID)
    values (12, 'KP', to_date('20-02-2009', 'dd-mm-yyyy'), 1258, 6985);
    insert into TRADING (TFID, SRC, TDATE, BID, SID)
    values (13, 'KP', to_date('22-02-2009', 'dd-mm-yyyy'), 5468, 7865);
    insert into TRADING (TFID, SRC, TDATE, BID, SID)
    values (14, 'MS', to_date('18-02-2009', 'dd-mm-yyyy'), 4669, 6893);
    insert into TRADING (TFID, SRC, TDATE, BID, SID)
    values (15, 'KP', to_date('20-02-2009', 'dd-mm-yyyy'), 1548, 6975);
    insert into USERS_MAP (SRC_CUST_ID, EXT_CUST_ID, SRC)
    values ('9675', '1111', 'kp');
    insert into USERS_MAP (SRC_CUST_ID, EXT_CUST_ID, SRC)
    values ('5468', '2222', 'kp');
    insert into USERS_MAP (SRC_CUST_ID, EXT_CUST_ID, SRC)
    values ('6893', '3333', 'kp');
    insert into USERS_MAP (SRC_CUST_ID, EXT_CUST_ID, SRC)
    values ('5468', '4444', 'kp');
    insert into USERS_MAP (SRC_CUST_ID, EXT_CUST_ID, SRC)
    values ('7865', '5555', 'kp');
    insert into USERS_MAP (SRC_CUST_ID, EXT_CUST_ID, SRC)
    values ('6975', '6666', 'kp');
    insert into USERS_MAP (SRC_CUST_ID, EXT_CUST_ID, SRC)
    values ('6975', '7777', 'kp');
    insert into USERS_MAP (SRC_CUST_ID, EXT_CUST_ID, SRC)
    values ('6985', '8888', 'kp');Thanks.

    Hi,
    Thanks for posting the sample data in such a useful form! I'm sorry, I'm not at a database now, so I can't run it.
    What are the correct results you want from that data?
    You can outer-join to more than one table using ANSI notation.
    Another solution is to do some of the joins in a sub-query. It looks like the problem is with the est table. If you join all the tables except est in a sub-query, then you can join est to that result set in the main query.
    If you "want to display the data even if there is no corresponding data in the fac_pos table.", and fac_pos is being called flen, then you have the + signs in the wrong places.
    16         AND mtf.EXT_FID (+) = flen.FID              
    17         AND mtf.EXT_DID (+)  = flen.DID  means "display data from flen even if there is no match in mtf".

  • OUTER JOIN -- Error: ORA-01417  (a table may be outer joined to at most one

    Hi there,
    I have a rather simple task: retrieve all the records in a table, for agiven domain p_domain_id (input parameter). The problem is that there are about 6 FKs in the table, and I need the names (strings) corresponding to those FKs (from other tables). Unfortunately, some of the FKs are NULL, so in '=' I loose records. Without the last 2 lines in WHERE clause, I get the correct result. With d2 in place (and without the "(+)" ) I loose 2 records. With the d3 (and also without "(+)"), I do not get any record.
    With the "(+)", the code compiles but I get the run time error ORA-01417
    NOTE: I put the "+" within parentheses, in order to show it like a text in this editor.
    What's an elegant solution to this?
    Thanks a lot.
    Here's the code:
    SELECT
    a.DOMAIN,
    b.NAME,
    a.DE_ID,
    a.NAME,
    a.PREFERRED_LABEL,
    a.TECHNICAL_DEFINITION,
    a.PUBLIC_DEFINITION,
    a.DE_TYPE,
    c1.NAME,
    a.HAS_PARAMETER,
    a.VALUE_CLASS,
    c2.NAME,
    a.INDEX_TERMS,
    a.DATA_TABLE_ID,
    d1.TABLE_NAME,
    a.SP_INSERT,
    a.SP_UPDATE,
    a.SP_GET_BYMRN,
    a.SP_GET_BYATTRIBUTE,
    a.VALUE_TABLE_ID,
    d2.TABLE_NAME,
    a.PARAM_TABLE_ID,
    d3.TABLE_NAME,
    a.PARAM_DOMAIN_LOGIC,
    a.SP_LOV,
    a.LOWER_LIMIT,
    a.UPPER_LIMIT,
    a.BOOLEAN_Y,
    a.BOOLEAN_N,
    a.COMMENTS,
    a.ENTERED_BY,
    commons_API.get_person_full_name(a.ENTERED_BY),
    a.ENTERED_ON
    FROM
    DATA_ELEMENT_INDEX a,
    DE_DOMAIN b,
    GENERAL_LIST c1,
    GENERAL_LIST c2,
    TABLE_GROUP d1,
    TABLE_GROUP d2,
    TABLE_GROUP d3
    WHERE
    DOMAIN = p_domain_id AND
    b.DOMAIN_ID = a.DOMAIN AND
    c1.ID = a.DE_TYPE AND
    c2.ID = a.VALUE_CLASS AND
    d1.TABLE_ID = a.DATA_TABLE_ID AND -- it works well without the next two lines
    d2.TABLE_ID = a.VALUE_TABLE_ID "(+)" AND
    d3.TABLE_ID = a.PARAM_TABLE_ID "(+)"
    ORDER BY a.NAME;
    Edited by: user10817976 on Oct 19, 2009 8:14 AM

    One of my standard replies...
    Oracle syntax does not support outer joining to more than one table.
    However ANSI syntax does...
    SQL> select * from a;
            ID      B_KEY      C_KEY
             1          2          3
             2          1          4
             3          3          1
             4          4          2
    SQL> select * from b;
            ID     C_KEY2
             1          1
             2          5
             3          3
             4          2
    SQL> select * from c;
          KEY1       KEY2 DTA
             1          1 1-1
             1          2 1-2
             1          3 1-3
             1          4 1-4
             2          1 2-1
             2          2 2-2
             2          3 2-3
             2          4 2-4
             3          1 3-1
             3          2 3-2
             3          3 3-3
             3          4 3-4
             4          1 4-1
             4          2 4-2
             4          3 4-3
             4          4 4-4
    16 rows selected.
    SQL> ed
    Wrote file afiedt.buf
      1  select a.id as a_id, b.id as b_id, c.key1 as c_key1, c.key2 as c_key3, c.dta
      2  from a, b, c
      3  where a.b_key = b.id
      4  and   a.c_key = c.key1 (+)
      5* and   b.c_key2 = c.key2 (+)
    SQL> /
    and   a.c_key = c.key1 (+)
    ERROR at line 4:
    ORA-01417: a table may be outer joined to at most one other table
    SQL> ed
    Wrote file afiedt.buf
      1  select a.id as a_id, b.id as b_id, c.key1 as c_key1, c.key2 as c_key3, c.dta
      2  from a JOIN b ON (a.b_key = b.id)
      3*        LEFT OUTER JOIN c ON (a.c_key = c.key1 and b.c_key2 = c.key2)
    SQL> /
          A_ID       B_ID     C_KEY1     C_KEY3 DTA
             3          3          1          3 1-3
             4          4          2          2 2-2
             2          1          4          1 4-1
             1          2
    SQL>

  • Multiple left outer join in single select query

    My client requires to apply multiple left outer join in single select query.
    Tell me how it is possible . tell me if we can use native sql query.

    HI vineet,
    Using multile left join is possible but it reduce performance as it takes a long time to retrieve data.
    The following code would help you in knowing how to use multiple left join
    REPORT  test.
    PARAMETERS:
      p_auart LIKE vbak-auart.
    DATA:
      BEGIN OF fs_sales,
        auart LIKE vbak-auart,
        vbeln LIKE vbak-vbeln,
        posnr LIKE vbap-posnr,
        matnr LIKE vbap-matnr,
        netwr LIKE vbap-netwr,
      END OF fs_sales,
      fs_temp LIKE fs_sales.
    DATA:
      t_sales LIKE STANDARD TABLE OF fs_sales.
    SELECT k~auart
           k~vbeln
           p~posnr
           p~matnr
           p~netwr
      INTO TABLE t_sales
      FROM vbak AS k
      OUTER JOIN vbap AS p
      ON k~vbeln = p~vbeln
    WHERE auart = p_auart
       AND p~netwr LT 1000.
    IF sy-subrc EQ 0.
      WRITE:/5 'Sales Document'(001),/,
            15 'Sales Document Item'(002),
            40 'Material Number'(003).
      sort t_sales by netwr ascending.
      LOOP AT t_sales INTO fs_sales.
        WRITE:/ fs_sales-vbeln under text-001.
        LOOP AT t_sales INTO fs_temp WHERE vbeln = fs_sales-vbeln.
          WRITE:/ fs_temp-posnr under text-002,
                  fs_temp-matnr under text-003.
        ENDLOOP.
      ENDLOOP.
    ELSE.
      MESSAGE 'No Record Found' TYPE 'I'.
    ENDIF.
    But i would suggest you to go with views instead of using multiple joins..
    Best of luck,
    Bhumika

  • Error in making left outer join to a nested query

    i am writing this query getting error here i am using nested query with that i am making join it is giving error
    SQL
    SELECT
    * FROM IVItem INNER JOIN
    IVPackSize_Mst ON IVItem.PackSizeID = IVPackSize_Mst.Id
    left outer join IvItemGenericLink on IvItemGenericLink.itemID=IVItem.Id
    Select GenericId from
    IvItemGenericLink where ItemID=IVItem.Id and rownum <=1
    )x
    and x on IvItemGenericLink.GenericId=x.GenericId;
    Error report:
    SQL Error: ORA-00936: missing expression
    00936. 00000 - "missing expression"
    *Cause:   
    *Action:
    give me and suggestion

    i am using left outer join at virtual table say x your gave me its equivalent
    EXISTS (SELECT 1 FROM IvItemGenericLink G
    WHERE G.ITEMID =V.ID
    AND G.GenericId = L.GenericId)-----its i guess inner join
    i am not confirmed that why iam asking this i guess i have to use this
    as i use keyword inner join for inner join and for left join i use
    left outer join
    EXISTS (SELECT 1 FROM IvItemGenericLink G
    WHERE G.ITEMID =V.ID
    AND G.GenericId(+) = L.GenericId)-----its i guess left outer join
    left outer join
    Select GenericId from
    IvItemGenericLink where ItemID=IVItem.Id and rownum <=1
    )*x*
    IvItemGenericLink.GenericId=x.GenericId
    -------------------Statement U Gave in this--------------------------------------------------------------------------
    SELECT *
    FROM IVITEM V, IVPACKSIZE_MST M , IVITEMGENERICLINK L,
    WHERE V.PACKSIZEID = M.ID
    AND V.ID = L.ITEMID (+)
    AND EXISTS (SELECT 1 FROM IvItemGenericLink G
    WHERE G.ITEMID =V.ID
    AND G.GenericId = L.GenericId)
    -------------------Statement U Gave in this--------------------------------------------------------------------------
    is this equivalent to left outer join
    *AND EXISTS (
    SELECT 1 FROM IvItemGenericLink G*
    WHERE G.ITEMID =V.ID
    *AND G.GenericId = L.GenericId
    please tell me this in this regard

  • Outer join, use in a query.

    Hi forum!
    I want to do a query among three tables keeping empties rows. Is this possible to do with an outer join?
    Could anybody give me an example how to use it¿?
    Thanks in advance and regards,
    Mon

    Yes you can use outer join for the same.
    In an inner join, a line from the left-hand database table or join is only included in the selection if there is one or more lines in the right-hand database table that meet the ON condition <cond>. <b>The left outer join, on the other hand, reads lines from the left-hand database table or join even if there is no corresponding line in the right-hand table.</b>
    SELECT ...
    FROM <tab> LEFT [OUTER] JOIN <dbtab> [AS <alias>] ON <cond> <options>
    <tab> and <dbtab> are subject to the same rules and conditions as in an inner join. The OUTER addition is optional. The tables are linked in the same way as the inner join with the one exception that all lines selected from <tab> are included in the final selection. If <dbtab> does not contain any lines that meet the condition <cond>, the system includes a single line in the selection whose columns from <dbtab> are filled with null values.
    In the left outer join, more restrictions apply to the condition <cond> than in the inner join. In addition to the above restrictions:
    EQ or = is the only permitted relational operator.
    There must be at least one comparison between columns from <tab> and <dbtab>.
    The WHERE clause may not contain any comparisons with columns from <dbtab>. All comparisons using columns from <dbtab> must appear in the condition <cond>.
    For details and examples of outer join please have a look at below links.
    http://help.sap.com/saphelp_nw04/helpdata/en/67/7e4b3eaf72561ee10000000a114084/content.htm
    http://database.ittoolbox.com/documents/popular-q-and-a/inner-and-outer-join-sql-statements-2108
    I hope it helps.
    Best Regards,
    Vibha
    *Please mark all the helpful answers

  • LEFT OUTER JOIN, Problem in POST-QUERY TRIGGER

    Hi,
    Please guide for the following
    I wrote below query in POST-QUERY Trigger of a TABULAR DATA BLOCK, having only one text item, called INVENTORY_ITEM
    select c.cat||' '||s.subcat||' '||l1.lvl1 ITEM INTO :DATABLOCK.INVENTORY_ITEM
    from itemcat c
    LEFT OUTER JOIN itemsubcat s on (c.catid = s.catid)
    LEFT OUTER JOIN lvl1 l1 on (s.subcatid = l1.subcatid)
    When I compile the module an error is generated
    *" Encountered the symbol 'LEFT' when expecting one of the following ,; for group having intersect minus order start union where connect ".*
    Above query is working fine in ORACLE SQL DEVELOPER .
    Any solution please.
    Regards,

    Difference

  • Outer join two tables with query search record attached to both tables

    When I create a query with two tables that have query search records attached with outer join, PS seems to do a natural join (cartesian). We are on PT8.48.
    Is there a workaround for this issue. I do not want to remove query search record on either of the tables.
    I am trying to create an Emergency contact report. I am using two tables PS_EMPLOYEES and PS_EMERGENCY_CNTCT. Here is the sql PeopleSoft query generated when I did Left outer Join.
    Query SQL:
    SELECT A.EMPLID, A.NAME, A.ADDRESS1, A.CITY, B.PRIMARY_CONTACT, B.ADDRESS1, B.CITY, B.STATE, B.POSTAL, B.RELATIONSHIP, A.DEPTID, A.JOBCODE, A.COMPANY, A.EMPL_TYPE
    FROM (PS_EMPLOYEES A LEFT OUTER JOIN PS_EMERGENCY_CNTCT B ON A.EMPLID = B.EMPLID ), PS_EMPLMT_SRCH_QRY A1, PS_PERS_SRCH_QRY B1
    WHERE A.EMPLID = A1.EMPLID
    AND A.EMPL_RCD = A1.EMPL_RCD
    AND A1.OPRID = 'SREESR'
    AND (B.EMPLID = B1.EMPLID OR B.EMPLID IS NULL )
    AND B1.OPRID = 'PS'
    Appreciate any help.

    I think there are fixes for this issue in later tools releases (Report ID 1544345000). I'm not sure about 8.48, but you might try the workaround documented in
    E-QR: Left Outer Joins with Security Records are returning unexpected results [ID 651252.1]
    on Oracle Support.
    Regards,
    Bob

  • Getting ORA-22922 with apex_collection.create_collection_from_query

    Hi,
    i'm getting ora-22922 nonexistent LOB value with
    apex_collection.create_collection_from_query('coll_name','select a,b,c from testtable','NO');
    what is going wrong?
    please help !!
    thx in advance !!!

    Hi Dila,
    unless you let us know what
    TESTTABLEexactly is, we probably can't help you.

  • Urgent - ORA-06502 numeric or value error in Complex SQL Join

    I am having trouble with a tricky bit of code.
    I have a complex join query which uses reference cursors.
    type search_cursor is ref cursor;
    c_result search_cursor;
    cursor c_result1 is
    select chemicals.*,buildings.building_name,msds.msds,chemical_ras.ra from chemicals,msds,chemical_ras,buildings;
    cv_result c_result1%rowtype;
    pv_query := 'select chemicals.*,buildings.building_name,msds.msds,chemical_ras.ra from
    chem_location_join
    right join room_permissions on chem_location_join.room_id = room_permissions.room_id
    inner join chemicals on chemicals.chemical_id = chem_location_join.chem_id
    inner join cupboards on cupboards.cupboard_id=chem_location_join.cupboard_id
    inner join rooms on rooms.room_id=chem_location_join.room_id
    inner join buildings on buildings.building_id=chem_location_join.building_id
    inner join csr on chemicals.chemical_id=csr.chemical_id
    left join msds on msds.csr_id = csr.csr_id
    left join chemical_ras on csr.csr_id= chemical_ras.csr_id
    where research_group_id = '||pv_research_group_id||' and upper(' || p_search_field || ') LIKE upper(''%' || p_search_entry || '%'') order by chemicals.chemical_name';
    Basically,
    When the italics are left out, the query runs perfectly. However, when it is put in, it returns the ORA-06502 numeric or value error.
    I have run the query in SQL using values in the where clause and it works perfectly. When i replace buildings with other similar elements, i.e. cupboard, room the query returns a similar error.
    Sorry if this seems hard to understand, if you need more clarification please reply.
    Many Thanks,
    Simon
    Message was edited by:
    SimonHollingsworth

    no but that shouldn't matter because all that cursor is doing is setting the variable cv_result equal to the same %rowtype, the where clause shouldn't be relevant. in any case I don't have a where clause when the italic bit is left out and it still works fine

  • Outer join problem (ORA-01799)

    We have a database design roughly as follows:
    - A STAFF table (columns don't matter here).
    - Resources have a cost per hour that varies over time, so we have a STAFF_COST table with an effective date and a cost per hour
    - A PROJECT table (columns don't matter here).
    - Projects can have staff assigned, so we have a PROJECT_STAFF table which has foreign keys to the PROJECT and STAFF table.
    - Project staff have a cost per hour, which can vary over time, and be different to the (default) staff costs. So we have a PROJECT_STAFF_COST table which uses the PROJECT_STAFF foreign key, with an effective date and a cost per hour
    - Staff work on tasks so we have a TIMESHEET_TASK and TIMESHEET_DAY tables which define a project worked on, task within the project (optional as time can be 'entered against the project', who is recording the time, the hours worked and the day the hours were worked.
    So when timesheet information is entered we have three scenario's that we need to cover.
    1) The resource is a member of the project and the hours were worked on a day for which we have a project staff cost. That is, the project staff cost table has one or more rows for the staff member assigned to the given project with an effective date before the date the hours were entered against.
    2) The resource is a member of the project but the hours were worked on a day for which we do not have a project staff cost. That is, the project staff cost table has one or more entries for the staff member assigned to the given project, but all the effective dates are after the date the hours were entered against.
    3) The resource is not a member of the project. That is, the project staff cost table does not have any rows for the staff member. Time was entered 'against the project'.
    We need to work out the actual cost of the project. So we need to retrieve every day's timesheet entry, returning the hours assigned and the cost per hour relevant for that day. I have the following query:
    select tsh.staff_id, s.full_name, tsd.entry_date, tsd.hours as ProjectHours,
    psCOST_INFO.cost_per_hour as ProjectCost
    from timesheet_day tsd
    inner join timesheet_task tst on tst.timesheet_task_id = tsd.timesheet_task_id
    inner join timesheet_header tsh on tst.timesheet_header_id = tsh.timesheet_header_id
    inner join staff s on s.staff_id = tsh.staff_id
    left join (Select ps.project_id, ps.staff_id, psc.project_staff_id, psc.effective_date, psc.cost_per_hour
    from project_staff ps
    inner join project_staff_cost psc on ps.project_staff_id = psc.project_staff_id) as psCOST_INFO
    on psCOST_INFO.staff_id = tsh.staff_id and psCOST_INFO.project_id = tst.project_id
    and psCOST_INFO.effective_date = (select max(ps2.effective_date) from project_staff_cost ps2
    where ps2.project_staff_id = psCOST_INFO.project_staff_id
    and ps2.effective_date <= tsd.entry_date)
    where tst.project_id = 55825
    Using the left join covers scenario's 2 and 3 above because I will get null in the cost columns and can then take appropriate action. If I were to use an inner join, then hours in timesheets from scenario's 2 and 3 would be excluded, which is not what we want.
    The subselect using the MAX aggregate function is required to get the cost per hour most relevant for the timesheet day. That is, if there are several effective dates for the project staff member before the date in question, we want the most recent one. We can't just use the MAX one, however in case there is an effective date after the particular timesheet date. Sheesh...
    This query works fine in SQL Server. It it not allowed in Oracle and returns an ORA-01799 column may not be outer joined to a subquery.
    I'm not going to bother to ask why not. I just need a way to do what I want. I've spent days trying to move the code around but I either end up with an inner join (which returns fewer rows than I want) or it just plain don't work.
    Can someone help me rework this query to achieve the result I want?
    Thanks, Andrew

    Thanks for your reply, Laurent. In my experience trying to cut important corners in explaining a problem only serves to make it more difficult to solve. That pretty much was the smallest reproducable query that demonstrates the complexity of the problem I have. I'm not just trying to get which publishers live in the 'CA' state here...
    From what I have just read about rank() it serves the same purpose as max() on a given column, and getting the maximum or top ranked one just doesn't cut it. As I said in my original post that provided all the relevant (and no spurious) information on the problem, it is possible that there are effective dates AFTER the date we are interested in and they have to be excluded.
    I have to get the project staff cost row with the latest date that is before the timesheet date. That means I have to reference data in the outer query. Oracle seems to have a problem with that when used in an outer join.
    We are currently going down the track of 3 UNION'd statement to cover the 3 scenario's. A single query would be more efficient so if anyone can provide guidance I would appreciate it.
    Thanks, Andrew

  • ORA-01799: a column may not be outer-joined to a subquery

    Hi,
    How to solve this problem below?
         and id2.invoice_line_id*(+)*=(select min(invoice_line_id)
              from TW.invoice_detail
              where invoice_id=239917
              and (bl_amount_currency='USD' AND actual_amount_currency='VND'
              OR bl_amount_currency='VND' AND actual_amount_currency='USD')
    ERROR at line 150:
    ORA-01799: a column may not be outer-joined to a subquery
    Since there's an uncertain existence in id2, it needs to be outer-joined to that!
    Bst Rgds,
    HuaMin

    You cant do a outer join on a sub query. Can you describe what are you trying to do?

Maybe you are looking for