main logo
Subject: RE: Passing large strings to an Oracle SP
Author: "Derek J. Kalweit"
Posted: 2002/12/30 14:58:00
 
View Entire Thread
New Search


Does Oracle have an OLEDB/ADO provider you can use directly with ADO =
instead of passing everything through ODBC?

--=20
Derek

> Anyone have experience passing ~2MB sized data to an Oracle SP using
> SQLEEXEC( ) or ADO? I need to pass entire files to an Oracle=20
> SP as an input
> parameter of type BLOB or CLOB but cannot get it to work.
>=20
> Thanks,
> Bo Durban
>=20
>=20
> ** VFP Example:
> nSQL =3D SQLSTRINGCONNECT( cOracleConnect )
> cData =3D FILETOSTR("Document.pdf") && 2MB file
> nResult =3D SQLEXEC(nSQL,"{call insert_file_blob(?cData)}") &&=20
> C'005 error
>=20
> cData =3D FILETOSTR("Document.pdf") && 2MB file
> cData =3D STRCONV(cData, 13) && Convert to base64
> nResult =3D SQLEXEC(nSQL,"{call insert_file_clob(?cData)}") &&=20
> C'005 error
>=20
>=20
> ** ADO Example:
> cData =3D FILETOSTR("Document.pdf") && 2MB file
> cData =3D STRCONV(cData, 13) && Convert to base64
>=20
> loConnection =3D CREATEOBJECT( "ADODB.Connection" )
> loConnection.CursorLocation =3D 2 && server-side cursor
> loConnection.Open( cOracleConnect )
>=20
> loCommand =3D CREATEOBJECT( "ADODB.Command" )
> loCommand.CommandType =3D 4 && by SP name
> loCommand.CommandText =3D "insert_file_clob"
> loCommand.ActiveConnection =3D loConnection
>=20
> loParameter =3D loCommand.CreateParameter()
> loParameter.Name =3D "p_lob" && name we assign
> loParameter.Type =3D 201 && long varchar string type
> loParameter.Direction =3D 1 && input parameter
> loParameter.Size =3D LEN(cData) && maximum length
> loParameter.Value =3D cData && initialize the parameter
> loCommand.Parameters.Append( loParameter )
>=20
> loCommand.Execute() && Error:
> && OLE IDispatch exception code 0 from Microsoft OLE DB Provider
> && for ODBC Drivers: [Oracle][ODBC][Ora]ORA-01460: unimplemented
> && or unreasonable conversion requested
>=20
> RELEASE loCommand
> loConnection.Close
> RELEASE loConnection



 
©2002 Derek J. Kalweit
<-- Prior Message New Search Next Message -->