"Newbie" wrote...
//i couldnt find the namespace required for OracleDbType.In t32
That depends on which provider you're using!
If you don't use Oracle's provider (where the types are defined in
Oracle.DataAcce ss.Client.Oracl eDbType), you should be able to use
System.Data.Ora cleClient.Oracl eType instead (in Microsoft's provider for
Oracle).
I haven't run any stored functions with it myself (I've only used Oracle's
own provider), so I'm not sure about the behaviour from Microsoft's
provider...
But my guess is that you simply can change OracleDbType to OracleType in
your code... :-)
i'm getting the exception:
Parameter 'p1': No size set for variable length data type: String.
Well, you don't set any types or names for any parameters at all, so I
believe it defaults to String, which *must* be defined with a length (just
as CHAR and VARCHAR2 in Oracle must have lengths)...
With the small changes I mentioned above, you'll probably at least come one
step further...
OracleCommand cmd = new OracleCommand() ;
cmd.Connection = oraConn;
cmd.CommandText = "ops$sqltime.pa _new_job_no_fn" ;
cmd.CommandType = CommandType.Sto redProcedure;
OracleParameter par1 =
new OracleParameter ("RETURN_VALUE" , OracleType.Int3 2);
par1.Direction = ParameterDirect ion.ReturnValue ;
cmd.Parameters. Add(par1);
// It's best to check what the input parameter *really* is
// named in the stored function, and to use that name...
par1 = new OracleParameter ("PROJECT_NO ", OracleType.Int3 2);
par1.Value = projectNo;
par1.Direction = ParameterDirect ion.Input;
cmd.Parameters. Add(par1);
int affectedRows = (int) cmd.ExecuteNonQ uery();
ljn = (int) cmd.Parameters["RETURN_VAL UE"].Value;
// Bjorn A