Files on disk to oracle blob column

hi,

i have read andre’s article and tried to push files which is stored in disk (after detaching from notes document using embedded object class).

am trying to read the file contents uisng “file” connector, but field list is not getting populated, i get “object variable not set” error.

here is my code …

Any help greatly appreciated … andre … as you said in email, i have posted query in forum … look forward to your help/reply.

many Thanks

-Anand Kannan.

==============

Sub Initialize

Dim lcora As LCConnection

Dim lcfile As LCConnection



Dim fldlistora As LCFieldList

Dim fldlistfile As LCFieldList



Dim fldattid As LCField

Dim fldattname	As LCField

Dim fldattdata As LCField



Set lcora = New LCConnection ("ORACLE")

Set lcfile = New LCConnection("file")



Set fldattid = New LCField(LCTYPE_INT)

Call fldattid.SetInt(1, 1001)

Set fldattname = New LCField(LCTYPE_TEXT)

Set fldattdata = New LCField(LCTYPE_BINARY)



Set fldlistora = New LCFieldList(1)

Call fldlistora.IncludeField(1, fldattid, "att_id")

Call fldlistora.IncludeField(2, fldattname, "att_name")

Call fldlistora.IncludeField(3, fldattdata, "att_data")



lcFile.Database = "g:\LCAttachments" 'set file connector to use new directory.

lcFile.Metadata = "CallReport"

lcFile.Binary = True	' the files we're working with are binary



lcora.MapByName = True

lcora.server = "XE"

lcora.userid = "system"

lcora.password = "password"

lcora.Metadata = "ATT_TEST"



lcfile.Connect

'lcfile.Action(LCACTION_TRUNCATE)  ' delete all file in temp dir first ...



lcora.Connect

Msgbox "connected to ora"



'Call lcora.Select(Nothing, 1, fldlistora)

Call lcFile.Select(Nothing, 1, fldlistfile)

'Call lcFile.Fetch(fldlistfile)



'Call fldlistora.MapName(fldlistfile, "Filename,Contents", "att_name,att_data")

'Call fldlistora.IncludeField(3, fldattid, "att_id")



Do While lcFile.Fetch(fldlistfile)

	Set fldattname = fldlistfile.Lookup("FileName")

	Set fldattdata = fldlistfile.Lookup("Contents")

	Call lcora.Insert(fldlistora)

Loop

End Sub

==============

Subject: Files on disk to oracle blob column

Further to my previous post … i am able to populate fldlistfile (LCFieldList in above code) … by instantiating it as follows.Set fldlistfile = New LCFieldList(1).

When i debug i am able to see fieldlist getting populated with file contents … but when i try to insert with …

Call lcora.Insert(fldlistora)

getting following error “Invavalid data type for field ATT_DATA”, which is actually of type BLOB in oracle table.

Any help to overcome the problem would be greatly appreciated.

-Thanks

Anand Kannan.

Subject: RE: Files on disk to oracle blob column

It appears that the technical article posted by IBM …IBM Developer

is WORTH for TRASH … many people seems to have complained about the same problem and no solution yet!

sorry for being little uncouth, but it seems to be the truth.

folks correct me if i am wrong.

-AK.

Subject: RE: Files on disk to oracle blob column

What version of Oracle are you using? I suspect your problem might be from using the Oracle 7 connector with an Oracle 8 database. (New LCConnection(“oracle”) for Oracle 7, New LCConnection(“oracle8”) for Oracle 8).

If this is your problem, perhaps you could find the many other people who you say have had the same problem and post a solution for them. I don’t know who they are – and please note, if this is your problem, it comes from your not reading the documentation carefully – not from a trashy article.

Subject: RE: Files on disk to oracle blob column

hi andre,

found the same on my own by muckking thru’ several docs.

anyway thanks very much for your response, this is wonderul developer community to share knowledge/tips/solutions etc …

But if the forum monitores regularly of incoming posts and take action (say within two days), it would be great. Not sure whether my suggesstion is feasible to implement for every posts.

Thanks,

-AK.