Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Exception Handling in SQL

2 posts in General Discussion Last posting was on 2007-09-27 14:58:16.0Z
mason Posted on 2007-09-27 12:31:13.0Z
From: "mason" <masonliu@msn.com>
Newsgroups: ianywhere.public.general
Subject: Exception Handling in SQL
Lines: 22
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: adsl-69-208-167-220.dsl.emhril.ameritech.net
X-Original-NNTP-Posting-Host: adsl-69-208-167-220.dsl.emhril.ameritech.net
Message-ID: <46fba291$1@forums-1-dub>
Date: 27 Sep 2007 05:31:13 -0700
X-Trace: forums-1-dub 1190896273 69.208.167.220 (27 Sep 2007 05:31:13 -0700)
X-Original-Trace: 27 Sep 2007 05:31:13 -0700, adsl-69-208-167-220.dsl.emhril.ameritech.net
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:6323
Article PK: 2829

I have a SQL script like this:

... on_error=continue

begin
...
while ...
...
execute immediate 'load table ...'
// error handling here...
end loop
end

When the load table statement fails, how can I obtain the SQL error message
and ignore the error so that the script can still go on to the next table.
The examples in the online help are not very clear. Thanks.

The on_error=continue option affects ISQL statements such as INPUT only. It
does not seem to have any impact to errors from SQL statements such as load
table.


Chris Keating (Sybase iAnywhere) Posted on 2007-09-27 14:58:16.0Z
From: "Chris Keating (Sybase iAnywhere)" <keating_spam_free@ianywhere.com>
User-Agent: Thunderbird 2.0.0.6 (Windows/20070728)
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Re: Exception Handling in SQL
References: <46fba291$1@forums-1-dub>
In-Reply-To: <46fba291$1@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: keating-d620.sybase.com
X-Original-NNTP-Posting-Host: keating-d620.sybase.com
Message-ID: <46fbc508$1@forums-1-dub>
Date: 27 Sep 2007 07:58:16 -0700
X-Trace: forums-1-dub 1190905096 10.25.98.110 (27 Sep 2007 07:58:16 -0700)
X-Original-Trace: 27 Sep 2007 07:58:16 -0700, keating-d620.sybase.com
Lines: 25
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:6324
Article PK: 4705

response posted to your crosspost in sybase.public.sqlanywhere.general

mason wrote:
> I have a SQL script like this:
>
> ... on_error=continue
>
> begin
> ...
> while ...
> ...
> execute immediate 'load table ...'
> // error handling here...
> end loop
> end
>
> When the load table statement fails, how can I obtain the SQL error message
> and ignore the error so that the script can still go on to the next table.
> The examples in the online help are not very clear. Thanks.
>
> The on_error=continue option affects ISQL statements such as INPUT only. It
> does not seem to have any impact to errors from SQL statements such as load
> table.
>
>