| |
|
If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
|
 |

06-13-06, 01:24
|
|
Registered User
|
|
Join Date: Jun 2006
Posts: 13
|
|
|
Error
|
|
Iam getting error when i run the following statement
db2 -tvf file name
the error is as follows
SQL0104N An unexpected token "db2" was found following "BEGIN-OF-STATEMENT"
Expected tokens may include: "SELECT". SQLSTATE=42601
provide me solution
|
|

06-13-06, 01:28
|
|
Registered User
|
|
Join Date: May 2003
Location: USA
Posts: 5,196
|
|
You are probably in the DB2 Command Line Processor (not the DB2 Command Window). When using the Command Line Processor you exclude the "db2" keyword. You can type "quit" to exit the Command Line Processor and then you can use the "db2" command.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
|
|

06-13-06, 01:39
|
|
Registered User
|
|
Join Date: Jun 2006
Posts: 13
|
|
|
error
|
|
Thanks Marcus for providing me the solution.but still iam getting error,if i quit & if i give the statement
db2 -tvf My Documents\ee
follows error
DB21004E You cannot specify both an input file and a command when invokin
the Command Line Processor.
I tried other thing also
after quiting db2
again i tried db2 then i gave
-tvf My Documents\ee
iam getting error as follow
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0007N The character "\" following "-tvf My Documents" is not valid.
SQLSTATE=42601
|
|

06-13-06, 02:39
|
|
Registered User
|
|
Join Date: May 2003
Location: USA
Posts: 5,196
|
|
I am not sure you can use a path name with blanks. Try cd to the path name where the file is located and then just reference the file name in your command.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
|
|

06-13-06, 03:00
|
|
Registered User
|
|
Join Date: Jun 2006
Posts: 13
|
|
|
Error
Thanks a lot Marcus.
i tried by replacing the file in D folder
statement is
C:\>db2 -tvf D:\ee
error is
DB21005E An error occurred while accessing the file D:\ee
|
|

06-13-06, 04:02
|
|
Registered User
|
|
Join Date: May 2003
Location: USA
Posts: 5,196
|
|
Change the directory to the path were the file is. Then issue the DB2 command with the file name only, excluding the drive and path (since you should already be at that directory).
If you still have problems, get someone who understands Windows to help you.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
|
|

06-13-06, 06:03
|
|
Registered User
|
|
Join Date: Jun 2006
Posts: 13
|
|
|
Error
Marcus once more my gratitude.
i changed the directory
D:\>db2 -tvf ee.txt
but showing error
create table ee ( idnum numeric(10), name varchar(10), address varchar(1
0), statusid numeric(10) )
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL1024N A database connection does not exist. SQLSTATE=08003
Help me
|
|

06-13-06, 10:47
|
|
Registered User
|
|
Join Date: May 2003
Location: USA
Posts: 5,196
|
|
put this as the first line in your script (assuming your database name is sample):
connect to sample;
make sure you have a ";" after every SQL statement.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
|
|

06-14-06, 04:01
|
|
Registered User
|
|
Join Date: Jun 2006
Posts: 13
|
|
|
Error
Marcus i did as u said,but the error as follows
D:\>db2 -tvf ee.txt
connect to vts user brindha using create table ee ( idnum numeric(10)
, name varchar(10), address varchar(10), statusid numeric(10) )
SQL0104N An unexpected token "create" was found following "<identifier>".
Expected tokens may include: "NEW". SQLSTATE=42601
actually in our organisation we no need to give ";" after SQL statement they set like that in command prompt.
|
|

06-14-06, 04:33
|
|
Registered User
|
|
Join Date: May 2003
Location: USA
Posts: 5,196
|
|
Quote:
|
Originally Posted by brindha
Marcus i did as u said
|
No, you did not do as I said.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
|
|

06-19-06, 03:48
|
|
Registered User
|
|
Join Date: Jun 2006
Posts: 13
|
|
|
Error
Thanks...
my error has been corrected.
I had made some simple mistakes.
now my statement is executing
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|