What is wrong with this function? EDITED>>
CREATE OR REPLACE FUNCTION on_ai_myTable() RETURNS TRIGGER AS $$
BEGIN
SELECT fn_name, count(*) + 1 FROM table_ebscb_spa_log02 WHERE time_type = 'Start' GROUP BY fn_name
RETURN NEW.fn_name;
END
$$
LANGUAGE plpgsql;
Ok I added the ";" but now, when I try to create it, it send me the message ERROR: syntax error at or near "RETURN" LINE 5: RETURN fn_name;
How can I solve it????
Thanks Advanced.
You just need to add semicolons:
CREATE OR REPLACE FUNCTION on_ai_myTable() RETURNS TRIGGER AS $$
BEGIN
SELECT fn_name, count(*) + 1 FROM table_ebscb_spa_log02 WHERE time_type = 'Start' GROUP BY fn_name;
RETURN NEW.fn_name;
END
$$
LANGUAGE plpgsql;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With