Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 88543 invoked from network); 13 Aug 2009 15:25:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 13 Aug 2009 15:25:11 -0000 Received: (qmail 47291 invoked by uid 500); 13 Aug 2009 15:25:17 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 47264 invoked by uid 500); 13 Aug 2009 15:25:17 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 47256 invoked by uid 99); 13 Aug 2009 15:25:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Aug 2009 15:25:17 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of clinton.begin@gmail.com designates 209.85.212.199 as permitted sender) Received: from [209.85.212.199] (HELO mail-vw0-f199.google.com) (209.85.212.199) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Aug 2009 15:25:09 +0000 Received: by vws37 with SMTP id 37so718346vws.27 for ; Thu, 13 Aug 2009 08:24:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=EhQrwphMq6WsrVMCNtr7iCQZbvbfOfSIb5QKnXbnCr8=; b=bdZ7k4EZ2ETf8m4tlvSyU8c9CCnfBUPXqIsSsaxLj0nnf0gly62+l2NpWJ3cly+NCq pCnJGEeu+r1CbgmG8BXNLpyxgS51Qm6PHtsQv7jhuqJb6YRl3QquZpLqLhF+x9bh4jBR BVjy2VSBN1IFozuTfOgOa7ZY/MlJa/SqeFrhw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=vu9wFws6q124kpBCibYrXmEQOW1a6nezdjPfzQv112pC48YjdFmr/MgZwU46Wj/PZa //EsLFyXZLJtdjBuJwX9K8b+O21hWS804yLTKY9N8e0tIeeu1NGxlTrb08O8qr1XppUN THkyd+Dyh7/TR+hp/L8FoYqQwjLdq3bZ7cf3Y= MIME-Version: 1.0 Received: by 10.220.66.92 with SMTP id m28mr1254933vci.6.1250177088287; Thu, 13 Aug 2009 08:24:48 -0700 (PDT) In-Reply-To: References: <16178eb10908130814k6a0b34c6x82a5c818e8e6bdac@mail.gmail.com> Date: Thu, 13 Aug 2009 09:24:48 -0600 Message-ID: <16178eb10908130824p437d5b6dhabeecde1ca51b06c@mail.gmail.com> Subject: Re: migration tools support sql comment From: Clinton Begin To: user-java@ibatis.apache.org Content-Type: multipart/alternative; boundary=001485e7ca3640f34704710789ce X-Virus-Checked: Checked by ClamAV on apache.org --001485e7ca3640f34704710789ce Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Then should support all comment styles from various databases... We don't want DB specific stuff in iBATIS. Clinton On Thu, Aug 13, 2009 at 9:21 AM, Guoyou Jiang wrote: > ok, thanks, > but i think when read line from file, we can search this line, if contains > "--" , just use substring to cut the comment begin with "--". > > 2009/8/13 Clinton Begin > > the problem is that many JDBC drivers have problems with newline >> characters. So we have to put the SQL all in one line. I think there's an >> open request to make it optional, and if I recall correctly, in iBATIS 3 I >> send the statement as is... so we'll see how many JDBC drivers/databases >> still have the problem! >> >> >> >> On Thu, Aug 13, 2009 at 8:52 AM, Guoyou Jiang wrote: >> >>> seems if the sql file contains comment at line end will cause error, like >>> this: >>> CREATE TABLE groups >>> ( >>> id bigserial NOT NULL, *--the primary key >>> * >>> group_code varchar(50),* --code* >>> group_name varchar(50) NOT NULL, >>> group_type varchar(100) NOT NULL, >>> parent_id bigint, >>> department_type varchar(50), >>> business_relation_type varchar(50), >>> business_relation_value varchar(50), >>> memo varchar(200), >>> PRIMARY KEY (id), >>> CONSTRAINT groups_parent_id_fkey FOREIGN KEY (parent_id) >>> REFERENCES groups (id) >>> ); >>> >>> can we support this type comment? thanks! >>> >> >> > --001485e7ca3640f34704710789ce Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Then should support all comment styles from various databases... We don'= ;t want DB specific stuff in iBATIS.

Clinton

On Thu, Aug 13, 2009 at 9:21 AM, Guoyou Jiang = <guoyou.jiang@jsvest.com&= gt; wrote:
ok, thanks,
b= ut i think when read line from file, we can search this line, if contains &= quot;--" , just use substring to cut the comment begin with "--&q= uot;.

2009/8/13 Clinton Begin &l= t;clinton.begi= n@gmail.com>

the problem is th= at many JDBC drivers have problems with newline characters.=A0 So we have t= o put the SQL all in one line.=A0 I think there's an open request to ma= ke it optional, and if I recall correctly, in iBATIS 3 I send the statement= as is... so we'll see how many JDBC drivers/databases still have the p= roblem!

=A0

On Thu, Aug 13, 2009 at 8:52 AM, Guoy= ou Jiang <guoyou.jiang@jsvest.com> wrote:
seems if the sql file contains comment at line end will cause error, like t= his:
CREATE TABLE groups
(
=A0 id bigserial NOT NULL,=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= --the primary key<= /i>
=A0 group_code varchar(50),=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= --code
=A0 group_name varchar(50) NOT NULL,
=A0 group= _type varchar(100) NOT NULL,
=A0 parent_id bigint,
=A0 department_type varchar(50),
=A0 business_relation_type varchar(50),
=A0 business_relation_value varc= har(50),
=A0 memo varchar(200),
=A0 PRIMARY KEY (id),
=A0 CONSTRAI= NT groups_parent_id_fkey FOREIGN KEY (parent_id)
=A0=A0=A0=A0=A0 REFEREN= CES groups (id)
);

can we support this type comment? thanks!



--001485e7ca3640f34704710789ce--