mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-20 02:48:56 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@146503 c90b9560-bf6c-de11-be94-00142212c4b1
77 lines
2.8 KiB
XML
77 lines
2.8 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.5 $ -->
|
|
<!-- splitted from ./en/functions/oracle.xml, last change in rev 1.2 -->
|
|
<refentry id="function.ora-bind">
|
|
<refnamediv>
|
|
<refname>ora_bind</refname>
|
|
<refpurpose>Binds a PHP variable to an Oracle parameter</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>ora_bind</methodname>
|
|
<methodparam><type>resource</type><parameter>cursor</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>PHP_variable_name</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>SQL_parameter_name</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>length</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>type</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
This function binds the named PHP variable with a SQL parameter.
|
|
The SQL parameter must be in the form ":name". With the optional
|
|
type parameter, you can define whether the SQL parameter is an
|
|
in/out (0, default), in (1) or out (2) parameter. As of PHP
|
|
3.0.1, you can use the constants ORA_BIND_INOUT, ORA_BIND_IN and
|
|
ORA_BIND_OUT instead of the numbers.
|
|
</para>
|
|
<para>
|
|
&return.success; Details about the error can be retrieved using the
|
|
<function>ora_error</function> and <function>ora_errorcode</function>
|
|
functions.
|
|
</para>
|
|
<para>
|
|
<function>ora_bind</function> must be called after <function>ora_parse</function>
|
|
and before <function>ora_exec</function>. Input values can be given
|
|
by assignment to the bound PHP variables, after calling
|
|
<function>ora_exec</function> the bound PHP variables contain the output
|
|
values if available.
|
|
<example>
|
|
<title><function>ora_bind</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?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 "Result: $result<br />Out: $output<br />In: $input";
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|