note 68022 added to function.oci-lob-load
| From: | thimenon at hotmail dot com | Date: | Mon, 10 Jul 2006 15:16:52 +0000 |
| Subject: | note 68022 added to function.oci-lob-load | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-114640@lists.php.net to get a copy of this message | ||
Bom,
Um exemplo simples de como utilizar a função lob->load();
em uma tabela qualquer com um campo do tipo CLOB, em um banco de dados 8i, que não tem suporte
para retornar o valor pela funcao ociresult(). Pois no ORACLE 8i a funcao ociResult() retorna um
OBJECT, entao devo utilizar a funcao load() para retornar o valor.
EXEMPLO PARA BANCO ORACLE 8i e 9i.
TABELA
ID number
CAMPO CLOB
$sql = "SELECT ID, CAMPO FROM TABELA";
$sql = ociParse($conn, $sql);
ociExecute($sql, OCI_DEFAULT);
if (ociFetch($sql))
{
print "id: ".ociResult($sql, 'ID')."<br>";
$vCLOB = ociResult($sql, 'CAMPO');
print is_object($vCLOB)?$vCLOB->load():$vCLOB;
}
Esperto ter ajudado
Thiago Menon
msn: thimenon@hotmail.com
----
Server IP: 200.185.109.103
Probable Submitter: 200.186.96.138
----
X-Spam-Status: Yes, hits=8.3 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER,
HEAD_ILLEGAL_CHARS,HTML_MESSAGE,UPPERCASE_25_50 autolearn=no
version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.oci-lob-load.php
Edit -- http://master.php.net/note/edit/68022
Del: integrated -- http://master.php.net/note/delete/68022/integrated
Del: useless -- http://master.php.net/note/delete/68022/useless
Del: bad code -- http://master.php.net/note/delete/68022/bad+code
Del: spam -- http://master.php.net/note/delete/68022/spam
Del: non-english -- http://master.php.net/note/delete/68022/non-english
Del: in docs -- http://master.php.net/note/delete/68022/in+docs
Del: other reasons-- http://master.php.net/note/delete/68022
Reject -- http://master.php.net/note/reject/68022
Search -- http://master.php.net/manage/user-notes.php