realbasic-nug
[Top] [All Lists]

Re: RegEx to reliably split SQL lines

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: RegEx to reliably split SQL lines
From: Norman Palardy <npalardy at great-white-software dot com>
Date: Wed, 28 Mar 2007 18:24:48 -0600
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <p06230926c230b2b838a3 at [129 dot 94 dot 109 dot 242]>
On Mar 28, 2007, at 6:03 PM, Dr Gerard Hammond wrote:

> At 5:41 PM -0600 28/3/07, Norman Palardy wrote:
>> On Mar 28, 2007, at 5:25 PM, Dr Gerard Hammond wrote:
>>
>>>  Hi,
>>>
>>>  I have a long file full of INSERT, UPDATE and SELECT statements.
>>>  Does anybody have a piece of RegEx code that'll split the lines
>>>  reliably into individual SQL statements.
>>>  RegEx and I don't normally get on.
>>>
>>>  Files typically look like this.
>>
>> Do you need to maintain returns in the textual items you have in the
>> mail or are those long fields that have been wrapped by mail ?
>
>
> Those CRs are real.
>
>
>>
>> If not I'd try to do this in 2 steps in BBEdit :)
>
> so far so good. That's where it is now ;-)

You know the old saying about great minds thinking alike :)

>> Remove all line endings
>> Then turn all ; into ; + an end of line
>
>
> But what happens to a field that might look like this
>
> UPDATE t1 set f2='(There is nothing like a dame); Nothing...'
>
> Column data in the SQL may have ); in there....

That wasn't clear that it may contain that

It might start something like
    INSERT into .* ( .* ) values ( ... omg ! )
or UPDATE .* SET .* = .... omg ! ......
or SELECT .* FROM

but a regex for the values could be nasty because you have a lot of  
possibilities

Even the BNF for SQL is pretty complex


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


From  Wed 28 Mar 2007 18:43:34 -0600
Return-Path: <realbasic-nug-bounces at lists dot realsoftware dot com>
X-Original-To: listarchive at realsoftware dot com
Delivered-To: listarchive at realsoftware dot com
Received: by xmail.realsoftware.com (Postfix, from userid 1037)
        id BCD1E1D5EB28; Wed, 28 Mar 2007 17:43:43 -0700 (PDT)
X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on 
        www.realsoftware.com
X-Spam-Level: 
X-Spam-Status: No, score=-2.8 required=4.5 tests=ALL_TRUSTED,AWL,BAYES_00,
        NO_REAL_NAME autolearn=ham version=3.1.1
Received: from lists.realsoftware.com (m.realsoftware.com [66.116.103.65])
        by xmail.realsoftware.com (Postfix) with ESMTP id DAFB61D5EB1D;
        Wed, 28 Mar 2007 17:43:42 -0700 (PDT)
Received: from real-software-mini.local (localhost [127.0.0.1])
        by lists.realsoftware.com (Postfix) with ESMTP id 89B68198887;
        Wed, 28 Mar 2007 19:43:38 -0500 (CDT)
X-Original-To: realbasic-nug at lists dot realsoftware dot com
Delivered-To: realbasic-nug at lists dot realsoftware dot com
Received: from mail.verex.com (mail.verex.com [66.116.103.197])
        by lists.realsoftware.com (Postfix) with ESMTP id ACB7119887C
        for <realbasic-nug at lists dot realsoftware dot com>;
        Wed, 28 Mar 2007 19:43:34 -0500 (CDT)
Received: from [66.116.103.197] (localhost [127.0.0.1])
        by mail.verex.com (Postfix) with SMTP id C394A7222B6
        for <realbasic-nug at lists dot realsoftware dot com>;
        Wed, 28 Mar 2007 18:43:34 -0600 (MDT)
Date: Wed, 28 Mar 2007 18:43:34 -0600
Subject: Re: What is frame 11 for a window?
From: joe at strout dot net
To: realbasic-nug at lists dot realsoftware dot com
In-Reply-To: <6A8EB4E2-3953-49CD-9EBF-46CA326A3D47 at tribu dot ch>
X-Mailer: VerEx Email Gateway
Message-Id: <20070329004334 dot C394A7222B6 at mail dot verex dot com>
X-BeenThere: realbasic-nug at lists dot realsoftware dot com
X-Mailman-Version: 2.1.9
Precedence: list
Reply-To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: realbasic-nug-bounces at lists dot realsoftware dot com
Errors-To: realbasic-nug-bounces at lists dot realsoftware dot com

On Mar 29, 2007, at 00:01 UTC, Arnaud Nicolet wrote:

> So it's a Win32 only frame :-(

No, it's a frame that describes a modeless dialog!  How exactly that
looks and behaves is up to the OS.  On the Mac, a modeless dialog is
not *supposed* to stay on top (that would make it modal).  Apparently
on Windows it is.  On the Mac, maybe it looks the same as a dialog
window today, but maybe next year Apple  will choose to make it look
different.  Who cares?  If it's a modeless dialog, set the frame type
to 11 and you'll get the correct behavior on all platforms and
versions.  Who do you keep worrying about the details on some
particular platform and version?  Just set it and forget it; let the OS
make it look and feel as it should.

--
Joe Strout -- joe at strout dot net
Verified Express, LLC     "Making the Internet a Better Place"
http://www.verex.com/

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>