Recent

Author Topic: Visual Query Creating Tool for Lazarus - ported Open QBuilder by Fast Report  (Read 17861 times)

tatamata

  • Hero Member
  • *****
  • Posts: 736
    • ZMSQL - SQL enhanced in-memory database
How difficult would this be to adapt to a generic tdataset interface?

i.e. for example I use a commercial PostgreSQL lib from Devart on Lazarus as it does not require libpq.dll

I guess what I mean is making it work with a datasource so it would work with SQLDB that comes with Lazarus or any other tdataset based lib.
hello.
i just stumbled to this topic, searching for visual query builder component.
can this be used for any datasets or there are some limitations?

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1251
WOW!  Many thanks @jepafi

@tatamata  Dunno, but I'll be trying to do exactly this sometime in the next week...
Lazarus Trunk/FPC Trunk on Windows [7, 10]
  Have you tried searching this forum or the wiki?:   http://wiki.lazarus.freepascal.org/Alternative_Main_Page
  BOOKS! (Free and otherwise): http://wiki.lazarus.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines

tatamata

  • Hero Member
  • *****
  • Posts: 736
    • ZMSQL - SQL enhanced in-memory database
WOW!  Many thanks @jepafi

@tatamata  Dunno, but I'll be trying to do exactly this sometime in the next week...
Hi, Mike!
Can you explain what are you planning to do?
Thanks.

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1251
No idea what's required, but first I'll play with this with ZEOS controls, then I'll see what's needed to get it working with SQLDB controls.  From the OP, it's all based on TDataset, so I can't see there being that many points of divergence (famous last words).

if I do get it working with both SQLDB and ZEOS, I'll email the OP with the modified source, see if he uploads it.

If he does, THEN, I'll be hooking this into my application ASAP :-)  (My app uses either SQLDB or ZEOS, so I need something compatible with both...)

Mind you, getting this work with the two connection engines is only a small part.  I'd have to see how well the generated SQLs work with Oracle, MySQL and MSSQL.  There's sufficient difference between these flavours for me to suddenly realise I may have got too excited too quickly.

We'll see though :-)
« Last Edit: April 09, 2014, 09:14:40 am by Mike.Cornflake »
Lazarus Trunk/FPC Trunk on Windows [7, 10]
  Have you tried searching this forum or the wiki?:   http://wiki.lazarus.freepascal.org/Alternative_Main_Page
  BOOKS! (Free and otherwise): http://wiki.lazarus.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
@Mike: good idea. Very interested in an sqldb version myself.

I suspect the component is limited to fairly basic select queries which would not differ too much across systems... but perhaps I'm wrong.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1251
@Mike: good idea. Very interested in an sqldb version myself.

I suspect the component is limited to fairly basic select queries which would not differ too much across systems... but perhaps I'm wrong.

Big difference between Oracle and the other two - at least in the syntax I use.  Any time you have more than two tables, you've got to join them somehow and the join syntax is where the variance is.  Guess I'll find out shortly :-)

Hmmm.  Looking back at the screenshot on the front page - no Join indicators.  Either means they're not there, or they're not used...
Lazarus Trunk/FPC Trunk on Windows [7, 10]
  Have you tried searching this forum or the wiki?:   http://wiki.lazarus.freepascal.org/Alternative_Main_Page
  BOOKS! (Free and otherwise): http://wiki.lazarus.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Well, IIRC the Oracle specific join syntax hasn't been needed for a long while now...

Edit:
http://docs.oracle.com/cd/B28359_01/server.111/b28286/queries006.htm#SQLRF52331
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1251
You telling me all that "Inner Join <tablename> X On X.Field1 = Y.Field1" jibber I've been putting in MS SQL queries doesn't have to be there and that I can use the same nomenclature as I use in Oracle?

So, the following will work in both flavours?  (assuming the keyfield is Field1 in each table)

Code: [Select]
Select X.Field1, X.Field2, Y.Field1, Y.Field2
From Table1 X, Table2 Y
Where X.Field1=Y.Field1

Sigh...  That would have simplified development on my cross db engine app...
Lazarus Trunk/FPC Trunk on Windows [7, 10]
  Have you tried searching this forum or the wiki?:   http://wiki.lazarus.freepascal.org/Alternative_Main_Page
  BOOKS! (Free and otherwise): http://wiki.lazarus.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
You telling me all that "Inner Join <tablename> X On X.Field1 = Y.Field1" jibber I've been putting in MS SQL queries doesn't have to be there and that I can use the same nomenclature as I use in Oracle?
No, I tried telling you that weird (+) stuff is not needed in Oracle anymore - if you ever used that ;)

So, the following will work in both flavours?  (assuming the keyfield is Field1 in each table)

Code: [Select]
Select X.Field1, X.Field2, Y.Field1, Y.Field2
From Table1 X, Table2 Y
Where X.Field1=Y.Field1
Yes, that should work, BUT it is a very old way of specifying relationships. A lot of DB engines probably don't optimize for this and JOINs are the preferred way of doing things.
INNER JOINs, LEFT JOINs have been a part fo standard SQL for ages now - I would think it's the most compatible/generally performant option. Of course, if you're used to WHERE... then it takes some getting used to ;)
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1251
Never used (+), I just don't seem to have a need for outer joins.

I was convinced that the "Inner Join Table X On X.Field1=Y.Field1" terminology didn't work on Oracle.  Gonna have to dig my Oracle Server out tonight and give it a go...
Lazarus Trunk/FPC Trunk on Windows [7, 10]
  Have you tried searching this forum or the wiki?:   http://wiki.lazarus.freepascal.org/Alternative_Main_Page
  BOOKS! (Free and otherwise): http://wiki.lazarus.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines

vfclists

  • Hero Member
  • *****
  • Posts: 856
    • HowTos Considered Harmful?
Has anyone created a version which can handle  'where' clauses?
Lazarus 2.1.0/FPC 3.2.0

 

TinyPortal © 2005-2018