| From: | "Dr(dot) Evil" <drevil(at)sidereal(dot)kz> |
|---|---|
| To: | jvbussel(at)natlab(dot)research(dot)philips(dot)com |
| Cc: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: Function won't compile |
| Date: | 2001-10-24 21:42:29 |
| Message-ID: | 20011024214229.14212.qmail@sidereal.kz |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
> Does anybody know why the function insert_case() won't compile. When I
> INSERT a new record I always get the following error message :
>
> NOTICE: plpgsql: ERROR during compile of insert_case near line 1
> "RROR: parse error at or near "
>
> Below is the function and trigger. ('Now' is surrounded with single quotes)
>
> CREATE FUNCTION insert_case () RETURNS INTEGER AS '
> BEGIN
> NEW.date_created := ''now'';
> END;
> ' LANGUAGE 'SQL';
Very simple! You don't use BEGIN and END within a LANGUAGE 'sql'
function. You are mixing up sql with plpgsql.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Aasmund Midttun Godal | 2001-10-24 21:51:06 | Re: Function won't compile |
| Previous Message | Guy Fraser | 2001-10-24 21:39:36 | Re: WWW interface for postgres |