Subject | Re: [firebird-support] system tables - second attempt. |
---|---|
Author | Mitchell Peek |
Post date | 2005-04-18T19:08:32Z |
Geoff Worboys wrote:
not reveal.
arduous, and I was searching to see if there was a shortcut that I
didn't know about. Obviously there isn't, but, nothing ventured....
my knowledge, before the question, was the fact that "THIS" and THIS
was equivalent, until pointed out by Martijn. Now that this is known,
you are correct, double quotes everywhere won't hurt anything.
I removed all the extraneous parsing routines. It is certainly less
code, more readable and maintainable and appears to be working.
my liking.
Thanks!
>(As you know) if you are talking to a dialect 3 database thenAnd finally, a direct answer to my question.
>quoted names are possible - BUT there is no "flag" to indicate
>whether a field was originally created with quotes or not.
>
>
>"FROM" is a valid identifier whereas FROM is a keyword andGood point. And just a check looking for lowercase and/or spaces will
>cannot be used as an identifier.
>
not reveal.
>"1ST" is a valid identifier whereas 1ST would cause ananother good point.
>error.
>
>If your database policy allows the use of quoted identifiersAnd is what I have now. As I said, it is working, but yes, it was
>then you have (at least) two options...
>
>
>* You could try to be smart and determine whether the characters
>in the name will require quoting - just remember that the first
>character has different requirements to the rest (eg: "1ST").
>If you follow this approach you also need a list of keywords to
>check whether quotes are needed regardless of the validity of
>the characters (eg: "FIRST").
>
>This can be somewhat arduous to code but having seen it in
>action (in IBObjects) it works pretty well.
>
>
>
arduous, and I was searching to see if there was a shortcut that I
didn't know about. Obviously there isn't, but, nothing ventured....
>* Quote everything. There is no harm in creating trigger andIt also
>stored procedure code that uses redundant quotes (eg: "THIS").
>Since the code is automatically produced who cares whether it
>looks exactly like what the user would have written.
>
>has the advantage of "future proofing" the SQL code for newAgreed, no one cares what it "looks" like. The other thing missing from
>versions of FB that may introduce new keywords. (Take a look
>at some of the new keywords that came with v1 and v1.5 and
>you can see the potential hazards.)
>
>
my knowledge, before the question, was the fact that "THIS" and THIS
was equivalent, until pointed out by Martijn. Now that this is known,
you are correct, double quotes everywhere won't hurt anything.
I removed all the extraneous parsing routines. It is certainly less
code, more readable and maintainable and appears to be working.
>There is also another way to approach your particularIt wasn't that hard of a task, and doing it myself, I can customize to
>requirement. Use something already written for the task. See
>IBLogManager at http://www.upscene.com/
>
>
my liking.
Thanks!