db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From CP Lim <cp_...@redsheriff.com>
Subject Re: How to specify default value for a date column
Date Thu, 31 Jul 2003 23:41:05 GMT
You can use the 'default' attribute, eg:

<table name="my_table">
     <column name="id" type="integer" required="true" primaryKey="true"/>
     <column name="bday" type="date" default="now()::date"/>
</table>

Note, the above example is specific to postgresql.  If you're using 
Oracle, Sybase, etc you'll have to figure out that database's default 
call for sysdate.

HTH,
CP

Anil AUP wrote:

> Can I define sysdate as the default value for a date column in schema.xml.
> (Or any other expression)?
> 
> Any ideas
> 
> Anil
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
> 
> 
> 

-- 
R E D S H E R I F F
C.P. Lim - Software Engineer
[cp_lim@redsheriff.com]

96-98 Market St    +61 (3) 9606 4036 tel
South Melbourne    +61 (3) 9606 4001 fax
Victoria  3205     +61 (413) 781 846 cell

This message and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom they are 
addressed. If you are not the intended recipient, you are hereby 
notified that any use or dissemination of this communication is strictly 
prohibited. If you have received this message in error please notify us 
immediately by return email or telephone +61 (2) 8204 5888, then delete 
this message. Any views expressed in this message are those of the 
individual sender and many not necessarily reflect the views of Red 
Sheriff.


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message