Can I use an array on a table in "IN"

Can I use a table or an array in 'IN'?
It doesnt work.
create or replace
TYPE "SPLIT_TBL2"
as table of number(12,2);
declare
  v_tab_num split_tbl2;
  v_num number;
begin
  select * bulk collect into v_tab_num from table(tools.split('1,2,3,4', ','));    -- return a table like SPLIT_TBL2
  select 1 into v_num from dual where 1 in (v_tab_num);  -- it doesn't work
end;

Example:
create or replace
TYPE "SPLIT_TBL2"
as table of number(12,2);
declare
  v_tab_num split_tbl2 := split_tbl2(3);
  v_num number;
begin
--  select * bulk collect into v_tab_num from table(tools.split('1,2,3,4', ','));    -- return a table like SPLIT_TBL2 
  select 33 into v_num from dual where 3 in (select * from TABLE((v_tab_num)));  -- it doesn't work 
  dbms_output.put_line( v_num);--outputs 33
end;

Similar Messages

  • How can I use my array in another method.... Or better yet, what's wrong?

    I guess I'll show you what I am trying to do rather and then explain it
    public class arraycalc
    int[] dog;
    public void arraycalc()
    dog = new int[2];
    public void setSize(int size)
    dog[1] = size;
    public int getSize()
    return dog[1];
    This gives me a null pointer exception...
    How can I use my array from other methods?

    You have to make the array static. :)
    Although I must admit, this is rather bad usage. What you want to do is use an object constructor to make this class an object type, and then create the array in your main class using this type, and then call the methods from this class to modify your array. Creating the array inside the other method leads to a whole bunch of other stuff that's ... well, bad. :)
    Another thing: Because you're creating your array inside this class and you want to call your array from another class, you need to make the array static; to make it static, you must make your methods static. And according to my most ingenious computer science teacher, STATIC METHODS SUCK. :D
    So, if you want to stick with your layout, it would look like:
    public class arraycalc
         static int[] dog;
         public static void arraycalc()
              dog = new int[2];
         public static void setSize(int size)
              dog[1] = size;
         public static int getSize()
              return dog[1];
    }But I must warn you, that is absolutely horrible code, and you shouldn't use it. In fact, I don't even know why I posted it.
    You should definitely read up on OOP, as this problem would be better solved by creating a new object type.

  • Can I Use The Products On The Tables At The Apple Store

    I Want An Apple Product But i dont know if i should get an ipod and iphone idk but i would like to know if i can use the products on the tables so i can choose the apple product i want and i need to know before this afternoon

    If they're sitting on the tables and not in boxes, they're display models and intended for people to play around with without buying them.
    (78249)

  • Can you use schema name in "INTO TABLE" in sqlldr?

    Hi All,
    I have a simple question.
    My Oracle userid is SBHAT.
    SBHAT has insert,delete, select,update privileges on a Table in another schema XYZ.
    I want to SQL*Load data in Table EMPLOYEE in XYZ schema, using my userid. Something like ....
    sqlldr userid=*SBHAT*/password control=test.ctl data=test.txt
    I tried to use the following in my test.ctl file but it does not work.
    load data
    append
    into table "XYZ.EMPLOYEE"
    fields terminated by ',' optionally enclosed by '"'
    trailing nullcols
    Can someone give me the proper syntax for into table that uses *schema.table_name* construct.
    Thanks,
    Suresh

    Pl post exact OS and database versions - what do you get when you execute sql*loader with the syntax you have identified so far ?
    http://docs.oracle.com/cd/E11882_01/server.112/e22490/ldr_control_file.htm#i1005623
    HTH
    Srini

  • Can I use CSS to target a table or a DIV

    Ok, I am trying to use DW Layers so when I click on a
    thumbnail, I can trigger the "SetTextofLayer". The reason i do this
    is because I dont know of any other way to do it., but as you all
    know, the positioning of DW layers is absolute. So is there a
    simple way i can have an image trigger the change of text in a
    table or div. How do I do that? I looked, but all Ive found was
    tutorials on how to swap an image, not change text. Is there anyway
    to trigger table data using an image? Any help would be greatly
    appreciated
    -psy

    Look again at how I did it on my sample page. I removed ALL
    positioning
    from the div after applying the behavior (leaving it as a
    position:static,
    the default). It still works fine.
    http://murraytestsite.com/stol-text2.html
    shows a few tweaks I did -
    1. Moved the onclick event to an <a> tag surrounding
    the <img> tag so that
    you get a proper cursor on the image.
    2. Added a return false to the onclick event to avoid an IE
    flake.
    3. Added quotes to your STOL code.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "psypent81" <[email protected]> wrote in
    message
    news:[email protected]...
    > Hi,
    > Thanks again. Ive tried using the two methods A) Using
    the SetTextofLayer
    > -Which is nice, but it brings me to the whole absolute
    vs relative
    > positioning
    > deal.
    > Here's what I tried:
    >
    >
    http://www.helenbwilson.com/SetTextofLayer-01
    >
    > It's great but it still stays in an absolute position
    even though I
    > changed the
    >
    > #imageLayer {
    > position:relative;
    > width:400px;
    > height:400px;
    > z-index:1;
    > left: 290px;
    > top: 94px;
    > }
    >
    > I also tried to use the change of position to this page:
    >
    >
    http://www.helenbwilson.com/helen-portfolio-1.html
    >
    > All it did was make my caption disappear completely!
    > Actually, I tried both on that one page. If you click,
    you dont get the
    > caption anymore, whereas in
    >
    >
    http://www.helenbwilson.com/helen-portfolio-2.html
    >
    > you get the captions, albeit in absolute position form..
    > I just want this to be a quick patch, since I am now
    beginning to see the
    > light in terms of CSS positioning
    >
    > So what exactly am I doing wrong (Besides the obvious
    answer of Do not use
    > DW
    > Layers, lol) .
    > I really appreciate all the help. Thanks
    >
    > -psypent
    >

  • Can I use a cell text as table name

    I would like to give my table name the same as the cell A1. the tables I am using are journals so the first cell is the date and I would like to give the table the same date. Can I link the two so I only have to write the date once?

    lovattsa wrote:
    I would like to give my table name the same as the cell A1. the tables I am using are journals so the first cell is the date and I would like to give the table the same date. Can I link the two so I only have to write the date once?
    No. But, you can Copy the content of A1 and Paste into the Table Name field in the Sheets Pane.
    Jerry

  • Can't use filter when accessing hana table through link from another table in sapui5

    Hi all,
    Have a strange one and I was wondering if someone had come across this before.
    Hana table structure
          entity SalesOrder {
        key element name : String;
        element contact : Association[0..*] to Contact via backlink order;
    entity Contact {
    element location: Location;
        element order : Association to SalesOrder;
    ==
    each sales order has a number of contacts.
    In javascript, if I bind on list of contacts directly then I can use the filter
    oRowRepeater.bindRows("/Contact",oRowTemplate,null,[new sap.ui.model.Filter("location",sap.ui.model.FilterOperator.EQ, "Germany")]);
    and if I enter link i returns the number of entries
    Contact/$count?$filter=location eq 'Germany'
    But if I get contacts through the sales order it doesn't allow me to use the filter,
    oRowRepeater.bindRows("/SalesOrder('mike')/Contact",oRowTemplate,null,[new sap.ui.model.Filter("location",sap.ui.model.FilterOperator.EQ, "Germany")]);
    I can return the contacts same as accessing them directly and i can get the information such as
    new sap.ui.commons.TextView({text: "{location}"}) same as before but only difference is that i can't filter.
    When I try the following I get error
    /SalesOrder('mike')/Contact/$count?$filter=location eq 'Germany'
    Error
    "message": {
                "lang": "en-US",
                "value": {
                    "type": "ODataInputError",
                    "message": "Bad Request URL: U"
    When I open Chrome Developer Tools I see the following error
    SalesOrder/contact/$count?$filter=location%20eq%20%27EMEA%27 400 (Bad Request)
    Basically the $count doesn't work if you access contacts indirectly even though the link is there.
    Is this a bug or am I doing something wrong?
    Hana is sp8, I am up to date with almost everything.
    Many thanks,
    Matthew

    for the reading/writing from oracle to access, you could do something like this:
    for table in oracle/access with fields of id(number), name(varchar/text):
    Connection oconn = //connect to Oracle
    Connection aconn =  //connect to access
    //create the insert statement into access table
    PreparedStatement apstmt = aconn.prepareStatement("INSERT INTO accesstable (id, name) values (?,?)");
    //select all the results neeed from oracle table
    Statement ostmt = oconn.createStatement();
    ResultSet rs = ostmt.executeQuery("select id, name from oracletable where...");
    while ( rs.next() )
         apstmt.setLong(1, rs.getLong(1));
         apstmt.setString(2, rs.getString(2));
         apstmt.addBatch();
         //if your driver doesn't support batching, just use this:
         //apstmt.executeUpdate();
    //use this only if you use batch statements
    apstmt.executeBatch();
    rs.close();
    stmt.close();
    apstmt.close();
    oconn.close();
    aconn.close();

  • Can i use OEM to automaticaly fill tables with data ?

    Hi currently, i have tables that contains data on our databases such as the characteristics of the servers where these DB are stored, the user enter these data manually via an interface. I know that OEM has these information, i want to use it to automatically fill the tables with it. Is that doable ?

    Apparently you know nothing of OEM architecture. The obvious would be to look up documentation, sadly you belong to the majority of people here refusing to read any documentation.
    OEM comes in the flavors Grid Control (monitoring multiple databases) and Database Control (monitoring one database).
    OEM needs a repository. Using Grid Control this is located in a separate database, and each server has the Intelligent Agent installed to collect information from that server, provided the database is registered against grid control.
    Using Database Control, the repository is in the monitored database.
    Having OEM 'feed' your 'repository' would be about the poorest solution you can implement. Converting your 'repository' in views on the OEM schema would be the only viable solution, as Grid Control automatically has the most recent info.
    And obviously, for those who read, the OEM info is in the SYSMAN schema.
    Sybrand Bakker
    Senior Oracle DBA

  • SELECT-OPTIONS can u use it to read internal table ?????

    Hello All,
       I am trying to read an internal table with the select-options statement. I am getting a syntax error so i am hoping i am just coding it incorrectly. Can someone tell me what is wrong here is the if statement :
    if p_begdte in t_rpt-datab and
           p_enddte in t_rpt-datbi.
        else.
           exit.
        endif.
    thanks scott

    This is not working?
    tables: a916.
    * Beg valid date *
    data text021(29).
    selection-screen begin of line.
    selection-screen comment 1(30) text-021 for field p_begdte.
    selection-screen position 32.
    select-options: p_begdte for a916-datab default '20041101' to
    '99991231'.
    selection-screen end of line.
    * End valid date *
    data text022(29).
    selection-screen begin of line.
    selection-screen comment 1(30) text-022 for field p_enddte.
    selection-screen position 32.
    select-options: p_enddte for a916-datbi default '20041101' to
    '99991231'.
    selection-screen end of line.
    start-of-selection.
    <b>Loop at t_rpt.
    if t_rpt-datab in p_begdte
      and t_rpt-datbi in p_endte.
    * do something
    else.
    exit.
    endif
    Endloop.</b>
    Regards,
    Rich Heilman

  • Can i use an array as a methods parameter?

    If you can how would I call the method?
    public void method(int[] p){
    method({1, 1, 1 , 1});that gives me errors :D
    Edited by: tom14201 on Dec 16, 2007 5:19 AM

    sorry I meant in the last replyint arr[] = new int [4];
    for(int i= 0; i< 4; i++)
    arr[i] = 1;
    method(arr);Edited by: javadare on Dec 16, 2007 5:28 AM
    Edited by: javadare on Dec 16, 2007 5:30 AM

  • Can I use APEX directly read/sync with the Oracle Tables ?

    We have a Oracle Database to manage the design data.I am trying to setup a web-based front end using APEX to manage & monitor the parts ordering & logisitics.I want to drive the master data directly from the database without any export or data transfer ? Can I directly read or Link an Oracle tables from APEX application.
    Also,once this is setup,I am looking for setting up some data entry fields to enter Purchasing & Logistics information.Hope I can achieve this using APEX !
    Look forward for the appropriate response.
    Thanks,
    Sham

    Tony,
    Thanks & Appreciate your Quick response.
    Glad that I can use the existing Oracle db schema with APEX.I am not sure if there is any information as how I can connect or link my production schema to the APEX ! I was able to import .csv files & use XL data to create some test databases & play with APEX..but,I did try to go thru most of the instructions & guides to find how to use the production oracle tables,but,could not find anything particular...Please send me a link or material info.
    I suppose I can then use which ever attribute or table data that is required to build the queries ! I am planning to use the production data to build the ordering & logistics application using APEX.Assume I can create new fields & columns for parts that will be ordered & capture/record the purchasing information like Purchase order numbers/Supplier Info/Target Delivery dates etc...
    - Am on very tight schedules to get this application up & running ! Is there any support team or a technical support team that I can call upon if I need any help ?
    Thanks,
    Sham

  • How to use Javascript array in the JSP

    hELLO Friends,
    I am creating an String array using the values
    in the list of a jsp page using Java script..
    How can I use this array in the same jsp
    file for processing...
    any help in this regard would be highly appreciated.
    thanks in Advance...
    ashish

    you cannot pass values from javascript to JSP without having to form-post to another JSP page.

  • How to use an Array

    Morning all,
    I am trying to setup an array of numbers however, by looking at the crystal reports help file, I cannot find out how to set one up.
    I have created a new formula and inserted
    Local NumberVar Array x := MakeArray (1, 2, 3, 4, 5);
    however, it says you cannot set a result to an array.
    I have also looked at the Array help, but Crystal shows a VB syntax instead of Crystal. (How helpful to show VB syntax in CR!)
    My question is how can you use an array in your report that it shows numbers 1-5?
    many thanks
    Kind Regards
    Jehanzeb

    The question is - what you want to do with this array. Your code is correct , beside that you need to return something from formula and that needs to be discrete value.
    Local NumberVar Array x := MakeArray (1, 2, 3, 4, 5);
    "test"

  • Can i use select statements in LDB

    Hai All,
       Can i use select statements and internal table in a LDB program.
    my requirement is that if i enter company code , fiscal year and reporting periods.
    generally fiscal year will be jan to dec.but in my requirement the fiscal year is apr of previous year to march of currentyear.
    so as i require the last years data can iuse select statement in that ldb program or is there any solution for this.
    Thanks in Advance
    kiran

    Hi Kiran,
    To retrive records from ldb you have to use the
    GET <node> statement. This will invoke the selection screen of the node. An alternate solution is to use the function module LDB_PROCESS.
    Please see the following link for help and example
    http://help.sap.com/saphelp_nw04/helpdata/en/64/237f8cd43711d1950b0000e8353423/content.htm
    Thanks
    Vinod

  • Using Assoc Arrays in OBPM 10GR3 for 25 million comparisons

    Can we use Associative arrays in OBPM 10GR3 to do 25 million comparisons or even more than that?
    I have two assoc arrays which I compare with each other 25 million times by looping them one inside the other.
    For e.g.
    for(int i = 0; i < 5000; i++)
    for(j=0; j < 5000; j++)
    if(i==j)
    logMessage ("The value is equal");
    when I try to do that, I get an error:-
    Persistence Data error.
    I get this error:-
    Error while persisting the transaction data: 'An error occurred while accesing the database. Detail:SQL statement: 'unknown' ' Details: An error occurred while accesing the database. Detail:SQL statement: 'unknown' Caused by: Unexpected exception while enlisting XAConnection java.sql.SQLException: Transaction rolled back: Transaction timed out after 302 seconds BEA1-25BFB4A4F3934EFC9C00 at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1418) at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1330) at weblogic.jdbc.wrapper.JTAConnection.getXAConn(JTAConnection.java:189) at weblogic.jdbc.wrapper.JTAConnection.checkConnection(JTAConnection.java:64) at weblogic.jdbc.wrapper.Connection.preInvocationHandler(Connection.java:92) at weblogic.jdbc.wrapper.Connection.prepareStatement(Connection.java:482) at fuego.jdbc.FaultTolerantConnection.prepareStatement(FaultTolerantConnection.java:541) at fuego.server.persistence.jdbc.JdbcServerActivityPersMgr.insertInstanceEvent(JdbcServerActivityPersMgr.java:913) at fuego.server.persistence.Persistence.storeInstanceEvent(Persistence.java:944) at fuego.server.execution.EngineExecutionContext.persistEvents
    So can we use such a big comparison on OBPM 10GR3. If yes, how?

    Don't use ASSOC Arrays. Use SETs.
    Also increase the JTA timeout in Weblogic to like say 600 seconds.

Maybe you are looking for

  • No ipod can connect to my machine

    I have searched and searched, and I have not found anyone with this specific problem. At this point, I am fairly confident that the problem is in my computer and not my ipod, as my ipod can connect just fine to any other machine. Additionally, any ot

  • Reading NVARCHAR fields, how?

    Hi, I have NVARCHAR colunm in my database table and it contains string saved in different character sets. I have also another field telling what character set is used. The question is that how should I read that NVARCHAR column if I wanted to get con

  • Converting files to QT

    I have a couple of files that won't play in QT. They are MPEG-2, MPEG Layer files. I downloaded MPEG Streamclip but when I try to conver them to a QT file, it says I don't have the playback component to do this. I downloaded the files on a pc. I need

  • 0EMPLOYEE master data issue

    Hi All, We are extracting the data from HR to BI info object 0EMPLOYEE. The data source name 0EMPLOYEE_ATTR. While extracting the data from HR to BI the data is coming up to PSA and the data is not updating to info object (some of the employees aroun

  • Sequencing and AD

    trying to sequence an app... (sequencer machine is not in AD) during installation get the error : installation cannot continue. The folder written in configuration file is not valid. The same app installs without problems on W7 in AD. I run the insta