[unixODBC-support] Check result of all row sets after SQLExecute()
Daniil A Megrabjan
danil.megrabjan at gmail.com
Thu Jul 9 15:09:06 BST 2009
Hello All.
I have querie like this(Its only example, not real query!):
DECLARE @res numeric(1)
SELECT @res=2
DELETE FROM dbo.TABLE1... (query 1)
DELETE FROM dbo.TABLE2... WHERE 1=2 (query 2)
SELECT @res
In my cpp app I do for it:
success = SQLPrepare(Stmt, (unsigned char *) SQL, SQL_NTS);
success = SQLExecute(Stmt);
My main trblz in processing the result codes of all row sets... How I
can do this? Because, for example:
My "query 1" success = 1 (The DELETE statement conflicted with the
REFERENCE constraint "FK__T_KLS_ALL__KLSRE__1DE1DF5A". The conflict
occurred in database "infin_web_2008", table "dbo.T_KLS_ALL", column
'KLSREF_NUM')
My "query 2" success = 100 (No affected rows!)
If I execute this queries(1&2) in common one (as in first example) I
have total success = 1 from first DELETE(from 1 rowset). But if I
change position of queries in batch, like:
DECLARE @res numeric(1)
SELECT @res=2
DELETE FROM dbo.TABLE2... WHERE 1=2 (query 2)
DELETE FROM dbo.TABLE1... (query 1)
SELECT @res
I have success=100, and I don't know anything about second "success" of query.
How I can check all success codes of all row sets?
Thanks!
--
Daniil A Megrabjan | email danil.megrabjan at gmail.com | icq 4545450 |
skype danil.megrabjan
More information about the unixODBC-support
mailing list