1. Peter Klopfer
  2. PowerBuilder
  3. Thursday, 7 January 2021 13:46 PM UTC

Hi,

I want to execute a relatively big SQL script using EXECUTE IMMEDIATE with ODBC (PB 2019 R2).

Works fine with SNC, but with ODBC  some parts are not executed, without any error message.

Looks for me like a size restriction for the SQL script. 

 

Thanks in advance for any hints.

Peter

 

Peter Klopfer Accepted Answer Pending Moderation
  1. Sunday, 10 January 2021 12:32 PM UTC
  2. PowerBuilder
  3. # 1

We found a workaround: The big SQL script is now saved into a database field and then executed by the exec()-function. The frontend only has to exec a SQL procedure that starts the exec()-function.

Besides, we found out that size restrictions of the SQL-script were not the reason of the problem. 

But we use a cursor construct within the SQL-script which contains very many SQL commands - probably this could be pitfall.

 

Thank you all for your valuable hints.

Peter

 

Comment
  1. Armeen Mazda @Appeon
  2. Sunday, 10 January 2021 15:07 PM UTC
Thanks for sharing the solution!
  1. Helpful
There are no comments made yet.
David Sowray Accepted Answer Pending Moderation
  1. Thursday, 7 January 2021 17:01 PM UTC
  2. PowerBuilder
  3. # 2

If I remember correctly (ie this may be wrong!) I had a similar problem using ODBC with MS SQL Server.

I'm pretty sure the answer for me turned out to be increasing the PBMaxTextSize setting in the PBODB190.INI file.

From the documentation in the INI file:

   ;PBMaxTextSize='32767' only used by MS SQLServer for Text fields limit

Comment
There are no comments made yet.
Peter Klopfer Accepted Answer Pending Moderation
  1. Thursday, 7 January 2021 16:53 PM UTC
  2. PowerBuilder
  3. # 3

Hi Chris,

thanks for your question.

It's about pressure from my customers and the Microsoft announcement to not further develop the SNC.

Would you recommend otherwise?

 

Regards,

Peter

Comment
  1. Chris Pollach @Appeon
  2. Thursday, 7 January 2021 16:59 PM UTC
FWIW: Personally, I would wait and try the new SS driver in PB 2019 R3 coming out later this month. This is MS's recommended direction and will now be supported natively by PB as well ....

http://docs.appeon.com/pb2019r3/whats_new/MS_SQL_Server_enhancements.html

Food for thought. ;-)
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 7 January 2021 16:45 PM UTC
  2. PowerBuilder
  3. # 4

Hi Peter;

  My 1st BIG question ... why are you changing from SNC to ODBC (aka "middleware")?

Regards ... Chris

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Thursday, 7 January 2021 16:18 PM UTC
  2. PowerBuilder
  3. # 5

Hi,

I would first make sure that the parts which don't execute would work in a small script using ODBC:

Why not, just set tracing on in your sqlca.dbms parameter by preceding it with "TRACE ODBC" or "TRA ODBC". The output will then give you more clarity about why some of the commands did not run and if indeed it's a size problem.

ODBC is a lot more limited than any native driver, especially when it comes to 'execute dynamic' commands.
Once you are sure that indeed it's to do with the size of the script, you could split the script into several ones instead of one big one. (but I don't think that's really the problem here).

regards.

Comment
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.