Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: DBI and Inserting an Array

by krujos (Curate)
on Mar 12, 2004 at 00:28 UTC ( #336039=note: print w/replies, xml ) Need Help??


in reply to DBI and Inserting an Array

I was able to do it using the following.
my $sth = $dbh->prepare("INSERT INTO $table ($cols) VALUES (?,?,?)") or die "$dbh->errstr"; my @array=('one', 'two', 'thee'); $sth->execute(@array) or die "$dbh->errstr : $table";
You should be able to plug your code in pretty easily.

Replies are listed 'Best First'.
Re: Re: DBI and Inserting an Array
by carric (Beadle) on Mar 12, 2004 at 04:55 UTC
    Excellent. Thanks guys. That did the trick!! =)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://336039]
help
Chatterbox?
[Corion]: TCLion: Whee ;)
[TCLion]: need to put like this : 2017-02-20 09:30:53
[1nickt]: That's why I asked if you are using DateTime. It has a large number of supporting modules (the author likes the term 'eco-system') so if you are already creating a DateTime obj from your dates, this module would read in the mnoron-formatted 1s seamlessly
[TCLion]: when I put the date together it looks like : 2017-Feb-24 (month is the problem)
[1nickt]: good luck, then.
[TCLion]: looking at DateTime documentation in monastery now

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (11)
As of 2017-03-23 14:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (288 votes). Check out past polls.