Re: inserting data coming from a hash

2005-05-22 Thread Steven Lembark
-- Robert <[EMAIL PROTECTED]> This is my hash structure: "Veterans Day" => { date=> '2005', type=> 'US', federal => 'true', active => 'true', }, Would I just use a placeholder (?) in my statement and pass it in via that? It will be in a loop as I have quite a f

Re: inserting data coming from a hash

2005-05-22 Thread Steven Lembark
-- Robert <[EMAIL PROTECTED]> This is my hash structure: "Veterans Day" => { date=> '2005', type=> 'US', federal => 'true', active => 'true', }, Would I just use a placeholder (?) in my statement and pass it in via that? It will be in a loop as I have quite a f

Re: inserting data coming from a hash

2005-04-25 Thread Bart Lateur
On Thu, 21 Apr 2005 09:36:33 -0400, Robert wrote: >This is my hash structure: > >"Veterans Day" => { >date=> '2005', >type=> 'US', >federal => 'true', >active => 'true', > }, > >Would I just use a placeholder (?) in my statement and pass it in via that? Use DBIx::Sim

Re: inserting data coming from a hash

2005-04-21 Thread Michael A Chase
On 04/21/2005 10:11 AM, Robert said: This was "a" solution: my $insert_stmt = "Insert into TABLE (name, date, type, federal, active) values( :name, :date, :type, :federal, :active )"; my $sth = $dbh->prepare( $insert_stmt ); my $holidays; foreach my $name ( keys %holidays ) { $sth->bind_p

RE: inserting data coming from a hash

2005-04-21 Thread CAMPBELL, BRIAN D (BRIAN)
David, Your solution is similar to mine. But I like your use of the hash slice better. I keep forgetting about those darn slices. -Original Message- From: David [mailto:[EMAIL PROTECTED] Sent: Thursday, April 21, 2005 6:53 AM To: dbi-users@perl.org Subject: Re: inserting data coming

RE: inserting data coming from a hash

2005-04-21 Thread CAMPBELL, BRIAN D (BRIAN)
$sth->bind_param($i++, $d->{$_}) foreach @members; $sth->execute(); Warning. This is untested code. But hopefully you get the idea. Was this the kind of answer that you were looking for? -Original Message- From: Robert [mailto:[EMAIL PROTECTED] Sent: Thursday, April 21, 2005 6:37 A

Re: inserting data coming from a hash

2005-04-21 Thread Robert
This was "a" solution: my $insert_stmt = "Insert into TABLE (name, date, type, federal, active) values( :name, :date, :type, :federal, :active )"; my $sth = $dbh->prepare( $insert_stmt ); my $holidays; foreach my $name ( keys %holidays ) { $sth->bind_param( ':name', $name ); $s

Re: inserting data coming from a hash

2005-04-21 Thread David Nicol
On 4/21/05, Robert <[EMAIL PROTECTED]> wrote: > This is my hash structure: > > "Veterans Day" => { > date=> '2005', > type=> 'US', > federal => 'true', > active => 'true', > }, > > Would I just use a placeholder (?) in my statement and pass it in via that? > It will

Re: inserting data coming from a hash

2005-04-21 Thread David
On Thu, Apr 21, 2005 at 09:36:33AM -0400, Robert wrote: > This is my hash structure: > > "Veterans Day" => { > date=> '2005', > type=> 'US', > federal => 'true', > active => 'true', > }, > > Would I just use a placeholder (?) in my statement and pass it in via that?

Re: inserting data coming from a hash

2005-04-21 Thread Michael Styer
On Thu, 21 Apr 2005 09:36:33 -0400, "Robert" said: > This is my hash structure: > > "Veterans Day" => { > date=> '2005', > type=> 'US', > federal => 'true', > active => 'true', > }, > > Would I just use a placeholder (?) in my statement and pass it in via > that? >

inserting data coming from a hash

2005-04-21 Thread Robert
This is my hash structure: "Veterans Day" => { date=> '2005', type=> 'US', federal => 'true', active => 'true', }, Would I just use a placeholder (?) in my statement and pass it in via that? It will be in a loop as I have quite a few. Thoughts and suggestions would