Getting a value from the user and submitting it to a database requires the use of a form.
You therefore need two pages, a "front" page with the form to get the user input and a "back" page with the ASP code, to connect to the database.
This example also makes use of a function query2table. This formats the results from the database into a html table to make the results look better. Since it is a useful function that could be used in further ASP pages, it has been saved to a library file: ASPLib.asp
These examples were put together years ago, long before SQL-Injection was heard of, or understood. Allowing the user to type the value in the fields is not recommended, since it leaves it open to SQL-Injection and other nasties!
This is similar to the previous Emp form example. The difference is only one field is returned to make it more vunerable to UNION attacks.
It is better practice to allow the user to pick a value from a list instead. See this example instead, which uses Access, but the concepts are equally applicable to Oracle.
<h2><font color= "blue">Employee List</font></h2><!--#include file="_lib\ASPLib.asp"-->
<% SET myConn=SERVER.CreateObject("adodb.connection")
' request gets the value of the deptno variable
' see the string generated
<% SUB query2table(inputquery, conntemp)
' hardcode a space if value blank
<% ' close the connections