Обсуждение: is this proper sql?

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

is this proper sql?

От
clayton cottingham
Дата:
hi one of the developers here at work say this should workinsert into detail (det_id,det_mas_id,det_date,det_amt)
values
 
(0,0,now(),'0'), (1,1,now(),'1');



but when i try that in postgres like:insert into detail (det_id,det_mas_id,det_date,det_amt) values 
(0,0,datetime'now','0'), (1,1,datetime'now','1');

i get
ERROR:  parser: parse error at or near ","


now i personally dont think this is real sql
anyone?


Re: is this proper sql?

От
Stephan Szabo
Дата:
On Tue, 17 Apr 2001, clayton cottingham wrote:

> hi one of the developers here at work say this should work
>  insert into detail (det_id,det_mas_id,det_date,det_amt) values 
> (0,0,now(),'0'), (1,1,now(),'1');
> 
> 
> 
> but when i try that in postgres like:
>  insert into detail (det_id,det_mas_id,det_date,det_amt) values 
> (0,0,datetime'now','0'), (1,1,datetime'now','1');
> 
> i get
> ERROR:  parser: parse error at or near ","
> 
> 
> now i personally dont think this is real sql
> anyone?

I'm pretty sure that meets spec, but isn't currently supported by
postgres.  I believe if I'm reading the spec correctly, it's only
required for the highest level of complience.




Re: is this proper sql?

От
David Olbersen
Дата:
On Tue, 17 Apr 2001, clayton cottingham wrote:

> now i personally dont think this is real sql
> anyone?

Nope, not real. Although that type of syntax would be handy IMHO.

-- Dave



Re: is this proper sql?

От
Tom Lane
Дата:
clayton cottingham <drfrog@smartt.com> writes:
> hi one of the developers here at work say this should work
>  insert into detail (det_id,det_mas_id,det_date,det_amt) values 
> (0,0,now(),'0'), (1,1,now(),'1');

Multiple rows in INSERT ... VALUES are legal according to the SQL92
spec, but we don't support that (yet).
        regards, tom lane


Re: is this proper sql?

От
Peter Eisentraut
Дата:
clayton cottingham writes:

> hi one of the developers here at work say this should work
>  insert into detail (det_id,det_mas_id,det_date,det_amt) values
> (0,0,now(),'0'), (1,1,now(),'1');

This is real SQL (except for the now() function) but it isn't supported in
PostgreSQL yet.

-- 
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter