To get worng result form Strored procedure

I dropped the following partitions-
Schema name-scpdat
Name of table-basetab_pps
Partitions-
partitions-
Y2009M12D21
Y2009M12D22
Y2009M12D23

I created a procedure is as
CREATE OR REPLACE PROCEDURE purge_partition (
   schema_name         IN   VARCHAR2,
   table_name          IN   VARCHAR2,
   active_partitions   IN   NUMBER
)
IS
   CURSOR PARTITION_CURSOR
   IS
      SELECT DISTINCT (partition_name)
                 FROM  dba_tab_partitions
                WHERE table_owner = UPPER (schema_name)
                  AND table_name = UPPER (table_name)
                  AND TO_DATE ((   SUBSTR (partition_name, 2, 4)
                                || SUBSTR (partition_name, 7, 2)
                                || SUBSTR (partition_name, 10, 2)
                               ),
                               'YYYYMMDD'
                              ) < SYSDATE - active_partitions
             ORDER BY partition_name; 
BEGIN
 
     FOR part_name IN PARTITION_CURSOR
     LOOP 
          DBMS_OUTPUT.put_line (  part_name.partition_name);
     END LOOP;
 
   DBMS_OUTPUT.put_line ('-------------------------------------');
 
END purge_partition;
/




SQL> exec purge_partition(schema_name=>'scpdata', table_name=>'basetab_pps',active_partitions=>55);
Y2009M12D21
Y2009M12D21
Y2009M12D22
Y2009M12D22
Y2009M12D23
Y2009M12D23
-------------------------------------

PL/SQL procedure successfully completed.

SQL> SELECT DISTINCT (partition_name)
  2                        FROM  dba_tab_partitions
                WHERE table_owner = UPPER ('scpdata')
                  AND table_name = UPPER ('basetab_pps')
                  AND TO_DATE ((   SUBSTR (partition_name, 2, 4)
                                || SUBSTR (partition_name, 7, 2)
                                || SUBSTR (partition_name, 10, 2)
                               ),
                               'YYYYMMDD'
                              ) < SYSDATE - 55
                ORDER BY partition_name;  3    4    5    6    7    8    9   10   11  

no rows selected

SQL> exec purge_partition(schema_name=>'scpdata', table_name=>'basetab_pps',active_partitions=>53);
Y2009M12D21
Y2009M12D21
Y2009M12D22
Y2009M12D22
Y2009M12D23
Y2009M12D23
Y2009M12D24
Y2009M12D24
Y2009M12D24
Y2009M12D25
Y2009M12D25
Y2009M12D25
-------------------------------------

PL/SQL procedure successfully completed.

SQL> 
SELECT DISTINCT (partition_name)
  2                            FROM  dba_tab_partitions
                WHERE table_owner = UPPER ('scpdata')
                  AND table_name = UPPER ('basetab_pps')
                  AND TO_DATE ((   SUBSTR (partition_name, 2, 4)
                                || SUBSTR (partition_name, 7, 2)
                                || SUBSTR (partition_name, 10, 2)
                               ),
                               'YYYYMMDD'
                              ) < SYSDATE - 53
                ORDER BY partition_name;  3    4    5    6    7    8    9   10   11  

PARTITION_NAME
------------------------------
Y2009M12D24
Y2009M12D25

SQL> 
My concern is the reason why the procedure give me worng result with duplicates...

Concerning
Fahmed

The problem lies in this line:

AND table_name = UPPER (table_name)

It is what originally is the procedure to retrieve rows from other tables than simply that you are interested in.

I hope you can see why a) the problem occurred and b) why you should not use the same name for different types of identifier.

A common practice is that the parameters are prefixed with p (or p_) and variable (_) v (or a variant which differentiates between local and global variables) etc. to avoid the kind of scope shock you meet here precisely.

Replace your settings p_schema_name and nom_table_p and you will find that your procedure works as expected.

Tags: Database

