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?
What database server/version? What interface (ODBC, OLE DB, etc.)?
SQL 2012, ODBC connection
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?
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
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.
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.