Simple query in Oracle Table in MS Access causes a full table scan.

I run a very simple query in MS ACCESS to an Oracle table attached as follows:

Select *.
EXPRESS_SERVICE_EVENTS-(EXPRESS is the name of the related table. SERVICE_EVENTS)
When executed > MyDate()

or

Select *.
EXPRESS_SERVICE_EVENTS-(EXPRESS is the name of the related table. SERVICE_EVENTS)
When executed > [Forms]! [MyForm]! [Date1]

We have more than 50 machines and this query works well on more than half of them, using an Oracle Index on the field "run." Exactly the same thing running on other machines results in a full table scan, so regardless of the index (the DB access even access all machines).

Strangely, if we write the query as follows:

Select *.
Of EXPRESS_SERVICE_EVENTS
When executed > # 2009-09-04 08:00 #.

It works fast everywhere!

Any help with this "phenominon" would be appreciated.

We did the things:
Check the locale settings of the ODBC driver, MS Access settings (as in tools-> Options), we have the latest XP and Office service packs and re-related all the Access Tables on the slow and fast machines independently).

All machines use the same version of the ODBC driver?

If you have access to Metalink, check the following note:
Note.257828.1 Scan of Table full Ext/Pub while seeking the DATE columns using the ODBC Oracle driver:

In a Word, try "bind timestamp date" option in the dsn configuration and do not forget to update the links in the table.

It will be useful,
Greg

Tags: Database

