Jeff, that's helpful:-)

but that does not pupulat the excel spreadsheet with data from a select
query, rather you have to select and loop while do()ing it.

There is lot of overhead for certain things, I just though a simple mod
would help to just dump data, and nothing else.

I'll also look into the AnyData, it's probably redundant, but I was looking
into supporting format that say can't be queried, but can be dumped into.

Ilya

-----Original Message-----
From: Jeff Zucker
To: Sterin, Ilya (I.)
Cc: '[EMAIL PROTECTED]';       Kawai Takanori (Hippo2000)
Sent: 10/1/02 3:41 PM
Subject: Re: Database to Excel script...

Ilya Sterin wrote:
 >
 >Jeff Zucker wrote
 >>

>>With Kawai Takanori's DBD::Excel (on CPAN).
> 
>Yes, but DBD::Excel allows you to query Excel files, not dump them.


Here's a somewhat simple minded patch to DBD::Excel that allows one to 
create and populate an Excel file with standard SQL CREATE and INSERT 
statements.

=item xl_mode

If xl_mode is set to "write" in the connect() statement, the CREATE and 
INSERT statements will be written to file when disconnect() is 
explicitly called.  For example. this creates a new .xls file and 
inserts rows into it:

   my $hDb = DBI->connect("dbi:Excel:file=$file;xl_mode=write");
   $hDb->do("CREATE TABLE $table (id INTEGER,phrase CHAR(40))");
   $hDb->do("INSERT INTO $table VALUES (1,'JAPH')");
   $hDb->do("INSERT INTO $table VALUES (2,'Hello World')");
   $hDb->disconnect;

-- 

Jeff





 <<excel.dif>> 

Reply via email to