ERROR WHILE INSERTING BLOBS AS PARAMETERS OF EXISTING STORED PROCEDURE

I have 2 simple tables to keep large application data (as XMLDOCUMENT in one table and BLOB in another):
SQL> desc bindata_tbl;
Name Null? Type
BDATA_ID NOT NULL NUMBER(10)
BDATA NOT NULL BLOB
SQL> desc metadata_tbl;
Name Null? Type
MDATA_ID NOT NULL NUMBER(10)
MDATA NOT NULL SYS.XMLTYPE
and stored preocedure to input new data into those tables:
"SP_TEST_BIN_META_DATA"
i_MetaData in METADATA_TBL.MDATA%TYPE,
i_BinData in BINDATA_TBL.BDATA%TYPE
as
begin
if i_MetaData is not null then
insert into METADATA_TBL (MDATA_ID, MDATA)
values (METADATA_SEQ.nextval, i_MetaData);
end if;
if i_BinData is not null then
insert into BINDATA_TBL (BDATA_ID, BDATA)
values (BINDATA_SEQ.nextval, i_BinData);
end if;
COMMIT;
-- Handle exceptions
EXCEPTION
WHEN OTHERS THEN
ROLLBACK;
RAISE;
end;
I communicate with database from .Net application using "Oracle.DataAccess 10.1.0.200 (Runtime version v1.0.3705)" component.
Following procesure is a [simplified] examlple of the code I use, which demonstrates the errors while inserting XMLDOCUMENT and BLOB values simultaneously.
In my application those should be quite big objects (~200 K XML and ~5-25M binary image data), but following sample keeps failing even with very small-sized objects:
Line Number
1          private void PureTest()
2          {
3               OracleConnection conn = null;
4               OracleTransaction tx = null;
5               OracleCommand command = null;
6
7               try
8               {
9                    // Open connection
10                    string strConn = "Data Source=AthenaWf; User ID=AthenaWf; Password=Poseidon";
11                    conn = new OracleConnection( strConn );
12                    conn.Open();
13
14                    // Begin transaction (not sure if really needed)
15                    tx = conn.BeginTransaction();
16
17                    // Create command
18                    string strSql = "SP_TEST_BIN_META_DATA";
19                    command = new OracleCommand();
20                    command.Connection = conn;
21                    command.CommandText = strSql;
22                    command.CommandType = CommandType.StoredProcedure;
23
24                    // Create parameters
25                    // 1) XmlType parameter
26                    string strXml = "<?xml version=\"1.0\"?><configuration testValue=\"123456789\"/>";
27                    XmlDocument xmlDoc = new XmlDocument();
28                    xmlDoc.LoadXml( strXml );
29                    OracleXmlType oraXml = new OracleXmlType( conn, xmlDoc );
30                    //oraXml = null;
31                    //
32                    OracleParameter xmlPrm = new OracleParameter();
33                    xmlPrm.ParameterName = "i_MetaData";
34                    xmlPrm.Direction = ParameterDirection.Input;
35                    xmlPrm.OracleDbType = OracleDbType.XmlType;
36                    xmlPrm.Value = oraXml;
37                    command.Parameters.Add( xmlPrm );
38
39                    // 2) Blob type
40                    byte[] buf = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
41                    OracleBlob oraBlob = new OracleBlob( conn, true );
42                    //oraBlob.Write( buf, 0, buf.Length );
43                    oraBlob = null;
44                    //
45                    OracleParameter blobPrm = new OracleParameter();
46                    blobPrm.ParameterName = "i_BinData";
47                    blobPrm.Direction = ParameterDirection.Input;
48                    blobPrm.OracleDbType = OracleDbType.Blob;
49                    blobPrm.Value = oraBlob;
50                    command.Parameters.Add( blobPrm );
51
52
53                    // Execute command finally
54                    command.ExecuteNonQuery();
55                    tx.Commit();
56               }
57               catch( Exception ex )
58               {
59                    // Clean-up
60                    if( command != null )
61                    {
62                         command.Dispose();
63                    }
64                    if( tx != null )
65                    {
66                         tx.Dispose();
67                    }
68                    if( conn != null )
69                    {
70                         conn.Dispose();
71                    }
72
73                    // Display error message
74                    MessageBox.Show( ex.Message, "Error" );
75               }
76          }
If I try insert only XMLDOCUMENT object (lines 30, 42 are commented out, 43 IS NOT) - everything is OK.
If I try to insert only BLOB object (lines 30, 42 are NOT COMMENTED OUT, line 43 is commented out) - everything is OK again.
If I try to insert them both having some values (lines 30, 43 are commented out, 42 is not commented out) - it fails right on "command.ExecuteNonQuery();" (line 54)
with the following exception:
"ORA-21500: internal error code, arguments: [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%]".
Even when I nullify oraBlob before assigning it to OracleParameter value (line 30 is commented out, line 42 and 43 are not) I have the same exception.
XMLDOCUMENT and DLOB data logically are very coupled objects (in my application), so I really want to insert them simultaneously in one stored procedure in transactional way.
Is it bug of drivers, server, .net environment, or I miss something in implementation?
PS. In some articles on Oracle web and in MSDN site I found a mention about necessity of wrapping all write/update operations in a transaction, while working with temporary LOBs. I use it here, but it does not look like changing anything.

