.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old June 22nd, 2004, 04:14 PM
hazrah8 hazrah8 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 4 hazrah8 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
System.Data.OracleClient.OracleException: ORA-06550: while calling stored procedure

I'm trying to call a stored procedure and I get System.Data.OracleClient.OracleException: ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'CTSINSERT2'

I have created a stored procedure called CTSINSERT2 which works fine from SQL*Plus


OracleConnection conn = GetOracleConnection();
String carrierCode = "CN1";
String fileName = "CN1-Test";
String subTime = "20040616020000";
String periodFrom = "20040101";
String periodTo = "20040131";
String formID = "6";
String comments = "Testing";
OracleCommand command = new OracleCommand ("CTSINSERT2", conn);

command.CommandType = CommandType.StoredProcedure;

OracleParameter pcarrierCode = new OracleParameter("pcarrierCode", new OracleString(carrierCode));
OracleParameter pfile = new OracleParameter("pfile", new OracleString(fileName));
OracleParameter psubDate = new OracleParameter("psubDate", new OracleString(subTime));
OracleParameter psDate = new OracleParameter("psDate", new OracleString(periodFrom));
OracleParameter peDate = new OracleParameter("peDate", new OracleString(periodTo));
OracleParameter pformID = new OracleParameter("pformID", new OracleString(formID));
OracleParameter pComments = new OracleParameter("pComments", new OracleString(comments));

command.Parameters.Add(pcarrierCode);
command.Parameters.Add(pfile);
command.Parameters.Add(psubDate);
command.Parameters.Add(psDate);
command.Parameters.Add(peDate);
command.Parameters.Add(pformID);
command.Parameters.Add(pComments);

conn.Open();
command.ExecuteNonQuery();
conn.Close();

Any help will be appreciated

Reply With Quote
  #2  
Old July 21st, 2004, 12:59 AM
Semrau Semrau is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 1 Semrau User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
the same problem!! 0ra 06550

hi there
have solved this problem?
can you tell me what was the reason?
simon

Reply With Quote
  #3  
Old August 20th, 2004, 09:08 AM
anweshi anweshi is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 1 anweshi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
System.Data.OracleClient.OracleException: ORA-06550: line 1, column 7: PLS-00306: wro

Hi

I faced the same problem, and could solve it. U need to specify the oracle parameters in the
following way.

Dim cmd As New OracleCommand
Dim con As New OracleConnection(constring)
con.Open()
cmd.Connection = con
cmd.CommandText = "procname"
cmd.CommandType = CommandType.StoredProcedure

cmd.Parameters.Add(New OracleParameter("arg1", OracleType.Number, 16)).Value = 10
cmd.Parameters.Add(New OracleParameter("arg2", OracleType.Number, 16)).Value = 20
cmd.Parameters.Add(New OracleParameter("arg3", OracleType.VarChar, 240)).Value = 30
cmd.ExecuteNonQuery()

I think it might help you
Regards
Anu

Reply With Quote
  #4  
Old November 28th, 2006, 12:10 AM
jimfollett1 jimfollett1 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2006
Posts: 1 jimfollett1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 54 m 9 sec
Reputation Power: 0
Snap

Heya,

I have been getting the same problem. I have been trawling code examples high and low to no avail. Here's my calling code to a simple, one output, stored proc. It gives the error:

PLS-00306: wrong number or types of arguments in call to 'TEST'

However, when I changed the provider to System.Data.OleDb it worked fine - any theories?

cheers,
James


VB.NET code
-----------------------------------------------------------
Dim conn2 As New System.Data.OracleClient.OracleConnection("...")
Dim cmd2 As New System.Data.OracleClient.OracleCommand
conn2.Open()
cmd2.Connection = conn2
cmd2.CommandType = CommandType.StoredProcedure
cmd2.CommandText = "test"

cmd2.Parameters.Add("Id", OracleClient.OracleType.Int32, 9)
cmd2.Parameters("Id").Direction = ParameterDirection.Output

cmd2.ExecuteScalar()
Dim j As Integer = CInt(cmd2.Parameters("").Value)
conn2.Close()
-----------------------------------------------------------



Stored Proc:
-----------------------------------------------------------
PROCEDURE test
(outId out number)
IS
BEGIN
SELECT SEQ.nextval into outId FROM dual;
END test;

-----------------------------------------------------------

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgramming.NET Development > System.Data.OracleClient.OracleException: ORA-06550: while calling stored procedure


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap