2002-04-15 00:12:54 +00:00
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
2007-02-06 01:46:48 +00:00
|
|
|
<!-- $Revision: 1.7 $ -->
|
2007-02-06 01:46:33 +00:00
|
|
|
<refentry id="function.ora-bind">
|
|
|
|
<refnamediv>
|
|
|
|
<refname>ora_bind</refname>
|
|
|
|
<refpurpose>Binds a PHP variable to an Oracle parameter</refpurpose>
|
|
|
|
</refnamediv>
|
2007-02-06 01:46:48 +00:00
|
|
|
|
|
|
|
<refsect1 role="description">
|
|
|
|
&reftitle.description;
|
2007-02-06 01:46:33 +00:00
|
|
|
<methodsynopsis>
|
|
|
|
<type>bool</type><methodname>ora_bind</methodname>
|
|
|
|
<methodparam><type>resource</type><parameter>cursor</parameter></methodparam>
|
2007-02-06 01:46:48 +00:00
|
|
|
<methodparam><type>string</type><parameter>phpvar</parameter></methodparam>
|
|
|
|
<methodparam><type>string</type><parameter>sqlparam</parameter></methodparam>
|
2007-02-06 01:46:33 +00:00
|
|
|
<methodparam><type>int</type><parameter>length</parameter></methodparam>
|
|
|
|
<methodparam choice="opt"><type>int</type><parameter>type</parameter></methodparam>
|
|
|
|
</methodsynopsis>
|
|
|
|
<para>
|
2007-02-06 01:46:48 +00:00
|
|
|
Binds the named PHP variable with a SQL parameter.
|
2007-02-06 01:46:33 +00:00
|
|
|
</para>
|
2007-02-06 01:46:48 +00:00
|
|
|
<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.
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="parameters">
|
|
|
|
&reftitle.parameters;
|
|
|
|
<para>
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>cursor</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
An Oracle cursor, opened with <function>ora_open</function>.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>phpvar</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The PHP variable to be bound.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>sqlparam</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The SQL parameter. Must be in the form <literal>:name</literal>.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>length</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>type</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Defines the type of the parameter. It defaults to
|
|
|
|
<constant>ORA_BIND_INOUT</constant>. Possible values are listed below:
|
|
|
|
<informaltable>
|
|
|
|
<tgroup cols="2">
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Constant</entry>
|
|
|
|
<entry>Value</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><constant>ORA_BIND_INOUT</constant></entry>
|
|
|
|
<entry>0</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><constant>ORA_BIND_IN</constant></entry>
|
|
|
|
<entry>1</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><constant>ORA_BIND_OUT</constant></entry>
|
|
|
|
<entry>2</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</informaltable>
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="returnvalues">
|
|
|
|
&reftitle.returnvalues;
|
2007-02-06 01:46:33 +00:00
|
|
|
<para>
|
|
|
|
&return.success; Details about the error can be retrieved using the
|
|
|
|
<function>ora_error</function> and <function>ora_errorcode</function>
|
|
|
|
functions.
|
|
|
|
</para>
|
2007-02-06 01:46:48 +00:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="changelog">
|
|
|
|
&reftitle.changelog;
|
|
|
|
<para>
|
|
|
|
<informaltable>
|
|
|
|
<tgroup cols="2">
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>&Version;</entry>
|
|
|
|
<entry>&Description;</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry>3.0.1</entry>
|
|
|
|
<entry>
|
|
|
|
The constants for the <parameter>type</parameter> were added.
|
|
|
|
In previous versions, you should use the numerical values.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</informaltable>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="examples">
|
|
|
|
&reftitle.examples;
|
2007-02-06 01:46:33 +00:00
|
|
|
<para>
|
|
|
|
<example>
|
|
|
|
<title><function>ora_bind</function> example</title>
|
|
|
|
<programlisting role="php">
|
2002-04-15 00:12:54 +00:00
|
|
|
<![CDATA[
|
|
|
|
<?php
|
2003-05-17 13:32:13 +00:00
|
|
|
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);
|
2003-12-15 16:55:22 +00:00
|
|
|
echo "Result: $result<br />Out: $output<br />In: $input";
|
2002-04-15 00:12:54 +00:00
|
|
|
?>
|
|
|
|
]]>
|
2007-02-06 01:46:33 +00:00
|
|
|
</programlisting>
|
|
|
|
</example>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
2007-02-06 01:46:48 +00:00
|
|
|
|
2007-02-06 01:46:33 +00:00
|
|
|
</refentry>
|
2002-04-15 00:12:54 +00:00
|
|
|
|
|
|
|
<!-- 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
|
|
|
|
-->
|