On Tue, Sep 13, 2005 at 03:31:35PM +0200, Paskamp, Marco wrote:
> Hi,
> I'm thinking about the support of default values as parameter bind for a
> prepared statement. Before I implement a special DBD::MaxDB solution I
> would like to ask if there is a standardized way to do this in DBI. For
> understanding, you can set the NULL value when you bind undef but how
> can you set the DEFAULT value for a parameter?
You mean DEFAULT as in
INSERT INTO foo VALUES (1, DEFAULT, "bar");
where the _SQL_keyword_ DEFAULT triggers the use of whatever value was
declared as the DEFAULT value in the table definition?
> If DBI does not support default values as parameter are there any other
> driver that support this. If yes, how is it solved?
Well here's one way that might work:
INSERT INTO foo VALUES (?, IFNULL(?,DEFAULT), "bar");
(substitute something else for IFNULL isn't that's not quite right)
but I'm not sure if that's valid and/or viable.
How does the MaxDB API expose the functionality?
Tim.