Stored procedure in FireBird

5 posts, 0 answers
  1. Krzysztof Szulc
    Krzysztof Szulc avatar
    5 posts
    Member since:
    Jan 2010

    Posted 04 Feb 2010 Link to this post

    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
  2. Ady
    Admin
    Ady avatar
    588 posts

    Posted 10 Feb 2010 Link to this post

    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.
  3. DevCraft banner
  4. Krzysztof Szulc
    Krzysztof Szulc avatar
    5 posts
    Member since:
    Jan 2010

    Posted 10 Feb 2010 Link to this post

    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  
  5. Ady
    Admin
    Ady avatar
    588 posts

    Posted 18 Feb 2010 Link to this post

    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.
  6. Krzysztof Szulc
    Krzysztof Szulc avatar
    5 posts
    Member since:
    Jan 2010

    Posted 18 Feb 2010 Link to this post

    Hello, thanks for reply.
    I`ll  waiting for Q1 relase.
Back to Top
DevCraft banner