CGI::AppBuilder::TaskLoads - Loading files to a database
use CGI::AppBuilder::TaskLoads; my $sec = CGI::AppBuilder::TaskLoads->new(); my ($sta, $msg) = $sec->exe_sql($ar);
This class provides methods for reading and parsing configuration files.
This is a inherited method from CGI::AppBuilder. See the same method in CGI::AppBuilder for more details.
Input variables:
$ar - array ref containing the following variables:
Variables used or routines called:
None
How to use:
Return: array/hash array or its ref {$k}{$e} where $k = [v|1|..|study_id]; $e contains
rdr - relative directory mfn - meta file name, i.e., the xls contains domain and variable metadata dfn - domain file name containing domain metadata vfn - variable file name containing variable metadata ofd - output file directory dml - data manipulation act: A|D|I|U var - hash array ref containing variables
$q - CGI class $ar - array ref containing the following variables:
Return: $pr will contain the parameters adn output from running the PL/SQL.
$rr - array ([$i]{$k}) with new data $rf - hash array with the following elements tbn - table name: cc_domains kcn - key column name: dn_id scn - select column name: study_id scv - select column value: 1 act - DML type: A-auto, D-delete, I-insert, U-update $ar - hash array for system wide parameters
Return: This procedure returns an array containing DML SQL statements and populate the $rf with the following new elements:
c1_crf - column definition array [$i]{$k} for the table where $k= column_name,data_type,data_length c1_vars - a list of column names separated by comma in the table c2_crf - column definition array [$i]{$k} for the new data where $k= column_name,data_type,data_length c2_vars - a list of column names separated by comma in the data
$cr - array ref containing column definitions ([$i]{$k}) where $k is column_name, data_type, and data_length
Return: a list containing column names separated by comma
$cns - column names separated by comma
Return: a formated list to be used in SELECT statement.
$ar - array ref containing two dimensional data elements in an array $vars - variable names sparated by comma
Return: an array with hash elements $r->[$i]{$k}.
sub prt_txt_file { my ($s, $fn,$ar) = @_; my ($fname, $path, $sfx) = fileparse($fn,qr{\..*}); my $t1 = "<center><b>$fname$sfx</b></center>\n<hr>\n<pre>\n"; my $typ = my $w = my $st = my $t = ""; my $n = $w; open FILE, "<$fn" or die "ERR: could not open $fn: $!\n"; while (<FILE>) { s/</\</g; s/>/\>/g; s/ /^L/g; # change the non-printable char to printable char if ($st) { s/($st)/<font color=red>$1<\/font>/ig; } my ($tt, $i) = ($_, -1); if (length($tt) < $n || !$w ) { $t .= $tt; next; } while (length($tt) >= $n) { ++$i; if ($i) { # the second line $t .= " "x4 . substr($tt, 0, $n) . "\n"; } else { # first line $t .= substr($tt, 0, $n) . "\n"; } $tt = substr($tt, $n); } $t .= " "x4 . $tt; } close FILE; return $t if $typ; print "$t1$t</pre><br>\n"; }
Version 0.10
This version was started on 09/28/2011.
Oracle::Loader, Oracle::Trigger, CGI::AppBuilder, File::Xcopy, CGI::AppBuilder::Message
Copyright (c) 2009 Hanming Tu. All rights reserved.
This package is free software and is provided "as is" without express or implied warranty. It may be used, redistributed and/or modified under the terms of the Perl Artistic License (see http://www.perl.com/perl/misc/Artistic.html)
1 POD Error
The following errors were encountered while parsing the POD:
You forgot a '=back' before '=head1'
To install CGI::AppBuilder::TaskLoads, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CGI::AppBuilder::TaskLoads
CPAN shell
perl -MCPAN -e shell install CGI::AppBuilder::TaskLoads
For more information on module installation, please visit the detailed CPAN module installation guide.