[Info-ingres] Ingres Terminal Monitor - Conditional Execution
Shelia White
srwhite at ppol.co.uk
Sat Oct 4 12:14:26 UTC 2014
> Ah found some stuff in the QUEL manual...
Finally got it to work. In case anyone else ever wants to do this my
script is below. Setting FLAG to Y causes the optional processing
step to be skipped. You have to build the SQL into a file and use the
\i command to include the file, piping it from stdin doesn't work.
Thanks for the pointers!
#!/bin/csh
set FLAG=Y
cat > /tmp/testb.sql <<ENDSQL
select 'started'\p\g
/* Skip to end section if flag is Y */
\branch ?{ifsame;$FLAG;Y;1;0}=1 endsection
/* This bit is optional */
select 'optional processing'\p\g
\mark endsection
select 'finished'\g
ENDSQL
sql iidbdb <<ENDI
\i /tmp/testb.sql
ENDI
More information about the Info-ingres
mailing list