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 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2018 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
-->
<refentry id="fn_exec_result">
<refmeta>
<refentrytitle>exec_result</refentrytitle>
<refmiscinfo>sql</refmiscinfo>
</refmeta>
<refnamediv>
<refname>exec_result</refname>
<refpurpose>Returns a result set row to the calling procedure context</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="fsyn_exec_result">
<funcprototype id="fproto_exec_result">
<funcdef>any <function>exec_result</function></funcdef>
<paramdef>in <parameter>res_values_array</parameter> any</paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="desc_exec_result">
<title>Description</title>
<para>This function returns a result set row to the calling procedure's context, whether it is
the client, exec function or a procedure view). The row's values are the elements of the supplied
res_values_array vector.</para>
</refsect1>
<refsect1 id="params_exec_result"><title>Parameters</title>
<refsect2><title>res_values_array</title>
<para>This parameter can be one of two things:</para>
<simplelist>
<member>a vector of strings (like vector('cola', 'colbb')).
When used that way it makes columns named 'cola' and 'colb' with type ANY and
precision 256</member>
<member>an array with the same format as the 0th element of the metadata
returned by <function>exec()</function> and <function>rexec()</function>,
which contains all the type information and can be used directly.</member>
</simplelist></refsect2>
</refsect1>
<refsect1 id="ret_exec_result"><title>Return Types</title>
<para>The row's values are the elements of the supplied
res_values_array vector. For example:
<computeroutput>exec_result (vector (1, 'a'))</computeroutput> will return a row of two columns:
1 and 'a'. This is similar to the <function>result()</function> function, but it uses an array instead of
parameter list</para>
</refsect1>
<!--
<refsect1 id="errors_exec_result">
<title>Errors</title>
<para>This function can generate the following errors:</para>
<errorcode></errorcode>
</refsect1>
-->
<refsect1 id="examples_exec_result">
<title>Examples</title>
<example id="ex_exec_result_names"><title>Result set rows</title>
<screen><![CDATA[
create procedure XX1 ()
{
declare meta, _dt any;
declare inx integer;
exec ('select U_ID, U_NAME from SYS_USERS', null, null, null, 0, meta, _dt);
inx := 0;
exec_result_names (meta[0]);
while (inx < length (_dt))
{
exec_result (_dt[inx]);
inx := inx + 1;
}
};
]]>
</screen>
</example>
</refsect1>
<refsect1 id="seealso_exec_result">
<title>See Also</title>
<para><link linkend="fn_exec"><function>exec()</function></link></para>
<para><link linkend="fn_rexec"><function>rexec()</function></link></para>
<para><link linkend="fn_exec_result_names"><function>exec_result_names()</function></link></para>
<para><link linkend="fn_result_names"><function>result_names()</function></link></para>
</refsect1>
</refentry>
|