Introduction to PowerBuilder

HomePrevious Lesson: Saving as a Query
Next Lesson: External Data Source

Query as a Data Source

Creation of Query is similar to the creation of SQL SELECT statement, except that it has its own painter and is created outside the DataWindow environment. With queries we can base multiple DataWindows on the same query, i.e., SQL statements without having to repeat the definition.

Create a new DataWindow and this time select Query as the data source. PowerBuilder asks for the name of the query on which the DataWindow should be based. Select the query that we just have saved and click OK. If this DataWindow is previewed, the 'Specify Retrieval Arguments' window will popup for the transaction type. If you type in 'R', PowerBuilder will show a preview of the DataWindow.

By selecting query as the basis for a DataWindow, we are not creating a dynamic link between the two components. It means that the changes made to one object won't be reflected in the other.
HomePrevious Lesson: Saving as a Query
Next Lesson: External Data Source