Re: Create function statement with insert statement

Поиск
Список
Период
Сортировка
От Ian Harding
Тема Re: Create function statement with insert statement
Дата
Msg-id se70295c.026@mail.tpchd.org
обсуждение исходный текст
Ответ на Create function statement with insert statement  ("Susan Hoddinott" <susan@hexworx.com>)
Список pgsql-sql
I think the language needs to be in quotes ...

...
' language 'sql';

>>> "Jon Griffin" <jong@e88.org> 03/12/03 11:59AM >>>
You need to put your aliases in:
value1 alias for $1;
etc.
Hello,
>
> I am trying to create a database trigger which inserts into a second
> table.  I have created the following function in accordance with the
> reference manual documentation (7.2).
>
>
> CREATE OR REPLACE FUNCTION orderinsert(INTEGER, VARCHAR) RETURNS INTEGER
> AS '
>
> INSERT INTO HEXORDERS ( CUSTOMER_ID, ORDER_KEY, DISTRIBUTOR_ID,
> ORDER_AMOUNT, ORDER_GST ) VALUES ( $1, $2, 1, 0, 0 ) ;
>
> SELECT 1 ;
>
> ' LANGUAGE SQL ;
>
>
>
> It fails with the cryptic error "parse error at or near ;".   Can anyone
> tell me what is wrong with this syntax?
>
> Regards




---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster



В списке pgsql-sql по дате отправления:

Предыдущее
От: sarloc@jevic.com (Carmen)
Дата:
Сообщение: Poor performance on a right join
Следующее
От: "Len Morgan"
Дата:
Сообщение: Re: What's wrong with this group by clause?