472,354 Members | 1,289 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,354 software developers and data experts.

BLOB with oracle stored proc

I am new to using BLOB with oracle stored proc. I dont knw how to set the
size of the buffer which seems to overflow no matter what i used to pass it.
I am getting an error

System.Data.OracleClient.OracleException: ORA-06502: PL/SQL: numeric or
value error: character string buffer too small
ORA-06512: at line 1

The code i am executing is

OracleTransaction tx = oConn.BeginTransaction();
byte[] tempbuff =ConvertStringToByteArray(newHireXML);

//Creating a BLOB
OracleCommand cmdLob = oConn.CreateCommand();
cmdLob.Transaction = tx;
cmdLob.CommandText = "declare xx blob; begin dbms_lob.createtemporary(
xx, false, 0); :tempblob := xx; end;";
OracleParameter("tempblob",OracleType.Blob)).Direc tion =

OracleLob LobApplicantXML = (OracleLob)cmdLob.Parameters[0].Value;

LobApplicantXML.BeginBatch(OracleLobOpenMode.ReadW rite);

cmdLob.CommandText = "XXVAA_E_RECRUITMENT_HA_IF.main";
cmdLob.CommandType = CommandType.StoredProcedure;

//set store procedure parameters
cmdLob.Parameters.Add(new OracleParameter("p_applicant_xml",
OracleType.Blob)).Value = LobApplicantXML;
// cmdLob.Parameters.Add(new OracleParameter("p_applicant_xml",
OracleType.Blob)).Value = LobApplicantXML;
// cmdLob.Parameters.Add("p_applicant_xml", OracleType.Blob).Direction =
ParameterDirection.Input ;

cmdLob.Parameters.Add("p_success", OracleType.VarChar,10).Direction =
ParameterDirection.Output ;

cmdLob.Parameters.Add("p_error_text", OracleType.VarChar,2000).Direction
= ParameterDirection.Output;




public static byte[] ConvertStringToByteArray(string stringToConvert)
return (new UnicodeEncoding()).GetBytes(stringToConvert);

Coudl anyone help me overcome this buffer error.
Any help would be appreciated

Aug 23 '06 #1
0 3572

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Mohammad | last post by:
hi when i try to send a blob or Longraw value with more than 32k as parameter to stored procedure in oracle 9i, the following exception raise "ORA-01460 : Unimplemented or Unreasonable...
by: Chris Fink | last post by:
I have setup an Oracle table which contains a blob field. How do I insert data into this field using C# and ADO.net?
by: Newbie | last post by:
how can i call an oracle function to get data without using a select statement or stored procedures? given a project_no, i need to call the function: ops$sqltime.pa_new_job_no_fn which will...
by: Big George | last post by:
Hello, I'm trying to save a jpg file of 300KB as a BLOB field in an Oracle 10g Database. If I try to call a Stored Procedure, it fails. If I use CommandText with SQL sentence, it success. I...
by: matt | last post by:
hello, im doing my first ASP.NET app that inserts & retrieves files from Oracle (no need for a discussion on *that*!). i learned first-hand of the somewhat awkward technique for inserting...
by: =?Utf-8?B?Vmlua2k=?= | last post by:
Hello Everyone, I can successfully insert and update the oracle database by calling a oracles stored proc from my .net code. This oracle stored proc is returning some value. I cannot see that...
by: =?Utf-8?B?Vmlua2k=?= | last post by:
Hello Everyone, I can successfully insert and update the oracle database by calling a oracles stored proc from my .net code. This oracle stored proc is returning some value. I cannot see that...
by: colmkav | last post by:
Can someone tell me how I can access the return value of a function called from Oracle as opposed to a store proc from oracle? my oracle function is get_num_dates_varposfile. I am only used to...
by: Gloops | last post by:
Hello everybody, Is anyone able to give me some indications about how to develop an Access interface for an Oracle database ? I dispose of Access 2003 (11.6566.8107) SP2, Oracle 9i
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. header("Location:".$urlback); Is this the right layout the...
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.