Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to run *.sql file in db2?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
Hi,

I have a .sql file containing INSERT statements. Could anyone please tell me as to how do I run it in db2 version 7? Also, do I need to add any other statements in the file apart from the INSERT statements (like connect to...)?

Thanks,

Naveen
RamasahayaN@NIBCO.com
 
hi,
Either you need to connect to db2 using your command window or you can insert the statement on top of all sql statement as "connect to sample user db2admin using db2admin" where sample is ur db name and db2admin being ur user id and password.
next in your command window, change the respective directory and then type db2 -f filename.sql to execute the command.
Hope this helps
Bye
GK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top