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

how to get a single generated sql statement from multiple linked dataview

edited February 2007 in End User
Hi,
i have an end user reporting application that store and load the report
layout from database.
i wanna give my user the ability to export data into various formats file.
i'm using EMS Advanced Data Export to do this job.

how can i get generated sql statement from several linked dataview as one
sql statement, so i can assign it into TAdoQuery SQL.Text component, and
use that TAdoQuery as source of my export component dataset property?


i'm using :
-Delphi 5 Ent
-RB 7.0.4

Thanks,

fathur



--- posted by geoForum on http://delphi.newswhat.com

Comments

  • edited February 2007
    Hi Fathur,

    Take a look at the following example of extracting the SQL object.
    Specifically look at the ShowSQLText routine. This is called multiple times
    as each dataview is created in code however if you were to do something like
    this after all your datasets have been created in DADE, it would return a
    single SQL statement representing your query.

    http://www.digital-metaphors.com/tips/ExtractSQLObject.zip

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited February 2007

    Please choose a single destination to post questions.

    This same question was sent to support@digital-metaphors.com yesterday
    (2/20/2007) and I sent you a comprehensive repsonse yesterday morning.
    Please do not repost questions here, our resources are limited - it is not
    fair to the other developers that have questions.


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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited February 2007
    Hi Nard,

    Thanks for your help.

    i am sorry for my mistake that sending email message to different
    destination more than once, cause of some problem on my internet
    connections.

    i've been extending RAP functionality for my application for many tasks
    like linking Dataview, generating and setting dynamic parameters, and so
    on.

    but i've some problems where i wanna get single SQL statement from
    multiple linked dataview.

    as you say in replied email:
    "There is no way to combine linked queries into a single query, unless
    you
    want to manually write some code that does that. "

    do you have some idea what this manually methods should look like?



    Regards,

    Fathur

    not



    --- posted by geoForum on http://delphi.newswhat.com
  • edited February 2007

    I think your question is really more of a SQL question/challenge.

    Think of it this way, if you put multiple Query DataSets on a
    Form/DataModule and put SQL in each of one them, then how you can write some
    code that will combine the SQL from each Query DataSet into a single SQL
    statement that can be assigned to another Query DataSet?


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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited February 2007
    Hi Nard,

    Thanks for your response. Thats way already in my mind, thanks for all.
    After i am analyzing the several possible way to solve this problem, i've
    decided to trial and to evaluate using some of RB Add On products.
    coz, i've diffuculties to combine SQL statement for this situation, what
    if there are any unlinked DataView too? that's must be more complicated,
    so i place it on lower priority at my todo list.

    But i will still in trying for the first method too.

    thanks


    Fathur

    some



    --- posted by geoForum on http://delphi.newswhat.com
This discussion has been closed.