Subject | Re: [Firebird-Architect] Literal strings and quotes |
---|---|
Author | Geoff Worboys |
Post date | 2009-05-25T01:45:50Z |
> What if i need this sequence inside my literal ? What ifAside from Adriano's response - that this is primarily intended
> literal is user-defined and we can't prevent user from entering
> this sequence ?
as sql-writers tool/feature rather than a "prompt an uneducated
user to fill in the blanks" feature - it is possible to solve
this even this problem.
Assumption: You are prompting for some user-defined text so
you must have an application that is parsing that text (as you
must have had before in order to check for quote chars etc).
The application can easily discover if the user input string
contains one or more instances of every possible closing
combination: ]' }' )' and >'
In the unlikely situation that this occurs what should the
application do? Easy, revert to the old quoting system!
(We are talking about SQL statements here, not megabytes of
random text, so additional parsing in the application is not
likely to be much of a problem. Even so, no-one is forcing
the application to support this quoting system - it is
syntactic sugar, that is all.)
The application has only very minor (and entirely optional)
complication added while those that write sql by hand gain a
mechanism that makes it much easier to write complex SQL.
--
Geoff Worboys
Telesis Computing