SAP Knowledge Base Article - Preview

2033908 - PowerBuilder RPCFUNC does not fetch the return value in OLEDB or ADO.NET interface when there is a RAISERROR

Symptom

Calling a remote stored procedure (RPCFUNC) through the OLEDB or ADO.NET interface does not fetch the return value when an error is raised.

Consider the following SAP Sybase Adaptive Server Enterprise (ASE) stored procedure:

CREATE PROCEDURE dbo.sp_raisetest;1 AS
BEGIN DECLARE @errorvalue varchar(100) DECLARE @retvalue int
SELECT @errortext = 'My RAISERROR Message'
RAISERROR 12345 @errortext
SELECT @retvalue = -888
RETURN @retvalue
END

When connected using the OLEDB interface and calling the stored procedure the return value is not fetched and stays zero. The raiserror number is not stored into the SQLDBCode variable of the connection object.

SQLDBCode: 999
Return value: 0
SQLErrText:
ASEOLEDB [][Message Class: 16][Message State: 1][Transaction State: 1][Server Name: MyServer] [Procedure Name: sp_raisetest][Line Number: 8][Native Code: 12345][ASEOLEDB]My RAISERROR Message

When connected using the ADO.NET interface the return value is also not fetched although the raiserror number is now stored into the SQLDBCode variable of the connection object as expected.

SQLDBCode: 12345
Return value: 0
SQLErrText:
Message: My RAISERROR Message ErrorNumber: 12345


Read more...

Environment

  • SAP PowerBuilder 12.5
  • SAP Sybase Adaptive Server Enterprise

Product

SAP PowerBuilder 12.5

Keywords

RPCFUNC RAISERROR OLEDB ADO.NET return value   , KBA , BC-SYB-PB , PowerBuilder , Bug Filed

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.