/
ocidefinebyname.xml
88 lines (80 loc) · 2.74 KB
/
ocidefinebyname.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?xml version="1.0" encoding="UTF-8"?>
<!-- splitted from ./it/functions/oci8.xml, last change in rev 1.1 -->
<!-- last change to 'ocidefinebyname' in en/ tree in rev 1.2 -->
<!-- EN-Revision: n/a Maintainer: cucinato Status: ready -->
<!-- OLD-Revision: 1.45/EN.1.2 -->
<refentry xml:id="function.ocidefinebyname" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>OCIDefineByName</refname>
<refpurpose>
Utilizza una variabile PHP per la fase di definizione in un comando SELECT
</refpurpose>
</refnamediv>
<refsect1>
<title>Descrizione</title>
<methodsynopsis>
<type>bool</type><methodname>ocidefinebyname</methodname>
<methodparam><type>int</type><parameter>stmt</parameter></methodparam>
<methodparam><type>string</type><parameter>Column-Name</parameter></methodparam>
<methodparam><type>mixed</type><parameter>variable</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>type</parameter></methodparam>
</methodsynopsis>
<para>
<function>ocidefinebyname</function> aggancia le variabili PHP ai
campi SQL. Attenzione: Oracle usa nomi di colonna MAIUSCOLI,
mentre nella SELECT si possono anche scrivere minuscoli.
<function>ocidefinebyname</function> vuole
il parametro <parameter>Column-Name</parameter> in caratteri maiuscoli. Se si
definisce una variabile che non esiste nel comando SELECT, non
viene dato alcun errore!
</para>
<para>
Se occorre definire un tipo di dati astratto (LOB/ROWID/BFILE)
lo si deve prima allocare usando la funzione
<function>OCINewDescriptor</function>. Vedere anche la
funzione <function>OCIBindByName</function>.
</para>
<example>
<title>OCIDefineByName</title>
<programlisting>
<![CDATA[
<?php
/* OCIDefineByName example - thies@thieso.net (980219) */
$conn = OCILogon("scott","tiger");
$stmt = OCIParse($conn,"select empno, ename from emp");
/* il define DEVE essere eseguito PRIMA di ociexecute! */
OCIDefineByName($stmt,"EMPNO",$empno);
OCIDefineByName($stmt,"ENAME",$ename);
OCIExecute($stmt);
while (OCIFetch($stmt)) {
echo "empno:".$empno."\n";
echo "ename:".$ename."\n";
}
OCIFreeStatement($stmt);
OCILogoff($conn);
?>
]]>
</programlisting>
</example>
</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:"~/.phpdoc/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
-->