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.

 
Go Back  dBforums > Database Server Software > DB2 > Scripting error with db2batch command

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-23-09, 16:26
opowell opowell is offline
Registered User
 
Join Date: Jun 2009
Posts: 14
Question Scripting error with db2batch command

Version: 8.2.11
OS: Current Linux
command: db2batch -d dbname -f db2batch.sql

SCRIPT:
-- FILE: db2batch.sql
--get table level information
--
describe table mslibpaw.cmcdlstfp1 show detail;
--
-- get table data
select * from mslibpaw.cmcdlstfp1;
--
-- end Script

ERROR:
SQL0104N An unexpected token "mslibpaw" was found following "describe table ".
Expected tokens may include: "JOIN". SQLSTATE=42601

The DESCRIBE is Failing, but the select works. Any cluess and to why a system level command will not work in a script but will work on the command Prompt.
Reply With Quote
  #2 (permalink)  
Old 06-24-09, 00:14
madhu_kaza madhu_kaza is offline
Registered User
 
Join Date: Apr 2008
Posts: 39
Hi,

SQL0104N An unexpected token "<token>" was found following "<text>".
Expected tokens may include: "<token-list>".

Explanation:

A syntax error in the SQL statement or the input command string for the
SYSPROC.ADMIN_CMD procedure was detected at the specified token
following the text "<text>". The "<text>" field indicates the 20
characters of the SQL statement or the input command string for the
SYSPROC.ADMIN_CMD procedure that preceded the token that is not valid.

As an aid, a partial list of valid tokens is provided in the SQLERRM
field of the SQLCA as "<token-list>". This list assumes the statement is
correct to that point.

The statement cannot be processed.

User response:

Examine and correct the statement in the area of the specified token.

sqlcode: -104

sqlstate: 42601


which means "describe" command is not supported by SYSPROC.ADMIN_CMD stored procedure and "db2batch" uses ADMIN_CMD stored procedure internally to process the commands in the script file.

Thanks,
Madhavi.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On