in reply to Re: Re: DBI placeholders, bind_values, and SQL_DATE
in thread DBI placeholders, bind_values, and SQL_DATE
So, you can bind a specific date in the execute, or you can bind undef and let the database specify the current date.$insert_sth = $dbh->prepare(<<"EndOfSQL"); INSERT INTO members (member_id, name, date_joined) VALUES (?, ?, NVL(?, SysDate)) EndOfSQL $insert_sth->execute(1, 'Bob', '2001-08-15'); # Bob actually joined y +esterday $insert_sth->execute(2, 'Tom', undef); # Tom is joining now
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: DBI placeholders, bind_values, and SQL_DATE
by dga (Hermit) on Aug 17, 2001 at 01:11 UTC |