Hi,
<snip>
>
> ERROR: there is no built-in function named "
> declare
> "ID_ADDR" alias for $1;
> ...
> return 1;
> END;"
>
>
> See below the Syntax I used:
>
> create function
> delete_irgendwas_function (int4,varchar,...)
> returns boolean as '
> declare
> "ID_ADDR" alias for $1;
> "COMPANY" alias for $2;
> "SIGN" alias for $65;
I personally would try and avoid variables with quotes round them (not sure
if its even legal). Instead I'd do something like
f_id_addr alias for $1;
> begin
> delete from "ADDRESSES"
> where "ID_ADDR" = f_"ID_ADDR" AND "COMPANY" = f_"COMPANY"...;
Having variables named the same as fields can get confusing (for the parser
as well as people).
See above for how I personally would name
> delete from "CONTACTS"
> where "ID" = f_"ID" AND "C_CATEGORY" = f_"C_CATEGORY" AND
> .... "SIGN" =
> f_"SIGN";
> return 1;
> END;'
> LANGUAGE 'internal';
Should be LANGUAGE 'plpgsql';
Hope this helps,
- Stuart