.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

How do I call a Stored Procedure with one associative array as Out put Parameter ?

Posted By: Rohan     Posted Date: July 14, 2010    Points:2   Category :ASP.Net
How do I call a Stored Procedure with one associative array as Out put Parameter?

I got an error

ERROR
Error ---->
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call

STORE PROCEDURE
My Store Procedure Prototype is as follows :------------>

create or replace package PCK_TAX_CALCULATION as

type tax_type is table of NUMBER index by varchar2(20);
procedure tax_calculation(BASIC_AMT in NUMBER,TAX_PLAN in varchar2,TAX_VALUETABLE out tax_type);


end;


create or replace package BODY PCK_TAX_CALCULATION AS

procedure "TAX_CALCULATION"
(BASIC_AMT IN NUMBER ,TAX_PLAN IN VARCHAR2,TAX_VALUETABLE OUT tax_type )
is

/*
SOME LOGIC
*/
dbms_output.put_line('Total Tax '|| total_tax_amt);
Exception
WHEN OTHERS THEN
dbms_output.put_line('some error occur');
end TAX_CALCULATION;
end PCK_TAX_CALCULATION;

call from Dot net 2.0

Oracle.DataAccess.Client.OracleConnection conn = new Oracle.DataAccess.Client.OracleConnection("Data Source=GANAK2;User ID=rohan;Password=rohan;");
Oracle.DataAccess.Client.OracleCommand cmd = new Oracle.DataAccess.Client.OracleCommand();
cmd.Connection = conn;

cmd.CommandType = CommandType.StoredProcedure;//begin PCK_TAX_CALCULATION.TAX_CALCULATION(:1, :2, :3); end;
cmd.CommandText = "PCK_TAX_CALCULATION.TAX_CALCULATIONS";
//cmd.CommandText = "begin PCK_TAX_CALCULATION.TAX_CALCULATION(:1, :2, :3); end;";
Oracle.DataAccess.Client.OracleParameter PmtrBasicAmt = new Oracle.DataAccess.Client.OracleParameter();
PmtrBasicAmt.OracleDbType = Oracle.DataAccess.Client.OracleDbType.Decimal;
PmtrBasicAmt.Value = 1000;
PmtrBasicAmt.Direction = ParameterDirection.Input;
PmtrBasicAmt.ParameterName = "BASIC_AMT";


Oracle.DataAccess.Client.OracleParameter PmtrTaxPlan = new Oracle.DataAccess.Client.OracleParameter();
PmtrTaxPlan.OracleDbType = Oracle.DataAccess.Client.OracleDbType.Varchar2;
PmtrTaxPlan.Value = "A1";
PmtrTaxPlan.Direction = ParameterDirection.Input;
PmtrTaxPlan.ParameterName = "TAX_PLAN";
PmtrTaxPlan.Size =30;


// System.Data.OracleClient.OracleParameter AarrayAllTaxType = new System.Data.OracleClient.OracleParameter();
Oracle.DataAccess.Client.OracleParameter AarrayAllTaxType = new Oracle.DataAccess.Client.OracleParameter();
AarrayAllTaxType.OracleDbType = Oracle.DataAccess.Client.OracleDbType.Decimal;

AarrayAllTaxType.CollectionType = Oracle.DataAccess.Client.OracleCollectionType.PLSQLAssociativeArray;
AarrayAllTaxType.Direction = ParameterDirection.Output;
AarrayAllTaxType.ParameterName = "TAX_VALUETABLE"; //Tax_valueTable
AarrayAllTaxType.Size = 10;
AarrayAllTaxType.Value = DBNull.Value;
cmd.Parameters.Clear();
cmd.Parameters.Add(PmtrBasicAmt);
cmd.Parameters.Add(PmtrTaxPlan);
cmd.Parameters.Add(AarrayAllTaxType);

ERROR
Error ---->
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call


Responses

No response found. Be the first to respond this post
Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend