Charles,

No. SELECT INTO syntax is not available in Net.Data.

You must assign the value to a global variable in order for it to be used elsewhere.
You can make the variable global by declaring it via a %define statement or simply by returning it as an OUT parameter.
The following example uses the getvar function to get a variable and assigns it to myvar which is then available for use anywhere else as demonstrated by the tstvar function.

%function(dtw_sql) getvar(out myvar) {
select IBMREQD from sysibm/sysdummy1
%report { %row { @dtw_assign(myvar,V1) %} %}
%}
%function(dtw_sql) tstvar() {
select count(*) from sysibm/sysdummy1
where IBMREQD = '$(myvar)'
%report { %row { <br>count = $(V1) %} %}
%}
%html(macro) {
@getvar(myvar)
<br>myvar = $(myvar)
@tstvar()
%}

Peter

-----Original Message-----
From: WEB400 [mailto:web400-bounces@xxxxxxxxxxxx] On Behalf Of Charles Wilt
Sent: Saturday, 24 January 2015 5:39 a.m.
To: Web Enabling the AS400 / iSeries
Subject: [WEB400] SELECT INTO in Net.Data

Inside of a Net.Data macro, I need to lookup a value, save it and then use it in the where clause of some other queries.

Does SELECT INTO work in Net.Data?

Charles
--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list To post a message email: WEB400@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at http://archive.midrange.com/web400.

#####################################################################################

This correspondence is for the named person's use only. It may
contain confidential or legally privileged information, or both.
No confidentiality or privilege is waived or lost by any
mistransmission. If you receive this correspondence in error,
please immediately delete it from your system and notify the sender.
You must not disclose, copy or rely on any part of this correspondence
if you are not the intended recipient. Any views expressed in this
message are those of the individual sender, except where the sender
expressly, and with authority, states them to be the views of
Veda. If you need assistance, please contact Veda :-
Australia http://www.veda.com.au/contact-us or New Zealand +64 9 367 6200

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.