1. Satyam Mishra
  2. PowerBuilder
  3. Thursday, 27 January 2022 12:10 PM UTC

Dear Support Team,

I am using the Power Builder 2021 trial version.

Is there any provision in Power Builder 2021 to read the SQL query from PSR file which is loaded in Data Window control?

If so then kindly guide me possible ways.

Thanks & Regards,

Satyam

René Ullrich Accepted Answer Pending Moderation
  1. Thursday, 27 January 2022 12:55 PM UTC
  2. PowerBuilder
  3. # 1

Have you tried GetSQLSelect() function or Describe("DataWindow.Table.Select")?

Comment
There are no comments made yet.
Satyam Mishra Accepted Answer Pending Moderation
  1. Wednesday, 2 February 2022 12:53 PM UTC
  2. PowerBuilder
  3. # 2

Yes. tried with both functions but not working.

Just reclarify the scenario. Here SQL statement is associated with PSR file not with Data window control. And that PSR file is loaded in Data Window. Hope you are clear about the scenario.

 

Comment
  1. René Ullrich
  2. Wednesday, 2 February 2022 14:00 PM UTC
Yes, I know.

I've just tested it with a simple test case and it works.



string ls_s



dw_1.dataobject = "d:\test.psr"



ls_s = dw_1.GetSQLSelect ()

MessageBox ("GetSQLSelect", ls_s)



ls_s = dw_1.Describe("DataWindow.Table.Select")

MessageBox ("DataWindow.Table.Select", ls_s)



  1. Helpful 2
  1. René Ullrich
  2. Wednesday, 2 February 2022 14:07 PM UTC
If your SQL is a PBSelect (graphical select) my example also returns only the PBSelect statement. You can set the transaction object for the dw control after you set the dataobject. In this case you will get the real SQL from PBSelect if you have a connection to a database that can work with the query.
  1. Helpful 2
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.