0

i am running this inside the shell script. I have passed the values as parameters:

sqlplus -S ${DW_DBUSER}@${DW_DB}/${DW_DBPASSWORD} <<EOF
INSERT INTO CS_CUSTOMERS_TEST(CUSTOMER_ID,COMPANY_CODE,CUSTOMER_NAME,SHIPTO_CONTACT_NAME,SHIPTO_ADDR,SHIPTO_CITY,SHIPTO_STATE,SHIPTO_ZIP,SHIPTO_PHONE,SHIPTO_FAX,EMAIL_ADDR,PROD_TRANSFER_CODE,TAPES_SHIPPED_CNT,IP_ADDRESS,LOGIN_ID,PASSWORD,DIRECTORY,PUBLIC_KEY,SINGLE_FILE_FLAG) VALUES('${CUSTOMER_ID}','${COMPANY_CODE}','${CUSTOMER_NAME}','${SHIPTO_CONTACT_NAME}','${SHIPTO_ADDR}','${SHIPTO_CITY}','${SHIPTO_STATE}','${SHIPTO_ZIP}','${SHIPTO_PHONE}','${SHIPTO_FAX}','${EMAIL_ADDR}','${PROD_TRANSFER_CODE}','${TAPES_SHIPPED_CNT}','${IP_ADDRESS}','${LOGIN_ID}','${PASSWORD}','${DIRECTORY}','${PUBLIC_KEY}','${SINGLE_FILE_FLAG}');
COMMIT;
EXIT;
EOF

but whenever i run the script its throwing an error saying:

insert_cs_customer.sh: line 64: INSERT: command not found

Please let me know if anything is wrong in my script. I have issue only with insert query

Raptor
  • 53,206
  • 45
  • 230
  • 366
sar12089
  • 55
  • 4
  • 12
  • Welcome to Stack Overflow. Please read the [About] page soon. It is not obvious what you are doing wrong from what you've given. Are you sure that's an accurate representation of what's in the script? Have you run your script with `sh -x` (or `ksh -x` or `bash -x` or ...)? Try it; it may illuminate what is going on. I think that the error must be caused by what precedes the code you show, but I'm not sure what you could be doing that would lead to the behaviour you're seeing. – Jonathan Leffler Nov 06 '13 at 06:34
  • see http://stackoverflow.com/questions/2500436/how-does-cat-eof-work-in-bash/2500524#2500524 – technosaurus Nov 06 '13 at 06:48
  • I ran the script with sh – sar12089 Nov 06 '13 at 07:01
  • was there any space after < – Srini V Nov 06 '13 at 09:06

0 Answers0