PB/SQL Server calling SP with RETURN Value
- New
- How-to
-
Anil Rao
- PowerBuilder
- Saturday, 18 April 2026 03:17 AM UTC
We are migrating from PB2025/Sybase to PB2025/MS SQL Server. We have lots of SPs written 25 years ago that has a mix of OUTPUT parms & RETURN in the SPs & these SPs are being called from PB. Works fine in getting the RETURN value and the OUTPUT parms in Sybase.
PB Call to the SP with RETURN value is below. @person_nbr fetches the RETURN value from SP.
Declare get_login_person PROCEDURE FOR @person_nbr = sp_get_login_person
@login = :as_login
BUT this is failing in SQL Server. CGPT recommends to NOT use RETURN value but to use OUTPUT. Since we have many legacy SPs having RETURN does PB allow to fetch RETURN as backward compatiniity. If not, we are left with no option but to change all SPs to convert all RETURN as OUTPUT parms.
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.