External table in a procedure

Hi,
I have an external table script to load data and I need to schedule the loading (every 10 minutes). (env: Windows XP)
I am planning on putting the external table script in a procedure and call the procedure in the DBMS utility.
But.... when I put the external table script in the procedure, I am getting compilation errors because of the DROP and CREATE (DDL) statements in the procedure.
Please help me putting the external table script in the procedure.
Thanks in advance

JT,
If the file is allways the same name, why drop and recreate externale table.
You can reuse the table even if the file was drop and recreate.
  1   CREATE TABLE EXT_RN_DEPLOY_DATA
  2   (
  3   MONITOR_ID VARCHAR2(30),
  4   SAMPLE_ID VARCHAR2(30),
  5   LATITUDE VARCHAR2(10),
  6   DEW_POINT NUMBER(18,8)
  7   )
  8   ORGANIZATION EXTERNAL
  9   ( TYPE ORACLE_LOADER
10   DEFAULT DIRECTORY DATA_FILE_DIR2
11   ACCESS PARAMETERS
12   ( RECORDS DELIMITED BY NEWLINE SKIP 1
13   BADFILE DATA_FILE_DIR2:'REVEXT%A_%P.BAD'
14   LOGFILE DATA_FILE_DIR2:'REVEXT%A_%P.LOG'
15   FIELDS TERMINATED BY ","
16   OPTIONALLY ENCLOSED BY '"'
17   MISSING FIELD VALUES ARE NULL
18   )
19   LOCATION (DATA_FILE_DIR2:'load.csv')
20   )
21   REJECT LIMIT UNLIMITED
22   LOGGING
23   NOCACHE
24*  NOPARALLEL
SQL> /
Table created.
SQL> create procedure test_ext as
  2  i number;
  3  begin
  4  select count(*) into i from EXT_RN_DEPLOY_DATA;
  5  dbms_output.put_line(i);
  6  end;
  7  /
Procedure created.
--The file exists
SQL> exec test_ext
0
PL/SQL procedure successfully completed.
--I deleted the file
SQL> exec test_ext
BEGIN test_ext; END;
ERROR at line 1:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-04040: file load.csv in DATA_FILE_DIR2 not found
ORA-06512: at "SYS.ORACLE_LOADER", line 14
ORA-06512: at line 1
ORA-06512: at "SCOTT.TEST_EXT", line 4
ORA-06512: at line 1
--I recreated the file and populate this one
SQL> exec test_ext
2
PL/SQL procedure successfully completed.
SQL> Nicolas.

