Re: Inserting into a database
- From: Glenn Jackman <glennj@xxxxxx>
- Date: 13 Sep 2006 19:17:50 GMT
At 2006-09-13 11:05AM, "MattJ83" wrote:
my @filenames = </home/username/logs/*.log>;
foreach my $filename (@filenames)
{
[...]
my $dbh = DBI ->connect("dbi:Oracle:server", "database", "password")
or die "couldn't connect to database: $DBI::errstr\n";
$dbh->do("INSERT INTO TEST2 (sfd, w, sdf, hfg, rt, bv, te)
VALUES (?, ?, ?, ?, ?, ?, ?)", undef,
$filename, $info, $elapsed1, $fast, $elapsed2, $inversions,
$elapsed3);
}
Why are you opening the db connection for each file? You should open it
once, prepare your sql statement, and then for each file execute the
statement with the values to insert.
--
Glenn Jackman
Ulterior Designer
.
Relevant Pages
- Re: JDBC and Stored procedure performance problems
... There is an overhead on the iSeries in getting the JVM started, ... > connection if all are in use and opening it in advance. ... > The same SQL statement takes just a second in STRSQL, ... (comp.sys.ibm.as400.misc) - Re: JDBC and Stored procedure performance problems
... We are using a connection pooling mechanism but only to reuse the ... connection if all are in use and opening it in advance. ... The same SQL statement takes just a second in STRSQL, ... embed SQL RPGLE. ... (comp.sys.ibm.as400.misc) - Re: SQL wont work
... It seems like the basic component SQL statement is working but the code isn't. ... All you need is a TADOConnection, a TADODataSet and a TDataSource if you're using bound controls. ... Drop a TADOConnection on your form or in your data module and make sure the connection string to your MySQL database is correct. ... Add a TADODataSet. ... (comp.lang.pascal.delphi.databases) - Re: ASP Page tyring to query AS/400 file
... > I have created an SQL statement that queries a file on our AS/400 ... > using a DNS-less connection. ... > IBM says this MS Query is aliasing one of the fields in the query ... > product and to contact Microsoft. ... (microsoft.public.scripting.vbscript) - Re: SQL wont work
... All you need is a TADOConnection, a TADODataSet (or the ... Do I understand correctly that you have entered an SQL statement at design ... connection string to your MySQL database is correct. ... (comp.lang.pascal.delphi.databases) |
|