ocinewcursor
<<<
ocinewdescriptor ocinlogon
>>>

8.85 Oracle 8
8 Référence des fonctions
 Manuel PHP

Introduction
Pré-requis
Installation
Configuration à l'exécution
Types de ressources
Constantes pré-définies
Exemples
oci_bind_by_name
oci_cancel
oci_close
OCI-Collection->append
OCI-Collection->assign
OCI-Collection->assignElem
OCI-Collection->getElem
OCI-Collection->free
OCI-Collection->max
OCI-Collection->size
OCI-Collection->trim
oci_commit
oci_connect
oci_define_by_name
oci_error
oci_execute
oci_fetch_all
oci_fetch_array
oci_fetch_assoc
oci_fetch_object
oci_fetch_row
oci_fetch
oci_field_is_null
oci_field_name
oci_field_precision
oci_field_scale
oci_field_size
oci_field_type_raw
oci_field_type
descriptor->free
oci_free_statement
oci_internal_debug
lob->append
lob->close
oci_lob_copy
lob->eof
lob->erase
lob->export
lob->flush
lob->import
oci_lob_is_equal
lob->load
lob->read
lob->rewind
lob->save
lob->seek
lob->size
lob->tell
lob->truncate
lob->writeTemporary
lob->write
oci_new_collection
oci_new_connect
oci_new_cursor
oci_new_descriptor
oci_num_fields
oci_num_rows
oci_parse
oci_password_change
oci_pconnect
oci_result
oci_rollback
oci_server_version
oci_set_prefetch
oci_statement_type
ocibindbyname
ocicancel
ocicloselob
ocicollappend
ocicollassign
ocicollassignelem
ocicollgetelem
ocicollmax
ocicollsize
ocicolltrim
ocicolumnisnull
ocicolumnname
ocicolumnprecision
ocicolumnscale
ocicolumnsize
ocicolumntype
ocicolumntyperaw
ocicommit
ocidefinebyname
ocierror
ociexecute
ocifetch
ocifetchinto
ocifetchstatement
ocifreecollection
ocifreecursor
ocifreedesc
ocifreestatement
lob->getBuffering
ociinternaldebug
ociloadlob
ocilogoff
ocilogon
ocinewcollection
ocinewcursor
->ocinewdescriptor
ocinlogon
ocinumcols
ociparse
ociplogon
ociresult
ocirollback
ocirowcount
ocisavelob
ocisavelobfile
ociserverversion
lob->setBuffering
ocisetprefetch
ocistatementtype
ociwritelobtofile
ociwritetemporarylob

8.85.108 ocinewdescriptor()Initialise un nouveau pointeur de LOB/FILE Oracle

[ Exemples avec ocinewdescriptor ]   PHP 3>= 3.0.7, PHP 4 , PHP 5

OCI-Lob  ocinewdescriptor ( resource   connection , int   type )

ocinewdescriptor alloue l'espace nécessaire pour stocker un descripteur, ou un pointeur de LOB sur la connexion connection . Les valeurs acceptées pour type sont OCI_D_FILE , OCI_D_LOB et OCI_D_ROWID . Pour les pointeurs de LOB, les méthodes lob->load() , lob->save() et lob->savefile() sont associées avec le pointeur. Pour les pointeurs de type BFILE, seule la méthode lob->save() existe. Voyez le second exemple pour une illustration.

Exemple avec ocinewdescriptor

<?php   
    
/* Ce script est fait pour être appelé dans un formulaire HTML
     * Il attend les variables $user, $password, $table, $where, et $commitsize
     * Le script efface alors les lignes sélectionnées avec ROWID et valide
     * l'effacement après chaque groupe de $commitsize lignes.
     * (Utilisez avec prudence, car il n'y a pas d'annulation possible).
     */
    
$conn = OCILogon($user, $password);
    
$stmt = OCIParse($conn,"select rowid from $table $where");
    
$rowid = OCINewDescriptor($conn,OCI_D_ROWID);
    
OCIDefineByName($stmt,"ROWID",&$rowid);   
    
OCIExecute($stmt);
    while (
OCIFetch($stmt) ) {      
       
$nrows = OCIRowCount($stmt);
       
$delete = OCIParse($conn,"delete from $table where ROWID = :rid");
       
OCIBindByName($delete,":rid",&$rowid,-1,OCI_B_ROWID);
       
OCIExecute($delete);      
       print
"$nrows\n";
       if ( (
$nrows % $commitsize) == 0 ) {
           
OCICommit($conn);      
       }   
    }
    
$nrows = OCIRowCount($stmt);   
    print
"$nrows deleted...\n";
    
OCIFreeStatement($stmt);  
    
OCILogoff($conn);
?>
Exemple avec ocinewdescriptor

<?php   
    
/* Appel d'une procédure PL/SQL stockée qui prend un clobs
     * en entrée (PHP 4 >= 4.0.6).
     * Exemple de signature de procédure stockée PL/SQL :
     *
     * PROCEDURE save_data
     *   Nom de l'argument              Type                    In/Out Default?
     *   ------------------------------ ----------------------- ------ --------
     *   KEY                            NUMBER(38)              IN
     *   DATA                           CLOB                    IN
     *
     */

    
$conn = OCILogon($user, $password);
    
$stmt = OCIParse($conn, "begin save_data(:key, :data); end;");
    
$clob = OCINewDescriptor($conn, OCI_D_LOB);
    
OCIBindByName($stmt, ':key', $key);
    
OCIBindByName($stmt, ':data', $clob, -1, OCI_B_CLOB);
    
$clob->WriteTemporary($data);
    
OCIExecute($stmt, OCI_DEFAULT);
    
OCICommit($conn);
    
$clob->close();
    
$clob->free();
    
OCIFreeStatement($stmt);
?>
Note

Cette fonction a été renommée en oci_new_descriptor pour PHP version 5.0.0 et plus récent. Pour la compatibilité ascendante, ocinewdescriptor peut toujours être utilisée. Toutefois, elle est obsolète.

<< ocinewdescriptor >>
ocinewcursor Oracle 8 ocinlogon