Skip to Content
0

PB 12.5 crashing when running application and calling sys stored proc

Dec 07, 2016 at 07:57 PM

136

avatar image

I have a powerbuilder application that runs great in PB 10. However, I am trying to upgrade it to PB 12.5 (unfortunately we cannot purchase 12.6 due to budget, so stuck with 12.5).

When it run the applciation it is crashing at the point that it needs to run a system stored procedure

string u, r, l, d, ds, ui, sid

DECLARE rolename PROCEDURE FOR sp_helpuser
@name_in_db = :SQLCA.Logid;
EXECUTE rolename;
FETCH rolename INTO :u, :gs_access_group, :l, :d, :ds, :ui, :sid ;

CLOSE rolename ;

This is working great in 10, but cannot figure out what is wrong in 12.5. All I did was copy the application (all pbl files, etc), regenerated all files in 12.5. If I comment out this code it works fine, but I need this in the application.

Any ideas?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

6 Answers

Roland Smith Dec 07, 2016 at 08:04 PM
0

What database server/version? What interface (ODBC, OLE DB, etc.)?

Share
10 |10000 characters needed characters left characters exceeded
Connie Dove Dec 07, 2016 at 08:04 PM
0

SQL 2012, ODBC connection

Share
10 |10000 characters needed characters left characters exceeded
Scott Morris Dec 08, 2016 at 03:51 PM
0

If this is MS sql server, the resultset is 5 strings, an int, and a varbinary value. So your usage is implicitly converting the 2 last columns. Maybe PB is more picky now?

Share
10 |10000 characters needed characters left characters exceeded
Connie Dove Dec 08, 2016 at 07:46 PM
0

This is MS Sql server 2012. Looking at the sp_helpuser proc, it looks like it converts the int field into a char field so string should work. but it doesn't do any conversion for the varbinary. So for the varbinary, what powerbuilder datatype should I use to put it into? I tried to use blob but it still crashed at the same spot

Share
10 |10000 characters needed characters left characters exceeded
Scott Morris Dec 08, 2016 at 09:17 PM
0

The easy answer is to create a datawindow for this and see what PB thinks the datatypes should be. Without knowing your goal, I would suggest using a select statement against the sys.database_principals catalog view instead - where you can select just the columns you need.

Share
10 |10000 characters needed characters left characters exceeded
Connie Dove Dec 27, 2016 at 06:08 PM
0

Thank you both for your help. I finally ended up just running a select against the sys.database_principals instead of using the stored proc.

Share
10 |10000 characters needed characters left characters exceeded