Last active
December 1, 2020 23:00
-
-
Save greghelton/ca4be0f024957a4fbec595007fa108a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
**free | |
dcl-s x packed(3:0) inz(0); | |
dcl-s y char(10) inz('Texas'); | |
dcl-s key char(10); | |
dcl-s val char(20); | |
dcl-s mysql CHAR(250) | |
inz(‘SELECT key1, prop1 FROM states_afflictions where key1 = ? UNION ALL + | |
SELECT key2, prop2 FROM states_afflictions where key2 = ? UNION ALL + | |
SELECT key3, prop3 FROM states_afflictions where key3 = ? for read only’); | |
exec sql | |
prepare s1 from :mysql; | |
exec sql | |
declare C1 cursor for s1; | |
exec sql | |
open C1 using :y, :y, :y; | |
dow SQLCOD = 0 AND X < 10; | |
exec sql | |
fetch next from C1 into :key, :val; | |
x = x + 1; | |
dsply val ; // at this point place data into table | |
enddo; | |
*INLR = *ON; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment