![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| what is wrong with this tr -d? | cleansing_flame | UNIX for Dummies Questions & Answers | 3 | 02-06-2008 12:34 PM |
| What’s wrong with the following? | vrn | UNIX for Dummies Questions & Answers | 8 | 03-19-2006 09:09 PM |
| where have i gone wrong? | Blip | Shell Programming and Scripting | 3 | 01-28-2004 04:43 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
What am I doing wrong
When I execute following shell script I am getting the following error
syntax error at line 50 : `<<' unmatched What am I doing wrong Script begins here ---------------- MPAN_FILE=$1 exec 3<$MPAN_FILE while read -u3 -r Outcode Incode Depot do echo $Outcode echo $Incode echo $Depo { sqlplus -S abc/xyz <<EOF set heading off feedback off serveroutput on DECLARE DEPO number; BEGIN -- Attempt to find the depo SELECT DEPOT_CODE INTO DEPO FROM DEPOT WHERE UPPER(DEPOT_LKVAL) = UPPER('${Depot}'); -- Found it, print the depo DBMS_OUTPUT.PUT_LINE (Depo); EXCEPTION -- No depo WHEN NO_DATA_FOUND THEN SELECT -1 INTO Depo FROM dual; DBMS_OUTPUT.PUT_LINE (Depo); WHEN OTHERS THEN SELECT -2 INTO Depo FROM dual; DBMS_OUTPUT.PUT_LINE (Depo); END; / EOF } | read Depo echo $Depo if [ ${Depo} -ge 0 ] then echo 'Success' { sqlplus -S abc/xyz <<EOF set heading off feedback off serveroutput on DECLARE Err number; BEGIN -- Attempt to Insert the data into depot_postal_area INSERT INTO DEPOT_POSTAL_AREA (SUPPLIER_CODE,DEPOT_CODE,POST_OUTCODE,POST_INCODE) VALUES (12,${Depo},'${Outcode}','${Incode}'); INSERT INTO DEPOT_POSTAL_AREA (SUPPLIER_CODE,DEPOT_CODE,POST_OUTCODE,POST_INCODE) VALUES (13,${Depo},'${Outcode}','${Incode}'); Err := 0; DBMS_OUTPUT.PUT_LINE (Err); EXCEPTION -- No depo WHEN OTHERS THEN SELECT -1 INTO Err FROM dual; DBMS_OUTPUT.PUT_LINE (Err); END; / EOF } | read Error echo $Error else echo 'Failed' fi done |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|