Subject Re: [ib-support] Select syntax
Author Paul Schmidt
On 22 Dec 2001, at 2:05, Claudio Valderrama C. wrote:

> "Doug Chamberlin" <DChamberlin@...> wrote in message
> news:5.1.0.14.2.20011221223458.025763d0@...... > >
> While on the subject of the parser, I would sure love to see the >
> identification of tokens in error messages done in terms which are
> more > useful to the user. The "line X, character Y" counting is very
> difficult to > understand!
>
> Please explain what you mean. I'm 99% sure you don't want to convert
> lineX, characterY in rectangular coordinates to polar coordinates in
> the form angle (measured from the horizontal line), length (measured
> in pixels).
>
> Do you want the full line shown? It wouldn't help too much anyway if
> your procedure is 300 lines long, for example.
>
> Or do you want a MS Office assistant to popup and show you graphically
> where the error is, with your favorite MIDI in the background? We
> could replace Mr. Genius with Mr. Starkey and the dog with a wolf, for
> example. :-)

Don't be silly, how about something like this:

SELECT * FROPM CUSTOMERS produces:

Invalid token:
SELECT * FROPM CUSTOMERS
^

This would be handy if you did have a 300 line SQL statement,
because you just look for the ^ and that will show you exactly
where the error is. Because line and character can be wrong, take
this example from some C++ code:

stringx = "SELECT O1.OCU_CD, C1.CSHORT AS \
OCU_CSHORT, O1.BCU_CD, C2.CSHORT AS BCU_CSHORT, \
FROM ORDERS O1 \
LEFT JOIN CUSTOMER C1 ON O1.OCU_CD = C1.CU_CD \
LEFT JOIN CUSTOMER C2 ON O1.BCU_CD = C2.CU_CD \
WHERE O1.OR_NB = 332 ";

C++ uses \ as a continuation character, so the select ends up
being parsed as a single line. so if the table orders does not
exist, it dutifully reports it as character 84 on line 1, which means
absolutely nothing to me. However if it dumped the sql with an
indicator, say ^ at that position, then that means something.

Paul














Paul Schmidt
Tricat Technologies
paul@...
www.tricattechnologies.com