Solved

query oracle db with asp or other server-side scripting

Posted on 2010-11-08
2
432 Views
Last Modified: 2012-05-10
oracle 10g r2 database
server 2003 r2/iis web server

i have a website that has a few dynamic requirements
this is being used with livelink web forms 9.7.2 however i can generalize the question

a html website comprised mostly of forms (text boxes and drop-downs) will need to have a few html tables hidden/shown based on two oracle db lookups.  i was wondering if asp could help me achieve this goal?  of course with some javascript to hide/show the tables.

a website is going to load with a text box already containing a value.  this text box is called
LL_FormTag_1_2_1

the value in that text box is a unique id which will be used to query a specific row in the LL_PAF_Form table.  in the LL_PAF_From table there is a column titled ProjectNumber and this value is what's contained in the LL_FormTag_1_2_1 text box. i need to return results from this row which will help to build the next query.

i need to query how many managers are required to approve an order.  the number of managers required exists in the LL_PAF_Form table, column ManagersRequired.  this is a number, 1-6.  if the value is 4, then 4 html tables will be shown (hence the javascript)

select ManagersRequired from LL_PAF_Form where ProjectNumber =  **ValueFromFirstQuery**


from a high level:
- query oracle db
- hide/show html tables based on query results

thanks for the help!!!
0
Comment
Question by:sknoll84
  • 2
2 Comments
 
LVL 25

Accepted Solution

by:
jrb1 earned 500 total points
ID: 34102987
Sure, something like this will pull Oracle into ASP:

<%
  Set OraSession  = Server.CreateObject("OracleInProcServer.XOraSession")
  Set OraDatabase = OraSession.DbOpenDatabase("connect_str.world", "userid/password",cint(0))

  Set osRecordSet = OraDatabase.DbCreateDynaset("SELECT ManagersRequired FROM LL_PAF_Form where ProjectNumber =" & projectNum, cint(0))              

  If osRecordset.EOF = FALSE Then
     Response.write(osRecordset.Fields("TNAME") & " ")
  End If

  Set OraSession = Nothing
%>

Here are a couple of good pages to look at:

http://www.asp101.com/articles/colin/oracle/default.asp
http://www.orafaq.com/wiki/ASP
0
 
LVL 25

Expert Comment

by:jrb1
ID: 34102997
One change....

Response.write(osRecordset.Fields("ManagersRequired") & " ")
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question