-1

I have a .tbl file with data and I'm trying to import this data into a table. I'm using SQL Developer for this with this command:

load data infile "C:\path\users.tbl" 
insert into table users fields terminated by "|" lines terminated by "\r\n;

But nothing is working, the data is not loaded and no errors are shown...Do you see why it's not working?

vosicz
  • 59
  • 6
johy
  • 3
  • 1
  • 4

1 Answers1

1

That looks like SQL*Loader syntax.

For that to work, you'd have to run SQL*Loader, which is a separate command-line program available in your ORACLE_HOME/bin directory.

If you don't have an ORACLE_HOME, you'll need to install the client. Then open a shell/cmd window, and run your command there.

OR, if you want to use SQL Developer, you can use our wizard to read the file and insert the data, row-by-row.

SQL Developer's import table data wizard

thatjeffsmith
  • 20,522
  • 6
  • 37
  • 120
  • Thanks for your help! Im trying to follow your example with data import wizard. But when I select the users.tbl file it appears "cannot be opened due to the following error:null". – johy Mar 02 '16 at 16:39
  • The users.tbl file has this format: 1|john|email@email.email|active. – johy Mar 02 '16 at 16:43
  • 1
    sorry, you need to rename the file to users.tsv - the wizard wont' like your .tbl – thatjeffsmith Mar 02 '16 at 16:49
  • Thanks for your help again. Now I can import the file. But dont appear like your image, in your image you have each value in each column as it should be. In mine I just have one column and I each value has the entire row. – johy Mar 02 '16 at 16:59
  • It appears an area with title File Contents, and then just 1 column with 1000 rows. And in each row has the entire columns info! – johy Mar 02 '16 at 17:01
  • make sure the line terminator is right, and adjust the skip rows bit if necessary so that the 'first row' is indeed the column headers – thatjeffsmith Mar 02 '16 at 18:33
  • Thanks, I have that right. But dont works, in your image below area where you have your columns (STATE,COUNTRY,CITY,ID,...) I just have one column without title. And in that column I have 100 rows and in each row I just have one column that have the entire data, like this: 1|john|email@email.email|active| – johy Mar 02 '16 at 18:57
  • post a screenshot. or email me jeff.d.smith@oracle.com – thatjeffsmith Mar 02 '16 at 19:18
  • Thanks for your attention really! Here is a print: http://s15.postimg.org/tq7rqoye3/ask.png – johy Mar 02 '16 at 21:27
  • you have the delimiter set to 'tab' but it's clearly a | - change it – thatjeffsmith Mar 03 '16 at 14:46