Results 1 to 8 of 8
  1. #1
    Join Date
    Apr 2008
    Posts
    21

    Unanswered: How to execute the sample.sql script file in db2 command prompt.

    Hi,

    I have generated a sample.sql ddl script from windows platform through db2look command.


    The sample.sql copied into aix platform. How to execute the sample.sql script file in db2 command prompt.

    Please help me.. how to run the ddl sample.sql script file db2 command prompt of aix platform.

    Thanks,

    Mohan Reddy

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    db2 -tvsf sample.sql

    Andy

  3. #3
    Join Date
    Apr 2008
    Posts
    21
    I have executed the script with below given command. but the following error:

    $ db2 -tvsf sample.sql
    DB21006E The input command is too long. The maximum length is 65535.


    Thanks,

    Mohan Reddy

  4. #4
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    What is your statement terminating character? (It usually is a semicolon ";").

    Andy

  5. #5
    Join Date
    Apr 2008
    Posts
    21
    Hi,

    The some part of the code is pasted here below:

    $ view sample.sql
    "sample.sql" [Read only] 8864 lines, 479330 characters
    % Using database SAMPLE ^M
    % Using userid ^M
    % Database Manager Version DB2/NT Version 8.2.0 ^M
    % Database Codepage 1252^M
    % Database Collating Sequence is UNIQUE^M
    \documentclass{article} ^M
    \setlength{\textwidth}{6in} ^M
    \setlength{\oddsidemargin}{-0.3in} ^M
    \setlength{\evensidemargin}{-0.3in} ^M
    \setlength{\textheight}{8.0in} ^M
    \begin{document}^M
    ^M
    ^M
    \sf^M
    ^M
    \section*{Database Manager Version: DB2/NT Version 8.2.0}^M
    ^M
    ^M
    \section*{Database Codepage: 1252}^M
    ^M
    ^M
    \section*{Database Name: SAMPLE}^M


    ..........


    I think is is ^M

    Thanks,

    Mohan Reddy

  6. #6
    Join Date
    Nov 2005
    Location
    IL
    Posts
    557
    "t" tell the system that termination char should be ";". If you want to use something else you have to use td@ where @ is your termination char
    --
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows

    DB2 v9.7.0.6 os 6.1.0.0

  7. #7
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Quote Originally Posted by goudelly1
    $ view sample.sql
    "sample.sql" [Read only] 8864 lines, 479330 characters
    % Using database SAMPLE ^M
    % Using userid ^M
    % Database Manager Version DB2/NT Version 8.2.0 ^M
    % Database Codepage 1252^M
    % Database Collating Sequence is UNIQUE^M
    \documentclass{article} ^M
    \setlength{\textwidth}{6in} ^M
    You should have used the db2look -e option. Also make sure you transfer the resulting file to the AIX box in ASCII mode.
    ---
    "It does not work" is not a valid problem statement.

  8. #8
    Join Date
    Jul 2012
    Posts
    1

    Just check for the delimiter..

    Just chek for you delimiter in the file OR you can use
    - vf <file name > if there is CR as delimiter in you file.

Posting Permissions

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