Solved

query oracle db with asp or other server-side scripting

Posted on 2010-11-08
2
429 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

744 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now