Oracle 8i array DML operations with LOB objects

Hi all,
I have a question about Oracle 8i array DML operations with LOB objects, both CLOB and BLOB. With the following statement in mind:
INSERT INTO TABLEX (COL1, COL2) VALUES (:1, :2)
where COL1 is a NUMBER and COL2 is a BLOB, I want to use OCIs array DML functionality to insert multiple records with a single statement execution. I have allocated an array of LOB locators, initialized them with OCIDescriptorAlloc(), and bound them to COL2 where mode is set to OCI_DATA_AT_EXEC and dty (IN) is set to SQLT_BLOB. It is after this where I am getting confused.
To send the LOB data, I have tried using the user-defined callback method, registering the callback function via OCIBindDynamic(). I initialize icbfps arguments as I would if I were dealing with RAW/LONG RAW data. When execution passes from the callback function, I encounter a memory exception within an Oracle dll. Where dvoid **indpp equals 0 and the object is of type RAW/LONG RAW, the function works fine. Is this not a valid methodology for CLOB/BLOB objects?
Next, I tried performing piecewise INSERTs using OCIStmtGetPieceInfo() and OCIStmtSetPieceInfo(). When using this method, I use OCILobWrite() along with a user-defined callback designed for LOBs to send LOB data to the database. Here everything works fine until I exit the user-defined LOB write callback function where an OCI_INVALID_HANDLE error is encountered. I understand that both OCILobWrite() and OCIStmtExecute() return OCI_NEED_DATA. And it does seem to me that the two statements work separately rather than in conjunction with each other. So I rather doubt this is the proper methodology.
As you can see, the correct method has evaded me. I have looked through the OCI LOB samples, but have not found any code that helps answer my question. Oracles OCI documentation has not been of much help either. So if anyone could offer some insight I would greatly appreciate it.
Chris Simms
[email protected]
null

Before 9i, you will have to first insert empty locators using EMPTY_CLOB() inlined in the SQL and using RETURNING clause to return the locator. Then use OCILobWrite to write to the locators in a streamed fashion.
From 9i, you can actually bind a long buffer to each lob position without first inserting an empty locator, retrieving it and then writing to it.
<BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by CSimms:
Hi all,
I have a question about Oracle 8i array DML operations with LOB objects, both CLOB and BLOB. With the following statement in mind:
INSERT INTO TABLEX (COL1, COL2) VALUES (:1, :2)
where COL1 is a NUMBER and COL2 is a BLOB, I want to use OCIs array DML functionality to insert multiple records with a single statement execution. I have allocated an array of LOB locators, initialized them with OCIDescriptorAlloc(), and bound them to COL2 where mode is set to OCI_DATA_AT_EXEC and dty (IN) is set to SQLT_BLOB. It is after this where I am getting confused.
To send the LOB data, I have tried using the user-defined callback method, registering the callback function via OCIBindDynamic(). I initialize icbfps arguments as I would if I were dealing with RAW/LONG RAW data. When execution passes from the callback function, I encounter a memory exception within an Oracle dll. Where dvoid **indpp equals 0 and the object is of type RAW/LONG RAW, the function works fine. Is this not a valid methodology for CLOB/BLOB objects?
Next, I tried performing piecewise INSERTs using OCIStmtGetPieceInfo() and OCIStmtSetPieceInfo(). When using this method, I use OCILobWrite() along with a user-defined callback designed for LOBs to send LOB data to the database. Here everything works fine until I exit the user-defined LOB write callback function where an OCI_INVALID_HANDLE error is encountered. I understand that both OCILobWrite() and OCIStmtExecute() return OCI_NEED_DATA. And it does seem to me that the two statements work separately rather than in conjunction with each other. So I rather doubt this is the proper methodology.
As you can see, the correct method has evaded me. I have looked through the OCI LOB samples, but have not found any code that helps answer my question. Oracles OCI documentation has not been of much help either. So if anyone could offer some insight I would greatly appreciate it.
Chris Simms
[email protected]
<HR></BLOCKQUOTE>
null

