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..."

This question is marked "community wiki".

asked 09 Oct '11, 23:28

goroth's gravatar image

goroth
6114
accept rate: 0%


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...

permanent link

answered 10 Oct '11, 03:24

Volker%20Barth's gravatar image

Volker Barth
30.0k294448654
accept rate: 32%

edited 10 Oct '11, 03:24

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.

(11 Oct '11, 08:55) goroth

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

permanent link

answered 10 Oct '11, 04:24

Martin's gravatar image

Martin
8.6k115149237
accept rate: 14%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×55

question asked: 09 Oct '11, 23:28

question was seen: 1,058 times

last updated: 11 Oct '11, 08:55