1. Kieu Parrish
  2. PowerBuilder
  3. Tuesday, 16 February 2021 16:03 PM UTC

Hello,

We are using PB 2019 R2 Build 2328 and have been dealing with an issue relating to execute stored procedure. 

We are using the nvo like below:

 

nvo_sqlcadb_log DBapplogs
DBapplogs = CREATE nvo_sqlcadb_applogs

DECLARE addlog procedure for SP_Add_Log 

@log = :ls_log

using DBapplogs.sqlcadb;

execute pbsp_update_log; ==> WE ARE GETTING NULL REFERENCE AT THIS LINE 

If DBapplogs.sqlcadb.SQLCode = -1 then 

  // show error 

end If 

The constructor() event of the "nvo_sqlcadb_log" looks like below:

sqlcaDB = create transaction

Then set sqlca parameters ... 

 

Since the issue "execute pbsp_update_log; ==> WE ARE GETTING NULL REFERENCE AT THIS LINE " happened , we've added a check for transaction "DBapplogs.sqlcadb" -> it showed this transaction is not valid . But it does not happen all time. ( this log is run all the time and every few days , the error "NULL REFERENCE AT "execute pbsp_update_log;" " happens )

Could you guys help me how to resolve this issue ? 

Thank you very much!

 

Accepted Answer
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 17 February 2021 18:05 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi Kieu;

  Sounds like the odd time the Transaction object is not getting created properly. I would add some IsValid() and DBHandle() commands into the code to trap a bad TO or a failed "Connect;".

HTH

Regards ... Chris

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 16 February 2021 16:56 PM UTC
  2. PowerBuilder
  3. # 1

Hi Kieu;

  Can you tell us ...

1) DBMS version & build being used

2) DB Client version & build being used

3) How is your App connecting to DBMS ( SQLCA.DBMS = "???") ?

4) How is the SP being called (SP based DW, RPC, Inline SQL)?

5) Have you run an SQL Trace?

Regards ... Chris

Comment
  1. Kieu Parrish
  2. Wednesday, 17 February 2021 17:41 PM UTC
Thank you, Chris!

Below is the information that I can give :



1) DBMS version & build being used

--> SNC - most current for PB2019 R2



2) DB Client version & build being used

--> 2012 Native Client



3) How is your App connecting to DBMS ( SQLCA.DBMS = "???") ?

--> DBMS=SNC

sqlcaDB.dbms = [xxxxxx]

sqlcaDB.database = [databasename]

sqlcaDB.logid = [logid]

sqlcaDB.logpass = [logpass]

sqlcaDB.servername = [servername]

sqlcaDB.DBParm = "Host = '" + [computerinfo] + "'" + "Database=[databasename],TrimSpaces=1"



4) How is the SP being called (SP based DW, RPC, Inline SQL)?

The Stored Procedure is called using the PB DECLARE/Using sqlcadb/Execute statements



5) SQL Trace -> Could you give some instructions on how to do the SQL Trace ?



Thanks again!



  1. Helpful
  1. John Fauss
  2. Wednesday, 17 February 2021 21:02 PM UTC
To enable the SQL Trace, preface the normal DBMS property value of the transaction object with the word "TRACE". In your case, sqlcadb.DBMS = 'SNC would become sqlcadb.DBMS = 'TRACE SNC'. Note this also is possible from a database profile in the IDE by checking the "Generate Trace" checkbox near the bottom of the "Connection" tab page when editing a DB Profile (you can see the effect in the "Preview" tab).
  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.