view · edit · sidebar · attach · print · history
 
CREATE OR REPLACE FUNCTION update_object(integer, text, text, boolean)
RETURNS BOOLEAN AS '
BEGIN
  PERFORM odba_id FROM object WHERE odba_id = $1;
  IF FOUND THEN
    UPDATE object
    SET content = $2, name = $3, prefetchable = $4
    WHERE odba_id = $1;
  ELSE
    INSERT INTO object (odba_id, content, name, prefetchable)
    VALUES ($1, $2, $3, $4);
  END IF;
  RETURN FOUND;
END;
' LANGUAGE plpgsql;

view · edit · sidebar · attach · print · history
Page last modified on May 03, 2005, at 03:57 PM