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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Have LONG, need CLOB, want answer!

Re: Have LONG, need CLOB, want answer!

From: <shmurphy_at_my-deja.com>
Date: Wed, 08 Sep 1999 20:15:36 GMT
Message-ID: <7r6g4q$ve$1@nnrp1.deja.com>


Aha! It worked! Thanks a trillion! We changed the LONG column in ORACLE to a LONG_RAW column and ORACLE seems compliant. To move data in and out as a LONG or LONG_RAW, you don't need C++ -- VB does fine, you just have to use parameters (see below).



'First query the table that has the LONG column dim sBodyText as string
dim sChunk as string
Do Until sChunk = ""

   sChunk = rs!BodyText.GetChunk(1024) & ""    sBodyText = sBodyText & sChunk
Loop



'Then use the variable in a parameter
Public cnNewConnection As New ADODB.Connection Public cmdNewCommand As New ADODB.Command sSQL = "INSERT INTO MyTable VALUES ("ABCD123" sSQL = sSQL & " AS DocTitle, ? AS BodyText" With cmdNewCommand

   If .ActiveConnection Is Nothing Then

      Set .ActiveConnection = cnNewConnection 'New ADODB.Connection    End If
.CommandText = sSQL
.Prepared = True
.Parameters.Append .CreateParameter("Body_Text", adLongVarBinary, ,
1000000, sBodyText) 'allowed a full meg for space

.Execute , , adCmdText + adExecuteNoRecords
.Parameters.Delete "Body_Text"

End With



If there's an easier way in VB, PLEASE let me know. -Sherry Murphy

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Wed Sep 08 1999 - 15:15:36 CDT

Original text of this message

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