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

Home -> Community -> Usenet -> c.d.o.tools -> Re: ASP and LONGs

Re: ASP and LONGs

From: DriftWood <drift_wood_at_my-deja.com>
Date: Mon, 22 Jan 2001 16:03:29 GMT
Message-ID: <94hlka$n48$1@nnrp1.deja.com>

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

  2 set clob_column = 'Hello World';
SQL> commit;
'******************************************************
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") = Nothing
   End Sub
</SCRIPT>

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

Original text of this message

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