Similar Messages

  • Oracle 11.2 - Perform parallel DML on a non partitioned table with LOB column

    Hi,
    Since I wanted to demonstrate new Oracle 12c enhancements on SecureFiles, I tried to use PDML statements on a non partitioned table with LOB column, in both Oracle 11g and Oracle 12c releases. The Oracle 11.2 SecureFiles and Large Objects Developer's Guide of January 2013 clearly says:
    Parallel execution of the following DML operations on tables with LOB columns is supported. These operations run in parallel execution mode only when performed on a partitioned table. DML statements on non-partitioned tables with LOB columns continue to execute in serial execution mode.
    INSERT AS SELECT
    CREATE TABLE AS SELECT
    DELETE
    UPDATE
    MERGE (conditional UPDATE and INSERT)
    Multi-table INSERT
    So I created and populated a simple table with a BLOB column:
    SQL> CREATE TABLE T1 (A BLOB);
    Table created.
    Then, I tried to see the execution plan of a parallel DELETE:
    SQL> EXPLAIN PLAN FOR
      2  delete /*+parallel (t1,8) */ from t1;
    Explained.
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 3718066193
    | Id  | Operation             | Name     | Rows  | Cost (%CPU)| Time     |    TQ  |IN-OUT| PQ Distrib |
    |   0 | DELETE STATEMENT      |          |  2048 |     2   (0)| 00:00:01 |        |      |            |
    |   1 |  DELETE               | T1       |       |            |          |        |      |            |
    |   2 |   PX COORDINATOR      |          |       |            |          |        |      |            |
    |   3 |    PX SEND QC (RANDOM)| :TQ10000 |  2048 |     2   (0)| 00:00:01 |  Q1,00 | P->S | QC (RAND)  |
    |   4 |     PX BLOCK ITERATOR |          |  2048 |     2   (0)| 00:00:01 |  Q1,00 | PCWC |            |
    |   5 |      TABLE ACCESS FULL| T1       |  2048 |     2   (0)| 00:00:01 |  Q1,00 | PCWP |            |
    PLAN_TABLE_OUTPUT
    Note
       - dynamic sampling used for this statement (level=2)
    And I finished by executing the statement.
    SQL> commit;
    Commit complete.
    SQL> alter session enable parallel dml;
    Session altered.
    SQL> delete /*+parallel (t1,8) */ from t1;
    2048 rows deleted.
    As we can see, the statement has been run as parallel:
    SQL> select * from v$pq_sesstat;
    STATISTIC                      LAST_QUERY SESSION_TOTAL
    Queries Parallelized                    1             1
    DML Parallelized                        0             0
    DDL Parallelized                        0             0
    DFO Trees                               1             1
    Server Threads                          5             0
    Allocation Height                       5             0
    Allocation Width                        1             0
    Local Msgs Sent                        55            55
    Distr Msgs Sent                         0             0
    Local Msgs Recv'd                      55            55
    Distr Msgs Recv'd                       0             0
    11 rows selected.
    Is it normal ? It is not supposed to be supported on Oracle 11g with non-partitioned table containing LOB column....
    Thank you for your help.
    Michael

    Yes I did it. I tried with force parallel dml, and that is the results on my 12c DB, with the non partitionned and SecureFiles LOB column.
    SQL> explain plan for delete from t1;
    Explained.
    | Id  | Operation             | Name     | Rows  | Cost (%CPU)| Time     |    TQ  |IN-OUT| PQ Distrib |
    |   0 | DELETE STATEMENT      |          |     4 |     2   (0)| 00:00:01 |        |      |            |
    |   1 |  DELETE               | T1       |       |            |          |        |      |            |
    |   2 |   PX COORDINATOR      |          |       |            |          |        |      |            |
    |   3 |    PX SEND QC (RANDOM)| :TQ10000 |     4 |     2   (0)| 00:00:01 |  Q1,00 | P->S | QC (RAND)  |
    |   4 |     PX BLOCK ITERATOR |          |     4 |     2   (0)| 00:00:01 |  Q1,00 | PCWC |            |
    |   5 |      TABLE ACCESS FULL| T1       |     4 |     2   (0)| 00:00:01 |  Q1,00 | PCWP |            |
    The DELETE is not performed in Parallel.
    I tried with another statement :
    SQL> explain plan for
    2        insert into t1 select * from t1;
    Here are the results:
    11g
    | Id  | Operation                | Name     | Rows  | Bytes | Cost (%CPU)| Time     |    TQ  |IN-OUT| PQ Distrib |
    |   0 | INSERT STATEMENT         |          |     4 |  8008 |     2   (0)| 00:00:01 |        |      |            |
    |   1 |  LOAD TABLE CONVENTIONAL | T1       |       |       |            |          |        |      |            |
    |   2 |   PX COORDINATOR         |          |       |       |            |          |        |      |            |
    |   3 |    PX SEND QC (RANDOM)   | :TQ10000 |     4 |  8008 |     2   (0)| 00:00:01 |  Q1,00 | P->S | QC (RAND)  |
    |   4 |     PX BLOCK ITERATOR    |          |     4 |  8008 |     2   (0)| 00:00:01 |  Q1,00 | PCWC |            |
    |   5 |      TABLE ACCESS FULL   | T1       |     4 |  8008 |     2   (0)| 00:00:01 |  Q1,00 | PCWP |            |
    12c
    | Id  | Operation                          | Name     | Rows  | Bytes | Cost (%CPU)| Time     |    TQ  |IN-OUT| PQ Distrib |
    |   0 | INSERT STATEMENT                   |          |     4 |  8008 |     2   (0)| 00:00:01 |        |      |            |
    |   1 |  PX COORDINATOR                    |          |       |       |            |          |        |      |            |
    |   2 |   PX SEND QC (RANDOM)              | :TQ10000 |     4 |  8008 |     2   (0)| 00:00:01 |  Q1,00 | P->S | QC (RAND)  |
    |   3 |    LOAD AS SELECT                  | T1       |       |       |            |          |  Q1,00 | PCWP |            |
    |   4 |     OPTIMIZER STATISTICS GATHERING |          |     4 |  8008 |     2   (0)| 00:00:01 |  Q1,00 | PCWP |            |
    |   5 |      PX BLOCK ITERATOR             |          |     4 |  8008 |     2   (0)| 00:00:01 |  Q1,00 | PCWC |            |
    It seems that the DELETE statement has problems but not the INSERT AS SELECT !

  • What are right parameter types of ODCIIndexInsert in case of creating indextype WITH ARRAY DML option (documentation mismatch)

    Hello.
    During developing Domain Index for Oracle 11.2.0.1.0 (problem also appears in 12с) i was faced with misunderstanding of parameter types of function
    ODCIIndexInsert in case of creating indextype  WITH ARRAY DML option
    According to Oracle documentation
    http://docs.oracle.com/cd/E11882_01/appdev.112/e10765/ext_idx_ref.htm#i76892
    In case of  WITH ARRAY DML option Oracle will invoke ODCIIndexInsert with following signature
    FUNCTION ODCIIndexInsert(
      ia ODCIIndexInfo,
      ridlist ODCIRidList,
      newvallist varray_of_column_type,
      env ODCIEnv)
    RETURN NUMBER
    In my case indexed column has datatype NUMBER so i defined varray_of_column_type as SYS.ODCINumberList
    STATIC FUNCTION ODCIIndexInsert(ia in sys.ODCIIndexInfo, ridlist in sys.ODCIRidList,  newvallist in sys.ODCINumberList, env in SYS.ODCIEnv) RETURN NUMBER
    Indextype was created as
    CREATE INDEXTYPE test_index_type
    FOR
    test_eq(number, number)
    USING index_methods
    WITH ARRAY DML(number, sys.ODCINumberList)
    WITH LOCAL RANGE PARTITION
    WITH SYSTEM MANAGED STORAGE TABLES;
    or
    CREATE INDEXTYPE test_index_type
    FOR
    test_eq(number, number)
    USING index_methods
    WITH ARRAY DML
    WITH LOCAL RANGE PARTITION
    WITH SYSTEM MANAGED STORAGE TABLES;
    (problem occurs in all cases)
    CREATE TABLE test_table (id NUMBER (19,0));
    CREATE INDEX test_index ON test_table(id) INDEXTYPE IS test_index_type;
    When attempting to insert data in the table
    insert into test_table values (1);
    oracle raise exception
    Error starting at line 53 in command:
    insert into test_table values (1)
    Error at Command Line:53 Column:1
    Error report:
    SQL Error: ORA-29925: cannot execute SCOTT.INDEX_METHODS.ODCIINDEXINSERT
    ORA-06553: PLS-306: wrong number or types of arguments in call to 'ODCIINDEXINSERT'
    ORA-06553: PLS-306: wrong number or types of arguments in call to 'ODCIINDEXINSERT'
    29925. 00000 -  "cannot execute %s"
    *Cause:    The specified function does not exist or does not have an
               appropriate signature.
    *Action:   Implement the function with the appropriate signature.
    So my question is.
    Is it normal behavior  of oracle (according to documentation)?
    What is correct signature of ODCIIndexInsert function in case of INDEXTYPE creation with 'WITH ARRAY DML' option and fact that indexed column has NUMBER datatype?
    By the way if i define indextype without 'WITH ARRAY DML' option signature is clear, and working. But this approach doesn't satisfies our performance needs.
    Also if i define index type with option 'WITH ARRAY DML WITHOUT COLUMN DATA' and use signature
    static function ODCIIndexInsert(ia sys.odciindexinfo,   ridlist sys.odciridlist, env sys.ODCIEnv) return number
    Everything works too. But this approach doesn't satisfies our business needs.
    Is it a way to define ODCIIndexInsert  parameter types (in case of indexing number column)  so that batch inserting works according to documentation ?
    FUNCTION ODCIIndexInsert(
          ia ODCIIndexInfo,
          ridlist ODCIRidList,
          newvallist varray_of_column_type,
          env ODCIEnv)
    I am attaching full sql script to recreate environment and reproduce the problem.
    Type definition:
    CREATE OR REPLACE TYPE index_methods AS OBJECT
      step number,
      STATIC FUNCTION ODCIGetInterfaces(ifclist OUT SYS.ODCIObjectList) RETURN NUMBER,
      STATIC FUNCTION ODCIIndexCreate (ia SYS.ODCIIndexInfo, parms VARCHAR2, env SYS.ODCIEnv) RETURN NUMBER,
      STATIC FUNCTION ODCIIndexAlter (ia sys.ODCIIndexInfo, parms IN OUT VARCHAR2, altopt number, env sys.ODCIEnv) RETURN NUMBER,
      STATIC FUNCTION ODCIIndexDrop(ia SYS.ODCIIndexInfo, env SYS.ODCIEnv) RETURN NUMBER,
      STATIC FUNCTION ODCIIndexExchangePartition(ia SYS.ODCIIndexInfo, ia1 SYS.ODCIIndexInfo, env SYS.ODCIEnv) RETURN NUMBER,
      STATIC FUNCTION ODCIIndexUpdPartMetadata(ia sys.ODCIIndexInfo, palist sys.ODCIPartInfoList, env sys.ODCIEnv) RETURN NUMBER,
      STATIC FUNCTION ODCIIndexInsert(ia in sys.ODCIIndexInfo, ridlist in sys.ODCIRidList,  newvallist in sys.ODCINumberList, env in SYS.ODCIEnv) RETURN NUMBER,
      STATIC FUNCTION ODCIIndexDelete(ia SYS.ODCIIndexInfo, rid VARCHAR2, oldval number, env SYS.ODCIEnv) RETURN NUMBER,
      STATIC FUNCTION ODCIIndexUpdate(ia SYS.ODCIIndexInfo, rid VARCHAR2, oldval number, newval number, env SYS.ODCIEnv) RETURN NUMBER,
      STATIC FUNCTION ODCIIndexStart(sctx IN OUT index_methods, ia SYS.ODCIIndexInfo,
        op SYS.ODCIPredInfo, qi sys.ODCIQueryInfo, strt number, stop number, cmpval number, env SYS.ODCIEnv) RETURN NUMBER,
      MEMBER FUNCTION ODCIIndexFetch(self IN OUT index_methods, nrows NUMBER, rids OUT SYS.ODCIridlist, env SYS.ODCIEnv) RETURN NUMBER,
      MEMBER FUNCTION ODCIIndexClose(self IN index_methods, env SYS.ODCIEnv) RETURN NUMBER
    CREATE OR REPLACE TYPE BODY index_methods IS
    STATIC FUNCTION ODCIGetInterfaces(ifclist OUT sys.ODCIObjectList) RETURN NUMBER IS
    BEGIN
      ifclist := sys.ODCIObjectList(sys.ODCIObject('SYS','ODCIINDEX2'));
      RETURN ODCIConst.Success;
    END ODCIGetInterfaces;
    STATIC FUNCTION ODCIIndexCreate (ia sys.ODCIIndexInfo, parms VARCHAR2,  env sys.ODCIEnv) RETURN NUMBER IS
    BEGIN
      RETURN ODCIConst.Success;
    END ODCIIndexCreate;
    STATIC FUNCTION ODCIIndexDrop(ia sys.ODCIIndexInfo, env sys.ODCIEnv) RETURN NUMBER IS
    BEGIN
      RETURN ODCIConst.Success;
    END ODCIIndexDrop;
    STATIC FUNCTION ODCIIndexAlter (
      ia sys.ODCIIndexInfo,
      parms IN OUT VARCHAR2,
      altopt NUMBER,
      env sys.ODCIEnv)
    RETURN NUMBER IS
    BEGIN
      RETURN ODCIConst.Success;
    END ODCIIndexAlter;
    STATIC FUNCTION ODCIIndexUpdPartMetadata(
      ia sys.ODCIIndexInfo,
      palist sys.ODCIPartInfoList,
      env sys.ODCIEnv)
    RETURN NUMBER IS
    BEGIN
      RETURN ODCIConst.Success;
    END ODCIIndexUpdPartMetadata;
    STATIC FUNCTION ODCIIndexExchangePartition(
      ia sys.ODCIIndexInfo,
      ia1 sys.ODCIIndexInfo,
      env sys.ODCIEnv)
    RETURN NUMBER IS
    BEGIN
      RETURN ODCIConst.Success;
    END ODCIIndexExchangePartition;
    STATIC FUNCTION ODCIIndexInsert(
       ia sys.ODCIIndexInfo,
       ridlist sys.ODCIRidList,
       newvallist sys.ODCINumberList,
       env sys.ODCIEnv)
    RETURN NUMBER IS
    BEGIN
      return ODCIConst.Success;
    END;
    STATIC FUNCTION ODCIIndexDelete(
       ia SYS.ODCIIndexInfo,
       rid VARCHAR2,
       oldval number,
       env SYS.ODCIEnv)
    RETURN NUMBER IS
    BEGIN
      return ODCIConst.Success;
    END;
    STATIC FUNCTION ODCIIndexUpdate(
       ia SYS.ODCIIndexInfo,
       rid VARCHAR2,
       oldval number,
       newval number,
       env SYS.ODCIEnv)
    RETURN NUMBER AS
    BEGIN
      return ODCIConst.Success;
    END;
    STATIC FUNCTION ODCIIndexStart(
      sctx IN OUT index_methods,
      ia SYS.ODCIIndexInfo,
      op SYS.ODCIPredInfo,
      qi sys.ODCIQueryInfo,
      strt number,
      stop number,
      cmpval  number,
      env SYS.ODCIEnv)
    RETURN NUMBER AS
    BEGIN
      sctx := index_methods(1);
      return ODCIConst.Success;
    END;
    MEMBER FUNCTION ODCIIndexFetch(
      self IN OUT index_methods,
      nrows NUMBER,
      rids OUT SYS.ODCIridlist,
      env SYS.ODCIEnv)
    RETURN NUMBER AS
    BEGIN
      return ODCIConst.Success;
    END;
    MEMBER FUNCTION ODCIIndexClose(self IN index_methods, env SYS.ODCIEnv) RETURN NUMBER AS
    BEGIN
      return ODCIConst.Success;
    END;
    end;
    Problem workaround:
    --drop function test_eq_fun;
    CREATE FUNCTION test_eq_fun(a number, b number) RETURN NUMBER AS
    BEGIN
      IF a = b then
        RETURN 1;
      ELSE
        RETURN 0;
      END IF;
    END;
    --drop operator test_eq;
    CREATE OPERATOR test_eq
    BINDING (number, number) RETURN NUMBER
    USING test_eq_fun;
    --drop indextype test_index_type;
    CREATE INDEXTYPE test_index_type
    FOR
    test_eq(number, number)
    USING index_methods
    WITH ARRAY DML(number, sys.ODCINumberList)
    WITH LOCAL RANGE PARTITION
    WITH SYSTEM MANAGED STORAGE TABLES;
    CREATE INDEXTYPE test_index_type
    FOR
    test_eq(number, number)
    USING index_methods
    WITH ARRAY DML
    WITH LOCAL RANGE PARTITION
    WITH SYSTEM MANAGED STORAGE TABLES;
    --drop table test_table;
    CREATE TABLE test_table (id NUMBER (19,0));
    CREATE INDEX test_index ON test_table(id) INDEXTYPE IS test_index_type;
    insert into test_table values (1);

    I get single for 1 row and batch for 2 or more rows in the following simplified simulation.
    SCOTT@orcl12c> DESC SYS.ODCINUMBERLIST
    SYS.ODCINUMBERLIST VARRAY(32767) OF NUMBER
    SCOTT@orcl12c> CREATE OR REPLACE TYPE index_methods AS OBJECT
      2  (
      3    step number,
      4    STATIC FUNCTION ODCIGetInterfaces(ifclist OUT SYS.ODCIObjectList) RETURN NUMBER,
      5    STATIC FUNCTION ODCIIndexCreate (ia SYS.ODCIIndexInfo, parms VARCHAR2, env SYS.ODCIEnv) RETURN NUMBER,
      6    STATIC FUNCTION ODCIIndexAlter (ia sys.ODCIIndexInfo, parms IN OUT VARCHAR2, altopt number, env sys.ODCIEnv) RETURN NUMBER,
      7    STATIC FUNCTION ODCIIndexDrop(ia SYS.ODCIIndexInfo, env SYS.ODCIEnv) RETURN NUMBER,
      8    STATIC FUNCTION ODCIIndexExchangePartition(ia SYS.ODCIIndexInfo, ia1 SYS.ODCIIndexInfo, env SYS.ODCIEnv) RETURN NUMBER,
      9    STATIC FUNCTION ODCIIndexUpdPartMetadata(ia sys.ODCIIndexInfo, palist sys.ODCIPartInfoList, env sys.ODCIEnv) RETURN NUMBER,
    10    STATIC FUNCTION ODCIIndexInsert(ia in sys.ODCIIndexInfo, rid in VARCHAR2,  newval in NUMBER, env in SYS.ODCIEnv) RETURN NUMBER,
    11    STATIC FUNCTION ODCIIndexInsert(ia in sys.ODCIIndexInfo, ridlist in sys.ODCIRidList,  newvallist in your_type, env in SYS.ODCIEnv) RETURN NUMBER,
    12    STATIC FUNCTION ODCIIndexDelete(ia SYS.ODCIIndexInfo, rid VARCHAR2, oldval number, env SYS.ODCIEnv) RETURN NUMBER,
    13    STATIC FUNCTION ODCIIndexUpdate(ia SYS.ODCIIndexInfo, rid VARCHAR2, oldval number, newval number, env SYS.ODCIEnv) RETURN NUMBER,
    14    STATIC FUNCTION ODCIIndexStart(sctx IN OUT index_methods, ia SYS.ODCIIndexInfo,
    15       op SYS.ODCIPredInfo, qi sys.ODCIQueryInfo, strt number, stop number, cmpval number, env SYS.ODCIEnv) RETURN NUMBER,
    16    MEMBER FUNCTION ODCIIndexFetch(self IN OUT index_methods, nrows NUMBER, rids OUT SYS.ODCIridlist, env SYS.ODCIEnv) RETURN NUMBER,
    17    MEMBER FUNCTION ODCIIndexClose(self IN index_methods, env SYS.ODCIEnv) RETURN NUMBER
    18  );
    19  /
    Type created.
    SCOTT@orcl12c> CREATE OR REPLACE TYPE BODY index_methods IS
      2  STATIC FUNCTION ODCIGetInterfaces(ifclist OUT sys.ODCIObjectList) RETURN NUMBER IS
      3  BEGIN
      4    ifclist := sys.ODCIObjectList(sys.ODCIObject('SYS','ODCIINDEX2'));
      5    RETURN ODCIConst.Success;
      6  END ODCIGetInterfaces;
      7
      8  STATIC FUNCTION ODCIIndexCreate (ia sys.ODCIIndexInfo, parms VARCHAR2,  env sys.ODCIEnv) RETURN NUMBER IS
      9  BEGIN
    10    RETURN ODCIConst.Success;
    11  END ODCIIndexCreate;
    12
    13  STATIC FUNCTION ODCIIndexDrop(ia sys.ODCIIndexInfo, env sys.ODCIEnv) RETURN NUMBER IS
    14  BEGIN
    15    RETURN ODCIConst.Success;
    16  END ODCIIndexDrop;
    17
    18  STATIC FUNCTION ODCIIndexAlter (
    19    ia sys.ODCIIndexInfo,
    20    parms IN OUT VARCHAR2,
    21    altopt NUMBER,
    22    env sys.ODCIEnv)
    23  RETURN NUMBER IS
    24  BEGIN
    25    RETURN ODCIConst.Success;
    26  END ODCIIndexAlter;
    27
    28  STATIC FUNCTION ODCIIndexUpdPartMetadata(
    29    ia sys.ODCIIndexInfo,
    30    palist sys.ODCIPartInfoList,
    31    env sys.ODCIEnv)
    32  RETURN NUMBER IS
    33  BEGIN
    34    RETURN ODCIConst.Success;
    35  END ODCIIndexUpdPartMetadata;
    36
    37  STATIC FUNCTION ODCIIndexExchangePartition(
    38    ia sys.ODCIIndexInfo,
    39    ia1 sys.ODCIIndexInfo,
    40    env sys.ODCIEnv)
    41  RETURN NUMBER IS
    42  BEGIN
    43    RETURN ODCIConst.Success;
    44  END ODCIIndexExchangePartition;
    45
    46  STATIC FUNCTION ODCIIndexInsert(
    47      ia sys.ODCIIndexInfo,
    48      rid VARCHAR2,
    49      newval NUMBER,
    50      env sys.ODCIEnv)
    51  RETURN NUMBER IS
    52  BEGIN
    53    dbms_output.put_line ('single');
    54    return ODCIConst.Success;
    55  END;
    56
    57  STATIC FUNCTION ODCIIndexInsert(
    58      ia sys.ODCIIndexInfo,
    59      ridlist sys.ODCIRidList,
    60      newvallist your_type,
    61      env sys.ODCIEnv)
    62  RETURN NUMBER IS
    63  BEGIN
    64    dbms_output.put_line ('batch');
    65    return ODCIConst.Success;
    66  END;
    67
    68  STATIC FUNCTION ODCIIndexDelete(
    69      ia SYS.ODCIIndexInfo,
    70      rid VARCHAR2,
    71      oldval number,
    72      env SYS.ODCIEnv)
    73  RETURN NUMBER IS
    74  BEGIN
    75    return ODCIConst.Success;
    76  END;
    77
    78  STATIC FUNCTION ODCIIndexUpdate(
    79      ia SYS.ODCIIndexInfo,
    80      rid VARCHAR2,
    81      oldval number,
    82      newval number,
    83      env SYS.ODCIEnv)
    84  RETURN NUMBER AS
    85  BEGIN
    86    return ODCIConst.Success;
    87  END;
    88
    89  STATIC FUNCTION ODCIIndexStart(
    90    sctx IN OUT index_methods,
    91    ia SYS.ODCIIndexInfo,
    92    op SYS.ODCIPredInfo,
    93    qi sys.ODCIQueryInfo,
    94    strt number,
    95    stop number,
    96    cmpval  number,
    97    env SYS.ODCIEnv)
    98  RETURN NUMBER AS
    99  BEGIN
    100    sctx := index_methods(1);
    101    return ODCIConst.Success;
    102  END;
    103
    104  MEMBER FUNCTION ODCIIndexFetch(
    105    self IN OUT index_methods,
    106    nrows NUMBER,
    107    rids OUT SYS.ODCIridlist,
    108    env SYS.ODCIEnv)
    109  RETURN NUMBER AS
    110  BEGIN
    111    return ODCIConst.Success;
    112  END;
    113
    114  MEMBER FUNCTION ODCIIndexClose(self IN index_methods, env SYS.ODCIEnv) RETURN NUMBER AS
    115  BEGIN
    116    return ODCIConst.Success;
    117  END;
    118  end;
    119  /
    Type body created.
    SCOTT@orcl12c> CREATE FUNCTION test_eq_fun(a number, b number) RETURN NUMBER AS
      2  BEGIN
      3    IF a = b then
      4       RETURN 1;
      5    ELSE
      6       RETURN 0;
      7    END IF;
      8  END;
      9  /
    Function created.
    SCOTT@orcl12c> CREATE OPERATOR test_eq
      2  BINDING (number, number) RETURN NUMBER
      3  USING test_eq_fun
      4  /
    Operator created.
    SCOTT@orcl12c> CREATE INDEXTYPE test_index_type
      2  FOR
      3  test_eq(number, number)
      4  USING index_methods
      5  WITH ARRAY DML(number, your_type)
      6  WITH LOCAL RANGE PARTITION
      7  WITH SYSTEM MANAGED STORAGE TABLES
      8  /
    Indextype created.
    SCOTT@orcl12c> CREATE TABLE test_table (id NUMBER (19,0))
      2  /
    Table created.
    SCOTT@orcl12c> CREATE INDEX test_index ON test_table(id) INDEXTYPE IS test_index_type
      2  /
    Index created.
    SCOTT@orcl12c> insert into test_table values (1)
      2  /
    single
    1 row created.
    SCOTT@orcl12c> insert into test_table
      2  select 2 from dual union all
      3  select 3 from dual
      4  /
    batch
    2 rows created.
    SCOTT@orcl12c> insert into test_table select deptno from dept
      2  /
    batch
    4 rows created.
    SCOTT@orcl12c> insert into test_table select object_id from user_objects
      2  /
    batch
    34 rows created.
    SCOTT@orcl12c>

  • Query performance on same table with many DML operations

    Hi all,
    I am having one table with 100 rows of data. After that, i inserted, deleted, modified data so many times.
    The select statement after DML operations is taking so much of time compare with before DML operations (There is no much difference in data).
    If i created same table again newly with same data and fire the same select statement, it is taking less time.
    My question is, is there any command like compress or re-indexing or something like that to improve the performance without creating new table again.
    Thanks in advance,
    Pal

    Try searching "rebuilding indexes" on http://asktom.oracle.com. You will get lots of hits and many lively discussions. Certainly Tom's opinion is that re-build are very rarley required.
    As far as I know, Oracle has always re-used deleted rows in indexes as long as the new row belongs in that place in the index. The only situation I am aware of where deleted rows do not get re-used is where you have a monotonically increasing key (e.g one generated by a seqence), and most, but not all, of the older rows are deleted over time.
    For example if you had a table like this where seq_no is populated by a sequence and indexed
    seq_no         NUMBER
    processed_flag VARCHAR2(1)
    trans_date     DATEand then did deletes like:
    DELETE FROM t
    WHERE processed_flag = 'Y' and
          trans_date <= ADD_MONTHS(sysdate, -24);that deleted the 99% of the rows in the time period that were processed, leaving only a few. Then, the index leaf blocks would be very sparsely populated (i.e. lots of deleted rows in them), but since the current seq_no values are much larger than those old ones remaining, the space could not be re-used. Any leaf block that had all of its rows deleted would be reused in another part of the index.
    HTH
    John

  • DML operations on a Replicated Object when it is in QUIZED State.

    Hi,
    How do we do DML operations on a Replicated object(Multi-Master Replication) when the object is in QUIZED State.
    As such my intenttion is to bring the Replication in a QUIZED State and then do some DML then bring up the Replicator and allow it to sync the Database.

    Hi Anita,
    Thank you so much for patiently explaining me about issues on Replication.
    Now, let me explain my objective. We are about to implement Oracle 8.1.6 Multi Master Replication. As a Fall back mechanism management is so concerned that "if anything goes wrong in Replication, how do we prevent the "stopshow" from carrying out the normal transaction till the issues gets settled.
    To achieve this objective, we are doing some investigation on this issue. As i am quite new to Oracle Replication I thought there is no way that i could do this in a very short "window" period.
    I tried to stop the Replication using the suggested method it worked well. Meaning i am able to do the DML transaction. Now the problem is when we decide to bring up the system back to Replication. How do we go doing that. As i thought that the DBMS package that resumes the replication would do the "sync" on both sides of the Replication. But it is not happening.
    I referred to the Oracle documentation on Replication and was quite eager to use the package DBMS_RECTIFIER_DIFF.DIFFERENCES and DBMS_RECTIFIER_DIFF.RECTIFY procedures.
    But i am yet to test this. If this works out for a specific table. Then my plan is to deploy a mechanism where in b4 i start the replication i would execute these packages for all the replicated tables.
    Hope you now understand what i intend to do and Pls advise me if i am on the right track on reaching my goal.
    Thanx in advance.
    Senthil.

  • Java.sql.SQLException: Internal Error with oracle.sql.ARRAY getArray()

    hi,
    I am having having problems with the getArray() of oracle.sql.ARRAY.
    Here are the details:
    Oracle Database - 9.2.0.6. The JDBC driver used -10.2.0.1 jar.(the latest available).
    I am calling a stored procedure from java, that has out param as a collection (VARRAY) of a user defined type.
    The stored procedure works fine, if the user/schema used to connect,contains actual type, and i am able to extract the user defined object from the oracle.sql.ARRAY, via getArray().
    But if i use a different user to connect which has public synonyms and execute rights to the actual type, i get the following error:
    java.sql.SQLException: Internal Error
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.initCollElemTypeName(OracleTypeCOLLECTION.java:1026)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.getAttributeType(OracleTypeCOLLECTION.java:1056)
         at oracle.jdbc.oracore.OracleNamedType.getFullName(OracleNamedType.java:110)
         at oracle.jdbc.oracore.OracleTypeADT.createStructDescriptor(OracleTypeADT.java:2262)
         at oracle.jdbc.oracore.OracleTypeADT.unpickle81(OracleTypeADT.java:1656)
         at oracle.jdbc.oracore.OracleTypeUPT.unpickle81UPT(OracleTypeUPT.java:466)
         at oracle.jdbc.oracore.OracleTypeUPT.unpickle81rec(OracleTypeUPT.java:416)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81_imgBody_elems(OracleTypeCOLLECTION.java:979)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81_imgBody(OracleTypeCOLLECTION.java:923)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81(OracleTypeCOLLECTION.java:743)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION._unlinearize(OracleTypeCOLLECTION.java:242)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unlinearize(OracleTypeCOLLECTION.java:208)
         at oracle.sql.ArrayDescriptor.toJavaArray(ArrayDescriptor.java:963)
         at oracle.sql.ARRAY.getArray(ARRAY.java:370)
    The problem is happening because we have 2 different users to connect to the database. one is the dba user, which contains all the types, packages and other one the application user, which we are supposed to use, to connect via java. This application user does have access to types via public synonym, but it gives the above mentioned error.
    Please help :(.
    Regards,
    Gaurav.

    Hi avi,
    Even I am getting the same error inspite of preceding the type name with the same user who has created the type.
    It has displayed the array length.When I am trying to fetch each array, I am getting the error.
    ARRAY simpleArray = (ARRAY) cs.getObject(3);          
    System.out.println("Array is of length " + simpleArray.length());          ********************** The above stmt prints 2 records ******************
    But it goes to exception in the foll stmt..
    Object [] objArrStructArray = null;
    try{
         objArrStructArray = (Object[]) simpleArray.getArray();
    }catch(SQLException e){
         e.printStackTrace();
    Do u know abt this?
    The foll is the error which I am getting.
    java.sql.SQLException: Internal Error
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.initCollElemTypeName(OracleTypeCOLLECTION.java:1026)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.getAttributeType(OracleTypeCOLLECTION.java:1056)
         at oracle.jdbc.oracore.OracleNamedType.getFullName(OracleNamedType.java:110)
         at oracle.jdbc.oracore.OracleTypeADT.createStructDescriptor(OracleTypeADT.java:2262)
         at oracle.jdbc.oracore.OracleTypeADT.unpickle81(OracleTypeADT.java:1656)
         at oracle.jdbc.oracore.OracleTypeUPT.unpickle81UPT(OracleTypeUPT.java:466)
         at oracle.jdbc.oracore.OracleTypeUPT.unpickle81rec(OracleTypeUPT.java:416)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81_imgBody_elems(OracleTypeCOLLECTION.java:979)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81_imgBody(OracleTypeCOLLECTION.java:923)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81(OracleTypeCOLLECTION.java:743)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION._unlinearize(OracleTypeCOLLECTION.java:242)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unlinearize(OracleTypeCOLLECTION.java:208)
         at oracle.sql.ArrayDescriptor.toJavaArray(ArrayDescriptor.java:963)
         at oracle.sql.ARRAY.getArray(ARRAY.java:353)
         at com.telstra.plo.data.NetworkDAO.findCablesInBuffer(NetworkDAO.java:730)
         at com.telstra.plo.data.NetworkDAOTest.testFindCablesInBuffer(NetworkDAOTest.java:45)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at junit.framework.TestCase.runTest(TestCase.java:154)
         at junit.framework.TestCase.runBare(TestCase.java:127)
         at junit.framework.TestResult$1.protect(TestResult.java:106)
         at junit.framework.TestResult.runProtected(TestResult.java:124)
         at junit.framework.TestResult.run(TestResult.java:109)
         at junit.framework.TestCase.run(TestCase.java:118)
         at junit.framework.TestSuite.runTest(TestSuite.java:208)
         at junit.framework.TestSuite.run(TestSuite.java:203)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
    Thanks
    Archana

  • Error in multiple operation with change document object for custom table

    hi all,
    I have developed a change document object for a custom table ZTEST and developed a report program for insertion, updation & deletion..everything works fine if I do only once ie. if I created only 1 entries. If I created 2 new entries , I am getting an Error "DUPREC:POS&Z3RL_TAB&Z3RL_TAB" and EXIT the transaction.
    why I am getting this error??? is it not possible to do multiple operation with the change document???
    kindly help.
    Edited by: JaiKarthik on Apr 7, 2010 6:20 AM

       LOOP AT ts_mod INTO wa_mod.
                READ TABLE <i_itab> INTO <wa_tab> INDEX wa_mod-row.
    * Select the existing entries in table Z3RL for change history
                    SELECT SINGLE * FROM z3rl
                           INTO wa_z3rl
                           WHERE vkorg   = <wa_tab>+3(4)
                           AND   zzkunnr = <wa_tab>+7(10).
    * Move the old entries
                    IF sy-subrc = 0.
                      CLEAR ls_z3rl.
                      ls_z3rl = wa_z3rl.
                    ENDIF.
    * Update the table
                 MODIFY (viewname) FROM <wa_tab>.
                   CLEAR wa_z3rl.
                    wa_z3rl-mandt      = <wa_tab>+0(3).
                    wa_z3rl-vkorg      = <wa_tab>+3(4).
                    wa_z3rl-zzkunnr    = <wa_tab>+7(10).
    * Populate change tables
                    CLEAR wa_change.
                    wa_change-teilobjid = 'Z3RL'.
                    wa_change-textart = 'TEST_2'.
                    wa_change-textspr = 'EN'.
                    wa_change-updkz = 'U'.
                    APPEND wa_change TO ts_change.
    *call the fM to log the values in CDHDR table.
                    CALL FUNCTION 'Z3RL_WRITE_DOCUMENT'
                      EXPORTING
                        objectid                 = 'Z3RL'
                        tcode                    = sy-tcode
                        utime                    = sy-uzeit
                        udate                    = sy-datum
                        username                 = sy-uname
                        planned_change_number    = ' '
                        object_change_indicator  = 'U'
                        planned_or_real_changes  = 'U'
                        no_change_pointers       = 'U'
                        upd_icdtxt_z3rl= 'U'
                        n_z3rl= wa_z3rl
                        o_z3rl        = ls_z3rl
                        upd_z3rl= 'U'
                        lv_opt                   = ' '
                      TABLES
                        icdtxt_z3rl= ts_change.
                CLEAR : wa_mod, <wa_tab>.
              ENDLOOP.
    Edited by: JaiKarthik on Apr 7, 2010 6:49 AM

  • How to find last DML operation in oracle ADF

    how to find last DML operation in oracle ADF
    Please help me
    Thanks
    Damby

    In the base EntityIml class, just override doDML() method as I said.
    (see http://docs.oracle.com/cd/E16162_01/web.1112/e16182/appendix_mostcommon.htm
    "Methods for Creating Your Own Layer of Framework Base Classes")
    So, put a some flag in the session.
    You should not call doDML() method in backing bean, it will be called by framework.
    In the backing bean, you only have to get that information from the session, as follows:
    String last_dml_op = (String)ADFContext.getCurrent().getSessionScope().get("last_dml_op");And voila...

  • I need help with a Object Array

    I am having trouble and this maybe really simple seeing that I am fairly new to java but I have text that is being broken down in to preset part with those parts stored in Object arrays.
    Now I also have a object array inside my object array. Within the second object array are the broken down parts of the text and I want to compare this text with another string so for example this is what I am trying
    boolean found = false;
    for (int i = 0; i < FirstObjectArray.length ;i++)
         Object[] SecondObjectArray = (Object[]) FirstObjectArray;
         if(SecondObjectArray[0] == "string")
              found = true;
              break;
         else
              found = false;
    }Help would be very appreciated.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    astlanda wrote:
    Sure, you're right.
    [public boolean equals(Object obj)|http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#equals%28java.lang.Object%29]
    sharkura said all the OP needs at the moment. I just wanted to clarify a bit why You don't use == 99.999% of the time with objects, and never with String.
    I have argued elsewhere in these forums that it is inappropriate to tell anyone that you never use == to compare objects. This has not always been accepted. I have, on rare occasions, known experienced developers to blindly compare two objects with equals(), and cite the professor that taught them, 15 years iin the past, that object references are never compared using ==, but always with equals().
    However, the cases where == is appropriate and equals() is not are indeed rare, but not, in my experience, non-existent. In my statement, I probably exaggerated. And String is a case where I can probably accept that you will probably never go wrong with equals(). If the String has been pooled (see String::intern()), you can actually use either. From the javadocs: "*It follows that for any two strings s and t, s.intern() == t.intern() is true if and only if s.equals(t) is true.*"
    ¦ {Þ                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How does operator 'less than' work with Rectangle objects?

    Just found in legacy code the following:
    private var firstRect:Rectangle;
    private var secondRect:Rectangle;
    if (firstRect < secondRect)
    // do something
    How does operator 'less than' work with Rectangle objects?
    Doc says that object is converted to number if it is not a String.
    Rectangle is not a String, though has conversion to String.
    Please help.

    IME the best way to know for sure is to experiment. The docs are only one person's best understanding of how things worked on the day, which is seldom 100% accurate. I find that even with code I wrote I can't accurately say 100% of what it does until I've worked with it for a while. Keep in mind that the docs are usually written when the code is written, so  never expect more than a rough idea from the docs.

  • Operations with object dependency not showing in CTM PDS

    Hi all,
    When PDS is created in APO, the operations with object dependency are excluded in CTM PDS but in PPDS PDS all the operations are fetched.
    When I remove OD from operations and then CIF (curto_create), the operations are visible in CTM PDS too.
    Please let me know the  possible reasons for operations with OD getting excluded from CTM PDS
    Regards,
    RS

    Hello RS,
    If you are using SCM 7.0 please implement the following instructions in BADI /SAPAPO/CURTO_CREATE, for the method CREATE_CTM_PDS insert the code ev_true = 'x' and Activate it.
    then execute the curto_create transaction, while executing curto_create don't select change transfer. Object dependencies should be visible.
    PS: I assume there is no error in the object dependencies defined and the status of the object dependency is set to released.
    Hope this helps you.
    Thanks and Regards,
    Roopesh

  • Oracle.sql.ARRAY incompatible with weblogic.jdbc.vendor.oracle.OracleArray

    Hi,
    I am facing following issue in my one environment. but in other environment same class path is working fine. I have compared all jar and classpath for both weblogic server.
    I am using weblogic 11g.
    27 Mar 2013 15:21:09,507 ERROR XXXServlet:293 - oracle.sql.ARRAY incompatible with weblogic.jdbc.vendor.oracle.OracleArray
    java.lang.ClassCastException: oracle.sql.ARRAY incompatible with weblogic.jdbc.vendor.oracle.OracleArray
    at com.emc.nems.wsd.ui.beans.reports.mpapi.FacilityBeanType.nullSafeGet(FacilityBeanType.java:126)
    at org.hibernate.type.CustomType.nullSafeGet(CustomType.java:128)
    at org.hibernate.type.AbstractType.hydrate(AbstractType.java:105)
    at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2114)
    at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1404)
    at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1332)
    at org.hibernate.loader.Loader.getRow(Loader.java:1230)
    at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:603)
    at org.hibernate.loader.Loader.doQuery(Loader.java:724)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
    at org.hibernate.loader.Loader.doList(Loader.java:2232)
    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2129)
    at org.hibernate.loader.Loader.list(Loader.java:2124)
    at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:312)
    at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1723)
    at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
    at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:175)
    at com.emc.nems.oms.dao.hibernate.util.OMSHibBaseDAO.executeNamedQueryWithoutTransaction(Unknown Source)
    at com.emc.nems.wsd.dao.hibernate.reports.mpapi.MpapiReportHibDAO.findMCR020(Unknown Source)
    at com.emc.nems.wsd.ui.handler.reports.ReportsHandler.getMPAPIData(Unknown Source)
    at com.emc.nems.wsd.ui.servlets.reports.mpapi.MpapiServlet.executeReport(XXXServlet.java:1009)
    at com.emc.nems.wsd.ui.servlets.reports.mpapi.MpapiServlet.generateAuditFile(XXXServlet.java:318)
    at com.emc.nems.wsd.ui.servlets.reports.mpapi.MpapiServlet.execute(XXXServlet.java:273)
    at com.emc.nems.wsd.ui.servlets.reports.mpapi.MpapiServlet.doGet(XXXServlet.java:207)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:183)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3731)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3695)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2285)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2184)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1459)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Regards,
    Abhishek

    Creating my Oracle connection works fine ... code as follows:
    <i>Context ctxt = getInitialContext();
    DataSource dataSource = (DataSource) ctxt.lookup(poolName);
    Connection conn = dataSource.getConnection();
    OracleConnection oracleConn = (OracleConnection)((WLConnection)conn).getVendorConnection();</i>
    I also have reviewed documentation:
    http://e-docs.bea.com/wls/docs81/jdbc/thirdparty.html. In section 'Using OracleStruct Extension Methods' it highlights that
    <i>java.sql.Struct struct =(weblogic.jdbc.vendor.oracle.OracleStruct)(rs.getObject(2));</i>
    None of the documentation actually mentions <b>oracle.sql.STRUCT</b>. For Weblogic to truely provide support for Oracle it needs an easy way of converting to this data type. At present I cannot interact with Oracle APIs until I can create an oracle.sql.STRUCT.

  • Identifing DMLs on specific database objects in procedure.

    Hi,
    I'm looking for oracle dictionary views or oracle procedure to identify which DML operations exist in a specific stored procedure. For example,
    create or replace procedure test_proc as
    i integer;
    begin
    select count(*) into i from test_table;
    end;
    I want to identify which DML operation exist on which database object in this test_proc procedure. The answer should be such as, TEST_TABLE ------> SELECT.
    How I can solve this problem?
    Thanks.

    Tahnx Karthick, for response.
    Yes, I can identify objects used in procedure (from DBA_DEPENDENCIES) but actual matter is identifing whitch dml operation will be done on this objects. I wrote an procedure, witch can show object name and dml name on this object. But my procedure is working with strings (read from DBA_SOURCE), so if there is any variable witch has same name with any table used in procedure, output will be wrong. And there is some applications witch can show object name and DML name on this this object used in a procedure. I am searching how they can achive it. If there is any data dictionary view stores this information?
    Thanks

  • Two DML operations in one FORALL?

    Hi all,
    In 11g is it possible to make two dml operations in one Forall loop?
    For example:
    SQL> create table xx_test (col1 number, col2 number, col3 number);
    Table created
    SQL> create table xx_test1 (col1 number, col2 number, col3 number);
    Table created
    SQL> insert into xx_test values(1,2,3);
    1 row inserted
    SQL>  insert into xx_test values(1,2,3);
    1 row inserted
    SQL>  insert into xx_test values(4,5,6);
    1 row inserted
    SQL>  insert into xx_test1 values(6,7,8);
    1 row inserted
    SQL> declare
      2  cursor c is select col1, col2, col3 from xx_test;
      3  type t is table of c%rowtype;
      4  v t;
      5  begin
      6   open c;
      7  loop
      8  fetch c bulk collect into v limit 1000;
      9   forall i in 1..v.count
    10   update xx_test1
    11  set col1 = v(i).col2;
    12 
    13  insert into xx_test1(col1,col2,col3) values(v(i).col1,v(i).col2,v(i).col3);
    14 
    15  exit when c%notfound;
    16  end loop;
    17 
    18  end;
    ORA-06550: line 14, column 50:
    PLS-00201: identifier 'I' must be declared
    ORA-06550: line 14, column 50:
    PLS-00201: identifier 'I' must be declared
    ORA-06550: line 14, column 48:
    PL/SQL: ORA-00904: : invalid identifier
    ORA-06550: line 14, column 4:
    PL/SQL: SQL Statement ignoredany ideas? I know that this can be achieved by processing row by row but in my case the cursor retrieves a lot of rows...
    Thanks in advance,
    Alexander.

    Stew, a bulk bind from an OCI client looks as follows:
    OCIStmtPrepare()
    OCIBindByName()/OCIBindByPos() (binding a host array)
    while some-condition loop
      fill host array
      OCIStmtExecute()  (specify the number of elements in array via the iters param)
    end loopThe statement is executed once for each array element - according to the OCI guide. So in the case of sending a 100 elements, the statement will be executed (iterated) by Oracle, a 100 times. It however is not exactly clear on how the server-side deals with this execution.
    The issue you raised with cursor execution counts, seems to be whether the statement is single statement, or single statement with nested statements.
    I have written an OCI client doing the exact same tests as were done in PL/SQL using FORALL in this thread.
    If the SQL statement executed is SQL, the cursor that is created is executed only "once" (not exactly true as multiple rows are inserted using a single row DML).
    If the statement is PL/SQL, the cursor that is created, is executed "once". So pretty much the same behaviour. However, as this statement contains "nested" SQLs (the actual DML statements), these also need to be parsed and executed as cursors. In which case you see these as being executed a 100 times (once per element in for the bind array).
    The issue is whether or not the FORALL DML statement is executed once (as it would appear from the executions column), or not?
    It would seem that there is some funky happening (some kind of call optimisation perhaps?) when Oracle deals with an array bind - as the cursor seems to be executed once. But that in fact is not the case as that cursor only inserts a single row. And multiple rows are inserted.
    E.g. simplistic example to see how many times the FORALL DML statement is executed:
    SQL> create sequence emp_id_seq
      2          start with 1
      3          increment by 1
      4          nocycle
      5          nomaxvalue;
    Sequence created.
    SQL> --// add a PL/SQL user function wrapper for the sequence
    SQL> create or replace function GetNextEmpID return number is
      2          id      number;
      3  begin
      4          select emp_id_seq.NextVal into id from dual;  --// explicit SQL statement
      5          return( id );
      6  end;
      7  /
    Function created.
    SQL>
    SQL> declare
      2          cursor c is
      3          select empno, ename, job from emp;
      4 
      5          type TBuffer is table of c%RowType;
      6          buffer  TBuffer;
      7  begin
      8          open c;
      9          loop
    10                  fetch c bulk collect into buffer limit 100;
    11 
    12                  forall i in 1..buffer.Count
    13                          insert into tab1 values( GetNextEmpID(), buffer(i).ename );
    14                  exit when c%NotFound;
    15          end loop;
    16          close c;
    17  end;
    18  /
    PL/SQL procedure successfully completed.
    SQL>
    SQL> select
      2          executions,
      3          sql_text
      4  from       v$sql
      5  where      sql_text like 'INSERT INTO TAB1%'
      6  or sql_text like 'SELECT EMP_ID_SEQ%';
    EXECUTIONS SQL_TEXT
            14 SELECT EMP_ID_SEQ.NEXTVAL FROM DUAL
             1 INSERT INTO TAB1 VALUES( GETNEXTEMPID(), :B1So the insert seems to have been executed once. However, the wrapper was called 14 times and its SQL statement was called 14 times. Once per bind array value.
    So there do seem to be some kind of optimisation on the Oracle side - however, it does not mean that the FORALL statement is not using bulk/array binding. It is. And that is what the FORALL statement is designed to do.

  • Send a array of user-defined java objects to stored procedure

    hi,
    I´d like to know if its possible send java user-defined objects to a collection. I've tried the exemple bellow but it doesn´t work:
    1) In database
    -- nested table type
    create or replace type client_table_type is table of client%rowtype;
    -- table client:
    teste
    ( id number(18,0),
    name varchar2(80),
    birthday date)
    -- stored procedure
    create or replace package client_pkg
    is
    procedure insert_clients(
    p_array_clients client_table_type
    end;
    2) In Java
    java.lang.Class.forName ("oracle.jdbc.driver.OracleDriver");
    java.sql.Connection conn = java.sql.DriverManager.getConnection("jdbc:oracle:thin .....);
    ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor("client_table_type", conn);
    ARRAY a2 = new ARRAY(descriptor, conn, anArrayIn);
    PreparedStatement ps = (PreparedStatement)conn.prepareStatement("{ call client_pkg.insert_clients(?) }");
    ps.setArray(1, a2);
    ps.execute();
    Where anArrayIn is an array of Client and Client is a java user-defined class with these attributes:
    public class Client{
    public long id;
    public String name;
    public Date birthday;
    3) when I´ve tried to run the java code its returned the error in the ArrayDescriptor line:
    Exception in thread "main" java.sql.SQLException: .....:
    Unable to resolve type: "SISSERV.CLIENT_TABLE_TYPE"
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
    at oracle.sql.ArrayDescriptor.initPickler(ArrayDescriptor.java:1976)
    at oracle.sql.ArrayDescriptor.<init>(ArrayDescriptor.java:199)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:118)
    at teste_array_oracle.Carga.callPLSQL(Carga.java:60)
    at teste_array_oracle.Carga.<init>(Carga.java:41)
    at teste_array_oracle.Carga.main(Carga.java:32)
    erro de execuþÒo
    Tks for any help!

    A brief answer to this from my side (not knowing Java that wel), but hopefully suffices to put you on the right track.
    <p>
    A SQL user defined type is basically a class (it can contain properties and methods). It has only superficial resemblence to a traditional record struct. So you cannot use one. Even if you could (assuming you code a PL/SQL "traditional" record struct), there are issues around how char and numeric data are represented binary inside Oracle and issues around byte/word alignment.
    <p>
    So bottom line - what you're doing will not work (as the errors show).
    <p>
    Okay, so what then? Well, the OCI (Oracle Call Interface) supports all Oracle data types, including these user types (also called Advance Data Types in Oracle-speak). You therefore need to use the supplied API calls to deal with instantiated objects (structures) of these type.
    You're best bet is to have a look Oracle® Database Java Developer's Guide

