I have spent a great deal of time trying to call a basic stored procedure in a Firebird database without success. I cannot believe that it should be so difficult! I have googled the web and have found some examples, but when I implement them, exceptions are generated.
I have tried the following code:
IObjectScope scope = dbContext.GetInternalScope();
IQuery query = scope.GetSqlQuery(
"auto_inc_master_detail ?, ?, ?, ?"
"INT inMasterCode, SMALLINT inReservationType, VARCHAR inWorkstation, SMALLINT inFetchFolioCode"
IQueryResult resultSet = query.Execute(0, Reservation.MAST_IN_PROGRESS, Environment.MachineName, (Int16)1);
When I execute it, I receive the following exception:
SQLState=;Dynamic SQL Error
SQL error code = -104
Token unknown - line 1, column 38
My situation is simple: I have a stored procedure named auto_inc_master_detail that accepts four parameters and returns four values. I would like to call this stored procedure from a project that uses Telerik ORM Domain Model, but direct SQL is okay. At this point, anything will be accepted.
Here is a typical call as I would use it using exact parameter names:
outRecordNo, outMasterCode, outItemNumber, outFolioCode
Input parameter types: INTEGER, SMALLINT, VARCHAR, SMALLINT
Output types: INTEGER, INTEGER, INTEGER, INTEGER
Any working code example of this type would be greatly appreciated.