Click here to Skip to main content
15,897,187 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
In my code am getting following error.
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'SAVE_DATA'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

What will be the reason for this?

code am using is,

C#
List<oracleparameter> listparamters = new List<oracleparameter>();
                OracleParameter prm = null;
                OracleParameter prm1 = null;
                OracleParameter prm2 = null;
                OracleParameter prm3 = null;
                OracleParameter prm4 = null;
                prm = new OracleParameter(Param, OracleType.VarChar);
                prm1 = new OracleParameter(Param1, OracleType.VarChar);
                prm2 = new OracleParameter(Param2, OracleType.VarChar);
                prm3 = new OracleParameter(Param3, OracleType.VarChar);
                prm4 = new OracleParameter(Param4, OracleType.VarChar);

                  prm.Value = "Test";
              
                    prm1.Value = "TRUE";
                    prm2.Value = "FALSE";
                    prm3.Value = "FALSE";
                    prm4.Value = "FALSE";
               
              
                prm.Direction = ParameterDirection.Input;
                prm 1.Direction = ParameterDirection.Input;
                prm2.Direction = ParameterDirection.Input;
                prm3.Direction = ParameterDirection.Input;
                prm3.Direction = ParameterDirection.Input;
                 paramters.Add(prm);
                 paramters.Add(prm1);
                 paramters.Add(prm2);
                 paramters.Add(prm3);
                 paramters.Add(prm3);

                OracleCommand command = objDataAccessUtilities.GetOracleCommand(SaveData, paramters);
                objDataAccessUtilities.ExecuteDataReader(command);

Procedure:

SQL
PROCEDURE SAVE_DATA(
Value1 IN varchar2,
Value2 IN varchar2,
Value3 IN varchar2,
Value4 IN varchar2,
Value5 IN varchar2) IS       

 COUNT  INTEGER;
 
BEGIN

Select count(Field_name) into  COUNT from table1 where UPPER(Filed_name)=UPPER(Value1);

IF  COUNT>0 THEN

update table1
SET
Field 2=Value2  ,
Field 3=Value2Value3  ,
Field 4=Value2Value4  ,
Field 5=Value2Value5  ,
where UPPER(Filed_name)=UPPER(Value1);

ELSE

INSERT INTO table1(
field,
field,
field,
field,
field,
field,
field,
field,
)
VALUES(
Value,
Value,,
Value,,
Value,,
Value,,
Value,,
SYSDATE,
USER
);    
END IF;

commit;

EXCEPTION
 WHEN OTHERS THEN   
  Rollback; 

END SAVE_DATA;
Posted
Updated 13-May-13 3:00am
v2

The problem is with objDataAccessUtilities.ExecuteDataReader(command); instead of this we have to use
objDataAccessUtilities.ExecuteNonQuery(command);
 
Share this answer
 
If you type "ORA-06550" in google (or any other ORA error) you'll get the explanation. In this case, not much of help as it seems to be a generic error. My guess is that it might be because you add prm3 twice (not sure though):

//btw is "paramters" a typ-o ?  
paramters.Add(prm3);
paramters.Add(prm3);


I would first try to call the Stored Procedure from the database to check if that works, then call it from code.

PS: Please verify that the code you provide here is 100% the same as the code you use. There seem to be several typ-o's in the provided code, which makes it harder to find the culprit.

hope this helps.
 
Share this answer
 
Comments
Am Gayathri 13-May-13 9:23am    
Sorry i cant publish my exact code here cause of some security issues.
V. 13-May-13 9:25am    
Don't apologize, not necessary. it is just harder to correctly answer a question. if you do change the code, make sure it "fits". I don't thing the provided sample works ...
Am Gayathri 14-May-13 5:57am    
Hi It is solved ,
The problem was with objDataAccessUtilities.ExecuteDataReader(command); instead of this we have to use
objDataAccessUtilities.ExecuteNonQuery(command);
V. 14-May-13 5:59am    
good work. :-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900