perldoc > DBD::Excel

📖 NAME

DBD::Excel – A class for DBI drivers that act on Excel File.

This is still alpha version.

🚀 Quick Reference

Use CaseCommandDescription
Connect to an Excel fileDBI->connect("DBI:Excel:file=test.xls")🔗 Open a connection to an Excel workbook
Create a table (worksheet)$hDb->prepare("CREATE TABLE ...")->execute()📝 Create a new worksheet with columns
List all worksheets$hDb->func('list_tables')📋 Return sheet names in the workbook
Insert data into a worksheet$hDb->prepare("INSERT INTO ...")->execute()đŸ“Ĩ Add rows to a worksheet
Select data from a worksheet$hDb->prepare("SELECT ...")->execute()🔍 Retrieve rows from a worksheet
Set custom formatter for parsingconnect(..., {xl_fmt => $formatter})🎨 Use a custom formatter class
Search Excel files in a directory$hDr->data_sources({xl_dir => '/path'})📂 Get list of .xls files in a directory

đŸ› ī¸ SYNOPSIS

use DBI;
$hDb = DBI->connect("DBI:Excel:file=test.xls")
    or die "Cannot connect: " . $DBI::errstr;
$hSt = $hDb->prepare("CREATE TABLE a (id INTEGER, name CHAR(10))")
    or die "Cannot prepare: " . $hDb->errstr();
$hSt->execute() or die "Cannot execute: " . $hSt->errstr();
$hSt->finish();
$hDb->disconnect();

📄 DESCRIPTION

This is still alpha version.

The DBD::Excel module is a DBI driver. The module is based on these modules:

This module assumes TABLE = Worksheet. The contents of first row of each worksheet as column name.

Adding that, this module accepts temporary table definition at "connect" method with xl_vtbl.

ex. my $hDb = DBI->connect( "DBI:Excel:file=dbdtest.xls", undef, undef,
    {xl_vtbl => {TESTV => { sheetName => 'TEST_V', ttlRow => 5,
    startCol => 1, colCnt => 4, datRow => 6, datLmt => 4 } } } );

For more information please refer sample/tex.pl included in this distribution.

📋 Metadata

The following attributes are handled by DBI itself and not by DBD::Excel, thus they all work like expected:

The following DBI attributes are handled by DBD::Excel:

These attributes and methods are not supported:

Additional to the DBI attributes, you can use the following dbh attribute:

🔧 Driver private methods

📋 TODO

🐛 KNOWN BUGS

👤 AUTHOR

Kawai Takanori (Hippo2000) kwitknr AT cpan.org

Homepage:
http://member.nifty.ne.jp/hippo2000/ (Japanese)
http://member.nifty.ne.jp/hippo2000/index_e.htm (English)

Wiki:
http://www.hippo2000.net/cgi-bin/KbWiki/KbWiki.pl (Japanese)
http://www.hippo2000.net/cgi-bin/KbWikiE/KbWiki.pl (English)

🔗 SEE ALSO

DBI, Spreadsheet::WriteExcel, Spreadsheet::ParseExcel, SQL::Statement

ÂŠī¸ COPYRIGHT

Copyright (c) 2001 KAWAI,Takanori All rights reserved.

You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.

DBD::Excel
📖 NAME 🚀 Quick Reference đŸ› ī¸ SYNOPSIS 📄 DESCRIPTION
📋 Metadata 🔧 Driver private methods
📋 TODO 🐛 KNOWN BUGS 👤 AUTHOR 🔗 SEE ALSO ÂŠī¸ COPYRIGHT

Generated by phpman v4.10.0-7-g98e9fd5 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-09-15 06:46 @216.73.217.167
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!

^_top_^