how to set a DEFAULT value !!
- From: easy.lin@xxxxxxxxx (T. H. Lin)
- Date: Sat, 22 Apr 2006 11:08:11 +0200
for example, a table, 2 column
Table
------------------------------------------------------------
| lang_code | CHAR(2) | default: 'en' |
------------------------------------------------------------
| time | DATETIME | |
------------------------------------------------------------
I would like to do in SQL
" INSERT table VALUES (DEFAULT, NOW()); "
I use DBIx::Class and it seems not so easy....
When I do pupulate, I write like this..
$schema->populate(
'Table',
[ [ qw/lang_code
time/
],
(
[ $schema->source('Table')->column_info('lang_code')->{default_value},
'2006-04-24 12:13:23',
],
)
],
)
Question!
is there any simple way I can write like this?
$schema->populate(
'Table',
................
[ DEFAUT,
NOW(),
]
.......
)
thanks a lot!
.
- Follow-Ups:
- Re: how to set a DEFAULT value !!
- From: Greg Sabino Mullane
- Re: how to set a DEFAULT value !!
- Prev by Date: Re: last insert id
- Next by Date: Re: last insert id
- Previous by thread: sv_setpvn error in DBD::Sybase
- Next by thread: Re: how to set a DEFAULT value !!
- Index(es):