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

Setting parameter types in a custom DADE plugin when using Parameterized SQL Linking

edited June 2011 in DADE
Hi,

I'm testing all the great new features of RB12, and I must say I love
all the great new things you have added to the product. It is many,
many times more powerful and flexible than previous versions!

So I ran into a master-detail report that could be made lots faster by
editing in RAP the SQL before generating the report, based on report
parameters and AutoSearch criteria. I've managed to get all of this
working. However, I have the following problem:

As soon as I edit the master's sql text, the link type is switched to
parameterized query. And this would be great, except that the dakbmMW
client query is complaining that the parameter used in the detail query
does not have a type. I've been searching in the code where am I
suppossed to set the parameter types for the detail query in the DADE
plugin, but I don't see any code for this. Where do I do this in the
dakbmMW DADE plugin?

I tried creating a master detail report that is by default linked with
parameterized queries, and it gives me the same problem: the query is
complaining that it does not have a type for the parameter.

If setting parameter types is not implemented in DADE, I might have to
find a way to do it, so the other question is: where in the code is the
parameterized query being generated when the report is executed?

Thanks in advance!


--
Arturo
Using RB12.04 Build 77

Comments

  • edited June 2011
    I found where the Parameterized SQL is generated. However, I might not
    be understanding how the Parameterized SQL works at all.

    I added some test code to force the parameter type of my query in
    dakbmMW, just before my query is executed. However, right before the
    query is executed, the parameter has no value. Also, for several master
    detail records, the detail query is executed only once. So I'm
    probably expecting some results here that parameterized queries are not
    designed for, :).

    Thanks for any guidance you can provide to get this running.

    Cheers!

    --
    Arturo
    Using RB12.04 Build 77
  • edited June 2011
    Thanks for the kind words! :)

    Parameterized dataset linking is a feature of VCL and the data access
    components. I have not worked with kbmMW, but most other datasets handle
    this as follows.

    The user does the following:

    1. Typically query component has a property called either DataSource or
    MasterSource that can be used to link a detail query to a master query.

    2. For the detail SQL, you specify :FieldName in the SQL Where clause. The
    :FieldName refers to a field in the master query.

    Internally the dataset parses the SQL and generates a dataset parameter. As
    the master dataset is traversed the detail query parameter is resolved and
    the detail query fires. This happens for each master record position change.

    As a simple test, you can place datasets on a form and configure the
    linking. Connect some DBGrid objects to the datasets. Try that with kbmMW
    and get it working.

    Based on your feedback, I'm guessing kbmMW handles parameterized linking
    differently or perhaps does not support this feature.

    A customer using Direct Oracle Access (DOA) components reported the
    parameterized linking worked differently and we were able to work together
    towards a solution. You can see this in the DOA plug-in for DADE which is
    installed to Demos\EndUser Databases\Oracle\DOA\daDOA.pas. See the method
    TdaDOAQueryDataView.CreatePipelineLinksForParameterizedSQL


    -
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.