Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: WWW and ORACLE integration question

Re: WWW and ORACLE integration question

From: Martin Smith <mfsmith_at_erols.com>
Date: 1997/05/28
Message-ID: <338D05A8.6EC8@erols.com>#1/1

CGI is said to be pretty inefficient. Oracle has a Web solution, of course. But there are lots of others, too, most of which access Oracle. We are experimenting with MS IIS (comes with NT Server) which has a system called Active Server Pages (ASP) (also free with NT Server.) With ASP, you create .ASP files that are a mixture of "VB Script" (version of Basic) and HTML. The VBScript lets you do full programming logic to build your HTML (conditions, etc.); ASP also includes several "components", including one (Active Data Object) for accessing databases like Access and Oracle. To make an HTML table from any Oracle table or view, you code (approximately)--

	<% 'This indicates start of VBScript code
	Set MyConnection = Server.CreateObject("ADODB.Connection")
	Set MyCursor = Server.CreateObject("ADODB.RecordSet")
	MyConnection.Open "ODBCSOurceName", "userID", "password"  
	sql= "Select * from Mytable where Col_X like 'Whatever%'"
	MyCursor.Open sql, MyConnection

	TempArray = MyCursor.GetRows

' TempArray is automatically dimensioned to fit the number ' of rows
and number of fields.
' This indicates end of VBScript code %>
This line (not within "<% %>" )would just appear as text in the browser page. The following HTML would be interpreted by the client to
produce a table.
	<TABLE>
		<% For i = 0 to ubound(TempArray,2) %>
		<TR>
			<% for j = 0 to ubound(TempArray,1) %>
			<TD>  <% = TempArray(i,j) %> </TD>
			<% next %>
		</TR>
		<% next %>
		</TABLE>


The above gets all rows into an array where they can be worked with; you can (more commonly) move row-by-row through the cursor--like a PL/SQL fetch--bi-directionally if the ODBC driver supports it.                 

        The .ASP files are used like .HTML files, except that they are preprocessed by the NT/IIS server, which interprets the VB Script and builds a "pure" HTML file, which is passed to the browser for its normal processing.

So far, this approach looks pretty nice. I'd like to find a report writer "component" so I could be a little less low-level. Scalability is untested, but performance seems quick. ODBC driver support for Oracle is not as complete as I'd like.

Oh, yeah: in principle you can modify & add records with built-in "methods" called AddNew and Update, but I haven't tested that. I have passed a SQL 'Create' statement "by hand" via the .OPEN method--that works.

Let us know what you come up with . . .

Martin Smith                 

djose_at_att.com wrote:

> 
> Hello everyone,
> 
> I am quiet familiar with oracle and new to the web developement scene.
> 
> I am trying to prototype a simple application which
> does an
>         add
>         modify
>         view
>         delete
> 
> to a single oracle table from the web.
> 
> My questions are as follows
> ----------------------------
> 
> 1. What are the reqd software components to be written ?
>     HTML, CGI's etc
> 
> 2. What is exactly a CGI ? ( in simple words please )
> 
> 3. Assuming that the software components are in place how do I make
>    my machine 'viewable' to the world ?
> 
> 4. Can someone who has gone thru the learning curve suggest suitable
>    web-sites which help integrate an oracle database to WWW ?
> 
> Thanks a lot for your time and patience.
> 
> regards,
> Jude
> 
> -------------------==== Posted via Deja News ====-----------------------
>       http://www.dejanews.com/     Search, Read, Post to Usenet
Received on Wed May 28 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US