Error while selecting  from nested table in PL/SQL block ............

SQL> create type string_table is table of varchar(100);
2 /
Type created.
declare
v_names string_table := string_table();
begin
v_names.EXTEND(3);
v_names(1) := 'name1';
v_names(2) := 'name2';
v_names(3) := 'name3';
dbms_output.put_line(v_names(1));
dbms_output.put_line(v_names(2));
dbms_output.put_line(v_names(3));
dbms_output.put_line(v_names.COUNT());
select * from table(v_names);
end;
select * from table(v_names);
ERROR at line 12:
ORA-06550: line 12, column 7:
PLS-00428: an INTO clause is expected in this SELECT statement

select * from table(v_names);
I guess ,here you were trying to put the content of the NT into another NT, or just trying to print it.
But, I don't think INTO Clause is mandatory here.
Please check your modified code (w/o INTO) and the output :
DECLARE
   TYPE string_table IS TABLE OF VARCHAR (100);
   v_names   string_table := string_table ();
   v_test    string_table := string_table ();
BEGIN
   v_names.EXTEND (3);
   v_names (1) := 'name1';
   v_names (2) := 'name2';
   v_names (3) := 'name3';
   DBMS_OUTPUT.put_line ('Old collection - '||v_names (1));
   DBMS_OUTPUT.put_line ('Old collection - '||v_names (2));
   DBMS_OUTPUT.put_line ('Old collection - '||v_names (3));
   DBMS_OUTPUT.put_line ('Old collection - '||v_names.COUNT ());
   DBMS_OUTPUT.put_line (CHR(10));
   /* SELECT * FROM TABLE (v_names); */
   v_test := v_names;
   DBMS_OUTPUT.put_line ('New collection -- '||v_test (1));
   DBMS_OUTPUT.put_line ('New collection -- '||v_test (2));
   DBMS_OUTPUT.put_line ('New collection -- '||v_test (3));
   DBMS_OUTPUT.put_line ('New collection -- '||v_test.COUNT ());
   DBMS_OUTPUT.put_line (CHR(10));
   /* Printing using FOR LOOP */
   FOR i IN v_test.FIRST..v_test.LAST
   LOOP
     DBMS_OUTPUT.put_line ('In FOR Loop --- '||v_test (i));
   END LOOP;
EXCEPTION
   WHEN OTHERS
   THEN
      DBMS_OUTPUT.put_line ('Error ' ||SQLERRM|| DBMS_UTILITY.format_error_backtrace);
END;gives o/p :
Old collection - name1
Old collection - name2
Old collection - name3
Old collection - 3
New collection -- name1
New collection -- name2
New collection -- name3
New collection -- 3
In FOR Loop --- name1
In FOR Loop --- name2
In FOR Loop --- name3Refer this link -- http://docs.oracle.com/cd/E11882_01/appdev.112/e17126/tuning.htm#CIHGGBGF
Edited by: ranit B on Dec 26, 2012 2:29 PM
-- code modified
Edited by: ranit B on Dec 26, 2012 2:45 PM
-- code 'again' updated -- FOR LOOP added

