Re: WARNING:Latest 4GL+Online buggy
Posted in 1999
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
From: Richard Spitz <Richard.Spitz@ana.med.uni-muenchen.de> > >David Williams wrote: > > > > The latest 4gl has a bug where preparing a string causes the string > > to have spaces added to it. (Someone here mentioned it, I've logged > > it as a call in the UK.). > > > > e.g. "select a,b,c from t1" becomes > > "select a , b , c from t1" > > after you prepare something from it. > >Why is this a problem? The string with the added spaces is syntactically >identical to the original query and will yield the same result. So why >bother? Or do you do additional things with the string after the >PREPARE? It could be a problem with the length of the string. If you know that the string will never be longer than 20 chars so you define it as a CHAR(20), and suddenly it's 23 chars and this happens before the prepare completes, you might get a syntax error. But I'm just guessing. :-) ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com
Obnoxio The Clown wrote:
>
> From: Richard Spitz <Richard.Spitz@ana.med.uni-muenchen.de>
> >
> >David Williams wrote:
> > >
> > > The latest 4gl has a bug where preparing a string causes the string
> > > to have spaces added to it. (Someone here mentioned it, I've logged
> > > it as a call in the UK.).
> > >
> > > e.g. "select a,b,c from t1" becomes
> > > "select a , b , c from t1"
> > > after you prepare something from it.
> >
> >Why is this a problem? The string with the added spaces is syntactically
> >identical to the original query and will yield the same result. So why
> >bother? Or do you do additional things with the string after the
> >PREPARE?
>
> It could be a problem with the length of the string. If you know that the
> string will never be longer than 20 chars so you define it as a CHAR(20),
> and suddenly it's 23 chars and this happens before the prepare completes,
> you might get a syntax error. But I'm just guessing. :-)
I have a doubt! David, does this extra space occurs with variables or
only with strings, meaning :
case 1 :
PREPARE p FROM "select a,b,c from t1" and in .4ec it's
converted with something :
$ prepare p from "select a , b , c from t1"
--OR--
case 2:
DEFINE anystr CHAR[20]
LET anystr = "select a,b,c from t1"
DISPLAY "1. Anystr is ", anystr
PREPARE p FROM anystr
DISPLAY "2. Anystr is ", anystr -- gives "select a , b , c .." ???
If it is case 2, then it is definately a BUG. So please contact your
nearest tech-suppost to log it as a bug. Whereas if it is case 2, then
it should not matter much, eventhough a bug(?, not sure).
regards,
Rahul.