我想從c#調用下面的informix sp,但無法編譯它。我想給它傳遞一個像'2012-11-22'這樣的字符串和兩次像'08:15:00'並將它們轉換爲日期和兩個日期時間,但我似乎無法找到正確的informix函數。我花了整整一天的時間來解決這個問題,任何幫助都很有意義。Informix,過程,將字符串轉換爲時間
不知道下面的代碼是否會編譯,因爲我不得不刪除一些敏感的部分,但我希望它足以給你這個想法。
的TO_DATE功能是不正確的,我認爲
create procedure up_myproc(
calndr_dt CHAR(15)
, actvty_typ CHAR(5)
, actvty_start_tm CHAR(15)
, actvty_end_tm CHAR(15)
, actvty_cap SMALLINT
)
DEFINE calendar_activity_id int;
DEFINE activity_details_id int;
-- calendar activity
insert into caa61140 (
caa61140001
, caa61140004
, caa61140005
)
values (
0
, org_id
, DATE(calndr_dt)
);
LET calendar_activity_id = DBINFO('sqlca.sqlerrd1');
-- activity details
insert into caa61240 (
caa61240001
, caa61240002
, caa61240003
, caa61240004
)
values (
0
,calendar_activity_id
, TO_DATE(actvty_start_tm, "%H:%M")
, TO_DATE (actvty_end_tm, "%H:%M")
);
LET activity_details_id = DBINFO('sqlca.sqlerrd1');
-- calendar matter
insert into caa61340(caa61340001
, caa61340002)
SELECT activity_details_id
, caa60840003 matter_typ
FROM caa60840 -- valid matter types;
WHERE caa60840001=org_id
AND caa60840002=actvty_typ;
end procedure;