Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2009
    Posts
    14

    Question Unanswered: 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.

  2. #2
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •