473,506 Members | 17,393 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calling a store procedure using C#

I was wondering if someone can help me out. I'm getting the following
error:

Message: ORA-06550: line 1, column 7: PLS-00306: wrong number or types
of arguments in call to 'GET_RIGHTS2' ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'GET_RIGHTS2'
ORA-06550: line 1, column 7: PLS-00306: wrong number or types of
arguments in call to 'GET_RIGHTS2' ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'GET_RIGHTS2'
ORA-06550: line 1, column 7: PLS-00306: wrong number or types of
arguments in call to 'GET_RIGHTS2' ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'GET_RIGHTS2'
ORA-06550: line 1, column 7: PL/SQL: Statement ignored
Here is the stored procedure

CREATE OR REPLACE package admin_package
AS

TYPE CHAR_ARRAY IS TABLE OF VARCHAR2(50) INDEX BY BINARY_INTEGER;

TYPE GRP_IDTABLETYPE IS TABLE OF SEC_GRP.GRP_ID%TYPE
INDEX BY BINARY_INTEGER;
TYPE BRANCHTABLETYPE IS TABLE OF SEC_CONSOLD.CONSOLIDATED_BRANCH_CODE
%TYPE
INDEX BY BINARY_INTEGER;
TYPE PRODUCERTABLETYPE IS TABLE OF
SEC_CONSOLD.CONSOLIDATED_PRODUCER_CODE%TYPE
INDEX BY BINARY_INTEGER;
TYPE SUBPRODUCERTABLETYPE IS TABLE OF
SEC_CONSOLD.CONSOLIDATED_SUBPRODUCER_CODE%TYPE
INDEX BY BINARY_INTEGER;
TYPE READINDTABLETYPE IS TABLE OF SEC_GRP_RIGHTS.READ_IND%TYPE
INDEX BY BINARY_INTEGER;
TYPE WRITEINDTABLETYPE IS TABLE OF SEC_GRP_RIGHTS.WRITE_IND%TYPE
INDEX BY BINARY_INTEGER;
TYPE LEVELINDTABLETYPE IS TABLE OF SEC_GRP_RIGHTS.LEVEL_IND%TYPE
INDEX BY BINARY_INTEGER;
TYPE GRP_NAMETABLETYPE IS TABLE OF SEC_GRP.GRP_NAME%TYPE
INDEX BY BINARY_INTEGER;

PROCEDURE GET_RIGHTS2 (SGRPID IN SEC_GRP.GRP_ID%TYPE,
SCONSOLDBRANCH OUT BRANCHTABLETYPE,
SCONSOLDPRODUCER OUT PRODUCERTABLETYPE,
SCONSOLDSUBPRODUCER OUT SUBPRODUCERTABLETYPE,
SREADIND OUT READINDTABLETYPE,
SWRITEIND OUT WRITEINDTABLETYPE,
SLEVELIND OUT LEVELINDTABLETYPE)
IS
iIndex BINARY_INTEGER := 0;
CURSOR GRCUR (SGRPID IN SEC_GRP.GRP_ID%TYPE) IS
SELECT CONSOLIDATED_BRANCH_CODE, CONSOLIDATED_PRODUCER_CODE,
CONSOLIDATED_SUBPRODUCER_CODE, READ_IND, WRITE_IND, LEVEL_IND
FROM SEC_GRP_RIGHTS
Where GRP_ID = SGRPID ;
BEGIN
FOR GetRec IN GRCUR(SGRPID)
LOOP
iIndex := iIndex + 1;
SCONSOLDBRANCH(iIndex) := GetRec.CONSOLIDATED_BRANCH_CODE;
SCONSOLDPRODUCER(iIndex) := GetRec.CONSOLIDATED_PRODUCER_CODE;
SCONSOLDSUBPRODUCER(iIndex) :=
GetRec.CONSOLIDATED_SUBPRODUCER_CODE;
SREADIND(iIndex) := GetRec.READ_IND;
SWRITEIND(iIndex) := GetRec.WRITE_IND;
SLEVELIND(iIndex) := GetRec.LEVEL_IND;
END LOOP;
END GET_RIGHTS2;
END;
/

and here is the C# code

OracleCommand myCMD1 = new OracleCommand();
myCMD1.Connection = Oraclecon1;
myCMD1.CommandText = "SECURITY_PROC.ADMIN_PACKAGE.GET_RIGHTS2";
myCMD1.CommandType = CommandType.StoredProcedure;
OracleParameter param1 = myCMD1.Parameters.Add("SGRPID", null);
OracleParameter param2 = myCMD1.Parameters.Add("SCONSOLDBRANCH",
null);
OracleParameter param3 = myCMD1.Parameters.Add("SCONSOLDPRODUCER",
null);
OracleParameter param4 =
myCMD1.Parameters.Add("SCONSOLDSUBPRODUCER", null);
OracleParameter param5 = myCMD1.Parameters.Add("SREADIND", null);
OracleParameter param6 = myCMD1.Parameters.Add("SWRITEIND", null);
OracleParameter param7 = myCMD1.Parameters.Add("SLEVELIND", null);

param1.Direction = ParameterDirection.Input;
param2.Direction = ParameterDirection.Output;
param3.Direction = ParameterDirection.Output;
param4.Direction = ParameterDirection.Output;
param5.Direction = ParameterDirection.Output;
param6.Direction = ParameterDirection.Output;
param7.Direction = ParameterDirection.Output;

param1.Value = strGrpId;
param1.Size = 8000;
param2.Size = 8000;
param3.Size = 8000;
param4.Size = 8000;
param5.Size = 8000;
param6.Size = 8000;
param7.Size = 8000;

try
{
Oraclecon1.Open();
OracleDataReader myReader = myCMD1.ExecuteReader();
int x;
int count;
count = 0;
while (myReader.Read())
{
for (x = 0; x <= myReader.FieldCount - 1; x++)
Response.Write(myReader.GetValue(x));
Console.WriteLine();
count += 1;

}
//OracleDataAdapter da = new OracleDataAdapter(myCMD);
//da.Fill(ds);
//DG_ShowUserInfo.DataSource = ds;
//DG_ShowUserInfo.DataBind();

}
catch (OracleException ex)
{
string errorMessage = "Code: " + ex.Code + "<br>" +
"Message: " + ex.Message;

Response.Write(errorMessage);
}
Oraclecon1.Close();

Feb 9 '07 #1
1 4820
This looks like an Oracle error. I'd try posting this to an Oracle
newsgroup.

Robin S.
Ts'i mahnu uterna ot twan ot geifur hingts uto.
-----------------------------------------------
"C#_Beginner" <c0*****@allstate.comwrote in message
news:11*********************@a75g2000cwd.googlegro ups.com...
>I was wondering if someone can help me out. I'm getting the following
error:

Message: ORA-06550: line 1, column 7: PLS-00306: wrong number or types
of arguments in call to 'GET_RIGHTS2' ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'GET_RIGHTS2'
ORA-06550: line 1, column 7: PLS-00306: wrong number or types of
arguments in call to 'GET_RIGHTS2' ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'GET_RIGHTS2'
ORA-06550: line 1, column 7: PLS-00306: wrong number or types of
arguments in call to 'GET_RIGHTS2' ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'GET_RIGHTS2'
ORA-06550: line 1, column 7: PL/SQL: Statement ignored
Here is the stored procedure

CREATE OR REPLACE package admin_package
AS

TYPE CHAR_ARRAY IS TABLE OF VARCHAR2(50) INDEX BY BINARY_INTEGER;

TYPE GRP_IDTABLETYPE IS TABLE OF SEC_GRP.GRP_ID%TYPE
INDEX BY BINARY_INTEGER;
TYPE BRANCHTABLETYPE IS TABLE OF SEC_CONSOLD.CONSOLIDATED_BRANCH_CODE
%TYPE
INDEX BY BINARY_INTEGER;
TYPE PRODUCERTABLETYPE IS TABLE OF
SEC_CONSOLD.CONSOLIDATED_PRODUCER_CODE%TYPE
INDEX BY BINARY_INTEGER;
TYPE SUBPRODUCERTABLETYPE IS TABLE OF
SEC_CONSOLD.CONSOLIDATED_SUBPRODUCER_CODE%TYPE
INDEX BY BINARY_INTEGER;
TYPE READINDTABLETYPE IS TABLE OF SEC_GRP_RIGHTS.READ_IND%TYPE
INDEX BY BINARY_INTEGER;
TYPE WRITEINDTABLETYPE IS TABLE OF SEC_GRP_RIGHTS.WRITE_IND%TYPE
INDEX BY BINARY_INTEGER;
TYPE LEVELINDTABLETYPE IS TABLE OF SEC_GRP_RIGHTS.LEVEL_IND%TYPE
INDEX BY BINARY_INTEGER;
TYPE GRP_NAMETABLETYPE IS TABLE OF SEC_GRP.GRP_NAME%TYPE
INDEX BY BINARY_INTEGER;

PROCEDURE GET_RIGHTS2 (SGRPID IN SEC_GRP.GRP_ID%TYPE,
SCONSOLDBRANCH OUT BRANCHTABLETYPE,
SCONSOLDPRODUCER OUT PRODUCERTABLETYPE,
SCONSOLDSUBPRODUCER OUT SUBPRODUCERTABLETYPE,
SREADIND OUT READINDTABLETYPE,
SWRITEIND OUT WRITEINDTABLETYPE,
SLEVELIND OUT LEVELINDTABLETYPE)
IS
iIndex BINARY_INTEGER := 0;
CURSOR GRCUR (SGRPID IN SEC_GRP.GRP_ID%TYPE) IS
SELECT CONSOLIDATED_BRANCH_CODE, CONSOLIDATED_PRODUCER_CODE,
CONSOLIDATED_SUBPRODUCER_CODE, READ_IND, WRITE_IND, LEVEL_IND
FROM SEC_GRP_RIGHTS
Where GRP_ID = SGRPID ;
BEGIN
FOR GetRec IN GRCUR(SGRPID)
LOOP
iIndex := iIndex + 1;
SCONSOLDBRANCH(iIndex) := GetRec.CONSOLIDATED_BRANCH_CODE;
SCONSOLDPRODUCER(iIndex) := GetRec.CONSOLIDATED_PRODUCER_CODE;
SCONSOLDSUBPRODUCER(iIndex) :=
GetRec.CONSOLIDATED_SUBPRODUCER_CODE;
SREADIND(iIndex) := GetRec.READ_IND;
SWRITEIND(iIndex) := GetRec.WRITE_IND;
SLEVELIND(iIndex) := GetRec.LEVEL_IND;
END LOOP;
END GET_RIGHTS2;
END;
/

and here is the C# code

OracleCommand myCMD1 = new OracleCommand();
myCMD1.Connection = Oraclecon1;
myCMD1.CommandText = "SECURITY_PROC.ADMIN_PACKAGE.GET_RIGHTS2";
myCMD1.CommandType = CommandType.StoredProcedure;
OracleParameter param1 = myCMD1.Parameters.Add("SGRPID", null);
OracleParameter param2 = myCMD1.Parameters.Add("SCONSOLDBRANCH",
null);
OracleParameter param3 = myCMD1.Parameters.Add("SCONSOLDPRODUCER",
null);
OracleParameter param4 =
myCMD1.Parameters.Add("SCONSOLDSUBPRODUCER", null);
OracleParameter param5 = myCMD1.Parameters.Add("SREADIND", null);
OracleParameter param6 = myCMD1.Parameters.Add("SWRITEIND", null);
OracleParameter param7 = myCMD1.Parameters.Add("SLEVELIND", null);

param1.Direction = ParameterDirection.Input;
param2.Direction = ParameterDirection.Output;
param3.Direction = ParameterDirection.Output;
param4.Direction = ParameterDirection.Output;
param5.Direction = ParameterDirection.Output;
param6.Direction = ParameterDirection.Output;
param7.Direction = ParameterDirection.Output;

param1.Value = strGrpId;
param1.Size = 8000;
param2.Size = 8000;
param3.Size = 8000;
param4.Size = 8000;
param5.Size = 8000;
param6.Size = 8000;
param7.Size = 8000;

try
{
Oraclecon1.Open();
OracleDataReader myReader = myCMD1.ExecuteReader();
int x;
int count;
count = 0;
while (myReader.Read())
{
for (x = 0; x <= myReader.FieldCount - 1; x++)
Response.Write(myReader.GetValue(x));
Console.WriteLine();
count += 1;

}
//OracleDataAdapter da = new OracleDataAdapter(myCMD);
//da.Fill(ds);
//DG_ShowUserInfo.DataSource = ds;
//DG_ShowUserInfo.DataBind();

}
catch (OracleException ex)
{
string errorMessage = "Code: " + ex.Code + "<br>" +
"Message: " + ex.Message;

Response.Write(errorMessage);
}
Oraclecon1.Close();

Feb 10 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
3610
by: vhvoun | last post by:
Hi, I've encountered this problem as below: I tried to called Oracle Store Procedure from VBS and it failed. The VBS is scheduled using NT Task Scheduler in Win 2000 environment using...
2
4017
by: Jin | last post by:
Hello: I run one process that calls the following the store procedure and works fine. create PROCEDURE sp_GetHostSequenceNum AS BEGIN SELECT int_parameter_dbf + 1
30
2240
by: Tim Marshall | last post by:
Here's the scenario, A2003, Jet back end, illustrated with some cut down code at the end of the post: A proc dims a snapshot recordset (dim rst as Dao.recordset) and opens it. There are several...
1
6121
by: Hugo Lefevre | last post by:
Dear, I have a problem : I have a database which contains my data of hardware. The Id is a varchar and I want at my filling form that my user know which is the last one. So I made a store...
2
1434
by: singlal | last post by:
Hi, my question was not getting any attention because it moved to 2nd page; so posting it again. Sorry for any inconvenience but I need to get it resolved fast. Need your help! ...
5
2229
by: Stephen Plotnick | last post by:
I'm very new to VB.NET, or any VB. I need to have form1 call form2 which calls form3, etc. I am able to use oledb in form1 to get the data. I build all the data for form2 and form3 from...
5
26206
by: Alan T | last post by:
Currently our SQL Server 2000 database table field is using char to store as boolean, ie. "T" or "F". Now we change the field from char to bit field. I am not sure how it has impact on the C#...
11
4346
by: c676228 | last post by:
Hi everyone, I am just wodering in asp program, if there is anybody writing store procedure for inserting data into database since there are so many parameters need to be passed into store...
10
3235
by: sulekhasweety | last post by:
Hi, the following is the definition for calling convention ,which I have seen in a text book, can anyone give a more detailed explanation in terms of ANSI - C "the requirements that a...
0
7105
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7308
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7371
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7479
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5617
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3188
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3178
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.