- Pierce Liu
- PowerBuilder
- Friday, 21 October 2022 07:11 AM UTC
Dear Sir,
We just migrated our system from PB7 to PB2021.
However, we found those windows which using "For-Loop" script in datawindow", the processing time become very slow.
The PB2021 version is about 50 times slower than the PB7 Version.
We use Oracle as database and the only change that we did during the mirgration is to add connection profile's DBParmso we can deal with Nchar/Nvarchar columns.
I put our connction string and for-loop script below.
// Profile User Connection
SQLCA.DBMS = ProfileString("LOGIN.INI","Database","DBMS","")
SQLCA.LogPass = ls_passwd
SQLCA.ServerName = ProfileString("LOGIN.INI","Database","ServerName","")
SQLCA.LogId = ls_user
SQLCA.AutoCommit = False
SQLCA.DBParm = "StaticBind=0,NCharBind=1"
For Loop script is like
for i = 1 to dw_2.rowcount()
ls_yn = dw_2.object.w_check[i]
if ls_yn = 'Y' then
dw_2.object.efrb_rpt_no[i] = dw_1.object.efrc_rpt_no[dw_1.getrow()]
dw_2.object.efrb_stn_cd[i] = dw_1.object.efrc_stn_cd[dw_1.getrow()]
dw_2.object.efrb_sfc_cd[i] = dw_1.object.efrc_sfc_cd[dw_1.getrow()]
dw_2.object.efrb_status_code[i] = '2'
else
dw_2.object.efrb_rpt_no[i] = ''
dw_2.object.efrb_stn_cd[i] = ''
dw_2.object.efrb_sfc_cd[i] = ''
dw_2.object.efrb_status_code[i] = '1'
end if
next
Do you have any suggestion? Thank you very much and looking forward to your reply.
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.