Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Conditionally exit from / stop execution of a isql script

191 views
Skip to first unread message

Justin Willey

unread,
Mar 11, 2004, 11:57:11 AM3/11/04
to
I want to be able to stop a script if ceratin conditions are not met. I can
throw up a message from inside an IF statement which will suspend execution,
but the user can OK it and continue. I would like to be able to then EXIT
but EXIT is not allowed inside an IF or a block.

Is there another way of achieving this?

Justin Willey


Robert Waywell

unread,
Mar 11, 2004, 12:05:54 PM3/11/04
to
Hi Justin,
What you are dealing with is a mix of database commands such as the IF
block and ISQL specific commands such as the EXIT statement. What you may be
able to do is convert your script to a batch (BEGIN ... END block) and then
RETURN from the batch conditionally. This may not be feasible, for example
if you are using the READ statement to pull in other scripts at various
points.

--
-----------------------------------------------
Robert Waywell
Sybase Adaptive Server Anywhere Developer - Version 8
Sybase Certified Professional

Sybase's iAnywhere Solutions

Please respond ONLY to newsgroup

EBF's and Patches: http://downloads.sybase.com
choose SQL Anywhere Studio >> change 'time frame' to all

To Submit Bug Reports:
http://case-express.sybase.com/cx/cx.stm?starturl=casemessage.ssc?CASETYPE=B
ug

SQL Anywhere Studio Supported Platforms and Support Status
http://my.sybase.com/detail?id=1002288

Whitepapers, TechDocs, and bug fixes are all available through the iAnywhere
Developer Community at www.ianywhere.com/developer

"Justin Willey" <g...@nospamatall.iqx.co.uk> wrote in message
news:40509b1d@forums-2-dub...

Bruce Hay

unread,
Mar 11, 2004, 12:52:34 PM3/11/04
to
An approach that has been suggested several times in the past is to
construct a query that conditionally returns either an empty string or EXIT.
Use DBISQL's OUTPUT command to write the result to a file, then use the READ
command to read that file.

Whitepapers, TechDocs, bug fixes are all available through the iAnywhere
Developer Community at http://www.ianywhere.com/developer

"Justin Willey" <g...@nospamatall.iqx.co.uk> wrote in message
news:40509b1d@forums-2-dub...

Justin Willey

unread,
Mar 11, 2004, 4:58:02 PM3/11/04
to
cunning - thanks

Justin


"Bruce Hay" <hay at sybase dot com> wrote in message
news:4050a81b@forums-2-dub...

0 new messages