From j-users-return-7288-apmail-xalan-j-users-archive=xalan.apache.org@xalan.apache.org Thu Dec 20 08:23:36 2012 Return-Path: X-Original-To: apmail-xalan-j-users-archive@www.apache.org Delivered-To: apmail-xalan-j-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9B3CEDF21 for ; Thu, 20 Dec 2012 08:23:36 +0000 (UTC) Received: (qmail 54062 invoked by uid 500); 20 Dec 2012 08:23:36 -0000 Delivered-To: apmail-xalan-j-users-archive@xalan.apache.org Received: (qmail 53809 invoked by uid 500); 20 Dec 2012 08:23:35 -0000 Mailing-List: contact j-users-help@xalan.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list j-users@xalan.apache.org Received: (qmail 53755 invoked by uid 99); 20 Dec 2012 08:23:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Dec 2012 08:23:33 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of cdbruun@flyingpigs.dk designates 37.75.161.45 as permitted sender) Received: from [37.75.161.45] (HELO mail.flyingpigs.dk) (37.75.161.45) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Dec 2012 08:23:28 +0000 Received: from [192.168.136.9] (s20.callis.dk [192.168.136.9]) by mail.flyingpigs.dk (Postfix) with ESMTPSA id 70D2E8C195; Thu, 20 Dec 2012 09:23:06 +0100 (CET) Message-ID: <50D2C978.1080509@flyingpigs.dk> Date: Thu, 20 Dec 2012 09:16:56 +0100 From: Christoffer Bruun User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: j-users@xalan.apache.org Subject: Re: Sql extension - parameterized query References: <7AE554A17B4ECB449C6EA79DAA4DD4886281BD29D1@FSPAS01EV010.fspa.myntet.se> In-Reply-To: <7AE554A17B4ECB449C6EA79DAA4DD4886281BD29D1@FSPAS01EV010.fspa.myntet.se> Content-Type: multipart/alternative; boundary="------------090307020705000000050508" X-Virus-Checked: Checked by ClamAV on apache.org This is a multi-part message in MIME format. --------------090307020705000000050508 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi, I have no direct expericence with the Sql extension, but I think you should use - 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: > > > > SPI01 > > 0000004016 > > > > And, in the stylesheet have the following code: > > > > > > > > > > > --------------090307020705000000050508 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
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)"/>



--------------090307020705000000050508--