1. Joseph Vendra
  2. PowerBuilder
  3. Thursday, 16 September 2021 17:22 PM UTC

Just posting some advice in case someone else stumbles onto an issue like this.

The SQLSTATE = 42000 a catch all basin for everything under the sun from Microsoft can lead you in circles. Here's another gotcha.

When using a PB 2019 R3 application we noticed an error when running pb script to generate pdfs from datastore's at retrieve time.

The datastore LDS_bject.retrieve() for example would throw:

Select Error: SQLSTATE = 42000 Microsoft SQL Server Native Client 11.0 Incorrect syntax near '*'.

Was solved by:

Changing your DbParm connection string parameter from : OJSyntax='PB' to OJSyntax='ANSI'
(*Or if you dont have the OJSyntax='' setting, then add it to be used during your SQL Server DB Connection)

Used when using Right outer join queries in the PB Datawindows appears to require this at least in some situations anyhow.

The symptom will be that the datawindow will retrieve without issues when connected and previewed / retrieved inside the PowerBuilder IDE,
however when running compiled application or during runtime retrieving the datawindow using a datastore or inside a datawindow on a window it will throw the error message indicated above.

Anyhow, happy trails, Hope this helps someone else.

Joseph

 

Matt Balent Accepted Answer Pending Moderation
  1. Thursday, 16 September 2021 18:29 PM UTC
  2. PowerBuilder
  3. # 1

Never use PB join syntax, always set to ANSI.  If you aren't doing so currently you should also always use ANSI join syntax in any sql you write.

Comment
There are no comments made yet.
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Thursday, 16 September 2021 17:34 PM UTC
  2. PowerBuilder
  3. # 2

Thanks for sharing!

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.