1. Geir Magne Vangen
  2. PowerBuilder
  3. Wednesday, 27 July 2022 08:42 AM UTC

As GetSQLPreview() became obsolete some time ago, we are finally removing the use of this, replacing it with the sqlsyntax argument.

We have one issue here:

If the sqlsyntax is changed in a parent window (sqlpreview event), and one want to do further changes in a child window.
The sqlsyntax argument for the child window does only contain the original sqlsyntax, and does not include the changes from the parent window. The GetSQLPreview() function however does include the changes from the parent window.

Is this the right behaviour? Then I guess we have to keep track of these changes from parent window ourselves.

 

Accepted Answer
Geir Magne Vangen Accepted Answer Pending Moderation
  1. Wednesday, 27 July 2022 10:52 AM UTC
  2. PowerBuilder
  3. # Permalink

Hi René,

Thanks for your valuable feedback, I was afraid this was the answer. The solution in the first round now will probably be an instance variable.

Geir

Comment
There are no comments made yet.
René Ullrich Accepted Answer Pending Moderation
  1. Wednesday, 27 July 2022 10:41 AM UTC
  2. PowerBuilder
  3. # 1

Cause sqlpreview event is triggert with all arguments by value these arguments will not change automatically and you can't change it. It is a real limitation.

So you have to handle it youself.

 

It would be easy if you could first change the argument in descendend before you change it in anchestor. In this case you can override the ancestor script, do your changes and call ancestor script with the changed sqlsyntax as argument.

But this will not work if you want to first change the SQL in ancestor because you will not have a way to get the modified sqlsyntax n your descendend. In this case you can use an instance variable to store the modified sql.

 

Maybe a better approach:

Create a new event mysqlpreview  (for example) that have a sqlsyntax argument by ref. Call this from sqlsyntax event in ancestor script. Do all your sql modifications in ancestor and descended in this new event.

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.