Dynamic Querys

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
[email protected]
Posts: 17
Joined: Sat 02 May 2009 11:20

Dynamic Querys

Post by [email protected] » Sat 02 May 2009 11:39

:?: Have you any suggestions on using dynamically built queries in my code. I wish my application to be absolutely transparent as to what database engine is in use. The features that can be found in the TUniQuery allowing you to select the differant options for the differant database engines is really great, however, can you suggest a way of implementing the same using in built code query strings ?

Thanks for the help.
Robert.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Tue 05 May 2009 07:04

In UniDAC 2.50 we have added Unified SQL support. Now you can use special condition operators in your SQL. For example:

Code: Select all

SELECT
{if Oracle}
  f1, f2
{else}
{if InterBase}
  f2, f3
{else}
  *
{endif}
{endif}
FROM
{if Oracle}
  dept
{else}
  test.dept
{endif}
See the 'Using UniDAC' / 'Unified SQL' topic in the UniDAC help for details.

[email protected]
Posts: 17
Joined: Sat 02 May 2009 11:20

Post by [email protected] » Tue 05 May 2009 16:25

:D Thanks. You seemed to have thought out your components very thouroughly.

Robert.

Post Reply