1. Mark Jones
  2. PowerBuilder
  3. Friday, 3 June 2022 13:57 PM UTC

I have hit an interesting bug that took me a while to figure out but I thought I will share here:

 

If you create a datawindow with the following sql syntax this works fine.

select * from tablex where  value1=:argument1 and value2=:argument2

However if you add a // comment referencing an argument  in the SQL statement then it looks like PB miscounts the number of arguments being passed into the ODBC sql statement and inserts an extra bind variable.

e.g.

select * from tablex 

where  

// value3=:argument2

value1=:argument1 and value2=:argument2

 

If you use /* */ to comment out arguments this does not occur.   In earlier versions of PB // comments were not supported and then at some later point support for these were added.  However the PB developer did not do the same analysis as the developer who coded the /* */ implementation.  So what is basically happening is PB is scanning the SQL and counting the number of :arguments it finds and then these are setup as ODBC bind variables.  However it is including // commented out bind variables which has the affect of shifting the bind variables up so they no longer match the arguments.

Mark

 

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 3 June 2022 14:54 PM UTC
  2. PowerBuilder
  3. # 1

Hi Mark;

  This is a "Legacy" bug from way back in the Sybase days. The only workaround that know of currently is to remove the SQL comments.

I saw your Support Ticket about this and have now forwarded it over to Engineering for a current update on this issue.

Regards ... Chris

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