Hi
I'm converting a Powerbuilder project to Powerserver. Some of the windows use SQLPreview to call stored procedures to update the database.
SQLPreview isn't supported by Powerserver, so I want to modify the datawindow dynamically to use the stored procedure.
The powerbuilder help section - Using stored procedures to update the database - suggests this can be done.
In addition, using Modify to enable a DataWindow object to use stored procedures to update the database when it is not already using stored procedures requires that the type qualifier be specified first. Calling the type qualifier ensures that internal structures are built before subsequent calls to Modify. If a new method or method arguments are specified without a preceding definition of type, Modify fails.
I'm confused because Update.Type, Update.Method and Update.Argument are described as Internal use only.
I found the example about changing the select statement from a select to a stored procedure, but I've not been able to find anything about using modify to enable a new stored procedure.
Is there a way I can do this using modify or will I need to change the entire datawindow syntax?
Thanks in advance
Jim
Andreas.
We rarely have any complex SQL on the PB Side. DWOs just select from a view and I've only came across 1 which had complex SQL - this is for retrieval anyway, so it doesn't need changing to use an SP.
We started using SQLPreview before SP Update came along so that we could call an SP to update the database where necessary. The code just gets values from the rows and then passes the values to the SP. We continued with this as it couldn't get trashed compared to using Datawindow SP Update. a
My view on using SQL is that any complexity is better in the database, and not in front end code which should only call simple singleton SQL statements or SPs otherwise.
My SP to generate the SP Update syntax is pretty much ready now, so I'll be able to use that. I have a function that displays an error message if a dw is not configured for SP Update when it should be (probably trashed by painter). This runs when the window opens, so it will detect the problem if it's occurred.
Generating the DW syntax from the DB and using the SP Update checker might be useful for your clients!
Cheers
Jim
As mentioned in reply, I'm going to change the DW by generating the SP Update syntax and editing the DW. However, I would be interested to know if SP update can be set up dynamically without changing the entire DW syntax. The extract from docs (see below) appears to suggest this is possible, but I couldn't find anything about how to do it.
Cheers
Jim
In addition, using Modify to enable a DataWindow object to use stored procedures to update the database when it is not already using stored procedures requires that the type qualifier be specified first. Calling the type qualifier ensures that internal structures are built before subsequent calls to Modify. If a new method or method arguments are specified without a preceding definition of type, Modify fails.
I'm confused because Update.Type, Update.Method and Update.Argument are described as Internal use only.