RE: [PHP] call a package of oracle in PHP
| From: | Tim Parkin | Date: | Fri, 20 Oct 2000 09:22:06 +0000 |
| Subject: | RE: [PHP] call a package of oracle in PHP | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-21356@lists.php.net to get a copy of this message | ||
heres an example of a package with normal and clob types
function
get_category_contents($client_id,$category_id,$titles_per_page,$page_no,$cn,
$debug) {
$cur = ocinewcursor($cn);
// Package call
$sql = "BEGIN dp_media_title_select.get_client_titles_w_contribs(";
$sql .= " pclient_id => :client_id,";
$sql .= " pcategory_id => :category_id,";
$sql .= " porder => dp_media_title_select.cby_title,"; // this is a
1/0 flag reffered from the table
$sql .= " presults => :results";
$sql .= ");";
$sql .= "END;";
$stmt = ociparse($cn, $sql);
// Bind variables to be used
ocibindbyname($stmt, "client_id", $client_id, 38);
ocibindbyname($stmt, "category_id", $category_id, 38);
ocibindbyname($stmt, "results", $cur, -1, OCI_B_CURSOR); // results
stores evrything (as defined in package)
// Execute the package
ociexecute($stmt);
ociexecute($cur); //dont' forget the second execute on the cursor ..
don't know why
//Loop through the cursor, retrieving results into an array and
process array
$elements = 0;
while ($elements < $no_title_to_return && ocifetchinto($cur, &$data)
) {
if ($elements >= $start_assigning_at) {
$this->media_id[$elements] = $data[0];
$this->media_title[$elements] = $data[1];
$this->media_description[$elements] = $data[2]->load(); // this is a
clob object ..
$this->media_coverprice[$elements] = $data[3];
$this->media_cname[$elements] = $data[4];
$this->media_cdate[$elements] = $data[5];
$this->media_publisher[$elements] = $data[6];
$this->media_avg_review[$elements] = $data[7];
$this->media_coverscan[$elements] = $data[8];
$this->author_id[$elements] = $data[9];
$this->author_name[$elements] = $data[10];
$this->narrator_id[$elements] = $data[11];
$this->narrator_name[$elements] = $data[12];
}
$elements++;
}
return $elements;
}
-----Original Message-----
From: Joe Wang [mailto:joewong_hu@21cn.com]
Sent: Friday, October 20, 2000 05:18
Cc: php-general@lists.php.net
Subject: [PHP] call a package of oracle in PHP
Hi all,
Anybody knows how to call a packege of oracle when using php ?
Best regards !
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net