Skip to Content

PB 12.5 crashing when running application and calling sys stored proc

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?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • avatar image
    Former Member
    Dec 07, 2016 at 08:04 PM

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

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 07, 2016 at 08:04 PM

    SQL 2012, ODBC connection

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 08, 2016 at 03:51 PM

    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?

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 08, 2016 at 07:46 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 08, 2016 at 09:17 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 27, 2016 at 06:08 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded