The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

DBIx::Array::Export - This modules extends DBIx::Array with convenient export functions

SYNOPSIS

  use DBIx::Array::Export;
  my $dbx=DBIx::Array::Export->new;
  $dbx->connect($connection, $user, $pass, \%opt); #passed to DBI

DESCRIPTION

USAGE

METHODS (Export)

xml_arrayhashname

Returns XML given an arrayhashname data structure

  $dbx->execute(q{ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD"T"HH24:MI:SS"Z"'});
  my @arrayhashname=$dbx->sqlarrayhashname($sql);
  my $xml=$dbx->xml_arrayhashname(data    => \@arrayhashname,
                                  comment => "Text String Comment",
                                  uom     => {col1=>"min", col2=>"ft"});

csv_arrayarrayname

Returns CSV given an arrayarrayname data structure

  my $csv=$dbx->csv_arrayarrayname($data);

csv_cursor

Writes CSV to file handle given an executed cursor

  binmode($fh);
  $dbx->csv_cursor($fh, $sth);

Due to portablilty issues, I choose not to force the passed file handle into binmode. However, it IS required! For most file handle objects you can run binmode($fh) or $fh->binmode;

xls_arrayarrayname

Returns XLS data blob given an arrayarrayname data structure

  my $xls=$dbx->xls_arrayarrayname("Tab One"=>$data, "Tab Two"=>$data2, ...);

TODO

Switch out XML::Simple for XML::LibXML::LazyBuilder

Add XLS export with Spreadsheet::WriteExcel::Simple::Tabs

BUGS

SUPPORT

AUTHOR

  Michael R. Davis
  CPAN ID: MRDVT
  STOP, LLC
  domain=>stopllc,tld=>com,account=>mdavis
  http://www.stopllc.com/

COPYRIGHT

This program is free software licensed under the...

  The BSD License

The full text of the license can be found in the LICENSE file included with this module.

SEE ALSO

XML::Simple, Text::CSV_XS, Spreadsheet::WriteExcel::Simple::Tabs