ORA-1036 when executing function without params

ORA-1036 when executing function without params

Postby dcoracle600pro » Wed 22 May 2013 15:00

Hi, I'm trying to execute a function who has no parameters. This function return a varchar

I receive an error ORA-0136: illegal variable name/number

Here is my code :
Code: Select all
using (GeneralEntities dataContext = this.GetEntitiesObject<GeneralEntities>())
{
    OracleConnection connexion = (dataContext.Connection as EntityConnection).StoreConnection as OracleConnection;
    connexion.Open();
    OracleCommand command = new OracleCommand("dbpc_cloee.getDatabasePlainText",connexion);
    command.Parameters.Clear();
    OracleParameter pReturn = new OracleParameter();
    pReturn.Direction = System.Data.ParameterDirection.ReturnValue;
    pReturn.OracleDbType = OracleDbType.VarChar;
    command.Parameters.Add(pReturn);
    command.ExecuteNonQuery();

    return (string)pReturn.Value;
}


I use almost the same code to execute another function who has parameters and it works fine.

Any idea ?

Thanks !

PS: EF4.50 - dotConnect 6.60
dcoracle600pro
 
Posts: 43
Joined: Mon 09 Apr 2012 09:57

Re: ORA-1036 when executing function without params

Postby Shalex » Thu 23 May 2013 13:29

Please replace

Code: Select all
OracleCommand command = new OracleCommand("dbpc_cloee.getDatabasePlainText",connexion);

with

Code: Select all
OracleCommand command = new OracleCommand("dbpc_cloee.getDatabasePlainText",connexion);
command.CommandType = System.Data.CommandType.StoredProcedure;

and notify us about the result.
Shalex
Devart Team
 
Posts: 7780
Joined: Thu 14 Aug 2008 12:44

Re: ORA-1036 when executing function without params

Postby dcoracle600pro » Fri 24 May 2013 13:56

Oh no, it was so simple...

Yes, it works now.


Thank you !
dcoracle600pro
 
Posts: 43
Joined: Mon 09 Apr 2012 09:57


Return to dotConnect for Oracle