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



I have a decision support table that has arrays of fields that I want to
update some of the data and not others.

I have a data structure to maps to the table.

d LEADINDDS ds
d CDATE 7P 0
d CTIME 6P 0
d LCYTM 7P 2 DIM(13) INZ(0)
d LCY1M 7P 2 DIM(13) INZ(0)
d LCY2M 7P 2 DIM(13) INZ(0)
d LACR 5P 2 DIM(12) INZ(0)
d LICR 5P 2 DIM(12) INZ(0)
d LOCR 5P 2 DIM(12) INZ(0)
d LMCR 5P 2 DIM(13) INZ(0)
d LM1CR 5P 2 DIM(13) INZ(0)
d LM2CR 5P 2 DIM(13) INZ(0)
d LONT 9P 2 DIM(13) INZ(0)
d LACP 9P 2 DIM(13) INZ(0)
d LPRB 9P 2 DIM(13) INZ(0)
d LVARH 5P 2 DIM(13) INZ(0)
d LSCR 5P 2 DIM(13) INZ(0)
d LRWR 5P 2 DIM(13) INZ(0)
d LSHP 5P 2 DIM(13) INZ(0)
d LEMF 5P 2 DIM(13) INZ(0)
d LPLN 5P 2 DIM(13) INZ(0)
d LPL 11P 2 DIM(13) INZ(0)

Is it possible to update all fields using an Update Where Current of
statement?

Exec Sql Declare C1 Cursor For
Select *
From LEADIND;
For Update;

Exec Sql Open C1;

Exec Sql Fetch Next From C1 Into :LEADINDDS;

// Do my updating.

Exec Sql Update LEADIND
Set Row = :LEADINDDS
Where Current Of C1;

The compile fails with update statement.

I found an example online of

Exec Sql Update LEADIND
Set Row = :LEADINDDS
Where CRDATE = 1071001;

If I wanted to a positioned update of all fields, how would I do it?

Also, can you do a select into with all fields? I keep getting a compile
error.

Exec Sql Select *
Into :LEADINDDS
From LEADIND;

Thanks for the help.


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.