Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: CLOB to String conversion in ASP
Christophe Lecas wrote:
>
>
> I'm retieving a CLOB field from an Oracle 8i database and I just want to
> write the content on my page. The code is:
>
> <%
> Set OraSession = CreateObject("OracleInProcServer.XOraSession")
> Set OraDatabase = OraSession.OpenDatabase("dbname", "login/password", 0)
> Set OraDynaset = OraDatabase.CreateDynaset("SELECT clobfield FROM mytable
> WHERE ..... ",0)
> %>
>
> The type name for the clobfield is IOraClob.
>
> The problem is that I don't know how to convert this IOraClob to a string
in
> order to do a response.write() of it.
>
> <% response.write(OraDynaset.fields("emailmessagebody").value) %> returns
an
> error
> "Missing Default property"
> <% response.write(CStr(OraDynaset.fields("emailmessagebody").value)) %>
> returns an
> error "Object does not support this property or method"
>
> What is the best way to convert this IOraClob into a string ?
>
> Thanks
>
>
>
>
>
>
>
Without knowing anything about ASP I can tell you that you can use the
DBMS_LOB package to write the CLOB out in chunks. You could then assign
the chunks to a variable of type VARCHAR2 (basically a string) and then
assign that to a string type. You could also write the entire CLOB out to
a file using the UTL_FILE package. If you are interested in a snippet of
code to do this let me know.
HTH RC
--
Posted via CNET Help.com
http://www.help.com/
Received on Wed Dec 29 1999 - 16:30:35 CST
![]() |
![]() |