Automatic Generation of SQL

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
josito
Posts: 4
Joined: Fri 05 Nov 2004 10:24
Location: Spain

Automatic Generation of SQL

Post by josito » Wed 13 Jun 2007 23:38

I have worked with a previous version of ODAC, now in ODAC 6, ODAC components automatically generate Insert, Update, Delete and Refresh if they doesn't exist.

But I want compatibility with previous version else i would have to change all forms. Colud I do?

thanks in advance, Jose Maria.

PD: Previous TOraQuery if insert, update or delete commands are not specified the data is readonly.

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

Post by Plash » Thu 14 Jun 2007 08:12

In the next ODAC build we'll add the OraQueryCompatibilityMode variable in the Ora unit. You should set this variable to True in the initialization section of one of your program units.

josito
Posts: 4
Joined: Fri 05 Nov 2004 10:24
Location: Spain

Post by josito » Thu 14 Jun 2007 09:11

It is a nice solution.

When will be available?

jfudickar
Posts: 202
Joined: Fri 10 Mar 2006 13:03
Location: Oberursel / Germany

Post by jfudickar » Thu 14 Jun 2007 10:50

Wouldn't it be a better solution to handle this via a component property.

Specially out of the readonly problem?

Greetings
Jens

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

Post by Plash » Fri 15 Jun 2007 15:51

TOraQuery already has the ReadOnly property. We have added the global variable so that the old behaviour can be restored without editing all TOraQuery components in the project.

We already released the new ODAC build with the OraQueryCompatibilityMode variable added.

MarkF
Posts: 211
Joined: Thu 02 Mar 2006 14:55

Post by MarkF » Sun 17 Jun 2007 17:53

Hi Folks,

In playing around with this it appears that setting OraQueryCompatibilityMode to true also affects TSmartQuery components as well (making them not autogenerate SQL which they used to do.) Things have changed a bit with version 6, but my understanding (or usage in the past) was:

TOraQuery: Used for read only queries unless you explicitly fill the editing SQL properties.
TSmartQuery: Used for editable queries where the editing SQL is automatically generated.

I'd rather not have TOraQuery generating editable queries automatically, but I'd like the TSmartQuery to do so. If I set the ReadOnly property of TOraQueries to true, will this also stop TOraQuery from doing anything extra (like generating the SQL statements for editing)?

Thanks,

-Mark

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

Post by Plash » Mon 18 Jun 2007 08:21

In the next ODAC build we'll change this behaviour. TSmartQuery components will be editable regardless of the OraQueryCompatibilityMode variable value.
If you set the ReadOnly property of the TOraQuery component to True, it will not generate SQL statements for updating tables.

MarkF
Posts: 211
Joined: Thu 02 Mar 2006 14:55

Post by MarkF » Mon 18 Jun 2007 11:42

Excellent. Thanks!

Post Reply