Re: Quoting for a Select Into - Please Help

Поиск
Список
Период
Сортировка
От ezra epstein
Тема Re: Quoting for a Select Into - Please Help
Дата
Msg-id x6icnRfEp6N8DZjdXTWc-w@speakeasy.net
обсуждение исходный текст
Ответ на Quoting for a Select Into - Please Help  (A E <cooljoint@yahoo.com>)
Список pgsql-general
Maybe if you could show what the final SELECT statement should look like -- after variable substitution -- that would give a sense of how to quote things.
 
NOTE 1. Regardless, this, of course, needs to be done inside of an EXECUTE statement (assuming pl/pgSQL is the procedure language being used), regular ol' SELECT does not do the dynamic variable substitution this would require.
 
NOTE 2. Another way (that also avoids use of EXECUTE) is to put the values being stored in "arrayval[]", "realname", etc. into a temporary table and join to this (single-row) temp table in the select.... performance may be an issue, but it would work even outside of pl/pgsql.
 
== Ezra Epstein
 
 
Hi,
 
Could someone help me with quoting this right?
 
select into aliasvalue ''|| trim(arrayval[i]) ||''  from ''|| trim(realname) ||'' where ''|| trim(searchfield) ||'' like ''''%''|| trim(searchvalue) ||''%'''';
 
The parser does not seem to want to put the value of the variables into the statement.
 
Alex

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

Предыдущее
От: "ezra epstein"
Дата:
Сообщение: COPY FROM STDIN
Следующее
От: "ezra epstein"
Дата:
Сообщение: Precedence of a TRIGGER vs. a CHECK on a column