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

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
daizhicun
Posts: 109
Joined: Thu 21 Jan 2010 11:49

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

Post by daizhicun » Sat 21 May 2011 07:29

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;

daizhicun
Posts: 109
Joined: Thu 21 Jan 2010 11:49

Post by daizhicun » Sat 21 May 2011 07:31

because Bind varibles SQL let SHARED_POOL can recycle used.

daizhicun
Posts: 109
Joined: Thu 21 Jan 2010 11:49

Post by daizhicun » Sat 21 May 2011 11:04

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;

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Tue 24 May 2011 11:00

Hello,

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

daizhicun
Posts: 109
Joined: Thu 21 Jan 2010 11:49

Post by daizhicun » Tue 24 May 2011 16:24

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.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Wed 25 May 2011 06:41

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.

Post Reply