Argument variables for select

Поиск
Список
Период
Сортировка
От Andreas Tille
Тема Argument variables for select
Дата
Msg-id Pine.LNX.4.21.0008280957530.30760-100000@wr-linux02.rki.de
обсуждение исходный текст
Список pgsql-sql
Hello,

I want to use the following construct in a stored function:

Create Function VarSelect ( varchar, varchar )  returns int  As '    Declare num int ;        Begin      Select Into
numCount(*) From $1 Where $2 ;      return num;    End ;  ' language 'plpgsql' ;
 

Could someone please explain who to type the exact syntax so that
I can ship the table to select from as $1 and the condition to select
what as $2?  Or do I have to concatenate a string with the whole
select statement and how to call this string?  In MS SQL server this
could be done with   Exec ( query )

Kind regards
         Andreas.



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

Предыдущее
От: Alessandro Valenti
Дата:
Сообщение: Tutorial
Следующее
От: pierre@kahuna.versions.com
Дата:
Сообщение: shared memory leak in 7.0.2?