× 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.



Hi,

VALUES as replacement for a dummy select statement was introduced with
release 6.1.
The advantage of VALUES over a dummy select statement is, the function can
be accessed directly, while with a dummy select statement a query
optimization (i.e. FULL OPEN) must be performed. Even though those
optimizations are fast, if you need to execute a lot of those dummy
statements, performance may decrease noticeable.

VALUES ... INTO is another animal, which can be used in SQL programming as
replacement for SELECT ... INTO or SET, to return a single row (or value)
out of an SELECT-Statement.
Contrary to SELECT ... INTO, VALUES ... INTO can be used with dynamic SQL.
VALUES ... INTO is available for a long time. IIRC I already used it with
the releases V4.

Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"

-----Ursprüngliche Nachricht-----
Von: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] Im Auftrag von
Lennon_s_j@xxxxxxxxxxx
Gesendet: Friday, 01. October 2010 02:52
An: midrange-l@xxxxxxxxxxxx
Betreff: Re: Get next Tuesday. Or the one after (VALUES)

Interesting info on values.

I was running from the green screen STRSQL on a V5R3 system. Tonight I
tried using values:
values week(Current date)
INTO clause missing from embedded statement.
So I'm guessing you can use it only in embedded SQL. Or else I'm doing
it wrongly.

I also took a peek at the V6R1 SQL Reference and it still contains
numerous examples that use SYSDUMMY1. Do you recall where you saw it as
deprecated?

(Finally found the V7R1 reference and it seems to contain the same examples)

Thanks, Sam

On 9/30/2010 9:30 AM, rob@xxxxxxxxx wrote:
The use of sysdummy1 has been deprecated on supported versions of the
operating system. I suggest you use VALUES instead of SELECT for
instances when you are tempted to use sysdummy1

Replace:
select week(current date) from sysibm/sysdummy1
With:
values week(current date)
or in sql rpg
exec sql values week(current date) into :WeekNumber;


Rob Berendt

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.