cancel
Showing results for 
Search instead for 
Did you mean: 

.NET on_error

Former Member
1,898

we are executing some sql string from .NET against sqlanywhere and our errors are not getting reported.
For example. If I have select * from TableThatExists
and then inside the same sql do a select * from TableThatDoesNotExist I don't get any error.
I just receive the first select.
I know the onerror = 'stop' should help but I can't flip that flag since others are using the same database.
I did try to use SET TEMPORARY OPTION ON_ERROR = 'STOP' but that gives an error of "Cannot set a temporary option for user..."

Accepted Solutions (1)

Accepted Solutions (1)

VolkerBarth
Contributor

AFAIK, on_error is an ISQL option and as such does not have any influence on other applications (like your .Net app).

How are you handling errors around your SQL code? I would expect a query against a non-existing table to throw a SAException object...

Former Member
0 Kudos

The problem was not SQL Anywhere it was my coding of .NET I was using the DataAdapter.FillSchema against 2 select statements and the FillSchema seems to ingore the table half of the select when getting the column names.

Answers (1)

Answers (1)

MCMartin
Participant
0 Kudos

Please provide your select statement, as Volker says you should get an Exception in .net, e.g. for a statement of the form: select * from ExistingTable where x in (select x from NotExisting) something like:

ERROR [42S02] [Sybase][ODBC Driver][SQL Anywhere]Table 'NotExisting' not found