Wrox Home  
Search P2P Archive for: Go

  Return to Index  

activex_data_objects thread: Re: Reading and Writing CLOBS to Oracle using ADO


Message #1 by "Neil Schlossberg" <neils@r...> on Fri, 3 Jan 2003 15:43:49
Hey David,





> 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")
> 
> 
Message #2 by "Neil Schlossberg" <neils@r...> on Fri, 3 Jan 2003 15:44:56
Hey David,
 I need to read a clob field also from Oracle 8i.

could you send me an example of the stored procedure that is called here?




> 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