> I'm porting some stored procedures from a MSSQL server, and thought I'd
> use PL/pgSQL.
>
> The original code is checking the insert with the line:
>
> if (@@Error != 0)
You might want to use something like:
SELECT INTO variable_name * FROM tableWHERE field = some_value;
IF FOUND THEN somevar := variable_name.fieldname ;
ELSE RAISE EXCEPTION ''ERROR blah blah'';
END IF;
And you also want to look into the @@rowcount:
GET DIAGNOSTICS v_rowcount = ROW_COUNT ;
Reinoud