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.
Thanks !
Never too old to learn. I misinterpreted the news on the dot notation when it came out years ago.
:)
When DW dot-notation was introduced (PB5??? That was a monumental release!), I was told that dot-notation incurs more overhead because of late binding... The compiler defers parsing and binding of everything past the "dw.Object." portion of the expression until execution time, whereas the GetItemXXXXX and SetItem functions can be fully compiled into psuedo-code or machine code and therefore execute faster. That may no longer be the case, but that's how I was taught.