The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-05-2005
guptan guptan is offline
Registered User
  
 

Join Date: Jun 2005
Posts: 19
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
  #2 (permalink)  
Old 07-05-2005
vgersh99's Avatar
vgersh99 vgersh99 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,128
run the script with the 'set -x' set and debug the output.
  #3 (permalink)  
Old 07-05-2005
guptan guptan is offline
Registered User
  
 

Join Date: Jun 2005
Posts: 19
I am getting the syntax error not the execution error.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:24 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0