note 16671 added to ref.oci8
| From: | 85276 at gmx dot net | Date: | Thu, 08 Nov 2001 16:16:14 +0000 |
| Subject: | note 16671 added to ref.oci8 | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-20606@lists.php.net to get a copy of this message | ||
<?
// offset and limit feature for oracle 8 database selects
$conn = OCILogon("user","pw","server.world");
$sql="
declare
type c_type is ref cursor;
c_data c_type;
c_null tab.row_id%type;
begin
open :c_data for
select row_id from tab order by row_id;
while :c_data%rowcount < :c_init loop
fetch :c_data into c_null;
end loop;
end;
";
$stmt=OCIParse($conn, $sql);
$curs=OCINewCursor($conn);
$offset=100; // dont fetch the first 100 rows
$limit=10; // we want exactly 10 rows
OCIBindByName($stmt,":c_init",$offset,32);
OCIBindByName($stmt,":c_data",$curs,-1,OCI_B_CURSOR);
OCIExecute($stmt);
OCIExecute($curs);
for ($i=0;$i<$limit&&OCIFetchinto($curs,$cols,OCI_ASSOC);$i++)
print $cols[ROW_ID]."\n";
OCIFreeStatement($stmt);
OCIFreeCursor($curs);
OCILogoff($conn);
?>
--
http://www.php.net/manual/en/ref.oci8.php
http://master.php.net/manage/user-notes.php?action=edit+16671
http://master.php.net/manage/user-notes.php?action=delete+16671
http://master.php.net/manage/user-notes.php?action=reject+16671