Omni
Omni

Reputation: 337

oracle Stored Procedure with Out parameter

I'm having trouble using an Oracle stored procedure that has an out parameter. I don't have access to view the actual stored proc but here is the method signature:

CHECKPASSWORDUSED (System.Decimal USER_IN, System.String PASSWORD_IN, out System.Decimal PW_FAIL)

And this is how I'm trying to call it.

public decimal CheckIfPasswordUsed(long userId, string password)
{
    decimal? used;
    _context.CHECKPASSWORDUSED(userId, password, out used);
    return Convert.ToDecimal(used);
}

I had to define an out variable but I'm not sure if I'm using this right. Am I on the right track?

Edit: The error messages I get are:

[OracleException (0x80004005): ORA-06550: line 2, column 3:
PLS-00201: identifier 'CHECK_PASSWORD_USED' must be declared
ORA-06550: line 2, column 3:
PL/SQL: Statement ignored]
Devart.Data.Oracle.bc.d() +872
Devart.Data.Oracle.an.i() +112
Devart.Data.Oracle.an.c() +3016
Devart.Data.Oracle.x.a(Int32 A_0, bt A_1) +3343
Devart.Data.Oracle.OracleCommand.InternalExecute(CommandBehavior behavior, IDisposable disposable, Int32 startRecord, Int32 maxRecords, Boolean nonQuery) +4880
Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior, Boolean nonQuery) +764
Devart.Data.Oracle.OracleCommand.ExecuteNonQuery() +69
Devart.Data.Linq.Provider.DataProvider.ExecuteQuery(CompiledQuery compiledQuery, Object[] parentArgs, Object[] userArgs, Object lastResult) +3675

Upvotes: 2

Views: 962

Answers (1)

Omni
Omni

Reputation: 337

I have discovered the answer!

Since this is my first time using Oracle I was unaware of 'Synonyms'. I had the dba create a synonym for the stored procedure and now I'm rocking and rolling!

For anyone interested you can read more about it here:

http://www.techonthenet.com/oracle/synonyms.php http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_7001.htm

Upvotes: 2

Related Questions