use Win32::ODBC;

# Make a connection with Win32::ODBC
#
$dbh = new Win32::ODBC("DSN=BJEPSON_MSSQL;UID=bjepson;PWD=secret");
if (!$dbh) {
  die "An ODBC error occurred"
}

# Issue an SQL statement.
$rv = $dbh->Sql("SELECT * FROM individual");
if ($rv != 0) {
  die "SQL Error: " . $dbh->Error;
}

# Retrieve the results.
while ($dbh->FetchRow) {

  $first_name    = $dbh->Data(first_name);
  $last_name     = $dbh->Data(last_name);
  $favorite_food = $dbh->Data(favorite_food);

  print "$first_name $last_name enjoys $favorite_food.\n";
}

# Clean up
$dbh->Close();

# Connect to Oracle with DBI.
# DBI connect() args: "DBI:Oracle:host=HOSTNAME;sid=SID", username,
   password $dbh = DBI->cibbect("DBI:Oracle:host=localhost;sid=ORCL",
   "scott", "tiger");