Similar Messages

  • XML parsing failed while select from my table with criteria

    While select from my table an error displayed as
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00601: Invalid token in: '/<XML Path>/row[c24="SA0010001"]'
    select * from category
    where existsNode(xmlrecord, '/<XML Path>/row[c24="SA0010001"]') = 1;
    xmlrecord
    <row id="52843" xml:space="preserve">
    <c1>Refund of Domestic Payment Order</c1>
    <c2>Ref Dom Py Or</c2>
    <c3>PLsql</c3>
    <c20>1</c20>
    <c21>62_TAABSINPUTT___OFS_TAABS</c21>
    <c22>0803181605</c22>
    <c23>62_TAABSINPUTT_OFS_TAABS</c23>
    <c24>SA0010001</c24>
    <c25>1</c25>
    </row>

    Hi,
    Did you copy that sample from some demo?
    The part "<XML Path>" is meant to be replaced by a real XPath fragment.
    Here, I think you may just want this :
    select * from category
    where existsNode(xmlrecord, '/row[c24="SA0010001"]') = 1;Edit : OK, just seen your previous post and the example given
    Edited by: odie_63 on 6 juil. 2010 21:16

  • Select from nested table in a nested table security problem

    please help
    running Oracle 9.2.0.3.0 on RH AS 2.1
    I can select the inner most nested table as the creator, but can't use the same select statement as USER2.
    ORA-00942: table or view does not exist
    -- begin make of objects and tables
    create or replace type mydata_t as object ( x float, y float);
    create or replace type mydata_tab_t as table of mydata_t;
    create or replace type mid_t as object (
         graphname varchar2(12),
         datapoints mydata_tab_t );
    create or replace type mid_tab_t as table of mid_t;
    create or replace type top_t as object (
         someinfo int,
         more_mid     mid_tab_t );
    create table xyz (
         xyzPK int,
         mainstuff     top_t )
         nested table mainstuff.more_mid store as mid_nt_tab
              (nested table datapoints store as mydata_nt_tab)
    -- grants
    grant all on mydata_t to user2;
    grant all on mydata_tab_t to user2;
    grant all on mid_t to user2;
    grant all on mid_tab_t to user2;
    grant all on top_t to user2;
    grant all on xyz to user2;
    -- insert
    insert into xyz values (1, top_t(22,mid_tab_t(mid_t('line1',mydata_tab_t(
    mydata_t(0,0),
    mydata_t(15,15),
    mydata_t(30,30))))));
    commit;
    -- select fails as user2
    select * from table(select Y.datapoints as DP_TAB
         from table(select X.mainstuff.more_mid as MORE_TAB
              from scott.xyz X
              where X.xyzPK=1) Y
         where Y.graphname='line1') Z;
    -- select works as user2, but i need individual lines
    select Y.datapoints as DP_TAB
         from table(select X.mainstuff.more_mid as MORE_TAB
              from scott.xyz X
              where X.xyzPK=1) Y
         where Y.graphname='line1';

    Thank you for your reply.
    I have tried
    select value(t) from table t;
    but it is still not working. I got almost the same answer as before.
    Anyway thank you very much again.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by MARCELO OCHOA ([email protected]):
    Originally posted by meimei wu ([email protected]):
    [b]I created a nested object-relational table using REF type in oracle8i. when I tried to select * from the table, I got lots of number as the ref type values, but actually, the value in ref type should be of type varchar2 and number. The number I got looked like following code:
    JARTICLE_REF_TYPE(000022020876108427C2FE0D00E0340800208FD71F76103B99B12009C0E0340800208FD71F,
    Does anyone know how I can get the actual value that I inserted into the nested table?
    your help is appreciated.<HR></BLOCKQUOTE>
    Try this:
    select value(t) from table t;
    Best regards, Marcelo.
    null

  • Value select from nested table

    CREATE TYPE test AS OBJECT (
    test1 varchar2(10),
    test2 varchar2(10));
    create or replace type test2 as table of test;
    two record are there within object type.then how i will select value from nested table.

    How many times are you going to ask this question before you either look at the response I have given to Re: how i will display type like (nestedtable or varrays or pl/sql table).?
    You have posted often enough to this forum to know the ettiquette by now.
    Regards, APC

  • Getting an error while selecting from table having CLOB column.

    Hi All,
    I have below table created in My oracle database version Oracle Database 11g Enterprise Edition Release 11.2.0.1.0.
    CREATE TABLE my_clob -- Dummy table created
    (DataBody CLOB);
    Current Database Character set - WE8MSWIN1250.
    On the front end of my application, I have one form through which I can save/edit data in the above table. If I'm creating one new entry in the above table then it first check with existing record to avoid the duplicate entry and the this point application create the below select statement on the above table and return the error "ORA-00932: inconsistent data types: expected - got CLOB".
    I can not change the sql statement.
    SELECT * FROM my_clob WHERE databody IS NULL OR databody ='';
    Even when I run the same statement on my DB server I’m getting the same error. Shown below
    SQL> SELECT * FROM my_clob WHERE databody IS NULL OR databody ='';
    SELECT * FROM my_clob WHERE databody IS NULL OR databody =''
    ERROR at line 1:
    ORA-00932: inconsistent datatypes: expected - got CLOB
    SQL>
    Is there anything with OraOLEDB which causing this error? Please help me out to get rid of this error.
    Thanks,
    Santosh

    You cannot compare directly a CLOB column with a VARCHAR2 column. In your case you don't need to do such comparison because Oracle consider zero length strings as null values:
    SQL> create table my_clob(data int, databody clob);
    Table created.
    SQL> insert into my_clob values(1, null);
    1 row created.
    SQL> insert into my_clob values(2, '');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select * from my_clob where databody is null;
          DATA
    DATABODY
             1
             2About null values in Oracle, please read http://docs.oracle.com/cd/E11882_01/server.112/e26088/sql_elements005.htm#SQLRF30037.

  • Error while selecting from view that references external table

    Can someone explain why the error near the bottom of the code below is occuring? If USER1 grants SELECT on the external table to USER2, then USER2 can select from the view without any problems; however, I want to avoid giving USER2 access to all of the columns in the external table. (I only want to give USER2 access to two of the four columns.)
    SQL> CONNECT sys AS SYSDBA
    Connected as SYS@ as sysdba
    SQL> CREATE USER user1 IDENTIFIED BY user1
    User created.
    SQL> CREATE USER user2 IDENTIFIED BY user2
    User created.
    SQL> GRANT CONNECT, CREATE TABLE, CREATE VIEW TO user1
    Grant complete.
    SQL> GRANT CONNECT TO user2
    Grant complete.
    SQL> GRANT READ, WRITE ON DIRECTORY EXT_DATA_DIR TO user1, user2
    Grant complete.
    SQL> CONNECT user1/user1
    Connected as USER1@
    SQL> CREATE TABLE emp_xt
      emp_id     NUMBER,
      first_name VARCHAR2(30),
      last_name  VARCHAR2(30),
      phone      VARCHAR2(15)
    ORGANIZATION EXTERNAL
      TYPE ORACLE_LOADER
      DEFAULT DIRECTORY EXT_DATA_DIR
      ACCESS PARAMETERS
        RECORDS DELIMITED BY NEWLINE
        FIELDS TERMINATED BY ','
        OPTIONALLY ENCLOSED BY '"'           
      LOCATION ('emp.txt')
    REJECT LIMIT 0
    Table created.
    SQL> SELECT COUNT(1) FROM emp_xt
      COUNT(1)
             4
    1 row selected.
    SQL> CREATE OR REPLACE VIEW emp_xt_view AS SELECT first_name, last_name FROM emp_xt;
    View created.
    SQL> SELECT COUNT(1) FROM emp_xt_view
      COUNT(1)
             4
    1 row selected.
    SQL> GRANT SELECT ON emp_xt_view TO user2
    Grant complete.
    SQL> CONNECT user2/user2
    Connected as USER2@
    SQL> SELECT COUNT(1) from user1.emp_xt_view
    SELECT COUNT(1) from user1.emp_xt_view
    Error at line 0
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    ORA-04043: object "USER1"."EMP_XT" does not exist
    SQL> CONNECT user1/user1
    Connected as USER1@
    SQL> GRANT SELECT ON user1.emp_xt TO user2
    Grant complete.
    SQL> CONNECT user2/user2
    Connected as USER2@
    SQL> SELECT COUNT(1) from user1.emp_xt_view
      COUNT(1)
             4
    1 row selected.
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    user503699 wrote:
    user1983440 wrote:
    Can someone explain why the error near the bottom of the code below is occuring? If USER1 grants SELECT on the external table to USER2, then USER2 can select from the view without any problems; however, I want to avoid giving USER2 access to all of the columns in the external table. (I only want to give USER2 access to two of the four columns.)As you have demonstrated, I guess the view approach only works for database tables. External tables are actually files on the file system. Even through OS, it is not possible to grant READ/WRITE access to only part of the file. The access is for entire file. An "External Table" is just a "wrapper" provided by oracle (using data cartridge) to allow user to be able to access the file as a "table". So it can definitely not do something that underlying OS can not do.
    p.s. In fact, oracle does not even allow to edit data in external tables using SQL.Why not just make a second external table (only including the 2 columns you need) and grant select directly on that to the user. I know you say "views only" but there's an exception to every rule ... just because it's called a table doesn't make it so. You could argue an external table is nothing more than a fancy view.
    Worst case, make a view on top of the second external table.
    CREATE TABLE emp_xt_less_information
      first_name VARCHAR2(30),
      last_name  VARCHAR2(30)
    ORGANIZATION EXTERNAL
      TYPE ORACLE_LOADER
      DEFAULT DIRECTORY EXT_DATA_DIR
      ACCESS PARAMETERS
        RECORDS DELIMITED BY NEWLINE
        FIELDS TERMINATED BY ','
        OPTIONALLY ENCLOSED BY '"'   
             emp_id      number,
             first_name  char,
             last_name   char,
             phone       char
      LOCATION ('emp.txt')
    REJECT LIMIT 0
    {code}
    Should do it, but my syntax may be off a touch ....                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • KUP-04063: unable to open log file.. (while selecting from External table)

    Hi
    I am trying to craete an external table and then select the data from the table. However I am getting error while trying to select the data from external table.
    SQL>CREATE OR REPLACE DIRECTORY my_dir as 'C:\arun';
    Directory created.
    SQL>GRANT ALL ON DIRECTORY my_dir TO PUBLIC;
    Grant succeeded.
    SQL>DROP TABLE proj_checklists_external;
    Table dropped.
    SQL>CREATE TABLE proj_checklists_external
    2 ( checklist_submission_id NUMBER
    3 ,Lead_reviewer_name VARCHAR2(30)
    4 ,Lead_reviewer_corp_id VARCHAR2(10)
    5 ,creation_date VARCHAR2(10)
    6 ,submitted_dater VARCHAR2(10)
    7 ,approved_date VARCHAR2(10)
    8 ,status VARCHAR2(50)
    9 )
    10 ORGANIZATION EXTERNAL
    11 (
    12 TYPE ORACLE_LOADER
    13 DEFAULT DIRECTORY my_dir
    14 ACCESS PARAMETERS
    15 (
    16 RECORDS DELIMITED BY NEWLINE
    17 FIELDS TERMINATED BY ','
    18 )
    19 LOCATION ('Book1.txt')
    20 )
    21 PARALLEL 5
    22 REJECT LIMIT 200;
    Table created.
    SQL>SELECT * FROM proj_checklists_external;
    SELECT * FROM proj_checklists_external
    ERROR at line 1:
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04063: unable to open log file PROJ_CHECKLISTS_EXTERNAL_28484.log
    OS error No such file or directory
    ORA-06512: at "SYS.ORACLE_LOADER", line 14
    ORA-06512: at line 1
    I craeted an file PROJ_CHECKLISTS_EXTERNAL_28484.log also in C:\arun and then tried to select but still got same error.
    Any idea how to overcome this error.
    Regards
    Arun

    here you go:
    SQL> CREATE OR REPLACE DIRECTORY GRATIS_LOAD as 'D:\AdvSourceData\Membership\';
    Directory created
    SQL> GRANT ALL ON DIRECTORY GRATIS_LOAD to ADVROLE;
    Grant succeeded
    SQL>
    SQL> DROP TABLE MEMB_BATCH_LOAD_ID;
    Table dropped
    SQL> CREATE TABLE MEMB_BATCH_LOAD_ID (
    2 ID_NUMBER VARCHAR2(10),
    3 STATUS CHAR(1)
    4 )
    5 ORGANIZATION EXTERNAL
    6 ( TYPE ORACLE_LOADER
    7 DEFAULT DIRECTORY GRATIS_LOAD
    8 ACCESS PARAMETERS
    9 ( records delimited by NEWLINE
    10 fields (
    11 ID_NUMBER POSITION (1:10) CHAR,
    12 STATUS POSITION (11:1) CHAR
    13 )
    14 )
    15 LOCATION
    16 ( 'GRATISID.TXT'
    17 )
    18 );
    Table created
    SQL> select * from memb_batch_load_id;
    select * from memb_batch_load_id
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04063: unable to open log file MEMB_BATCH_LOAD_ID_1388_5552.log
    OS error The system cannot find the file specified.
    ORA-06512: at "SYS.ORACLE_LOADER", line 14
    ORA-06512: at line 1
    SQL>

  • Error while selecting from a view ORA-01031: Insufficient privileges

    As DBA I have granted select privileges on a view to a user, but whenever I login as that user and try to select from the view I get the message 'ORA-01031'. When I run the query in the view as the user I do not have problem and can see the results. This view joins tables from more than one schema and does a distinct on the resultset. I am new to Oracle and would appreciate any help I can get.
    Thanks

    Back on this problem when I created another user with select permission on the same view and a default role that has reference on all the objects on the other schemas, I end up with the same error message. Although this time the schema owner of the view has select privileges on all the tables from other schemas referenced in the view.
    Thanks

  • Select from nested table

    Hi,
    I create following types and table:
    CREATE OR REPLACE TYPE obj_query AS OBJECT
    (emp_id NUMBER(6)
    ,emp_first VARCHAR2(20)
    ,emp_last VARCHAR2(25));
    CREATE OR REPLACE TYPE tab_query AS TABLE OF obj_query;
    CREATE TABLE queryEmp
    (id_row NUMBER
    ,beginTrans VARCHAR2(15)
    ,queryA VARCHAR2(100)
    ,resultEmp tab_query)
    NESTED TABLE resultEmp
    STORE AS nested_queryEmp;
    I would like the output of the table queryEmp like this:
    id_row beginTrans queryA emp_id emp_first emp_last
    1 15:00 Select1 100 Joe King
    101 John Queen
    2 15:10 Select2 100 Leo King
    101 Mett Queen
    But Can I get this result with only SQL SELECT statement from this table?
    I don't want to use PL/SQL, only SELECT in SQL*Plus.
    Thank you
    I'm sorry but output looks so bad.
    So, I want to get the one row of id_row, beginTrans, queryA and all rows of nested table dmlStats to this "main" row and so on.
    But not in PL/SQL
    I hope, you understand me.
    Thanks
    Edited by: user9357436 on 2.11.2011 5:18
    Edited by: user9357436 on 2.11.2011 5:25

    Arvind Ayengar wrote:
    Can you please explain things in details, and just ensure you are in the correct forum.Is this reply directed at me or the OP?

  • Dulpicate entry occur while select from edidc table

    HI ,
    internal table I_edidc declare as unique key DOC_NUM while select the value from the edidc table on basis of status ,msgtyp,direct ,sndprt.sndprn ,updat, updtim,cretim,credat giving the duplicate entry dump some time .ANY suggestion

    Hi Prakash ,
    thanks for your replying internal table is refreshed i checked it during the debugging time and this issue not occurs frequently .I think the reason is when the idoc status changes from 51 to 53 it is picking up 51 entry and the same time it status changes to 53 it again tries to pick the same idoc with status 53 .Please correct me if i am wrong and please give your valuable suggestion .Below is the code
    SELECT docnum status direct rcvpor rcvprt rcvprn mescod mesfct sndpor
                     sndprt sndprn credat cretim mestyp idoctp cimtyp upddat updtim
                     FROM edidc INTO TABLE i_edidc
                          WHERE status IN s_status
                          AND   mestyp EQ g_msgtyp
                          AND   direct EQ l_direct
                          AND   sndprt IN s_sndprt
                          AND   sndprn IN s_sndprn
                          AND   credat IN s_credat
                          AND   cretim IN s_cretim
                          AND   upddat IN s_upddat
                          AND   updtim IN s_updtim.

  • Select from Function PIPELINED on PL/SQL Block

    Hi folks,
    I have a PL/SQL Block and I need this block to show me in a grid the rows from a variable table (Type table) that I have declared.
    I don´t want to create Database objects, that's why I haven´t created tableTest like a type object in the database.
    Example:
    Declare
    type tableTest is table of varchar2(500);
    function test(indName IN VARCHAR2) return tableTest PIPELINED as
    begin
    pipe row (indName);
    pipe row ('teste2');
    return
    end;
    begin
    -- HERE I NEED SHOW ROWS RETURNED BY FUNCTION WAS DECLARED;
    -- Select * from TABLE(test('NAME'));
    end;

    You declare a pipelined table function by specifying the PIPELINED keyword. Pipelined functions can be defined at the schema level with CREATE FUNCTION or in a package. The PIPELINED keyword indicates that the function returns rows iteratively. The return type of the pipelined table function must be a supported collection type, such as a nested table or a varray. This collection type can be declared at the schema level or inside a package. Inside the function, you return individual elements of the collection type. The elements of the collection type must be supported SQL datatypes, such as NUMBER and VARCHAR2. PL/SQL datatypes, such as PLS_INTEGER and BOOLEAN, are not supported as collection elements in a pipelined function.
    http://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/b14261/tuning.htm

  • Data Mismatch while selecting from External Table

    Hi I am not able create an external table,I am trying to create and test table and able to create but when i selecting the data it showing data mismatch.I tried for an test data but it returned error.I want to load from an excel file saved as test.csv
    CREATE TABLE Per_ext
    CITY VARCHAR2(30),
    STATE VARCHAR2(20),
    ZIP VARCHAR2(10),
    COUNTRY VARCHAR2(30)
    ORGANIZATION EXTERNAL
    TYPE ORACLE_LOADER
    DEFAULT DIRECTORY dataload
    ACCESS PARAMETERS
    MISSING FIELD VALUES ARE NULL
    LOCATION ('test.csv')
    REJECT LIMIT UNLIMITED;
    test.csv file contents
    city ----------     state---------Zip------------country
    Bombay-----     MH------------34324-------india
    london-------London------1321---------UK
    Pune---------MH------------3224---------india
    Banglore----     Karnataka---11313-------india
    rgds
    soumya

    Hi Justin
    I am getting following error when i trying from toad
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-00554: error encountered while parsing access parameters
    KUP-01005: syntax error: found "comma": expecting one of: "badfile, byteordermark, characterset, column, data, delimited, discardfile, exit, fields, fixed, load, logfile, language, nodiscardfile, nobadfile, nologfile, date_cache, processing, readsize, string, skip, territory, variable"
    KUP-01007: at line 1 column 29
    ORA-06512: at "SYS.ORACLE_LOADER", line 19
    rgds
    soumya

  • Error while selecting from sequence

    Hi,
    select seq_empid.nextval from dual;
    when selecting this from Java code it is giving error "table or view does not exist"..
    can anybody pls guide me as to what possible reasons could be for the error?
    thx

    are you using different user acct when using it from java? i think it migth be privilege issue.

  • Error while selecting date from external table

    Hello all,
    I am getting the follwing error while selecting data from external table. Any idea why?
    SQL> CREATE TABLE SE2_EXT (SE_REF_NO VARCHAR2(255),
      2        SE_CUST_ID NUMBER(38),
      3        SE_TRAN_AMT_LCY FLOAT(126),
      4        SE_REVERSAL_MARKER VARCHAR2(255))
      5  ORGANIZATION EXTERNAL (
      6    TYPE ORACLE_LOADER
      7    DEFAULT DIRECTORY ext_tables
      8    ACCESS PARAMETERS (
      9      RECORDS DELIMITED BY NEWLINE
    10      FIELDS TERMINATED BY ','
    11      MISSING FIELD VALUES ARE NULL
    12      (
    13        country_code      CHAR(5),
    14        country_name      CHAR(50),
    15        country_language  CHAR(50)
    16      )
    17    )
    18    LOCATION ('SE2.csv')
    19  )
    20  PARALLEL 5
    21  REJECT LIMIT UNLIMITED;
    Table created.
    SQL> select * from se2_ext;
    SQL> select count(*) from se2_ext;
    select count(*) from se2_ext
    ERROR at line 1:
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04043: table column not found in external source: SE_REF_NO
    ORA-06512: at "SYS.ORACLE_LOADER", line 19

    It would appear that you external table definition and the external data file data do not match up. Post a few input records so someone can duplicate the problem and determine the fix.
    HTH -- Mark D Powell --

  • Error while selecting data for mara table from KOTG516 table

    Hello all,
    I am trying to select the data from mara table with respect to KOTG516 table . but i am not getting the value into t_mara table as t_kotg516-matnr is empty . but the t_kotg516 conatins the matnr value . here is the code . i am not getting where i went wrong . please help .
    TYPES: BEGIN OF Y_KOTG516,
            KAPPL TYPE KAPPL,
            KSCHL TYPE KSCHG,
            VKORG TYPE VKORG,
            VTWEG TYPE VTWEG,
            KUNAG TYPE KUNAG,
            MATNR TYPE MATNR,
            DATBI TYPE KODATBI,
          END OF Y_KOTG516.
    DATA: T_KOTG516 TYPE STANDARD TABLE OF Y_KOTG516,
          E_KOTG516 TYPE Y_KOTG516.
    TYPES: BEGIN OF Y_MARA,
            MATNR TYPE MATNR,
            MEINS TYPE MEINS,
          END OF Y_MARA.
    DATA: T_MARA TYPE STANDARD TABLE OF Y_MARA,
          E_MARA TYPE Y_MARA.
        SELECT KAPPL
               KSCHL
               VKORG
               VTWEG
               KUNAG
               MATNR
               DATBI
         FROM KOTG516
         INTO TABLE T_KOTG516
       WHERE VKORG IN S_VKOR
         AND VTWEG IN S_VTWE
         AND KUNAG IN S_KUNAG.
            IF NOT T_KOTG516[] IS NOT INITIAL
                    and SY-SUBRC EQ 0.
              SELECT MATNR
                     MEINS
                FROM MARA
                INTO TABLE T_MARA
               FOR ALL ENTRIES IN T_KOTG516
               WHERE MATNR EQ T_KOTG516-MATNR
                 AND MEINS EQ 'CS'
                  OR MEINS EQ 'IT'.
              ENDIF.
      FOR T_KOTG516 I HAVE VALUE but matnr is not getting selected from mara table as i cheked t_kotg516-mara is empty . i cant use with header line . please advise .
    Regards

    hi,
    SELECT KAPPL
                 KSCHL
                  VKORG
                 VTWEG
                KUNAG
               MATNR
                DATBI
               FROM KOTG516
              INTO TABLE T_KOTG516
              WHERE VKORG IN S_VKOR
               AND VTWEG IN S_VTWE
                 AND KUNAG IN S_KUNAG.
    if sy-subrc = 0 .
    SELECT MATNR
    MEINS
    FROM MARA
    INTO TABLE T_MARA
    FOR ALL ENTRIES IN T_KOTG516
    WHERE MATNR EQ T_KOTG516-MATNR
    AND MEINS EQ 'CS'
    OR MEINS EQ 'IT'.
    ENDIF.
    regards
    deepak .

Maybe you are looking for

  • How to fix the above mentioned, *"special Incoming Closed margins"*.

    Valuation runs (TPM1) fails with the error below: Unfixed bus. trans. with posting date 02/23/2012 before key date (long text) Message no. TPM_TLV1028 Diagnosis The position that is to be valued contains a position-relevant business transaction Close

  • How to set a pixel to certain value in a Graphic object.

    Hello Every One I want to set a certain point in a graphic context to a new Color value let say i have a point (x, y)=(100, 100) and i have a JFrame window i can do like this Graphics g = getGraphics(); Now i want to set the point(100, 100) to a new

  • Mass generation program in ABAP! Please help.

    Hello All:       I have a list of COPA programs that use some internal tables whose structures have been changed from 4.6C to ECC6.0. When I go to transaction KE30 it shows the list of reports and I have to select one at a time and click on program -

  • Questions about smart objects in CS3-CS5.

    Hi. Two questions. When I replace content of smart object in CS2 the content takes the size of previous state of smart object in pixels. It was very useful when need to replace some background to another and it autoresized to the new size and proport

  • HR table storing I/O number

    Hi, When I enter PA30 infotype 2010 and 0015, I also fill in the cost assignment. But when I check on table PA2010 or PA0015, the cost assignment is not included. Is there any other table linked to this ? Thanks, Melissa