dbTalk Databases Forums  

Getting Error -3016 from ODP.Net

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss Getting Error -3016 from ODP.Net in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Terry
 
Posts: n/a

Default Getting Error -3016 from ODP.Net - 11-03-2006 , 10:16 AM






All:

I'm attempting to write a value into a Blob. The database is Oracle
8.0.6, and I've installed the ODAC 9.2.0.7.0. I'm calling this from an
ASP.Net v1.1 web service.

Here is the table definition:

TABLE_X_ATTACHMENTS_STAGE (
OBJID NUMBER,
CASE_ID VARCHAR2 (30) NOT NULL,
SITE_ID VARCHAR2 (30) NOT NULL,
FILE_NAME VARCHAR2 (512),
CONTENTS BLOB
)

Here's the code:

string sqlAttachmentCmd =
@"insert into sa.table_x_attachments_stage " +
"(objid, case_id, site_id, file_name, contents) " +
"values (3, :case_id, :site_id, :file_name, :contents)" ;

byte [] contentsByteArr =
Convert.FromBase64String(attachment.contents);
int retVal = 0;

conn=new OracleConnection(connstr);

conn.Open();
OracleParameter caseIDParameter = new
OracleParameter("case_id",caseID);
OracleParameter siteIDParameter = new
OracleParameter("site_id",siteID);
OracleParameter fileNameParameter = new
OracleParameter("file_name",attachment.fileName);
OracleParameter blobParameter = new
OracleParameter("contents",OracleDbType.Blob);

blobParameter.Value = contentsByteArr;

cmnd=new OracleCommand(sqlAttachmentCmd,conn);

cmnd.Parameters.Add(caseIDParameter);
cmnd.Parameters.Add(siteIDParameter);
cmnd.Parameters.Add(fileNameParameter);
cmnd.Parameters.Add(blobParameter);

retVal = cmnd.ExecuteNonQuery();

And here's the exception I'm receiving:

CaseAttachment(): Error
Number=-3016 => - Oracle Data Provider for .NET
Oracle.DataAccess.Client.OracleException at
Oracle.DataAccess.Client.OracleException.GetOpoErr (IntPtr opsErrCtx,
Int32 arrayBindIndex, String dataSrc, String procedure)
at Oracle.DataAccess.Client.OracleException.GetOpoErr Ctx(IntPtr
opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, IntPtr opsConCtx, String
dataSrc, String procedure)
at Oracle.DataAccess.Client.OracleException.HandleErr orHelper(Int32
errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx*
pOpoSqlValCtx, Object src, String procedure)
at Oracle.DataAccess.Types.OracleBlob.CreateTempLob()
at Oracle.DataAccess.Types.OracleBlob.Write(Byte[] buffer, Int32
offset, Int32 count)
at
Oracle.DataAccess.Client.OracleParameter.PreBind_B lob(OracleConnection
conn)
at Oracle.DataAccess.Client.OracleParameter.PreBind(O racleConnection
conn, IntPtr errCtx, Int32 arraySize)
at Oracle.DataAccess.Client.OracleCommand.ExecuteNonQ uery()

I'm at a loss as to the cause.

Suggestions?


Reply With Quote
  #2  
Old   
Frank van Bortel
 
Posts: n/a

Default Re: Getting Error -3016 from ODP.Net - 11-04-2006 , 12:28 AM






Terry schreef:
Quote:
All:

I'm attempting to write a value into a Blob. The database is Oracle
8.0.6, and I've installed the ODAC 9.2.0.7.0. I'm calling this from an
ASP.Net v1.1 web service.

Here is the table definition:

TABLE_X_ATTACHMENTS_STAGE (
OBJID NUMBER,
CASE_ID VARCHAR2 (30) NOT NULL,
SITE_ID VARCHAR2 (30) NOT NULL,
FILE_NAME VARCHAR2 (512),
CONTENTS BLOB
)

Here's the code:

string sqlAttachmentCmd =
@"insert into sa.table_x_attachments_stage " +
"(objid, case_id, site_id, file_name, contents) " +
"values (3, :case_id, :site_id, :file_name, :contents)" ;

