The vbscript function:
Code: Select all
Function AsasDataUpdateStatus(rtnstat,cstartdate)
'Function AsasDataUpdateStatus( rtnstat )
'Function AsasDataUpdateStatus(rtnstat,cstartdate,switchmsg)
' this function with switchmsg is fail/not call
on error goto 0
AsasDataUpdateStatus = 0
'if not pArtnGetDateData.EOF then
'cstartdate = pArtnGetDateData.fields("today")
'else
'end if
'msgbox rtnstat
'msgbox cstartdate
cProcStat = "SWT"
if rtnstat = "S" then
cProcStat = "CAS"
end if
nProsKey = pArtnAsasData.fields("HistoryKey")
pArtnAsasSql = "update SVC_ACT_HISTORY set rtn_status = '" & rtnstat & "', PROCESS_CURRENT_ATTEMP_NO = PROCESS_CURRENT_ATTEMP_NO + 1 "
pArtnAsasSql = pArtnAsasSql & ", process_status = '" & cProcStat & "'"
pArtnAsasSql = pArtnAsasSql & ", ASAS_SVC_START_STATUS_DATE = '" & cstartdate & "',"
pArtnAsasSql = pArtnAsasSql & " ASAS_SVC_NEW_STATUS_DATE = getdate() "
pArtnAsasSql = pArtnAsasSql & ", ASAS_SVC_NEW_STATUS = '" & rtnstat & "'"
pArtnAsasSql = pArtnAsasSql & " where HistoryKey = " & nProsKey
'msgbox pArtnAsasSql
'pArtnAsasSql = pArtnAsasSql & ", ASAS_SVC_START_STATUS_DATE = " & cstartdate & ""
'pArtnAsasSql = pArtnAsasSql & ", ASAS_SVC_NEW_STATUS_DATE = " & cenddata & ""
'msgbox pArtnAsasSql
set pUpdate = pArtnOdbcConn.Execute(pArtnAsasSql)
on error resume next
if err.number > 0 then
AsasDataUpdateStatus = -1
end if
'msgbox "Asas tel sql 2 : " & GetAsasData
'msgbox pArtnAsasData
on error resume next
msgbox switchmsg
'pArtnAsasSql = "insert into SVC_ACT_log( HISTORYKEY, PROCESS_STATUS, RTN_STATUS,ACTIVITY_START_DATE,ACTIVITY_END_DATE,RETURN_CODE) values ( "
pArtnAsasSql = "insert into SVC_ACT_log( HISTORYKEY, PROCESS_STATUS, RTN_STATUS,ACTIVITY_START_DATE,ACTIVITY_END_DATE ) values ( "
pArtnAsasSql = pArtnAsasSql & nProsKey
pArtnAsasSql = pArtnAsasSql & ", 'SWT' "
pArtnAsasSql = pArtnAsasSql & ", '" & rtnstat & "'"
pArtnAsasSql = pArtnAsasSql & ", '" & cstartdate & "' ,"
pArtnAsasSql = pArtnAsasSql & " getdate() "
'pArtnAsasSql = pArtnAsasSql & " '" & switchmsg & "' "
pArtnAsasSql = pArtnAsasSql & " ) "
'msgbox pArtnAsasSql
set pUpdate = pArtnOdbcConn.Execute(pArtnAsasSql)
on error resume next
if err.number > 0 then
AsasDataUpdateStatus = -1
end if
'msgbox "Asas tel sql 2 : " & GetAsasData
'msgbox pArtnAsasData
on error resume next
'update process control
'
pControlSQLexist = "select count(*) as ntotal from REF_PROCESS_CONTROL where SYSTEM_TYPE = 'ASAS' and PROCESS_NO = 1 "
set pAControlEXISTData = pArtnOdbcConn.Execute(pControlSQLexist)
if err.number > 0 then
UpdateArtnData = 2
end if
'msgbox pArtnSQLexist
If pAControlEXISTData.fields("ntotal") <1>AsasDataLoop
VBEval>GetNextTelNo,TelNo
//messagemodal>TelNo
if>TelNo=-1
GOto>FinishAsasDataLoop
else
// assign telno to Asas telno
GoSub>Set_AsasTelRtn
//messagemodal>AsasTelRtn
Let>ActivationStatus=F
//Let>cstartdate
vbeval>GetDateTime(),currentdate
//messagemodal>%currentdate%
let>H30=a
GoSub>ACT_AsasTelRtn
//let>cenddate
//messagemodal>ActivationStatus
let>aa=%ActivationStatus%
let>SwitchResult='%H30%'
//messagemodal>H30
//messagemodal>SwitchResult
//Vbeval>AsasDataUpdateStatus("%aa%","%currentdate%","%SwitchResult%"),cstatreply --- this does not work even if i remove the '' from let>SwitchResult='%H30%'
Vbeval>AsasDataUpdateStatus("%aa%","%currentdate%"),cstatreply
the result is output from switch message as per code below:
Code: Select all
Let>H30_SIZE=4098
LibFunc>hIE,ExtractTag,r,%IE[0]%,,H3,0,0,H30
//messagemodal>H30
//messagemodal>r
MIDSTR>r_6,1,r,H30 -- if I comment this code, then the function works
//messagemodal>H30
//messagemodal>r