asp で oracle 関数に oracle 日付を指定すると、Classic ASP でエラーが発生します。私のコード:
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
私のオラクル機能:
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;
/