NAME

DBIx::Array::Export - 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 (with header row from $sth)

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

Due to portability 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;

csvappend_cursor

Appends CSV to file handle given an executed cursor (no header row)

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

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

BUGS

Please open on GitHub

AUTHOR

  Michael R. Davis

COPYRIGHT

MIT License

Copyright (c) 2023 Michael R. Davis

SEE ALSO

Building Blocks

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

Similar Capabilities

Data::Table see csv and tsv methods, Data::Table::Excel