Home » SQL & PL/SQL » SQL & PL/SQL » Importing .sql file!
Importing .sql file! [message #211612] Fri, 29 December 2006 23:03 Go to next message
Atif_Khan
Messages: 9
Registered: December 2006
Junior Member
Dear friends,

I have successfully imported the database scheme using imp command. Now my client has send me the data for that DB in the form of .sql script files. My question is where to copy those .sql files so that I can use @filename.sql to run those scripts.

Waiting for quick replies.

[Updated on: Fri, 29 December 2006 23:31]

Report message to a moderator

Re: Importing .sql file! [message #211613 is a reply to message #211612] Fri, 29 December 2006 23:44 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
You should just copy the file to a directory where you can access it via SQL*Plus. For example, place the file in C:\temp and then connect to the database thru SQL*Plus as the owner of the schema. At this point, you can run the file as:

SQL>@c:\temp\filename.sql
Re: Importing .sql file! [message #211617 is a reply to message #211612] Sat, 30 December 2006 00:12 Go to previous messageGo to next message
Atif_Khan
Messages: 9
Registered: December 2006
Junior Member
Thanks ebrian. I successfully imported the data. One more question what if I want to delete all the data from a specific table. Kind of redo thing.
Re: Importing .sql file! [message #211618 is a reply to message #211617] Sat, 30 December 2006 00:17 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
If you are looking to completely remove ALL the data from a table, then you can simply issue:

SQL> truncate table <table_name>;

You will not be able to rollback this action. If you have a need to possibly rollback the command, then issue:

SQL> delete <table_name>;
Re: Importing .sql file! [message #211620 is a reply to message #211618] Sat, 30 December 2006 00:40 Go to previous message
Atif_Khan
Messages: 9
Registered: December 2006
Junior Member
Thanks a lot ebrian for quick reply. I appreciate your help.
Previous Topic: Downsides of Data Denormalization
Next Topic: Some typical questions
Goto Forum:
  


Current Time: Mon Dec 05 10:57:22 CST 2016

Total time taken to generate the page: 0.07762 seconds