Обсуждение: float8 type

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

float8 type

От
"Krasnow, Greg"
Дата:
Is it not possible to have a float8 value default to a negative number??

I tried:
CREATE TABLE TEST1 (T1 FLOAT8 DEFAULT -1);
and I am getting:
ERROR: DEFAULT: type mismatched.

I also tried:
CREATE TABLE TEST1 (T1 FLOAT8 DEFAULT -1.0);
and have the same result.

am I going to have to create a function which returns the negative of a
number since it seems like the parser does not recognize the '-' as a
negative sign?

- Greg


Greg Krasnow
HNC Software Inc.
Financial Solutions Group
Senior Software Engineer
Email: gak@hnc.com
Direct Phone: 619.799.8341
Fax: 619.799.8036



Re: [GENERAL] float8 type

От
Sferacarta Software
Дата:
Hello Krasnow,,

martedì, 4 agosto 98, you wrote:

KG> Is it not possible to have a float8 value default to a negative number??

KG> I tried:
KG> CREATE TABLE TEST1 (T1 FLOAT8 DEFAULT -1);
KG> and I am getting:
KG> ERROR: DEFAULT: type mismatched.

KG> I also tried:
KG> CREATE TABLE TEST1 (T1 FLOAT8 DEFAULT -1.0);
KG> and have the same result.

KG> am I going to have to create a function which returns the negative of a
KG> number since it seems like the parser does not recognize the '-' as a
KG> negative sign?

KG> - Greg


KG> Greg Krasnow
KG> HNC Software Inc.
KG> Financial Solutions Group
KG> Senior Software Engineer
KG> Email: gak@hnc.com
KG> Direct Phone: 619.799.8341
KG> Fax: 619.799.8036

Try this:

CREATE TABLE TEST1 (T1 FLOAT8 DEFAULT '-1')

                                      ^^^^^

Best regards,
  Jose'                            mailto:sferac@bo.nettuno.it