db:execute context

Tomasz Rakowski <mourawi-/[email protected]> Sun, 12 Nov 2006 18:53:37 -0800 (PST)
Newsgroups gmane.text.xml.o-xml
Message-ID <[email protected]>
--===============2141554118==
Content-Type: multipart/alternative; boundary="0-347922243-1163386417=:67533"
Content-Transfer-Encoding: 7bit

--0-347922243-1163386417=:67533
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Hi,

I noticed that I can't access function parameters/variables inside db:exe=
cute statement:

    <o:function name=3D"Fun">
        <o:param name=3D"param1"/>
    <o:do>
          <o:variable name=3D"var1" select=3D"'value'"/>
            <db:execute connection=3D"db" sql=3D"SELECT * from table">
               =20
            I CAN'T ACCESS here parameter param1  and variable var1.

            </db:execute>
    </o:do>
    </o:function>=20

The only workaround I found was to include these parameters in SELECT sta=
tement :

    <o:function name=3D"Fun">
         <o:param name=3D"param1"/>
     <o:do>
           <o:variable name=3D"var1" select=3D"'value'"/>

                <o:variable name=3D"query">
                    SELECT attr1, attr2, ...  ,=20
                            <o:eval select=3D"$param1"/> as param1,  =20
                            <o:eval select=3D"$var11"/> as var1=20
                    FROM table
                </o:variable>
             <db:execute connection=3D"db" sql=3D"{$query}">
                =20
             NOW I CAN ACCESS here parameter param1  and variable var1.
=20
             </db:execute>
     </o:do>
     </o:function>=20
=20
Is there any more elegant workaround for this ?



Tomasz Rakowski


=20
---------------------------------
Check out the all-new Yahoo! Mail beta - Fire up a more powerful email an=
d get things done faster.
--0-347922243-1163386417=:67533
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Hi,<br><br>I noticed that I can't access function parameters/variables in=
side db:execute statement:<br><br>&nbsp;&nbsp;&nbsp; &lt;o:function name=3D=
"Fun"&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;o:param name=3D"pa=
ram1"/&gt;<br>&nbsp;&nbsp;&nbsp; &lt;o:do&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp=
; &nbsp;&nbsp;&nbsp; &lt;o:variable name=3D"var1" select=3D"'value'"/&gt;=
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;db:execu=
te connection=3D"db" sql=3D"SELECT * from table"&gt;<br>&nbsp;&nbsp;&nbsp=
; &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  <br>&nbsp;&nbsp;&nbsp; &nbsp;=
&nbsp;  &nbsp;&nbsp;  I CAN'T ACCESS here parameter param1&nbsp; and vari=
able var1.<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp=
; &lt;/db:execute&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/o:do&gt;<br>&nbsp;&nbsp;=
&nbsp; &lt;/o:function&gt; <br><br>The only workaround I found was to inc=
lude these parameters in SELECT statement :<br><br>&nbsp;&nbsp;&nbsp; &lt=
;o:function name=3D"Fun"&gt;<br> &nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;&nbsp; &lt;o:param name=3D"param1"/&gt;<br> &nbsp;&nbsp;&nbs=
p; &lt;o:do&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &lt;o:va=
riable name=3D"var1" select=3D"'value'"/&gt;<br><br>&nbsp;&nbsp;&nbsp; &n=
bsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &lt;o:variable name=3D"query"&gt;=
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;  &nbsp;&nbsp;  &nb=
sp;&nbsp;  SELECT attr1, attr2, ...&nbsp; , <br>&nbsp;&nbsp;&nbsp; &nbsp;=
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nb=
sp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;o:eval select=3D"$param1"/&gt; as =
param1,&nbsp;  <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbs=
p; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&=
nbsp; &lt;o:eval select=3D"$var11"/&gt; as var1 <br>&nbsp;&nbsp;&nbsp; &n=
bsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  FROM table<br>&nbsp=
;&nbsp;&nbsp; &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &lt;/o:variable&g=
t;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;&nbsp; &lt;db:execute connection=3D"db" sql=3D"{$query}"&gt;=
<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  <br> &n=
bsp;&nbsp;&nbsp; &nbsp;&nbsp;  &nbsp;&nbsp;  NOW I CAN ACCESS here parame=
ter param1&nbsp; and variable var1.<br> <br> &nbsp;&nbsp;&nbsp; &nbsp;&nb=
sp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/db:execute&gt;<br> &nbsp;&nbsp;&nbsp; &=
lt;/o:do&gt;<br> &nbsp;&nbsp;&nbsp; &lt;/o:function&gt; <br> <br>Is there=
 any more elegant workaround for this ?<br><br><br><br>Tomasz Rakowski<br=
><br><p>&#32;

<hr size=3D1>Check out <a href=3D"http://us.rd.yahoo.com/evt=3D43257/*htt=
p://advision.webevents.yahoo.com/mailbeta">the all-new Yahoo! Mail beta</=
a> - Fire up a more powerful email and get things done faster.
--0-347922243-1163386417=:67533--

--===============2141554118==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
o-xml mailing list
o-xml-zRfLyl9bSvv/[email protected]
http://lists.pingdynasty.com/mailman/listinfo/o-xml

--===============2141554118==--