File: testj.pl

package info (click to toggle)
libdbd-excel-perl 0.07-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 392 kB
  • sloc: perl: 1,064; makefile: 2
file content (23 lines) | stat: -rw-r--r-- 953 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use strict;
#For Not-Ascii Characterset(Japanese etc.)
use DBI;
use Spreadsheet::ParseExcel::FmtJapan2;
my $oFmtJ = Spreadsheet::ParseExcel::FmtJapan2->new( Code => 'euc');
my $hDb = DBI->connect("DBI:Excel:file=testj.xls", undef, undef, 
                        { xl_fmt => $oFmtJ,
                          xl_vtbl => 
                            {TESTJ => 
                                {
                                    sheetName => 'ܸ',
                                    ttlRow    => undef,
                                    startCol  => 0,
                                    colCnt    => 5,
                                    datRow    => 1,
                                }
                            }
                        });
my $hSt = $hDb->prepare(q/SELECT COL_1_, COL_2_ FROM TESTJ/);
$hSt->execute();
while(my $raRes = $hSt->fetchrow_arrayref()) {
    print "DATA:", join(',', @$raRes), "\n";
}