Return-Path: X-Original-To: apmail-xalan-dev-archive@www.apache.org Delivered-To: apmail-xalan-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9351FD6F2 for ; Thu, 13 Dec 2012 07:31:34 +0000 (UTC) Received: (qmail 42984 invoked by uid 500); 13 Dec 2012 07:31:34 -0000 Delivered-To: apmail-xalan-dev-archive@xalan.apache.org Received: (qmail 42614 invoked by uid 500); 13 Dec 2012 07:31:24 -0000 Mailing-List: contact dev-help@xalan.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@xalan.apache.org Delivered-To: mailing list dev@xalan.apache.org Received: (qmail 42539 invoked by uid 99); 13 Dec 2012 07:31:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Dec 2012 07:31:22 +0000 X-ASF-Spam-Status: No, hits=-2.8 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lars.bjerges@swedbank.se designates 164.10.46.102 as permitted sender) Received: from [164.10.46.102] (HELO mail2.swedbank.se) (164.10.46.102) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Dec 2012 07:31:15 +0000 Received: from unknown (HELO amcmail01.unix.se) ([10.155.192.81]) by mail2in.swedbank.se with SMTP; 13 Dec 2012 08:30:53 +0100 Received: from (fspas01ex100.fspa.myntet.se [10.190.87.22]) by amcmail01.unix.se with smtp id 3e86_1c87_0691398c_44f7_11e2_a072_005056b77bbb; Thu, 13 Dec 2012 08:30:52 +0100 Received: from FSPAS01EV010.fspa.myntet.se ([fe80::8542:9a17:6e18:f730]) by FSPAS01EX100.fspa.myntet.se ([fe80::255f:1eaa:1ad7:df%13]) with mapi; Thu, 13 Dec 2012 08:30:49 +0100 From: To: Date: Thu, 13 Dec 2012 08:30:49 +0100 Subject: Sql extension - parameterized query Thread-Topic: Sql extension - parameterized query Thread-Index: Ac3ZA8Zyv14xlwqBSgiYEl71krgepg== Message-ID: <7AE554A17B4ECB449C6EA79DAA4DD488627F46B26A@FSPAS01EV010.fspa.myntet.se> Accept-Language: sv-SE Content-Language: sv-SE X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: sv-SE Content-Type: multipart/alternative; boundary="_000_7AE554A17B4ECB449C6EA79DAA4DD488627F46B26AFSPAS01EV010f_" MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org --_000_7AE554A17B4ECB449C6EA79DAA4DD488627F46B26AFSPAS01EV010f_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi all. I have tried the sql extension somewhat as a IBM z/OS DB2 client and, sofar= , it has been working out allright. One strange thing I've found however concerns the parameterized queries whi= ch is possible to implement in a number of ways in xml-document and/or styl= esheet. 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: When doing this with more than one parameter (questionmark in the sql) I ge= t: [jcc][10143][10845][4.9.80] Invalid parameter 1: The parameter is not speci= fied, or registered. ERRORCODE=3D-4461, SQLSTATE=3D42815 -4461 When just using one parameter, after modifying whatever needs to be modifie= d above, it executes allright. After spending some time rearranging the code I found that the following se= t-up will work: And after doing: SPI01 0000004016 It actually works so the long and the short of it is that there is a workar= ound. The original problem is still there however so my question is: Has anybody done the original pattern with more than one parameter, if so, = what have I done wrong? Regards Lars Bjerges DQS, Mainframes and DW (Sweden) Swedbank AB (publ) 105 34 Stockholm Telefon: +46 (0)8 58 59 43 45 Mobil: +46 (0)70 95 27 774 Email:lars.bjerges@swedbank.se www.swedbank.se Vi ber dig l=E4gga m=E4rke till att detta e-postmeddelande kan inneh=E5lla = konfidentiell information. Om du felaktigt blivit mottagare av detta meddel= ande ber vi dig informera avs=E4ndaren om felet genom att anv=E4nda svara-f= unktionen. Vi ber dig ocks=E5 att radera e-postmeddelandet utan att skicka = det vidare eller kopiera det. Trots att vi intygar att e-postmeddelandet oc= h eventuella bilagor inte inneh=E5ller virus och andra fel som kan p=E5verk= a datorn eller IT-systemet d=E4r det mottages och l=E4ses, =F6ppnas det p= =E5 mottagarens eget ansvar. Vi tar inte p=E5 oss n=E5got ansvar f=F6r f=F6= rlust eller skada, som har uppst=E5tt i samband med att e-postmeddelandet m= ottagits och anv=E4nts. ___________________________________________________________________________= ___________________________________________________________________________= _______ Please note that this message may contain confidential information. If you = have received this message by mistake, please inform the sender of the mist= ake by sending a reply, then delete the message from your system without ma= king, distributing or retaining any copies of it. Although we believe that = the message and any attachment are free from viruses and other errors that = might affect the computer or IT system where it is received and read, the r= ecipient opens the message at his or her own risk. We assume no responsibil= ity for any loss or damage arising from the receipt or use of this message. --_000_7AE554A17B4ECB449C6EA79DAA4DD488627F46B26AFSPAS01EV010f_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

