This is a migrated thread and some comments may be shown as answers.

Stored procedure in FireBird

4 Answers 91 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Krzysztof Szulc
Top achievements
Rank 1
Krzysztof Szulc asked on 05 Feb 2010, 05:53 AM
Helo, I`ve problem with using stored procedure in Reverse mapping in FireBird. I,ve sp whith return in out parameter single value look like :

CREATE PROCEDURE CHECK_AUTHORIZATION (
    ID_USER INTEGER,
    ID_AUTHORIZATION INTEGER)
RETURNS (
    ACCESS_GRANT INTEGER)
AS
BEGIN
ACCESS_GRANT = 1;
SUSPEND;
END

But function generate by ORM return null.  In this function also is bug  ":" in parameter name.
Please tell me how can I use stored procedure from FireBird in ORM.

Thx

4 Answers, 1 is accepted

Sort by
0
Ady
Telerik team
answered on 10 Feb 2010, 04:54 PM
Hello Krzysztof Szulc,

 The OUT parameter values of a stored procedure can be accessed using the 'OutParameter' property of the IQueryResult obtained after executing the query. The value of this property is a dictionary with the OUT parameter name as the key and value is the value of the out parameter. The following code will be generated to obtain the value of the out parameter.
For example:
 IQueryResult res = query.Execute(new object[] {customerID});
int a = res.Count;//Actually executes the query
object value = res.OutParamer["ACCESS_GRANT"];

Best wishes,
Ady
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
Krzysztof Szulc
Top achievements
Rank 1
answered on 10 Feb 2010, 06:36 PM
Hello, thx  for Your replly.
But my problem is that the value of OutParameter["ACCESS_GRANT"]
after execute query is null.  I`ve problem only with out parameter. Other stored procedure without 
out parameter work fine.

This is code of function generated by ORM, with out ":" in paramtere name.

public

 

static IQueryResult checkAuthorization(IObjectScope scope,int? iD_USER,int? iD_AUTHORIZATION,ref int? aCCESS_GRANT)

 

{

 

IQuery query = scope.GetSqlQuery("\"CHECK_AUTHORIZATION\" ?,?,?",null,"INTEGER ID_USER,INTEGER ID_AUTHORIZATION,OUT.INTEGER ACCESS_GRANT");

 

 

 

IQueryResult res = query.Execute(new object[] {iD_USER,iD_AUTHORIZATION,aCCESS_GRANT});

 

 

int a = res.Count;//Actually executes the query

 

 

aCCESS_GRANT= res.OutParameter[

"ACCESS_GRANT"] as int?;

 

 

 

return res;

 

}



Best regards  
0
Ady
Telerik team
answered on 18 Feb 2010, 03:20 PM
Hi Krzysztof Szulc,

 Sorry for the delayed reply. I did have a look at the problem and can confirm that this is a bug while obtaining the value of OUT parameters for a Firebird stored procedure. We will fix this asap and the fix should be available in the Q1 release, shortly.

I'm afraid currently there is no workaround.

Your Telerik points have been updated.

Sincerely yours,
Ady
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Krzysztof Szulc
Top achievements
Rank 1
answered on 18 Feb 2010, 05:04 PM
Hello, thanks for reply.
I`ll  waiting for Q1 relase.
Tags
Getting Started
Asked by
Krzysztof Szulc
Top achievements
Rank 1
Answers by
Ady
Telerik team
Krzysztof Szulc
Top achievements
Rank 1
Share this question
or