Home RAP
New Blog Posts: Merging Reports - Part 1 and Part 2

SQL passtrough function

edited November 2003 in RAP
I need to implement a SQL passtrough function , that i can specify a sql
query, execute this, and assign the query result to a variable, any
ideas????, thank?s

Comments

  • edited November 2003

    Consid using the Data workspace (i.e. DADE) to build queries that are used
    by the report. You can link queries together creating lookup queries.

    If you want to use RAP, see the article below. You can try writing a RAP
    pass-through function does what you need.


    --------------------------------------------------
    Article: Extending RAP
    ---------------------------------------------------

    There are two very simple and powerful techniques to extend the capabilities
    of RAP infinitely. These are summarized below and covered in more detail in
    the RAP.hlp online help. Demos and tutorials are installed to
    RBuilder\Demos\RAP. The tutorial text is located in RAP.hlp.


    1. RAP Pass-Through Functions

    These are functions that appear in the Language tab of RAP's Code Toolbox.
    These functions are written in Delphi and can be called from RAP. RAP's
    pass-through function architecture enable's developers to add new built-in
    functions to RAP's code toolbox.

    2. Extend RAP's RTTI

    RAP's Run-time Type information defines what classes and properties can be
    accessed via RAP. By default the published properties of any class that is
    registered with Delphi's RegisterClass procedure is recognized by RAP. In
    addition many of the public properties and methods of ReportBuilder classes
    are exposed.







    --
    Tech Support mailto:support@digital-metaphors.com
    Digital Metaphors http://www.digital-metaphors.com


    --
    Nard Moseley
    Digital Metaphors
    http://www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited November 2003
    Thank?s, actually I wrote a passtrough function for rap, where I can specify
    a sql query, and I assign the result to a variable. For this function, I
    just Created an Interbase Sql query component, where I Execute the query
    passed from the Rap function, but my problem is that I can only get the
    result just for one field of the query, and I need, to get the other
    result?s, can anybody help me, cause I can?t see anything about this in the
    tutorial?s.

    Many Thank,s

  • edited November 2003
    Just change your function into a procedure instead and use var
    parameters. After you run your query just do

    var0:=qry.field[0].value;
    SetParamValue(0,var0);

    var1:=qry.field[1].value;
    SetParamValue(1,var1);
    etc.

    HTH,
    Kevin

This discussion has been closed.