Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Changing SQL Field delimiter

2 views
Skip to first unread message

Mark Rohde

unread,
Nov 5, 2002, 1:04:08 AM11/5/02
to
I have been trying to locate in flashfiler's code where the " is defined as
identifing a field i.e. mytable."some field name"
My hope is to extend this to include [] (e.g. mytable.[some field name]).
the need is born from my frustrations with SQLConstructor and its need to
have [], with no configurability to "".
Ideally it would be the third party app that should change but I have had no
response from the author.

TIA
Mark Rohde


Mark Rohde

unread,
Nov 5, 2002, 10:31:40 PM11/5/02
to
Sorry Hannes no go on
SQLNameString = '"' { noDblQuote } '"' | '[' { noDblQuote } ']'
tried but failed on this as well
SQLNameString = '[' { noDblQuote } ']' //had tried this before but double
tested

"Hannes Danzl [TPX]" <Han...@danzl.lznad.at> wrote in message
news:O#uAJ0ThC...@tpsmail01.turbopower.net...
> have you tried
>
> SQLNameString = '"' { noDblQuote } '"' | '[' { noDblQuote } ']'
>
> --
> Hannes
>
> -> Han...@danzl.lznad.at (remove .lznad) / http://www.danzl.at
> FF Foundry at http://community.turbopower.com/
> Newsgroup search at http://www.tamaracka.com/search.htm
> Fixes and updates at ftp://ftp.turbopower.com/pub/flash/updates/
>
>
> "Mark Rohde" <mro...@agdata.com.au> wrote in message
> news:9nOgRRTh...@tpsmail01.turbopower.net...
> > Mike,
> > I would appreciate a pointer in the right direction.
> > I have identified what I believe are the lines resposible
> > CHARACTERS
> > ...
> >
> > noDblQuote = ANY - '"' - eol .
> >
> > TOKENS
> > ...
> >
> > SQLNameString = '"' { noDblQuote } '"' .
> >
> >
> > But changing these values does not appear to work, ideally I would like
to
> > extend the functionality to include " or []. Any help/direction would
be
> > appreciated
> >
> >
> >
> > Mark Rohde
> >
> >
> >
> > "Mike Reith" <mre...@tetzel.com> wrote in message
> > news:MPG.183216f22...@news.turbopower.com...
> > > Mark,
> > >
> > > If you run into any road blocks I might be able to help. I wrote and
> > > maintain Coco/R for Delphi.
> > >
> > > Mike
> > > mre...@tetzel.com
> > >
> > > In article <LPpKZ$RhCHA...@tpsmail01.turbopower.net>,
> > > mro...@agdata.com.au says...
> > > > Thanks Sean,
> > > > I have read a little about Coco/R BTH I was short on time and it
> seemed
> > a
> > > > little beyond me. I'll give it a go and advise my progress if anyone
> is
> > > > interested
> > > >
> > > >
> > > > Mark Rohde
> > > >
> > > >
> > > > "Sean Winstead[TurboPower]" <se...@turbopower.com> wrote in message
> > > > news:ekrfsukiau2lvptmp...@4ax.com...

> > > > > That would be in the FF SQL grammar contained in file FFSQL.ATG.
You
> > can
> > > > > edit and compile that grammar into file FFSQL.pas using a utility
> > named
> > > > > Coco/R. Coco/R is available via http://www.tetzel.com. We use the
> beta
> > > > > version.
> > > > >
> > > >
> > > >
> > > >
> >
> >
>
>


Mark Rohde

unread,
Nov 5, 2002, 8:31:29 PM11/5/02
to

TOKENS
...

SQLNameString = '"' { noDblQuote } '"' .

Mark Rohde

Sean Winstead[TurboPower]

unread,
Nov 5, 2002, 11:16:25 AM11/5/02
to

That would be in the FF SQL grammar contained in file FFSQL.ATG. You can

Hannes Danzl [TPX]

unread,
Nov 5, 2002, 9:33:16 PM11/5/02
to
have you tried

SQLNameString = '"' { noDblQuote } '"' | '[' { noDblQuote } ']'

--
Hannes


"Mark Rohde" <mro...@agdata.com.au> wrote in message
news:9nOgRRTh...@tpsmail01.turbopower.net...

Mark Rohde

unread,
Nov 5, 2002, 6:04:57 PM11/5/02
to
Thanks Sean,
I have read a little about Coco/R BTH I was short on time and it seemed a
little beyond me. I'll give it a go and advise my progress if anyone is
interested


Mark Rohde


"Sean Winstead[TurboPower]" <se...@turbopower.com> wrote in message
news:ekrfsukiau2lvptmp...@4ax.com...
>

Mark Rohde

unread,
Nov 7, 2002, 8:11:06 PM11/7/02
to
Thanks Mike,

Downloaded the latest Coco/R made the changes and implimented into the
server. A couple of things however:
It seems in BracketedName<var aName : string>,
Symbol.Len := GetScanner.BufferPosition - Symbol.Pos - 2;
Is not returning the correct position. This is the SQL I am passing
Select [Account ID] from Accounts
The SQL engine returns the error "....Account ID] fr is not ...." By
changing the Literal from 2 to 6 the script works. But of course this would
be too simple... in a multiple field select this method does not work. I
have tried to compensate in the ffSQL.pas and scan aName removing all the
extra chars, this also failed.
I am guessing that there is some issue in either GetScanner.BufferPosition
or in Symbol.Pos (this is my bet) rather than the literal 2, not being
familar with Coco/R and its language any assistance would be appreciated

TIA
Mark Rohde


"Mike Reith" <mre...@tetzel.com> wrote in message

news:MPG.1833bb709...@news.turbopower.com...
> Mark,
>
> Working on this problem identified a bug in Coco/R for Delphi so you
> will have to download the latest version (1.1.0.182) from my web page.
>
> Then change the SQLName production to:
>
> SQLName <var aName : string>
> =
> ident (. aName := LexString; .)
> | SQLNameString (. aName := CheckSQLName(LexString); .)
> | BracketedName<aName>
> .
>
> And add the BracketedName production:
>
> BracketedName<var aName : string>
> (. var Symbol : TSymbolPosition; .)
> = (. aName := '';
> Symbol := TSymbolPosition.Create;
> try
> Symbol.Pos := GetScanner.BufferPosition; .)
> (
> "["
> { ANY
> }
> "]"
> ) (. Symbol.Len := GetScanner.BufferPosition -
> Symbol.Pos - 2;
> aName := GetScanner.GetString(Symbol);
> finally
> Symbol.Free;
> end; .)
> .
>
> Hope this helps. Let me know if there are any problems.
>
> Mike
>
> In article <9nOgRRTh...@tpsmail01.turbopower.net>,
> mro...@agdata.com.au says...

Mike Reith

unread,
Nov 8, 2002, 9:37:57 AM11/8/02
to
Mark,

I think that you are right and that there is a problem with the literal;
the test cases that I ran were rather short. I'll look at it this
weekend and find out where the problem is occurring.

Mike

In article <kDFLKPsh...@tpsmail01.turbopower.net>,
mro...@agdata.com.au says...

Eivind Bakkestuen [TPX]

unread,
Nov 10, 2002, 8:27:56 PM11/10/02
to
Mark,

Thanks for sharing the solution.

Please note that posting of TP source to the Foundry is expressly
prohibited, so take care to only post changes and not complete unit(s).

--

Eivind Bakkestuen [TPX]

Please, no private email unless requested.
This newsgroup is searchable at http://www.tamaracka.com
Visit TurboPower's new Foundry at http://community.turbopower.com


"Mark Rohde" <mro...@agdata.com.au> wrote in message

news:xSzUnhRi...@tpsmail01.turbopower.net...
> Big thanks to Mike Reith of Coco/R. The changes made to ffSQL.pas via
Coco/R
> now allow for the use of [] or "" for field identifications. This now
brings
> FlashFiler and SQLConrtructor together as a working solution for me
instead
> of being a painfull execice of search/replace.
> I will submit this change to the foundry for those that are
> interested........
>
> Thanks again Mike for all your help.
>
>
> Mark Rohde
>
>


Mark Rohde

unread,
Nov 10, 2002, 7:21:52 PM11/10/02
to

Mike Reith

unread,
Nov 10, 2002, 3:56:45 PM11/10/02
to
> It seems in BracketedName<var aName : string>,
> Symbol.Len := GetScanner.BufferPosition - Symbol.Pos - 2;
> Is not returning the correct position. This is the SQL I am passing
> Select [Account ID] from Accounts

> I am guessing that there is some issue in either GetScanner.BufferPosition


> or in Symbol.Pos (this is my bet) rather than the literal 2, not being
> familar with Coco/R and its language any assistance would be appreciated

Mark,

Try the following code:

SQLName <var aName : string>
=
ident (. aName := LexString; .)
| SQLNameString (. aName := CheckSQLName(LexString); .)

| BracketedName <aName> (. aName := CheckSQLName(aName); .)
.



BracketedName<var aName : string>
(. var Symbol : TSymbolPosition; .)
= (. aName := '';
Symbol := TSymbolPosition.Create;
try

// GetScanner.NextSymbol will be the [
Symbol.Pos := GetScanner.NextSymbol.Pos; .)
(
"["
{ ANY
}
"]"
)
(. // GetScanner.CurrentSymbol will be the ]
Symbol.Len := (GetScanner.CurrentSymbol.Pos
+ GetScanner.CurrentSymbol.Len) - Symbol.Pos;


aName := GetScanner.GetString(Symbol);
finally
Symbol.Free;
end; .)
.

You were right that I did not get the correct position within the source
stream for the closing bracket. I have rewritten the code avoiding the
use of BufferPosition. Hopefully this code will work.

Mike

Mark Rohde

unread,
Nov 11, 2002, 5:51:54 PM11/11/02
to
Eivind,
Thanks for the heads up on the TP source. Would the changes expressed in
this thread be enough? All you need in to download the latest Coco/r and
apply the last changes Mike advised me of.

Either way I wont send anything to the Foundry as I thing it would violate
the Foundry rules. If TP want the changed file I'd be happy to send it to
them or they can follow the thread and decide for themselves.

Just another note of appreciation to Mike and also one to TP. Where else can
a programmer go, express a wish to change something fundimental in a
database engine and recieve expert advise and the source code to make the
changes? I am constantly impressed and satified my money and advise to my
employer are well spent.

Mark Rohde.

"Eivind Bakkestuen [TPX]" <eivind.b...@tpx.turbopower.com> wrote in
message news:C1YErESi...@tpsmail01.turbopower.net...

Eivind Bakkestuen [TPX]

unread,
Nov 18, 2002, 7:35:31 AM11/18/02
to
A quick Question... is this the constructor you're talking about?

http://www.aipoint.com/b_asi/sqlConstructor/index.htm

--

Eivind Bakkestuen [TPX]

Please, no private email unless requested.
This newsgroup is searchable at http://www.tamaracka.com
Visit TurboPower's new Foundry at http://community.turbopower.com


"Mark Rohde" <mro...@agdata.com.au> wrote in message

news:UwpdBFJh...@tpsmail01.turbopower.net...

Mark Rohde

unread,
Nov 28, 2002, 11:30:15 PM11/28/02
to
Sorry for the delay , its been a mad mad month!
Yes, I have tried to contact the author several times and posted a question
here to see if there was a way to redifine the [] to "" but recieved no
response.

Mark Rohde

"Eivind Bakkestuen [TPX]" <eivind.b...@tpx.turbopower.com> wrote in

message news:nPygq5vj...@tpsmail01.turbopower.net...

Eivind Bakkestuen [TPX]

unread,
Nov 29, 2002, 12:46:01 AM11/29/02
to
Ok. I would suggest that you try replying (publicly!) to the latest of his
ads in Borland's thirdpartytools.general newsgroup; he appears to advertise
there each time he releases an update. Possibly public exposure of the
problem will bring about a fix. Mailing him after posting publicly, telling
him where to find the public message probably also helps. :)

--

Eivind Bakkestuen [TPX]

Please, no private email unless requested.
This newsgroup is searchable at http://www.tamaracka.com
Visit TurboPower's new Foundry at http://community.turbopower.com


"Mark Rohde" <mro...@agdata.com.au> wrote in message

news:6IsGr$1lCH...@tpsmail01.turbopower.net...

0 new messages