× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



message: 5
date: Thu, 26 Apr 2012 11:12:59 -0700
from: CRPence <CRPbottle@xxxxxxxxx>
subject: Re: SQL using WITH/AS (Solved)

On Thu, 26 Apr 2012 11:12:59, Chuck Pence wrote:

As with the delimited column name suggestion in my earlier reply,
that assists for reserved words as well. The use of a delimited
identifier can prevent such issues; e.g.:

with
temp (current) as (select intcol from qsys2/qsqptabl)
select * from temp where "CURRENT">0

For consistency however, perhaps better:

with
temp ("CURRENT") as (select intcol from qsys2/qsqptabl)
select * from temp where "CURRENT">0

To prevent ever having the issue arise for a previously functional
statement, due to a newly added reserved word, the delimiters can be
added to column names whenever\wherever. The delimiters are optional in
whatever context the usage as a column identifier can be safely assumed
by the parser\syntax-checker. Always best to review the list of
reserved words from the most recent release, to know what identifiers to
avoid or to delimit; e.g.:

Thanks for the info on using delimiters with the column identifiers. Again,
I learned something new today.

Buzz



As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.