Page 1 of 1

when execute"UniQuery.Refresh ",what SQL will be executed;

Posted: Sat 21 May 2011 07:29
by daizhicun
begin
uniquery1.sql.text:='SELECT * FROM AREA';
uniquery1.open;
uniquery1.refresh;
end;


when Execute refresh:

i monitor SQL:
SELECT '' TABLE_CATALOG, IC.TABLE_OWNER TABLE_SCHEMA, IC.TABLE_NAME,
'' INDEX_CATALOG, IC.INDEX_OWNER INDEX_SCHEMA, IC.INDEX_NAME, IC.COLUMN_NAME,
IC.COLUMN_POSITION, DECODE(IC.DESCEND, 'ASC', 0, 1) DESCENDING FROM SYS.ALL_IND_COLUMNS IC,
SYS.ALL_INDEXES I, SYS.ALL_CONSTRAINTS C WHERE IC.TABLE_OWNER = 'FSDQ' AND IC.TABLE_NAME = 'AREA' AND I.UNIQUENESS = 'UNIQUE' AND
I.OWNER = IC.INDEX_OWNER AND I.INDEX_NAME = IC.INDEX_NAME AND
C.TABLE_NAME (+) = IC.TABLE_NAME AND C.INDEX_NAME (+) = IC.INDEX_NAME AND C.OWNER (+)= IC.TABLE_OWNER
ORDER BY DECODE(C.CONSTRAINT_TYPE, 'P', 1, 'U', 2, 3), IC.INDEX_OWNER, IC.TABLE_OWNER, IC.TABLE_NAME, IC.INDEX_NAME, IC.COLUMN_POSITION



i hope this SQL can not be atuo execute;

How to set Uniqery.options;

And:
i think this AUTO SQL not good.

i hope It bind variable;

"IC.TABLE_OWNER = 'FSDQ' AND IC.TABLE_NAME = 'AREA' AND "

can changed to :
"IC.TABLE_OWNER =:TABLE_OWNER AND IC.TABLE_NAME =:TABLE_NAME AND "


i search all .pas files in UniDac ,but i don't find this AUTO SQL;

Posted: Sat 21 May 2011 07:31
by daizhicun
because Bind varibles SQL let SHARED_POOL can recycle used.

Posted: Sat 21 May 2011 11:04
by daizhicun
in fact ,sometimes ,

when i execute: select * from AREA USE UniQuery;

i noly get data ,do not want to update data ;

so i don't what to know the key or unique fieds .

but Uniquery foced to execute SQL to get the key fields;

Posted: Tue 24 May 2011 11:00
by AlexP
Hello,

To avoid searching for the primary key and unique fields, you need to explicitly specify the value of the uniquery1.KeyFields property.

Posted: Tue 24 May 2011 16:24
by daizhicun
thanks ,my another question is: could you change your SQL for geting keyfiels;
i hope the SQL is binding varible SQL;
it is let SHARD_POOL work better.

Posted: Wed 25 May 2011 06:41
by AlexP
Hello,

Thank you for the information.
We'll consider your suggestions.
In one of the next product versions we are going to change scripts for receiving metadata completely in order to improve performance.