BCB Components rotating around DirectX

Welcome to BCB-Tools.com Latest News

Development Tools Demo Applications Step-By-Step Tutorials Component Reference

Register Here Available Downloads

Frequently Asked Questions Discussion Forums Receive emails from BCB-Tools.com Send us some Feedback

Links to other sites Information about the BCB-Tools.com website


    FORUM MESSAGE
    Go to the Welcome Page
        FORUM MESSAGE

    You are reading a General forum message.

    Stored Procedures ...how work with arguments and returned values

    Author: Israel Luengo

    Date Posted: 2005-10-10 09:46:21



    Well, recently....coding in Interbase (do not test with Firebird, sorry)
    i discover the Stored Procedures? what's this?

    It like a small process into the Database Engine....that makes a defined work
    and it's called by the client application,  but with a component dedicated to this work
    the benefit it's that for example, you can have flexibility for queries that must return values
    used here throught the PARAMS property and defined as Parameters in IBEasy+

    which component? IBStoredProc at InterBase component tab....

    if (supposed) we have the TIBDatabase connected to our database file (GDB framework)
    and inserted the TIBStoredProc component + the TIBTransaction component and all linked properly

    Step 1)  used IBEasy+ of Marc Grange (it's freeware) for declare the parameter variables (kind Input or Output) and the Stored Procedure itself

    Step 2) with the TIBStoredProc component....we select the name of procedure in StoredProcName property

    Step 3) we call initialize the procedure by for example as follow....

    //code of example previously, we must have the connection to
    //database assigned correctly and we're logged in IBX server

    ///The code for execute the procedure and get the output results

    void __fastcall TForm1::Button1Click(TObject *Sender)
    {
       float returned_value = 0;


    IBStoredProc1->ExecProc();  //call to execute the procedure


    //for example, here at position 0 of Item array, is the
    //variable TOTAL (defined as output float value in IBEasy+ (as parameters))

    returned_value = IBStoredProc1->Params->Items[0]->AsFloat;

    ShowMessage(returned_value);

    }
    //---------------------------------------------------------------------------

    Hope it helps to understand Stored Procedures and how use it.
    Israel
    NAME: TOTALIZE





    REPLY TO THIS MESSAGE?
    Top    

    You can post a reply to this General message using the form below:
    Your Name:


    Message Subject:


    Message Body:


    Verification:





    When ready, click on the submit button below:






Top

Welcome |  Latest News |  Tools |  Demos |  Tutorials |  Reference |  Register |  Downloads
FAQ |  Forums |  Feedback |  Mailing List |  Links |  Site Information

This page is Copyright © 2007 Darren John Dwyer, Australia. All Rights Reserved.
Borland C++ Builder, CBuilder, etc are Trademarks of Borland Corporation.
DirectX, DirectDraw, Windows, etc are Trademarks of Microsoft Corporation.