Обсуждение: column does not exist Error

Поиск
Список
Период
Сортировка

column does not exist Error

От
Ramy Abdel-Azim
Дата:
Hello,

I'm getting a confusing error message. I'm trying to insert a row into a database table called "users". I'm trying to insert using the form:

insert into table (column, column1, column2)
values (value, value1, value2)

however, i'm getting an error message that, relative to the query i provide above, would say this:

ERROR:  column value1 does not exist

LINE 5:   "value1","value2"

               ^

....I didn't specify value1 AS a column. Why is it telling me the value i'm trying to insert is not a column. It shouldn't be a column. Why does it think it IS a column?


Thanks,

_Ramy

Re: column does not exist Error

От
Ramy Abdel-Azim
Дата:
it may be worth noting that i'm not naming all of the columns in the DB table explicitly in the list of columns. I've omitted the second column name as well as having omitted a value for the second column. I've tried however to put the second column name into the column list and a value for the second column. I still get the same error, though.

On Wed, Nov 9, 2011 at 4:06 PM, Ramy Abdel-Azim <ramy.abdel-azim@startdatelabs.com> wrote:
Hello,

I'm getting a confusing error message. I'm trying to insert a row into a database table called "users". I'm trying to insert using the form:

insert into table (column, column1, column2)
values (value, value1, value2)

however, i'm getting an error message that, relative to the query i provide above, would say this:

ERROR:  column value1 does not exist

LINE 5:   "value1","value2"

               ^

....I didn't specify value1 AS a column. Why is it telling me the value i'm trying to insert is not a column. It shouldn't be a column. Why does it think it IS a column?


Thanks,

_Ramy


Re: column does not exist Error

От
Ramy Abdel-Azim
Дата:
well...
probably this is the problem/solution:


i'll give it a shot now. if you don't hear from me, this worked ;-)

On Wed, Nov 9, 2011 at 4:10 PM, Ramy Abdel-Azim <ramy.abdel-azim@startdatelabs.com> wrote:
it may be worth noting that i'm not naming all of the columns in the DB table explicitly in the list of columns. I've omitted the second column name as well as having omitted a value for the second column. I've tried however to put the second column name into the column list and a value for the second column. I still get the same error, though.


On Wed, Nov 9, 2011 at 4:06 PM, Ramy Abdel-Azim <ramy.abdel-azim@startdatelabs.com> wrote:
Hello,

I'm getting a confusing error message. I'm trying to insert a row into a database table called "users". I'm trying to insert using the form:

insert into table (column, column1, column2)
values (value, value1, value2)

however, i'm getting an error message that, relative to the query i provide above, would say this:

ERROR:  column value1 does not exist

LINE 5:   "value1","value2"

               ^

....I didn't specify value1 AS a column. Why is it telling me the value i'm trying to insert is not a column. It shouldn't be a column. Why does it think it IS a column?


Thanks,

_Ramy



Re: column does not exist Error

От
Craig Barnes
Дата:
Hi Ramy,

>> ERROR:  column value1 does not exist
>>
>> LINE 5:   "value1","value2"
>>
>>                ^
>>

When I see this message it usually means that I have used double
quotes to delimit values.

Value text strings can only be delimited by single quotes and Column
names by double quotes.

HTH
--
Craig

()  ascii ribbon campaign - against html mail
/\