Hello,
I tested your code with the 10.1.0.4.0 ODP and 10.1.0.4.0 Client and it worked fine.
Can you please apply the 10.1.0.4.0 patches for both ODP and client to see if this resolves the issue for you.
Here is the output from the same execution of the ODP application you provided as a testcase. These rows were inserted at the same time when I executed the application and passed the data as parameters to the SP you provided.
Results of Testing with 10.1.0.4.0
==========================
SQL> select count(*) from BINDATA_TBL
2 ;
COUNT(*)
1
SQL> select count(*) from METADATA_TBL;
COUNT(*)
1
SQL> select dbms_lob.getlength(bdata) from BINDATA_TBL;
DBMS_LOB.GETLENGTH(BDATA)
10
SQL> select mdata from METADATA_TBL;
MDATA
<?xml version="1.0"?><configuration testValue="123456789" />

Similar Messages

  • Error while refreshing bqy file on workspace using stored procedure

    Hi,
    I am using stored procedure which returns ref-cursor. The report is running fine locally but on Workspace, while refresh, it gives the following error.
    An Interactive Reporting Service error has occurred.-SQL API: [SQLNumResultCols], SQL RETURN: [-1], SQL STATE: [HY010], SQL NATIVE ERROR: [0], SQL MESSAGE: [[Microsoft][ODBC Driver Manager] Function sequence error]
    (0)
    I have ODBC/ODBC connection set up at BI+ configurator.
    Thanks,
    Manish

    We also met this issue. Some guy told me this is a Hyperion limitation, is it true? I really need this function in Hyperion:(

  • Error while inserting BLOB value in the database

    I am trying to insert a BLOB value in the database. This action results in the following exception:
    java.sql.SQLException: ORA-22925: operation would exceed maximum size allowed for a LOB value
    The method i am using is as follows:
    public void insertBlob(Connection Con, StringBuffer Message)throws SQLException
    String Query = "INSERT INTO MSGBLOCKS (MSGDB_ID, MSGBLOCKTYPE, MESSAGE) VALUES (20, 1 , ?)";
    PreparedStatement PS = Con.prepareStatement(Query);
    byte[] bytes = new String(Message).getBytes();
    ByteArrayInputStream bi = new ByteArrayInputStream(bytes);
    PS.setBinaryStream(1, bi, bytes.length);
    PS.executeUpdate();
    The manifest file of ojdbc14.jar being used is: 10.1.0.5.0 and I am using jdk 1.4.
    Also the message being tried to insert is of 9 Kb only.
    Any help would be greatly appreciated.
    Thanks!!!

    Did you check if the Message is having only that small 9kb of data? also check the maximum allowed size for that column in the Oracle DB, the size can be restricted to 8Kb also.
    Edited by: DynamicBasics on Jul 28, 2010 5:54 PM

  • Error while Inserting message in JMS

    Version : SOA 11G
    I am getting following error while inserting message in JMS.
    rror Message: {http://schemas.oracle.com/bpel/extension}bindingFault
    Fault ID     default/TestingSOA!2.0*soa_3b8b3493-6062-457c-8213-5dd613c95dd3/TransformData/30014-BpInv0-BpSeq0.3-4
    Fault Time     06-Dec-2010 03:25:10
    Non Recoverable System Fault :
    <bpelFault><faultType>0</faultType><bindingFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="summary"><summary>Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'Produce_Message' failed due to: ERRJMS_ERR_CR_QUEUE_PROD. ERRJMS_ERR_CR_QUEUE_PROD. Unable to create Queue producer due to JMSException. ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution. </summary></part><part name="detail"><detail>[JMSExceptions:045103]While trying to find a topic or a queue we could not find the specific JMSServer requested. The linked exception may contain more information about the reason for failure.</detail></part><part name="code"><code>null</code></part></bindingFault></bpelFault>
    Steps followed while creating JMS
    1. Login to weblogic console
    2. Click Services>Messaging>JMS Module
    3. Select SOAJMSModule
    4. Click new, select Queue and press Next
    5. Give JMS Name and JNDI
    5. Pick Subdepolyment as "SOASUBDeployment" from dropdown and select JMS Server as "SOAJMSServer" and click "Finish"

    Steps followed while creating JMS
    +1. Login to weblogic console+
    +2. Click Services>Messaging>JMS Module+
    +3. Select SOAJMSModule+
    +4. Click new, select Queue and press Next+
    +5. Give JMS Name and JNDI+
    +5. Pick Subdepolyment as "SOASUBDeployment" from dropdown and select JMS Server as "SOAJMSServer" and click "Finish"+
    Next u need to create Connection Factory and u need to update or create(if doesnt exist) a new plan.xml
    Follow the below link:
    http://www.packtpub.com/article/installation-configuration-oracle-soa-suite-11g-2

  • Error while migrating BLOB type data

    Hi ,
    I am migrating the data from oracle to oracle and both soruce and target tables have BLOB type field.
    I am getting error when I am executing the interface with these blob fields. But My interface is successfull if I am not maaping this blob files.
    Below is the error message.
    ODI-1217: Session BLOB (162501) fails with return code 942.
    ODI-1226: Step BLOB fails after 1 attempt(s).
    ODI-1240: Flow BLOB fails while performing a Loading operation. This flow loads target table IMAGES.
    ODI-1228: Task SrcSet0 (Loading) fails on the target ORACLE connection YAGLD.
    Caused By: java.sql.BatchUpdateException: ORA-00942: table or view does not exist
    Thanks,
    Patel.

    Duplicate of
    Error while migrating BLOB type data

  • Error while insert data using execute immediate in dynamic table in oracle

    Error while insert data using execute immediate in dynamic table created in oracle 11g .
    first the dynamic nested table (op_sample) was created using the executed immediate...
    object is
    CREATE OR REPLACE TYPE ASI.sub_mark AS OBJECT (
    mark1 number,
    mark2 number
    t_sub_mark is a class of type sub_mark
    CREATE OR REPLACE TYPE ASI.t_sub_mark is table of sub_mark;
    create table sam1(id number,name varchar2(30));
    nested table is created below:
    begin
    EXECUTE IMMEDIATE ' create table '||op_sample||'
    (id number,name varchar2(30),subject_obj t_sub_mark) nested table subject_obj store as nest_tab return as value';
    end;
    now data from sam1 table and object (subject_obj) are inserted into the dynamic table
    declare
    subject_obj t_sub_mark;
    begin
    subject_obj:= t_sub_mark();
    EXECUTE IMMEDIATE 'insert into op_sample (select id,name,subject_obj from sam1) ';
    end;
    and got the below error:
    ORA-00904: "SUBJECT_OBJ": invalid identifier
    ORA-06512: at line 7
    then when we tried to insert the data into the dynam_table with the subject_marks object as null,we received the following error..
    execute immediate 'insert into '||dynam_table ||'
    (SELECT

    887684 wrote:
    ORA-00904: "SUBJECT_OBJ": invalid identifier
    ORA-06512: at line 7The problem is that your variable subject_obj is not in scope inside the dynamic SQL you are building. The SQL engine does not know your PL/SQL variable, so it tries to find a column named SUBJECT_OBJ in your SAM1 table.
    If you need to use dynamic SQL for this, then you must bind the variable. Something like this:
    EXECUTE IMMEDIATE 'insert into op_sample (select id,name,:bind_subject_obj from sam1) ' USING subject_obj;Alternatively you might figure out to use static SQL rather than dynamic SQL (if possible for your project.) In static SQL the PL/SQL engine binds the variables for you automatically.

  • Error while Inserting DB

    Hi,
    We are getting the below error while inserting a record in to DB. It is not occuring always, as sometimes the transactions are passing and some times it is throwing the below error. Any one faced this issue and have solution for the same?
    The invocation resulted in an error: <jca-transport-application-error xmlns="http://www.bea.com/wli/sb/transports/jca" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <jca-transport-error-message>Invoke JCA outbound service failed with application error</jca-transport-error-message>
    <jca-runtime-fault-detail>
    <eis-error-code xsi:nil="true"/>
    <eis-error-message xsi:nil="true"/>
    <exception>com.bea.wli.sb.transports.jca.JCATransportException: oracle.tip.adapter.sa.api.JCABindingException: oracle.tip.adapter.sa.impl.fw.ext.org.collaxa.thirdparty.apache.wsif.WSIFException: servicebus:/WSDL/ServiceProcessor_1.00/src/osb/resources/wsdls/Service_DB_Write_1.00 [ ServiceDBAdp_ptt::insert(SampleMiddlewareLogCollection) ] - WSIF JCA Execute of operation 'insert' failed due to: DBWriteInteractionSpec Execute Failed Exception.
    insert failed. Descriptor name: [ServiceDBAdp.SampleMiddlewareLog].
    Caused by java.lang.ArrayIndexOutOfBoundsException.
    ; nested exception is:
    BINDING.JCA-11616
    DBWriteInteractionSpec Execute Failed Exception.
    insert failed. Descriptor name: [ServiceDBAdp.SampleMiddlewareLog].
    Caused by java.lang.ArrayIndexOutOfBoundsException.
    Please see the logs for the full DBAdapter logging output prior to this exception. This exception is considered not retriable, likely due to a modelling mistake.
    at com.bea.wli.sb.transports.jca.binding.JCATransportOutboundOperationBindingServiceImpl.invokeOneWay(JCATransportOutboundOperationBindingServiceImpl.java:114)
    at com.bea.wli.sb.transports.jca.JCATransportEndpoint.sendOneWay(JCATransportEndpoint.java:191)
    at com.bea.wli.sb.transports.jca.JCATransportEndpoint.send(JCATransportEndpoint.java:168)
    at com.bea.wli.sb.transports.jca.JCATransportProvider.sendMessageAsync(JCATransportProvider.java:598)
    at sun.reflect.GeneratedMethodAccessor900.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.bea.wli.sb.transports.Util$1.invoke(Util.java:83)
    at $Proxy142.sendMessageAsync(Unknown Source)
    at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageAsync(LoadBalanceFailoverListener.java:148)
    at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageToServiceAsync(LoadBalanceFailoverListener.java:603)
    at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageToService(LoadBalanceFailoverListener.java:538)
    at com.bea.wli.sb.transports.TransportManagerImpl.sendMessageToService(TransportManagerImpl.java:558)
    at com.bea.wli.sb.transports.TransportManagerImpl.sendMessageAsync(TransportManagerImpl.java:426)
    at com.bea.wli.sb.test.service.ServiceMessageSender.send0(ServiceMessageSender.java:380)
    at com.bea.wli.sb.test.service.ServiceMessageSender.access$000(ServiceMessageSender.java:79)
    at com.bea.wli.sb.test.service.ServiceMessageSender$1.run(ServiceMessageSender.java:137)
    at com.bea.wli.sb.test.service.ServiceMessageSender$1.run(ServiceMessageSender.java:135)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
    at com.bea.wli.sb.security.WLSSecurityContextService.runAs(WLSSecurityContextService.java:55)
    at com.bea.wli.sb.test.service.ServiceMessageSender.send(ServiceMessageSender.java:140)
    at com.bea.wli.sb.test.service.ServiceProcessor.invoke(ServiceProcessor.java:454)
    at com.bea.wli.sb.test.TestServiceImpl.invoke(TestServiceImpl.java:172)
    at com.bea.wli.sb.test.client.ejb.TestServiceEJBBean.invoke(TestServiceEJBBean.java:167)
    at com.bea.wli.sb.test.client.ejb.TestService_sqr59p_EOImpl.__WL_invoke(Unknown Source)
    at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
    at com.bea.wli.sb.test.client.ejb.TestService_sqr59p_EOImpl.invoke(Unknown Source)
    at com.bea.wli.sb.test.client.ejb.TestService_sqr59p_EOImpl_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:667)
    at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
    at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
    Caused by: oracle.tip.adapter.sa.api.JCABindingException: oracle.tip.adapter.sa.impl.fw.ext.org.collaxa.thirdparty.apache.wsif.WSIFException: servicebus:/WSDL/ServiceProcessor_1.00/src/osb/resources/wsdls/Service_DB_Write_1.00 [ ServiceDBAdp_ptt::insert(SampleMiddlewareLogCollection) ] - WSIF JCA Execute of operation 'insert' failed due to: DBWriteInteractionSpec Execute Failed Exception.
    insert failed. Descriptor name: [ServiceDBAdp.SampleMiddlewareLog].
    Caused by java.lang.ArrayIndexOutOfBoundsException.
    ; nested exception is:
    BINDING.JCA-11616
    DBWriteInteractionSpec Execute Failed Exception.
    insert failed. Descriptor name: [ServiceDBAdp.SampleMiddlewareLog].
    Caused by java.lang.ArrayIndexOutOfBoundsException.
    Please see the logs for the full DBAdapter logging output prior to this exception. This exception is considered not retriable, likely due to a modelling mistake.
    at oracle.tip.adapter.sa.impl.JCABindingReferenceImpl.post(JCABindingReferenceImpl.java:197)
    at com.bea.wli.sb.transports.jca.binding.JCATransportOutboundOperationBindingServiceImpl.invokeOneWay(JCATransportOutboundOperationBindingServiceImpl.java:109)
    ... 37 more
    Caused by: oracle.tip.adapter.sa.impl.fw.ext.org.collaxa.thirdparty.apache.wsif.WSIFException: servicebus:/WSDL/ServiceProcessor_1.00/src/osb/resources/wsdls/Service_DB_Write_1.00 [ ServiceDBAdp_ptt::insert(SampleMiddlewareLogCollection) ] - WSIF JCA Execute of operation 'insert' failed due to: DBWriteInteractionSpec Execute Failed Exception.
    insert failed. Descriptor name: [ServiceDBAdp.SampleMiddlewareLog].
    Caused by java.lang.ArrayIndexOutOfBoundsException.
    ; nested exception is:
    BINDING.JCA-11616
    DBWriteInteractionSpec Execute Failed Exception.
    insert failed. Descriptor name: [ServiceDBAdp.SampleMiddlewareLog].
    Caused by java.lang.ArrayIndexOutOfBoundsException.
    Please see the logs for the full DBAdapter logging output prior to this exception. This exception is considered not retriable, likely due to a modelling mistake.
    at oracle.tip.adapter.sa.impl.fw.wsif.jca.WSIFOperation_JCA.performOperation(WSIFOperation_JCA.java:662)
    at oracle.tip.adapter.sa.impl.fw.wsif.jca.WSIFOperation_JCA.executeOperation(WSIFOperation_JCA.java:353)
    at oracle.tip.adapter.sa.impl.fw.wsif.jca.WSIFOperation_JCA.executeRequestResponseOperation(WSIFOperation_JCA.java:312)
    at oracle.tip.adapter.sa.impl.fw.wsif.jca.WSIFOperation_JCA.executeInputOnlyOperation(WSIFOperation_JCA.java:291)
    at oracle.tip.adapter.sa.impl.JCABindingReferenceImpl.invokeWsifProvider(JCABindingReferenceImpl.java:345)
    at oracle.tip.adapter.sa.impl.JCABindingReferenceImpl.post(JCABindingReferenceImpl.java:195)
    ... 38 more
    Caused by: BINDING.JCA-11616
    DBWriteInteractionSpec Execute Failed Exception.
    insert failed. Descriptor name: [ServiceDBAdp.SampleMiddlewareLog].
    Caused by java.lang.ArrayIndexOutOfBoundsException.
    Please see the logs for the full DBAdapter logging output prior to this exception. This exception is considered not retriable, likely due to a modelling mistake.
    at oracle.tip.adapter.db.exceptions.DBResourceException.createNonRetriableException(DBResourceException.java:682)
    at oracle.tip.adapter.db.exceptions.DBResourceException.createEISException(DBResourceException.java:648)
    at oracle.tip.adapter.db.exceptions.DBResourceException.outboundWriteException(DBResourceException.java:696)
    at oracle.tip.adapter.db.DBInteraction.executeOutboundWrite(DBInteraction.java:1056)
    at oracle.tip.adapter.db.DBInteraction.execute(DBInteraction.java:240)
    at oracle.tip.adapter.sa.impl.fw.wsif.jca.WSIFOperation_JCA.performOperation(WSIFOperation_JCA.java:529)
    ... 43 more
    Caused by: java.lang.ArrayIndexOutOfBoundsException</exception>
    </jca-runtime-fault-detail>
    </jca-transport-application-error>.
    Thanks

    Hi
    Thrown to indicate that an array has been accessed with an illegal index. The index is either negative or greater than or equal to the size of the array you are sending.
    make sure your table can able to recieve that array of data

  • Error while inserting into MS-SQL Server from Oracle using HS

    Hi,
    I am using hetrogeneous connection.
    I want to insert into MS-SQL Server Table by selecting from Oracle Tables.
    insert into tableone@mssql select * from table2;
    Table2 is in oracle database.
    while executing i'm getting
    ORA-02025: all tables in the SQL statement must be at the remote database
    Please guide me.
    Regards
    Salih KM

    some guy come up a solution by himself before. go ahead and try it
    ORA-02025 error while insert into emp@custard select ....

  • SQL Exception Error while Inserting

    hi i m getting this error while inserting
    java.sql.SQLException: ORA-01400: cannot insert NULL into ("APPS"."XXGEN_BAND5_ASSESSMENT_DETAILS"."PERSON_ID")

    While you are inserting value to the table.You are not passing PERSON_Id value which is the primary key in your table.If your page is EO based then while you are initializing the VO based on that EO.You are not setting the value of Person_id prior to commiting the data.
    Hope it helps!!!
    Thanks
    AJ

  • Pass BLOB as parameter to Packaged Stored Procedure

    Does JDBC (thin or otherwise) support passing a BLOB as a parameter to a packaged stored procedure in Oracle, or do we have to do an 'insert' statement to get it in?
    All the articles I've seen seem to refer to insert and select, but I want to strictly enforce all access to the database being through a package rather than table level access.
    We've certainly had no difficulty receiving blobs from the resultset returned by our packaged procedures.
    Any help appreciated,
    Thanks
    Jason.

    C5112736 wrote:>
    > And then these 2 formulas 'Formula # 1' and 'Formula # 2' can be used to pass on to the stored procedure.
    Can someone please demonstrate exactly how to use formula results as date parameters to a SQL stored procedure?  Keep in mind, there are two parameters to the stored procedure.
    I have gleaned this much: Use Add Command and insert the procedure with
    EXEC ServerName.dbo.usp_sprocName;1 '{?StringParameter}'
    but if I try to do
    {CALL ServerName.dbo.usp_SprocName({@Formula1},{@Formula2})}
    then it gives the error "No value given for one or more required parameters". 
    Both of the parameters are VARCHAR(50).
    I have finally found this link: [http://msdn.microsoft.com/en-us/library/ms710248(VS.85).aspx|http://msdn.microsoft.com/en-us/library/ms710248(VS.85).aspx]
    This Microsoft site defines the format of the ODBC escape sequences, but I still do not know how to convince Crystal to insert it's parameter results or formula results.
    Pulling what's left of my hair out . . .
    ~ Shaun

  • Varbinary(max) parameters in Nested Stored Procedures by value or reference _Expand / Collapse

    Consider a situation where a stored procedure taking a varbinary(max) (BLOB) input parameter
    then calls a nested stored procedure and passes along that varbinary(max) as an input parameter to the nested stored procedure.
    Is a copy of the BLOB provided to the nested stored procedure (passed by value) OR is the BLOB passed by reference.
    My interest is in understanding the potential memory hit when handling large BLOBs in this environment.
    For example, if the BLOB is 200MB, will SQL server need to allocate memory for a new copy each time it's passed to another stored procedure at the next nestlevel?
    Looks like table type parameters are passed by reference, but I haven't been able to find any info on BLOBS in this context.

    The semantics for parameters in SQL Server is copy-in/copy-out. However, this does not mean that there cannot be optimizations. That is, there is no need to copy the BLOB, as long as the procedure does not change it. Whether they actually have such an optimization,
    I don't know.
    I composed the repro below, and it is sort of interesting. If I restart my instance (SQL 2014), the memory usage grows with about 40 M for each nesting call, which certainly indicates that the BLOB is copied over and over again. But if I then run it again,
    the growth is not the same. This may be because, it uses buffers already available. (A BLOB has to be a handle like a table when it is over some size.) Then again, it means that it is squeezing something else out of the cache.
    CREATE PROCEDURE K  @h varchar(MAX) AS
       SELECT SUM(pages_kb)*8192 AS K, datalength(@h) as Dlen FROM sys.dm_os_memory_clerks
       SELECT @h = ''
    go
    CREATE PROCEDURE L  @h varchar(MAX) AS
       SELECT SUM(pages_kb)*8192 AS L1, datalength(@h) as Dlen FROM sys.dm_os_memory_clerks
       EXEC K @h
       SELECT SUM(pages_kb)*8192 AS L2, datalength(@h) as Dlen FROM sys.dm_os_memory_clerks
       --SELECT @h = ''
    go
    CREATE PROCEDURE M  @h varchar(MAX) AS
       SELECT SUM(pages_kb)*8192 AS M1, datalength(@h) as Dlen FROM sys.dm_os_memory_clerks
       EXEC L @h
       SELECT SUM(pages_kb)*8192 AS M2, datalength(@h) as Dlen FROM sys.dm_os_memory_clerks
       --SELECT @h = ''
    go
    CREATE PROCEDURE N  @h varchar(MAX) AS
       SELECT SUM(pages_kb)*8192 AS N1, datalength(@h) as Dlen FROM sys.dm_os_memory_clerks
       EXEC M @h
       SELECT SUM(pages_kb)*8192 AS N2, datalength(@h) as Dlen FROM sys.dm_os_memory_clerks
       --SELECT @h = ''
    go
    DECLARE @h varchar(MAX) = replicate(cast('ABCD' AS varchar(MAX)), 1E7)
    EXEC N @h
    go
    DROP PROCEDURE K, L, M, N
    Erland Sommarskog, SQL Server MVP, [email protected]

  • StoredProcedureCall with IN OUT Parameters order in Stored Procedure

    Refer to the Toplink documentID:Note 224269.1 - Using IN, OUT and INOUT parameters with StoreProcedureCall. This document can be download from OracleMetaLink:
    http://www.oracle.com/support/metalink/index.html
    I followed the sample code in this document to write a test case for one of complicated PL/SQL codes. The test case showed wrong results for IN/OUT and OUT parameters.
    At the end of the document above, I found this paragraph
    " Check the ordering of the arguments to make sure that they are in the following sequence:
    All 'IN' parameters, All 'OUT' parameters and then all 'INOUT' parameters.
    Your stored procedure must be set up the same way, since this is how values will be passed to it. This is the way in which TopLink stored procedure calls have been designed and implemented. "
    The order of our PL/SQL codes is IN, IN/OUT and OUT. We are not allowed to change our PL/SQL codes because they are currently used in production environment. We do not want to create another versions of PL/SQL codes to comply with IN, OUT, IN/OUT parameter order mentioned above.
    Do you have any work around solution?
    Dennis Nguyen
    LA County Sheriff IT

    I tried a simple example using named parameters and it worked in 9.0.4:
    CREATE OR REPLACE PROCEDURE
    "TEST_904"."STOREDPROCEDURE_INOUT_OUT_IN" (
         P_INOUT IN OUT NUMBER,
         P_OUT OUT NUMBER,
         P_IN NUMBER) AS
    BEGIN
    P_OUT := P_INOUT;
    P_INOUT := P_IN;
    END;
    public void storedProcedureOutInoutInTest() {
         System.out.println("storedProcedureOutInoutInTest");
        StoredProcedureCall call = new StoredProcedureCall();
        call.setProcedureName("STOREDPROCEDURE_INOUT_OUT_IN");
        call.addNamedArgument("P_IN");
        call.addNamedOutputArgument("P_OUT", "P_OUT", Integer.class);
        call.addNamedInOutputArgument("P_INOUT", "P_INOUT", "P_INOUT", Integer.class);
        call.setUsesBinding(true);
        DataReadQuery query = new DataReadQuery();
        query.setCall(call);
        query.addArgument("P_IN");
        query.addArgument("P_INOUT");
        Vector args = new Vector(2);
        args.add(new Integer(1));
        args.add(new Integer(2));
        Object result =  session.executeQuery(query, args);
        Map map = (Map)((Vector)result).firstElement();
        Integer result_p_inout = (Integer)map.get("P_INOUT");
        Integer result_p_out = (Integer)map.get("P_OUT");
         System.out.println("P_INOUT = " +  result_p_inout);
         System.out.println("P_OUT = " +  result_p_out);
    }Result:
    P_INOUT = 1
    P_OUT = 2

  • Error while inserting spatial data

    Hi All,
    I have a problem while inserting spatial data. could some one please help me in solving this.
    I have creatd a table with spatial index.
    INSERT INTO USER_SDO_GEOM_METADATA
                VALUES('SDO_CA_test', 'CA', SDO_DIM_ARRAY(
                    MDSYS.SDO_DIM_ELEMENT ('LON', 71.19545, 120.35101, 0.000005),
                    MDSYS.SDO_DIM_ELEMENT ('LAT', 12.1145, 26.58041, 0.000005)), 8687);
         CREATE INDEX IO_CA_test ON SDO_CAR_test(CA)
        INDEXTYPE IS MDSYS.SPATIAL_INDEX PARAMETERS ('SDO_COMMIT_INTERVAL=10000 SDO_RTR_PCTFREE = 0');when I insert data from another spatail table that does not have a index I get an error.
    insert into sdo_ca_test as select * from base_sdo;
    ORA-29875 Failed in the ececution of the ODCINDEXINSERT routine
    ORA-13354 incorrect offset in ELEM_INFO_ARRAY
    ORA_06512 at MDSYS.SDO_INDEX_METHOD_101 line. 709I believe that there is some incorrect data that is not with my index defination.
    How do I check this invalid data at base_sdo table. The base_sdo table has no index.
    rgds
    Saz
    Edited by: Saaz Ena on Dec 21, 2009 6:16 PM

    Can you try SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT
    or SDO_GEOM.VALIDATE_LAYER_WITH_CONTEXT? e.g.
    select * from base_sdo a where
    SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(a.CA, 0.000005) != 'TRUE';

  • How to get ALL validate-errors while insert xml-file into xml_schema_table

    How to get all validate-errors while using insert into xml_schema when having a xml-instance with more then one error inside ?
    Hi,
    I can validate a xml-file by using isSchemaValid() - function to get the validate-status 0 or 1 .
    To get a error-output about the reason I do validate
    the xml-file against xdb-schema, by insert it into schema_table.
    When more than one validate-errors inside the xml-file,
    the exception shows me the first error only.
    How to get all errors at one time ?
    regards
    Norbert
    ... for example like this matter:
    declare
         xmldoc CLOB;
         vStatus varchar
    begin     
    -- ... create xmldoc by using DBMS_XMLGEN ...
    -- validate by using insert ( I do not need insert ;-) )      
         begin
         -- there is the xml_schema in xdb with defaultTable XML_SCHEMA_DEFAULT_TABLE     
         insert into XML_SCHEMA_DEFAULT_TABLE values (xmltype(xmldoc) ) ;
         vStatus := 'XML-Instance is valid ' ;
         exception
         when others then
         -- it's only the first error while parsing the xml-file :     
              vStatus := 'Instance is NOT valid: '||sqlerrm ;
              dbms_output.put_line( vStatus );      
         end ;
    end ;

    If I am not mistaken, the you probably could google this one while using "Steven Feuerstein Validation" or such. I know I have seen a very decent validation / error handling from Steven about this.

  • Error while inserting data in SQL Server.

    Hi',
    I am using SOA 11.1.1.5
    I am inserting data using DB adapter in MS SQL Server. Some times I get below error.
    Error Message: {http://schemas.oracle.com/bpel/extension}bindingFault
    Fault ID     rrr/xxx!1.1*soa_313bd437-7bb9-41c6-a719-d1775b9afc4b/xx/4115908-BpInv0-BpSeq1.6-4
    Fault Time     Dec 24, 2012 8:02:09 AM
    Non Recoverable System Fault :
    <bpelFault><faultType>0</faultType><bindingFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="summary"><summary>Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'insert' failed due to: DBWriteInteractionSpec Execute Failed Exception. insert failed. Descriptor name: [InsertIntoStagingxx.Stagingxx]. Caused by java.sql.BatchUpdateException: String or binary data would be truncated.. Please see the logs for the full DBAdapter logging output prior to this exception. This exception is considered not retriable, likely due to a modelling mistake. To classify it as retriable instead add property nonRetriableErrorCodes with value "-8152" to your deployment descriptor (i.e. weblogic-ra.xml). To auto retry a retriable fault set these composite.xml properties for this invoke: jca.retry.interval, jca.retry.count, and jca.retry.backoff. All properties are integers. ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution. </summary></part><part name="detail"><detail>String or binary data would be truncated.</detail></part><part name="code"><code>8152</code></part></bindingFault></bpelFault>
    Please advice.
    Thanks
    Yatan

    Hi Yatan,
    This should be due to data issues. And the error message is due to data truncation issues.
    Please check your payload that you are trying to insert into the SQL server table.
    One or more fields might have a data that is exceeding its defined length with respect to the table definitions.
    Problem with using SQL server is that while inserting, you will not be pointed towards which field or column is causing the error.
    You have to take the pain of searching through the entire payload to find the problem causing ones.
    Thanks,
    Deepak.

Maybe you are looking for

  • My internet won't work, and I am losing my MAC loyalty

    Hi, I have seen a recent trend in this topic and I don not believe it is okay. I don't know if my problem is different from the others and can be solved, but I will find out soon. My problem is that my internet is saying connected but no network sele

  • Ducker does not appear as an insert

    Ducker does not appear as an insert in my window. Should it not be located within dynamics? Is it possible that the software did not install? How can I get it?

  • Restriction for Profit centers

    Hi All, I have an issue here. The client wants the following requirement: A set of users needs to be given access to post all the GLS available in FBCJ, wherein the users should get restricted at Profit center level. Manual posting through FB50, Fb01

  • Help - Migration problems

    Hi everybody, I am very new to this community, let's say I don't know CF much and for now I need to migrate a website (CF website) but It seems I get lots of problems. I wonder if anybody could help me somehow Here is the website : http://bit.ly/b0D6

  • Defining Distribution Functions

    Dear, In SOP base planning i define "Dstribution Functions". Can any one help what its and how functionally it works? I define this thing under path : Production - Basic Data - Bill of Material - Item Data- Item Data from Related Application Areas -