Hi,

So I got my jdbc query to work
Now I just need to get the Query result into a usable variable.

This is my result and attempted Xpath expression:

> DirXML Log Event -------------------
> Driver: \ATIDM\system\Driver Set\AT-IREG
> Channel: Subscriber
> Object: \ATIDM\data\users\Personal\ltest2
> Status: Success
> [08/31/15 14:02:16.195]:AT-IREG ST: Direct command from
> policy result
> [08/31/15 14:02:16.195]:AT-IREG ST:
> <nds dtdversion="2.0" ndsversion="8.x" xmlns:jdbc="urn:dirxml:jdbc">
> <source>
> <product build="20150417_0410" instance="AT-IREG"
> version="4.0.1.0">DirXML Driver for JDBC</product>
> <contact>NetIQ Corporation</contact>
> </source>
> <output>
> <status level="warning">Child table 'Picture' should have 1 syncable
> column(s) instead of 2.<application>DirXML</application>
> <module>AT-IREG</module>
> <object-dn>\ATIDM\data\users\Personal\ltest2</object-dn>
> <component>Subscriber</component>
> </status>
> <status level="warning">Child table 'Phone' should have 1 syncable
> column(s) instead of 4.<application>DirXML</application>
> <module>AT-IREG</module>
> <object-dn>\ATIDM\data\users\Personal\ltest2</object-dn>
> <component>Subscriber</component>
> </status>
> <status level="warning">Child table 'Organization' should have 1
> syncable column(s) instead of 4.<application>DirXML</application>
> <module>AT-IREG</module>
> <object-dn>\ATIDM\data\users\Personal\ltest2</object-dn>
> <component>Subscriber</component>
> </status>
> <status level="warning">Child table 'Activity' should have 1
> syncable column(s) instead of 8.<application>DirXML</application>
> <module>AT-IREG</module>
> <object-dn>\ATIDM\data\users\Personal\ltest2</object-dn>
> <component>Subscriber</component>
> </status>
> <status level="warning">Child table 'Address' should have 1 syncable
> column(s) instead of 9.<application>DirXML</application>
> <module>AT-IREG</module>
> <object-dn>\ATIDM\data\users\Personal\ltest2</object-dn>
> <component>Subscriber</component>
> </status>
> <status level="warning">Child table 'Email' should have 1 syncable
> column(s) instead of 5.<application>DirXML</application>
> <module>AT-IREG</module>
> <object-dn>\ATIDM\data\users\Personal\ltest2</object-dn>
> <component>Subscriber</component>
> </status>
> <status level="warning">Child table 'SklEmployee' should have 1
> syncable column(s) instead of 15.<application>DirXML</application>
> <module>AT-IREG</module>
> <object-dn>\ATIDM\data\users\Personal\ltest2</object-dn>
> <component>Subscriber</component>
> </status>
> <status level="warning">Child table 'Contact' should have 1 syncable
> column(s) instead of 3.<application>DirXML</application>
> <module>AT-IREG</module>
> <object-dn>\ATIDM\data\users\Personal\ltest2</object-dn>
> <component>Subscriber</component>
> </status>
> <status level="warning">Child table 'ActivityMembership' should have
> 1 syncable column(s) instead of 8.<application>DirXML</application>
> <module>AT-IREG</module>
> <object-dn>\ATIDM\data\users\Personal\ltest2</object-dn>
> <component>Subscriber</component>
> </status>
> <jdbc:result-set event-id="0" jdbc:number-of-rows="1">
> <jdbc:row jdbc:number="1">
> <jdbc:column jdbc:name="MAXID" jdbcosition="1"
> jdbc:type="java.sql.Types.INTEGER">
> <jdbc:value>72301</jdbc:value>
> </jdbc:column>
> </jdbc:row>
> </jdbc:result-set>
> <status event-id="0" level="success">
> <application>DirXML</application>
> <module>AT-IREG</module>
> <object-dn>\ATIDM\data\users\Personal\ltest2</object-dn>
> <component>Subscriber</component>
> </status>
> </output>
> </nds>
> [08/31/15 14:02:16.195]:AT-IREG ST: Token Value: {/}.
> [08/31/15 14:02:16.195]:AT-IREG ST: Arg Value: {/}.
> [08/31/15 14:02:16.195]:AT-IREG ST: Evaluating selection criteria for
> rule 'Query Result'.
> [08/31/15 14:02:16.195]:AT-IREG ST: Rule selected.
> [08/31/15 14:02:16.195]:AT-IREG ST: Applying rule 'Query Result'.
> [08/31/15 14:02:16.195]:AT-IREG ST: Action:
> do-set-local-variable("queryResult",scope="policy",token-xpath("jdbc:result-set/jdbc:row/jdbc:column/jdbc:value/text()")).
> [08/31/15 14:02:16.195]:AT-IREG ST:
> arg-string(token-xpath("jdbc:result-set/jdbc:row/jdbc:column/jdbc:value/text()"))
> [08/31/15 14:02:16.195]:AT-IREG ST:
> token-xpath("jdbc:result-set/jdbc:row/jdbc:column/jdbc:value/text()")
> [08/31/15 14:02:16.195]:AT-IREG ST: Token Value: "".
> [08/31/15 14:02:16.195]:AT-IREG ST: Arg Value: "".
>


What I want it to get 72301 in a variable but I seem to get {/} back as
a token.

This is my original query code:
> <rule>
> <description>Query SQL to see last available nr</description>
> <conditions>
> <and/>
> </conditions>
> <actions>
> <do-set-local-variable name="lv_SQLquery" scope="policy">
> <arg-string>
> <token-text xml:space="preserve">SELECT MAX(Id) </token-text>
> <token-text xml:space="preserve">AS MAXID </token-text>
> <token-text xml:space="preserve">FROM </token-text>
> <token-text xml:space="preserve">dbo.Person</token-text>
> </arg-string>
> </do-set-local-variable>
> <do-set-local-variable name="lvQuery" scope="policy">
> <arg-node-set>
> <token-xml-parse notrace="true">
> <token-text notrace="true" xml:space="preserve">
> &lt;input xmlns:jdbc="urn:dirxml:jdbc">
> &lt;jdbc:statement jdbc:type="query">
> &lt;jdbc:sql/>
> &lt;/jdbc:statement>
> &lt;/input>
> </token-text>
> </token-xml-parse>
> </arg-node-set>
> </do-set-local-variable>
> <do-append-xml-text expression="$lvQuery//jdbc:statement/jdbc:sql">
> <arg-string>
> <token-local-variable name="lv_SQLquery"/>
> </arg-string>
> </do-append-xml-text>
> <do-trace-message>
> <arg-string>
> <token-xml-serialize notrace="true">
> <token-local-variable name="lvQuery" notrace="true"/>
> </token-xml-serialize>
> </arg-string>
> </do-trace-message>
> <do-set-local-variable name="lvExecute" scope="policy">
> <arg-node-set>
> <token-xpath
> expression="cmd:execute($destCommandProcessor,$lvQ uery)"/>
> </arg-node-set>
> </do-set-local-variable>
> </actions>
> </rule>
>



--
joakim_ganse
------------------------------------------------------------------------
joakim_ganse's Profile: https://forums.netiq.com/member.php?userid=159
View this thread: https://forums.netiq.com/showthread.php?t=54202