create an external table based on local drive

Hello world

Is it possible to create an external table and that it points to a file on my local drive?

It is perhaps a silly question. I'm sorry.

Thank you

Lydiea

In addition to the response of William Robertson (which is correct), if you do not have a way to make the server access to your local disk, you can use sql loader on your local computer to load the data into an actual table.

Tags: Database

Similar Questions

  • Creating the external Table - length fixed

    I was responsible for importing data in fixed length of a text file in an oracle table. To do this, I create an external Table. I'm finally at the point where the script works to create the table, but when I run a statement select for ' select * from external table ', I have received only a single line/record (the first line of the text file).

    This is what the script looks like:
    CREATE TABLE EXT_MD
    (
    AR_SID VARCHAR2 (12),
    AR_SSN VARCHAR2 (4).
    AR_LASTNAME VARCHAR2 (29),
    AR_FIRSTNAME VARCHAR2 (27),
    AR_RACE VARCHAR2 (1).
    DATE OF AR_DOB,
    NA_LASTNAME VARCHAR2 (29),
    NA_FIRSTNAME VARCHAR2 (27),
    NA_SEX VARCHAR2 (1).
    ID_FBI_ID VARCHAR2 (9).
    AR_ARR_DATE VARCHAR (26).
    AR_PRIMARY_CHARGE VARCHAR2 (35),
    DEM_STREET_NBR VARCHAR2 (5).
    DEM_STREET_NAM VARCHAR2 (10),
    DEM_STREET_SFX VARCHAR2 (2),
    DEM_STREET_DIR VARCHAR2 (2),
    DEM_CITY VARCHAR2 (10),
    DEM_STATE VARCHAR2 (2),
    DEM_ZIP VARCHAR2 (5).
    AR_TRACK_NUM VARCHAR2 (12),
    DEM_ORI VARCHAR2 (9)
    )
    EXTERNAL ORGANIZATION
    (TYPE ORACLE_LOADER
    THE DEFAULT DIRECTORY EXT_DIR
    ACCESS SETTINGS
    (
    RECORDS DELIMITED BY NEWLINE
    BADFILE EXT_DIR: 'ext_bag.bad'
    EXT_DIR LOG file: 'ext_good.log'
    FIELDS
    MISSING FIELD VALUES ARE NULL
    (
    AR_SID(1:12) CHAR (12),
    AR_SSN(13:16) CHAR (4),
    AR_LASTNAME(17:45) TANK (29),
    AR_FIRSTNAME(46:72) TANK (27),
    AR_RACE(73:73) CHAR (1),
    AR_DOB(74:83) CHAR(10) DATE_FORMAT DATE MASK "YYYY-MM-DD"
    NA_LASTNAME(84:112) TANK (29),
    NA_FIRSTNAME(113:139) TANK (27),
    NA_SEX(140:140) CHAR (1),
    ID_FBI_ID(141:149) CHAR(9),
    AR_ARR_DATE(150:175) TANK (26),
    AR_PRIMARY_CHARGE(176:210) CHAR (35),
    DEM_STREET_NBR(211:215) CHAR (5),
    DEM_STREET_NAM(216:225) CHAR(10),
    DEM_STREET_SFX(226:227) CHAR (2),
    DEM_STREET_DIR(228:229) CHAR (2),
    DEM_CITY(230:239) CHAR(10),
    DEM_STATE(240:241) CHAR (2),
    DEM_ZIP(242:246) CHAR (5),
    AR_TRACK_NUM(247:258) CHAR (12),
    DEM_ORI(259:267) TANK (9)
    )
    )
    LOCATION ("daily.txt")
    )
    REJECT LIMIT UNLIMITED;

    That's what part of the log file looks like:

    For table EXT_MD field definitions
    Record format DELIMITED BY newline
    Data in file have same "endianness" as platform
    Rows with all null fields are accepted

    Fields of the Data Source:

    AR_SID TANK (12)
    Position of the record (1: 12)
    Cut the whites of right
    AR_SSN CHAR (4)
    Position of the record (13: 16)
    Cut the whites of right
    etc (shows the rest of the columns with similar message) then at the end of the log file

    Transformations of columns
    ROWID

    Date table EXT_MD Cache statistics
    Maximum size: 1000
    Entries: 1
    Hits: 0
    Rate: 0

    Assistance or management will most certainly be appreciated. Thanks in advance.

    Published by: zephyr223 on March 25, 2013 10:47

    Hello
    Which characters do you have in your data file that define the "line break".

    Oracle documentation:

    If DELIMITED BY NEWLINE is specified, then the actual value used is platform-specific. On UNIX platforms, NEWLINE is assumed to be "\n". On Windows NT, NEWLINE is assumed to be "\r\n".
    

    you have these 'hidden' characters in your folder or are they something else?

    Kind regards
    Harry

  • Creating the external Table to alert log

    Hello

    I create an external table in oracle database 11g for the alert log file monitoring (to find the ORA errors), I used this statement to create an external table

    Create the directory TESTForAlertLog as 'E:\oracle\product\10.2.0\admin\db\bdump '.

    create table Alert_Log)
    Message varchar2 (30),
    Date of the day
    )
    (external) Organization
    type oracle_loader
    Default directory TESTForAlertLog
    (settings) access
    records delimited by newline
    fields ended by ',' possibly framed by "" "
    missing field values are null
    (
    "Message."
    'DAY' DATE 'DD MM YYYY ".
    )
    )
    location ("alert_db.log")
    )
    reject limit unlimited;

    Output is

    DAY OF MSG

    ORACLE V10.2.0.1.0 - Production vsnsta = 0
    ORACLE V10.2.0.1.0 - Production vsnsta = 0
    ORA-1109 marked during: ALTER DATABASE CLOSE NORMAL...
    ORA-00313: open failed for the members of the group log 1 of thread 1
    ORA-00312: thread 1 1 online journal: ' E:\ORACLE\PRODUCT\10.2.0\ORADATA\db\REDO01. JOURNAL"
    ORA-27041: could not open the file
    ORA-00313: open failed for the members of the Group of newspapers wire 2 1
    ORA-00312: wire 2 1 online journal: ' E:\ORACLE\PRODUCT\10.2.0\ORADATA\db\REDO02. JOURNAL"
    ORA-27041: could not open the file
    ORA-00313: open failed for the members of Group 3, Journal of thread 1
    ORA-00312: wire 3 1 online journal: ' E:\ORACLE\PRODUCT\10.2.0\ORADATA\db\REDO03. JOURNAL"
    ORA-27041: could not open the file
    ORACLE V10.2.0.1.0 - Production vsnsta = 0
    ORACLE V10.2.0.1.0 - Production vsnsta = 0

    But I need the eyes of output like this


    DAY OF MSG

    ORACLE V10.2.0.1.0 - Production vsnsta = 0 lun 22 dec 13:10:48 2008
    ORACLE V10.2.0.1.0 - Production vsnsta = 0 lun 22 dec 13:10:48 2008
    ORA-1109 marked during: ALTER DATABASE CLOSE NORMAL...
    ORA-00313: open failed for the members of the group log 1 of thread 1
    ORA-00312: thread 1 1 online journal: ' E:\ORACLE\PRODUCT\10.2.0\ORADATA\db\REDO01. JOURNAL"Mon dec 22 13:10:48 2008
    ORA-27041: could not open the file
    ORA-00313: open failed for the members of the Group of newspapers wire 2 1
    ORA-00312: wire 2 1 online journal: ' E:\ORACLE\PRODUCT\10.2.0\ORADATA\db\REDO02. JOURNAL"Mon dec 22 13:10:48 2008
    ORA-27041: could not open the file
    ORA-00313: open failed for the members of Group 3, Journal of thread 1
    ORA-00312: wire 3 1 online journal: ' E:\ORACLE\PRODUCT\10.2.0\ORADATA\db\REDO03. JOURNAL"Mon dec 22 13:10:48 2008
    ORA-27041: could not open the file
    ORACLE V10.2.0.1.0 - Production vsnsta = 0
    ORACLE V10.2.0.1.0 - Production vsnsta = 0

    I need the message and time of the message occurred

    No idea... is it possible to get this output...


    Thank U very much

    Concerning

    SHAN

    Read this - he explains how:
    http://www.singleQuery.com/2007/02/read-the-alert-log-with-SQL/

  • Oracle 11 SPR: create 2 logical Tables based on 1 physical Table

    Hello

    I have a dimension table date in the physical layer. Since I need to create 2 dimension tables date in the MDB layer. One for the date of the order, and the other is for the shipping date. There is a ship_date_key and an order_date_key in my fact table that I try to use my foreign key.  Seems I can create a table of logic date arrived at the ship or a logical table of date joint command, but not both.

    Very new to the OBI administration tool.  Any help would be greatly appreciated.

    If you don't create an alias of the Date dimension in the physical layer, then you can get the data that one or the other Date of delivery or date order Details.

    The Date dimension data are retrieved based on the join is to tell which button it was joined to the fact.

    To resolve the ambiguity above, you must create two separate alias tables in the physical layer, so you will have two logical tables in MDB layer

    Create Dim_Ship_Date and Dim_Order_Date of the Date dimension.

    And now you can join the fact with these two aliases on different tones. This practice is usually followed.

    If deemed useful response

    -----

    Srikanth

  • Create an external table to import csv to dynamic action

    Hello

    I'm trying to import data from a csv file into a table. The csv is located on the server and I try to do an external table to copy its contents to the master data table.
    I can't even save the code, without this error:
    PLS-00103: Encountered the symbol "CREATE" when expecting one of the following:
    ( begin case declare exit for goto if loop mod null pragma raise return select update
    while with <an identifier> <a double-quoted delimited-identifier> <a bind variable>
    << continue close current delete fetch lock insert open rollback savepoint set sql execute
    commit forall merge pipe purge
    It works very well in the SQL Developer.
    CREATE TABLE  "DATA_CSV" 
       (     "C1" VARCHAR2(255), 
         "C2" VARCHAR2(255), 
         "C3" VARCHAR2(255), 
         "C4" VARCHAR2(255), 
         "C5" VARCHAR2(255), 
         "C6" VARCHAR2(255), 
         "C7" VARCHAR2(255), 
         "C8" VARCHAR2(255), 
         "C9" VARCHAR2(255), 
         "C10" VARCHAR2(255), 
         "C11" VARCHAR2(255), 
         "C12" VARCHAR2(255), 
         "C13" VARCHAR2(255), 
         "C14" VARCHAR2(255), 
         "C15" VARCHAR2(255), 
         "C16" VARCHAR2(255), 
         "C17" VARCHAR2(255), 
         "C18" VARCHAR2(255), 
         "C19" VARCHAR2(255), 
         "C20" VARCHAR2(255)
       )
        ORGANIZATION EXTERNAL
        (
          TYPE ORACLE_LOADER
          DEFAULT DIRECTORY FTP_FOLDER
          ACCESS PARAMETERS (
            records delimited BY newline
            fields terminated BY ';'
            optionally enclosed BY '"'
            lrtrim
            missing field VALUES are NULL
          )
        LOCATION ('foo.csv')
        );
    {code}
    
    The server I work on, runs on Apex 4.2.2.
    
    Thanks in advance, for your help
    Skirnir                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

  • Create an external table fails

    I'm trying to map a trace file in an external table ' but I get the error message "missing the key word."
    set verify off
    
    create or replace directory 'TRACE_DIR' as '/db_home/oracle/product/diag/rdbms/test/dtms_t/trace';
    
    column id new_value os_user;
    SELECT sys_context('USERENV', 'OS_USER') id FROM DUAL;
    
    BEGIN
          EXECUTE IMMEDIATE 'alter session set tracefile_identifier = &os_user' ; 
    END;
    /
    
    column tracefile_loc new_value tracefile
    select SUBSTR(tracefile_loc,INSTR(tracefile_loc,'/',-1)+1) tracefile_loc
    from
     ( select value ||'/'||(select instance_name from v$instance) ||'_ora_'||
                  (select spid||case when traceid is not null then '_'||traceid else null end
                        from v$process where addr = (select paddr from v$session
                                                     where sid = (select sid from v$mystat
                                                                  where rownum = 1
                                                                 )
                                                    )
                  ) || '.trc' tracefile_loc
       from v$parameter where name = 'user_dump_dest'
     )
    /
    
    jbrock@ddtms_t> CREATE TABLE trace_ext
      2                     (line varchar2(80)
      3                     )
      4       ORGANIZATION EXTERNAL
      5       (
      6         TYPE ORACLE_LOADER
      7         DEFAULT DIRECTORY trace_dir
      8         ACCESS PARAMETERS
      9         (
     10           records delimited by newline
     11           missing field values are null
     12           ( line
     13           )
     14         )
     15         LOCATION (&&tracefile)
     16       )
     17       REJECT LIMIT UNLIMITED;
           LOCATION (ddtms_t_ora_9101_JBROCK.trc)
                                                *
         
    ERROR at line 15:
    ORA-00905: missing keyword

    Hello

    JimmyB wrote:

    ... jbrock@ddtms_t> CREATE TABLE trace_ext
    2                     (line varchar2(80)
    3                     )
    4       ORGANIZATION EXTERNAL
    5       (
    6         TYPE ORACLE_LOADER
    7         DEFAULT DIRECTORY trace_dir
    8         ACCESS PARAMETERS
    9         (
    10           records delimited by newline
    11           missing field values are null
    12           ( line
    13           )
    14         )
    15         LOCATION (&&tracefile)
    16       )
    17       REJECT LIMIT UNLIMITED;
    LOCATION (ddtms_t_ora_9101_JBROCK.trc)
    *
    
    ERROR at line 15:
    ORA-00905: missing keyword
    

    The location must not be single-quotes? For line 15, try

    LOCATION ('&&tracefile')
    
  • Helps to create an external table to a dashboard

    I am creating a table in an external file that will receive and organize partitions from Quiz.fla when you click on the button to submit the results.  I also want another fla file to reference the external table and pull 15 scores him and then view scores on a scrolling banner.  I want the banner to be able update dynamically (I guess it would accomplish the reloading of the banner fla every time it reaches the end of its cycle, with the first load of the image of the outer table on an onClipEvent action), how it will update while remaining open.  The main reason that I need two separate files for the quiz and the banner of the score is that they are displayed on two different monitors.  What would be the most effective way to solve this problem?  I know a little actionscript, but I don't have much experience with the call for data and functions from external fla or as files (table and function referring to the way in which the data will be organized inside the table will be in a file separate .as).

    I currently work in AS2, since I had almost no experience with AS3.

    Please mark this thread as answered, if it is closed.

  • Creating an external Table using Xml Dataset - how to include null values?

    The script below works fine, but I'm fails as soon as the xml file does not contain a column for a line, or has the value as "< ACTUAL_FLAG / >.

    Is there way I can show the missing values as null?

    With the help of "missing field is null values" does not work for me.

    Any help would be appreciated.


    < < < < < < < < < <
    / * Formatting on the 2010-05-24 14:53:01 (v5.136.908.31019 PS5) * /.
    DROP TABLE ENE_GL_SAP_TEMP;

    CREATE TABLE ENE_GL_SAP_TEMP
    (
    status VARCHAR2 (50).
    number of ledger_id (15),
    set_of_books_id NUMBER (15),
    accounting_date DATE,
    CURRENCY_CODE VARCHAR2 (15).
    Date_Created DATE,
    created_by NUMBER (15),
    actual_flag VARCHAR2 (1).
    user_je_category_name VARCHAR2 (25).
    user_je_source_name VARCHAR2 (25).
    Segment1 VARCHAR2 (25).
    Segment2 VARCHAR2 (25).
    segment3 VARCHAR2 (25).
    segment4 VARCHAR2 (25).
    segment5 VARCHAR2 (25).
    segment6 VARCHAR2 (25).
    segment7 VARCHAR2 (25).
    entered_dr NUMBER,
    entered_cr NUMBER,
    accounted_dr NUMBER,
    accounted_cr NUMBER,
    Reference1 VARCHAR2 (100)
    )
    EXTERNAL ORGANIZATION
    (
    TYPE ORACLE_LOADER
    THE DEFAULT DIRECTORY ENE_SOLAR_FTP_IN_DIR
    ACCESS SETTINGS
    (
    records delimited by ' < / GL_REC >.
    BadFile "temp.bad."
    logfile "temp.log.
    fields)

    filler TANK (2000) TERMINATED BY "< GL_REC >,"
    status (50) tank surrounded by '<>STATUS' and ' < / STATUS >. "
    ledger_id char (15), framed by '< LEDGER_ID >' and ' < / LEDGER_ID >, "
    set_of_books_id char (15), framed by '< SET_OF_BOOKS_ID >' and ' < / SET_OF_BOOKS_ID >, "
    accounting_date char (11), framed by '< ACCOUNTING_DATE >' and ' < / ACCOUNTING_DATE >, "
    Char (15) currency_code framed by '< CURRENCY_CODE >' and ' < / CURRENCY_CODE >. "
    tank (11) Date_Created framed by '< DATE_CREATED >' and ' < / DATE_CREATED > "date_format DATE mask MON/dd/yyyy". "
    created_by char (12), framed by '< CREATED_BY >' and ' < / CREATED_BY >. "
    actual_flag char (1) surrounded by '< ACTUAL_FLAG >' and ' < / ACTUAL_FLAG >, "
    user_je_category_name tank (25), framed by '< USER_JE_CATEGORY_NAME >' and ' < / USER_JE_CATEGORY_NAME >, "
    user_je_source_name tank (25), framed by '< USER_JE_SOURCE_NAME >' and ' < / USER_JE_SOURCE_NAME >, "
    tank (25) Segment1 framed by '< SEGMENT1 >' and ' < / SEGMENT1 >. "
    tank (25) Segment2 framed by '< SEGMENT2 >' and ' < / SEGMENT2 >. "
    tank (25) segment3 framed by '< SEGMENT3 >' and ' < / SEGMENT3 >. "
    segment4 tank (25), framed by '< SEGMENT4 >' and ' < / SEGMENT4 >, "
    tank (25) segment5 framed by '< SEGMENT5 >' and ' < / SEGMENT5 >, "
    segment6 tank (25), framed by '< SEGMENT6 >' and ' < / SEGMENT6 >, "
    segment7 tank (25), framed by '< SEGMENT7 >' and ' < / SEGMENT7 >. "
    entered_dr char (15), framed by '< ENTERED_DR >' and ' < / ENTERED_DR >, "
    entered_cr char (15), framed by '< ENTERED_CR >' and ' < / ENTERED_CR >, "
    accounted_dr char (15), framed by '< ACCOUNTED_DR >' and ' < / ACCOUNTED_DR >, "
    accounted_cr char (15), framed by '< ACCOUNTED_CR >' and ' < / ACCOUNTED_CR >, "
    tank (100) of reference1 framed by '< REFERENCE1 >' and ' < / REFERENCE1 >.



    )
    )
    LOCATION ("books2.xml")
    )
    PARALLEL
    REJECT LIMIT UNLIMITED;


    Select * from ENE_GL_SAP_TEMP;

    > > > > > > > > > > > > > > > > > >

    Hello

    It's funny, I never thought of parsing an XML through SQL * Loader before.

    Are you aware of the XML DB features? They are intended only for what you are doing here.

    Also, please look at function XMLTable. It allows you to directly map your XML file in columns and relational rows.

    For example, by giving an example of file "book.xml" like this:

    
    
     
      1
      2
      ABC
      DEF
     
     
      1
      3
      XYZ
      TTT
     
    
    

    Then, just do:

    SELECT *
    FROM XMLTable(
     '/GL_RECS/GL_REC'
     passing xmltype( bfilename('XML_DIR','book.xml'), nls_charset_id('CHAR_CS') )
     columns
      status varchar2(50) path 'STATUS',
      ledger_id varchar2(15) path 'LEDGER_ID',
      segment1 varchar2(25) path 'SEGMENT1',
      segment2 varchar2(25) path 'SEGMENT2'
    );
    
  • Create an external Table - KUP-04020

    11.2.0.1.0 64-bit

    ...  ORGANIZATION EXTERNAL
        (TYPE ORACLE_LOADER
         DEFAULT DIRECTORY ext_tab_dir
         ACCESS PARAMETERS
           (RECORDS DELIMITED BY NEWLINE
              FIELDS TERMINATED BY ',' ENCLOSED BY '"'
              (... {code}
    
    
    {code}ORA-29913: error in executing ODCIEXTTABLEFETCH callout
    ORA-29400: data cartridge error
    KUP-04020: found record longer than buffer size supported, 524288, in c:\ext_tables\nff.csv{code}
    
    When opening up the data for examination, the records are delimited with LF, and not CRLF.  
    Would this be picked up with delimiter NEWLINE, or should I use something else?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        

    To resolve this problem, change the delimiter CHARACTERSET and reviews

    ex:
    saves the delimiter character > record delimiter '\n '.

    Add in the parameters of access CHARACTERSET 'utf8 '.

  • creating an external table

    Hello

    I made an excel csv file, but some of the columns of the excel file are null, so I did type .dat
    and when I try: select *.
    from caen:

    I get this error:

    Error at startup on line 2 of the command:
    Select *.
    Caen
    Error report:
    SQL error: ORA-29913: error in executing ODCIEXTTABLEFETCH legend
    ORA-30653: reject limit reached
    29913 00000 - "error in the execution of %s legend".
    * Cause: The execution of the specified legend caused an error.
    * Action: Examine the error messages take appropriate measures.

    I also have a comma after each line FRO this .dat file.
    Can you help me to import this file?

    Thank you

    Some of your data values seem to have a comma in the data:

    Cultivarea cerealelor (exclusiv orez), plantelor leguminoase si aplantelor producatoare de seminte oleaginoase
    Cultivarea legumelor si a pepenilor, a radacinoaselor si tuberculilor
    Cultivarea fructelor arbustilor fructiferi, capsunilor, nuciferilorsi a altor pomi fructiferi
    Cultivarea condimentelor, plantelor aromatice, medicinale si aplantelor de uz farmaceutic
    

    I suggest that you change your data file if you can so that text fields are surrounded with double quotes.

  • Create the external data with dates table

    I have a CSV file that looks a little like this:

    abcuser,12345,5/12/2012,5,250.55
    xyzuser, 67890, 5/1/2012,1,50
    ghjuser, 52523, 1 January 00

    When I create the external table, then question him, I get an error of date:

    CREATE TABLE xtern_ipay
    (
    username VARCHAR2 (50).
    acctNbr NUMBER 20 (0)
    datelastused DATE,
    number_rtxns NUMBER (12: 0).
    amtused NUMBER (12: 0)
    )
    external organization (TYPE oracle_loader DEFAULT directory "XTERN_DATA_DIR"
    (Settings) ACCESS
    records delimited BY newline completed fields BY ',')
    release location ("SubscriberStatistics.csv") limit) UNLIMITED;

    The error I see in the newspaper of rejection:
    For table XTERN_IPAY field definitions
    Record format DELIMITED BY newline
    Data in file have same "endianness" as platform
    Rows with all null fields are accepted

    Fields of the Data Source:

    USERID CHAR (255)
    Completed by «,»
    Trim whitespace same as SQL Loader
    ACCTNBR CHAR (255)
    Completed by «,»
    Trim whitespace same as SQL Loader
    DATELASTUSED CHAR (255)
    Completed by «,»
    Trim whitespace same as SQL Loader
    NUMBER_RTXNS CHAR (255)
    Completed by «,»
    Trim whitespace same as SQL Loader
    AMTUSED CHAR (255)
    Completed by «,»
    Trim whitespace same as SQL Loader
    column in treatment of DATELASTUSED error in the row 1 for the g:\externaltables\SubscriberStatistics.csv data file
    ORA-01858: a non-digit character was found here where was waiting for a digital
    column in treatment of DATELASTUSED error in line 2 to the g:\externaltables\SubscriberStatistics.csv data file
    ORA-01858: a non-digit character was found here where was waiting for a digital
    column in treatment of DATELASTUSED error on line 3 for the g:\externaltables\SubscriberStatistics.csv data file
    ORA-01858: a non-digit character was found here where was waiting for a digital


    Any ideas on that? I know I must tell oracle the date on the external file format, but I can't understand it.
  • Creating external Tables using the EXECUTE IMMEDIATE in PL/SQL

    Hi guys,.

    I am trying to create an external Table using the EXECUTE IMMEDIATE in a procedure and I managed to compile and no errors were generated. But when I try to run it from sql using the exec command I get the following error:

    ------------------------------------------------------------------------
    ERROR on line 5:
    ORA-00911: invalid character
    ORA-06512: at "GEO. TEST_DDL', line 4
    ORA-06512: at line 5

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

    I tried to check the whole statement to create the external table, but I can't find where is the error. Surprisingly, if I simply run the command table create external on sqlplus it works, but not a procedure.

    If anyone can help with ideas or experience?

    Geoffrey Kossami

    The error means that there is an identifier somewhere that starts with a nonalphanumeric. This is a typical mistake of editing. A procedure compiles correctly is not of course because the underlying dynamic sql running is OK. Which of course only be resolved when you try to run it.

    There is certainly a problem with the text you provide to be run as a piece of dynamic sql code. You should try to watch it with dbms_output and run this code in sqlplus. But your problem is with the code you run as dynamic PL/SQL, it is not itself compilable.

    Jack

  • When to load the external table condition


    Hello

    Is my version of db: oracle 11g

    I have a 6 gig csv file.

    I divided it several 15 MB csv files.

    But only the first csv file has header (with column headers).

    I have to load each of these files into a target table.

    I created an external table with jump 1.

    But how can I substitute jumping 1 for other csv files.

    Is there a way I can do it in the external table definition.

    I can't merge the split csv files and run as one big file. So I don't hv this option. Please advice.

    You should be able to use the LOAD WHEN clause to exclude a line based on the contents of a field. Or the other

    WHEN LOAD 1 / 2! = "ID".

    or, if the bonds are quoted,

    WHEN LOAD 1:4! = « « ID » »

    or you can always add a list of fields to your specifications and the names of the fields in the reference LOAD WHEN the condition instead of using an absolute position.

    Don't know if you saw my comments on the use of the tail command before you replied, but if the break-up of the file is part of your project of automated process, and then deleting the header row could certainly be integrated into this process if your on a unix platform and using the split command to split the file.

    Kind regards

    Bob

  • With the help of external Tables

    HELO - I have a few questions regarding the use of external tables, as I have not worked with them before.

    From what I read, looks like they are more intended instead of SQL Loader, to simply load the data. But I was wondering if they are also used for queries. I ask because we usually create temporary tables to load the data provided by the company and we then attach this information to our main tables. The file that we just received is more 3 million lines, so I was wondering if it might be appropriate to use an external table and also, I can query this external table directly or will it still my temporary table as well.

    In addition, it's the syntax that I found to create an external table and I was wondering if something escapes me.
    SQL> create table xtern_empl_rpt
      2      ( empl_id varchar2(3),
      3        last_name varchar2(50),
      4        first_name varchar2(50),
      5        ssn varchar2(9),
      6       email_addr varchar2(100),
      7        years_of_service number(2,0)
      8      )
      9      organization external
     10      ( default directory xtern_data_dir
     11        access parameters
     12        ( records delimited by newline
     13          fields terminated by ','
     14        )
     15        location ('employee_report.csv')  
     16    );
    I appreciate all the comments...

    Thank you!
    Christine

    Hello

    Based on what I read

    It would be good to know what you have read sofar and where...

    I can query this external table directly

    Yes, once you have created.
    An external table allows to process a file as if it were a table.
    Don't forget that you can query only, you can not the update/delete/insert in an external table.

    You can find many examples by searching on this forum,
    or http://asktom.oracle.com
    (for example: http://asktom.oracle.com/pls/asktom/f?p=100:11:0:::P11_QUESTION_ID:6611962171229))
    or http://www.oracle-base.com/articles/9i/ExternalTables9i.php
    or the Oracle Documentation @ http://tahiti.oracle.com

  • Facing many problems on the creation of directory and an external Table

    Question:

    The strange thing is that if you look at the question 10-b page 3-41, it says:
    (page 3-41 "Oracle Database 10g SQL Fund. II Vol.1")

    Merge the data into the EMP_DATA table that is created in the lab last in the data in the table emp_hist. assume
    EMP_DATA external table data corresponds to the EMP_HIST of table, update the email column
    table EMP_HIST to match the row in the EMP_DATA table. If a row in the EMP_DATA table is not
    match, to be inserted in the tables of EMP_HIST lines are considered as corresponding whenever his first and
    family name are the same.

    For me, this issue is built wrong. First of all in the last lab we have not been asked to create EMP_DATA. Secondly, EMP_DATA is empty.
    Thirdly, this question asks us to merge into the table EMP_HIST while EMP_DATA is empty.

    Table EMP_HIST currently copied data from the employees table. Structure EMP_HIST:

    FIRST NAME VARCHAR2 (20)
    LAST_NAME NOT NULL VARCHAR2 (25)
    EMAIL NOT NULL VARCHAR2 (45)

    Anway, I did the merger as follows:

    merge into e emp_hist
    with the help of emp_data d
    on (e.first_name = d.first_name)
    When matched then
    game update
    Select = d.last_name,
    e.email = d.email
    When not matched then
    Insert values (d.first_name, d.last_name, d.email);

    I get this error:

    Error report:
    SQL error: ORA-29913: error in executing ODCIEXTTABLEOPEN legend
    ORA-29400: data cartridge error
    KUP-04040: file emp.dat in EMP_DIR not found
    ORA-06512: at "SYS." ORACLE_LOADER', line 19
    29913 00000 - "error in the execution of %s legend".
    * Cause: The execution of the specified legend caused an error.
    * Action: Examine the error messages take appropriate measures.

    On the other hand, I said I'm going to try this:

    merge into emp_data d
    using e emp_hist
    on (d.first_name = e.first_name)
    When matched then
    game update
    d.last_name = select,
    d.email = e.email
    When not matched then
    Insert values (e.first_name, select, e.email);

    I get this error because the external table is final once its creation is as far as I know:

    Error report:
    SQL error: ORA-30657: operation not supported on external organized table
    30657.0000 - "operation not supported on external-organized table".
    * Cause: User attempted on the operation on an external table which is
    not supported.
    * Action: Don't do that!

    **********************************

    I don't know what to do. I did my best, please help.

    Published by: user11164565 on July 27, 2009 02:43

    user11164565 wrote:
    NOTE: I did my best, I've done everything I can do, but the problem persists. Help, please

    I'll mention all the steps that I made it clear...

    I gave scott the following grants:

    grant create any directory Scott;
    grant read on the directory emp_dir to scott;

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

    1. create a directory and its been created successfully:

    create or replace directory emp_dir
    like 'F:\emp_dir ';

    Then I made just to make sure that my directory is recognized the following:

    SELECT *.
    OF dba_directories;

    I found the drive among the results...

    OWNER NOM_REPERTOIRE
    ------------------------------ ------------------------------
    DIRECTORY_PATH
    --------------------------------------------------------------------------------
    SYS EMP_DIR
    F:\emp_dir

    SYS SUBDIR
    D:\oracle\product\10.2.0\db_1\demo\schema\order_entry\/2002/Sep

    SYS XMLDIR
    D:\oracle\product\10.2.0\db_1\demo\schema\order_entry\

    ----------------------
    2. I created an external table emp_data (the script is given by the text book): successfully done

    drop table emp_data;

    CREATE TABLE emp_data
    (first name VARCHAR2 (20))
    , last_name VARCHAR2 (20)
    , email VARCHAR2 (30)
    )
    EXTERNAL ORGANIZATION
    (
    TYPE oracle_loader
    Emp_dir default DIRECTORY
    ACCESS SETTINGS
    (
    RECORDS DELIMITED BY NEWLINE CHARACTERSET US7ASCII
    NOBADFILE
    NOLOGFILE
    FIELDS
    (first name POSITION (01:20) TANK)


    , last_name POSITION (22:41) TANK
    CHAR POSITION (43:72) by email)
    )
    LOCATION ('emp.dat'));

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

    3. I went to drive F:\ to see if emp_dir file exist or not! I did not see it. I checked the files hidden, nothing. Anyway, I ignored and did step 4.

    "Anyway, I ignored him... "

    and so the rest of your problems. I do not see in the steps you told that acually you created a directory ("folder") named "\emp_dir" on your f: drive. Anything that you create the database will actually create this directory on the operating system. Uttering a directory in Oracle, uttering an external table in Oracle, don't create pointers to Oracle objects will assume just actually exists.

Maybe you are looking for

  • Help with a game called "QUAKELIVE.

    I played this game called QUAKELIVE, and sometimes when I join a match, it resumed its course he played and finally my computer screen everything black. Y at - it an update for NVIDIA? is it because QUAKELIVE is in beta? Additional information:The Ve

  • Why are all my documents gradually reclassified 'read-only '?

    This has just started, too and we have not in by me.  Are they being encrypted or compressed to save space on an old machine?

  • Event id 1101 on Vista home difficulty Viewer

    I have Vista Home and my computer crashes at least once a day, so I check the event viewer and I see that I always get this error http://technet.microsoft.com/en-us/library/cc727052 (WS.10) .aspx whenever my computer crashes. I'm looking around and I

  • HP officejet pro k550 will not print a test page using the printer buttons.

    How to print a test page to make sure that this printer is still operational? I tried all the instructions release possible jams printer, deleted and reinserted the printheads and clean the rollers.  When you press the keys on the front of the printe

  • IR report 11.1.2.2 movement

    Hi allCurrently, we are in a process of recovery of the company and we work on our Brio system moving from one environment to another.Below are the process that we follow...Plan a:1 run the utility of LCM and take a backup full of the old system of s