Maybe you are looking for

  • Unable to get the data from table controller

    Dear All, I am facing the following problem in BSP tableview, I am having tableview on page as below <htmlb:tableView id              = "reportsTable2"                        headerVisible   = "true"                        headerText      = "Pending

  • How to Install New Internal Hard Drive on Mac Pro Laptop

    My wifes 15 in Mid 2010 lap top running 10.8.4 has run out of drive space so we bought a new 1tb drive to install. We aren't sure where to go from here. The current contents are back up on Time Machine, but we also bought a small hard drive enclosure

  • Power surge fried inputs on 55" LG LCD TV

    TV was bought from BB, but out of warranty (no extended).  It's about 2 years old.  The TV turns on, but none of the inputs work.  A surge went through my PC hooked up to the TV via HDMI...literally fried the HDMI cable into the port to where I almos

  • Frozen 5G iPod after updating

    After purchasing an album from iTunes, I was advised to update to iTunes 7.0, and subsequently to a newer iPod software. On completion, my iPod 'froze'. Every time I reset it, it behaves normally for approximately 20 seconds then freezes again. I've

  • Can't open up phots after reinstalling iphoto older version

    Last year my hard drive crashed, and since I had applecare just took it to my apple store and they put in the new hard drive, and updated my OS to Leopard 10.5.8 I had used a program that didn't work as well as I thought for my back ups and had to ma