0
當在asp中將oracle日期授予oracle函數時,在經典ASP中出現錯誤。我的代碼:在經典asp中使用oracle日期參數調用oracle函數
dim startDate, endDate
startDate = rs1.fields("oraDate1") 'field is oracle field. Gets with oracle to_char('30.10.203','dd/mm/yyyy')
endDate = rs1.fields("oraDate2") 'oraDate2 is like oraDate1
if IsDate(startDate) Then
Set cmd = Server.CreateObject("ADODB.Command")
cmd.ActiveConnection = conn
cmd.CommandText = "find_business_day" 'oracle function
cmd.CommandType = 4
dim date1, date2
set date1 = cmd.CreateParameter("start_date",135,1)
cmd.Parameters.Append date1
date1.value = startDate
set date2 = cmd.CreateParameter("end_Date", 135, 1)
cmd.Parameters.Append date2
date2.value = endDate
cmd.Execute
的錯誤是在cmd.Execute
線,該錯誤信息是:
Microsoft OLE DB Provider for ODBC Drivers hata '80004005' [Microsoft][ODBC driver for Oracle]Invalid parameter type
我的Oracle功能:
CREATE OR REPLACE FUNCTION find_business_day (my_trh1 date,my_trh2 date) return number is
my_isgunu number(2);
begin
select count(*) into my_isgunu from takvim where tatil=1 and tarih between my_trh1 and my_trh2;
Return(my_isgunu);
exception
When others then return(0);
end find_business_day;
/
如果你'date1.value = CDATE(的startDate)'會發生什麼?我注意到你正在做'IsDate(startDate)',仍然... – SearchAndResQ
給出相同的錯誤(無效的參數類型)。我認爲CDate與oracle日期不符。 – cejoseph