ВУЗ:
Составители:
Рубрика:
133
array("no", "N", 7, 2)
);
$dbid = dbase_create($dbname, $def);
if (!$dbid) echo "Failed to open dbf.";
$c = OCILogon("system", "dimakom", "uml");
$s = OCIParse($c, "select aname,
id_act from W_ACTOR");
OCIExecute($s, OCI_DEFAULT);
while (OCIFetch($s)) {
$rec[1] = ociresult($s, "ANAME");
$rec[2] = ociresult($s, "ID_ACT");
if (!dbase_add_record($dbid,
array($rec[1],$rec[2])))
echo "Failed to add a record. ";
}
OCILogoff($c);
?>
Done.
<hr/>
</body>
</html>
Результат
Distant data transfer from Oracle to dbf:
Done.
Листинг 17. Выполнение Select
<?php
if ($c = ora_logon("system@uml","dimakom")) {
$curs = ora_do($c, "SELECT ID_ACT, ANAME FROM
W_ACTOR");
while (ora_fetch($curs)) {
echo "ID = " . ora_getcolumn($curs, 0) .
", ACTOR = " . ora_getcolumn($curs, 1) .
"<br/>";
}
ora_logoff($c);
} else {
echo "Oracle Connect Error " . ora_error();
}
?>
133 array("no", "N", 7, 2) ); $dbid = dbase_create($dbname, $def); if (!$dbid) echo "Failed to open dbf."; $c = OCILogon("system", "dimakom", "uml"); $s = OCIParse($c, "select aname, id_act from W_ACTOR"); OCIExecute($s, OCI_DEFAULT); while (OCIFetch($s)) { $rec[1] = ociresult($s, "ANAME"); $rec[2] = ociresult($s, "ID_ACT"); if (!dbase_add_record($dbid, array($rec[1],$rec[2]))) echo "Failed to add a record. "; } OCILogoff($c); ?> Done.