Wrox Home  
Search P2P Archive for: Go

  Return to Index  

activex_data_objects thread: Reading and Writing CLOBS to Oracle using ADO


Message #1 by "Seamus Cummins" <seamus.cummins@e...> on Wed, 17 Oct 2001 00:39:55
Can anybody provide me with some sample code that reads and writes CLOB 

data types to an Oracle Database, using the Command object.

Message #2 by "david adams" <davidadams00@h...> on Wed, 17 Oct 2001 14:09:44
we use command objects to return clobs from stored procedures in oracle.

we use it to return xml streams from the stored procedures.



good luck

dav



Set m_oCM = New ADODB.Command



Set m_oCM.ActiveConnection = OpenConnection '<This function returns a   

pooled active connection.>



m_oCM.CommandType = adCmdStoredProc



m_oCM.CommandText = sProc '<This is a string value of the stored procedure 

name.>



m_oCM.Parameters.Append m_oCM.CreateParameter("shtml", adLongVarChar, 

adParamInputOutput, 1000000) '<This is our CLOB return val.>



m_oCM.Parameters.Append m_oCM.CreateParameter("resourceid", adDouble, 

adParamInput, 8, IIf(lSecurityId = 0, Null, lSecurityId)) '<This is a 

parameter for the stored procedure.>



m_oCM.Properties("SPPrmsLOB") = True '<CLOBs True.>

m_oCM.Execute '<Execute Cmd.>

m_oCM.Properties("SPPrmsLOB") = False '<CLOBs False.>

'True and False required because we use the function for all of our stored 

procedure executes.  we simply pass a boolean for an if-then construct as to 

whether we require clobs or recordsets.



oStream = m_oCM.Parameters.Item("shtml")






  Return to Index