While creating external table getting KUP-01005 error

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 "identifier": expecting one of: "badfile, byteord
ermark, characterset, colon

Post the Create statement.

Similar Messages

  • Error while creating external table

    Hi i tried to create external table. The table is created but while selecting that table it is throwing below errors
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04040: file Countries1.txt in EXT_TABLES not found
    ORA-06512: at "SYS.ORACLE_LOADER", line 19I've created temp directory in window under oracle directory " C:\oracle\product\10.2.0\temp"
    In the temp directory i've a text file countries1.txt
    the text file has the below information
    ENG,England,English
    SCO,Scotland,English
    IRE,Ireland,English
    WAL,Wales,WelshI've connected to system user and created one directory and granted the read and write permissions to user SCOTT.
    SQL> create or replace directory ext_tables as 'C:\oracle\product\10.2.0\temp\';
    Directory created.
    SQL> grant read,write on directory ext_tables to scott;
    Grant succeeded.The creation of external table query is
    CREATE TABLE countries_ext (
      country_code      VARCHAR2(5),
      country_name      VARCHAR2(50),
      country_language  VARCHAR2(50)
    ORGANIZATION EXTERNAL (
      TYPE ORACLE_LOADER
      DEFAULT DIRECTORY ext_tables
      ACCESS PARAMETERS (
        RECORDS DELIMITED BY NEWLINE
        FIELDS TERMINATED BY ','
        MISSING FIELD VALUES ARE NULL
          country_code      CHAR(5),
          country_name      CHAR(50),
          country_language  CHAR(50)
      LOCATION ('Countries1.txt')
    PARALLEL 5
    REJECT LIMIT UNLIMITED;And the error is
    SQL> select *from countries_ext;
    select *from countries_ext
    ERROR at line 1:
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04040: file Countries1.txt in EXT_TABLES not found
    ORA-06512: at "SYS.ORACLE_LOADER", line 19
    SQL> Please help me in this

    You are missing something. Most probably the file does not exists in your specified path. This is working in my 10.2.0.3
    Step1: Check the file is actually there.
    C:\oracle\product\10.2.0>mkdir temp
    C:\oracle\product\10.2.0>cd temp
    C:\oracle\product\10.2.0\temp>dir
    Volume in drive C is C_Drive
    Volume Serial Number is 8A93-1441
    Directory of C:\oracle\product\10.2.0\temp
    07/30/2011  12:00 PM    <DIR>          .
    07/30/2011  12:00 PM    <DIR>          ..
    07/30/2011  12:00 PM                79 countries1.txt
                   1 File(s)             79 bytes
                   2 Dir(s)  50,110,582,784 bytes free
    C:\oracle\product\10.2.0\temp>type countries1.txt
    ENG,England,English
    SCO,Scotland,English
    IRE,Ireland,English
    WAL,Wales,Welsh
    C:\oracle\product\10.2.0\temp>Step 2: Creating the directory object.
    SQL> show user
    USER is "SYS"
    SQL> SELECT * FROM v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    SQL> create or replace directory ext_tables as 'C:\oracle\product\10.2.0\temp';
    Directory created.
    SQL> grant read,write on directory ext_tables to scott;
    Grant succeeded.
    SQL>Step 3: Table definition.
    C:\>sqlplus scott@orclsb/tiger
    SQL*Plus: Release 10.1.0.4.2 - Production on Sat Jul 30 12:04:24 2011
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL> CREATE TABLE countries_ext (
      2    country_code      VARCHAR2(5),
      3    country_name      VARCHAR2(50),
      4    country_language  VARCHAR2(50)
      5  )
      6  ORGANIZATION EXTERNAL (
      7    TYPE ORACLE_LOADER
      8    DEFAULT DIRECTORY ext_tables
      9    ACCESS PARAMETERS (
    10      RECORDS DELIMITED BY NEWLINE
    11      FIELDS TERMINATED BY ','
    12      MISSING FIELD VALUES ARE NULL
    13      (
    14        country_code      CHAR(5),
    15        country_name      CHAR(50),
    16        country_language  CHAR(50)
    17      )
    18    )
    19    LOCATION ('Countries1.txt')
    20  )
    21  PARALLEL 5
    22  REJECT LIMIT UNLIMITED;
    Table created.
    SQL> SELECT * FROM countries_ext;
    COUNT COUNTRY_NAME
    COUNTRY_LANGUAGE
    ENG   England
    English
    SCO   Scotland
    English
    IRE   Ireland
    English
    COUNT COUNTRY_NAME
    COUNTRY_LANGUAGE
    WAL   Wales
    Welsh

  • Syntax Error, while Creating External Table

    Hi,
    Can anyone tell this Syntax is correct or not. And how it look like:
    CREATE TABLE emp_load (T_DATE DATE NOT NULL,
    T_NO DOUBLE PRECISION,
    T_TYPE CHAR(1),
    T_CO VARCHAR(30),
    T_CONTRACT DOUBLE PRECISION,
    T_PARTY VARCHAR(15),
    T_BILL_NO DOUBLE PRECISION,
    T_BILL_DATE DATE,
    T_QTY DOUBLE PRECISION,
    T_RATE DOUBLE PRECISION,
    T_BKG DOUBLE PRECISION NOT NULL,
    T_TAX DOUBLE PRECISION,
    T_OTHER DOUBLE PRECISION,
    T_DIV DOUBLE PRECISION,
    T_STAMPS DOUBLE PRECISION,
    T_DC_NO DOUBLE PRECISION,
    T_SPOT CHAR(2),
    T_CITY VARCHAR(3),
    T_ORDER DOUBLE PRECISION,
    T_TRADE DOUBLE PRECISION,
    T_TIME DATE,
    T_FORM CHAR(1),
    HEADER VARCHAR(2),
    T_DC_DATE DATE,
    T_POD VARCHAR(30),
    T_POD_DATE DATE,
    T_SET INTEGER,
    T_MARGIN DOUBLE PRECISION NOT NULL WITH DEFAULT,
    T_MKT_TYPE VARCHAR(3) NOT NULL,
    T_MEMBER_CODE VARCHAR(15),
    T_EXIM SMALLINT,
    T_P VARCHAR(15),
    T_C VARCHAR(30),
    T_TERM VARCHAR(8),
    T_CUST VARCHAR(12),
    T_SUBBKG DOUBLE PRECISION,
    T_BILL_TYPE VARCHAR(1),
    T_OPN_CLS DOUBLE PRECISION,
    T_AUCTION DOUBLE PRECISION,
    T_BRANCH VARCHAR(8),
    T_UNQID VARCHAR(20),
    T_SQ SMALLINT,
    T_CBKG DOUBLE PRECISION,
    T_COTHER DOUBLE PRECISION,
    T_MOD DATE,
    T_ORIG_CUST VARCHAR(20),
    T_TOT DOUBLE PRECISION,
    T_FIRM SMALLINT,
    T_ORDER_TIME DATE,
    T_NON_MT SMALLINT)
    ORGANIZATION EXTERNAL (TYPE ORACLE_LOADER DEFAULT DIRECTORY ext_tab_dir
    ACCESS PARAMETERS (RECORDS FIXED 62 FIELDS (T_DATE DATE NOT NULL,
    T_NO DOUBLE PRECISION,
    T_TYPE CHAR(1),
    T_CO VARCHAR(30),
    T_CONTRACT DOUBLE PRECISION,
    T_PARTY VARCHAR(15),
    T_BILL_NO DOUBLE PRECISION,
    T_BILL_DATE DATE,
    T_QTY DOUBLE PRECISION,
    T_RATE DOUBLE PRECISION,
    T_BKG DOUBLE PRECISION NOT NULL,
    T_TAX DOUBLE PRECISION,
    T_OTHER DOUBLE PRECISION,
    T_DIV DOUBLE PRECISION,
    T_STAMPS DOUBLE PRECISION,
    T_DC_NO DOUBLE PRECISION,
    T_SPOT CHAR(2),
    T_CITY VARCHAR(3),
    T_ORDER DOUBLE PRECISION,
    T_TRADE DOUBLE PRECISION,
    T_TIME DATE,
    T_FORM CHAR(1),
    HEADER VARCHAR(2),
    T_DC_DATE DATE,
    T_POD VARCHAR(30),
    T_POD_DATE DATE,
    T_SET INTEGER,
    T_MARGIN DOUBLE PRECISION NOT NULL WITH DEFAULT,
    T_MKT_TYPE VARCHAR(3) NOT NULL,
    T_MEMBER_CODE VARCHAR(15),
    T_EXIM SMALLINT,
    T_P VARCHAR(15),
    T_C VARCHAR(30),
    T_TERM VARCHAR(8),
    T_CUST VARCHAR(12),
    T_SUBBKG DOUBLE PRECISION,
    T_BILL_TYPE VARCHAR(1),
    T_OPN_CLS DOUBLE PRECISION,
    T_AUCTION DOUBLE PRECISION,
    T_BRANCH VARCHAR(8),
    T_UNQID VARCHAR(20),
    T_SQ SMALLINT,
    T_CBKG DOUBLE PRECISION,
    T_COTHER DOUBLE PRECISION,
    T_MOD DATE,
    T_ORIG_CUST VARCHAR(20),
    T_TOT DOUBLE PRECISION,
    T_FIRM SMALLINT,
    T_ORDER_TIME DATE,
    T_NON_MT SMALLINT))
    LOCATION ('BR271107.DAT'))
    Error at Command Line:28 Column:40
    Error report:
    SQL Error: ORA-00905: missing keyword
    00905. 00000 - "missing keyword"
    Thank u..!
    Ravi

    Where can we find that directory in the server. You have to provide for it's existence.
    So you must create C:/Oracle on the server or have your ext_tab_dir point to some existing directory on the server (better if dedicated to external tables for not creating confusion)
    You must also see to have read and write OS rights and have granted read (and write) privileges on directory ext_tab_dir to your_user_name
    Regards
    Etbin
    If you can use utl_file try to use utl_file_dir as your ext_tab_dir to perform the test => copy your file to the directory your utl_file_dir is pointing to and do select * from test
    Message was edited by: Etbin
    user596003

  • External Table Load KUP-04037 Error

    I was asked to repost this here. This was a follow on question to this thread how to load special characters (diacritics) in the Exort/Import/SQL Loader/External Table Forum.
    I've defined an external table and on my one instance running the WE8MSWIN1252 character set everything works fine. On my other instance running AL32UTF8 I get the KUP-04037 error, terminator not found on the field that has "à" (the letter a with a grave accent). Changing it to a standard "a" works avoids the error. Changing the column definition in the external table to nvarchar2 does NOT help.
    Any ideas anyone?
    Thanks,
    Bob Siegel

    Exactly. If you do not specify the CHARACTERSET parameter, the database character set is used to interpret the input file. As the input file is in WE8MSWIN1252, the ORACLE_LOADER driver gets confused trying to interpret single-byte WE8MSWIN1252 codes as multibyte AL32UTF8 codes.
    The character set of the input file depends on the way it was created. Even on US Windows, you can create text files in different encodings. Notepad allows you to save the file in ANSI code page (=WE8MSWIN1252 on US Windows), Unicode (=AL16UTF16LE), Unicode big endian (=AL16UTF16), and UTF-8 (=AL32UTF8). The Command Prompt edit.exe editor saves the files in the OEM code page (=US8PC437 on US Windows).
    -- Sergiusz

  • Need help at date format while creating External Tables from Flat file

    Hi All,
    I have a flat file generated from SQL Server 2005. In that generated flat file the date format is in the format as "YYYY-MM-DD HH24:MI:SS.Millisec" like example "2007-09-08 13:32:36.568".
    My task is I have to load this flat file data into Oracle database table running on 9i, but its failing at the creation of external table itself because of this date format. The target table in Oracle the date column data type is "date" only not the "TIMESTAMP".
    Can any body suggest how to resolve this?
    Thanks,
    Sankar

    Or:
    SQL> select cast(to_timestamp('2007-09-08 13:32:36.568',
      2                  'yyyy-mm-dd hh24:mi:ss.xff') as  date) dt
      3  from dual;
    DT
    08-SEP-07                                                                                                                                                                                                                                                                                                                                                                   

  • Error while creating business action: Getting unversionable object error.

    Hi,
    When we try to create a business action with name "AcceptanceAcknowledgementException" and version 1.0, we are getting following errror:
    *{color:#ff0000}AIP-11052: Writing following objects: Document type failed due to following constraint violation: DOCUMENTTYPE: CAN NOT UPDATE UNVERSIONABLE OBJECT IN A VALIDATED CONFIGURATION.{color}*
    We have checked the configuration and there is no validated configuration and all agreements are in "draft" state. We also restarted the b2b server but issue was not resolved. Please help us out.
    Thanks and Regards,
    Anay and Kunal(Infosys Team)
    +91 9764061611
    +91 9764000862

    Hi,
    This is to inform you that the issue has been resolved as of now. There was some issue with the environment and after restarting the b2b we were able to complete the preliminary steps. Currently we are in the process of creating the business actions and we will update you once all the final steps are completed.
    Thanks and Regards,
    Anay and Kunal(Infosys Team)
    +91 9764061611
    +91 9764000862

  • KUP-01005 error when selecting external table

    Hi All,
    My name is arun. I am having trouble resolving the following error. I tried to google, search oracle forum but no avail. I would really appreciate some help? I hope someone point me to the right direction with this problem. Thank you.
    Scenario :
    I have done the following :
    1. Created the external directories using a user account(KDEV199). However by default its owned by SYS user.
    2. Created the table necessary for selection. This was done by user account(KDEV199)
    3. I have granted the folder privileges owned by oinstall:oracle where the 2 physical files exists. Thus all the files is owned by oracle. This was done at OS layer.
    4. I have created 2 files necessary to extract data & read in oracle. This was done at OS layer.
    The problem is that i have the following when i try to select the table :
    SQL> select * from TEXN_IGM_MST;
    select * from TEXN_IGM_MST
    ERROR at line 1:
    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 "minussign": expecting one of:
    "double-quoted-string, identifier, single-quoted-string"
    KUP-01007: at line 7 column 10
    This script used to create the table :
    --Create External Table
    CREATE TABLE texn_igm_mst
    COMP_NO CHAR(2),
    POL_NO CHAR(10),
    WRITING_AGENCY_NO_1 CHAR(10),
    WRITING_AGENT_NO_1 CHAR(10),
    WRITING_AGENCY_NO_2 CHAR(10),
    WRITING_AGENT_NO_2 CHAR(10),
    POL_STS_CDE CHAR(4),
    STS_CHNG_DT DATE,
    POL_DTE DATE,
    PAY_UP_DTE DATE,
    PAY_TO_DTE CHAR(10),
    MATURE_DTE DATE,
    PAY_MODE_CDE CHAR(2),
    PAY_METHOD_CDE CHAR(1),
    MODAL_PREM_AMT NUMBER(15,2),
    POL_CUR CHAR(2),
    NFO_CDE CHAR(1),
    DIVD_OPTION_CDE_1 CHAR(1),
    DIVD_OPTION_CDE_2 CHAR(1),
    OTHER_OPTION_CDE_1 CHAR(1),
    OTHER_OPTION_CDE_2 CHAR(1),
    RESTRICT_CDE CHAR(20),
    NEXT_MODAL_PREM NUMBER(15,2),
    SUSPEND_CDE CHAR(1),
    EXTRACT_DTE DATE,
    REASON_CDE CHAR(3),
    LINE_OF_BUSS CHAR(1),
    BILL_TO_DTE CHAR(10),
    DUE_DAY NUMBER(3),
    DAY_USE CHAR(1),
    PAR_TYPE CHAR(1),
    ISSUE_STATE CHAR(2),
    MED_CDE CHAR(1),
    RACE_CDE CHAR(1),
    ADMIT_CDE CHAR(1),
    REPT_STATE CHAR(2),
    COLL_OFF CHAR(2),
    WRITING_AGENCY CHAR(10),
    LAST_ANN_PROC CHAR(3),
    TIMESTAMP DATE,
    SPND_EFF_DT DATE,
    SPND_TRMN_DT DATE,
    SPND_USER_ID CHAR(8),
    CMPLN_AGT_ID CHAR(10),
    TOTAL_CWA DECIMAL(17),
    TOTAL_CWA_DT DATE,
    DELIVERY_DT DATE,
    REINSURED_CDE CHAR(1),
    SERV_AGENCY CHAR(10),
    ST_CODE CHAR(1),
    NFO_RULE CHAR(1),
    CSTAT_REASN_CD CHAR(2),
    REJ_REASN_CD CHAR(2)
    ORGANIZATION EXTERNAL
    TYPE oracle_loader
    DEFAULT DIRECTORY external_dir_clmlog
    ACCESS PARAMETERS
    records delimited by newline
    BADFILE external_dir_clmlog:'VILFPM1.BAD'
    LOGFILE external_dir_clmlog:'VILFPM1.LOG'
    fields terminated by '!'
    missing field values are null
    --Column and format setting
    COMP_NO,
    POL_NO,
    WRITING_AGENCY_NO_1,
    WRITING_AGENT_NO_1,
    WRITING_AGENCY_NO_2,
    WRITING_AGENT_NO_2,
    POL_STS_CDE,
    STS_CHNG_DT CHAR date_format DATE Mask "yyyy-mm-dd",
    POL_DTE CHAR date_format DATE Mask "yyyy-mm-dd",
    PAY_UP_DTE CHAR date_format DATE Mask "yyyy-mm-dd",
    PAY_TO_DTE,
    MATURE_DTE CHAR date_format DATE Mask "yyyy-mm-dd",
    PAY_MODE_CDE,
    PAY_METHOD_CDE,
    MODAL_PREM_AMT,
    POL_CUR,
    NFO_CDE,
    DIVD_OPTION_CDE_1,
    DIVD_OPTION_CDE_2,
    OTHER_OPTION_CDE_1,
    OTHER_OPTION_CDE_2,
    RESTRICT_CDE,
    NEXT_MODAL_PREM,
    SUSPEND_CDE,
    EXTRACT_DTE CHAR date_format DATE Mask "yyyy-mm-dd",
    REASON_CDE,
    LINE_OF_BUSS,
    BILL_TO_DTE,
    DUE_DAY,
    DAY_USE,
    PAR_TYPE,
    ISSUE_STATE,
    MED_CDE,
    RACE_CDE,
    ADMIT_CDE,
    REPT_STATE,
    COLL_OFF,
    WRITING_AGENCY,
    LAST_ANN_PROC,
    TIMESTAMP CHAR date_format DATE Mask "yyyy-mm-dd-hh24.mi.ss.ffffff",
    SPND_EFF_DT CHAR date_format DATE Mask "yyyy-mm-dd",
    SPND_TRMN_DT CHAR date_format DATE Mask "yyyy-mm-dd",
    SPND_USER_ID,
    CMPLN_AGT_ID,
    TOTAL_CWA,
    TOTAL_CWA_DT CHAR date_format DATE Mask "yyyy-mm-dd",
    DELIVERY_DT CHAR date_format DATE Mask "yyyy-mm-dd",
    REINSURED_CDE,
    SERV_AGENCY,
    ST_CODE,
    NFO_RULE,
    CSTAT_REASN_CD,
    REJ_REASN_CD
    LOCATION (external_dir_clmxcom:'VILFPM1.DAT')
    DB version :
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE 11.2.0.2.0 Production
    TNS for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    OS version :
    SUSE Linux Enterprise Server 11 (x86_64)
    VERSION = 11
    PATCHLEVEL = 1
    Linux KAITLSDS01 2.6.32.12-0.7-default #1 SMP 2010-05-20 11:14:20 +0200 x86_64 x86_64 x86_64 GNU/Linux
    ---------------------------------------------------------------------------------------------------------------------------------------

    Pl see MOS Doc 302672.1 (Select From External Table Gives ORA-29913 ORA-29400 KUP-554 KUP-1005)
    Srini

  • Getting error while creating a table

    Hi there,
    I have created a user 'ram' and gave "create table" permissions for that user.
    After that, when I tried to create a table using the command
    create table countries as select * from hr.countries;
    where hr is another user and countries is the name of table in that schemagetting error message
    ERROR at line 1:
    ORA-00942: table or view does not existNOTE: The same error occurs even while creating a table in 'ram' schema after granting sysdba rights to 'ram'
    Thanks
    Rajiv

    Hi,
    dose the user ram has SELECT rights on the table hr.countries. Can he do SELECT in that table.
    Thanks

  • Error while Creating External definition with WSDL file

    Hi ALL,
    I need to create a External defination with a WSDL file in PI 7.1.so i selected the Option WSDL & From all available message defination while creating External defination  & imported the WSDL file.
    I am getting an error
    javax.ejb.EJBException: nested exception is: java.lang.RuntimeException: java.lang.NoSuchMethodError: com.sap.aii.utilxi.wsdl.api.WsdlHandler.parseWsdlWithOrderRearrange(Lcom/sap/aii/utilxi/xml/xdom/XElement;Z)Lcom/sap/aii/utilxi/wsdl/api/Wsdl; java.lang.RuntimeException: java.lang.NoSuchMethodError:
    Note : i checked the WSDl file in altova its no error's ,i know there is no problem with the WSDL file ,i tried importing the same in other XI 3.0 system it has no problem.
    help me in solving this ..
    Regards
    Shakeif

    Hi Tony,
    Somehow I solved this issue. I dont remember what exactly I did, as it was sometime back in December. I think I used the Wizard initially to do the configurations in Solution Manager and again i tried to do the same manually as the earlier one threw some errors.
    It seems the wizard proceeded half-way through and hence the entry was made in the database already and hence that error.
    Anyways thank you for replying me.
    best regds,
    Alagammai.

  • Keep getting an error message that reads, "LR An error has occurred while creating the book on Blurb" An error has occurred while trying to create texts and fonts.  Pleas advise as Blurb has said that it's a LR issue.

    Keep getting an error message that reads, "LR An error has occurred while creating the book on Blurb" An error has occurred while trying to create texts and fonts.  Pleas advise as Blurb has said that it's a LR issue.

    Are you behind a firewall or double NAT??
    What is the device that is immediately plugged into the main modem or router? Has that one been able to update?
    It is plugged in of course isn't it.. no nasty join wireless anywhere??
    The best way to work around these sort of problems is to simplify the network.. Plug each device directly into the main router.. by ethernet. You can trigger the firmware upgrade by wireless but use ipad or iphone version of airport utility and see what happens.

  • I am receiveing error while creating Z table: Entry in table TAORA missing

    Hi Experts,
    I am receiving "Entry in table TAORA missing" while creating Z table.
    Please help
    Edited by: N_niki on Jun 11, 2011 9:22 AM

    Hi
    1) Check for the DB System. The Table name in  "Entry in table TAORA missing", meant to save the "DATA CLASS of the ORACLE application"., OR
    2) check for the Data Class you Selected, on Creation of the Z Table, for which an Entry exists in the TAORA or the Available DATA CLASS in the TAORA Table to fix it.
    Regards
    Gopu

  • Create external table in procedure

    i have a PL/SQL Block [ well i'm not created procedure still]
    /* Formatted on 2011/01/05 11:53 (Formatter Plus v4.8.8) */
    DECLARE
    -- create header
       p_formula_no                VARCHAR2 (200);
       p_formula_vers              NUMBER;
       p_formula_desc              VARCHAR2 (200);
       p_formula_desc2             VARCHAR2 (200);
       p_formula_class             VARCHAR2 (200);
       p_owner_organization_id     NUMBER;
       p_owner_id                  NUMBER;
       p_formula_type              NUMBER;
       p_scale_type                NUMBER;
       p_text_code                 NUMBER;
       p_last_update_date          DATE;
       p_auto_product_calc         VARCHAR2 (200);
       x_formula_id                NUMBER;
       x_return_code               VARCHAR2 (200);
       x_error_msg                 VARCHAR2 (200);
       formula_id                  NUMBER;
    -- update header
       p_formula_id                NUMBER;
       p_formula_status            VARCHAR2 (200);
       p_user_id                   NUMBER;
       p_last_update_date_orig     DATE;
       p_formulaline_id            NUMBER;
       p_line_type                 NUMBER;
       p_line_no                   NUMBER;
       p_item_id                   NUMBER;
       p_item_no                   VARCHAR2 (200);
       p_revision                  VARCHAR2 (200);
       p_qty                       NUMBER;
       p_item_um                   VARCHAR2 (200);
       p_release_type              NUMBER;
       p_scrap_factor              NUMBER;
       p_cost_alloc                NUMBER;
       p_phantom_type              NUMBER;
       p_rework_type               NUMBER;
       p_tp_formula_id             NUMBER;
       p_iaformula_id              NUMBER;
       p_scale_uom                 VARCHAR2 (200);
       p_contribute_step_qty_ind   VARCHAR2 (200);
       p_contribute_yield_ind      VARCHAR2 (200);
       p_scale_multiple            NUMBER;
       p_scale_rounding_variance   NUMBER;
       p_rounding_direction        NUMBER;
       p_by_product_type           VARCHAR2 (200);
       p_prod_percent              NUMBER;
    -- create header and update header cursors
       CURSOR c1
       IS
          SELECT DISTINCT formula_no, formula_ver, formula_desc, formula_class,
                          owner_header
                     FROM api_formula;
    -- for product cursors
       CURSOR c2
       IS
          SELECT *
            FROM api_formula
           WHERE line_type = 1;
    -- for ingredient cursors
       CURSOR c3
       IS
          SELECT *
            FROM api_formula
           WHERE line_type = -1;
       hdr                     c1%ROWTYPE;
       prod                        c2%ROWTYPE;
       ing                         c3%ROWTYPE;
    BEGIN
    -- for create and update header
       OPEN c1;
       FETCH c1
        INTO hdr;
       WHILE c1%FOUND
       LOOP
          p_formula_no := hdr.formula_no;
          p_formula_vers := hdr.formula_ver;
          p_formula_desc := hdr.formula_desc;
          p_formula_desc2 := NULL;
          p_formula_class := hdr.formula_class;
          p_owner_organization_id := 327;
          p_owner_id := 1298;
          p_formula_type := 0;
          p_scale_type := 0;
          p_text_code := 0;
          p_last_update_date := SYSDATE;
          p_auto_product_calc := 'Y';
          x_formula_id := NULL;
          x_return_code := NULL;
          x_error_msg := NULL;
          apps.gmd_formula_designer_pkg_cust.create_formula_header
                                                        (p_formula_no,
                                                         p_formula_vers,
                                                         p_formula_desc,
                                                         p_formula_desc2,
                                                         p_formula_class,
                                                         p_owner_organization_id,
                                                         p_owner_id,
                                                         p_formula_type,
                                                         p_scale_type,
                                                         p_text_code,
                                                         p_last_update_date,
                                                         p_auto_product_calc,
                                                         x_formula_id,
                                                         x_return_code,
                                                         x_error_msg
          COMMIT;
          SELECT formula_id
            INTO formula_id
            FROM fm_form_mst_b
           WHERE formula_no = hdr.formula_no;
          p_formula_id := formula_id;
          p_formula_no := NULL;
          p_formula_vers := NULL;
          p_formula_desc := NULL;
          p_formula_desc2 := NULL;
          p_formula_status := 700;
          p_formula_class := NULL;
          p_owner_organization_id := 327;
          p_owner_id := 1298;
          p_formula_type := 0;
          p_scale_type := 0;
          p_text_code := NULL;
          p_last_update_date := SYSDATE;
          p_user_id := 1298;
          p_last_update_date_orig := SYSDATE;
          p_auto_product_calc := 'Y';
          x_return_code := NULL;
          x_error_msg := NULL;
          apps.gmd_formula_designer_pkg_cust.update_formula_header
                                                         (p_formula_id,
                                                          p_formula_no,
                                                          p_formula_vers,
                                                          p_formula_desc,
                                                          p_formula_desc2,
                                                          p_formula_status,
                                                          p_formula_class,
                                                          p_owner_organization_id,
                                                          p_owner_id,
                                                          p_formula_type,
                                                          p_scale_type,
                                                          p_text_code,
                                                          p_last_update_date,
                                                          p_user_id,
                                                          p_last_update_date_orig,
                                                          p_auto_product_calc,
                                                          x_return_code,
                                                          x_error_msg
          DBMS_OUTPUT.put_line (x_return_code);
          DBMS_OUTPUT.put_line (x_error_msg);
          COMMIT;
          -- for PROD
          OPEN c2;
          FETCH c2
           INTO prod;
          WHILE c2%FOUND
          LOOP
             p_formula_id := formula_id;
             p_formulaline_id := NULL;
             p_line_type := 1;
             p_line_no := prod.line_no;
             p_item_id := prod.item_id;
             p_item_no := prod.item_name;
             p_revision := NULL;
             p_qty := prod.qty;
             p_item_um := prod.uom;
             p_release_type := 0;
             p_scrap_factor := 0;
             p_scale_type := 1;
             p_cost_alloc := 1;
             p_phantom_type := 0;
             p_rework_type := NULL;
             p_text_code := NULL;
             p_tp_formula_id := NULL;
             p_iaformula_id := NULL;
             p_scale_uom := NULL;
             p_contribute_step_qty_ind := NULL;
             p_contribute_yield_ind := NULL;
             p_scale_multiple := NULL;
             p_scale_rounding_variance := NULL;
             p_rounding_direction := NULL;
             p_by_product_type := NULL;
             p_last_update_date := SYSDATE;
             p_user_id := 1298;
             p_prod_percent := NULL;
             x_return_code := NULL;
             x_error_msg := NULL;
             apps.gmd_formula_designer_pkg.insert_formula_detail
                                                      (p_formula_id,
                                                       p_formulaline_id,
                                                       p_line_type,
                                                       p_line_no,
                                                       p_item_id,
                                                       p_item_no,
                                                       p_revision,
                                                       p_qty,
                                                       p_item_um,
                                                       p_release_type,
                                                       p_scrap_factor,
                                                       p_scale_type,
                                                       p_cost_alloc,
                                                       p_phantom_type,
                                                       p_rework_type,
                                                       p_text_code,
                                                       p_tp_formula_id,
                                                       p_iaformula_id,
                                                       p_scale_uom,
                                                       p_contribute_step_qty_ind,
                                                       p_contribute_yield_ind,
                                                       p_scale_multiple,
                                                       p_scale_rounding_variance,
                                                       p_rounding_direction,
                                                       p_by_product_type,
                                                       p_last_update_date,
                                                       p_user_id,
                                                       p_prod_percent,
                                                       x_return_code,
                                                       x_error_msg
             DBMS_OUTPUT.put_line (x_return_code);
             DBMS_OUTPUT.put_line (x_error_msg);
             COMMIT;
             FETCH c2
              INTO prod;
          END LOOP;
          -- for ing
          OPEN c3;
          FETCH c3
           INTO ing;
          WHILE c3%FOUND
          LOOP
             p_formula_id := formula_id;
             p_formulaline_id := NULL;
             p_line_type := -1;
             p_line_no := ing.line_no;
             p_item_id := ing.item_id;
             p_item_no := ing.item_name;
             p_revision := NULL;
             p_qty := ing.qty;
             p_item_um := ing.uom;
             p_release_type := 0;
             p_scrap_factor := 0;
             p_scale_type := 1;
             p_cost_alloc := 1;
             p_phantom_type := 0;
             p_rework_type := NULL;
             p_text_code := NULL;
             p_tp_formula_id := NULL;
             p_iaformula_id := NULL;
             p_scale_uom := NULL;
             p_contribute_step_qty_ind := NULL;
             p_contribute_yield_ind := NULL;
             p_scale_multiple := NULL;
             p_scale_rounding_variance := NULL;
             p_rounding_direction := NULL;
             p_by_product_type := NULL;
             p_last_update_date := SYSDATE;
             p_user_id := 1298;
             p_prod_percent := NULL;
             x_return_code := NULL;
             x_error_msg := NULL;
             apps.gmd_formula_designer_pkg.insert_formula_detail
                                                      (p_formula_id,
                                                       p_formulaline_id,
                                                       p_line_type,
                                                       p_line_no,
                                                       p_item_id,
                                                       p_item_no,
                                                       p_revision,
                                                       p_qty,
                                                       p_item_um,
                                                       p_release_type,
                                                       p_scrap_factor,
                                                       p_scale_type,
                                                       p_cost_alloc,
                                                       p_phantom_type,
                                                       p_rework_type,
                                                       p_text_code,
                                                       p_tp_formula_id,
                                                       p_iaformula_id,
                                                       p_scale_uom,
                                                       p_contribute_step_qty_ind,
                                                       p_contribute_yield_ind,
                                                       p_scale_multiple,
                                                       p_scale_rounding_variance,
                                                       p_rounding_direction,
                                                       p_by_product_type,
                                                       p_last_update_date,
                                                       p_user_id,
                                                       p_prod_percent,
                                                       x_return_code,
                                                       x_error_msg
             DBMS_OUTPUT.put_line (x_return_code);
             DBMS_OUTPUT.put_line (x_error_msg);
             COMMIT;
             FETCH c3
              INTO ing;
          END LOOP;
          FETCH c1
           INTO hdr;
       END LOOP;
       DBMS_OUTPUT.put_line (p_formula_id);
       DBMS_OUTPUT.put_line (x_return_code);
       DBMS_OUTPUT.put_line (x_error_msg);
    END;in this PL/SQL Block i'm used external table which is "API_FORMULA"
    the coding is
    create table api_formula
           ( FORMULA_NO varchar2(2000),
             FORMULA_VER NUMBER,
             FORMULA_DESC varchar2(2000),
             FORMULA_CLASS varchar2(2000),
             ORG NUMBER,
             OWNER_HEADER NUMBER,
             LINE_TYPE NUMBER,
           LINE_NO NUMBER,
             ITEM_ID NUMBER,
           ITEM_NAME VARCHAR2(2000),
           QTY NUMBER,
             UOM VARCHAR2(200),
             SCRAP_FAC NUMBER,
             SCRAP_TYPE NUMBER,
             UPDATE_DATE date,
             OWNER_LINE NUMBER,
               testt char(2)/*,
             future_use varchar2(200)*/
           organization external
           ( default directory ZAFAR
             access parameters
             ( records delimited by newline
               fields terminated by ','
             location ('HEADER.csv') 
    reject limit 100   
         ;i want this create external table statment in my Pl/SQL Block and when all the execution is complete then drop the table
    how it is possible??
    regard
    chintoo

    user11156570 wrote:
    @BluShadow
    ok .. i want to delete all rows from table in the end when execute this PL/SQLdelete all rows from what table?
    If you're referring to the external table, it's a file on the filesystem, you don't delete rows from it, you just replace/overwrite/delete the file as and when necessary.
    blushadow how i crate a reliable code.. can u suggest me?Basics of transactions... you commit when a business rule/process is complete, not for every little technical thing your code does. In your case I would expect a single commit at the end of the code.
    I don't have your tables, data or know what the code is supposed to be achieving, but you can bet your bottom dollar that if you're nesting cursor loops within each other then the code is running much slower than if you generated the data from a single SQL statement/cursor. I certainly have no clue what those procedure calls are doing, but it looks like they're using a load of OUT parameters. Are they user defined procedures or something that's part of e.g. Oracle Apps? If they're user defined I would consider redesigning all the code to use functions and pass back a structured data type with the required data.

  • How to assign a seq while creating a table

    Hi,
    How to assign a sequence such that i dont want to give the sequence while creation. i mean
    if employee table is there
    sl_no empname salary .....
    i dont want to give sequence while inserting the data, i want to give the sequence at creation of table level for sl_no
    i tried this
    create table seqtest1 (id number primary key default rajseq.nextval);
    but it is showing me the error
    ERROR at line 1:
    ORA-00907: missing right parenthesis
    whats the solution
    please help me
    Thank you
    Raj deep.A

    Hi Raj,
    You can not assign a sequence to a column while creating a table. you have two options for this. (So you can also use one sequence for multiple tables)
    1. As Gasparotto said, you can create a before insert statement. OR
    2. you can assign new sequence number in the program code. for example.
    insert into xxx (user_id,name,surname) values (seq_userid.nextval,'Raj','Deep');
    Good Luck.
    Onur

  • Steps to follow while creating Database table in notes or paperwork

    what are the steps to follow while creating Database table in notes or paperwork
    Thank you,
    Regards,
    Jagrut Bharatkumar Shukla

    hi,
    1. Goto Transaction SE11.
    2. Enter the table name to be created. It should start with a Y or Z.
    3. Press Create
    4. Enter the Short description for the table
    5. Enter the Delivery class for the table. It can be 'A', 'C' or other.
    6. In the Fields tab, specify the table fields and the corresponding data elements or the built-in data types.
    7. If the table needs to be made a client-depenedent table, the first field should be MANDT.
    8. Goto Technical settings of the table and sepcify the Data Class and Size for the table. Also, there u can specify if buffering for the table should be allowed or not.
    9. Now, activate the table.
    if helpful reward some points.
    with regards,
    Suresh Aluri.

  • Can i create External Table dynamically

    Hi,
    Is it possible to create External Table dynamically ?
    I want to use the following dynamically to create External Table.
    1) fields
    2) field position
    3) file location
    Thanks

    The answer shouldn't be very different of already given answers in your Can i create external table dynamically? of the last month, is it ?
    And question is still same : why wanted such thing ?
    Nicolas.

Maybe you are looking for