简体   繁体   中英

Invalid table name while bulk insert in oracle

I am trying to insert values into Oracle table using Bulk Insert query but getting below error

ORA-00903: invalid table name
00903. 00000 -  "invalid table name"
*Cause:    
*Action:
Error at Line: 4 Column: 5

Here is my query

BULK INSERT TEST1.STUDENT
    FROM 'C:\Users\Alan\Desktop\STUDENT.txt'
        WITH
(
            FIELDTERMINATOR = '\t',
            ROWTERMINATOR = '\n'
);

Why is this error coming. Is there some issue with query? Please help. Thanks

Update

I changed by file format to CSV and wrote below query

LOAD DATA
INFILE 'C:\Users\Alan\Desktop\STUDENT.csv'
INTO TABLE TEST1.STUDENT
FIELDS TERMINATED BY ","
(ID,
NAME);

but above query is giving

ORA-00928: missing SELECT keyword
00928. 00000 -  "missing SELECT keyword"
*Cause:    
*Action:
Error at Line: 16 Column: 2

What is wrong in the above syntax?

This is not Oracle syntax at all. If you need to load data from file to table please use either SQLoader or External table
Some documentation about External table and SQLoader

If you're using SQLDeveloper you can also use import facility.

Please also have a look on that thread .

[EDIT}

LOAD DATA
INFILE 'C:\Users\Alan\Desktop\STUDENT.csv'
INTO TABLE TEST1.STUDENT
FIELDS TERMINATED BY ","
(ID,
NAME);

This is not a query. This is content of control file. Please save it to file load.csv then run cmd (or shell if yuo're on Linux) and type:

sqlldr user/pass control=load.ctl

Some examples you can find here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM