Return-Path: X-Original-To: apmail-jmeter-user-archive@www.apache.org Delivered-To: apmail-jmeter-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0E7509D7E for ; Tue, 10 Apr 2012 11:11:38 +0000 (UTC) Received: (qmail 19519 invoked by uid 500); 10 Apr 2012 11:11:37 -0000 Delivered-To: apmail-jmeter-user-archive@jmeter.apache.org Received: (qmail 19487 invoked by uid 500); 10 Apr 2012 11:11:37 -0000 Mailing-List: contact user-help@jmeter.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "JMeter Users List" Delivered-To: mailing list user@jmeter.apache.org Received: (qmail 19478 invoked by uid 99); 10 Apr 2012 11:11:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Apr 2012 11:11:37 +0000 X-ASF-Spam-Status: No, hits=1.6 required=5.0 tests=FREEMAIL_REPLY,RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sebbaz@gmail.com designates 209.85.214.171 as permitted sender) Received: from [209.85.214.171] (HELO mail-ob0-f171.google.com) (209.85.214.171) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Apr 2012 11:11:26 +0000 Received: by obbwd18 with SMTP id wd18so8526481obb.2 for ; Tue, 10 Apr 2012 04:11:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=C5ML7GBWJlad3X4C9MFjipa0m2CBM8UsisaLsvhJLKQ=; b=V1milrcOmmqs+fkG8wwMnZK4JBjrNYtfy6Hg0paMCl6vGNXtfccSnHKxo0zlWAXybn iCmEA6S3QjArUezqHiyFKcNd0rs+t/G2q9fcOmWpAvKoMUeHlMW2Fc7vRasLvywrKd3v yD9rT3m7aJQmN2mTcK5aVEFnP+LfhGQ3OxvyziyUdnzQxOgXnV52el5LL8eAK0LfCU3f pCsVmX3jtTlLUvoVjGW1BM72E2NhEeC6Y+q/Ar9L2qa2e0PCVuPimPiRAoJkwfWBBI45 Ht9C+GEhmxF2o62heEFqMOOMe5ml/HEnHBYbgfkC9dgj31DrUcZ0w8zo+Svz6XVPIV80 mISw== MIME-Version: 1.0 Received: by 10.60.14.166 with SMTP id q6mr15201860oec.17.1334056265272; Tue, 10 Apr 2012 04:11:05 -0700 (PDT) Received: by 10.182.225.99 with HTTP; Tue, 10 Apr 2012 04:11:05 -0700 (PDT) In-Reply-To: References: Date: Tue, 10 Apr 2012 12:11:05 +0100 Message-ID: Subject: Re: Feeding a JDBC sampler with multiple SQL statements from a SQL script file From: sebb To: JMeter Users List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On 10 April 2012 09:28, Wolfgang Wyremba wrote: > > Thanks for your help - I now have some improvements . > > I did the following: > I tried ${SQLStmt} in the JDBC sampler - but that did not work because al= ways a "?" was placed in front of my SQL string. That must have come from the CSV file - did you create it with a text editor, or a word-processor? > Therefore, I added a dummy-column in my SQL script file. > The file looks now: > dummy;SELECT * FROM dbc.tablesV ORDER BY 1 > dummy;SELECT * FROM dbc.tablesV ORDER BY 1, 2, 3 > > > My CSV data set config has now the following settings: > - filename: C:\JMeterCSVSQL.txt > - character set: UTF-8 > - variable name: dummy,SQLStmt > - delimiter: ; Which is fine so long as you never need to include a semi-colon in your SQL statement. > I do not use the dummy variable, but now I can execute one SQL statement = which is placed in the SQL script file. > > However, there is one problem again: > Only the first SQL statement of the textfile gets executed - the others d= o not get executed. > > I am not sure, why JMeter does not fetch row after row of the textfile an= d does not execute all statement. > > The debugging info also did not show me any more information about that. > > Do you have any other hints to solve this issue? > > thanks > > >> Subject: Re: Feeding a JDBC sampler with multiple SQL statements from a = SQL script file >> From: oliver_lloyd@hotmail.com >> Date: Sat, 7 Apr 2012 10:24:12 +0100 >> To: user@jmeter.apache.org >> >> One thing, have you tried with ${SQLStmt} - ${} is the notation for how = JM refers to variables. >> >> Apart from that, as it stands this should work. Try moving the View Resu= lts Tree Listener from where it is as a child of the JDBC request to the to= p of the testplan, that way you will see results for everything. Then add a= Debug Request, that will show more information. >> >> On 7 Apr 2012, at 09:59, Wolfgang Wyremba wrote: >> >> > >> > hello, >> > >> > let my outline my current configuration below... >> > >> >>> So, is there a way to "feed" a JDBC sampler with an external file, h= olding different SQL statements? >> >> >> > Yes, you can pass a variable directly into the SQL statement itself. >> > Eg. In the Query edit box, you might have something like: >> >> >> >> INSERT INTO `myDB`.`emails` (`email`) VALUES ('${myEmail}'); >> >> >> >> Where ${myEmail} is a jmeter variable. >> >> >> >>> >> >>> I could find one posting in this mailling list, discussing this issu= e using CSV data set configs: >> >>> http://jmeter.512774.n5.nabble.com/How-to-run-SQL-log-against-databa= se-td525660.html >> >>> >> >>> However, I am not sure, whether this is the right solution and addit= ionally I could not manage to get it working. >> >> >> >> >> > Sounds like a good solution to me, there may be others, but this would >> > certainly work and actually, probably isn't all that hard. You just ah= ve >> > to get the CSV Dataset Config to work. >> >> >> >> What exactly is it that is causing you trouble? >> > >> > I have a working JDBC configuration and I can run a single SQL stateme= nt without any problems in a JDBC sampler. >> > >> > I set up a text-file called "JMeterCSVSQL.txt" which has two SQL state= ments - each in a line seperated with a semicolon: >> > SELECT * FROM DBC.TablesV ORDER BY 1; >> > SELECT * FROM DBC.TablesV ORDER BY 1, 2, 3; >> > >> > My CSV data set config has the following settings: >> > - filename: C:\JMeterCSVSQL.txt >> > - character set: UTF-8 >> > - variable name: SQLStmt >> > - delimiter: ; >> > >> > I did not touch the other settings. >> > >> > My JDBC sampler has the following settings: >> > - Variable Name Bound To Pool: DB1 ... this is my working DB-connectio= n >> > - Query-Type: SELECT statement >> > - Query: {SQLStmt} >> > >> > I did not touch the other settings. >> > >> > Well, this configuration does not work. >> > I always get the following JDBC Error: >> > >> > >> > I >> > also tried to change the query to '{SQLStmt}' but that didn't work as = well. >> > The JDBC error then is: >> > >> > >> > >> > My layout of my JMeter file is: >> > Thread Group >> > =A0 =A0 JDBC Connection >> > =A0 =A0 CSV Data Set Config >> > =A0 =A0 JDBC Request >> > =A0 =A0 =A0 =A0 View Result Set in Table >> > =A0 =A0 Summary Report >> > >> > >> > So, there seem to be some small changes needed; but I am not sure what= I have to change to get it working. >> > >> > I hope you can give me some more hints on how to solve this issue. >> > >> > Thanks. >> > >> > >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org >> For additional commands, e-mail: user-help@jmeter.apache.org >> > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org For additional commands, e-mail: user-help@jmeter.apache.org