Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: ASP and LONGs
Oracle 8 uses CLOBS and BLOBS in addition to LONG/LONG RAW which offer other advantages. Here is an example that uses ASP and Oracle Objects for OLE (OO4O):
'The following sets up the data.
SQL> create table clob_table (clob_id number(5), clob_column CLOB); SQL> insert into clob_table values (1, EMPTY_CLOB()); SQL> update clob_table
'******************************************************The Global.asa file is as follows.
<OBJECT RUNAT=Server SCOPE=Application ID=OraSession
PROGID="OracleInProcServer.XOraSession">
</OBJECT>
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Application_OnStart
End Sub
Sub Session_OnStart
Set Session("OraDatabase") = OraSession.OpenDatabase
("V8i", "scott/tiger", 0)
Set OraDatabase = Session("OraDatabase") End Sub
Sub Session_OnEnd
Set Session("OraDatabase") = Nothing Set Session("OraDynaset") = NothingEnd Sub
The CLOBDemo.Asp page is
<%@ Language=VBScript %>
<%
session.Abandon
set OraDatabase=Session("OraDatabase")
set OraDynaset=OraDatabase.CreateDynaset("select clob_column from
clob_table where clob_id = 1 ", 0)
Set OraCLOB = OraDynaset.Fields("Clob_column").Value
amountRead = OraClob.Read (buffer)
Response.Write(buffer)
%>
-- -cheers DW -------------------------------------------------------------------- "It is a kind of good deed to say well; and yet words are not deeds. -William Shakespeare" Sent via Deja.com http://www.deja.com/Received on Mon Jan 22 2001 - 10:03:29 CST