OXIESEC PANEL
- Current Dir:
/
/
home
/
cubot
/
bin
/
etl_odbc
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📄
-d
10 bytes
02/03/2023 07:34:13 AM
rw-r--r--
📁
..
-
02/03/2023 08:06:37 AM
rwxr-xr-x
📄
config.pl
7.61 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
cross2normal.pl
3.71 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
dataextract.sh
2.51 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
etl.pl
5.42 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
etlproc
9.99 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
func.pl
4.01 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
globvar.sh
127 bytes
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
initetl.pl
1.88 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
libawk.awk
3.07 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
makeXtab2NormalExcel.pl
5.73 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
process.pl
6.91 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
process_changed.pl
5.69 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
readwrite.pl
4.16 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
rxcsv.pl
7.94 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
rxdb.pl
11.06 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
rxfile.pl
4.68 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
rxsalesforce.pl
3.5 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
rxxml.pl
13.83 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
rxxml2.pl
4.18 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
sendmail.pl
1.06 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
sourcequery.pl
4.18 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
sql.pl
23.98 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
store.pl
7.97 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
tags
13.14 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
task.pl
33.48 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📁
test
-
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
userfunc.pl
5.05 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
valid.pl
3.64 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
workflow.pl
3.94 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
xform.pl
2.62 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
Editing: readwrite.pl
Close
#!/usr/bin/perl sub getstmt_mapall{ my $xdestqry; my $ctr = 0; my ($dest_storeids, $A_destqry, $data, $hdestconn, $hdeststmt, $hdest_mst, $dest_tblfile) = @_; $xdestqry = $A_destqry."( "; for(my $i=1; $i<@$data; $i++){ $xdestqry = $xdestqry."?, "; } $xdestqry = $xdestqry."?)"; foreach my $destid(@$dest_storeids){ my ($deststorename, $deststoremode, $deststoretype, $deststoreip) = @{$$hdest_mst{$destid}}; if($deststoretype eq 'D'){ $$hdeststmt{$destid, $$dest_tblfile[$ctr]} = getstmt($$hdestconn{$destid}, $xdestqry); } elsif($deststoretype eq 'T'){ $$hdeststmt{$destid, $$dest_tblfile[$ctr]} = $$hdestconn{$destid}; } $ctr++; } } sub write_mapall{ my ($firsttime, $dest_storeids, $A_destqry, $data, $hdestconn, $hdeststmt, $hdest_mst, $dest_tblfile, $hfinfo) = @_; my $xdestqry; my $ctr = 0; if($$firsttime eq '1'){ getstmt_mapall( $dest_storeids, $A_destqry, $data, $hdestconn, $hdeststmt, $hdest_mst, $dest_tblfile); $$firsttime = 0; } $ctr = 0; foreach my $destid(@$dest_storeids){ my ($deststorename, $deststoremode, $deststoretype, $deststoreip) = @{$$hdest_mst{$destid}}; loaddata($deststoretype, $$hdeststmt{$destid, $$dest_tblfile[$ctr]}, $destid, $$dest_tblfile[$ctr], $data, $hfinfo); $ctr++; } } #sub hashprn{ # my $hcols = shift; # while ( my ($key, $value) = each(%$hcols) ) { # print "HASH OF COLUMNS $key => @$value\n"; # } # } sub write_map{ my $col = 0; my @tmpdata = (); my $ctr = 0; my($dest_storeids, $hdest_mst, $hdest_numcols, $data, $hdeststmt, $dest_tblfile, $hdestmap, $srctype, $hcols, $hfinfo, $hwidth, $hdesterrlog) = @_; foreach my $destid(@$dest_storeids){ my ($deststorename, $deststoremode, $deststoretype, $deststoreip) = @{$$hdest_mst{$destid}}; my @newdata = (); my $colctr=0; for(;$col<$$hdest_numcols{$destid, $$dest_tblfile[$ctr]}; $col++){ if(($srctype eq 'T') || ($srctype eq 'E')){ # print "------------$destid------------------------------\n"; # print "Dest:",$destid, # "\tFile:",$$dest_tblfile[$ctr] , # "\tColName:",@{$$hcols{$destid, $$dest_tblfile[$ctr]}}[$colctr], # "\t(Colctr:$colctr)(Ctr:$ctr)<<<1\n"; # print "Col : \n"; # print "I/P Position : ", $$hdestmap{ $destid,$$dest_tblfile[$ctr] ,@{$$hcols{$destid, $$dest_tblfile[$ctr]}}[$colctr]}, "\t"; # print "Data Selected : ",@$data[$$hdestmap{ $destid,$$dest_tblfile[$ctr] ,@{$$hcols{$destid, $$dest_tblfile[$ctr]}}[$colctr]}], "\t<<<3\n"; # print "------------------------------------------\n"; $newdata[$colctr] = @$data[$$hdestmap{ $destid, #Destid $$dest_tblfile[$ctr] , #table Name @{$$hcols{$destid, $$dest_tblfile[$ctr]}}[$colctr]}]; #Column Name push(@tmpdata, $newdata[$colctr]); $colctr++; } else{ push(@tmpdata, @$data[$col]); } } loaddata($deststoretype, $$hdeststmt{$destid, $$dest_tblfile[$ctr]}, $destid, $$dest_tblfile[$ctr], \@tmpdata, $hfinfo, $hwidth); @tmpdata = (); $ctr++; } } sub readdata{ my $stmt = shift; my $storetype = shift; my $storeid = shift; my $srcinfo = shift; my $srcfwidth = shift; if($storetype eq 'D'){ return doselectmany($stmt); } else{ my ($ftype, $fdelim) = @$srcinfo; return doselectline($stmt, $ftype, $fdelim, $srcfwidth); } } sub loaddata{ my ($deststoretype, $destconn, $destid, $tblfile, $outdata, $hfinfo, $hwidth, $hdesterrlog) = @_; if($deststoretype eq 'D'){ $destconn->execute(@$outdata) or &logaserr($destid, $deststoretype, $destconn->errstr, $outdata, $hdesterrlog); #$destconn->execute(@$outdata) or $G_NumRecDisc++; } elsif($deststoretype eq 'T'){ printlog($MAX, "Writing : $destconn, $destid, @$tblfile, @$outdata, @@ @{$$hfinfo{$destid, $file}} @@, $hwidth"); writefile($destconn, $destid, $tblfile, $outdata, $hfinfo, $hwidth, $hdesterrlog); } } sub logaserr{ my ($destid, $deststoretype, $errmsg, $outdata, $hdesterrlog) = @_; $G_NumRecDisc++; if($deststoretype eq 'D'){ my $FH = $hdesterrlog{$destid}; my @erdata = join("|", @$outdata); print $FH @erdata , "__RXBOUNDARY__ ", $errmsg, "\n"; } else{ my $FH = $hdesterrlog{$destid}; my @erdata = join("|", @$outdata); print $FH @erdata , "__RXBOUNDARY__ ", $errmsg, "\n"; } } 1;