1. Kirankumar Chavadi
  2. PowerBuilder
  3. Tuesday, 23 January 2024 05:51 AM UTC

I am trying to assign values to transaction properties as below

transaction l_tmp

l_tmp = CREATE transaction

l_tmp.DBParm = arg_trans.DBParm

l_tmp.SQLErrText= arg_trans.SQLErrText

l_tmp.SQLDBCode= arg_trans.SQLDBCode

 

I observe that l_tmp.SQLCode (not SQLDBCode) assigned with -1 where as arg_trans.SQLCode = 0 and not being assigned by code

and apart from DBParm value, SQLErrText and SQLDBCode values are not getting assigned to l_tmp

after executing above lines 

l_tmp.SQLErrText= "Transaction not connected"

l_tmp.SQLDBCode= 0

 

where as arg_trans values are

arg_trans.SQLErrText = "some db error "

arg_trans.SQLDBCode = -1

 

why arg_trans values are not getting assigned to l_tmp?

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 23 January 2024 13:33 PM UTC
  2. PowerBuilder
  3. # 1

Hi Kirankumar;

  Have you tried using the GetTrans() method to accomplish this?

Regards ... Chris 

Comment
  1. Kirankumar Chavadi
  2. Tuesday, 23 January 2024 15:48 PM UTC
GetTrans will work only when we use SetTrans() right? not when we use SetTransObject
  1. Helpful
  1. Chris Pollach @Appeon
  2. Tuesday, 23 January 2024 20:04 PM UTC
No, it will work on any active TO when it's already been assigned to a DWO.
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Tuesday, 23 January 2024 06:19 AM UTC
  2. PowerBuilder
  3. # 2

HI,

Not sure, but maybe you have to do a CONNECT USING l_tmp first ?

Comment
  1. John Fauss
  2. Tuesday, 23 January 2024 14:09 PM UTC
If that is why you are doing this, you might consider using a structure instead. If you need it only in one window or user object, create an "object structure" that exists only within the window (or user object).
  1. Helpful 2
  1. Kirankumar Chavadi
  2. Tuesday, 23 January 2024 15:50 PM UTC
Yeah I can do that.

but this code exists from a very long time and there was no issue until now.

recently trying to host the app on PowerServer cloud and we are encountering this error



the code is in a global function
  1. Helpful
  1. Chris Pollach @Appeon
  2. Tuesday, 23 January 2024 20:06 PM UTC
Note: now that I see that you are using a PowerServer based App vs a native PB App - then this restriction would now apply ...

https://docs.appeon.com/ps2022/TransactionName.html

  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.