xalan-j-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christoffer Bruun <cdbr...@flyingpigs.dk>
Subject Re: Sql extension - parameterized query
Date Thu, 20 Dec 2012 08:16:56 GMT
Hi,

I have no direct expericence with the Sql extension, but I think you 
should use
<xsl:variable name="qparam" select="//QUERY*/**"/>
- otherwise it may assume that you want to add only 1 parameter (the 1 
QUERY element) with a text value of SPI010000004016

Best regards
Christoffer Bruun


Den 20-12-2012 09:02, lars.bjerges@swedbank.se skrev:
> ...

> What I would like to do is to have  a xml fragment containing the 
> parameter values:
>
> <QUERY>
>
> <KOD_TXT_GRP>SPI01</KOD_TXT_GRP>
>
> <KODTXT>0000004016</KODTXT>
>
> </QUERY>
>
> And, in the stylesheet have the following code:
>
> <xsl:param name="q1" select="'SELECT HANDAT,VALFRI_TEXT_RAD FROM 
> DB2T.SPATTXT WHERE KOD_TXT_GRP = ? AND KODTXT = ?'"/>
>
> <xsl:variable name="qparam" select="//QUERY"/>
>
> <xsl:value-of select="sql:addParameterFromElement($db,$qparam)"/>
>
> <xsl:param name="q1type" select="'string,string'"/>
>
> <xsl:variable name="table" select="sql:pquery($db,$q1,$q1type)"/>
>



Mime
View raw message