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