Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get VALUES from FILE

Status
Not open for further replies.

gparthas

Programmer
Feb 10, 2004
1
US
I am trying to do the following. I am trying to identify all the locations assigned to a USER in an ORACLE table. But how do I populate all the returned values into a drop down box? The following code, only obtains the first value.

SQL ORA
select locations AS LOC
FROM user t
WHERE Upper(t.userid) = Upper('&MRUSER')
;
TABLE FILE SQLOUT
PRINT
LOC AS 'LOC'
ON TABLE HOLD AS LOCHLD1
END
-RUN
DEFINE FILE LOCHLD1
RLOC1/A55 = '<option value=&quot;'|| LOC ||'&quot;>' || LOC ;
END

Thanks in advance
 
The code looks right to me. How many records are returned from the SQL? Once you do the DEFINE, I assume you have a TABLE FILE LOCHDL1
PRINT RLOC1
ON TABLE SAVE LOCLIST
END
-RUN
-HTMLFORM formname

Where the HTMLFORM has a !IBI.FIL.LOCLIST;
 
Why are you doing the define after the TABLE FILE request?
This is code that I used to populate a drop down box.

DEFINE FILE COMPANY
OPTCOMPANY/A80 = '<OPTION VALUE="' | CMPY_NUMBER || '">' | CMPY_NAME;
END

TABLE FILE COMPANY
SUM OPTCOMPANY
BY CMPY_NAME NOPRINT
&COMPWHER
WHERE CMPY_STATUS EQ 'A' OR 'B'
ON TABLE HOLD AS CLIST FORMAT ALPHA
END
-RUN

And this is how I display it in the HTML code.

<TD width=50%><STRONG>Company/Vendor Name:</STRONG><SELECT name=compnoa size=1
onChange="CheckIt(this.options[selectedIndex].value,this.form)">
<OPTION value=''>All companies</OPTION>
!IBI.FIL.CLIST;
</SELECT>
</td>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top