#!/usr/perl -w
use DBI;
my $database='MySQL ODBC 3.51 Driver';
my $hostname='192.168.1.100'
my $username= 'R1'; #same for every customer
my $password= 'box747'; #same for every customer
my $dbh = DBI->connect("dbi:ODBC:DRIVER=$database;SERVER=$hostname;port=3306",$username$password)";
my $sql = "SELECT * FROM ORG1.MACHINE";
## SQL works in MySQL studio where ORG1:db and MACHINE:table
my $sth = $dbh->prepare($sql);
$sth->execute();
## should I be sure to inject (undef)
my ($ID, $NAME, $USER, $MAC);
## Titles correspond to Schema Viewer table names in CAPS
#BIND results to variables ?
$sth->bind_columns(undef, \$ID, \$NAME, \$USER, \$MAC);
##retrieve / return results
while( $sth->fetch() ) {
print "$ID, $NAME, $USER, $MAC\n";
}
$sth->finish();
$dbh->disconnect();
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE