Click here to Skip to main content
15,922,015 members
Home / Discussions / C#
   

C#

 
GeneralRe: update data in xml file Pin
N a v a n e e t h27-Jun-08 20:41
N a v a n e e t h27-Jun-08 20:41 
Questionimmediate window Pin
arkiboys27-Jun-08 2:02
arkiboys27-Jun-08 2:02 
AnswerRe: immediate window Pin
Pete O'Hanlon27-Jun-08 2:49
mvePete O'Hanlon27-Jun-08 2:49 
QuestionWebBrowser control in Windows Application using C#.. Pin
Sasmi_Office27-Jun-08 2:02
Sasmi_Office27-Jun-08 2:02 
Questionxml serialisation Pin
JoZ CaVaLLo27-Jun-08 2:00
JoZ CaVaLLo27-Jun-08 2:00 
AnswerRe: xml serialisation Pin
leppie27-Jun-08 3:47
leppie27-Jun-08 3:47 
AnswerRe: xml serialisation Pin
JoZ CaVaLLo30-Jun-08 23:48
JoZ CaVaLLo30-Jun-08 23:48 
QuestionNewbie Problems... Pin
scotlandc27-Jun-08 1:50
scotlandc27-Jun-08 1:50 
Hi all,

Am trying to call a simple function held against an Oracle database. I've included the function at the bottom of this post. All it does is return a varchar(3) value along the lines of 'ROW' or 'ENG', depending on what value was passed in so one IN parameter and one OUT.

The C# code used to call this is as follows:

OracleCommand cmd = new OracleCommand("SMD2EUP.get_lan_id", con);

cmd.CommandType = CommandType.StoredProcedure;

OracleParameter cv_Ref = new OracleParameter("cv_ref", OracleType.Number, 5);
cv_Ref.Value = item.CV.Ref;
cv_Ref.Direction = ParameterDirection.Input;


OracleParameter lan_ID = new OracleParameter("this_lan_id", OracleType.VarChar, 3);
lan_ID.Direction = ParameterDirection.Output;

cmd.Parameters.Add(cv_Ref);
cmd.Parameters.Add(lan_ID);

cmd.Connection = con;

con.Open();

cmd.ExecuteNonQuery();

string result = cmd.Parameters["this_lan_id"].Value.ToString();



The SMD2eup is the name of the package that the function is stored in and get_lan_id is the name of the function. All code compiles successfully. When I run the application I get ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'GET_LAN_ID'

What am I missing as I can't see anything wrong with the code, 1 IN paramter of type Number (or int) and 1 OUT parameter of type VARCHAR(3) (or string) with the directions being declared.

Please can some one help?

Thanks very much...







FUNCTION get_lan_id(cv_ref eup_comm_veh.xvol_region_ref%TYPE) RETURN eup_comm_veh.lan_id%TYPE
IS
this_lan_id eup_comm_veh.lan_id%TYPE;

BEGIN

SELECT lan_id
INTO this_lan_id
FROM eup_comm_veh
WHERE cvh_id IN (SELECT MIN(cvh_id)
FROM eup_comm_veh
WHERE xvol_region_ref = cv_ref);

RETURN(this_lan_id);

EXCEPTION
WHEN NO_DATA_FOUND THEN
this_lan_id := LAN_ERROR;
RETURN(this_lan_id);

WHEN OTHERS THEN
this_lan_id := LAN_ERROR;
RETURN(this_lan_id);

END get_lan_id;
AnswerRe: Newbie Problems... Pin
Pete O'Hanlon27-Jun-08 11:41
mvePete O'Hanlon27-Jun-08 11:41 
QuestionSMS Service Pin
hadad27-Jun-08 1:24
hadad27-Jun-08 1:24 
AnswerRe: SMS Service Pin
Simon P Stevens27-Jun-08 1:52
Simon P Stevens27-Jun-08 1:52 
GeneralRe: SMS Service Pin
Marek Grzenkowicz27-Jun-08 3:31
Marek Grzenkowicz27-Jun-08 3:31 
AnswerRe: SMS Service Pin
Giorgi Dalakishvili27-Jun-08 4:13
mentorGiorgi Dalakishvili27-Jun-08 4:13 
Questionarray Pin
cst_kvp27-Jun-08 0:38
cst_kvp27-Jun-08 0:38 
AnswerRe: array Pin
N a v a n e e t h27-Jun-08 0:54
N a v a n e e t h27-Jun-08 0:54 
GeneralRe: array Pin
Rao Rafique27-Jun-08 22:51
Rao Rafique27-Jun-08 22:51 
AnswerRe: array Pin
Simon P Stevens27-Jun-08 0:54
Simon P Stevens27-Jun-08 0:54 
Questionstring.Empty Vs "" Pin
Abhijit Jana26-Jun-08 23:53
professionalAbhijit Jana26-Jun-08 23:53 
AnswerRe: string.Empty Vs "" Pin
N a v a n e e t h26-Jun-08 23:58
N a v a n e e t h26-Jun-08 23:58 
GeneralRe: string.Empty Vs "" Pin
Paw Jershauge27-Jun-08 0:10
Paw Jershauge27-Jun-08 0:10 
GeneralRe: string.Empty Vs "" Pin
N a v a n e e t h27-Jun-08 0:37
N a v a n e e t h27-Jun-08 0:37 
GeneralRe: string.Empty Vs "" Pin
S. Senthil Kumar27-Jun-08 4:27
S. Senthil Kumar27-Jun-08 4:27 
AnswerRe: string.Empty Vs "" [modified] Pin
Paw Jershauge27-Jun-08 0:10
Paw Jershauge27-Jun-08 0:10 
GeneralRe: string.Empty Vs "" Pin
Abhijit Jana27-Jun-08 0:40
professionalAbhijit Jana27-Jun-08 0:40 
GeneralRe: string.Empty Vs "" Pin
Guffa27-Jun-08 1:20
Guffa27-Jun-08 1:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.