do() with bind_values
From: Jupiterhost.Net (mlists_at_jupiterhost.net)
Date: 05/12/04
- Next message: Jeff Zucker: "Re: different field delimiters and xml question"
- Previous message: Tim Bunce: "Re: different field delimiters and xml question"
- Next in thread: Scott T. Hildreth: "Re: do() with bind_values"
- Reply: Scott T. Hildreth: "Re: do() with bind_values"
- Maybe reply: Ronald Kimball: "RE: do() with bind_values"
- Maybe reply: Jupiterhost.Net: "Re: do() with bind_values"
- Maybe reply: Jupiterhost.Net: "Re: do() with bind_values"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 12 May 2004 09:13:11 -0500 To: dbi-users@perl.org
Howdy group!
perldoc DBI
has this:
$rv = $dbh->do($statement, \%attr, @bind_values);
So would this be a proper use of it:
$dbh->do(
'INSERT INTO Stuff (Id,Foo) VALUES (NULL,?)',
undef,
qw('foo' 'bar' 'baz')
) or die ....
# IE undef foro \%attr and include quoted data
That would essencially run:
INSERT INTO Stuff (Id,Foo) VALUES (NULL,'foo');
INSERT INTO Stuff (Id,Foo) VALUES (NULL,'bar');
INSERT INTO Stuff (Id,Foo) VALUES (NULL,'baz');
since do() does the prepare and execute for you.
correct?
TIA
Lee.M - JupiterHost.Net
- Next message: Jeff Zucker: "Re: different field delimiters and xml question"
- Previous message: Tim Bunce: "Re: different field delimiters and xml question"
- Next in thread: Scott T. Hildreth: "Re: do() with bind_values"
- Reply: Scott T. Hildreth: "Re: do() with bind_values"
- Maybe reply: Ronald Kimball: "RE: do() with bind_values"
- Maybe reply: Jupiterhost.Net: "Re: do() with bind_values"
- Maybe reply: Jupiterhost.Net: "Re: do() with bind_values"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|