in reply to Re: Re: dbi style questions (code, discussion)
in thread dbi style questions (code, discussion)
# my sql statement. my $sql = "INSERT INTO msg ( " . join (",\n", @keys) . ") " . "VALUES (" . join (",\n", @values) . ")";
I like it. Using join() this way simplifies the SQL generation a lot.
Unfortunately, there's no real help for manually $dbh->quote()ing values that need it - we use DB2 at work, and quoting a number gives a SQL error (grrrrrrrr). That's my #1 complaint about the thing.
We'll probably move to something between what your friend does, and the inline code. Generate the actual SQL in a module, but maintain control of it's execution inline - otherwise you're borked with transactions, and I hate passing $dbh's around all over the place.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: dbi style questions (code, discussion)
by runrig (Abbot) on Jan 01, 2002 at 02:00 UTC | |
by edebill (Scribe) on Jan 01, 2002 at 21:39 UTC | |
by tilly (Archbishop) on Jan 06, 2002 at 06:20 UTC | |
by runrig (Abbot) on Jan 02, 2002 at 00:18 UTC | |
by edebill (Scribe) on Jan 02, 2002 at 00:45 UTC |