Hello,

I'm having an interesting, and not wanted, result in a rule where I
need to add jdbc statements. I do can build the jdbc statements
correctly, but the problem is in the content of the statements.

I'll try to explain: I have a GCV (mrsCdAplcWeb) with 4 values (75,
75003, 82, 82001) and I need to mount a sql statement for each of these.

I did a loop of the size of the gcv (in my case: 4).

I set a local variable, using xpath to retrieve each of the values of
the gcv and build the sql statement. I trace the resulting local
variable and it shows up correctly:
SELECT PK_CD_APLC_WEB FROM ADM_IST.IST_USUA_APLC_WEB_IDM WHERE
PK_CD_USUA='99000002' and PK_CD_APLC_WEB='75'
SELECT PK_CD_APLC_WEB FROM ADM_IST.IST_USUA_APLC_WEB_IDM WHERE
PK_CD_USUA='99000002' and PK_CD_APLC_WEB='75003'
SELECT PK_CD_APLC_WEB FROM ADM_IST.IST_USUA_APLC_WEB_IDM WHERE
PK_CD_USUA='99000002' and PK_CD_APLC_WEB='82'
SELECT PK_CD_APLC_WEB FROM ADM_IST.IST_USUA_APLC_WEB_IDM WHERE
PK_CD_USUA='99000002' and PK_CD_APLC_WEB='82001'

I add an xml element for each of the sql statements I will have as
result:
<do-append-xml-element expression="./../jdbc:statement"
name="jdbc:sql"/>

Then I add a xml text with the local variable containing the sql
statement
do-append-xml-text
expression="./../jdbc:statement/jdbc:sql[$vCdAplcCount]">

The problem I'm having is that when I use the local variable inside the
while loop to fill the sql statement the resulting xml document shows
the jdbc statements like this (which is not correct).
<jdbc:statement jdbc:transaction-id="4"
jdbc:transaction-type="manual" jdbc:type="update"
xmlns:jdbc="urn:dirxml:jdbc" xmlns:jdbc-1="urn:dirxml:jdbc"
xmlns:jdbc-2="urn:dirxml:jdbc" xmlns:jdbc-3="urn:dirxml:jdbc"
xmlns:jdbc-4="urn:dirxml:jdbc">
<jdbc:sql>SELECT PK_CD_APLC_WEB FROM
ADM_IST.IST_USUA_APLC_WEB_IDM WHERE PK_CD_USUA='99000002' and
PK_CD_APLC_WEB='75'SELECT PK_CD_APLC_WEB FROM
ADM_IST.IST_USUA_APLC_WEB_IDM WHERE PK_CD_USUA='99000002' and
PK_CD_APLC_WEB='75003'SELECT PK_CD_APLC_WEB FROM
ADM_IST.IST_USUA_APLC_WEB_IDM WHERE PK_CD_USUA='99000002' and
PK_CD_APLC_WEB='82'SELECT PK_CD_APLC_WEB FROM
ADM_IST.IST_USUA_APLC_WEB_IDM WHERE PK_CD_USUA='99000002' and
PK_CD_APLC_WEB='82001'</jdbc:sql>
<jdbc:sql>SELECT PK_CD_APLC_WEB FROM
ADM_IST.IST_USUA_APLC_WEB_IDM WHERE PK_CD_USUA='99000002' and
PK_CD_APLC_WEB='75003'SELECT PK_CD_APLC_WEB FROM
ADM_IST.IST_USUA_APLC_WEB_IDM WHERE PK_CD_USUA='99000002' and
PK_CD_APLC_WEB='82'SELECT PK_CD_APLC_WEB FROM
ADM_IST.IST_USUA_APLC_WEB_IDM WHERE PK_CD_USUA='99000002' and
PK_CD_APLC_WEB='82001'</jdbc:sql>
<jdbc:sql>SELECT PK_CD_APLC_WEB FROM
ADM_IST.IST_USUA_APLC_WEB_IDM WHERE PK_CD_USUA='99000002' and
PK_CD_APLC_WEB='82'SELECT PK_CD_APLC_WEB FROM
ADM_IST.IST_USUA_APLC_WEB_IDM WHERE PK_CD_USUA='99000002' and
PK_CD_APLC_WEB='82001'</jdbc:sql>
<jdbc:sql>SELECT PK_CD_APLC_WEB FROM
ADM_IST.IST_USUA_APLC_WEB_IDM WHERE PK_CD_USUA='99000002' and
PK_CD_APLC_WEB='82001'</jdbc:sql>
</jdbc:statement>

In the first jdbc:sql I have all the four sql statements;
In the second, the 3 left sql statements;
In the third, the 2 left sql statements;
In the fourth, the last sql statements.

The tricky here, is that all is done in the same loop (trace the local
variable and filling the jdbc statement). So, why when I trace the local
variables they shows up correctly, but my jdbc statements are build
wrongly when I add them?

The reason I did all of this, is because I will need to add more values
to the gcv, and I don't want to edit my rule every time with fixec
values.

Please, can someone help me on this?

Thanks!!


--
beniciash
------------------------------------------------------------------------
beniciash's Profile: http://forums.novell.com/member.php?userid=79578
View this thread: http://forums.novell.com/showthread.php?t=439496