-
YuSeok Kim
- PowerBuilder
- Wednesday, 25 June 2025 04:10 AM UTC
Powerbuilder Version : 2019R3 (build 2728)
SQL Server Version : 2017 std and 2022 std (both using phase for upgrade in this month)
I try to create Powerbuilder Datawindow with Microsoft SQL Server's Temporal table Temporal Tables - SQL Server | Microsoft Learn
but not working by syntax issue
I guess my argument declare isn't properly or argument using in as of clause for temporal tables isn't support in powerbuilder
following is datawindow source code about retrieving from table
Does anyone have an idea or an insight for me? I couldn't think clearly.
table(
column=(type=long update=yes updatewhereclause=yes key=yes name=trademarkid dbname="TrademarkID" )
column=(type=long update=yes updatewhereclause=yes name=isoverseas dbname="IsOverseas" )
column=(type=char(100) update=yes updatewhereclause=yes name=country dbname="Country" )
column=(type=char(100) update=yes updatewhereclause=yes name=applicationnumber dbname="ApplicationNumber" )
column=(type=date update=yes updatewhereclause=yes name=applicationdate dbname="ApplicationDate" )
column=(type=char(100) update=yes updatewhereclause=yes name=registrationnumber dbname="RegistrationNumber" )
column=(type=date update=yes updatewhereclause=yes name=registrationdate dbname="RegistrationDate" )
column=(type=date update=yes updatewhereclause=yes name=expirationdate dbname="ExpirationDate" )
column=(type=long update=yes updatewhereclause=yes name=renewalcount dbname="RenewalCount" )
column=(type=char(50) update=yes updatewhereclause=yes name=status dbname="Status" )
column=(type=char(50) update=yes updatewhereclause=yes name=productclassification dbname="ProductClassification" )
column=(type=char(100) update=yes updatewhereclause=yes name=applicant dbname="Applicant" )
column=(type=char(100) update=yes updatewhereclause=yes name=markname dbname="MarkName" )
column=(type=char(100) update=yes updatewhereclause=yes name=finalholder dbname="FinalHolder" )
column=(type=char(500) update=yes updatewhereclause=yes name=remark dbname="Remark" )
column=(type=char(100) update=yes updatewhereclause=yes name=trademarkimage dbname="TradeMarkImage" )
column=(type=char(100) update=yes updatewhereclause=yes name=trademarkcertificate dbname="TradeMarkCertificate" )
column=(type=char(100) update=yes updatewhereclause=yes name=attachment_1 dbname="Attachment_1" )
column=(type=char(100) update=yes updatewhereclause=yes name=attachment_2 dbname="Attachment_2" )
column=(type=char(100) update=yes updatewhereclause=yes name=attachment_3 dbname="Attachment_3" )
column=(type=char(100) update=yes updatewhereclause=yes name=trademarkimage_name dbname="TradeMarkImage_name" )
column=(type=char(100) update=yes updatewhereclause=yes name=trademarkcertificate_name dbname="TradeMarkCertificate_name" )
column=(type=char(100) update=yes updatewhereclause=yes name=attachment_1_name dbname="Attachment_1_name" )
column=(type=char(100) update=yes updatewhereclause=yes name=attachment_2_name dbname="Attachment_2_name" )
column=(type=char(100) update=yes updatewhereclause=yes name=attachment_3_name dbname="Attachment_3_name" )
column=(type=char(6) update=yes updatewhereclause=yes name=lasteditor dbname="LastEditor" )
column=(type=datetime updatewhereclause=no name=sysstarttime dbname="SysStartTime" )
retrieve="SELECT TrademarkID, IsOverseas, Country, ApplicationNumber, ApplicationDate, RegistrationNumber, RegistrationDate, ExpirationDate, RenewalCount, Status, ProductClassification, Applicant, MarkName, FinalHolder, Remark, TradeMarkImage, TradeMarkCertificate, Attachment_1, Attachment_2, Attachment_3, TradeMarkImage_name, TradeMarkCertificate_name, Attachment_1_name, Attachment_2_name, Attachment_3_name, LastEditor, SysStartTime AT TIME ZONE 'UTC' AT TIME ZONE 'Korea Standard Time' as SysStartTime
FROM dbo.tb_Trademarks
FOR SYSTEM_TIME AS OF :ref_dt
WHERE TrademarkID = :trademark_id"
arguments=(("trademark_id", long),("ref_dt", datetime)) update="dbo.tb_Trademarks" updatewhere=1 updatekeyinplace=no
)
+++
Also, following pattern coding works, but in window/user object side powerscript way isn't good architecture Me and my senior thought, so I found some way to using in datawindow definition codes
ls_sql = "SELECT ~~~"
dw_p.SetTransObject(SQLCA)
dw_p.SetSqlSelect(ls_sql)
dw_p.Retrieve()
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.