Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Create external table for csv import from dynamic action

SkirnirJun 3 2013 — edited Jun 4 2013
Hello,

I try to import some data from a csv to a table. The csv lies on the server and i try to make it to 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 fine 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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
This post has been answered by jariola on Jun 4 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 2 2013
Added on Jun 3 2013
11 comments
2,566 views