Re: [SQL] Use of 'default TEXT now()'

Поиск
Список
Период
Сортировка
От Rich Shepard
Тема Re: [SQL] Use of 'default TEXT now()'
Дата
Msg-id Pine.LNX.4.04.9903240552430.1624-100000@salmo.appl-ecosys.com
обсуждение исходный текст
Ответ на Use of 'default TEXT now()'  ("Ing. Roberto Andrade" <randrade@campus.iztacala.unam.mx>)
Список pgsql-sql
On Wed, 24 Mar 1999, Ing. Roberto Andrade wrote:

> I'm writing an application where I have to use a datetime field. In this
> field we'll keep the date and time of the coments about some tasks.
>
> I am not sure about the right use of 'default', should I use:
>
> fecha_obs    datetime default TEXT now()
>
> or
>
> fecha_obs    datetime default now() ?
>
> When I must use TEXT ?

  Unless I've missed something important, you want to use the latter form.
Text is a field data type for a variable length field without limit. Like
the memo field in dBASE and Paradox.

  The variable length field with a limit to the number of characters it can
contain is varchar(n). The data type, char(n), holds a fixed length string,
padded with blanks, to the maximum of 'n'.

  These are most of the character data types. What you want is one of the
date/time data types.

Hope this helps,

Rich


Dr. Richard B. Shepard, President
Applied Ecosystem Services, Inc.
2404 SW 22nd Street
Troutdale, OR 97060-1247  U.S.A.
+ 1 503-667-4517 (voice) | + 1 503-667-8863 (fax)
rshepard@appl-ecosys.com



В списке pgsql-sql по дате отправления:

Предыдущее
От: "Ing. Roberto Andrade"
Дата:
Сообщение: RE: [SQL] Use of 'default TEXT now()'
Следующее
От: "Jackson, DeJuan"
Дата:
Сообщение: RE: [SQL] Use of 'default TEXT now()'