Re: how to set a DEFAULT value !!
- From: jonathan.leffler@xxxxxxxxx (Jonathan Leffler)
- Date: Thu, 27 Apr 2006 00:26:48 -0700
On 4/26/06, Greg Sabino Mullane <greg@xxxxxxxxxxxx> wrote:
DBI is complex enough, and AIUI the DBI philosophy opposes addingfeatures
to the core that will cause implementation headaches for driver authors..
The standard perl idiom for default values is
You misunderstand. The DEFAULT is on the database side, not the client,
and
is represented by sending the literal string 'DEFAULT' to the backend,
similar to the way that null values are sent by the literal string 'NULL'..
The database then populates the column with whatever the default has been
set as, which may be a constant, or may be (in PostgreSQL's case) an
arbitrarily
complex expression or call to a stored procedure.
Is it a string that's sent, or the identifier? For NULL, it is either an
identifier (not quoted) or Perl undef that denotes NULL in the DBMS. I'm
not sure how you'd represent DEFAULT in Perl, or as a string rather than an
identifier.
--
Jonathan Leffler <jonathan.leffler@xxxxxxxxx> #include <disclaimer.h>
Guardian of DBD::Informix - v2005.02 - http://dbi.perl.org
"I don't suffer from insanity - I enjoy every minute of it."
- Follow-Ups:
- Re: how to set a DEFAULT value !!
- From: Greg Sabino Mullane
- Re: how to set a DEFAULT value !!
- References:
- Re: how to set a DEFAULT value !!
- From: David Nicol
- Re: how to set a DEFAULT value !!
- From: Greg Sabino Mullane
- Re: how to set a DEFAULT value !!
- Prev by Date: Fwd: Re: DBD::Oracle ppd
- Next by Date: Re: how to set a DEFAULT value !!
- Previous by thread: Re: how to set a DEFAULT value !!
- Next by thread: Re: how to set a DEFAULT value !!
- Index(es):
Relevant Pages
|