1. Ganesan Rajan
  2. PowerServer
  3. Tuesday, 10 May 2022 13:59 PM UTC

Hi,

I have a query related to PowerServer. 

We are interested to explore the powerserver/PowerBuilder Cloud Pro, as it gives native cloud deployment capability to the application.

I also learn that the PowerServer doesn't support SQL Preview event.

But in our application (almost in all transaction windows), we do inserts and updates in SQL Preview event, as shown below.

IF SqlType = PreviewInsert! 

    CALL an SP to insert record

IF SqlType = PreviewUpdate! 

       CALL an SP to update record

Whenever pfc_save is called, the above code is executed to do inserts/updates in database

If we have to user PowerServer/PowerBuilder Cloud Pro, what is the alternate solution?

Your suggestions are most welcome.

Thanks,

Ganesan R

 

 

Ronnie Po Accepted Answer Pending Moderation
  1. Wednesday, 11 May 2022 16:43 PM UTC
  2. PowerServer
  3. # 1

Hi Ganesan,

I know this is not what you are asking, but is there a reason you are not using the "Stored Procedure Update" feature of the DataWindow itself? If you're not familiar with this, you access it in the DW painter under Rows > Stored Procedure Update...

You can specify which SP to call for insert, update, delete. If you don't specify a stored procedure for a particular SQL operation, that operation will be handled in the traditional way.

You do have to be sure that all arguments to the stored procedures are represented by either a column or computed column in the dwo, so you may need to add some dummy columns depending on your scenario.

With this technique, there's no need to visit the sqlpreview event.

Comment
  1. Ronnie Po
  2. Wednesday, 11 May 2022 18:33 PM UTC
:-D
  1. Helpful
  1. Mark Goldsmith
  2. Thursday, 12 May 2022 00:36 AM UTC
Yes, very cool! Hmm...maybe the feature entertainment for the next in-person Elevate?! Lol.
  1. Helpful
  1. Ronnie Po
  2. Thursday, 12 May 2022 02:40 AM UTC
Lol, we may be too old by the time there's an in-person Elevate.
  1. Helpful
There are no comments made yet.
Ganesan Rajan Accepted Answer Pending Moderation
  1. Wednesday, 11 May 2022 12:03 PM UTC
  2. PowerServer
  3. # 2

Hi Julie,

Thanks for the response.

If it is few windows , definitely we can adapt the solution you have suggested.

But there are thousands of lines written in SQL Preview event across 50 to 75 windows. Hence it will be very difficult.

 

Thanks,

Ganesan R

Comment
There are no comments made yet.
Julie Jiang @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 11 May 2022 08:58 AM UTC
  2. PowerServer
  3. # 3

Hi Ganesan,

Is it possible for you to change the code to the following way to work around SQLPreview unsupported feature?  Do you have any concern about this workaround?  If possible, please provide me a test case (send it to product@appeon.com).  I will ask our team to study about it.

long ll_row
DWItemStatus ldws_status

for ll_row = 1 to dw_1.rowcount() 
                ldws_status = dw_1.getitemstatus(ll_row,0,primary!)
                choose case ldws_status
                                case NewModified! 
                                               CALL an SP to insert record                                             
                                case DataModified!
                                                CALL an SP to update record
                                case else
                                                continue
                end choose
next

Best regards, Julie

Comment
  1. Miguel Leeuwe
  2. Wednesday, 11 May 2022 13:41 PM UTC
You guys are claiming 99% compatibility, and yet, this important feature is still not supported. Sorry if that sounds harsh.
  1. Helpful
  1. Armeen Mazda @Appeon
  2. Wednesday, 11 May 2022 15:00 PM UTC
Hi Miguel, The 99% is referring to # of unsupported features vs. supported feature. It is not referring to 99% of people don't use a particular unsupported feature. Anyway, we are totally on same page that this is important unsupported feature.
  1. Helpful
  1. Miguel Leeuwe
  2. Wednesday, 11 May 2022 23:40 PM UTC
Yes, I've never been in any project where the sqlpreview wasn't used in some way.

Thanks!
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 10 May 2022 15:28 PM UTC
  2. PowerServer
  3. # 4

Hi Ganesan;

  Unfortunately, these SQLPreview events are not supported in PS 2021 ... https://docs.appeon.com/ps2021/bk06ch02s01s05.html

Regards ... Chris

Comment
  1. Mariano Collado @Appeon
  2. Tuesday, 10 May 2022 15:47 PM UTC
After consulting with our product manager, we have determined that there will not be enhancements made to the SQLPreview event in the initial release of the next major version of PowerServer (PowerServer 2022)

The limitations detailed in our documentation (https://docs.appeon.com/ps2021/bk06ch02s01s05.html) will still apply for PowerServer 2022, at least for the initial release. We invite you to test out if these limitations will affect your project.

As of this time, we cannot provide more news on future developments regarding the SQLPreview event. For future information, you can reach out to us again or review the changelog of future PowerServer versions.
  1. Helpful
  1. Miguel Leeuwe
  2. Wednesday, 11 May 2022 23:43 PM UTC
When looking for a workaround, the documentation still says it will be supported in the next (pb2022) version. Maybe someone should change that.

https://docs.appeon.com/ps2021/bk06ch02s01s05.html

"Workaround

This feature will be supported in the next release."
  1. Helpful
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.