weird SQL statement question

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

weird SQL statement question

От:
"Tadej Kanizar" <Tadej.Kanizar@sagit-server.com>
Дата:

Ok, so I installed the latest version of Postresql (8.02) on a WinXP SP2 machine..

My question is why won't the statement SELECT * FROM table work, whereas the statement SELECT * FROM »table« works!

And, to explain a bit more, here's another example:

INSERT INTO TestTable (Name, Surname) VALUES ('name', 'surname');  .. this DOESN'T work

INSERT INTO »TestTable« (»Name«, »Surname«) VALUES ('name', 'surname'); .. this DOES work

 

Any ideas? J

 

Regards,

Tadej

Re: weird SQL statement question

От:
Frank Bax <fbax@sympatico.ca>
Дата:
At 01:55 PM 4/23/05, Tadej Kanizar wrote:

>Ok, so I installed the latest version of Postresql (8.02) on a WinXP SP2 
>machine..
>
>My question is why won't the statement SELECT * FROM table work, whereas 
>the statement SELECT * FROM »table« works!
>
>And, to explain a bit more, here's another example:
>
>INSERT INTO TestTable (Name, Surname) VALUES ('name', 'surname');  .. this 
>DOESN'T work
>
>INSERT INTO »TestTable« (»Name«, »Surname«) VALUES ('name', 'surname'); .. 
>this DOES work


If you create a table using quotes and mixed-case, you will need quotes 
every time you reference the table.  Don't use quotes when you create the 
table and you won't need them when you acces the table with other commands.


Re: weird SQL statement question

От:
Mischa Sandberg <mischa.sandberg@telus.net>
Дата:
Quoting Frank Bax : 
> At 01:55 PM 4/23/05, Tadej Kanizar wrote: 
>  
> >Ok, so I installed the latest version of Postresql (8.02) on a 
WinXP 
> SP2  
> >machine.. 
> > 
> >My question is why won't the statement SELECT * FROM table work, 
> whereas  
> >the statement SELECT * FROM �table� works! 
> If you create a table using quotes and mixed-case, you will need 
> quotes  
> every time you reference the table.  Don't use quotes when you 
create 
> the  
> table and you won't need them when you acces the table with other 
> commands. 
I don't suppose that the original poster actually named the table 
"table"? In which case, being a keyword, it will ALWAYS need quotes. 
"Dreams come true, not free." -- S.Sondheim, ITW 


FAQ