Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use DBI;
- use strict;
- my $usersFile = sprintf("users.txt");
- open(STDOUT, ">>", $usersFile);
- my $driver = "Oracle";
- my $sid = "SID01";
- my $userid = "admin";
- my $password = "s3cret";
- my $host = "SID01.domain.com";
- my $dbh = DBI->connect("dbi:$driver:host=$host;service_name=$sid;port=1521", $userid, $password , { RaiseError => 1, AutoCommit => 0 });
- my $sth = $dbh->prepare("SELECT USR_ID FROM T_USERS");
- $sth->execute;
- my $row;
- while (my @data = $sth->fetchrow_array) {
- foreach(@data) {
- print "Username: $_\r";
- }
- }
- $sth->finish;
- $dbh->disconnect;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement