Stored Procedure table/column args

Поиск
Список
Период
Сортировка
От Bret Stern
Тема Stored Procedure table/column args
Дата
Msg-id 1378170386.3581.15.camel@centos-dev.machinemanagement.com
обсуждение исходный текст
Ответы Re: Stored Procedure table/column args  (Adrian Klaver <adrian.klaver@gmail.com>)
Список pgsql-general
'psuedo

Can you create stored procedures that are built from parameters as
below, or does this defeat the pre-compiled purpose of an SP?

create function item_exists (tbl character varying, col character
varying, col_val character varying)

DECLARE
 x integer;

PERFORM col FROM tbl
       WHERE col="'" + col_val + "'"
    IF FOUND THEN
     x := 1;
    else
     x := 0;
    end if;

RETURN x;

....

left out some syntax, but should deliver the idea

trying to build build a generic "check for existing", that's not
specific to a specific table/column without returning recordset
object overhead

any better ways
thanks



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

Предыдущее
От: 高健
Дата:
Сообщение: Re: My Experiment of PG crash when dealing with huge amount of data
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Stored Procedure table/column args