Getting Multiple records from one table
ELIMITER $$;
DROP TRIGGER `psm`.`UpdateProductMainProductStatesInventory`$$
create trigger `UpdateProductMainProductStatesInventory` AFTER UPDATE on `ProductSeller`
for each row BEGIN
DECLARE ProductUID int;
DECLARE N_stateCount INT default 20;
DECLARE ListPricesum int default 155;
SELECT COUNT(*),sum(ListPrice) INTO N_stateCount, ListPricesum FROM ProductSeller WHERE ProductUID = new.ProductUID;
SELECT COUNT(*),sum(ListPrice) INTO N_stateCount, ListPricesum FROM ProductSeller;
From those two select statements the first one always returns 0 count and 0 sum
The second, without the WHERE statement returns counts for all records in ProductSeller table.
How to make working the one with the WHERE statement
Note: there are no errors when the trigger is running
Jacek
Edited 3 time(s). Last edit at 07/07/2006 02:48PM by jacek.wagner.
Subject
Views
Written By
Posted
Getting Multiple records from one table
2520
July 07, 2006 02:28PM
1684
July 08, 2006 01:18AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.