Hi all.=

 

I have tried the sql extension somewhat as a IBM z/OS DB2 client= and, sofar, it has been working out allright.

 

One strange thing I’ve found however concer= ns the parameterized queries which is possible to implement in a number of = ways in xml-document and/or stylesheet.

 

= What I would like to do is to have =A0a xml fragment con= taining the parameter values:

<QUERY>

<KOD_TXT_GRP>SPI01</KOD_TXT_GRP>

<KODTXT>0000004016&l= t;/KODTXT>

= </QUERY>

And, in the stylesheet have the following code:

 

<xsl:param name=3D"q1" select=3D&q= uot;'SELECT HANDAT,VALFRI_TEXT_RAD FROM DB2T.SPATTXT WHERE KOD_TXT_GRP =3D = ? AND KODTXT =3D ?'"/>

<xsl:variable name=3D"qparam" select=3D"= //QUERY"/>

<xsl:value-of select=3D"sql:addParameterFromElement($db,$qpara= m)"/>

= <xsl:param name=3D"q1type" select=3D"'string,string'"= ;/>

<xsl= :variable name=3D"table" select=3D"sql:pquery($db,$q1,$q1typ= e)"/>

=  

When do= ing this with more than one parameter (questionmark in the sql) I get:=

[jcc][10143][10845= ][4.9.80] Invalid parameter 1: The parameter is not = specified, or registered. ERRORCODE=3D-446= 1, SQLSTATE=3D42815 -4461

 

When just using one paramete= r, after modifying whatever needs to be modified above, it executes allrigh= t.

 =

After spending som= e time rearranging the code I found that the following set-up will work:

<xsl:value-of= select=3D"sql:addParameterWithType($db,'SPI01','string')"/>

<xsl:value-o= f select=3D"sql:addParameterWithType($db,'0000004016','string')"/= >=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 = =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0

<xsl:variable name=3D"table" select=3D"sql:pquer= y($db, $q1)"/>

 

And after doing:

<xsl:variable name=3D"p1">SPI01</xsl:variable>

<xsl:variabl= e name=3D"p2">0000004016</xsl:variable>

<xsl:value-of select=3D&quo= t;sql:addParameterWithType($db,$p1,'string')"/>

<xsl:value-of select=3D"s= ql:addParameterWithType($db,$p2,'string')"/>

<= p class=3DMsoNormal> 

It actually works so the long and the short= of it is that there is a workaround. The original problem is still there h= owever so my question is:

 

Has anybody done the original pattern with more than one parameter, if= so, what have I done wrong?

 

Regards

 

L= ars Bjerges

D= QS, Mainframes and DW (Sweden)

 

Swedbank AB (publ)

105 34 Stockholm

Telefon: +46 (0)8 58 59 43 45

Mobil: +46 (0)70 95 27 774

Email:lars.bjerges@swedbank.se= =

www.swedba= nk.se

 

Vi ber= dig l=E4gga m=E4rke till att detta e-postmeddelande kan inneh=E5lla konfid= entiell information. Om du felaktigt blivit mottagare av detta meddelande b= er vi dig informera avs=E4ndaren om felet genom att anv=E4nda svara-funktio= nen. Vi ber dig ocks=E5 att radera e-postmeddelandet utan att skicka det vi= dare eller kopiera det. Trots att vi intygar att e-postmeddelandet och even= tuella bilagor inte inneh=E5ller virus och andra fel som kan p=E5verka dato= rn eller IT-systemet d=E4r det mottages och l=E4ses, =F6ppnas det p=E5 mott= agarens eget ansvar. Vi tar inte p=E5 oss n=E5got ansvar f=F6r f=F6rlust el= ler skada, som har uppst=E5tt i samband med att e-postmeddelandet mottagits= och anv=E4nts.

__________________= ___________________________________________________________________________= ________________________________________________________________

 

Please note that this message may contain confidential information. = If you have received this message by mistake, please inform the sender= of the mistake by sending a reply, then delete the message from your syste= m without making, distributing or retaining any copies of it. Although= we believe that the message and any attachment are free from viruses and o= ther errors that might affect the computer or IT system where it is receive= d and read, the recipient opens the message at his or her own risk. We assu= me no responsibility for any loss or damage arising from the receipt or use= of this message.

 

 

= --_000_7AE554A17B4ECB449C6EA79DAA4DD488627F46B26AFSPAS01EV010f_--