Page 1 of 1

Automatic Generation of SQL

Posted: Wed 13 Jun 2007 23:38
by josito
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.

Posted: Thu 14 Jun 2007 08:12
by Plash
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.

Posted: Thu 14 Jun 2007 09:11
by josito
It is a nice solution.

When will be available?

Posted: Thu 14 Jun 2007 10:50
by jfudickar
Wouldn't it be a better solution to handle this via a component property.

Specially out of the readonly problem?

Greetings
Jens

Posted: Fri 15 Jun 2007 15:51
by Plash
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.

Posted: Sun 17 Jun 2007 17:53
by MarkF
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

Posted: Mon 18 Jun 2007 08:21
by Plash
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.

Posted: Mon 18 Jun 2007 11:42
by MarkF
Excellent. Thanks!