Solved

query oracle db with asp or other server-side scripting

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

685 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