Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

stored proc, sqlcode = 100

939 views
Skip to first unread message

_darq

unread,
Feb 11, 2004, 10:47:53 AM2/11/04
to
I have a stored procedure that updates a table in the
database. How come SQLCA.SQLCode returns 100? The row in
the table is actually updated successfully and I checked
SQLCA.SQLERRTEXT and it is blank. Sqlcode = 100 means 'not
found', but in this case it does not seem to apply. Can
anyone enlighten me?

Thanks,
Darq

Darq

unread,
Feb 11, 2004, 12:03:15 PM2/11/04
to
Okay, let me ask this another way. How do I know if my
stored procedure (which updates a table) was successful or
not? I tried a fetch and it returned nothing. The SQLcode
= 100 even though the table was successfully updated.

Any ideas appreciated,
Darq

dhun_n...@mmm.com

unread,
Feb 11, 2004, 12:21:44 PM2/11/04
to
<<Okay, let me ask this another way. How do I know if my
stored procedure (which updates a table) was successful or
not? I tried a fetch and it returned nothing. The SQLcode
= 100 even though the table was successfully updated.

Any ideas appreciated,
Darq>>

How you check the success/filaure of a stored procedure depends very much
on what DBMS you are using.. knowing the version of PB would help too.
Also.. since stored procedures can be called multiple ways, how are you
calling this one?

As to why you're getting a 100. Have you checked the value of SQLCODE
before you call the stored procedure? It just occurs to me that it might
already be 100 and the call to the stored procedure isn't effecting it at
all.

Andy Turiansky [TeamSybase]

unread,
Feb 11, 2004, 12:24:03 PM2/11/04
to
"Use RaisError. This will generate an error response to PowerBuilder,
returning both a user-specified error number and a user-specified error
message. If the stored procedure is run from a datawindow you can examine
this response within the dberror event; if run as standalone SQL, SQLCode
will be -1, SQLDBError will be your error number, and SQLErrText will be
your error message. If this is a "success" message, probably as determined
by your error code, then you can ignore any "error" processing."


On 11 Feb 2004 09:03:15 -0800,
in sybase.public.powerbuilder.general

- - -
Andy [TeamSybase]

Submit Sybase product enhancement requests via:
http://www.isug.com/cgi-bin/ISUG2/submit_enhancement


Techwave 2003 - http://www.sybase.com/techwave2003
International Sybase User Group (ISUG) - http://www.isug.com
CodeXchange - http://powerbuilder.codeXchange.sybase.com/


Darq

unread,
Feb 11, 2004, 12:48:51 PM2/11/04
to
Actually, I found an answer on Google groups which fits my
case:

"If a stored procedure does NOT return a result set,
Sqlca.Sqlcode will then be 100, which means no result set.
In this case the stored procedure is executed ok. To test if
a stord procedure fails, always check for Sqlca.Sqlcode =
-1."

Thanks for the ideas.

steve_katz_[teamsybase]

unread,
Feb 12, 2004, 10:25:18 AM2/12/04
to
It also happens when you are fetching a result set and get
to the point where there are no more rows to fetch. Using
SQLCode = 100 is a good loop break when fetching.

steve
[TeamSybase]

0 new messages