473,387 Members | 1,528 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 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 "APPS.XXVAA_E_RECRUITMENT_HA_IF", line 13
ORA-06512: at line 1

The code i am executing is

oConn.Open();
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;";
cmdLob.Parameters.Add(new
OracleParameter("tempblob",OracleType.Blob)).Direc tion =
ParameterDirection.Output;
cmdLob.ExecuteNonQuery();

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

LobApplicantXML.BeginBatch(OracleLobOpenMode.ReadW rite);
LobApplicantXML.Write(tempbuff,0,tempbuff.Length);
LobApplicantXML.EndBatch();
cmdLob.Parameters.Clear();

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;

cmdLob.ExecuteNonQuery();

tx.Commit();

***********

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


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

Thanks
Aug 23 '06 #1
0 3802

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

Similar topics

1
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...
11
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?
12
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...
0
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...
9
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...
2
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...
1
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...
8
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...
23
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 9.2.0.1.0...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.