Inserting clob data to Oracle


R

rh.krish

Hi,
I'm trying to insert clob data which is around 250K through stored
procedure in oracle. But I'm getting 'ORA-1460: unimplemented or
unreasonable conversion'. Here is my oracle stored procedure:

PROCEDURE saveResponseClob
(IDNum IN RPT.ID#%TYPE,
RptXml IN RPT.RPT_XML%TYPE,
ProgName IN RPT.CREATE_PROG_NAME%TYPE,
UserId IN RPT.CREATE_USER_ID%TYPE) IS
row_count NUMBER;
BEGIN
SELECT COUNT(*) INTO row_count FROM RPT WHERE AP# =
ApNum;
IF row_count = 0 THEN
INSERT INTO RPT
(ID#, RPT_XML, CREATE_PROG_NAME,
CREATE_USER_ID )
VALUES
(IDNum, RptXml, ProgName, SYSDATE,
UserId );
ELSE
UPDATE RPT
SET ID# = IDNum,
RPT_XML = RptXml,
CHG_LST_PROG_NAME = ProgName,
CHG_LST_DATE = SYSDATE,
CHG_LST_USER_ID = UserId
WHERE ID# = IDNum;
END IF;
EXCEPTION WHEN OTHERS THEN
NULL;
END saveResponseClob;

Here is my .NET code:

string idNum = "123";
string rptXml = "...."; // it has 250k data read from xml object.

OracleConnection con = new OracleConnection ( conStr );
OracleCommand cmd = new OracleCommand ( );
cmd.Connection = con;
cmd.CommandText = "saveResponseClob";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add ( Helper.AddParameter ( "IDNum", OracleType.VarChar,
idNum ));
cmd.Parameters.Add ( Helper.AddParameter ( "RptXml", OracleType.Clob,
rptXml ));
cmd.Parameters.Add ( Helper.AddParameter ( "ProgName",
OracleType.VarChar, progName ));
cmd.Parameters.Add ( Helper.AddParameter ( "UserId",
OracleType.VarChar, userID ));

cmd.ExecuteNonQuery ();

Helper.AddParameter creates an OracleParameter object and sets the
values with the passed parameters.

Any help is appreciated.

Regards,
Hari.
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top