Similar Questions

  • Querying the oracle table that has a column with the name of "FILE".

    Hi all

    I need to have an oracle table that has the column with the name "FILE".

    I can query all columns with the query "select * from table".

    But I'm not able to use the query "select the table file.

    This table is converted from ms access to oracle and I need to have this column with the name "FILE".

    Any suggestions?

    Thank you

    Abdellaoui

    Hello

    FILE is a keyword from Oracle, so it's not a good name,

    Use FILEDATE, or DATE_FILED, or something else that is not in V$ RESERVED_WORDS. KEYWORD as the name column.

    If you need to use the FILE, then you must use quotation marks.

  • Oracle Table scan for numbers

    When I use a numeric value against a column defined as varchar in which would adopt it, Oracle performs a full table scan, although there is an index of this column. Is there a reason why Oracle has in this way? I use 10.2.0.3.0

    create table employees (empid varchar2 (3));

    insert into employees values ('123');

    create index emp_index on employees (empid).

    Select * from employees where empid = '123'; -Index scan interval

    Select * from employees where empid = 123; -Full Table Scan

    Select * from employees where empid = to_char (123); -Index scan interval

    However, this is not the case when I use a string where clause against a column defined as number.

    create table managers (mgr_id number (3));

    insert into values of managers (123);

    create index mgr_index on managers (mgr_id);

    Select * managers where mgr_id = 123; -Index scan interval

    Select * managers where mgr_id = '123'; -Index scan interval

    user6794035 wrote:
    When I use a numeric value against a column defined as varchar in which would adopt it, Oracle performs a full table scan, although there is an index of this column. Is there a reason why Oracle has in this way? I use 10.2.0.3.0

    This is due to the average implicit data type conversion Oracle does. Here is the excerpt from the documentation

    Character and multivalued example when a condition compares a character value and a NUMERIC value, Oracle implicitly converts the value of character to a NUMERIC value, instead of converting the NUMBER of value to a character value.

    This can be illustrated using DBMS_XPLAN:

    SQL> EXPLAIN PLAN FOR SELECT * FROM EMPLOYEES WHERE EMPID = 123;
    
    Explained.
    
    SQL> SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY);
    
    PLAN_TABLE_OUTPUT
    -----------------------------------------------------------------------------------------------------
    
    Plan hash value: 1445457117
    
    -------------------------------------------------------------------------------
    | Id  | Operation         | Name      | Rows  | Bytes | Cost (%CPU)| Time     |
    -------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT  |           |     1 |     3 |     2   (0)| 00:00:01 |
    |*  1 |  TABLE ACCESS FULL| EMPLOYEES |     1 |     3 |     2   (0)| 00:00:01 |
    -------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       1 - filter(TO_NUMBER("EMPID")=123)
    

    See the TO_NUMBER() function applied to the EMPID column in the section 'information of predicate? It's the implicit conversion is made. As a function is applied to a column and a function-based Index is not Oracle executes a FTS.

    HTH!

  • Full table scan caught me CBO choose

    Oracle 10.2.0.3.0
    OPTIMIZER_INDEX_COST_ADJ = 100

    Have a simple query on a table with 15mill records and 13 columns.

    Select distinct column
    from tablea

    I have a normal index with only the inside column, that I rebuilt and ran statisitcs and ran a shrink on the table statistics and update. I ran a partial statistics on both same results and then a full on both.

    I know with the separate, he must make a full analysis, but why the CBO chooses a table on an index.

    The only thing I could think is that the tables and indexes are in the same table, and that a larger block size for my index finger may seem preferable to the CBO on IO, do to the size of the record. Just could not get how a table scan complete 15mill records and victories of 22 columns on an index only one column, the health and statistics are up to date.



    Thanks for your help.

    PL see also MOS Doc 67522.1 (why a query is not using an Index of diagnosis)

    HTH
    Srini

  • Need help for query flat_file type clobdata oracle table data.

    Hi Sir,

    I need help to query oracle table flat file data having given clob type.
    Oracle Version:
    
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    "CORE     10.2.0.1.0     Production"
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    
    
    
    Source table
    
      CREATE TABLE order_details 
       (     QUEUE_SEQNUM NUMBER(10,0) NOT NULL ENABLE, 
         LINE_SEQNUM NUMBER(10,0) NOT NULL ENABLE, 
         CHAR_DATA CLOB, 
         OPTIMISTIC_LOCK_KEY NUMBER(20,0)
       ) 
    COLUMN FOR CHAR_DATA FLAT_FILE
    EU,6067AT,AT10,000000402004,NexiumGERDManagementProject,Z435,,ZZ29,NIS-GOLD,AT
    EU,6067AT,AT10,000000402038,NIS-OEU-ARI-2007/1,Z450,,ZZ29,NIS-OEU-ARI-2007/1,AT
    EU,6067AT,AT10,000000402039,SymbicortNISinCOPD,Z450,,ZZ29,NIS-REU-DUM-2007/1,AT
    EU,6067AT,AT10,000000402040,D1443L00044SeroquelXRRuby,Z450,,ZZ29,D1443L00044,AT
    EU,6067AT,AT10,000000402041,NIS-GEU-DUM-2008/1,Z450,,ZZ29,NIS-GEU-DUM-2008/1,AT
    EU,6067AT,AT10,000000402042,SonstigeAktivitätenLCM,Z450,,ZZ29,.,AT
    EU,6067AT,AT10,000000402134,D1680L00002Saxagliptin,Z450,,ZZ29,D1680L00002,AT
    EU,6067AT,AT10,000000402199,SeroquelWaveNIS,Z450,,ZZ29,NIS-NEU-DUM-2009/1,AT
    EU,6067AT,AT10,000000402313,SeroquelExtra(D1443L00082),Z450,,ZZ29,D1443L00082,AT
    EU,6067AT,AT10,000000402517,AtlanticD5130L00006(AZD6140),Z450,,ZZ29,D5130L00006,AT
    EU,6067AT,AT10,000000554494,ArimidexSt.Gallen(13+2),Z142,,ZZ09,,AT
    EU,6067AT,AT10,000000554495,ArimidexASCO(5delegates),Z142,,ZZ09,,AT
    EU,6067AT,AT10,000000554496,ArimidexSanAntonio6delegates,Z142,,ZZ09,,AT
    EU,6067AT,AT10,000000554497,ArimidexBreastCancerSummit(13+2),Z130,,ZZ09,,AT
    EU,6067AT,AT10,000000554498,ArimidexEIH(15delegates),Z130,,ZZ09,,AT
    EU,6067AT,AT10,000000554499,ArimidexNIFA(200delegates),Z135,,ZZ09,,AT
    EU,6067AT,AT10,000000554500,ArimidexNIFAworkshops(8x25),Z135,,ZZ09,,AT
    EU,6067AT,AT10,000000554501,ArimidexPraktischeGyn.Fortbildung,Z147,,ZZ09,,AT
    EU,6067AT,AT10,000000554502,ArimidexAGO,Z147,,ZZ09,,AT
    EU,6067AT,AT10,000000554503,ArimidexHämato/OnkologieKongress,Z147,,ZZ09,,AT
    EU,6067AT,AT10,000000554504,ARIMIDEXGYNäKOLOGENKONGRESS,Z147,,ZZ09,,AT
    EU,6067AT,AT10,000000554505,ArimidexChirurgenkongress,Z147,,ZZ09,,AT
    EXPECTED RESULTS:
    AFFIRM_CODE COMPANY_CODE INTERNAL_ORDER_CODE INTERNAL_ORDER_DESC ENIGMA_ACTIVITY             SUB_ACTIVITY_CODE IN_AFF_IND ORDER_TYPE EXTERNAL_ORDER COUNTRY        
    EU          6067AT       AT10                 000000402004       NEXIUMGERDMANAGEMENTPROJECT     Z435           NULL        ZZ29       NIS-GOLD        AT             
    EU          6068AT       AT11                 000000402005       NEXIUMGERDMANAGEMENTPROJECT     Z435           NULL        ZZ29       NIS-GOLD        AT             

    Sorry, my bad. Without database at hand, I'll try 'baby steps' (borrowed from Frank) so you don't confuse it with errors that I might add (happens far too often already, but at least you won't "swallow" as forum members think is one of the main goals of this fighter - help her learn - providing not only the proverbial fish.)
    Search the Forum - your problem is one of its best sellers. Watching {message identifier: = 10694602} ("split string into" was the key word used in research) you can try something as

    select table_row,
           level clob_row,
           regexp_substr(char_data,'[^' || chr(13) || chr(10) || ']+',1,level) the_line
      from (select to_char(queue_seqnum)||':'||to_char(line_seqnum) table_row,
                   char_data
              from order_details
           )
     connect by regexp_substr(char_data,'[^' || chr(13) || chr(10) || ']+',1,level) is not null
            and prior char_data = char_data
            and prior table_row = table_row
            and prior sys_guid() is not null
    

    to get all the s the_lineall CLOB and after that the use of the example even to get your columns of each the_line.

    Concerning

    Etbin

    Edited by: Etbin on 3.2.2013 09:01

    .. .but I m connected to do things according to the instructions, I can't do something.

    Used to happen to me too and I did as told to the but only after explaining any disadvantages, I was aware of in time. The last sentence is usually: "O.K. now be just and Don't come back with that kind of thing when it turns out that this isn't the right thing."
    rp0428 post - something to remember.

  • The query makes a full table scan?

    I have a simple select query that filters on the last 10 or 11 days of data in a table. In the first case, it runs in 1 second. In the second case it takes 15 minutes and still not done.

    I can say that the second query (11 days) makes a full table scan.
    -Why is this happening? ... I guess some kind of threshold?
    -Are there a way to avoid this? ... or encourage Oracle to play nice.

    I find confusing from the point of view before end/query to get very different performances.

    Jason
    Oracle 10g
    Toad quest 10.6

    CREATE TABLE delme10 AS 
    SELECT *
    FROM ed_visits
    WHERE first_contact_dt >= TRUNC(SYSDATE-10,'D');
    
    Plan hash value: 915912709
    
    --------------------------------------------------------------------------------------------------
    | Id  | Operation                    | Name              | Rows  | Bytes | Cost (%CPU)| Time     |
    --------------------------------------------------------------------------------------------------
    |   0 | CREATE TABLE STATEMENT       |                   |  4799 |  5534K|  4951   (1)| 00:01:00 |
    |   1 |  LOAD AS SELECT              | DELME10           |       |       |            |          |
    |   2 |   TABLE ACCESS BY INDEX ROWID| ED_VISITS         |  4799 |  5534K|  4796   (1)| 00:00:58 |
    |*  3 |    INDEX RANGE SCAN          | NDX_ED_VISITS_020 |  4799 |       |    15   (0)| 00:00:01 |
    --------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       3 - access("FIRST_CONTACT_DT">=TRUNC(SYSDATE@!-10,'fmd'))
    
    
    CREATE TABLE delme11 AS 
    SELECT *
    FROM ed_visits
    WHERE first_contact_dt >= TRUNC(SYSDATE-11,'D');
    Plan hash value: 1113251513
    
    -----------------------------------------------------------------------------------------------------------------
    | Id  | Operation              | Name      | Rows  | Bytes | Cost (%CPU)| Time     |    TQ  |IN-OUT| PQ Distrib |
    -----------------------------------------------------------------------------------------------------------------
    |   0 | CREATE TABLE STATEMENT |           | 25157 |    28M| 14580   (1)| 00:02:55 |        |      |            |
    |   1 |  LOAD AS SELECT        | DELME11   |       |       |            |          |        |      |            |
    |   2 |   PX COORDINATOR       |           |       |       |            |          |        |      |            |
    |   3 |    PX SEND QC (RANDOM) | :TQ10000  | 25157 |    28M| 14530   (1)| 00:02:55 |  Q1,00 | P->S | QC (RAND)  |
    |   4 |     PX BLOCK ITERATOR  |           | 25157 |    28M| 14530   (1)| 00:02:55 |  Q1,00 | PCWC |            |
    |*  5 |      TABLE ACCESS FULL | ED_VISITS | 25157 |    28M| 14530   (1)| 00:02:55 |  Q1,00 | PCWP |            |
    -----------------------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       5 - filter("FIRST_CONTACT_DT">=TRUNC(SYSDATE@!-11,'fmd'))

    This seems to change the plan to explain it...

    alter session set optimizer_index_cost_adj=10;
    
  • SQL Query Tuning (large table)

    Hi all

    Ask your help for Tuning below mentioned simple query.


    SELECT distinct BROKER_CODE FROM PROCESSED_TRXNS WHERE FOLIO_NO = '101302'

    Top query takes about 15 seconds to give the output.

    Explain the plan: -.

    Hash value of plan: 2775832988

    -----------------------------------------------------------------------------------------
    | ID | Operation | Name               | Lines | Bytes | Cost (% CPU). Time |
    -----------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT |                    |    29.   609 | 38241 (1) | 00:07:39 |
    |   1.  UNIQUE NOSORT FATE.                    |    29.   609 | 38241 (1) | 00:07:39 |
    |*  2 |   INDEX SKIP SCAN | PROCTRAN_BRC_FN_C1 |    29.   609 | 38240 (1) | 00:07:39 |
    -----------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):
    ---------------------------------------------------

    2 - access ("FOLIO_NO" = '101302')
    Filter ("FOLIO_NO" = '101302')


    Additional info: -.


    SELECT COUNT (1) IN PROCESSED_TRXNS - 135989170

    Composite index on BROKER_CODE, FOLIO_NO in the table

    The optimizer expects that the skip scan to take at 7:39 min - so the 15 sec are not so bad. And I'm sure that the operation is faster than a full Table Scan on PROCESSED_TRXNS. If you do not have a post adjustment index more then the skip scan might indeed be the best available strategy. I expect an index on PROCESSED_TRXNS (FOLIO_NO, BROKER_CODE) to be more effective for the query, because it should allow a range of index analysis which should read only the part of the index with the given FOLIO_NO. But create additional indexes will obviously slow down DML and could have an impact on other query execution plans (and not necessarily a positive impact).

  • A simple query with as wrong return result

    Hello

    I run a simple query with like.
    If I use the parameter I get incorrect results.
    If I use the request without parameter results are ok.

    My script:

    ALTER SESSION SET NLS_SORT = BINARY_CI;
    ALTER SESSION SET NLS_COMP = LINGUISTIC;

    -drop table abcd;
    create table abcd (col1 varchar2 (10));

    INSERT INTO VALUES ABCD ('122222');
    insert into abcd values ('111222');


    SELECT * FROM ABCD WHERE COL1 LIKE: 1. -bad result with 12%
    /*
    COL1
    ----------
    122222
    * 111222 *.
    */

    "Select * ABCD where col1 like 12%; -result ok
    /*
    COL1
    ----------
    122222
    */

    I use Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production
    and query, run in Oracle SQL Developer 3.1.07.

    I think it's just a bug, and it is set to 11.2.0.3:

    11.2.0.1:

    DB11.2.0.1>> select * from v$version where rownum=1;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    
    1 row selected.
    
    DB11.2.0.1>> ALTER SESSION SET NLS_SORT=BINARY_CI;
    
    Session altered.
    
    DB11.2.0.1>> ALTER SESSION SET NLS_COMP=LINGUISTIC;
    
    Session altered.
    
    DB11.2.0.1>> create table abcd (col1 varchar2(10));
    
    Table created.
    
    DB11.2.0.1>> INSERT INTO ABCD VALUES ('122222');
    
    1 row created.
    
    DB11.2.0.1>> insert into abcd values ('111222');
    
    1 row created.
    
    DB11.2.0.1>> VARIABLE A1 VARCHAR2(10);
    DB11.2.0.1>> EXEC :A1 := '12%';
    
    PL/SQL procedure successfully completed.
    
    DB11.2.0.1>> SELECT * FROM ABCD WHERE COL1 LIKE :A1;
    
    COL1
    ----------
    122222
    111222
    
    2 rows selected.
    

    11.2.0.3:

    DB11.2.0.3>> select * from v$version where rownum=1;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    
    1 row selected.
    
    DB11.2.0.3>> ALTER SESSION SET NLS_SORT=BINARY_CI;
    
    Session altered.
    
    DB11.2.0.3>> ALTER SESSION SET NLS_COMP=LINGUISTIC;
    
    Session altered.
    
    DB11.2.0.3>> create table abcd (col1 varchar2(10));
    
    Table created.
    
    DB11.2.0.3>> INSERT INTO ABCD VALUES ('122222');
    
    1 row created.
    
    DB11.2.0.3>> insert into abcd values ('111222');
    
    1 row created.
    
    DB11.2.0.3>> VARIABLE A1 VARCHAR2(10);
    DB11.2.0.3>> EXEC :A1 := '12%';
    
    PL/SQL procedure successfully completed.
    
    DB11.2.0.3>> SELECT * FROM ABCD WHERE COL1 LIKE :A1;
    
    COL1
    ----------
    122222
    
    1 row selected.
    

    Kind regards
    Sayan Malakshinov
    http://orasql.org

  • Load xml data into an Oracle table

    Hello

    I went through some threads in the forums itself, but for my requirement that nothing comes closer, I write my request. I have a XML like this
    <? XML version = "1.0"? >
    < ACCOUNT_HEADER_ACK >
    < HEADER >
    < STATUS_CODE > 100 < / STATUS_CODE >
    Check < STATUS_REMARKS > < / STATUS_REMARKS >
    < / Header >
    < DETAILS >
    < DETAIL >
    < SEGMENT_NUMBER > 2 < / SEGMENT_NUMBER >
    PR Polytechnic < REMARKS > < / COMMENTS >
    < / DETAILS >
    < DETAIL >
    < SEGMENT_NUMBER > 3 < / SEGMENT_NUMBER >
    < REMARKS > PR Polytechnic administration < / COMMENTS >
    < / DETAILS >
    < DETAIL >
    < SEGMENT_NUMBER > 4 < / SEGMENT_NUMBER >
    < REMARKS > rp Polytechnique finance < / COMMENTS >
    < / DETAILS >
    < DETAIL >
    < SEGMENT_NUMBER > 5 < / SEGMENT_NUMBER >
    < REMARKS > logistics Polytechnique rp < / COMMENTS >
    < / DETAILS >
    < / DETAILS >
    < HEADER >
    < STATUS_CODE > 500 < / STATUS_CODE >
    < STATUS_REMARKS > process exception < / STATUS_REMARKS >
    < / Header >
    < DETAILS >
    < DETAIL >
    < SEGMENT_NUMBER > 20 < / SEGMENT_NUMBER >
    Basic Polytechnique < REMARKS > < / COMMENTS >
    < / DETAILS >
    < DETAIL >
    < SEGMENT_NUMBER > 30 < / SEGMENT_NUMBER >
    < / DETAILS >
    < DETAIL >
    < SEGMENT_NUMBER > 40 < / SEGMENT_NUMBER >
    Finance basic Polytechnique < REMARKS > < / COMMENTS >
    < / DETAILS >
    < DETAIL >
    < SEGMENT_NUMBER > 50 < / SEGMENT_NUMBER >
    Logistics base Polytechnique < REMARKS > < / COMMENTS >
    < / DETAILS >
    < / DETAILS >
    < / ACCOUNT_HEADER_ACK >

    Here is the xml structure of the master structure and child I want to insert data in Oracle tables using the sql * loader initially tried to create a control file, but I don't know how to terminate in the control file, so I created two control files

    load data
    INFILE 'acct.xml' ' str ' < / DETAIL >»»
    TRUNCATE
    in the xxrp_acct_detail table
    TRAILING NULLCOLS
    (
    dummy fill finished by "< DETAIL >."
    SEGMENT_NUMBER surrounded by '< SEGMENT_NUMBER >' and ' < / SEGMENT_NUMBER >, "
    REMARKS framed by 'Of REMARKS <>' and ' < / COMMENTS >.
    )


    load data
    ACCT.XML INFILE' "str" < / header > ' "»
    TRUNCATE
    in the xxrp_acct_header table
    fields terminated by '< HEADER >.
    TRAILING NULLCOLS
    (
    dummy fill finished by "< HEADER >."
    STATUS_CODE framed by '< STATUS_CODE >' and ' < / STATUS_CODE >. "
    STATUS_REMARKS surrounded by '< STATUS_REMARKS >' and ' < / STATUS_REMARKS >.
    )

    I refer to the same xml file in two control files, where with regard to the first control file, I was able to load the files but the second which I suppose as table header not able to load the records of rest. I get the below error.

    Sheet 2: Rejected - error on the XXRP_ACCT_HEADER, column DUMMY table.
    Field in the data file exceeds the maximum length
    Sheet 3: Rejected - error on the XXRP_ACCT_HEADER, column DUMMY table.
    Field in the data file exceeds the maximum length

    In fact if its possible to seggrate a control file so it will be very useful for me. I'm also open for the external table as option. Please help me in this regard.

    Thanks in advance.

    Concerning
    Mr. Nagendra

    Here are two possible solutions:

    (1) reading the headers and separate details using two XMLTables:

    DECLARE
    
     acct_doc xmltype := xmltype( bfilename('TEST_DIR','acct.xml'), nls_charset_id('AL32UTF8') );
    
    BEGIN
    
     insert into xxrp_acct_details (status_code, status_remarks, segment_number, remarks)
     select x1.status_code,
            x1.status_remarks,
            x2.segment_number,
            x2.remarks
     from xmltable(
      '/ACCOUNT_HEADER_ACK/HEADER'
      passing acct_doc
      columns header_no      for ordinality,
              status_code    number        path 'STATUS_CODE',
              status_remarks varchar2(100) path 'STATUS_REMARKS'
     ) x1,
     xmltable(
      '$d/ACCOUNT_HEADER_ACK/DETAILS[$hn]/DETAIL'
      passing acct_doc as "d",
              x1.header_no as "hn"
      columns segment_number number        path 'SEGMENT_NUMBER',
              remarks        varchar2(100) path 'REMARKS'
     ) x2
     ;
    
    END;
    

    All first (alias X 1) retrieves all headers in separate lines. The HEADER_NO generated column is used to keep track of the position of the header into the document.
    Then, we join a second XMLTable (X 2), passing HEADER_NO, so that we can access the corresponding items in DETAIL.

    (2) reading with one XMLTable, but somewhat more complex XQuery:

    DECLARE
    
     acct_doc xmltype := xmltype( bfilename('TEST_DIR','acct.xml'), nls_charset_id('AL32UTF8') );
    
    BEGIN
    
     insert into xxrp_acct_details (status_code, status_remarks, segment_number, remarks)
     select x.*
     from xmltable(
      'for $i in /ACCOUNT_HEADER_ACK/HEADER
       return
        for $j in $i/following-sibling::DETAILS[1]/DETAIL
        return element r {$i, $j}'
      passing acct_doc
      columns status_code    number        path 'HEADER/STATUS_CODE',
              status_remarks varchar2(100) path 'HEADER/STATUS_REMARKS',
              segment_number number        path 'DETAIL/SEGMENT_NUMBER',
              remarks        varchar2(100) path 'DETAIL/REMARKS'
     ) x
     ;
    
    END;
    

    Here, we use an XQuery query to extract the information that we need.
    Basically it's the same logic as above, but with two nested loops which access each header, then each RETAIL location immediately after in the order of the documents.

    Here is the link to the documentation XMLTable and XQuery in Oracle:
    http://download.Oracle.com/docs/CD/B28359_01/AppDev.111/b28369/xdb_xquery.htm#CBAGCBGJ

  • an oracle DB for oracle table another transformation table DB. ODI11g

    Hello
    My source table and target tables are in different oracle 11g database servers (Instance Source and target are in different servers).
    All my connections to database server successful.
    I use more KMs.
    To check
    CKM SQL
    for loading
    LKM SQL to Oracle.
    For the integration
    IKM Oracle incremental update.
    I get the error after execution of the interface.

    ODI-1217: NGP_INT1 Session (28001) fails with return code 955.
    ODI-1226: NGP_INT1 step fails after 1 attempt.
    ODI-1240: Debit NGP_INT1 fails during a load operation. This flow of charge table target STAGE_COUNTRY_MASTER.
    ODI-1228: SrcSet0255 (load) task fails on ORACLE REV_TRG1 connection target.
    Caused by: java.sql.SQLSyntaxErrorException: ORA-00955: name is already used by an existing object

    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:91)
    at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1035)
    at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:194)
    at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:953)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1224)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3386)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3467)
    at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate(OraclePreparedStatementWrapper.java:1350)
    at com.sunopsis.sql.SnpsQuery.executeUpdate(SnpsQuery.java:665)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.executeUpdate(SnpSessTaskSql.java:3218)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execStdOrders(SnpSessTaskSql.java:1785)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java:2805)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2515)
    at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:534)
    at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:449)
    at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:1954)
    to oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$ 2.doAction(StartSessRequestProcessor.java:322)
    at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:224)
    at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:246)
    to oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$ 0 (StartSessRequestProcessor.java:237)
    to oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$ StartSessTask.doExecute (StartSessRequestProcessor.java:794)
    at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:114)
    to oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$ 2.run(DefaultAgentTaskExecutor.java:82)
    at java.lang.Thread.run(Thread.java:619)

    Even after changing KMs for CKM SQL, SQL to SQL LKM, IKM SQL ADD CONTROL. I get the same error.

    Please help me.

    Hello

    It is a common mistaken so nothing to worry about...

    Connect to Oracle with Sql * more or Toad or any other sql client tool
    For the query stuck by you it seems that your scheme of work is FCUBSITSUPP1

    GoTo this scheme and the number of the order
    DROP SYNONYM

    Once this synonym is deleted, go and run your ODI interface

    Thank you
    Fati

  • Formate LKM support of Oracle (TABLE EXTRENAL) data LENGTH FIXED files?

    Hi all

    I'm working on a simple test to create an external table using the "LKM to Oracle (TABLE EXTRENAL)" file to load a data file of fixed length (no separator/delimiter). After running, the error is as follows:

    2009-11-23 07:26:02 PM (DwgCmdExecutionThread): SnpSessTask.treatSqlException: 29913: 99999: java.sql.SQLException: ORA-29913: error in executing ODCIEXTTABLEOPEN legend
    ORA-29400: data cartridge error
    KUP-00554: error occurred when parsing the access settings
    KUP-01005: syntax error: found 'colon': expected an of: "asterisk, number.
    KUP-01007: in the column of the row 12 28

    java.sql.SQLException: ORA-29913: error in executing ODCIEXTTABLEOPEN legend
    ORA-29400: data cartridge error
    KUP-00554: error occurred when parsing the access settings
    KUP-01005: syntax error: found 'colon': expected an of: "asterisk, number.
    KUP-01007: in the column of the row 12 28


    The external table creation code generated is:

    «"createTblCmd = r»»»
    create the table ODI_WORK_SCHEMA. C$ _0PARTIAL_SHPT_TMP
    (
    C1_RECORD_TYPE VARCHAR2 (2),
    C2_ISN VARCHAR2 (8).
    C3_AWB_UID VARCHAR2 (11),
    C4_FLIGHT_ID VARCHAR2 (7).
    C5_FLIGHT_DATE VARCHAR2 (8).
    C6_AIRCRAFT_FLOW_TYPE VARCHAR2 (1).
    C7_PORT_CODE VARCHAR2 (3),
    C8_SHPT_BD_PIECES VARCHAR2 (5).
    C9_SHPT_BD_WEIGHT VARCHAR2 (9).
    C10_SHPT_MAN_PIECES VARCHAR2 (5).
    C11_SHPT_MAN_WEIGHT VARCHAR2 (9).
    C12_SHPT_MAN_VOLUME VARCHAR2 (12)
    )
    EXTERNAL ORGANIZATION
    (
    TYPE ORACLE_LOADER
    Dat_dir default DIRECTORY
    ACCESS SETTINGS
    (
    RECORDS DELIMITED BY 0 x '0D0A '.
    CHARACTERSET "WE8ISO8859P1".
    STRING SIZES ARE IN CHARACTERS
    BADFILE "PARTIAL_SHPT_FIXED_NHF.dat_%a.bad."
    LOGFILE "PARTIAL_SHPT_FIXED_NHF.dat_%a.log".
    DISCARDFILE 'PARTIAL_SHPT_FIXED_NHF.dat_%a.dsc '.
    SKIP 0

    FIELDS
    MISSING FIELD VALUES ARE NULL
    (
    C1_RECORD_TYPE POSITION (:),
    C2_ISN POSITION (:),
    C3_AWB_UID POSITION (:),
    C4_FLIGHT_ID POSITION (:),
    C5_FLIGHT_DATE POSITION (:),
    C6_AIRCRAFT_FLOW_TYPE POSITION (:),
    C7_PORT_CODE POSITION (:),
    C8_SHPT_BD_PIECES POSITION (:),
    C9_SHPT_BD_WEIGHT POSITION (:),
    C10_SHPT_MAN_PIECES POSITION (:),
    C11_SHPT_MAN_WEIGHT POSITION (:),
    C12_SHPT_MAN_VOLUME POSITION (:)
    )
    )
    LOCATION ("PARTIAL_SHPT_FIXED_NHF.dat")
    )
    PARALLEL
    REJECT LIMIT UNLIMITED
    """

    # Create the statement
    mystmt = myCon.createStatement)

    # Run the trigger creation
    myStmt.execute (createTblCmd)

    myStmt.close)
    mystmt = None

    # Commit, just in case
    myCon.commit)

    1. How can I solve this problem?
    2. If my data file have no record separator and the field delimiter, how do I configure in sub ODI?

    Remarks:

    1. the format of file under the "files" is "fixed".


    Thank you very much!!

    Tao

    Tao,

    Your problem is not LKM(External Table). You will need to set the interface diagram. Select each column in the pane "DataStore target" of the "Diagram" tab when you open the interface.
    Mark "run" for each column to be on the "staging area".
    Currently, you have all the columns marked in 'Source '.

    This will fix the problem.

    Hope that helps.
    PS Don't forget to mark as good/useful solutions if you feel they were.

  • Insert data as XML into the Oracle Table

    Hi all

    I have a requirement where the data in XML format, and I need to insert into the Oracle Table. For example, I get XML data in the following format,
    < results >
    < row >
    < BANK_ACCOUNT_ID > 10010 < / BANK_ACCOUNT_ID >
    < BANK_ID > 300968 < / BANK_ID >
    Vision operations < LEGAL_ENTITY > < / LEGAL_ENTITY >
    < BANK_NAME > BofA < / BANK_NAME >
    < BANK_ACCOUNT_NUM > 10271-17621-619 < / BANK_ACCOUNT_NUM >
    < BANK_ACCOUNT_NAME > BofA-204 < / BANK_ACCOUNT_NAME >
    < BRANCH_NAME > New York < / BRANCH_NAME >
    USD < CURRENCY_CODE > < / CURRENCY_CODE >
    < BALANCE_DATE > 2007 - 11 - 09 < / BALANCE_DATE >
    < LEDGER_BALANCE > 432705900.56 < / LEDGER_BALANCE >
    < / row >
    < row >
    < BANK_ACCOUNT_ID > 10091 < / BANK_ACCOUNT_ID >
    < BANK_ID > 300984 < / BANK_ID >
    Vision industries < LEGAL_ENTITY > < / LEGAL_ENTITY >
    Barclay Bank < BANK_NAME > < / BANK_NAME >
    < BANK_ACCOUNT_NUM > 70986798 < / BANK_ACCOUNT_NUM >
    Bank Multi currency-626 < BANK_ACCOUNT_NAME > Barclays < / BANK_ACCOUNT_NAME >
    Reading < BRANCH_NAME > < / BRANCH_NAME >
    GBP < CURRENCY_CODE > < / CURRENCY_CODE >
    < BALANCE_DATE > 2007 - 11 - 14 < / BALANCE_DATE >
    < LEDGER_BALANCE > 24244085.24 < / LEDGER_BALANCE >
    < / row >
    < row >
    < BANK_ACCOUNT_ID > 10127 < / BANK_ACCOUNT_ID >
    < BANK_ID > 300968 < / BANK_ID >
    < LEGAL_ENTITY > SSC U.S. 01 < / LEGAL_ENTITY >
    < BANK_NAME > BofA < / BANK_NAME >
    < BANK_ACCOUNT_NUM > 4898744 < / BANK_ACCOUNT_NUM >
    < BANK_ACCOUNT_NAME > BofA SSC U.S. 02-7188 < / BANK_ACCOUNT_NAME >
    < BRANCH_NAME > New York < / BRANCH_NAME >
    USD < CURRENCY_CODE > < / CURRENCY_CODE >
    < BALANCE_DATE > 2007 - 11 - 28 < / BALANCE_DATE >
    < LEDGER_BALANCE > 10783815.28 < / LEDGER_BALANCE >
    < / row >
    < / results >

    I like to write PLSQL code that will receive these data with XML tags and insert it into the Oracle Table. Is this possible with built-in XML features provided in the Oracle database?

    Please Guide...

    Kind regards
    Priyanka

    But the problem is the file XML is to have the details of the records if you carefully observed the XML file. But by using more high statement select I get output in the following format.
    ORG_ID REQ_LINE PO_NUMBER EXPECTED_REC_QTY USER_NAME REQ_NUMBER
    204204 1444714450 11 64446445 11 OPERATIONSOPERATIONS

    The table has only one row, so you get a single row as output.
    I'm surprised that you find useful examples showing how to divide the data into several lines.

    (1) create the table with the following option, it will optimize the performance of storage and query for large XML documents:

    CREATE TABLE xxios_xml_data_test(xml_data XMLTYPE)
    XMLTYPE COLUMN xml_data STORE AS SECUREFILE BINARY XML
    ;
    

    (2) interview table with:

    SQL> select x.*
      2  from xxios_xml_data_test t
      3     , xmltable(
      4         '/Results/Row'
      5         passing t.xml_data
      6         columns ORG_ID           number       path 'ORG_ID'
      7               , REQ_NUMBER       number       path 'REQ_NUMBER'
      8               , REQ_LINE         number       path 'REQ_LINE'
      9               , PO_NUMBER        number       path 'PO_NUMBER'
     10               , EXPECTED_REC_QTY number       path 'EXPECTED_REC_QTY'
     11               , USER_NAME        varchar2(30) path 'USER_NAME'
     12       ) x
     13  ;
    
        ORG_ID REQ_NUMBER   REQ_LINE  PO_NUMBER EXPECTED_REC_QTY USER_NAME
    ---------- ---------- ---------- ---------- ---------------- ------------------------------
           204      14447          1       6444                1 OPERATIONS
           204      14450          1       6445                1 OPERATIONS
     
    
  • Cache Oracle Tables

    Hello gurus,

    We are building a new application and identified that some tables will be access very frequently. To decrease the I/O we intend to CACHE these tables. I don't know if we have made the right decision. My question what are the things you need to consider before caching of Oracle tables.

    Any help much appreciated. Thank you.
    select * from V$VERSION
    BANNER                                                                           -------------------------------------------------------------------------------- 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                                                         TNS for IBM/AIX RISC System/6000: Version 11.2.0.3.0 - Production                NLSRTL Version 11.2.0.3.0 - Production    

    OK, if you want to use multiple buffer pools and put these paintings in the pool of Dungeon?

    Why do you think that this will improve the performance? Oracle default algorithm for the dating of the blocks that are rarely used is good enough for most applications. Why do you believe that you can identify what blocks will be more benefits to cache better than Oracle? Why do you think that you wouldn't be better off giving any pool cache size KEEP you would give to the DEFAULT pool and let the algorithm of Oracle caching to cache everything that it determines is appropriate? It is possible that there is something that you know your application that allows you to make that kind of determination. But in the vast majority of cases I've seen, people who tried to do end up hurting performance at least a little bit because they forcing you Oracle to the margin at the age of the blocks that it would be beneficial to cache and it would benefit from aging on blocks.

    Do you understand the impact of the maintenance of the use of multiple buffer caches? If you use a recent version vaguely Oracle and by using the features of automatic memory management, Oracle does not automatically manage default buffer caches. That increases the likelihood that the use of default buffer caches is will create performance issues, because humans are much less effective to recognize and react to changes in memory usage and greatly increases the amount of monitoring and work that administrators must make on the system (which, in turn, increases the risk that they are making a mistake).

    Justin

  • Convert the SQL query to Oracle

    Hi all

    I have two SQL queries to create the table.

    Query1.

    CREATE TABLE [dbo]. [DocumentType] (
    [DocType] [varchar] (20) GATHER SQL_Latin1_General_CP1_CI_AS NOT NULL,.
    [SubCat] [varchar] (20) GATHER SQL_Latin1_General_CP1_CI_AS NOT NULL
    ) ON [PRIMARY]
    GO
    ALTER TABLE [dbo]. [DocumentType] ADD
    CONSTRAINT [PK_DocumentType] PRIMARY KEY CLUSTER
    (
    [DocType],
    [SubCat]) ON [PRIMARY]


    Query2.

    CREATE TABLE [dbo]. [SBU] (
    [SBU] [varchar] (51) GATHER SQL_Latin1_General_CP1_CI_AS NOT NULL
    ) ON [PRIMARY]
    GO
    ALTER TABLE [dbo]. [SBU] ADD
    [PK_SBU] CLUSTERED PRIMARY KEY CONSTRAINT
    (
    [SBU]
    ) ON [PRIMARY]

    What will be the query in Oracle?

    Please suggest!
    Kind regards
    Shah

    Query1.

    CREATE TABLE dbo. DocumentType)
    DocType varchar2 (20) NOT NULL,
    SubCat varchar (20) NOT NULL,
    CONSTRAINT PK_DocumentType PRIMARY KEY (DocType, SubCat)
    )
    /

    Query2.

    CREATE TABLE dbo. SBU)
    SBU varchar2 (51),
    CONSTRAINT PK_SBU PRIMARY KEY (UDF)
    )
    /

    It is useful for you?

    Published by: insa on June 12, 2012 22:42

  • Help to download the xml of the oracle table below

    Dear all,

    I tried best to download the below xml to oracle table but giving the link between the tables is very difficult for me. can someone help me to import the XML below for oracle table

    <? XML version = "1.0" encoding = "utf-8"? >
    < Claim.Submission xmlns:tns = "http://www.haad.ae/DataDictionary/CommonTypes" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi: noNamespaceSchemaLocation = "http://www.haad.ae/DataDictionary/CommonTypes/ClaimSubmission.xsd" >
    < header >
    MF65 < SenderID > < / SenderID >
    C014 < ReceiverID > < / ReceiverID >
    < TransactionDate > 03/12/2012 10:40 < / TransactionDate >
    < RecordCount > 1 < / RecordCount >
    < DispositionFlag > PRODUCTION < / DispositionFlag >
    < / header >
    < claim >
    < ID > 23112 / < ID >
    < MemberID > 100000874 < / MemberID >
    A022 < PayerID > < / PayerID >
    MF65 < ProviderID > < / ProviderID >
    < EmiratesIDNumber > 111-1111-1111111-1 < / EmiratesIDNumber >
    < raw > 115 < / gross >
    < PatientShare > 20 < / PatientShare >
    < net > 95 < / Net >
    < meeting >
    MF65 < FacilityID > < / FacilityID >
    < type > 1 < / Type >
    < > 47685 PatientID < / PatientID >
    < Start > 02/11/2012 12:00 < / Start >
    < / meeting >
    < Diagnostics >
    Principal of < type > < / Type >
    < code > < code > 461.9
    < / Diagnosis >
    < Diagnostics >
    Secondary < type > < / Type >
    < code > < code > 462
    < / Diagnosis >
    < activity >
    23112_1 < ID > < /ID >
    < Start > 02/11/2012 12:00 < / Start >
    < type > 3 < / Type >
    < code > < code > 99202
    < quantity > 1 < / quantity >
    < net > 95 < / Net >
    D1310 < clinician > < / clinician >
    < / activity >
    < / claim >
    < Claim.Submission >

    Pls tell me how I can get

    Have you considered using the storage relational object for this?
    Since you have patterns, you could record in the database, which will automatically create storage appropriate for your XML documents as well as validate at the time of insertion.
    You can then create individual views to query the nested parts of the document and finally insert the data into relational tables final.

    See the documentation for an introduction to the concepts:
    http://docs.Oracle.com/CD/E11882_01/AppDev.112/e23094/partpg2.htm#g997354

    You will find examples on the {forum: id = 34} forum and its FAQ: {: identifier of the thread = 410714}

Maybe you are looking for

  • How to keep informed of future versions of Firefox (via electronic update)

    I would like to know when new versions are in Alpha or beta. Is there an email list that I can register?

  • Improve the Camileo S10

    I bought last year a Camileo S10. There are two not good question.Light sensitivity: with plain day I work well, but with the clear desk light or unclear orrible. is it possible to upgrade? Optics: it is quite a narrow profile. Is there a possibility

  • increase buffer size

    Hi all I am currently taking 6 pressure measurements, convert and then send HAVE up to 6 current AO, so I'll have continuous samples for each channel. I got error 200609, which wants to increase the size of buffer when buffer selected size: 1 and Min

  • Acer Tab 8 w Akku behavior

    Hallo, seit dem first Anschalten charges der Akku nicht richtig tablets. Netzbetrieb wurde erkannt, aber das war nicht possible (Anzeige "wird nicht aufgeladen") PARTY. Depending on der Akku leer und nach ob erfolglosen try war ERST mit different kla

  • U3415W bizarre tasks

    When it was my monitor on idle (the monitor turns off when I was not using computer for 5 minutes) for about 30 minutes and I start to use the computer again, there are a few bizarre tasks (or what ever it should be called), see screenshot. When the