Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 71086 invoked from network); 8 Nov 2004 12:57:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 8 Nov 2004 12:57:45 -0000 Received: (qmail 20546 invoked by uid 500); 8 Nov 2004 12:56:19 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 20311 invoked by uid 500); 8 Nov 2004 12:56:09 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: users@cocoon.apache.org Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 20296 invoked by uid 99); 8 Nov 2004 12:56:09 -0000 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_WHOIS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [146.64.10.166] (HELO wabe.csir.co.za) (146.64.10.166) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 08 Nov 2004 04:56:08 -0800 Received: from cs-emo.csir.co.za (cs-emo.csir.co.za [146.64.10.40]) by wabe.csir.co.za (8.12.5/8.12.5) with ESMTP id iA8CtZJK008829 for ; Mon, 8 Nov 2004 14:55:35 +0200 Received: from GW-EMO-MTA by cs-emo.csir.co.za with Novell_GroupWise; Mon, 08 Nov 2004 14:55:35 +0200 Message-Id: X-Mailer: Novell GroupWise Internet Agent 6.5.2 Date: Mon, 08 Nov 2004 14:55:18 +0200 From: "Derek Hohls" To: Subject: Re: Running a sequence of SQL queries with a single result Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-CSIR-MailScanner-Information: Please contact sys-admin at csir dot co dot za for more information X-CSIR-MailScanner: Found to be clean X-MailScanner-From: dhohls@csir.co.za X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Thanks Markus Yes, I have worked with ESQL before... I was just hoping to avoid it as it adds to the complexity of the application. (plus I am trying to not use XSP as a "matter of principle"... but, in the end, if the designers do not offer any other choice here, then I guess my principles take a back seat to the needs at hand!) >>> mvaterlaus@gmail.com 2004/11/08 02:47:11 PM >>> Hi Derek, hi list, ASFAIK you can only send one SQL-statement at a time. However, with ESQL you have the possibility to use several SQL-Statements in one xsp. E.q. select * from sometable .... select * from othertable .... HTH Markus On Mon, 08 Nov 2004 13:44:56 +0200, Derek Hohls wrote: > For more complex queries, I'd like to be able to > run chained queries and get a single result. For > example, the mySQL manual has this series of > steps: > > CREATE TEMPORARY TABLE tmp ( > article INT(4) UNSIGNED ZEROFILL DEFAULT '0000' NOT NULL, > price DOUBLE(16,2) DEFAULT '0.00' NOT NULL); > > LOCK TABLES shop READ; > > INSERT INTO tmp SELECT article, MAX(price) FROM shop GROUP BY article; > > SELECT shop.article, dealer, shop.price FROM shop, tmp > WHERE shop.article=tmp.article AND shop.price=tmp.price; > > UNLOCK TABLES; > > DROP TABLE tmp; > > When I run these steps from the mySQL command > line interface, the results are as expected. > > However, when I try to insert this into an > > > type of page, and run this via a normal > SQL transformer eg. > > > > > > > > > > > > > > I get the following error: > > Syntax error or access violation, message from server: > "You have an error in your SQL syntax. Check the manual > that corresponds to your MySQL server version for the right > syntax to use near '; LOCK TABLES .... > > I assume this means the SQL generator can only work with > one query - what are alternative ways of getting to a result? > > Thanks > derek > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > MailScanner thanks transtec Computers for their support. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org > For additional commands, e-mail: users-help@cocoon.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks transtec Computers for their support. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org