ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General Discussion » DB2 Issue

Post new topic  Reply to topic
 DB2 Issue « View previous topic :: View next topic » 
Author Message
james2005
PostPosted: Mon Dec 12, 2005 2:56 am    Post subject: DB2 Issue Reply with quote

Apprentice

Joined: 18 Sep 2005
Posts: 31

How to create database and all tables using sql file(example: ex.sql). Now i am copying all commands one by one into command editor. Pl tell me how and from where i have to run the .sql file.
Same issue with the script file to create queues.
Thanks in advance
James
Back to top
View user's profile Send private message
wschutz
PostPosted: Mon Dec 12, 2005 3:07 am    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

db2 < ex.sql
runmqsc < ex.mqsc
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
james2005
PostPosted: Tue Dec 13, 2005 10:57 pm    Post subject: please tell me in detail Reply with quote

Apprentice

Joined: 18 Sep 2005
Posts: 31

please tell me in detail, like from where i have to execute this commands.
I tried from command line, but getting problems.
i have one file called ex.sql which contains all commands to create database and tables.
when itried to execute this from commandline i got one message, 'DB21061E commandline environment not initialised'.
My file is in c: folder and i am trying the command from c:/ only.
Please tell me what i have to do now.
Regards,
James
Back to top
View user's profile Send private message
fschofer
PostPosted: Wed Dec 14, 2005 1:33 am    Post subject: Reply with quote

Knight

Joined: 02 Jul 2001
Posts: 524
Location: Mainz, Germany

An Introduction to DB2 UDB Scripting on Windows
http://www-128.ibm.com/developerworks/db2/library/techarticle/0307fierros/0307fierros.html

Greetings
Frank
Back to top
View user's profile Send private message Send e-mail
vennela
PostPosted: Wed Dec 14, 2005 9:55 am    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

Open a DB2 Command window
You will see something like

Quote:
C:\Program Files\IBM\SQLLIB\BIN>

On the prompt you can give
Code:

db2 -tf createDatabaseDb2.ddl


If you have your file somewhere else, you can also CD to that directory and issue the command
Back to top
View user's profile Send private message Send e-mail Visit poster's website
james2005
PostPosted: Thu Dec 15, 2005 4:23 am    Post subject: Thanks and one MQ prob Reply with quote

Apprentice

Joined: 18 Sep 2005
Posts: 31

DB2 command is working. Thanks for this.
I want to execute a file containing all commands like define qlocal...
How and from where i have to.
Back to top
View user's profile Send private message
wschutz
PostPosted: Thu Dec 15, 2005 4:25 am    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

Did you see this?

wschutz wrote:
db2 < ex.sql
runmqsc < ex.mqsc

_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
james2005
PostPosted: Sat Dec 17, 2005 12:55 am    Post subject: Yes, Thanks Reply with quote

Apprentice

Joined: 18 Sep 2005
Posts: 31

Hi,
Yes, I got. Thanks alot.
Regards,
Enda.
Back to top
View user's profile Send private message
james2005
PostPosted: Sat Dec 17, 2005 1:00 am    Post subject: Correct command to execute .sql file from db2 Reply with quote

Apprentice

Joined: 18 Sep 2005
Posts: 31

Hi,
Correct command to execute .sql file from db2 command window is:
db2 -t -v -f example.sql.
Before this u have to connect to the database.
Using db2 connect to DB1. DB1 is the database name.
Thanks....
Enda.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General Discussion » DB2 Issue
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.