Linux Oracle8なるものにちょっと触れてみました。
$SQL = "select * from dept";
$OraSession = new Win32::OLE 'OracleInProcServer.XOraSession' or die
"Failed!!\n";
$OraDatabase = $OraSession->OpenDatabase("LNXORA", "scott/tiger", 0);
$OraDynaset = $OraDatabase->CreateDynaset($SQL,0);
print "<TR>\n";
for ($i = 0; $i <= $OraDynaset->Fields->Count -1; $i++) {
print "<TD><B>";
$wk=$OraDynaset->Fields($i)->Name;
print "$wk";
print "</B></TD>\n";
}
print "</TR>\n";
while (!$OraDynaset->EOF()) {
print "<TR>\n";
for ($i = 0; $i <= $OraDynaset->Fields->Count
-1; $i++) {
print "<TD>";
$wk=$OraDynaset->Fields($i)->Value;
print "$wk";
print "</TD>\n";
}
print "</TR>\n";
$OraDynaset->MoveNext();
}
print <<END;
</TABLE>
</BODY>
</HTML>
END
exit;
下の画面は上記の実行結果です。