Hi there...
I have a question regarding an update function I created...
CREATE OR REPLACE FUNCTION rm_category_update(icompany bpchar, iraw_mat_cat_code bpchar, iraw_mat_cat_desc bpchar)
RETURNS character AS
$BODY$
DECLARE
loc_result CHAR(50);
BEGIN
UPDATE rm_category
SET
raw_mat_cat_code = iraw_mat_cat_code,
raw_mat_cat_desc = iraw_mat_cat_desc
WHERE company = icompany;
loc_result = 'success';
RETURN loc_result ;
END;
$BODY$
LANGUAGE 'plpgsql' VOLATILE;
ALTER FUNCTION rm_category_update(icompany bpchar, iraw_mat_cat_code bpchar, iraw_mat_cat_desc bpchar) OWNER TO postgres;
Okay, so if I input a record that doesn't exist, for example 9, it returns success even though I know it has updated nothing!
Does SQL not throw errors if it is updating a non-existent row??
Thanks