hello,
I have a store procedure at postgresql
CREATE OR REPLACE FUNCTION "GETINVOICENO"
RETURNS SETOF AS
'Select "INVOICENO" from "sales"
LANGUAGE sql VOLATILE
COST 100
ALTER FUNCTION "GETINVOICENO"
OWNER TO postgres;
unistoreproc.close;
unistoreproc.open;
uniquery.close;
uniquery.sql.clear;
uniquery.sql.add('select invoiceno from sales');
uniquery.open;
which one is more effective and speed to use it, unistoreproc or uniquery to get all invoiceno?
thanks a lot
TUniquery vs TUnistoreproc
-
DemetrionQ
- Devart Team
- Posts: 271
- Joined: Wed 23 Jan 2013 11:21
Re: TUniquery vs TUnistoreproc
Hello.
You can find answers to your questions concerning execution speed of stored procedures and SELECT queries on a PostgreSQL server in the PostgreSQL documentation.
TUniStoredProc and TUniQuery have the same performance when working with results returned by a stored procedure and a SELECT query.
TUniStoredProc doesn't allow edit a received dataset by default, in contrast to TUniQuery (that allows editing a dataset returned by a SELECT query). To edit the returned dataset via TUniStoreProc in the same way as via TUniQuery, you should set the TUniStoredProc.Options.SetFieldsReadOnly property to False and correctly set the TUniStoredProc.SQLUpdate and similar properties (SQLInsert, SQLDelete, SQLLock, SQLRefresh). The information about the named TUniStoredProc component properties can be found in the UniDAC documentation.
You can find answers to your questions concerning execution speed of stored procedures and SELECT queries on a PostgreSQL server in the PostgreSQL documentation.
TUniStoredProc and TUniQuery have the same performance when working with results returned by a stored procedure and a SELECT query.
TUniStoredProc doesn't allow edit a received dataset by default, in contrast to TUniQuery (that allows editing a dataset returned by a SELECT query). To edit the returned dataset via TUniStoreProc in the same way as via TUniQuery, you should set the TUniStoredProc.Options.SetFieldsReadOnly property to False and correctly set the TUniStoredProc.SQLUpdate and similar properties (SQLInsert, SQLDelete, SQLLock, SQLRefresh). The information about the named TUniStoredProc component properties can be found in the UniDAC documentation.
Last edited by DemetrionQ on Wed 12 Jun 2013 09:14, edited 2 times in total.
-
DemetrionQ
- Devart Team
- Posts: 271
- Joined: Wed 23 Jan 2013 11:21
Re: TUniquery vs TUnistoreproc
If any other questions come up, please contact us.