Local variable and column name conflict

Поиск
Список
Период
Сортировка
От Daniel Caune
Тема Local variable and column name conflict
Дата
Msg-id 1E293D3FF63A3740B10AD5AAD88535D2029164E4@UBIMAIL1.ubisoft.org
обсуждение исходный текст
Ответы Re: Local variable and column name conflict
Список pgsql-sql
Hi,

Is there a way to specify a local variable/parameter within a query
where a column has the same name than the local variable/parameter?

Example:

CREATE OR REPLACE FUNCTION foo(i IN int) RETURNS void
AS $$
BEGIN UPDATE bar   SET i = i; // column i = parameter i
END;
$$ LANGUAGE PLPGSQL;

For instance, Ingres suggests prefixing local variable/parameter with
":" in the query:
 UPDATE bar   SET i = :i;

I can continue using the de facto Oracle's naming convention
(P_parameter and V_local_variable) anyway.  That's not a big deal.

Regards,

--
Daniel CAUNE
Ubisoft Online Technology
(514) 490 2040 ext. 3613


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

Предыдущее
От: Richard Broersma Jr
Дата:
Сообщение: Re: hi i need to connect database from my system to another
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Local variable and column name conflict