On Sep 9, 10:19 am, Serge Rielau <srie...@ca.ibm.comwrote:
2803s...@gmail.com wrote:
All my SPs have an SQLSTATE OUT parameter. However, working with MS
VB6 ADO, parameters IN have no problem, but SQLSTATE parameter OUT (in
the procedure) always returns empty. Reviewing the COMMAND object
shows that it does have an P_SQLSTATE parameter, (that's what it's
called in the stored procedure), but it is always empty.
I have tried (in the app) to define a parameter to be passed to
receive the SQLSTATE, but that is worse -- it adds an extra parameter
where not needed.
I think there is a conceptual mis understanding here.
You shoudl not need a SQLSTATE OUR parameter.
At beats you have SQLSTATE local variable for soem handlers.
The SQLSTATE is set by either a SIGNAL, RESIGNAL statement or an error.
The value is passed back by DB2 through the SQLCA structure along with
the SQLCODE.
How do you check teh SQLSTATE in VB6 for normal SQL statements (like
UPDATE). Should be the same for CALL.
Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
_______________________
Serge,
You said:
<<The value is passed back by DB2 through the SQLCA structure along
with
the SQLCODE. How do you check the SQLSTATE in VB6 for normal SQL
statements (like
UPDATE). Should be the same for CALL.>>
I remember that from my C days. But how does one create and receive
the SQLCA struct in VisalBasic6 from a DB2 database? If there is one
thing on which I would bet my fortune, it would be that Microsoft
ain't gonna tell you, and that they will go out of their way to
obfuscate and make it impossible.
I see that there are examples in the docs. But they are all, every
single one of them, in C++. They all need "includes." I can work
with APIs if necessary.
But there has to be an easier way -- surely ?!?
<<Should be the same for CALL.>you said. What did you mean?
Am I the only one who, after all these years, actually wants to check
SQLSTATE returns?
SS