Implementing IN operator with array binding

Is there a way to have an SQL statement with a simple WHERE clause like "WHERE my_col = :p1" or "WHERE my_col IN (:p1)" and bind an array to p1?
My goal is to avoid blowing up of the command text like "WHERE my_col IN (:p1, :p2, :p3 ...)". In my case the array containing the params could contain several hundreds of items, so the where clause may become quite long...
Thanks,
Daniel

Is there a way to have an SQL statement with a simple
WHERE clause like "WHERE my_col = :p1" or "WHERE
my_col IN (:p1)" and bind an array to p1?
I would also like a solution for this problem.
It is possible to generate very long IN conditions.
There is a limit of 1000 values in the IN list, but that can be handled by OR-ing several IN conditions.
Executing this kind of expression is however terribly slow, so some other solution would be nice.
Thanks

Similar Messages

  • How to use sql "IN" operator with named bind variable in where clause ?

    Can one bind variable be used for the "IN" list ('1','2','3') ?

    rob,
    No worries. Glad it helped. Glad to see also that you're doing things right and trying to use bind variables ;)
    May I suggest adding "SOLVED" to the title of the original post?
    Best,
    John

  • User Defined Type - Array bind Query very slow

    Hi.
    I have following Problem. I try to use Oracle Instant Client 11 and ODP.NET to pass Arrays in SELECT statements as Bind Parameters. I did it, but it runs very-very slow. Example:
    - Inittial Query:
    SELECT tbl1.field1, tbl1.field2, tbl2.field1, tbl2.field2 ... FROM tbl1
    LEFT JOIN tbl2 ON tbl1.field11=tbl2.field0
    LEFT JOIN tbl3 ON tbl2.field11=tbl3.field0 AND tbll1.field5=tbl3.field1
    ...and another LEFT JOINS
    WHERE
    tbl1.field0 IN ('id01', 'id02', 'id03'...)
    this query with 100 elements in "IN" on my database takes 3 seconds.
    - Query with Array bind:
    in Oracle I did UDT: create or replace type myschema.mytype as table of varchar2(1000)
    than, as described in Oracle Example I did few classes (Factory and implementing IOracleCustomType) and use it in Query,
    instead of IN ('id01', 'id02', 'id03'...) I have tbl1.field0 IN (select column_value from table(:prmTable)), and :prmTable is bound array.
    this query takes 190 seconds!!! Why? I works, but the HDD of Oracle server works very hard, and it takes too long.
    Oracle server we habe 10g.
    PS: I tried to use only 5 elements in array - the same result, it takes also 190 seconds...
    Please help!

    I recommend you generate an explain plan for each query and post them here. Based on what you have given the following MAY be happening:
    Your first query has as static IN list when it is submitted to the server. Therefore when Oracle generates the execution plan the CBO can accurately determine it based on a KNOWN set of input parameters. However the second query has a bind variable for this list of parameters and Oracle has no way of knowing at the time the execution plan is generated what that list contains. If it does not know what the list contains it cannot generate the most optimal execution plan. Therefore I would guess that it is probably doing some sort of full table scan (although these aren't always bad, remember that!).
    Again please post the execution plans for each.
    HTH!

  • 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

  • How can I bind a operation with a table

    Hi !
    I'm trying to bind a operation with a table, so what type of operation return ? ViewObject or a Vector? And how can i set params to these operation if my operation has some param ( getSubscriber(int iSubId, int iSubType) )
    Thank a lot for your help

    Hi,
    it depends on the release you are asking this question for. In JDeveloper 10.1.3 you can expose a method (e.g. on a session facade) that returns a Collection. The input parameters can be dragged and dropped as input fields to the page.
    The same can be done in JDeveloper 10.1.2, but here you have to prgrammatically apply the input arguments.
    Frank

  • Can I use Array Binding with a ExecuteDataSet or ExecuteReader methods?

    I want to use Array binding with selects. From the examples that I see so far it seems like everyone is showing the ExecuteNonQuery method. I wonder if I can use this functionality with a regular query that returns ref cursoros.
    Andrzej

    what is the error you recieve?

  • 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>

  • Implementing Multiple operations in a web service in JCAPS 5.1.3

    Hi,
    I am using JCAPS 5.1.3 and have a requirement where in I have to implement multiple operations and expose them as a webservice.
    The complexity of operations is medium, they have to log the input message into database.
    In order to achieve this I have come up with two models:
    Model-1:1.Create a Business process in eInsight and use event based decisons and implement various operations.
    2.Create jcd operations in order to log messages into database.
    3.Expose the business process as a webservice
    Model-2:1.Create a jcd for each operation and make it Callable as an External SOAP web service.
    2.Expose each jcd as a webservice
    I would like to know which of these models gives better performance for the webservice .I see eInsight in earlier versions was low in performance.
    Please let me know if you have any ideas on this.
    Thanks in advance.
    Regards,
    Nag
    Edited by: Nag4.5.3 on Jun 10, 2008 12:02 PM

    I'd try the idea #1 first. EInsight performances could be an issue only for very CPU-intensive operations, but as you need to interact with a database usually this I/O is going to be the real bottleneck. Instead, you should avoid eInsight not mainly because of hypothetical performance issues but when you foresee the need to write very complex logic, which is much easier to code and maintain in Java within JCDs than in BPEL. However remember that JCDs exposed as WS need the latest ESR Rollup to work properly, if I well recall they were single-threaded in plain JCAPS 5.1.3.
    By the way, if your WSDL describes multiple operations you could probably implement them one by one by distinct eInsight BPs if you need to distribute them differently, you are not forced to use a single BP with event-based decisions, it is a matter of your taste and requirements. In my experience however in the past I had some annoying issues with WSDL exposing multiple operations and eInsight, hopefully those are gone with the latest Rollup but do some quick test yourself before betting all your money on it.

  • Need to implement auto suggest with multiple select in a input text field

    Hi,
    Jdev Ver: 11.1.1.4
    My requirement is to create an input field where i can provide auto suggest and user can enter multiple email ids. It is similar to current "To" field while composing a mail in Gmail.
    Problem:
    I have implemented input box with auto suggest. For the first entry it works fine. when i enter 2nd value(i have used ',' (comma) as separator and handled it in 'suggestItems' bean method to take sub-string after comma for providing the suggestion) , after selection.... the first value get lost. So at a time only one value is selected in the input text.
    Input text:
    <af:inputText label="Names" id="it21" rows="2"
    columns="50" simple="true"
    valueChangeListener="#{VisitBackingBean.visitMembersInputBoxCL}"
    binding="#{VisitBackingBean.visitMembersInputBox}">
    <af:autoSuggestBehavior suggestItems="#{VisitBackingBean.onSuggest}"/>
    </af:inputText>
    Bean Method:
    public List onSuggest(FacesContext facesContext,
    AutoSuggestUIHints autoSuggestUIHints) {
    BindingContext bctx = BindingContext.getCurrent();
    BindingContainer bindings = bctx.getCurrentBindingsEntry();
    String inputNamevalue = autoSuggestUIHints.getSubmittedValue().trim();
    if(inputNamevalue.contains(",")) {
    inputNamevalue = inputNamevalue.substring(inputNamevalue.lastIndexOf(",")+1).trim();
    //create suggestion list
    List<SelectItem> items = new ArrayList<SelectItem>();
    // if (autoSuggestUIHints.getSubmittedValue().length() > 3) {
    OperationBinding setVariable =
    (OperationBinding)bindings.get("setnameSearch");
    setVariable.getParamsMap().put("value",
    inputNamevalue);
    setVariable.execute();
    //the data in the suggest list is queried by a tree binding.
    JUCtrlHierBinding hierBinding =
    (JUCtrlHierBinding)bindings.get("AutoSuggestName_TUserROView1");
    //re-query the list based on the new bind variable values
    hierBinding.executeQuery();
    //The rangeSet, the list of queries entries, is of type //JUCtrlValueBndingRef.
    List<JUCtrlValueBindingRef> displayDataList =
    hierBinding.getRangeSet();
    for (JUCtrlValueBindingRef displayData : displayDataList) {
    Row rw = displayData.getRow();
    //populate the SelectItem list
    items.add(new SelectItem(rw.getAttribute("UsrUserName").toString().trim() +
    "<" +
    rw.getAttribute("UsrMailId").toString().trim() +
    ">",
    rw.getAttribute("UsrUserName").toString().trim() +
    "<" +
    rw.getAttribute("UsrMailId").toString().trim() +
    ">"));
    return items;
    Please suggest how can i achieve the mentioned functionality.

    Hi,
    doesn't work this way as the suggest list returns a single value. You can actually use the existing values as a prefix to the new value in which case the suggest list would look a bit odd. Beside of this all you can do is to create a user lookup field with auto suggest and once a name is selected, update another field with the value returned from this action
    Frank

  • Queries not working with multiple bind position variables?

    still need help here - can anyone provide any direction?
    (note: this is a follow-up from prior topic, " How to use JDBC Positional Binding Style & ExecuteWithParams?")
    I created two simple view objects off of the same entity
    object to perform this test:
    #1 - ViewObject with one bind position variable - where clause: where id > ?
    #2 - ViewObject with two bind position variables - where clause: where id > ? and id < ?
    I created two separate .jspx pages, view1.jspx (one input field) and view2.jspx (two input fields), for each view object by dragging ExecuteWithParams operation onto the JSF page.
    The .jspx page with one input field works (returns result sets.) The view2.jspx page with two input fields does not work - the query does not return any result sets (no errors produced, it just does not return any rows) - I've tested my query outside of jdeveloper and it works fine. I also tried switching my inputs to make sure I did not have an illogical query (i.e., id >100 and id< 1).
    Is there anything different / extra I need to do to use two bind position variables?
    Everything in this simple test was identical except for using 2 input variables versus 1.
    Technology stack is: jdeveloper 10.1.3, jsf/ADF BC, mySQL 5.01
    Message was edited by:
    javaX

    Using the where clause: "where id > ? and id < ?” for the 2 input variables, I get the same result - no row results returned (though query works outside the browser.)
    Interestingly, I modified the where clause to “where between ? and ?”, and then used values of ‘1’ and ‘100’ to test. Using the BC4J tester, the query gave back a single row with id = 100 (should have brought back 100 rows because there are 100 records with id’s 1-100.) So I got it to return something, but not the right results. This makes me believe that a different query is being sent to MySQL other than what I'm expecting from what is shown in the SQL Statement of the View Object..
    Is there anyway to view what SQL statement is actually being sent to the database using the BC4J tester? Also, could this be an issue related to the mySQL connector drivers and JDeveloper? I’m using mysql-connector-java=3.1.11-bin.jar (10/10/2005)? First though, if I could see what query is actually being sent, this may help me to debug and figure out the problem.

  • ADF Mobile: WebService data control method call with array

    JDev 11.1.2.3
    ADF Mobile deployed to Android emulator
    Hello All,
    I am trying to invoke a method in my Web Service data control and get the following exception
    Caused by: ERROR [oracle.adfmf.framework.exception.AdfInvocationRuntimeException] - Cannot serialize: [I@1dbae822
            at oracle.adfmf.dc.ws.soap.SoapTransportLayer.invokeSoapRequest(Lorg/ksoap2/SoapEnvelope;)Ljava/lang/Object;(Unknown Source)
            at oracle.adfmf.dc.ws.soap.SoapWebServiceOperation.invoke(Ljava/lang/String;Loracle/adfmf/dc/ws/soap/SoapGenericType;)Ljava/lang/Object;(Unknown Source)
            at oracle.adfmf.dc.ws.soap.SoapWebServiceOperation.invoke(Ljava/lang/String;Ljava/util/Map;)Ljava/lang/Object;(Unknown Source)
            at oracle.adfmf.dc.JavaBeanOperation.execute(Ljava/lang/Object;Ljava/util/Map;)Ljava/lang/Object;(Unknown Source)
            at oracle.adfmf.dc.ws.WebServiceDataControlAdapter.invokeOperation(Ljava/util/Map;Loracle/adfmf/bindings/OperationBinding;)Z(Unknown Source)
            at oracle.adfmf.bindings.dbf.AmxMethodActionBinding.execute()Ljava/lang/Object;(Unknown Source) This method is an AppModule method exposed as a service interface and the parameter for this method is a List<oracle.jbo.domain.Number>. The schema definition for the input is as follows:
    <element name="acceptTask">
       <complexType>
         <sequence>
                <element maxOccurs="unbounded" minOccurs="0" name="taskID" type="decimal"/>
         </sequence>
       </complexType>
    </element>For the input to my binding, I have tried int[], Integer[] and List<Integer>. All of these result in similar errors.
    I have also tried invoking this through a regular ADF application and that works fine with an int[]. It looks like something specific to the ADF Mobile SOAP layer.
    Is this a bug or a restriction in the framework? Any workarounds that has worked for anyone?

    No luck. A WS DC method call with a simple parameter (java.lang.String or java.lang.Integer) works fine but I can't get it to work when there is an array input.
    I have tried WS methods with int arrays and simple string arrays without any luck. All of them result in a cannot serialize error.
    I can't figure out what I am doing wrong. Are there any working WS Datacontrol samples with array inputs?

  • Support for Array Binding and PL/SQL tables (IN, INOUT, or OUT)

    I have attempted, unsuccessfully, to use array binding in stored procedure/function calls where the sp/sf has parameters that are PL/SQL tables. I have seen the topic floating around in this forum, but I have not seen the explicit questions:
    - Does ODP.NET support PL/SQL tables as IN, INOUT or OUT parameters to stored procedures/functions?
    - Will any planned ODP.NET release support PL/SQL tables as IN, INOUT or OUT parameters to stored procedures/functions?
    I am aware that I can use REF CURSORS to handle the OUT situation, but I need to make a design decision concerning supporting parameters of IN and INOUT PL/SQL tables.
    Thanks.
    James

    You really MUST do this!! - i.e. include support for PL/SQL table parameters (IN INOUT and OUT) in a future release of ODP.NET.
    PL/SQL tables are a fundamental type in Oracle stored procedures and you will be preventing a huge number of existing projects from migrating to .NET if you don't acknowledge them as part and parcel of Oracle programming.
    I sincerely hope support for PL/SQL table parameters is treated as a serious issue.
    Think what a coup it would be for you over Microsoft (who don't currently support PL/SQL tables with their .NET native provider for Oracle and don't look as if they will at least in the short term)!
    Please, please, please!

  • Execute PL/SQL block with named binds from within java code?

    Hi guys,
    Is there any good way to execute my PL/SQL code, for example
    BEGIN         :x := :x+1; END;
    from my Java code? I need nothing complicated, just static code block with named binds.
    I have tried the Oracle exetnded JDBC (setXXXbyName methods):
      public static void main(String[] args){     try {     Class.forName("oracle.jdbc.driver.OracleConnection");     Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","user","password"); String SQL="begin :x:=:x+1; end;"; OracleCallableStatement stmt; stmt=(OracleCallableStatement)conn.prepareCall(SQL); stmt.setIntAtName("x", 5); stmt.registerOutParameter("x", Types.INTEGER); stmt.execute(); System.out.println(stmt.getInt("x"));     } catch (Exception x) { x.printStackTrace();    }   }
    And get the java.sql.SQLException: operation not allowed: Ordinal binding and Named binding cannot be combined!
    Then i've tried SQLJ appoach:
      public static void main(String[] args){     try {     Class.forName("oracle.jdbc.driver.OracleConnection");     Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","user","password");       Oracle.connect(conn);       System.out.println("Connected!");           int x=3;       #sql { BEGIN         :x := :x+1;       END; };           System.out.println("x=" + x);     } catch (Exception x) { x.printStackTrace();    }   }
    And x=3 had retuned... Although 4 expected.
    Then, I've set parameter sqlj.bind-by-identifier=true
    And result is another exception! java.sql.SQLException: Missing IN or OUT parameter at index:: 2
    Can you please mark my mistakes/point to correct solution?
    Thanks in advance,
    Alexey

    Found another solution, this time working at least...
      public void testPLSQL() {
           String dynamicSQL=
                "declare\n" +
                "  v_CursorID  INTEGER;\n" +
                "  v_BlockStr  VARCHAR2(500);\n" +
                "  v_Dummy     INTEGER;\n" +
                "  v_x         String(18);\n" +
                "BEGIN\n" +
                "  v_CursorID := DBMS_SQL.OPEN_CURSOR;\n" +
                "  v_BlockStr :=?;" +
                "  DBMS_SQL.PARSE(v_CursorID, v_BlockStr, DBMS_SQL.V7);\n" +
                "  v_x:=?;"+
                "  DBMS_SQL.BIND_VARIABLE(v_CursorID, ':x', v_x,18);\n" +
                "  v_Dummy := DBMS_SQL.EXECUTE(v_CursorID);\n" +
                "  DBMS_SQL.VARIABLE_VALUE(v_CursorID, ':x', v_x);\n" +
                "  DBMS_SQL.CLOSE_CURSOR(v_CursorID);\n" +
                "  ?:=v_x;"+
                "  COMMIT;\n" +
                "EXCEPTION\n" +
                "  WHEN OTHERS THEN\n" +
                "    DBMS_SQL.CLOSE_CURSOR(v_CursorID);\n" +
                "    RAISE;\n" +
                "END DynamicPLSQL;";
             try {
                   Class.forName("oracle.jdbc.driver.OracleConnection");
                   Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","user", "password");
                   System.out.println("Profit");
         String SQL="begin :x:=:x+1; end;";
         OracleCallableStatement stmt;
         stmt=(OracleCallableStatement)conn.prepareCall(dynamicSQL);
         stmt.setString(1, SQL);
         int x=3;
         stmt.setInt(2, x);
         stmt.registerOutParameter(3,     Types.INTEGER);
         stmt.execute();
         x=stmt.getInt(3);
         System.out.println(x);
         assertEquals(4, x);
             } catch (Exception ex) {
                  ex.printStackTrace();
                  assertTrue(false);
      }Now the only thing I need is to code some kind of preprocessor of SQL block, to prepare the dynamicSQL lair for SQL critter...
    Please please please show me something less complicated! :8}

  • OIM 11gR2 - custom attribute with illegal binding on Create User form in published sandbox

    Hi,
    I think I have managed to paint myself into a corner!
    In OIM 11gR2 I have added a number of custom attributes to the "User Form" - some Text-, some Lookup-type attributes.
    While customizing the "Create User" page within a sandbox and adding a SelectOneChoice item and fiddling around with its binding, I was distracted by a phone call and the browser timed out.
    The binding property on the new item is now not correct and the sandbox has unfortunately been published, and I am now unable to enter the "Create User" page - when I try, I get the following:
    <Sep 23, 2013 2:39:11 PM CEST> <Warning> <oracle.adf.view.rich.component.fragment.UIXRegion> <ADF_FACES-00009> <Error processing viewId: /user/createView URI: /oracle/iam/ui/runtime/form/view/pages/userCreateForm.jsff actual-URI: /oracle/iam/ui/runtime/form/view/pages/userCreateForm.jsff.
    javax.el.PropertyNotFoundException: Target Unreachable, 'ekstraresource1__c' returned null
            at com.sun.el.parser.AstValue.getTarget(AstValue.java:108)
            at com.sun.el.parser.AstValue.isReadOnly(AstValue.java:149)
            at com.sun.el.ValueExpressionImpl.isReadOnly(ValueExpressionImpl.java:248)
            at oracle.adfinternal.view.faces.renderkit.rich.EditableValueRenderer._getUncachedReadOnly(EditableValueRenderer.java:486)
            at oracle.adfinternal.view.faces.renderkit.rich.EditableValueRenderer.cacheReadOnly(EditableValueRenderer.java:416)
            at oracle.adfinternal.view.faces.renderkit.rich.LabeledInputRenderer.beforeEncode(LabeledInputRenderer.java:128)
            at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:340)
    <Sep 23, 2013 2:39:11 PM CEST> <Warning> <oracle.adf.view.rich.component.fragment.UIXRegion> <ADF_FACES-00009> <Error processing viewId: /catalog-tf/cart-details URI: /oracle/iam/ui/catalog/pages/cart-details.jsff actual-URI: /oracle/iam/ui/catalog/pages/cart-details.jsff.
    javax.el.PropertyNotFoundException: Target Unreachable, 'ekstraresource1__c' returned null
            at com.sun.el.parser.AstValue.getTarget(AstValue.java:108)
            at com.sun.el.parser.AstValue.isReadOnly(AstValue.java:149)
            at com.sun.el.ValueExpressionImpl.isReadOnly(ValueExpressionImpl.java:248)
            at oracle.adfinternal.view.faces.renderkit.rich.EditableValueRenderer._getUncachedReadOnly(EditableValueRenderer.java:486)
            at oracle.adfinternal.view.faces.renderkit.rich.EditableValueRenderer.cacheReadOnly(EditableValueRenderer.java:416)
            at oracle.adfinternal.view.faces.renderkit.rich.LabeledInputRenderer.beforeEncode(LabeledInputRenderer.java:128)
            at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:340)
    Caused By: java.io.IOException: javax.el.PropertyNotFoundException: Target Unreachable, 'ekstraresource1__c' returned null
            at oracle.adfinternal.view.page.editor.renderkit.PageCustomizableRenderer.encodeAll(PageCustomizableRenderer.java:764)
            at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
            at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:341)
            at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
            at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
            at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:405)
    etc.
    Of course the sandbox should not have been published - but it is - and I am stuck trying to figure out how to somehow undo this mess.
    Is it possible to clean up this mess by diving to the database and removing some rows from the right tables - or perform some other operations undo my mistake?
    Thanks in advance,
    - Tom

    oim version is oim 11gR2 with BP4

  • How to do like this with array?

    How to do like this with array?
    I have 2 constants array put in main while loop ( array1{6,6}; array2{4,4} ). Those arrays will be come the input data for st in the small while loop inside.
    The input data look like : [6,6],[4,4],[6,6],[4,4]...... I have to put input data to result array[8]. The method is:
    input data result data
    [6,6] --------------------------------------------> [6,6,0,0,0,0,0,0]
    [4,4] --------------------------------------------> [6,6,4,4,0,0,0,0] ( this period, just add each element in new array)
    [6,6] --------------------------------------------> [6,6,4,4,6,6,0,0]
    [4,4] --------------------------------------------> [6,6,4,4,6,6,4,4]
    [6,6,4,4,6,6,4,4] ( 1st period )
    When the las index of result data array is filled in, I have to collapse the result data array to be this array:
    ----------> collapse: [6,4,6,4,0,0,0,0] ( take the average of 2 continuous element add to new result data array)
    Next input data
    [6,6] --------------------------------------------> [6,4,6,4,6,0,0,0]
    [4,4] --------------------------------------------> [6,4,6,4,6,4,0,0] ( this period, add the average of 2 continuous elements in new array )
    [6,6] --------------------------------------------> [6,4,6,4,6,4,6,0]
    [4,4] --------------------------------------------> [6,4,6,4,6,4,6,4]
    [6,4,6,4,6,4,6,4] ( 2 nd period)
    ----------> 2nd collapse [5,5,5,5,0,0,0,0] ( take the average of 2 continous element add to new result data array)
    Next input data
    [6,6] ....wait until input data has 4 elements
    [4,4] -------------------------------------------------------------------------------------> [5,5,5,5,5,0,0,0]
    [6,6] ....wait until input data has 4 elements
    [4,4] -------------------------------------------------------------------------------------> [5,5,5,5,5,5,0,0]
    [6,6] ....wait until input data has 4 elements
    [4,4] -------------------------------------------------------------------------------------> [5,5,5,5,5,5,5,0]
    [6,6] ....wait until input data has 4 elements
    [4,4] -------------------------------------------------------------------------------------> [5,5,5,5,5,5,5,5]
    [5,5,5,5,5,5,5,5] ( third period )
    ----------> 3rd collapse [5,5,5,5,0,0,0,0]
    This wayl to make the tren graph.I  made  an VI to do that , but it's not yet correct.
    Attachments:
    tryyyyyyy.vi ‏39 KB
    trend_mode.JPG ‏49 KB

    Frankly, I don't understand your problem description or your VI.
    In the description, the output array has a fixed size of 8 elements, is this correct? In this case you should initialize an array of 8 elements and do all operations "in place". I don't udnerstand the purpose of all the other code.
    There are a lof of things that don't make any sense at all.
    The second largest loop has no purpose, because it iterates only once per call
    Sometimes you are concatenating an empty array to an existing array. This makes no difference.
    Why is some of your data EXT representation???
    What's up with complicated constructs such as that small loop shown in the picture. I show a somewhat simpler alternative.
    Anyway, I have a hard time understanding your description. What should happen at the end? Do you have a link to a website that describes the algorithm? Does the algorithm have a name?
    Message Edited by altenbach on 01-10-2008 09:55 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Simplify.png ‏5 KB

Maybe you are looking for