SAMPLE #2
If Len(Trim(data)) = 6 Then
String ls_date
ls_date = data
ls_date = mid(ls_date, 1, 4) + "/" + mid(ls_date, 5, 2) + "/01"
/*
SELECT TO_CHAR(LAST_DAY(TO_DATE(:ls_date, 'YYYY/MM/DD')),'YYYY/MM/DD')
INTO :ls_dped
FROM SYSIBM.SYSDUMMY1;
*/
String ls_sqlstatement, ls_value
ls_sqlstatement = "SELECT TO_CHAR(LAST_DAY(TO_DATE('" + ls_date + "', 'YYYY/MM/DD')),'YYYYMMDD') " &
+ " FROM SYSIBM.SYSDUMMY1"
PREPARE SQLSA FROM :ls_sqlstatement ;
DESCRIBE SQLSA INTO SQLDA ;
DECLARE my_cursor DYNAMIC CURSOR FOR SQLSA ;
OPEN DYNAMIC my_cursor USING DESCRIPTOR SQLDA ;
FETCH my_cursor USING DESCRIPTOR SQLDA ;
ls_value = SQLDA.GetDynamicString(1)
CLOSE my_cursor ;
This.SetItem(row, "q02dpsd", data + "01")
This.SetItem(row, "q02dped", ls_value )
End If
Sample#3
STRING LS_SQL
LS_SQL = " INSERT INTO CLVDTALB.TZUPA110(ZUPDIV, ZUPFNM, ZUPEXT, ZUPSFNM, ZUPSIZE, ZUPPGMID, ZUPKEY, ZUPREGEM) "&
+ " VALUES ('F','"+ls_FileName+"','"+ls_Ext+"','"+pSerFile+"',"+STRING(ll_zupsize)+",'"+ls_windowid+"','"+as_key+"','"+gs_emp_no+"')"
EXECUTE IMMEDIATE :LS_SQL USING SQLCA;
If Sqlca.SqlCode = 0 Then
SELECT ZUPID
INTO :ll_zupid
FROM CLVDTALB.TZUPA110
WHERE ZUPSFNM = :pSerFile;
as_filename = ls_FileName
Else
MessageBox("알림1", "파일업로드 정보 저장 시 오류가 발생하였습니다.~r~n"+Sqlca.SqlErrText)
ChangeDirectory(gs_dir)
Return -1
End If
Else
MessageBox("알림", "파일업로드 시 오류가 발생하였습니다.")
ChangeDirectory(gs_dir)
Return -1
End If