From j-users-return-7290-apmail-xalan-j-users-archive=xalan.apache.org@xalan.apache.org Thu Dec 20 12:55:58 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 F2941D1C7 for ; Thu, 20 Dec 2012 12:55:58 +0000 (UTC) Received: (qmail 13280 invoked by uid 500); 20 Dec 2012 12:55:58 -0000 Delivered-To: apmail-xalan-j-users-archive@xalan.apache.org Received: (qmail 13254 invoked by uid 500); 20 Dec 2012 12:55:58 -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 13237 invoked by uid 99); 20 Dec 2012 12:55:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Dec 2012 12:55:58 +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 (nike.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 12:55:51 +0000 Received: from [192.168.136.9] (s20.callis.dk [192.168.136.9]) by mail.flyingpigs.dk (Postfix) with ESMTPSA id EBB228C190; Thu, 20 Dec 2012 13:55:30 +0100 (CET) Message-ID: <50D3094F.1060001@flyingpigs.dk> Date: Thu, 20 Dec 2012 13:49:19 +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> <50D2C978.1080509@flyingpigs.dk> <7AE554A17B4ECB449C6EA79DAA4DD4886281BD2FD9@FSPAS01EV010.fspa.myntet.se> In-Reply-To: <7AE554A17B4ECB449C6EA79DAA4DD4886281BD2FD9@FSPAS01EV010.fspa.myntet.se> Content-Type: multipart/alternative; boundary="------------080703050607020508040902" X-Virus-Checked: Checked by ClamAV on apache.org This is a multi-part message in MIME format. --------------080703050607020508040902 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Den 20-12-2012 13:47, lars.bjerges@swedbank.se skrev: > > Well, I'm sorry to say that it does not work for me, I get: > > file:///C:/xalan-j_2_7_0/samples/extensions/sql/pquery/dbtest.xsl; > Line #41; Column #70; java.sql.SQLException: At least one parameter to > the current statement is uninitialized. > > file:///C:/xalan-j_2_7_0/samples/extensions/sql/pquery/dbtest.xsl; > Line #51; Column #25; Error in Query > > When fiddling around however it seems that there is something amiss in > the use of: > > > > > That won't work since select will try to evaluate int as an xpath query You should use: int > Whenever I try to make a list, e.g. "int,string" (which would be a > proper CSV list to my understanding) I get: > > javax.xml.transform.TransformerException: > javax.xml.transform.TransformerException: Ytterligare otillåtna > tecken: ',', 'string' > > which is OK so I try to do an alternate pquery invocation: > > , I get: > --------------080703050607020508040902 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit

Den 20-12-2012 13:47, lars.bjerges@swedbank.se skrev:

Well, I’m sorry to say that it does not work for me, I get:

file:///C:/xalan-j_2_7_0/samples/extensions/sql/pquery/dbtest.xsl; Line #41; Column #70; java.sql.SQLException: At least one parameter to the current statement is uninitialized.

file:///C:/xalan-j_2_7_0/samples/extensions/sql/pquery/dbtest.xsl; Line #51; Column #25; Error in Query

 

When fiddling around however it seems that there is something amiss in the use of:

<!-- Build a CSV list of parameter types -->

<xsl:param name="q1type" select="int" />

That won't work since select will try to evaluate int as an xpath query
You should use:
<xsl:param name="q1type">int</xsl:param>

Whenever I try to make a list, e.g. “int,string” (which would be a proper CSV list to my understanding) I get:

javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: Ytterligare otillåtna tecken: ',', 'string'

which is OK so I try to do an alternate pquery invocation:

<xsl:variable name="table" select="sql:pquery($db, $q1, 'int,string')"/> , I get:


--------------080703050607020508040902--