Home » Developer & Programmer » Forms » LOB manipulation using the OLE2 package and Oracle Objects for OLE
LOB manipulation using the OLE2 package and Oracle Objects for OLE [message #83090] Tue, 05 August 2003 09:46 Go to next message
jimmy
Messages: 21
Registered: November 2000
Junior Member
Hello,

I'm kindly requesting if someone could give me a piece of help regarding the following issue:

I'm currently using(and works fine) the following code in an ASP page that extracts LOB data
stored in the database and more specifically the contents of files of various content that are
stored inside the DB enabling users to view and further manipulate the file(s) through a web
interface i've created :

<% @Language=VBScript %>
<% Option Explicit %>

<%
Dim OraSession
Dim OraDatabase
Dim lob_data
Dim lob_recset

Set OraSession = Server.CreateObject("OracleInProcServer.XOraSession")
Set OraDatabase = OraSession.OpenDatabase("orasrv","test/test", 0)
set lob_recset = OraDatabase.CreateDynaset ("SELECT lob_obj FROM test.lob_tbl WHERE test.lob_tbl.rec_id =" & Request("recid"),0)
set lob_data = lob_recset.Fields("lob_obj").Value
lob_data.CopyToFile Server.MapPath(".") & "extractions" & Request("filename") & "." & Request("ext")

Set lob_data = nothing
Set lob_recset = nothing
Set OraDatabase = nothing
Set OraSession = nothing

'show the extracted file.
Response.Redirect "http://" & Request.ServerVariables("HTTP_HOST") & "/ora/test/lob/extractions/" & Request("filename") & "." & Request("ext")

%>

The question is if this approach could also be implemented(not the web part of it - i used the above code only as an example) inside Oracle Forms through the use
of the OLE2 package and Oracle Objects for OLE(OO4O automation server) and if it is possible
how could this be done(a short sample code would be ideal if it is not too much trouble).
What i'm trying to achive is an "easy" way to extract
files stored as LOB objects to the clients' local
filesystem.

Oracle Server : 8i
Forms software used : Forms 6i

Thank you all in advance.
Re: LOB manipulation using the OLE2 package and Oracle Objects for OLE [message #83091 is a reply to message #83090] Tue, 05 August 2003 09:55 Go to previous message
jimmy
Messages: 21
Registered: November 2000
Junior Member
The ASP code in my previous message doesn't appear ignore first message - this is the correct one(i hope)

Hello,

I'm kindly requesting if someone could give me a piece of help regarding the following issue:

I'm currently using(and works fine) the following code in an ASP page that extracts LOB data
stored in the database and more specifically the contents of files of various content that are
stored inside the DB enabling users to view and further manipulate the file(s) through a web
interface i've created :

@Language=VBScript
Option Explicit


Dim OraSession
Dim OraDatabase
Dim lob_data
Dim lob_recset

Set OraSession = Server.CreateObject("OracleInProcServer.XOraSession")
Set OraDatabase = OraSession.OpenDatabase("orasrv","test/test", 0)
set lob_recset = OraDatabase.CreateDynaset ("SELECT lob_obj FROM test.lob_tbl WHERE test.lob_tbl.rec_id =" & Request("recid"),0)
set lob_data = lob_recset.Fields("lob_obj").Value
lob_data.CopyToFile Server.MapPath(".") & "extractions" & Request("filename") & "." & Request("ext")

Set lob_data = nothing
Set lob_recset = nothing
Set OraDatabase = nothing
Set OraSession = nothing

'show the extracted file.
Response.Redirect "http://" & Request.ServerVariables("HTTP_HOST") & "/ora/test/lob/extractions/" & Request("filename") & "." & Request("ext")



The question is if this approach could also be implemented inside Oracle Forms through the use
of the OLE2 package and Oracle Objects for OLE(OO4O automation server) and if it is possible
how could this be done(a short sample code would be ideal if it is not too much trouble).

Oracle Server : 8i
Forms software used : Forms 6i

Thank you in advance.
Previous Topic: Frm-40222
Next Topic: reg Richtext box usage in forms
Goto Forum:
  


Current Time: Wed Apr 24 04:10:45 CDT 2024