Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Trouble w/ ODP.NET calling Function

Trouble w/ ODP.NET calling Function

From: hb <hbranyan.SPAMBLOCK_at_merc.mercer.edu>
Date: Wed, 28 Apr 2004 10:22:26 -0400
Message-ID: <c6oejg$dsaoa$1@ID-92475.news.uni-berlin.de>


Having trouble with calling a function in .NET w/ ODP.NET.

Function spec in Oracle:

FUNCTION RptIsFinished (
iRptClsNm IN report_instances.rpt_class_nm%TYPE, iRptNm IN report_instances.rpt_nm%TYPE,
iSubmitDt IN VARCHAR,
iSubmitBy IN report_instances.submit_by%TYPE )
RETURN BOOLEAN; C# code w/ ODP.Net provider:

OracleParameter rv = cmd.Parameters.Add("RetVal", OracleDbType.Decimal, ParameterDirection.ReturnValue);
rv.Size = 1;
OracleParameter parmClass = cmd.Parameters.Add( "iRptClsNm", OracleDbType.Varchar2, ParameterDirection.Input ); parmClass.Value = className;
OracleParameter parmReport = cmd.Parameters.Add( "iRptNm", OracleDbType.Varchar2, ParameterDirection.Input ); parmReport.Value = reportName;
OracleParameter parmSubmitDate = cmd.Parameters.Add( "iSubmitDt", OracleDbType.Varchar2, ParameterDirection.Input ); parmSubmitDate.Value = submitDate;
OracleParameter parmSubmitBy = cmd.Parameters.Add( "iSubmitBy", OracleDbType.Varchar2, ParameterDirection.Input ); parmSubmitBy.Value = submitBy;

cmd.CommandText = "CLEANUP_REPORTS.RptIsFinished"; cmd.CommandType = CommandType.StoredProcedure; conn.Open();
cmd.ExecuteNonQuery();
if ( (OracleDecimal)rv.Value == 1 )
{ // etc.

I get the following error:
ORA-06550: line 1, column 18: PLS-00382: expression is of wrong type ORA-06550: line 1, column 7: PL/SQL: Statement ignored

Is this because SubmitDt is a VARCHAR in the function constructor, but I only have varchar2 available as a OracleDbType??

_hillarie Received on Wed Apr 28 2004 - 09:22:26 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US