|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
DB2 error, unable to create database.. |
« View previous topic :: View next topic » |
Author |
Message
|
Everest |
Posted: Tue Mar 06, 2007 12:07 pm Post subject: DB2 error, unable to create database.. |
|
|
Novice
Joined: 02 Feb 2007 Posts: 16
|
Hi all.. I am new in WebSpehere Message Broker world. I tried to create two db2 databases using the following script (mydbScript.sql)
CREATE DB ERRORDB
CONNECT TO ERRORDB
BIND '%DB2TEMPDIR%\bnd\@db2cli.lst' blocking all grant public
CATALOG SYSTEM ODBC DATA SOURCE ERRORDB
CONNECT RESET
CONNECT TO ERRORDB
DROP TABLE ERRORS
CREATE TABLE ERRORS (MSGID BLOB(4 , TEXT CHAR(250), ERRORNUM INTEGER, ERRORDATE TIMESTAMP, FLOWNAME CHAR(32), NODENAME CHAR(32), MSGDATA BLOB(3200))
CONNECT RESET
CREATE DB STAFFDB
CONNECT TO STAFFDB
BIND '%DB2TEMPDIR%\bnd\@db2cli.lst' blocking all grant public
CATALOG SYSTEM ODBC DATA SOURCE STAFFDB
CONNECT RESET
CONNECT TO STAFFDB
DROP TABLE STAFF
CREATE TABLE STAFF (STAFFNUM CHAR(10), LASTCHANGE TIMESTAMP, FIRSTNAME CHAR(30), LASTNAME CHAR(30))
CONNECT RESET
TERMINATE
...
I get the following message [C:>db2 -vf mydbScript.sql]
..
DB21034E The command was processed as an SQL statement becasue it was not a valid Command Line Processor command. During SQL processing it returned: SQL1024N A dabatabase connection does not exist. SQLSTATE=08003
When I go to db2 control center I dont find any db created there.
I am using db2 8.1,(FP2) on WinXP.
Any help? I can create any sample databases, so i dont think there is any problem with my db2 installation. |
|
Back to top |
|
 |
Gaya3 |
Posted: Tue Mar 06, 2007 10:34 pm Post subject: |
|
|
 Jedi
Joined: 12 Sep 2006 Posts: 2493 Location: Boston, US
|
|
Back to top |
|
 |
pathipati |
Posted: Wed Mar 07, 2007 6:55 am Post subject: |
|
|
Master
Joined: 03 Mar 2006 Posts: 296
|
Everest wrote: |
C:>db2 -vf mydbScript.sql |
I guess, you are already in command line. Try commands in the script manually and see what the result will be. If you still get same problem then I guess you may have to apply latest fixpac. |
|
Back to top |
|
 |
tillywern |
Posted: Tue Mar 13, 2007 8:56 am Post subject: Delimiter |
|
|
 Centurion
Joined: 28 Jan 2003 Posts: 109 Location: Colorado
|
Let me hazard a guess that you have not specified a statement delimiter. If this is the case all of your input lines are considered one statement. Try looking at the -d option. -td @ would allow you to use @ symbols at the end of your lines while other use -dt$ or -td;. Depends on what you are used to and what characters you are using.
But this would really apply if using a file for input which is an assumption of mine. You can always try "db2 ? options" or start the information center.
Also check out db2look for dumping DDL of a database that is already created. it also uses the -td parameter. The two tools are designed to work together to allow databases to be modeled and created. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|