Page 1 of 1

Dynamic Querys

Posted: 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.

Posted: Tue 05 May 2009 07:04
by Plash
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.

Posted: Tue 05 May 2009 16:25
:D Thanks. You seemed to have thought out your components very thouroughly.

Robert.