Similar Messages

  • Error while using External Table

    Hi Guru's,
    I am using external tables in my procedure and the code to create it will be dynamically built inside the procedure itself. I have tested it so many times and it works fine only. But suddenly now it is throwing some error and i was not able to figure out the problem.
    Additional Info:
    1. I have provided the full rights to the input directory.
    2. Working in Oracle 10g release 2
    3. Unix OS in server
    4. Error description:
    << UK_TRADINGDATA_LOAD >> ABEND : <<ABEND SYS-000 >> uncatched ORACLE-error : ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04040: file EXTRACTION COMPLETED in EXT_UK_TRADINGDATA not found
               v_ac_sql:='CREATE TABLE VLDPROCESS'||gv_ac_schema_suffix||'.EXT_UK_TRAD_'||gv_ac_machineid ||'_'||gv_ac_retailer_id||'_ADHOC'||CHR(10)
                            ||'(  AC_RETAILER_ID       VARCHAR2(2 BYTE),'||CHR(10)
                            ||'AC_DEPARTMENT_CD     VARCHAR2(20 BYTE),'||CHR(10)
                            ||'NC_PERIOD_FROM       NUMBER,'||CHR(10)
                            ||'NC_PERIOD_TO       NUMBER'||CHR(10)   
                            ||')'||CHR(10)
                            ||'ORGANIZATION EXTERNAL'||CHR(10)
                            ||'(TYPE ORACLE_LOADER'||CHR(10)
                            ||'DEFAULT DIRECTORY EXT_UK_TRADINGDATA'||CHR(10)
                            ||'ACCESS PARAMETERS'||CHR(10)
                            ||'(RECORDS DELIMITED BY NEWLINE'||CHR(10)
                            ||'badfile     '''||v_ac_failed_files||'.bad'''||CHR(10)
                            ||'discardfile '''||v_ac_failed_files||'.dis'''||CHR(10)
                            ||'logfile     '''||v_ac_failed_files||'.log'''||CHR(10)
                            ||'FIELDS'||CHR(10)
                            ||'('||CHR(10)
                            ||'AC_RETAILER_ID   position( 1: 2) char( 2),'||CHR(10)
                            ||'AC_DEPARTMENT_CD position( 3:22) char(20),'||CHR(10)
                            ||'NC_PERIOD_FROM   position(23:29) char( 7),'||CHR(10)
                            ||'NC_PERIOD_TO     position(30:36) char( 7)'||CHR(10)     
                            ||')'||CHR(10)
                            ||')'||CHR(10)
                            ||'LOCATION ('''||v_ac_file_name ||''')'||CHR(10)
                            ||')'||CHR(10)
                            ||'REJECT LIMIT 100'||CHR(10)
                            ||'NOPARALLEL'||CHR(10)
                            ||'NOMONITORING';  
               EXECUTE IMMEDIATE v_ac_sql; Kindly help me!
    With Regards,
    VJ

    Sometimes when troubleshooting issues like this it is helpful to output the dynamic SQL generated to the screen or spool it to a text file. From there it's usually easy to determine where the problem lies.
    If you can provide that one of the forum members can figure it out.

  • Variable filename external table

    I have written a script to import data from a .csv into a table in Apex:
    CREATE TABLE APEX_USER_002.INK_KASSA_LOAD
    KASS_DTM      VARCHAR2(255),
           KASS_ID       VARCHAR2(255),
           KASS_VKP_COD  VARCHAR2(255),
           KASS_VKP_OMS  VARCHAR2(255),
           KASS_COD VARCHAR2(255),
           KASS_OMS   VARCHAR2(255),
           KASS_PRS_COD VARCHAR2(255),
           KASS_PRS_OMS VARCHAR2(255)
    ORGANIZATION EXTERNAL
      TYPE ORACLE_LOADER
      DEFAULT DIRECTORY AFM_KASSA_IN
      ACCESS PARAMETERS
        RECORDS DELIMITED BY NEWLINE CHARACTERSET WE8MSWIN1252
          LOGFILE AFM_KASSA_LOG: 'log.log'
        BADFILE AFM_KASSA_BAD: 'badfile.bad'
        NODISCARDFILE
        SKIP 1
        FIELDS TERMINATED BY ';'
        OPTIONALLY ENCLOSED BY '"'
        LRTRIM
        MISSING FIELD VALUES ARE NULL
    KASS_DTM,
           KASS_ID,
           KASS_VKP_COD,
           KASS_VKP_OMS,
           KASS_COD,
           KASS_OMS,
           KASS_PRS_COD,
           KASS_PRS_OMS
        LOCATION  ('variable_filename.csv')
    It works fine when I put the name of the .csv hardcoded in the script. Like this: LOCATION ('Kassa_20130406130014.csv')
    I have written a function which returns the filename, but when I use the function in LOCATION (function()) I get an error: ora-00905: missing keyword
    How can I call a function in LOCATION ()?

    Hi,
    I'm not sure but I think you need re-create external table.
    Create procedure that drops and re-creates external table dynamically with new file name.
    Or use e.g. DBMS_SCHEDULER to call OS script that renames file always to same name for external table.
    Regards,
    Jari

  • How to use External Tables

    Hi, I want to know how to use external tables? The procedure i follow for SQL*Loader in my shell script is:
    Call the sqlldr
    Check return code
    If return code = 2. get count of records from bad file and exit.
    If return code != 0 and != 2 then exit as fatal error
    If return code = 0 then continue.
    But i don't understand how to use external table as it is not invoked and does not have a return code.

    Hello,
    What do you mean alogrithim, do you mean to invoke external table as you invoke sqlldr? You can generate external table script from sqlldr and use it to load data but you might have to modify the table name and datafile name . You can see if any bad file generated from sqlldr and if yes then you can generate external table (using sqlldr) or based on your bad file. May be if you can list what exactly you want in bullet points, then it will be easier to suggest you.
    Regards

  • Error while calling an procedure using an external table with C#.

    Hello,
    I am developping a scheduler application with Visual Studio 2010 (C#) to start my PL/SQL procedures.
    Everything works fine with every procedure but one who is reading the content of an external table.
    Strange thing is when i launch the same procedure with Toad, i have no problem, but when i launch it with my C# code :
                OracleCommand cmdMET = new OracleCommand();
                cmdMET.CommandText = "STG_AE.M_MET_S_EXT_DEFECT";
                cmdMET.CommandType = CommandType.StoredProcedure;
                cmdMET.Connection = con;
                //OracleParameter retvalMET = new OracleParameter("retval", OracleDbType.Varchar2, 50);
                //retvalMET.Direction = ParameterDirection.ReturnValue;
                //cmdMET.Parameters.Add(retvalMET);
                cmdMET.ExecuteNonQuery();
    I've got this error :
    ORA-29913: error in executing ODCIEXTTABLEFETCH callout
    ORA-01722: invalid number
    ORA-06512: at "STG_AE.M_MET_S_EXT_DEFECT", line 8
    ORA-06512: at "STG_AE.MET_SRC", line 10
    ORA-06512: at "STG_AE.MET", line 14
    ORA-06512: at line 1
    I can't figure out why it works when i launch it with Toad and why i get this error when launching it with C#... Any advice would be great !
    Thanks!

    You're right!
    Adding
    string sql = "ALTER SESSION SET NLS_NUMERIC_CHARACTERS = \",.\"";
    OracleCommand cmd = new OracleCommand(sql, con);
    cmd.CommandType = CommandType.Text;
    OracleDataReader dr = cmd.ExecuteReader();
    solved the problem !
    Thanks a lot =)

  • 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.

  • Error in Loading a clob via external table (Oracle 10.2.0.3 On Solaris 8)

    Hi,
    I am trying to insert a csv file as a single record as a CLOB (one row for entire csv file) and trying to do that via external table. But unalbe to do so. Following is the syntax I tried with:
    create table testext_tab2
      ( file_data clob
      organization external
         TYPE ORACLE_LOADER
         DEFAULT DIRECTORY dir_n1
      access parameters
             RECORDS DELIMITED BY NEWLINE
               BADFILE DIR_N1:'lob_tab_%a_%p.bad'
                 LOGFILE DIR_N1:'lob_tab_%a_%p.log'
                 FIELDS TERMINATED BY ','
              MISSING FIELD VALUES ARE NULL
      clob_filename CHAR(100)
      COLUMN TRANSFORMS  (file_data FROM LOBFILE (clob_filename) FROM (DIR_N1) CLOB)
      LOCATION ('emp.txt')
    REJECT LIMIT UNLIMITED
    --it gives the output that the table is created but the table does not have any rows (select count(*) from testext_tab2 gives 0 rows)
    -- and the logfile has entries like follows:
      Fields in Data Source:
        CLOB_FILENAME                   CHAR (100)
          Terminated by ","
          Trim whitespace same as SQL Loader
      Column Transformations
        FILE_DATA
            is set from a LOBFILE
                directory is from constant DIR_N1
                    directory object list is ignored
                file is from field CLOB_FILENAME
                file contains character data
                    in character set WE8ISO8859P1
    KUP-04001: error opening file /oracle/dba/dir_n1/7369
    KUP-04017: OS message: No such file or directory
    KUP-04065: error processing LOBFILE for field FILE_DATA
    KUP-04101: record 1 rejected in file /oracle/dba/dir_n1/emp.txt
    KUP-04001: error opening file /oracle/dba/dir_n1/7499
    KUP-04017: OS message: No such file or directory
    KUP-04065: error processing LOBFILE for field FILE_DATA
    KUP-04101: record 2 rejected in file /oracle/dba/dir_n1/emp.txt
    KUP-04001: error opening file /oracle/dba/dir_n1/7521
    KUP-04017: OS message: No such file or directory
    KUP-04065: error processing LOBFILE for field FILE_DATA
    KUP-04101: record 3 rejected in file /oracle/dba/dir_n1/emp.txt
    and also the file to be loaded (emp.txt) has data like this:
    7369,SMITH,CLERK,7902,12/17/1980,800,null,20
    7499,ALLEN,SALESMAN,7698,2/20/1981,1600,300,30
    7521,WARD,SALESMAN,7698,2/22/1981,1250,500,30
    7566,JONES,MANAGER,7839,4/2/1981,2975,null,20
    7654,MARTIN,SALESMAN,7698,9/28/1981,1250,1400,30
    7698,BLAKE,MANAGER,7839,5/1/1981,2850,null,30
    7782,CLARK,MANAGER,7839,6/9/1981,2450,null,10
    7788,SCOTT,ANALYST,7566,12/9/1982,3000,null,20
    7839,KING,PRESIDENT,null,11/17/1981,5000,null,10
    7844,TURNER,SALESMAN,7698,9/8/1981,1500,0,30
    7876,ADAMS,CLERK,7788,1/12/1983,1100,null,20
    7900,JAMES,CLERK,7698,12/3/1981,950,null,30
    7902,FORD,ANALYST,7566,12/3/1981,3000,null,20
    7934,MILLER,CLERK,7782,1/23/1982,1300,null,10I will be thankful for help on this. Also I read on asktom site (http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1669379500346411993)
    that LOB are not supported for external tables but there are other sites with examples of CLOB being loaded by external tables.
    With regards,
    Orausern

    CMcM wrote:
    Hi all
    We have an application that runs fine on 10.2.0.4 on most platforms, but a customer has reported an error when running 10.2.0.3 on HP. We have since reproduced the error on 10.2.0.3 on XP but have failed to reproduce it on Solaris or Linux.
    The exact error is within a set of procedures, but the simplest reproducible form of the error is pasted in below.Except that you haven't pasted output to show us what the actual error is. Are we supposed to guess?
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    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
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2    vstrg clob:= 'A';
      3    Thisstrg varchar2(32000);
      4  begin
      5    for i in 1..31999 loop
      6      vstrg := vstrg||'A';
      7    end loop;
      8    ThisStrg := vStrg;
      9* end;
    SQL> /
    PL/SQL procedure successfully completed.
    SQL>Works ok for me on 10.2.0.1 (Windows 2003 server)

  • Error in creating  External Table

    I am following the following procedure to create an external table,but somehow i am not getting success.Can anyone pls explain the error?
    CREATE OR REPLACE DIRECTORY TEST_DIR AS 'C:\TEST'
    Directory created.
    GRANT READ,WRITE ON DIRECTORY TEST_DIR TO PUBLIC
    Grant succeeded.
    CREATE TABLE external_table
    (empno     NUMBER(4),
    ename     VARCHAR2(10),
    job     VARCHAR2(9),
    mgr     NUMBER(4),
    hiredate DATE,
    sal     NUMBER(7, 2),
    comm     NUMBER(7, 2),
    deptno     NUMBER(2))
    ORGANIZATION EXTERNAL
    (TYPE ORACLE_LOADER
    DEFAULT DIRECTORY TEST_DIR
    ACCESS PARAMETERS
    (RECORDS DELIMITED BY NEWLINE
    BADFILE 'TEST_DIR':'emp.bad'
    LOGFILE 'TEST_DIR':'emp.log'
    FIELDS TERMINATED BY ',')
    LOCATION ('emp.csv'))
    Table created.
    The file emp.csv is located in TEST_DIR.
    SELECT * FROM EXTERNAL_TABLE
    ERROR at line 1:
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04063: unable to open log file emp.log
    OS error The system cannot find the file specified.
    ORA-06512: at "SYS.ORACLE_LOADER", line 19
    -MS

    quote from the docs:
    "Note that READ or WRITE permission to a directory object means only that the Oracle database will read or write that file on your behalf. You are not given direct access to those files outside of the Oracle database unless you have the appropriate operating system privileges. Similarly, the Oracle database requires permission from the operating system to read and write files in the directories."
    http://www.di.unipi.it/~ghelli/didattica/bdl/B19306_01/server.102/b14215/et_concepts.htm

  • Drop and recreate table in stored procedure

    Hi all
    When creating tables using Transact-SQL scripts, I have always preferred to drop the table if it exists and then create it explicitly using CREATE TABLE.  For two reasons:
    1) It does not matter if it is the first time the SP is run ie. if I create the table manually in the first instance and just use TRUNCATE TABLE it could fail if the table is deleted
    2) I have control over the data types of the table fields
    Just recently though I discovered the error that can occur when dropping and creating a table in the same batch (see link below)
    Microsoft Website
    This causes me a problem when dropping and creating tables in stored procedures, as I understand that a stored procedure is in itself a single batch?
    Can I avoid this error in a stored procedure whilst continuing to drop and create tables?  Or should I be taking a different approach?
    Coding best practice advice would be greatly appreciated.
    Thank you

    Thanks Ronen
    Please see my second post immediately before your reply.
    Given that I need to store the data output in a physical table for use in QlikView, would you suggest truncating the table each time the SP runs?  And then having a script that handles both dropping and creating the physical table, and also creating
    the SP?
    >> QlikView
    QlikView is an Israeli company, right?
    In any case I am not familiar with QlikView's application, therefore I can only give you general information, based on assumptions regarding the application, and facts regarding the SQL Server.
    >> for use in QlikView
    I assume that external application use specific database structure (table
    structure) and it is change only in rare situations (for example CMS interface might change the tables if and when a module s update/install). In this case there is no need to drop the table and recreate it and TRUNCATE is the solution.
    >> would you suggest truncating the table each time the SP runs
    I am sorry but i cant recommend on TRUNCATE a table each time you execute SP, without know the exact reason for this logic. It sound to me, at this point of time (with the information that we have), that this
    is very bad logic (application architecture). As I wrote above, basing your application on TRUNCATING the table each time mean that you have problems with multi users. Thins about 2 people that try to execute the same SP at almost the same time. Think about
    locking in the SQL Server and bad data (one truncate while the other already inserted the new data and get no rows, if there is no locking).
    But TRUNCATE is much better in this case probably then DROP and DELETE, since it is faster, and locking will be shorter (hopefully the application use the correct locking). There are other reasons why TRUNCATE is better, and other people already mentioned
    most of them, but time in this scenario might be critical.
    >> having a script that handles both dropping and creating the physical table, and also creating the SP?
    I do not undestand what is this second step. we said that you truncate the table, so why do you need to
    dropping and creating the physical table and who
    creating the SP?
    Are you meaning that the application create the tables and SP?
    There are lot of application that during installation create the database structure. is this what you mean?
      Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]

  • Error 'Loading Textfile data into external table'

    I am using Apex 2.0, Oralce Database 10G and Internet Explorer (version 6.5)
    I tried to run following code using SQLCommands of SQLWORKSHOP of Apex
    Code Here:
    declare
    ddl1 varchar2(200);
    ddl2 varchar2(4000);
    begin
    ddl1 := 'create or replace directory data_dir as
    ''C:\LAUSD_DATA\''';
    execute immediate ddl1;
    ddl2:= 'create table tbl_temp_autoload
    (ID NUMBER,
         RECTYPE VARCHAR2(2),
         EXPORTNBR NUMBER(2),
         EXPORTDATE DATE,
         BIMAGEID VARCHAR2(11),
         APPLICNBR NUMBER(10),
         MEALIMAGE VARCHAR2(17),
         MEDIIMAGE VARCHAR2(17),
         LANGUAGE VARCHAR2(1),
         APPLICCNT NUMBER(1),
         OTHAPPLICNBR VARCHAR2(10),
         PEDETDATE DATE,
         PESTATUS VARCHAR2(1),
         ERRORREMARKS VARCHAR2(50),
         COMMENTS VARCHAR2(50),
         SID1 VARCHAR2(10),
         WID1 NUMBER(10),
         MEDIROW1 VARCHAR2(1),
         LASTNAME1 VARCHAR2(20),
         FIRSTNAME1 VARCHAR2(20),
         SCHOOL1 VARCHAR2(15),
         LOCCD1 VARCHAR2(4),
         BIRTHDATE1 DATE,
         CASENBR1 VARCHAR2(15),
         FOSTER1 VARCHAR2(1),
         CHILDINC1 VARCHAR2(4),
         RACEAIAN VARCHAR2(1),
         RACEBAA VARCHAR2(1),
         RACENHPI VARCHAR2(1),
         RACEASIAN VARCHAR2(1),
         RACEWHITE VARCHAR2(1),
         HISPANIC VARCHAR2(1),
         NOTHISPANIC VARCHAR2(1),
         ADULTSIG3 VARCHAR2(1),
         ADULTSIGDATE3 VARCHAR2(10),
         ADULTNAME3 VARCHAR2(30),
         SSN3 VARCHAR2(1),
         SSN3NOT VARCHAR2(1),
         ADDRESS VARCHAR2(30),
         APTNBR VARCHAR2(6),
         CTY VARCHAR2(20),
         ZIP NUMBER(5),
         PHONEHOME VARCHAR2(12),
         PHONEWORK VARCHAR2(12),
         PHONEEXTEN VARCHAR2(6),
         MEALROWA VARCHAR2(1),
         LNAMEA VARCHAR2(20),
         FNAMEA VARCHAR2(20),
         MINITA VARCHAR2(6),
         GENDERA VARCHAR2(1),
         AGEA NUMBER(2),
         MOTYPEA VARCHAR2(1),
         MONAMEA VARCHAR2(1),
         FATYPEA VARCHAR2(1),
         FANAMEA VARCHAR2(1),
         FAMNBR NUMBER(1),
         PARENTINC NUMBER(5),
         FAMILYINC NUMBER(5),
         FAMILYSIZE NUMBER(2),
         PGSIG1 VARCHAR2(1),
         PGNAME1 VARCHAR2(30),
         PGSIGDATE1 VARCHAR2(10),
         FAMSIZE1 VARCHAR2(2),
         FAMINC1 VARCHAR2(6),
         PGSIG2 VARCHAR2(1),
         PGNAME2 VARCHAR2(30),
         PGSIGDATE2 DATE,
         FAMSIZE2 VARCHAR2(2),
         FAMINC2 VARCHAR2(4),
         GRADE NUMBER(2),
         SCHOOL VARCHAR2(40),
         RACE VARCHAR2(4),
         MEDI_CALID VARCHAR2(15),
         MEDSTATUS VARCHAR2(1),
         ADULT1NAME VARCHAR2(40),
         ADULT1TYPE VARCHAR2(1),
         ADULT1INC1 VARCHAR2(5),
         ADULT1INC2 VARCHAR2(5),
         ADULT1INC3 VARCHAR2(5),
         ADULT1INC4 VARCHAR2(5),
         ADULT2NAME VARCHAR2(40),
         ADULT2TYPE VARCHAR2(1),
         ADULT2INC1 VARCHAR2(5),
         ADULT2INC2 VARCHAR2(5),
         ADULT2INC3 VARCHAR2(5),
         ADULT2INC4 VARCHAR2(5),
         ADULT3NAME VARCHAR2(40),
         ADULT3TYPE VARCHAR2(1),
         ADULT3INC1 VARCHAR2(5),
         ADULT3INC2 VARCHAR2(5),
         ADULT3INC3 VARCHAR2(5),
         ADULT3INC4 VARCHAR2(5),
         ADULT4NAME VARCHAR2(40),
         ADULT4TYPE VARCHAR2(1),
         ADULT4INC1 VARCHAR2(5),
         ADULT4INC2 VARCHAR2(5),
         ADULT4INC3 VARCHAR2(5),
         ADULT4INC4 VARCHAR2(5),
         ADULT5NAME VARCHAR2(40),
         ADULT5TYPE VARCHAR2(1),
         ADULT5INC1 VARCHAR2(5),
         ADULT5INC2 VARCHAR2(5),
         ADULT5INC3 VARCHAR2(5),
         ADULT5INC4 VARCHAR2(5),
         ADULT6NAME VARCHAR2(40),
         ADULT6TYPE VARCHAR2(1),
         ADULT6INC1 VARCHAR2(5),
         ADULT6INC2 VARCHAR2(5),
         ADULT6INC3 VARCHAR2(5),
         ADULT6INC4 VARCHAR2(5),
         AGE1LT19 VARCHAR2(1),
         AGE2LT19 VARCHAR2(1),
         AGE3LT19 VARCHAR2(1),
         AGE4LT19 VARCHAR2(1),
         AGE5LT19 VARCHAR2(1),
         AGE6LT19 VARCHAR2(1),
         MIDINIT1 VARCHAR2(1)
    organization external
    ( type oracle_loader
    default directory data_dir
    access parameters
    ( fields terminated by '','' )
    location (''DataJuly07.txt'')
    execute immediate ddl2;
    end;
    Error Received:
    ORA-29913:error in executing ODCIEXITTABLEFETCH callout ORA-30653: reject limit reached
    Please help ASAP. I am new with oracle and Apex. Any help will be appreciated greatly.

    I downloaded the External table simple application from the Apex Packaged application and installed it. It installed successfully but when I run it - it doesn't load the data eventhough I get a message stating it was successful. I am running it on OracleXE - Apex 3.0.1.
    In addition, I tried running the stored procedure directly (ext_employees_load) in sql-developer and received the ora-30648.
    Please help.
    thanks,
    Tom

  • Comparison of Data Loading techniques - Sql Loader & External Tables

    Below are 2 techniques using which the data can be loaded from Flat files to oracle tables.
    1)     SQL Loader:
    a.     Place the flat file( .txt or .csv) on the desired Location.
    b.     Create a control file
    Load Data
    Infile "Mytextfile.txt" (-- file containing table data , specify paths correctly, it could be .csv as well)
    Append or Truncate (-- based on requirement) into oracle tablename
    Separated by "," (or the delimiter we use in input file) optionally enclosed by
    (Field1, field2, field3 etc)
    c.     Now run sqlldr utility of oracle on sql command prompt as
    sqlldr username/password .CTL filename
    d.     The data can be verified by selecting the data from the table.
    Select * from oracle_table;
    2)     External Table:
    a.     Place the flat file (.txt or .csv) on the desired location.
    abc.csv
    1,one,first
    2,two,second
    3,three,third
    4,four,fourth
    b.     Create a directory
    create or replace directory ext_dir as '/home/rene/ext_dir'; -- path where the source file is kept
    c.     After granting appropriate permissions to the user, we can create external table like below.
    create table ext_table_csv (
    i Number,
    n Varchar2(20),
    m Varchar2(20)
    organization external (
    type oracle_loader
    default directory ext_dir
    access parameters (
    records delimited by newline
    fields terminated by ','
    missing field values are null
    location ('file.csv')
    reject limit unlimited;
    d.     Verify data by selecting it from the external table now
    select * from ext_table_csv;
    External tables feature is a complement to existing SQL*Loader functionality.
    It allows you to –
    •     Access data in external sources as if it were in a table in the database.
    •     Merge a flat file with an existing table in one statement.
    •     Sort a flat file on the way into a table you want compressed nicely
    •     Do a parallel direct path load -- without splitting up the input file, writing
    Shortcomings:
    •     External tables are read-only.
    •     No data manipulation language (DML) operations or index creation is allowed on an external table.
    Using Sql Loader You can –
    •     Load the data from a stored procedure or trigger (insert is not sqlldr)
    •     Do multi-table inserts
    •     Flow the data through a pipelined plsql function for cleansing/transformation
    Comparison for data loading
    To make the loading operation faster, the degree of parallelism can be set to any number, e.g 4
    So, when you created the external table, the database will divide the file to be read by four processes running in parallel. This parallelism happens automatically, with no additional effort on your part, and is really quite convenient. To parallelize this load using SQL*Loader, you would have had to manually divide your input file into multiple smaller files.
    Conclusion:
    SQL*Loader may be the better choice in data loading situations that require additional indexing of the staging table. However, we can always copy the data from external tables to Oracle Tables using DB links.

    Please let me know your views on this.

  • Need help in Creating External Tables

    Hi All,
    I have a flat file containing numberic data, CLOB data, and also date columns data. I have to load this flat file data into staging server table using External tables. I have to write a stored procedure in such way creating exteranl tables dynamically. My question or need help from you people is that how to define the external table to load the CLOB data from flat file.
    Thanks,
    Sankar

    The LOCATION clause of an external table specifies the file or files to be read when the table is queried. You can change it to refer to different files without dropping and recreating the table and invalidating all dependent code.
    Regarding DBMS_SQL, yes you can do it the hard way if you prefer.
    Good point about CLOB columns in external tables. Quite possibly they are not supported, but I would have to check the manuals and try some examples.

  • Showing Text file as external table without trimming spaces

    Hi all:
    I am trying to display a text file from db sever with original spacing.
    Well it's not entirely related to APEX.
    This is how external table is created:
    create table u_x
      (rowline varchar2(255))
         ORGANIZATION EXTERNAL
           TYPE ORACLE_LOADER
           DEFAULT DIRECTORY ext_tab         <-- this is a dir i have created
           access parameters
           records delimited by newline
           fields notrim
           LOCATION ('aaa.txt')
    REJECT LIMIT UNLIMITED;
    on the first line of the aaa.text (its a report), it shows something like:
    Sat Dec 29                                                                Page 1
    but when I do select * from u_x , the result shows:
    Sat Dec 29 Page 1
    all above is done in sql workshop /sql command in APEX 4.2.1 (db 10.2.0.5)
    Is there any way to preserve the spaces between "29" and "Page"?
    (the result compressed all spaces in-between to 1 space).
    I think the ideal way is to invoke client's notepad to open the server's text file.
    anyway to generate the link?
    Thanks
    John

    Well, I have tried to download the file using below procedure.
    create or replace PROCEDURE download_bfile (
          directory_in   IN   VARCHAR2,
          file_in        IN   VARCHAR2
       AS
          lob_loc    BFILE;
          v_mime     VARCHAR2 (48);
          v_length   NUMBER(16);
       BEGIN
          lob_loc := BFILENAME (UPPER (directory_in), file_in);
          v_length := DBMS_LOB.getlength (lob_loc);
          -- set up HTTP header
          -- use an NVL around the mime type and
          -- if it is a null set it to application/octect
          -- application/octect may launch a download window from windows
          OWA_UTIL.mime_header (nvl(v_mime, 'application/octet'), FALSE);
          -- set the size so the browser knows how much to download
          HTP.p ('Content-length: ' || v_length);
          -- the filename will be used by the browser if the users does a save as
          HTP.p (   'Content-Disposition:attachment; filename="'
                 || SUBSTR (file_in, INSTR (file_in, '/') + 1)
                 || '";'
          -- close the headers
          OWA_UTIL.http_header_close;
          -- download the BLOB
          WPG_DOCLOAD.download_file (lob_loc);
          apex_application.stop_apex_engine;
       END download_bfile;
    I run it inside sql command in apex, but it does not show a pop window to save the file,
    it displays the whole text content of the file in the result window.
    Any idea why the save-as window does not pop up?
    thanks,
    John.

  • How to load external data without using external tables

    Hi,
    I'm asked to develop an ETL for loading external data into a database but, unfortunately, the vers. is 8i so I can't use external tables.
    I know that it's possible by using SQL-Loader. What I want to know is whether there's another way in 8i to load external data from a text file or a CSV file directly with a stored procedure without having to write CTL of SQL-Loader on the server. I mean, is there a way to write everything on the database the same manner I'd do whether I wrote data from a table to a file using for example UTL_FILE or the unique way is to write control files of SQL-Loader directly on the server?
    Thanks!

    Mark1970 wrote:
    Thank you very much Karthick
    I didn't know I could use UTL_FILE also for reading files. I've always use it only for writing data into external files.Yes you can use UTL_FILE to read. The version of oracle you are using i last used in 2004 :) Still remember giving the OS path of the file to open the file. That is long gone now. Its surprising that you are still in 8i.

  • ORA-00942 when creating external table under 10g with AQ

    I have an application that runs with AQ. The front-end queues up batch-type
    tasks in a queue. When one particular kind of message is dequeued, it
    initiates a data load. That load requires the creation of an external
    table.
    The schema in question is owned by user BL (bulkload). The queue
    is owned by BLB (bulkload batch), primarily to simplify some of the
    rules needed by the resource manager in order to limit the total CPU
    a batch process can consume. The BLB user has full access to the
    BL schema, along with the following rights:
    CREATE TYPE
    CREATE TABLE
    CREATE SEQUENCE
    CREATE PROCEDURE
    CREATE VIEW
    CREATE SYNONYM
    CREATE SEQUENCE
    ALTER SESSION
    CREATE SESSION
    QUERY REWRITE
    CREATE ANY CONTEXT
    EXECUTE_CATALOG_ROLE
    CREATE MATERIALIZED VIEW
    CREATE ANY DIRECTORY
    DROP ANY DIRECTORY
    The table creation works fine under 9.2.0.8 (our current required
    version). However the application generates an ORA-00942 table or view does
    not exist when run under 10g (10.2.0.1 and 10.2.0.3).
    The following statement is the problem:
    CREATE TABLE bulkload33 (
              field1 VARCHAR2(2000),field2 VARCHAR2(2000),field3 VARCHAR2(2000))
              ORGANIZATION EXTERNAL (
              TYPE oracle_loader DEFAULT DIRECTORY EXT_100
              ACCESS PARAMETERS ( RECORDS DELIMITED BY "\r\n"
              CHARACTERSET 'WE8ISO8859P1'
              BADFILE EXT_100:'bulkload_bad.csv'
              LOGFILE EXT_100:'bulkload_log.csv'
              FIELDS TERMINATED BY ','
              OPTIONALLY ENCLOSED BY '"' MISSING FIELD VALUES ARE NULL REJECT ROWS WITH ALL NULL FIELDS (
              field1 CHAR(2000),field2 CHAR(2000),field3 CHAR(2000),field4 CHAR(2000)))
              LOCATION ('bulkload.csv')
              ) REJECT LIMIT UNLIMITED PARALLEL;
    To clarify, the preceding statement, when handled by the process
    for a queue message, failes with an ORA-00942.
    Note that I can issue the command directly, as BLB or SYS, against
    the BL schema with no problems. Further, as user BLB or SYS, I can do
    the following:
    CREATE OR REPLACE PROCEDURE dotest
    IS
         l_sql varchar2(2000);
    BEGIN
         l_sql := 'CREATE TABLE bulkload33 (
              field1 VARCHAR2(2000),field2 VARCHAR2(2000),field3 VARCHAR2(2000))
              ORGANIZATION EXTERNAL (
              TYPE oracle_loader DEFAULT DIRECTORY EXT_100
              ACCESS PARAMETERS ( RECORDS DELIMITED BY "\r\n"
              CHARACTERSET ''WE8ISO8859P1''
              BADFILE EXT_100:''bulkload_bad.csv''
              LOGFILE EXT_100:''bulkload_log.csv''
              FIELDS TERMINATED BY '',''
              OPTIONALLY ENCLOSED BY ''"'' MISSING FIELD VALUES ARE NULL REJECT ROWS WITH ALL NULL FIELDS (
              field1 CHAR(2000),field2 CHAR(2000),field3 CHAR(2000),field4 CHAR(2000)))
              LOCATION (''bulkload.csv'')
              ) REJECT LIMIT UNLIMITED PARALLEL';
         EXECUTE IMMEDIATE l_sql;
    END;
    show errors
    EXEC dotest
    Does anyone have any ideas of why this doesn't work under 10g? Metalink
    has yielded no clues so far.
    Thanks.

    Define "has full access to the BL schema" given that it is impossible to grant access rights, in Oracle, by schema. What was done and how was it done?
    My guess is that the privs were granted in a role, rather than explicitly, as is required for PL/SQL.

Maybe you are looking for

  • The world clock on my IPOD touch is not telling the correct time

    My IPOD touch world clock is not displaying the correct time and the edit feature is not working to change the time

  • Outbound delivery was created but deleted

    Hello all, I create an outbound delivery from an order. SAP's system tells me that the outbound delivery 80002121 was created. After a short time I receive a message by mail from SAP to inform me of this outbound. After, when I'm trying to open this

  • Generating a certificate

    Hey All, So I just received an email saying that my vpn.xxxx.com is expiring. I'm trying to renew it but it wants a Certificate Signing Request. I've done this in servers before, but not in a 2811 router. Is there a command I use to generate it?

  • Searching in reverse with regular expressions

    I have recently constructed a "Find" dialog for my editor and would like to support the use of regular expressions (for people who know more about them than I do.) I have radio buttons that allow the user to search down (from the current caret positi

  • 3d constraints - shape layer materials, missing front

    Hi, Im a newbie to 3d in PS CS6 I have some text converted to a shape layer and then converted to New 3d Extrusion. I have all sides for materials instead of the front. The front seems to have broken into Boundary contraints, so was wondering is it p