byte [] contentsByteArr =
Convert.FromBase64String(attachment.contents);
int retVal = 0;

conn=new OracleConnection(connstr);

conn.Open();
OracleParameter caseIDParameter = new
OracleParameter("case_id",caseID);
OracleParameter siteIDParameter = new
OracleParameter("site_id",siteID);
OracleParameter fileNameParameter = new
OracleParameter("file_name",attachment.fileName);
OracleParameter blobParameter = new
OracleParameter("contents",OracleDbType.Blob);

blobParameter.Value = contentsByteArr;

cmnd=new OracleCommand(sqlAttachmentCmd,conn);

cmnd.Parameters.Add(caseIDParameter);
cmnd.Parameters.Add(siteIDParameter);
cmnd.Parameters.Add(fileNameParameter);
cmnd.Parameters.Add(blobParameter);

retVal = cmnd.ExecuteNonQuery();

And here's the exception I'm receiving:

CaseAttachment(): Error
Number=-3016 => - Oracle Data Provider for .NET
Oracle.DataAccess.Client.OracleException at
Oracle.DataAccess.Client.OracleException.GetOpoErr (IntPtr opsErrCtx,
Int32 arrayBindIndex, String dataSrc, String procedure)
at Oracle.DataAccess.Client.OracleException.GetOpoErr Ctx(IntPtr
opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, IntPtr opsConCtx, String
dataSrc, String procedure)
at Oracle.DataAccess.Client.OracleException.HandleErr orHelper(Int32
errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx*
pOpoSqlValCtx, Object src, String procedure)
at Oracle.DataAccess.Types.OracleBlob.CreateTempLob()
at Oracle.DataAccess.Types.OracleBlob.Write(Byte[] buffer, Int32
offset, Int32 count)
at
Oracle.DataAccess.Client.OracleParameter.PreBind_B lob(OracleConnection
conn)
at Oracle.DataAccess.Client.OracleParameter.PreBind(O racleConnection
conn, IntPtr errCtx, Int32 arraySize)
at Oracle.DataAccess.Client.OracleCommand.ExecuteNonQ uery()

I'm at a loss as to the cause.

Suggestions?

And what do you think the error signifies?

--
Regards,
Frank van Bortel

Top-posting is one way to shut me up...


Reply With Quote
  #3  
Old   
Terry
 
Posts: n/a

Default Re: Getting Error -3016 from ODP.Net - 11-06-2006 , 08:26 AM



Frank van Bortel wrote:
Quote:
And what do you think the error signifies?

Hi Frank:

I really have no idea - thus is why I've posted to this group.

I have since discovered that the same code works fine on a Oracle 9.2
DB. Thus, I suspect that it has something to do against the age/version
of the DB (it's 8.0.6, remember).

Does anyone know if there's a version 8 of ODP.Net? I "oldest" I could
locate was 9.2.

Thanks for replying Frank!



Reply With Quote
  #4  
Old   
Frank van Bortel
 
Posts: n/a

Default Re: Getting Error -3016 from ODP.Net - 11-07-2006 , 01:19 AM



Terry schreef:
Quote:
Frank van Bortel wrote:
And what do you think the error signifies?


Hi Frank:

I really have no idea - thus is why I've posted to this group.

I have since discovered that the same code works fine on a Oracle 9.2
DB. Thus, I suspect that it has something to do against the age/version
of the DB (it's 8.0.6, remember).

Does anyone know if there's a version 8 of ODP.Net? I "oldest" I could
locate was 9.2.

Thanks for replying Frank!

It's all documented:

http://www.oracle.com/pls/tahiti/tah...emark=docindex

8.0 is a wee bit old, laddy - hence the 8i link.

A decent platform has OERR utility:
[oracle9@csdb01 oracle9]$ oerr ora 3016
30160, 00000, "Unable to access the file"
// *Cause: The function was unable to access the existing the file.
//
// *Action: Check if the user has the required permissions on the file.
--
Regards,
Frank van Bortel

Top-posting is one way to shut me up...


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.