Similar Questions

  • Get the result of the procedure

    Hi all

    I have a procedure using storeb from the collection in an object of type as:

    create or replace type calc_type as object
    (
    field1 number,
    field2 number,
    field3 varchar2);
    
    create or replace type calc_table as table of calc_type;
    
    procedure make_calc_sched(v_id in number, v_user_id in varchar2) is 
    
    table_calc calc_table;
    begin
      select s.id, s.price, s.desc
      bulk collect into table_calc
      from tableA s
      inner join tableB d on d.id = s.id
      --.....
      
    end;
    

    How can I get the result of the procedure?

    procedure make_calc_sched(v_id in number, v_user_id in varchar2, v_table in out ????) is
    

    I plan to put up-to-date and inserts using the FORALL sentence.

    Can I use slider?  Maybe is a better way to do it.

    With the help of Oracle Database 11 g Enterprise Edition Release 11.2.0.4.0

    Thank you

    I think I got it:

    procedure make_calc_sched(v_id in number, v_user_id in varchar2, v_table out calc_table) is 
    
    begin
      select calc_type(s.id, s.price, s.desc)
      bulk collect into v_table
      from tableA s
      inner join tableB d on d.id = s.id
      --.....
    
    end;
    

    I'll look to materialize views more later. Someone at - it examples?

    Best,

  • Need to get the result of joing the views dba

    Hello

    need to get the result of the fileds below in a database

    TABLE_NAME NOM_PARTITION NOM_TABLESPACE PARTITION_TYPE (RANGE?) PARTITION_RANGE_CONDITION SPACE_OCCUPIED_AS_OF_DATE (IN GB)

    can I know what are the points of view that I can use and application

    apprecaited for assistance

    Thank you

    Published by: user12266475 on November 2, 2011 11:33

    LONG data type is NOT friendly SQL.
    Consider the following:

    SQL> @long
    SQL> drop table test;
    
    Table dropped.
    
    SQL> create table test (id LONG);
    
    Table created.
    
    SQL> insert into test values(q'[RANGE     TO_DATE(' 2009-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')]');
    
    1 row created.
    
    SQL> set serveroutput on
    SQL> DECLARE
      2  long_var LONG;
      3  var_var  VARCHAR2(2000);
      4  BEGIN
      5       dbms_output.enable(10000);
      6       SELECT id INTO long_var FROM test ;
      7       var_var := substr(long_var,19,19);
      8       dbms_output.put_line(var_var);
      9  END;
     10  /
    2009-01-01 00:00:00
    
    PL/SQL procedure successfully completed.
    
  • Combine queries to get the result set with max Y

    Hello
    I use forms 6i and db 10.2.0.1.0

    With the query below
    Select ufam_usrgrp,ufam_filegrp,ufam_read,ufam_write,ufam_overwrite,ufam_delete from usr_file_access_master
    Where ufam_ecode = '0004108';
    the result set is
    UFAM_USRGRP     UFAM_FILEGRP    UFA UFA UFA UFA
    --------------- --------------- --- --- --- ---
    MGMNT           CV              Y   Y   Y   Y
    EMPLOYEE        GENERAL         Y   N   N   N
    EMPLOYEE        PERSONAL        Y   N   N   N
    Another query
    Select uul_usrgrp, ufl_file_grp,ufl_read,ufl_write,ufl_overwrite,ufl_delete from usr_usrgrp_lnk,USRGRP_FILEGRP_LINK
    Where usr_usrgrp_lnk.uul_usrgrp = USRGRP_FILEGRP_LINK.UFL_USR_GRP
    and usr_usrgrp_lnk.uul_ecode = '0004108'
    gives the result
    UUL_USRGRP      UFL_FILE_GRP    UFL UFL UFL UFL
    --------------- --------------- --- --- --- ---
    MGMNT           GENERAL         Y   Y   Y   Y
    EMPLOYEE        GENERAL         Y   Y   N   N
    MGMNT           CV              Y   N   N   N
    I need to combine these two queries to get a separate result set with maximum Y

    Like here "MGMNT CV" is repeated in both the result set, but the first has more, then it should come from the combined result set. reverse-case also the same (such as "EMPLOYEE GENERAL")

    So I want to combine the queries so that I get the result as set below
    UserGroup       FileGroup       Rd Wrt Owrt Del
    --------------- --------------- --- --- --- ---
    MGMNT           GENERAL         Y   Y   Y   Y
    EMPLOYEE        GENERAL         Y   Y   N   N
    MGMNT           CV              Y   Y   Y   Y
    EMPLOYEE        PERSONAL        Y   N   N   N
    Please help me to combine these queries

    Published by: Divya on August 14, 2011 21:24
    Changed the result set and the last exit

    NOT TESTED!

    select y.uul_usrgrp,
           y.ufl_file_grp,
           greatest(ufl_read,nvl(ufam_read,' ')) ufl_read,
           greatest(ufl_write,nvl(ufam_write,' ')) ufl_write,
           greatest(ufl_overwrite,nvl(ufam_overwrite,' ')) ufl_overwrite,
           greatest(ufl_delete,nvl(ufam_delete,' ')) ufl_delete
      from (select ufam_usrgrp,ufam_filegrp,ufam_read,ufam_write,ufam_overwrite,ufam_delete
              from usr_file_access_master
             Where ufam_ecode = '0004108'
           ) x,
           (select uul_usrgrp, ufl_file_grp,ufl_read,ufl_write,ufl_overwrite,ufl_delete
              from usr_usrgrp_lnk,USRGRP_FILEGRP_LINK
             Where usr_usrgrp_lnk.uul_usrgrp = USRGRP_FILEGRP_LINK.UFL_USR_GRP
               and usr_usrgrp_lnk.uul_ecode = '0004108'
           ) y
     where y.uul_usrgrp = x.ufam_usrgrp(+)
       and y.ufl_file_grp = x.ufam_filegrp(+)
    

    Concerning

    Etbin

    Edited by: Etbin on 14.8.2011 13:08
    deleted by group

  • get the result without Union all the

    < pre >
    WITH GET_BALANCE AS
    (SELECT "CREDIT2' AS TYPE, - 6336.37 AS A AMOUNT OF DOUBLE
    Union of all the
    SELECT 'CREDIT', 8340.52 OF THE DOUBLE
    Union of all the
    SELECT 'CREDIT', THE DOUBLE 609.48
    Union of all the
    SELECT 'CREDIT', 50 OF THE DOUBLE
    Union of all the
    SELECT 'CREDIT', 6336.37 OF THE DOUBLE
    Union of all the
    Select "DEBIT", 628.68 DUAL FROM
    Union of all the
    Select "DEBITORG", 9000 DUAL FROM
    Union of all the
    SELECT 'DEBIT1', DOUBLE 50,81
    Union of all the
    SELECT 'DEBIT2',-679.49 OF THE DOUBLE
    UNION ALL
    SELECT 'DEBIT1', THE DOUBLE 679.49
    UNION ALL
    SELECT 'DEBIT2',-679.49 OF THE DOUBLE
    )

    SELECT sum (debit) debit, sum (credit) in the form of credit, (sum (debit) - sum (credit)) such as (FROM) balance
    SELECT FLAT CREDIT, DEBIT GET_BALANCE 0
    WHERE TO TYPE LIKE 'CREDIT %'
    UNION ALL
    SELECT 0 CREDIT, DEBIT GET_BALANCE PLATE
    WHERE TO TYPE LIKE' FLOW %')

    I got the result;
    credit debit balance
    9000 9000 0
    < / pre >
    But,
    I want to get the result without union all.
    I try sum on the partition by, or group by type...
    can not get the result. you would tell me the other way to get above result

    Thank you

    Published by: Jimmie_M on October 4, 2010 14:59

    Published by: Jimmie_M on October 4, 2010 15:01

    Hello

    Here's one way:

    WITH   got_credit_and_debit     AS
    (
         SELECT     SUM ( CASE
                     WHEN  SUBSTR (type, 1, 6) = 'CREDIT'
                         THEN  amount
                    END
                  )     AS credit
         ,     SUM ( CASE
                        WHEN  SUBSTR (type, 1, 5) = 'DEBIT'
                         THEN  amount
                    END
                  )     AS debit
         FROM    get_balance
    )
    SELECT     credit
    ,     debit
    ,     debit - credit     AS balance
    FROM     got_credit_and_debit
    ;
    

    What type of application is as follows, where the balance is defined as the debit - credit? Usually, it's the opposite: balance = credit - debit.

    You don't absolutely need a subquery:

    SELECT     SUM ( CASE
                WHEN  SUBSTR (type, 1, 6) = 'CREDIT'
                    THEN  amount
               END
             )     AS credit
    ,     SUM ( CASE
                   WHEN  SUBSTR (type, 1, 5) = 'DEBIT'
                    THEN  amount
               END
             )     AS debit
    ,     SUM ( CASE
                WHEN  SUBSTR (type, 1, 6) = 'CREDIT'
                THEN  amount
                   WHEN  SUBSTR (type, 1, 5) = 'DEBIT'
                    THEN  -amount
               END
             )     AS balance
    FROM    get_balance
    

    Published by: Frank Kulash, October 4, 2010 18:15
    Added query replacing without subquery

  • Can do a read request only results form be bound to an iterator designated?

    For the experienced:

    I use JDeveloper 10.1.3.4 and have a question while building a search page.

    I create this page by following the example in tutorial tutorial for forms/4GL (10.1.3.1.0) developers (Chapter 8).

    As in the tutorial, my page is a form of query by example and displays the results of the query on the same page. My page is built exactly as in the tutorial, except that the tutorial displays the query results in a read-only table, while in my page, I tried showing the results of the query in an unalterable form.

    The reason to use a form rather a table to display the query results is that in the tutorial, the results of the query may contain multiple lines, while in my page, the result of the query is always a line. It is not put into nice page to display a long line in small print and let most of the blank page.

    I don't know if using a form is the cause of the problem.

    In the tutorial on the search engine is first created, and then the results table is created. The search engine uses an iterator that is preparing to be always in discovery mode. After you have created the table of results, in the tutorial, a second iterator is inserted into the node executable files of the definition of the page, and the table of results is then linked to this new iterator. So that the search engine and the results form each uses its own iterator, in a different way and a different purpose. The binding is done using the option 'Edit link' in the menu which appears when the right click on the table in the component structure.

    I did the same thing. The only problem is that the form to display the results in my page has no option to change the binding.

    So in my search page, all what you type in the search field, if a match is found when the button is clicked, just the search values are repeated in the form of results. But the form of results a little more fields that are left white.

    Is there a way to link the form of results to the iterator in expected?

    Thanks a lot for your help!


    Newman

    Hello

    There is a difference between the table and the form. table is component jsf is a data model (collectionModel). form is simply by dialing. Need to right-click on each field (text of entry or exit) inside the shape
    to get the menu option Edit link and change iterator. (outputText or inputText are new components jsf with a data model)

    Kind regards

    Branislav

  • How to get the result

    Hi all

    Let me explain my requirment.

    I created a custom workflow where the order goes to the approver for counterpart he can accept or reject that.

    If the notification that the approver receives have a result with approve and reject values. The notification activity, I've written a procedure that will update the database columns that are based on the result.

    But how do we get this result value

    I need something like below

    x_result: result of get value =
    If x_result = "Approve" then
    Update of table with approved status
    on the other
    Update of table with the status rejected

    Kind regards
    Kumar.

    Use the RESULT attribute

    x_result: = Wf_Notification.GetAttrText (, 'RESULT');

  • How to get the results of the UK instead of the default USA?

    I live in the United Kingdom and would like to be able to search for UK results. for example, Amazon UK results when I search a product, etc.
    with the option of a search in the world so I don't get the results I want

    To add plugins to search for sites such as Amazon.co.UK and Google.co.uk to Firefox, open this page in Firefox and then search or click the sites that interest you: http://mycroft.mozdev.org/

    When you click on one of the listed search plugins, Firefox will ask you if you want to install it.

    After that, you can open the Firefox Add-ons Manager and click on disable one of the search engine integrated you want to use.

  • [LV-&gt; TS] How to run a SEQ file, get the result (PASS/FAIL) and the report file?

    Hello

    I'm looking for the most obvious and simple, LabVIEW:

    1. start the motor Teststand: FACT

    2. get a list of SEQ files to run: FACT

    3 - loop through the list to run each file follows:<- found="" some="" examples="" but="" i="" have="" some="" trouble="" with="" the="" uimessage="">

    http://zone.NI.com/reference/en-XX/help/370052N-01/tsexamples/infotopics/executing_sequences_using_a...

    4. get the result of the execution of the SEQ:<->

    5 retrieve the XML + name of the generated report file path:<- obviously="" not="">

    http://digital.NI.com/public.nsf/allkb/3D3B2358DF9B786B8625789500549A3B

    http://forums.NI.com/T5/NI-TestStand/getting-report-file-path-location-at-execution-in-TestStand-201...

    Here's my current implementation:

    David Koch


  • Get the result of the sequence by programming

    Hi all

    in my custom operator interface to save the event EndExecution callback to accomplish several final operation.

    What I can't do is to retrieve the result of the sequence ('Success' or 'Failure', exactly the one that is displayed in the default report under the voice "Result USE") using methods or properties API.

    I've tried Execution.ResultStatus property and the SequenceContext.SequenceFailed property, but none of them works.

    How can I get the result of the sequence?

    Thank you

    Process templates are already generating a Message from the user interface "TestingComplete" you can register an event reminder on.  It also transmits the result as part of the parameter string State.  The attached excerpt from LV show what the VI recall may contain to handle the event.  If you need to deal with other UI event codes you can wire the event directly number in the structure box for the 34 decimal 'TestingComplete' event code.

    P.S., the event is the same that Norbert has pointed out, event UIMessageEvent...

  • How to get the result of the test of CVI DLLs in teststand!

    I write a driver dll to test a source, I want to get the tension of world SERVERS (the instrument of the RS) and I used to call DLLs that written by CVI, teststand

    My question is what is the best way I can get the result of the test and show the user to teststand. the code below is fair? When I used to call this dll document, teststand

    "" I just get the result by setting in TS.this is a good meathod, and what should you do in teststand, I put the "outputVoltageV" point to an object?

    /*===========================================================================*/
    / * Function: read voltage/current output * /.
    / * End: this function returns the output and actual output voltage * /.
    / * current instrument.                                      */
    /*===========================================================================*/
    ViStatus _VI_FUNC rsngsm_datReadOutput (ViSession instrSession,
    ViPReal64 outputVoltageV, ViPReal64 outputCurrentA, ViPBoolean statusPeakCurrent)
    {
    ViStatus rsngsm_status = VI_SUCCESS;
    Bruno buf [BUFFER_SIZE];
    ViInt32 retCnt;
       
    FMT (buf, "%s<>
    If ((rsngsm_status = viWrite (instrSession, buf, NumFmtdBytes (), & retCnt))<>
    Return rsngsm_status;
           
    If ((rsngsm_status = viRead (instrSession, buf, 50, & retCnt))<>
    Return rsngsm_status;
    If (Scan (buf, "%s > %f [p2];")) %f [p2]; %i [b2] ", outputVoltageV, outputCurrentA, statusPeakCurrent). = 3)
    Return rsngsm_status;
           
    Return rsngsm_status;
    }

    sean_tan,

    Yes, you just pass a value of digital TestStand (e.g.; locals.number).

    If you use the adapter of the ICB, it might make more sense that you can use the Flexible DLL adapter for this type of function, that you do not use the standard settings of tTestData and tTestError. While TestStand will correctly recognize the function prototype, you want to make sure you that include the type library of your function Panel (you will need to create one if you have not already done so) in settings target of LabWindows / CVI-> type library.

    I hope this helps.

    -Jack

  • Windows 7: all of a sudden, when I enter a search in Explorer 'field research' I get no results.

    Hello

    Suddenly and without installation or messing around with hidden options, if I get *.mp3 in the search box in Explorer on windows 7 64 bit with all the updates, I get no results.

    What happens in a directory with 4 subdirectories and 120 MP3s inside.

    If I use *. * I get no results.

    *.MP3 works in the start menu > programs or search files and gives a lot of results.

    Left me speechless. Any advice?

    OK, I know the ability of research in libraries of indexing operating normally.  So, the first thing to try would be to go in Indexing Options, then click on "search indexing and troubleshooting."  (Indexing Options in Control Panel, or you can search for it in the search box start (Orb) if it works.)

  • Not get scheduling results in the browser of the operator?

    Hello

    I'm scheduling for scenario. I don't get the results in the browser of the operator.  Please find below the screenshot.

    Please help me with the planning. Please solve this problem

    Thanks in advance,

    Bruno has.

    err11.png

    Hello

    I got the answer of gurus odi.

    To resolve this problem, I changed the odiparams properties & I did it again agent. Now his work.

    Thank you best regards &,.

    A.Kavya.

  • OBIEE 11 g: get incorrect results when you browse detailed report summary.

    Hello

    I get incorrect results when you browse detailed report summary.

    Please find the attached document, I have gives step by step with screen shots.

    Please let me the problem and the solution.

    Kind regards

    Srinivas.

    1. What are you going through the link of action, only pass you the values (between 61 and 65) and Total, are

    If so that the parameter value will not restrict your report in detail, try filterout gender and age (between 61 and 65) group through action link.

    2 Total, to filter only the sex,

    Concerning

    Rajagopal.

  • Get the result of XMLTABLE when "Sub"-XMLTABLE is empty ".

    Hello

    I have an XML with the < Beitragssatzdatei > < ADR > < DFUE > elements where the 'DFUE' element is defined with a minOccurs = "0" maxOccurs = "unbounded".

    DROP TABLE test_xml;

    CREATE TABLE test_xml)

    ID NUMBER

    xml_document XMLTYPE

    );

    INSERT INTO test_xml (id, xml_document)

    VALUES)

    1

    XMLTYPE)

    q'[<? xml version = "1.0" encoding = "iso-8859-1"? >]

    " < Beitragssatzdatei logische_version ="2.0.1"xsi: schemaLocation =" beitragssatz TBSD0-schema - 2.0.xsd "xmlns ="beitragssatz"xmlns: xsi =" http://www.w3.org/2001/XMLSchema-instance ">

    < bn ADR = '00000033' kassenart = gueltig_ab '14' = '2013-01-01' letzte_aenderung = '2014-07-02' >

    < Anschrift art = 'Anschrift' >

    < Strasse > <! [CDATA [Am Grünen Tal 50]] > < / Strasse >

    < PLZ > 29063 < / PLZ >

    < ort > <! [CDATA [Schwerin]] > < / Ort >

    < / Anschrift >

    < letzte_aenderung DFUE = "2014-06-16" gueltig_ab "2014-01-01" = >

    < DAVBN bn = "01000240" / >

    < ASTBN bn = "01000251" / >

    < WLSTBN / >

    < / DFUE >

    < letzte_aenderung DFUE = '2014-07-02' gueltig_ab = '01-02-2014' >

    < DAVBN bn = "66993824" / >

    < ASTBN bn = "47056789" / >

    < WLSTBN / >

    < / DFUE >

    < / ADR >

    < bn ADR = "01000068" kassenart = gueltig_bis "14" = "2002-12-31" nachfolge_bn = "90235319" letzte_aenderung = "2014-04-15" >

    < Anschrift art = 'Anschrift' >

    < Strasse > <! [CDATA [time. 10]] > < / Strasse >

    < PLZ > 10963 < / PLZ >

    < ort > <! [CDATA [Berlin]] > < / Ort >

    < / Anschrift >

    < / ADR >

    ([< / Beitragssatzdatei >]')

    );

    COMMIT;

    SELECT adr.betriebsnummer

    dfue. DFUE_letzte_aenderung

    dfue. DFUE_gueltig_ab

    dfue. DAVBN

    dfue. ASTBN

    dfue. WLSTBN

    Test_xml BSD

    XMLTABLE)

    XMLNAMESPACES (DEFAULT ' beitragssatz'),

    ' / Beitragssatzdatei/ADR '.

    PASSAGE bsd.xml_document

    Betriebsnummer PATH VARCHAR2 COLUMNS (8) "@bn".

    adrXML XMLTYPE PATH ' / '.

    ) adr

    XMLTABLE)

    XMLNAMESPACES (DEFAULT ' beitragssatz'),

    "/ ADR/DFUE.

    PASSAGE adr.adrXML

    COLUMNS DFUE_letzte_aenderung DATE PATH '@letzte_aenderung '.

    , DATE of DFUE_gueltig_ab «@gueltig_ab» path

    , PATH of VARCHAR2 (8) DAVBN 'DAVBN/@bn '.

    , PATH of VARCHAR2 (8) ASTBN 'ASTBN/@bn '.

    , PATH of VARCHAR2 (8) WLSTBN 'WLSTBN/@bn '.

    ) dfue;

    ENTERPRISE DFUE_LET DFUE_GUE DAVBN ASTBN WLSTBN

    -------- -------- -------- -------- -------- --------

    00000033 16.06.14 01.01.14 01000240 01000251

    00000033 02.07.14 01.02.14 66993824 47056789

    This way I get only results when DFUE exists. How can I write a query that selects the values of ADR, even when there is no such thing as DFUE?


    ENTERPRISE DFUE_LET DFUE_GUE DAVBN ASTBN WLSTBN

    -------- -------- -------- -------- -------- --------

    00000033 16.06.14 01.01.14 01000240 01000251

    00000033 02.07.14 01.02.14 66993824 47056789

    01000068

    Concerning

    Marcus

    How can I write a query that selects the values of ADR, even when there is no such thing as DFUE?

    Just as we do in SQL, using an outer join:

    SELECT adr.betriebsnummer

    dfue. DFUE_letzte_aenderung

    dfue. DFUE_gueltig_ab

    dfue. DAVBN

    dfue. ASTBN

    dfue. WLSTBN

    Test_xml BSD

    XMLTABLE)

    XMLNAMESPACES (DEFAULT ' beitragssatz'),

    ' / Beitragssatzdatei/ADR '.

    PASSAGE bsd.xml_document

    Betriebsnummer PATH VARCHAR2 COLUMNS (8) "@bn".

    adrXML XMLTYPE PATH ' / '.

    ) adr

    XMLTABLE)

    XMLNAMESPACES (DEFAULT ' beitragssatz'),

    "/ ADR/DFUE.

    PASSAGE adr.adrXML

    COLUMNS DFUE_letzte_aenderung DATE PATH '@letzte_aenderung '.

    , DATE of DFUE_gueltig_ab «@gueltig_ab» path

    , PATH of VARCHAR2 (8) DAVBN 'DAVBN/@bn '.

    , PATH of VARCHAR2 (8) ASTBN 'ASTBN/@bn '.

    , PATH of VARCHAR2 (8) WLSTBN 'WLSTBN/@bn '.

    ) (+) dfue;

    or by using the ANSI syntax, if you prefer:

    XMLTABLE (...)  ADR

    Dfue LEFT OUTER JOIN XMLTABLE (...) ON 1 = 1

Maybe you are looking for