Home » SQL & PL/SQL » SQL & PL/SQL » Sql Statements
Sql Statements [message #36711] Thu, 13 December 2001 22:46 Go to next message
Ibrahim
Messages: 16
Registered: October 2001
Junior Member
Hi all,

How I can call a text file that contains a lot of sql statments such as create table, instert into etc.
from SQL prompt. The text file name is MyTableData.txt

I want to run the entire statements in the text file, by a single command in SQL prompt. Is that possible?

If so, Pls give me more details about the correct punctuations that separating each statements in the text file.

I am using Oracle8 Enterprise edition.

your help would be appreciated.

thanks and regards,

Ibrahim

----------------------------------------------------------------------
Re: Sql Statements [message #36722 is a reply to message #36711] Fri, 14 December 2001 06:20 Go to previous messageGo to next message
Suresh Vemulapalli
Messages: 624
Registered: August 2000
Senior Member
Example:
txt file contents

create table x (n number);
create table y (s varchar2(10));

save above statements in file , lets say samp.txt

run samp.txt at sqlplus using syntax below

SQL > @samp.txt

(give total path when you save in different directory than sqlplus default directory)

SQL > @c:samp_dirsamp.txt

----------------------------------------------------------------------
Re: Sql Statements [message #36734 is a reply to message #36722] Fri, 14 December 2001 20:00 Go to previous message
Ibrahim
Messages: 16
Registered: October 2001
Junior Member
Thank you Mr.Suresh. It is working.
Thank you

Ibrahim

----------------------------------------------------------------------
Previous Topic: Updating a LONG Column
Next Topic: Get child tables.
Goto Forum:
  


Current Time: Thu Aug 06 09:14:50 CDT 2020