[ic] Help with Postgres
daniel_castro at hotmail.com
Thu Nov 18 10:49:59 EST 2004
I am finishing a e-commerce site, the very last thing to do, is what my
client calls, the mark up protection. This is a way to protect catalog,
from changing the price for the products in the admin interface. So the way
to do this is making a trigger. but now the trigger is not allowing the
catalog to take orders. Can any one help me with either the trigger, or a
better way to do the protection.
Any comment are welcome...
The trigge for postgres 7.2 and IC 5.2:
CREATE FUNCTION price_verify () RETURNS OPAQUE AS'
SELECT INTO $7 sku FROM products WHERE sku = new.sku;
IF NOT FOUND THEN RAISE EXCEPTION ''NO PRODUCT FOUND'';
SELECT INTO $21 price FROM products WHERE sku = new.sku;
IF price > new.price THEN RAISE EXCEPTION ''INVALID PRICE'';
CREATE TRIGGER mark_up_protection
FOR EACH ROW
But now with the trigger I get the following error:
(log_orderline_table): There was an error adding the items to the orderline
table: DBD::Pg::st execute failed: ERROR: syntax error at or near "" at
/home/interchange/server/lib/Vend/Table/DBI.pm line 1626.
Thanks you all for you time, this is a great list. BTW I have written a
small article with some of the wierd stuff that we had to implement for this
catalog, you can find it here:
Pictures are missing, but I will correct that later today.
Thanks to all,
Ingenian Software LLC
FREE pop-up blocking with the new MSN Toolbar - get it now!
More information about the interchange-users