SQL from a C-Shell

From: Sean O'Brien <stm_at_iol.ie>
Date: 31 Jul 2001 05:04:01 -0700
Message-ID: <19e9e498.0107310404.7c1d575a_at_posting.google.com>


Hi

I am having a little difficulty with a script, but can't understand why. This is the result of the script :

# brillo [~/scripts] <143> test.csh
#
# 1 row created.
#
# SQLEND: << terminator not found
# brillo [~/scripts] <144>

I have called the same SQL query a number of different times, but only the first one works. Once inside the while loop it has a problem with the query, any idea why this is or how to fix it?

#!/bin/csh -f

set x = 0

sqlplus -s scott/tiger_at_irmit << SQLEND INSERT INTO SEAN_USER_ALERT(name)
VALUES ($x)
/
SQLEND while ($x < 5)         

        set x=`echo "$x + 1" | bc`         

	sqlplus -s scott/tiger_at_irmit << SQLEND
	INSERT INTO SEAN_USER_ALERT(name)
	VALUES ($x)
	/
	SQLEND

end Received on Tue Jul 31 2001 - 14:04:01 CEST

Original text of this message