Oracle Stored Procedure [CLOB out] - ASP
I am executing a stored procedure via ASP and getting a CLOB field back. It fails for big CLOBs (more then 4000 chars)..[Oracle][ODBC][Ora]ORA-06502: PL/SQL: numeric or value error ORA-06512: at line 1 .
My code:
Set conn = server.createobject("ADODB.connection")
conn.Open StrConn
Set comm = Server.CreateObject("ADODB.Command")
Set param = Server.CreateObject("ADODB.Parameter")
Set comm.ActiveConnection=conn
comm.CommandType=1
'********************************
'run stored procedure
'********************************
'var tpsid NUMBER;
'var viewType varchar2(3);
'var format varchar2(5);
'var tcNum NUMBER;
'var tpshtml CLOB;
'
'execute dbdev.tps_section.tps_html_gen(:tpshtml, :tpsid, :viewType, :format, :tcNum);
'*********************************
strSQL="{ call dbdev.tps_section.tps_html_gen(?, "&tpsid&", '"&ViewType&"', '"&format&"', "&tpstcm&", "& tpsverid &") }"
comm.CommandText =strSQL
set param = comm.CreateParameter(":tps_html",adLongVarWChar,adParamOutput,100000,"")
comm.Parameters.Append param
comm.Properties(0) = TRUE
comm.Execute
response.Write comm.Parameters(0).Value
------------------------------------------
My second attempt was to use OO4O but it doesn't seem to get the bind vaiable back.
---------------------------------------------------------
const ORATYPE_CLOB=112
Set OraSession = Server.CreateObject("OracleInProcServer.XOraSession")
Set OraDatabase = OraSession.DbOpenDatabase("test200", "guest/guest",cint(0))
OraDatabase.Parameters.Add "OutVar", OutVar, ORAPARM_OUTPUT
OraDatabase.Parameters("OutVar").ServerType = ORATYPE_CLOB
strSQL="call dbdev.tps_section.tps_html_gen(:tps_html, "&tpsid&", '"&ViewType&"', '"&format&"', "&tpstcm&", "& tpsverid &")"
Set OraSQLStmt=OraDatabase.CreateSql(strSQL, ORASQL_FAILEXEC)
response.Write OraDatabase.Parameters("tps_html").Value
---------------------------------------------------------
Please Help!