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 > Get error when trying execute db2 command from AIX .sh file

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-06-12, 22:47
sunshiner sunshiner is offline
Registered User
 
Join Date: Feb 2012
Posts: 2
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:

Quote:
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 :

Quote:
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
Reply With Quote
  #2 (permalink)  
Old 02-06-12, 23:21
stiruvee stiruvee is offline
Registered User
 
Join Date: May 2010
Location: India
Posts: 34
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
Reply With Quote
  #3 (permalink)  
Old 02-06-12, 23:24
sunshiner sunshiner is offline
Registered User
 
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
Reply With Quote
Reply

Tags
aix, db2, export

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