OXIESEC PANEL
- Current Dir:
/
/
home
/
cubot
/
bin
/
etl_odbc
/
test
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
mssql_odbc.pl
528 bytes
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
t3.pl
2.21 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
test.pl
1.45 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
test2.pl
1.95 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
test3.pl
685 bytes
02/03/2023 07:34:13 AM
rw-r--r--
📄
tmpxml.pl
1.49 KB
02/03/2023 07:34:13 AM
rw-r--r--
Editing: t3.pl
Close
require "config.pl"; use Data::Dumper; $dsn = "sampledb"; $user = "sa"; $pass = "12345678"; $ETLODBC='1'; $localconn = opendb($dsn, $user, $pass); print $localconn . "\n"; print "\n"; sub doselectone{ local $query = shift; print("ONE query >>>" . $query); local $sth = $localconn->prepare($query) or return 'ERR'; $sth->execute(); print( "c err >>>" . $localconn->errstr); print( "s err >>>" . $localconn->err); local $col_values = $sth->fetchrow_arrayref(); print Dumper($col_values); $sth->finish(); $col_values; } sub doselectall{ local $query = shift; print("ALL query >>>" . $query); local $sth = $localconn->prepare($query) ; $sth->execute(); local $n = $sth->rows; while (local $ref = $sth->fetchrow_arrayref) { push(@c_values, [@$ref]); } } $query = "select etl_logid from etl_tasklog where etl_logid=100"; local $sth = $localconn->prepare($query) or return 'ERR'; $sth->execute(); local $col_values = $sth->fetchrow_arrayref(); print Dumper($col_values); $sth->finish(); print "Step 1: Done"; ############################## $query2 = "select etl_logid from etl_tasklog"; local $sth2 = $localconn->prepare($query2) ; $sth2->execute(); my $i=0; do { my @row; while (@row = $sth2->fetchrow_array()) { push(@c_values2, [@$ref2]); print "X Step 2 middle [$i]" . $sth2->rows . " ==>: " . @c_values2 . "\n"; } } while ($sth2->{odbc_more_results}); print Dumper($col_values2); $query2 = "select etl_logid from etl_tasklog"; local $sth2 = $localconn->prepare($query2) ; $sth2->execute(); print ("Num Rows = $nrows\n"); $i=0; local $ref2; while ($ref2 = $sth2->fetchrow_array) { $i++; push(@c_values2, [@$ref2]); print "Step 2 middle [$i]" . $sth2->rows . " ==>: " . @c_values2 . "\n"; print $sth2->{odbc_more_results} . "\n"; if ($sth2->rows eq 15) { last; } } print $sth2->{odbc_more_results} . "===>" . $sth2->rows . "\n"; print Dumper($col_values2); $sth2->finish(); print "Step 2: Done"; ############################### $query1 = "select etl_logid from etl_tasklog where etl_logid=2"; local $sth1 = $localconn->prepare($query1) or return 'ERR'; $sth1->execute(); local $col_values1 = $sth1->fetchrow_arrayref(); print Dumper($col_values1); $sth1->finish(); print "Step 3: Done";