[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Separate strings for quotes.



Hello all,

This is by no means meant as criticism of anyone.  I have seen this done
several times and am wondering why people do it.  In an answer to a
previous question on the list someone sent the following code using a
separate string for each quote character he wanted to add.

> let $WhereClause = 'Where (A.HMRGP = ' || '''' || '01' || ''''
> let $WhereClause = $WhereClause || ' or A.HMRGP = ' || '''' || '15' || '''' 
>|| ')'
>
Most of the quotes and all of the concatenation are unnecessary.  The
above could be replaced with the following code:

Let $WhereClause = 'where (A.HMRGP = ''01'' or A.HMRGP = ''15'')'

I am just curious why people like to treat the "'" character so
specially.

Cheers,
Eric



--
------------------------------------------------------------------------
Eric Dimick Eastman  | To match what we [humans] can do, there would
Ray Ontko & Co.      | have to 3 billion of them [computers] . . .
erice@ontko.com      | wired together, . . . talking incessantly.
http://www.ontko.com |           Lewis Thomas, The Lives of a Cell 1974