Hello,
I have a store procedure in PostgreSQL :
CREATE OR REPLACE FUNCTION "UPDATEBALANCES"(a integer, b money)
RETURNS void AS
$BODY$UPDATE "BALANCES"
SET "CODE" = $1, "BALANCE" = $2 $BODY$
LANGUAGE sql VOLATILE
COST 100;
ALTER FUNCTION "UPDATEBALANCES"(integer, money)
OWNER TO postgres;
in design time I set :
Unistoredproc.cacheupdates := true ;
unistoredproc.storedprocname :='UPDATEBALANCES';
try
uniconnection.StartTransaction;
unistoredproc.Close;
unistoredproc.ParamByName('a').VALUE := 100;
unistoredproc.ParamByName('b').VALUE := 200000;
unistoredproc.Execute;
unistoredproc.ApplyUpdates;
UniConmection.Commit;
except
unistoreproc.RestoreUpdates;
UniConmection.Rollback;
end;
after i run unistoredproc.ApplyUpdates error occurs "Can not perform this operation on closed dataset" .. why this error occur ?do i need to applyupdates unistoredproc ? pls advise.. thanks a lot..
Unistoredproc.applyupdates Error
-
DemetrionQ
- Devart Team
- Posts: 271
- Joined: Wed 23 Jan 2013 11:21
Re: Unistoredproc.applyupdates Error
Hello.
The ApplyUpdates and RestoreUpdates methods are designed for situations when you work with open datasets in the CachedUpdates = True mode. Since your procedure does not return a dataset, you get an error when trying to execute ApplyUpdates and RestoreUpdates. To solve the problem, remove the calls of ApplyUpdates and RestoreUpdates from your code.
The ApplyUpdates and RestoreUpdates methods are designed for situations when you work with open datasets in the CachedUpdates = True mode. Since your procedure does not return a dataset, you get an error when trying to execute ApplyUpdates and RestoreUpdates. To solve the problem, remove the calls of ApplyUpdates and RestoreUpdates from your code.
Re: Unistoredproc.applyupdates Error
Hello,
thanks..so every time statement with uniconnection.starttransaction that mean process still in cache server ?thanks a lot
thanks..so every time statement with uniconnection.starttransaction that mean process still in cache server ?thanks a lot
-
DemetrionQ
- Devart Team
- Posts: 271
- Joined: Wed 23 Jan 2013 11:21
Re: Unistoredproc.applyupdates Error
Hello.
After execution of TUniConnection.StartTransaction, all data changes will be stored in the server cash till execution of TUniConnection.Commit or TUniConnection.Rollback.
After execution of TUniConnection.StartTransaction, all data changes will be stored in the server cash till execution of TUniConnection.Commit or TUniConnection.Rollback.
Re: Unistoredproc.applyupdates Error
Hello,
Thanks a lot...
Thanks a lot...
-
DemetrionQ
- Devart Team
- Posts: 271
- Joined: Wed 23 Jan 2013 11:21
Re: Unistoredproc.applyupdates Error
If any other questions come up, please contact us.