Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2012
    Posts
    2

    Unanswered: Get error when trying execute db2 command from AIX .sh file

    Dear frieds,

    I have a problem when I was trying execute db2 command from .sh file.
    I use AIX as my system.
    and i wanna try to export the data into .csv file.
    when I executed the .sh file, I got this:

    Database Connection Information

    Database server = DB2/AIX64 9.1.7
    SQL authorization ID = DB2INST1
    Local database alias = RMSALIAS

    DB20000I The SQL command completed successfully.
    SQL3022N An SQL error "-104" occurred while processing the SELECT string in
    the Action String parameter.

    SQL0104N An unexpected token "ftp" was found following "SELECT conf ".
    Expected tokens may include: "FROM". SQLSTATE=42601
    and here is my .sh file :

    db2 connect to RMSALIAS user xxx using xxx
    db2 UPDATE CREDIT.CSV_FLAG CF SET CF.FLAG = 1
    db2 export to /home/db2inst1/DWH/ftp/CREDIT_ASSESSMENT.csv of del modified by coldel'|' SELECT * FROM CREDIT.V_CREDIT_ASSESSMENT
    could you help me?

    Thanks

  2. #2
    Join Date
    May 2010
    Location
    India
    Posts
    84
    Provided Answers: 2
    Use double quotes around export command

    db2 "export to /home/db2inst1/DWH/ftp/CREDIT_ASSESSMENT.csv of del modified by coldel'|' SELECT * FROM CREDIT.V_CREDIT_ASSESSMENT "


    .....Satya

  3. #3
    Join Date
    Feb 2012
    Posts
    2
    Quote Originally Posted by stiruvee View Post
    Use double quotes around export command

    db2 "export to /home/db2inst1/DWH/ftp/CREDIT_ASSESSMENT.csv of del modified by coldel'|' SELECT * FROM CREDIT.V_CREDIT_ASSESSMENT "


    .....Satya
    Thanks for your help, I will try this

Tags for this Thread

Posting Permissions

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