×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Get VALUES from FILE

Get VALUES from FILE

Get VALUES from FILE

(OP)
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="'|| LOC ||'">' || LOC ;
END

Thanks in advance

RE: Get VALUES from FILE

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;

RE: Get VALUES from FILE

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>

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close