Jump to content
Sign in to follow this  
ORSO2001

SQL query results

Recommended Posts

Dear All,

I am starting for the first time to work with DB in a server PC using SQL (SQL server) query.

I am using the SQL example...all works fine...I do the connection...I create the table...I am able to insert, update, get and cancel the "info" with this DB...what I saw and I don't understood is that if I send a query to have some information refered at a specific ID (...WHERE employeID =?) and this ID is not present in the DB the query result, BIT about query success, is turned as "1" ...I was expecting that the "fail BIT" arise !?

Maybe this is correct, sorry I don't know deeply this matter...can someone confirm?

thanks

Share this post


Link to post
Share on other sites

dear All,

ok...now that I better checked I saw that in the query with SELECT command its struct has description string about the result...when I ask for a not existing ID I have "Number of records 0"...I was expecting an "exception" error but ok...this is managed in this way.

Share this post


Link to post
Share on other sites

Well, from the point of view of the SQL Server / Client or the query, it succeeded (there query itself had the right syntax, and the tables and columns existed).

We don't parse the queries you execute, so we don't know what is going to be returned. 0 records doesn't mean fail, since "Delete From Table" would return 0 records, but is still OK.

Share this post


Link to post
Share on other sites

hi Saragani,

thanks for the answer...yes obviously you are right...thinking better I understood that I am asking to search if some element has a specific ID and the answer is "no one item has this ID"...then the request is done in correct way and also the answer is back in the correct format...thanks

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...