SQL-Error-Code 591???
Posted in 2000
Topics: General Discussion
Hi,
I am having problems with a SQL-Statement. I keep getting SQL-Error 591,
which means: Invalid default value for column/variable...
Browsing through several books and informix-urls didn't help. Can one of
you experts spy the error?
CREATE TABLE SOME_NAME
(
EXECUTION_DAT DATETIME YEAR TO FRACTION(3) DEFAULT "1900-01-01
00:00:00.000" NOT NULL ,
....
)
I cannot see what's wrong with the default value.
I tried using single quotation marks instead of double quotation marks,
to no effect
Any help is highly appreciated
Thanx in advance
Peter
Try ,
CREATE TABLE SOME_NAME
(
execution_dat datetime year to fraction(3)
default datetime(1900-01-0100:00:00.000) year to fraction(3) not null )
Hope this helps
Pankaj
Peter Ulrich wrote in message <3976B2A9.1A2F216A@corag.de>...
>Hi,
>
>I am having problems with a SQL-Statement. I keep getting SQL-Error 591,
>which means: Invalid default value for column/variable...
>Browsing through several books and informix-urls didn't help. Can one of
>you experts spy the error?
>
>CREATE TABLE SOME_NAME
> (
> EXECUTION_DAT DATETIME YEAR TO FRACTION(3) DEFAULT "1900-01-01
>00:00:00.000" NOT NULL ,
> ....
> )>
>I cannot see what's wrong with the default value.
>I tried using single quotation marks instead of double quotation marks,
>to no effect
>
>Any help is highly appreciated
>Thanx in advance
>Peter
>
Hi Pankaj,
thanx for your reply!
Unfortunately your suggestion didn't solve the problem.
I get a syntax error (code 201) instead,
as well as with the following variations:
CREATE TABLE SOME_NAME
(
execution_dat datetime year to fraction(3)default datetime year to fraction(3) (1900-01-0100:00:00.000) not null
)
nor this:
CREATE TABLE SOME_NAME
(
execution_dat datetime year to fraction(3)default datetime (1900-01-0100:00:00.000) not null
)
Any more ideas?
Regards Peter
Pankaj wrote:
> Try ,
>
> CREATE TABLE SOME_NAME
> (
> execution_dat datetime year to fraction(3)
> default datetime(1900-01-0100:00:00.000) year to fraction(3) not null )>
> Hope this helps
>
> Pankaj
>
Hi Pankaj,
it did help indeed!
The minor syntax error I got refered to the missing blank between the date
and time.
Thus the correct statement goes like this:
CREATE TABLE SOME_NAME
(
execution_dat datetime year to fraction(3)
default datetime(1900-01-01 00:00:00.000) year to fraction(3) not null )
Thanx alot
Peter
Hi All ,
There is a type-o.
There should be a space in the line
>default datetime(1900-01-01 00:00:00.000) year to fraction(3) not null )
^
Cheers
Pankaj
Pankaj wrote in message
<964086444.6974.0.nnrp-03.d4e5c55a@news.demon.co.uk>...
>Try ,
>
>CREATE TABLE SOME_NAME
> (
> execution_dat datetime year to fraction(3)
>default datetime(1900-01-0100:00:00.000) year to fraction(3) not null )>
>Hope this helps
>
>
>Pankaj
>
>
>Peter Ulrich wrote in message <3976B2A9.1A2F216A@corag.de>...
>>Hi,
>>
>>I am having problems with a SQL-Statement. I keep getting SQL-Error 591,
>>which means: Invalid default value for column/variable...
>>Browsing through several books and informix-urls didn't help. Can one of
>>you experts spy the error?
>>
>>CREATE TABLE SOME_NAME
>> (
>> EXECUTION_DAT DATETIME YEAR TO FRACTION(3) DEFAULT "1900-01-01
>>00:00:00.000" NOT NULL ,
>> ....
>> )>>
>>I cannot see what's wrong with the default value.
>>I tried using single quotation marks instead of double quotation marks,
>>to no effect
>>
>>Any help is highly appreciated
>>Thanx in advance
>>Peter
>>
>
>
Pankaj's reply is exactly correct. I did the following and it works
just fine:
create table datetest (
date_col datetime year to fraction(3)
default datetime(1900-01-01 00:00:00.000) year to fraction(3)
not null
);
I think your problem is you are missing the space between the day
and the hour unless that is a typo below.
Art S. Kagel
Peter Ulrich wrote:
>
> Hi Pankaj,
>
> thanx for your reply!
>
> Unfortunately your suggestion didn't solve the problem.
> I get a syntax error (code 201) instead,
> as well as with the following variations:
>
> CREATE TABLE SOME_NAME
> (
> execution_dat datetime year to fraction(3)> default datetime year to fraction(3) (1900-01-0100:00:00.000) not null
> )
>
> nor this:
>
> CREATE TABLE SOME_NAME
> (
> execution_dat datetime year to fraction(3)> default datetime (1900-01-0100:00:00.000) not null
> )
>
> Any more ideas?
>
> Regards Peter