Subject | Re: [Firebird-Architect] Literal strings and quotes |
---|---|
Author | Martijn Tonies |
Post date | 2009-05-25T08:30:03Z |
>> What if i need this sequence inside my literal ? What ifIt doesn't really matter, if you accept user input, use parameters
>> literal is user-defined and we can't prevent user from entering
>> this sequence ?
>
> Aside from Adriano's response - that this is primarily intended
> 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 >'
and it's solved. It's really a matter if you use Q' .... '
With regards,
Martijn Tonies
Upscene Productions
http://www.upscene.com
Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
Anywhere, MySQL, InterBase, NexusDB and Firebird!
Database questions? Check the forum:
http://www.databasedevelopmentforum.com
> 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
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>