tags:

views:

45

answers:

1

I have to call a previously created function on SQL, like

SET  @ExtVALUE = sysdba.GetNextAccountExternalId('{TYPE}')  

but I can't manage to find if OPF3 has some of this functionality already.

Need to use OPF3, direct access to the SQL connection is not feasible in the architecture.

I think in a solution somewhat like this:

var functionQuery = "select sysdba.GetNextAccountExternalId('{0}') as result";

objContext.GetObjectReader<>();

What class should I put inside the <> ???

A: 

Just for the record,

var functionQuery = String.Format("SELECT sysdba.GetNextAccountExternalId('{0}')", account.Type);

var functionResult = (string)new SqlRawStorageAccess(Context.Storage as SqlStorageBase).
                                CreateCommand(new SqlQuery(functionQuery)).ExecuteScalar();

Works.

jpabluz