-1

So I have a string with a large sql query named sql_select. And I have the following code in PowerBuilder 10.5:

dw_1.Modify( "DataWindow.Table.Select=' "+ sql_select + "'" )
messagebox("Something", dw_1.getsqlselect())

I see that I do not get the full query, i.e., some conditions do not exist! Even though the sql_select is right. What is the problem?

Alex
  • 207
  • 1
  • 2
  • 15
  • 1
    It is difficult to get the answer with my crystal ball without any information concerning the dw structure and without any information about the content of the `sql_select`. Is the query correctly escaped for the DW syntax? – Seki Mar 10 '14 at 13:10
  • Yeap it seems that was somehow related. Thank you! – Alex Mar 10 '14 at 14:08
  • For future reference...The problem was related with some escaped quotes in the query. Also I wasn't getting the result of modify as @Seki suggested. Now it works fine. – Alex Mar 11 '14 at 11:07

2 Answers2

0

You should get the result of the dw_1.modify() call into a string variable. If there is any problem from the syntax, you should get an error message in the string. If there is no problem for Modify() the string will remain empty.

Seki
  • 11,135
  • 7
  • 46
  • 70
0

You may also be passed through the method of the object setsqlselect datawinow. But the return value is not readily exploitable being -1 on error occur...., and 1 if it passes.

Did you have the same number of column in your query and you dataobject?

Did you try to execute the query stocked in sql_select with your DBMS?