Обсуждение: SQL return value...

Поиск
Список
Период
Сортировка

SQL return value...

От
"Cristian Prieto"
Дата:

This is maybe a really newbie question, but, when I have an SQL function like that:

 

$$

Insert into mytable (id, name) values ($1, $2);

$$

 

What return value suppose to return?

Re: SQL return value...

От
Michael Glaesemann
Дата:
On Oct 20, 2005, at 3:24 , Cristian Prieto wrote:

> This is maybe a really newbie question, but, when I have an SQL
> function like that:
>
>
>
> $$
>
> Insert into mytable (id, name) values ($1, $2);
>
> $$
>
>
>
> What return value suppose to return?
>
>

Anything you want :). If you don't want to return anything, you can
use RETURNS VOID

Michael Glaesemann
grzm myrealbox com




Re: [GENERAL] SQL return value...

От
Richard Huxton
Дата:
Cristian Prieto wrote:
> This is maybe a really newbie question, but, when I have an SQL function
> like that:
>
> $$
> Insert into mytable (id, name) values ($1, $2);
> $$
>
> What return value suppose to return?

Either return "void" or return "boolean" and add a "SELECT true;"
statement to the end of your function.

--
   Richard Huxton
   Archonet Ltd