EXECUTE query INTO problem

Поиск
Список
Период
Сортировка
От Tk421
Тема EXECUTE query INTO problem
Дата
Msg-id 492C66EA.4050008@gmail.com
обсуждение исходный текст
Ответы Re: EXECUTE query INTO problem  (Andreas Kretschmer <akretschmer@spamfence.net>)
Re: EXECUTE query INTO problem  ("Pawel Socha" <pawel.socha@gmail.com>)
Список pgsql-sql
    I've got a problem with a function: It receives two parameters, the 
first, the table name, and the second, a where condition. The function 
looks like this:
   DECLARE      cod bigint;      query TEXT;
   BEGIN      query = 'SELECT codigo FROM ' || $1 || ' WHERE ' || $2;
      EXECUTE query INTO cod;      ·      ·      ·   END;
   I've alwais get the same error, in the EXECUTE sentence: it says: 
Error at or near NULL at character X
   I've also tried declaring cod as row, but the error is the same.
   Anybody can help me?
   Thank you very much


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

Предыдущее
От: "John Lister"
Дата:
Сообщение: Re: Full text search ordering question
Следующее
От: Andreas Kretschmer
Дата:
Сообщение: Re: EXECUTE query INTO problem