Re: function query error: column does not exist

Поиск
Список
Период
Сортировка
От Alban Hertroys
Тема Re: function query error: column does not exist
Дата
Msg-id CAF-3MvNRzGPzc_GkRPom-+Ccrine7fh01kpx+rGJGbmZG2vSdQ@mail.gmail.com
обсуждение исходный текст
Ответ на function query error: column does not exist  (giozh <giozh@yahoo.it>)
Список pgsql-general
On 11 July 2013 11:01, giozh <giozh@yahoo.it> wrote:
this is the insert code:

>EXECUTE 'INSERT INTO table VALUES('||value1||','[...]','||value_char||')';

and the error is on value_char. pg told me that "column does not exist".

A few suggestions:

1. Post a statement that actually matches your problem statement. What you posted can't possibly work as [...] is not valid SQL syntax. Post the actual query. You can replace table names and column names and such with example names, if/where necessary.

2. Show the actual error message instead of some interpretation; the actual message would have mentioned the name of the column that doesn't exist. That would have been useful info.

3. Don't concatenate values into a dynamic query, use USING instead so that the values get properly escaped and don't open you up for SQL injection issues.

The problem you ran into was possibly (we really can't tell from the info you provided) an error in how you quote the various parts of the query, or one of your variables/parameters had a value that contained a quote.

--
If you can't see the forest for the trees,
Cut the trees and you'll see there is no forest.

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

Предыдущее
От: Jayadevan M
Дата:
Сообщение: Re: pg recovery
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: pg recovery