Home » DbVisualizer Forums » DbVisualizer » DbVisualizer - BETA versions

Thread: Importing SQL script from file Error

This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 5 - Pages: 1 - Last Post: Aug 12, 2011 2:40 PM Last Post By: salim
salim

Posts: 22
Registered: 05/03/11
Importing SQL script from file Error
Posted: Aug 12, 2011 12:41 PM
 
   thread.click_reply Reply
Hi,

I'm trying to import a SQL huge script to insert data to my table, what i tried is to paste the script to my sql editor but unfortunately i get an out of memory exception which is normal. I then tried:

1. Click on import table data by selecting my table.
2. Select my Sql file(my insert statements), By default the encoding is cp1252, I click on next.
3. On the Data datagrid, on the first column you would see the part of the insert statement which is wrong.
4. I then click on next and select current database radio button, i click on next and click on import.

The import always failed. Is there another way to import table data from one database to another?

Regards,
Salim
Roger Bjarevall


Posts: 5,088
Registered: 12/17/04
Re: Importing SQL script from file Error
Posted: Aug 12, 2011 12:47 PM    global.in_response_to.tooltip in response to: salim
 
   thread.click_reply Reply
Salim,

The import table data feature imports CSV files, not SQL INSERT statements.

In order to run your script of insert statements without the limitation of memory available for DbVisualizer, try the @run client side command in the SQL Commander. It can read and process files of any size.

Read more in:

http://www.dbvis.com/products/dbvis/doc/main/doc/ug/sqlCommander/sqlCommander.html#mozTocId174213

Regards

Roger
salim

Posts: 22
Registered: 05/03/11
Re: Importing SQL script from file Error
Posted: Aug 12, 2011 2:15 PM    global.in_response_to.tooltip in response to: salim
 
   thread.click_reply Reply
Hi,
I tried to export a table in CSV format and import it to another database's table (Empty & with same formatting and no constraint) and run the command below:

select * from assign;
@run assign.csv;

I still get an error message while executing. Can you please tell me what i am doing wrong.

Thanks
Salim
Roger Bjarevall


Posts: 5,088
Registered: 12/17/04
Re: Importing SQL script from file Error
Posted: Aug 12, 2011 2:35 PM    global.in_response_to.tooltip in response to: salim
 
   thread.click_reply Reply
Salim,

The CSV file can only be imported using the Table Data Import feature in DbVisualizer.

The @run command is used to run a file (script) with SQL statements such as "INSERT INTO xxx". So if you have a big file with INSERT INTO (or other SQL statements) that you can load into the editor DbVisualizer due to memory problems. Run it with the @run <filename>; command in the SQL Commander.

I hope this clarifies.

Regards

Roger
salim

Posts: 22
Registered: 05/03/11
Re: Importing SQL script from file Error
Posted: Aug 12, 2011 2:36 PM    global.in_response_to.tooltip in response to: salim
 
   thread.click_reply Reply
Some updates:
I tried to import my file as:

@export on;
@export set filename="c:\alltables.csv" appendfile="clear" format="csv";
select * from assign;

It export the file successfully.

Now i tried to import it using the DBVis GUI, its work fine.

I deleted the table data, place my csv file in the right path & tried to import it using the command run:

select * from to_assign;
@run alltables.csv;

I still get an error. Please tell me what i'm doing wrong.

Thanks.
Salim
salim

Posts: 22
Registered: 05/03/11
Re: Importing SQL script from file Error
Posted: Aug 12, 2011 2:40 PM    global.in_response_to.tooltip in response to: salim
 
   thread.click_reply Reply
Thanks, it's working :)

Regards,
Salim

Point your RSS reader here for a feed of the latest messages in all forums