★ wanayoo — archive 1999 http://www.php.net/manual/fr/function.ora-bind.phpNouvelle recherche | Portail wanayoo

PHP Home Page

Manual Table of Contents
Up to Oracle
Quick Reference
English version of this pageGerman version of this pageJapanese version of this pageItalian version of this pageHungarian version of this page
Oracle
* Ora_Bind
* Ora_Close
* Ora_ColumnName
* Ora_ColumnType
* Ora_Commit
* Ora_CommitOff
* Ora_CommitOn
* Ora_Error
* Ora_ErrorCode
* Ora_Exec
* Ora_Fetch
* Ora_GetColumn
* Ora_Logoff
* Ora_Logon
* Ora_Open
* Ora_Parse
* Ora_Rollback
Manual: Ora_Bind
View the source code for this pageSearch the site



Previous page
 Oracle
 Updated
Sun, 06 Aug 2000
Ora_Close 
Next page


Ora_Bind

(unknown)

Ora_Bind -- Lie une variable PHP à un paramètre Oracle.

Description

int ora_bind (int cursor, string PHP variable name, string SQL parameter name, int length [, int type])

ora_bind() retourne TRUE si la liaison a pu se faire, et sinon FALSE. Les erreurs sont accessibles avec les fonctions ora_error() et ora_errorcode().

Cette fonction lie une variable PHP avec un paramètre SQL. Le paramètre SQL doit être de la forme ":name". Avec l'option, vous pouvez choisir si le paramètre SQL est de type entrée/sortie (0, valeur par défaut), entrée seulement (1) ou sortie seulement (2). Comme dans PHP 3.0.1, vous pouvez respectivement utiliser les constantes ORA_BIND_INOUT, ORA_BIND_IN eet ORA_BIND_OUT plutôt que des nombres.

ora_bind() doit être appelée après la fonction ora_parse() et avant ora_exec(). Les valeurs d'entrées peuvent alors être fournies par assignation des variables PHP. Après la fonction ora_exec() les variables liées contiennent les valeurs de sorties, si elles sont disponibles. Par exemple :


<?php
ora_parse($curs, "declare tmp INTEGER; begin tmp := :in; :out := tmp; :x := 7.77; end;");
ora_bind($curs, "result", ":x", $len, 2);
ora_bind($curs, "input", ":in", 5, 1);
ora_bind($curs, "output", ":out", 5, 2);
$input = 765;
ora_exec($curs);
echo "Résultat: $result<BR>Sortie: $output<BR>Entrée: $input";
?>


User Contributed Notes: Ora_Bind


castle@ruc.dk
29-Dec-1999 10:50
ora_bind looks for the bind variables globally. If your are using ora_bind
from within a class you'll have to delcare the bind variables globally and reference them using eg. $GLOBAL["myVar"].



koos@kzdoos.xs4all.nl
07-Jan-2000 11:39
Passing variables of Oracle type 'DATE' will fail. Just convert them to a string with all the relevant details and convert it back when needed in Oracle, using TO_CHAR and TO_DATE calls in Oracle.


koos@kzdoos.xs4all.nl
28-Feb-2000 09:28
The Oracle parser doesn't like DOS line endings (cr/lf). Save as Unix file (lf line ending only).


 About Notes


Previous page
 Oracle
 Updated
Sun, 06 Aug 2000
Ora_Close 
Next page





Who's responsible for this?
Top of this page

Site
Hosting:



Located in
United States
Elements of this website are subject to copyright.
Questions about installing or using PHP should be directed to one of the mailing lists.
Only questions about the website should be directed to webmaster@php.net.