By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,483 Members | 1,054 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,483 IT Pros & Developers. It's quick & easy.

Problem when accessing Oracle Procedure with varchar2

P: n/a
hi,

i'm using System.Data.OracleClient; but it seems not having Varchar2 and i
use Varchar instead. Then when i call a Oracle Procedure update a table with
varchar2, i got the following error:

==============
Error Message
==============

System.Data.OracleClient.OracleException: ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'UPDATE_DOC_NAME'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

at System.Data.OracleClient.OracleConnection.CheckErr or(OciHandle
errorHandle, Int32 rc)
at System.Data.OracleClient.OracleCommand.Execute(Oci Handle
statementHandle, CommandBehavior beha
vior, Boolean isReader, Boolean needRowid, OciHandle& rowidDescriptor,
ArrayList& refCursorParameter
Ordinals)
at System.Data.OracleClient.OracleCommand.Execute(Oci Handle
statementHandle, CommandBehavior beha
vior, Boolean needRowid, OciHandle& rowidDescriptor)
at System.Data.OracleClient.OracleCommand.ExecuteNonQ ueryInternal(Boolean
needRowid, OciHandle& r
owidDescriptor)
at System.Data.OracleClient.OracleCommand.ExecuteNonQ uery()
at SynESDForm.Class1.Main(String[] args)

==============
C# source code:
==============

cmd.CommandText = "ESD_DLFORM_PKG.update_doc_name";
cmd.CommandType = CommandType.StoredProcedure;
//cmd.Parameters.Add(new OracleParameter("a1",
OracleType.Cursor)).Direction = ParameterDirection.Output;
//cmd.Parameters.Add(new OracleParameter("a2",
OracleType.Cursor)).Direction = ParameterDirection.Output;
//cmd.Parameters.Add(new OracleParameter("doc_id",
OracleType.VarChar)).Direction = ParameterDirection.Input;
//cmd.Parameters.Add(new OracleParameter("doc_name",
OracleType.VarChar)).Direction = ParameterDirection.Input;
OracleParameter paramDocID = new OracleParameter("p_doc_id",
OracleType.VarChar, 9, "DOCID");
paramDocID.Direction = ParameterDirection.Input;
paramDocID.Value = strDocID;
Console.WriteLine("strDocID: " + strDocID);
cmd.Parameters.Add(paramDocID);

cmd.ExecuteNonQuery();

==============
Oracle Procedure
==============
PROCEDURE update_doc_name (
p_doc_id IN ABC_DLFORM.DOCID%TYPE,
p_doc_name IN ABC_DLFORM.DOCNAME%TYPE
);

where DOCID and DOCNAME are varchar2 datatype
Nov 16 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
fixed!

thanks!
"Mullin Yu" <mu*******@ctil.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
hi,

i'm using System.Data.OracleClient; but it seems not having Varchar2 and i
use Varchar instead. Then when i call a Oracle Procedure update a table with varchar2, i got the following error:

==============
Error Message
==============

System.Data.OracleClient.OracleException: ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'UPDATE_DOC_NAME'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

at System.Data.OracleClient.OracleConnection.CheckErr or(OciHandle
errorHandle, Int32 rc)
at System.Data.OracleClient.OracleCommand.Execute(Oci Handle
statementHandle, CommandBehavior beha
vior, Boolean isReader, Boolean needRowid, OciHandle& rowidDescriptor,
ArrayList& refCursorParameter
Ordinals)
at System.Data.OracleClient.OracleCommand.Execute(Oci Handle
statementHandle, CommandBehavior beha
vior, Boolean needRowid, OciHandle& rowidDescriptor)
at System.Data.OracleClient.OracleCommand.ExecuteNonQ ueryInternal(Boolean needRowid, OciHandle& r
owidDescriptor)
at System.Data.OracleClient.OracleCommand.ExecuteNonQ uery()
at SynESDForm.Class1.Main(String[] args)

==============
C# source code:
==============

cmd.CommandText = "ESD_DLFORM_PKG.update_doc_name";
cmd.CommandType = CommandType.StoredProcedure;
//cmd.Parameters.Add(new OracleParameter("a1",
OracleType.Cursor)).Direction = ParameterDirection.Output;
//cmd.Parameters.Add(new OracleParameter("a2",
OracleType.Cursor)).Direction = ParameterDirection.Output;
//cmd.Parameters.Add(new OracleParameter("doc_id",
OracleType.VarChar)).Direction = ParameterDirection.Input;
//cmd.Parameters.Add(new OracleParameter("doc_name",
OracleType.VarChar)).Direction = ParameterDirection.Input;
OracleParameter paramDocID = new OracleParameter("p_doc_id",
OracleType.VarChar, 9, "DOCID");
paramDocID.Direction = ParameterDirection.Input;
paramDocID.Value = strDocID;
Console.WriteLine("strDocID: " + strDocID);
cmd.Parameters.Add(paramDocID);

cmd.ExecuteNonQuery();

==============
Oracle Procedure
==============
PROCEDURE update_doc_name (
p_doc_id IN ABC_DLFORM.DOCID%TYPE,
p_doc_name IN ABC_DLFORM.DOCNAME%TYPE
);

where DOCID and DOCNAME are varchar2 datatype

Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.