Page 1 of 1
SmartQuery UpdatingTable request
Posted: Fri 09 Jul 2010 15:12
by MarkF
It would be helpful if the UpdatingTable property was filled in automatically if it is blank when the query is run. The information must be generated internally, but it doesn't appear to be possible to get it (the property remains blank if it isn't set by the user.)
-Mark
Posted: Tue 13 Jul 2010 10:19
by bork
Hello
ODAC generates information for updating table internally. We cannot understand why user can required information about updating table. If user defines a SQL query then he always knows which table will be updated. Please explain why you need this information and we will investigate the possibility of adding this feature in one of the next builds/versions of ODAC.
Posted: Tue 13 Jul 2010 11:37
by MarkF
My programs handle running queries that the users type in. I don't know the updating table in advance. Currently I parse it out of the SQL, which I assume is what ODAC does as well. It seems to be an unnecessary duplication of effort.
This wasn't a problem before as it always worked fairly well on its own. Now that I've found that it won't handle synonyms, I need to do it myself. I need to get the updating table, resolve it back to the owner.table[@dblink] spec and then get the key fields. However, I only want to do it if the user hasn't used ROWID in their query and if the updating table is a synonym. It would be very nice if the query made some of this information available to help work around the synonym issue.
Thanks for any comments or suggestions.
-Mark
Posted: Wed 14 Jul 2010 11:14
by bork
Hello
We don't want to get access to internal information for all users so we can suggest the following solution:
Declare your class:
Code: Select all
TMyOraQuery = class (TOraQuery) // or class (TSmartQuery)
public
function GetUpdatingTable: stirng;
end;
function TMyOraQuery.GetUpdatingTable: string;
begin
if (FDataSetService nil) and
(FDataSetService.UpdatingTableInfo nil)
then
Result := FDataSetService.UpdatingTableInfo.TableName
else
Result := '';
end;
And get the required info by the following code:
Code: Select all
begin
ShowMessage(TMyOraQuery(OraQuery1).GetUpdatingTable);
end;
If you need access to UpdatingTable information by public property or function of the standard TOraQuery or TSmartQuery classes please notify us and we will investigate possibility of adding this property or function.