Sql custom function with Chili's opf3
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 <> ???
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.
精彩评论