I am attempting to generate a temporary function to execute some dml with
the following script:

create or replace function setuplicense() returns integer as $$
declare
  hwcustid  integer := 0;
  retval    integer := 0;
begin
  insert into license.customer
  ( customer_id ) values ( hwcustid );
  commit;
  return retval;
end;
$$
LANGUAGE plpgsql;

select setuplicense();

When running this with psql I get the following:

Error: syntax error at or near "create"

Does anyone have a suggestion as to what is causing this?

Thanks

Reply via email to