How to use array or type in "IN" criteria

Hi all,
anybody knows how to use group of same datatype data ( array or type ) in SQL statement
For example
ls_dept[1] = 'abc';
ls_dept[2] = 'xyz';
ls_dept[10] = 'ppr';
i want to use this group of data in "IN" criteria like
Select * from department where dept in ('abc','xyz'.....''ppr');
if anybody know how to use please reply me as soon as possible.
Thanks,

I hope you are not suggesting concatenating literals from a web front-end application ;) Is it not what he was saying.. he is getting user input info from an application.. if the user sends multiple values.. he has to build a string with concatenating literals..
correct me if I am wrong.

Similar Messages

  • How to use the customer types in customer master data

    how to use the customer types in customer master data?
    menu path is Extras -> account group info -> customer types

    hi,
    This is an option given to you to choose (if you need to) the way you perceive this customer.Here you get options including ompetitors,Salespartner, prospect,
    default sp ,consumer.
    See it helps you to differentiate between prospect(which you may use for quotation or inquiry purpose)Sales partner and the competetor.
    I hope this clarifies your quiery.Reward points if so.
    Thanking you,
    Best regards,
    R.Srinivasan

  • How to use PO message type to output 'Form' as PDF file

    Dear experts,
      I am working for a topic of how to use PO message type to output 'Form' as 'PDF file', and save to external file system automatically.
      Any one familiar to this topic, please kindly give me some guide, thank you!
    Regards,
    Joyce

    Hi,
       Go through the program RSTXPDFT4 (Converting SAPscript (OTF) or ABAP List Spool Job to PDF), you will get some idea.  Using this program you can convert spool into PDF file.
    -Alpesh

  • How to use same Data Type and Length for two fields

    How to use same data type and length for two fields when using 'FOR ALL ENTRIES IN' in a select statement? For instance the select queries are :
    SELECT bukrs gjahr belnr lifnr budat bldat zlspr dmbtr waers shkzg
    FROM bsik
    INTO TABLE it_bsik
    WHERE bukrs = p_bukrs
    AND lifnr IN s_lifnr.
    IF it_bsik IS NOT INITIAL.
    SELECT belnr gjahr awkey awtyp
    FROM bkpf
    INTO TABLE it_bkpf
    FOR ALL ENTRIES IN it_bsik
    WHERE belnr = it_bsik-belnr
    AND gjahr = it_bsik-gjahr.
    IF it_bkpf IS NOT INITIAL.
    SELECT belnr gjahr lifnr xblnr
    FROM rbkp
    INTO TABLE it_rbkp
    FOR ALL ENTRIES IN it_bkpf
    WHERE belnr = it_bkpf-awkey+0(10)
    AND gjahr = it_bkpf-awkey+10(4).
    ENDIF.
    ENDIF.
    Here it gives an error in the 3rd select query that 'When you use the addition "FOR ALL ENTRIES IN itab", the fields "GJAHR" and "IT_BKPF2-AWKEY+10(4)" must have the same type and the same length.'
    Kindly clarify.

    Hi Saurabh,
    Please see the example code that I have developed for you. It will help you solve the problem.
    REPORT ZTEST_3 .
    tables : BKPF.
    data : begin of it_bkpf occurs 1,
             belnr type RE_BELNR,
             awkey type awkey,
             awtyp type awtyp,
             gjahr type GJAHR,
           end of it_bkpf.
    data : begin of it_bkpf1 occurs 1,
             belnr type RE_BELNR,
             awkey type gjahr,              " change the data type
             awtyp type awtyp,
             gjahr type GJAHR,
           end of it_bkpf1.
    data : begin of it_rbkp occurs 1,
             belnr type BELNR_D,
             gjahr type gjahr,
             lifnr type LIFRE,
             xblnr type XBLNR,
           end of it_rbkp.
    select belnr
           awkey
           awtyp
           gjahr
           from bkpf
           into table it_bkpf
           where BUKRS = 'TELH'.
    loop at it_bkpf.
    it_bkpf1-belnr = it_bkpf-belnr.
    it_bkpf1-awkey = it_bkpf-awkey+10(4).           "Here only append the required length.
    it_bkpf1-awtyp = it_bkpf-awtyp.
    it_bkpf1-gjahr = it_bkpf-gjahr.
    append it_bkpf1.
    clear it_bkpf1.
    endloop.
    select  belnr
            gjahr
            lifnr
            xblnr
            from RBKP
            into table it_rbkp
            for all entries in it_bkpf1
            where belnr = it_bkpf1-belnr
    This is just an example. Change the fields according to your requirement.
    Regards
    Abhii
    Edited by: Abhii on Mar 9, 2011 9:08 AM

  • [svn:osmf:] 13113: Changing to not use an embedded font by default, and adding instructions on how to use the free 'type writer' bitmap font.

    Revision: 13113
    Revision: 13113
    Author:   [email protected]
    Date:     2009-12-21 01:08:10 -0800 (Mon, 21 Dec 2009)
    Log Message:
    Changing to not use an embedded font by default, and adding instructions on how to use the free 'type writer' bitmap font.
    Modified Paths:
        osmf/trunk/libs/ChromeLibrary/.flexLibProperties
        osmf/trunk/libs/ChromeLibrary/src/org/osmf/chrome/controlbar/widgets/ScrubBar.as
        osmf/trunk/libs/ChromeLibrary/src/org/osmf/chrome/controlbar/widgets/URLInput.as
    Added Paths:
        osmf/trunk/libs/ChromeLibrary/src/org/osmf/chrome/fonts/
        osmf/trunk/libs/ChromeLibrary/src/org/osmf/chrome/fonts/Fonts.as
    Removed Paths:
        osmf/trunk/libs/ChromeLibrary/assets/images/stop_up.png_1

    Your site was built using tables, whose sizes are defined in your site.
    If we look at your first table definition, we can see:
    <table width="861" height="1449" border="3" cellpadding="0" cellspacing="0" bordercolor="#868787">
    Your table has a width of 861 pixels and an overall height of 1449 pixels. Anything you put into that overall box must fit those dimensions, else
    it won't be visible. Anything you add above it will push everything down. You can redefine your sizing to let you edit more inside of the table elements.
    This is why, when you type in more text, things act weird. If you are in Dreamweaver, you must find the right cell to put your text into and then enter
    text there. Unfortunately, this is going to push things around, which were all lined up using tables. And this gets everything offset with respect to
    everything else in your website.
    And that is why everyone is saying, "Start Over!"
    I just inherited a website that has been put together using tables. I'm going to have to expend considerable effort in rewriting the entire design of the
    website because of that. because everything I intend to add to the pages on the site is going to need to be deconstructed in order to get it to work
    properly if I'm adding text and pictures that need to line up with each other.
    You need something done quick and dirty and the only way I can recommend you do that is to use Dreamweaver to show you the tables you have
    and put what you need in a new table that is defined above or below the tables you all ready have defined. Do that and then get back to someone here
    who knows how to make a website correctly to clean up your entire website and make it editable -- which will cost you some money, but it will be
    money well-spent.
    I like to quote this maxim: Good, Fast, Cheap. Pick any two. This works for website design. You can get it fast and cheap, but it won't be good. I
    think you may have chosen that route.

  • How to use oracle collection type with JDBC?

    I try to use oracle collection type in java program. So I made some package and java program, however Java program was not found "package.collectiontype"(JDBC_ERP_IF_TEST.NUM_ARRAY) . please, show me how to use this.
    Java Version : Java 1.4
    JDBC Driver : Oracle Oci Driver
    DB: Oracle 9i
    No 1. Package
    ===========================================
    create or replace package JDBC_ERP_IF_TEST AS
    type NUM_ARRAY is table of number;
    procedure JDBC_ERP_IF_ARRAY_TEST(P_NUM_ARRAY IN NUM_ARRAY, ERR_NO OUT NUMBER, ERR_TEXT OUT VARCHAR2);
    procedure TEST(ABC IN NUMBER);
    END JDBC_ERP_IF_TEST;
    ==================================================
    No 2. Package Body
    ===============================================
    CREATE OR REPLACE package BODY JDBC_ERP_IF_TEST is
    procedure JDBC_ERP_IF_ARRAY_TEST(p_num_array IN NUM_ARRAY,
    ERR_NO OUT NUMBER,
    ERR_TEXT OUT VARCHAR2) is
    begin
    ERR_NO := 0;
    ERR_TEXT := '';
    dbms_output.enable;
    for i in 1 .. p_num_array.count() loop
    dbms_output.put_line(p_num_array(i));
    insert into emp (empno) values (p_num_array(i));
    commit;
    end loop;
    EXCEPTION
    WHEN OTHERS THEN
    ERR_NO := SQLCODE;
    ERR_TEXT := ERR_TEXT ||
    ' IN JDBC INTERFACE TEST FOR ORACLE ERP OPEN API..';
    ROLLBACK;
    RETURN;
    end JDBC_ERP_IF_ARRAY_TEST;
    procedure TEST(ABC IN NUMBER) IS
    begin
    insert into emp(empno) values (ABC);
    commit;
    end TEST;
    end JDBC_ERP_IF_TEST;
    ===============================================
    NO 3. Java Program
    ===============================================
    ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor("JDBC_ERP_IF_TEST.NUM_ARRAY", getConnection());
    ARRAY array = new ARRAY(descriptor, getConnection(), arrs);
    cstmt = getConnection().prepareCall(LQueryFactory.getInstance().get("Meta/Basic/testJdbcErpArrayIf").getSql());
    cstmt.setArray(1, array);
    cstmt.registerOutParameter(2, Types.INTEGER);
    cstmt.registerOutParameter(3, Types.VARCHAR);
    ====================================================
    couldn't find this phase => JDBC_ERP_IF_TEST.NUM_ARRAY
    what can i do for this package and program? please help me..

    Something like this:
    create or replace type t_record as  object (
    id number,
    no number
    CREATE or replace type t_table AS TABLE OF t_record;
    set serveroutput on
    declare
      v_table t_table := t_table();
      v_t1 t_table := t_table();
    begin
      v_table.extend(1);
      v_table(1).ID := 1;
      v_table(1).No := 10;
      v_table.extend(1);
      v_table(2).ID := 2;
      v_table(2).ID := 20;
      SELEC t_record (ID,NO) BULK COLLECT INTO v_t1
      from TableA
      FROM TABLEA
      WHERE ID IN (select t.ID from table(v_Table) t);
      for i in 1..v_t1.count loop
        dbms_output.put_line(v_t1(i).ID);
        dbms_output.put_line(v_t1(i).No);
      end loop;
    end;
    /Untested!
    P;
    Edited by: bluefrog on Mar 5, 2010 5:08 PM

  • How to use Oracle Table Type values in Select Statement.

    Hi,
    I am fetching initial set of values into Oracle Table of Records Type and want to use list of values in the Select statement.
    For example, try something like the following:
    TYPE t_record IS RECORD (
    ID TABLEA.ID%type,
    NO TABLEA.NO%type,
    v_record t_record;
    TYPE t_table IS TABLE OF v_record%TYPE;
    v_table t_table;
    -- Code to populate the values in v_table here.
    SELEC ID,NO, BULK COLLECT INTO <some other table variabes here> FROM TABLEA
    WHERE ID IN v_table(i).ID;
    I want to know how to use the values from Oracle Table Type in the Select Statement.

    Something like this:
    create or replace type t_record as  object (
    id number,
    no number
    CREATE or replace type t_table AS TABLE OF t_record;
    set serveroutput on
    declare
      v_table t_table := t_table();
      v_t1 t_table := t_table();
    begin
      v_table.extend(1);
      v_table(1).ID := 1;
      v_table(1).No := 10;
      v_table.extend(1);
      v_table(2).ID := 2;
      v_table(2).ID := 20;
      SELEC t_record (ID,NO) BULK COLLECT INTO v_t1
      from TableA
      FROM TABLEA
      WHERE ID IN (select t.ID from table(v_Table) t);
      for i in 1..v_t1.count loop
        dbms_output.put_line(v_t1(i).ID);
        dbms_output.put_line(v_t1(i).No);
      end loop;
    end;
    /Untested!
    P;
    Edited by: bluefrog on Mar 5, 2010 5:08 PM

  • How to use jsp:plugin type="applet" in jsp

    Hi ,
    I have a JSP File.
    How to use jsp:plugin tag in that.
    When I specify the file name in code="applet.class" Then it is giving an error saying that It could not find the class.
    What is the solution for this.

    its not working.. it shows exception class not found exception.
    i have placed the jsp and applet class in the same folder. but its not working.
    jsp file path : OracleSpatial\mypackage\webmap.jsp
    applet class : OracleSpatial\mypackage\demoApplet.class
    demoApplet class inside package "mypackage".
    code inside JSP is :
    <jsp:plugin type="applet"
    code="mypackage.demoApplet.class" width = "100%" height = "100%" >
    </jsp:plugin>

  • When/How to use - "search" parameter type in parameter like other types.

    We recently upgraded BI Publisher to 10.1.3.4. I saw new parameter type "search" in parameter section, when creating report. whats the use of it? How to use it ? like other parameter type Text, Menu,Hidden, Date.
    I couldn't find any help or release notes on this !
    Thanks
    Ayaps

    I started looking into this parameter type when our drop-down for customer numbers went from 13,000 (manageable) to 45,000 (completely unmanageable).
    I imagine this is supposed to mimic the effects of a "Long List" type LOV in Oracle Applications (as I had inquired about in [this thread|http://forums.oracle.com/forums/thread.jspa?threadID=895521&stqc=true|Large List of Values (LoV) hangs. Is there an equivalent for a long list?]), but performance-wise, "Search" does not seem to be any more efficient that using the "Menu" type LOV. Even with the help of having a partial string with a wildcard to match, the "Search" still takes too long to pull up to be of any use to us.

  • How to use array as parameter in procedure

    Hello,
    I am using Oracle SQL Developer 1.5.5
    I wanted to write a procedure which does insert into table.
    It should take 2 parameters.How to take array as parameter?
    One is a array of strings ('abc','def','erg') and another is a varchar ('abc').
    How to do this?
    Can somebody pls give a small example?
    Thanks
    Edited by: user13305573 on Aug 5, 2010 11:27 PM

    Hello,
    I am sorry if u didnt get my point.
    My req is i am using Orcale SQL Developer.
    Db is Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    I want to write a procedure which will be called from a java file.
    The parameter to that procedure will be a arr(array of strings) and username(varchar).
    I want to insert that data into a tableA.
    like if parameters are
    (abc01,edfg02,efg03) as arr and honey as username
    then it should insert 3 rows to the tableA
    abc01 honey
    edfg02 honey
    efg03 honey
    Thanks
    Edited by: user13305573 on Aug 5, 2010 11:54 PM

  • How to use JDBC driver (type 4) with struts?????

    Hi! have a nice day!!!!!
    i want to connect database use struts with JDBC driver type 4. i must add <data-source/> to <data-sources></data-sources> tag but i don't know how to use <data-source/> with it's properties. please tell me! thank very much

    thank for reply!!! :D
    my project require to use struts 1.2.8 with ODBC (i think so it's type 1) for connect to database (SQL server). i think so it has two step :
    1. edit file struts-config.xml with <data-sources> tag.
    2. programming in file java (which extends from Action class) connect to database.
    but how to programming in file java??? (i think so must use objects DataSource & Connection)

  • How to use Z transaction type while in the Transaction launcher Wizard?

    In SPRO->CRM->Transactions->Basic Settings->Define transaction Types I can see a whole host of Z transaction types.
    These define all sorts of business transaction defaults. Within the Transaction launcher Wizard there is a Transaction Type that can be entered, but I can only see three options, being 'BOR Transaction', 'URL Transaction' and ' M', for some reason. None of the transaction types shown in the above SPRO path are displayed.
    Does anyone know how I can use my Z transation type. These are used by the config behind the Action Boxes for the Winclient IC, but I can not get the Transaction launcher wizard to see or use these. The SAP How-to Guide to tha Transaction Launcher says that only BOR and URL Transactions can be used (unless you have IS-U). If this is true then how does one provide all the information provided by the Transaction type. The whole idea of the transaction type is default this information in one area.
    Anyone.
    Jason

    I think it is possible.
    In CRMC_UI_NBLINKS if you look at the logical links you can see that SRV-ORD-DC has a Parameter of 'SRVO' with a certain Parameter Class.
    If you were to check SPRO->CRM->Transactions_Basic Settings->Transaction Types  you will see that SRVO exists as an entry. This logical ink is therefore using this Transaction type to extract characteristics etc.
    Having said that, I need to call the sales order create with a certain transaction type, so I copied SLS-SLO-CR to a Z copy, added the Parameter of 'Z111' and also used the Parameter class of CL_CRM_UIU_BT_PARAM_CREATE.
    This should now, in theory all work, and show the exact same transaction in the Webclient IC as it does in the Winclient IC as they are both using the same Transaction type. However, the Webclient transaction looks different in terms of fields etc., so I don't think it's working. after all.
    Jason

  • How to use same collection type in different database

    i have created a synonym for a package whcih uses a collection type as input and when i am calling through that synonym it is throwing an error b'coz of the collection type saying wrong no. of arguements...
    declare
    collection_type collection_type:=collection_type('value');
    begin
    package_synonym1.procedure1(collection_type);
    END;
    how to rectify it can someone suggest....
    a quick response would be highly appreciated

    i have a package in schema A in which my input in a procedure is of type
    like
    create or replace package abc as
    procedure efg (
    ptbl_service_id in tbl_input_list,
    pn_error_code_out OUT NUMBER,
    pv_error_msg_out OUT VARCHAR2
    and in schema A the type is created.the package is working fine
    but when i am trying to test this package from database b with script as
    declare
    xyz tbl_input_list :=tbl_input_list('abcdefgh');
    begin
    abc.efg(
    xyz,
    pn_error_code_out,
    pv_error_msg_out
    end;
    then it gives an error saying wrong no. of arguements ORA-06550
    I have created the type in this database with the same OID as well and i have also tried the option of creating a synonym or calling it through a database link...
    Is there any other way through which we can use it.....
    A Quick Response will be highly appreciated...

  • StringIndexOutOfBoundsException using ARRAY data type

    Hi all.
    JDK 1.5.0_03, Oracle 9.2.0.4, 9i thin drivers.
    I'm trying to use the ARRAY data type to submit a large amount of data to a stored procedure. Unfortunatley I'm getting an error when using the oracleCAllableStatement.setArray method. I've successfully set up my types in the database, and I can create my StructDescriptor and ArrayDescriptor objects but that's as far as I get.
    Here's my code:
    connection = ConnectionManager.getRawConnection(DatabaseProperties.CSA_DB);
    connection.setAutoCommit(false);
    ARRAY array = getDatabaseArray(timeSeriesList, date, connection);
    String result = new String();
    statement = (OracleCallableStatement)connection.prepareCall("{call DATA_LOAD.ARCHIVE_TIMESERIES(?, ?)");
    statement.setARRAY(1, array);
    statement.registerOutParameter(2, OracleTypes.VARCHAR, result);
    statement.execute();
    LOG.info(result);
    connection.commit();
    The line highlighted is where it fails. The exception is below. Unfortunatley its a Java exception rather than a Oracle one so not much help there.
    Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 40
         at java.lang.String.charAt(Unknown Source)
         at oracle.jdbc.driver.OracleSql.handleODBC(OracleSql.java:123)
         at oracle.jdbc.driver.OracleSql.parse(OracleSql.java:69)
         at oracle.jdbc.driver.OracleConnection.nativeSQL(OracleConnection.java:1181)
         at oracle.jdbc.driver.OracleStatement.expandSqlEscapes(OracleStatement.java:6412)
         at oracle.jdbc.driver.OracleStatement.parseSqlKind(OracleStatement.java:6401)
         at oracle.jdbc.driver.OraclePreparedStatement.<init>(OraclePreparedStatement.java:152)
         at oracle.jdbc.driver.OracleCallableStatement.<init>(OracleCallableStatement.java:77)
         at oracle.jdbc.driver.OracleCallableStatement.<init>(OracleCallableStatement.java:48)
         at oracle.jdbc.driver.OracleConnection.privatePrepareCall(OracleConnection.java:1134)
         at oracle.jdbc.driver.OracleConnection.prepareCall(OracleConnection.java:988)
         at com.db.csa.systems.csa.timeseries.DataArchivedTimeSeriesProvider.archiveTimeseriesForDate(DataArchivedTimeSeriesProvider.java:46)
         at com.db.csa.experiments.TimeseriesArchiver.main(TimeseriesArchiver.java:26)
    I'm now completely stuck as short of decompiling the class that's throwing the exception I have no idea what's going on.
    Anyone got any ideas?
    Thanks, Rob
    Message was edited by:
    user470390

    Hi,
    Shouldn't:
    statement = (OracleCallableStatement)connection.prepareCall("{call DATA_LOAD.ARCHIVE_TIMESERIES(?, ?)");be this:
    statement = (OracleCallableStatement)connection.prepareCall("{call DATA_LOAD.ARCHIVE_TIMESERIES(?, ?)}");i.e. have a closing brace?
    - Mark

  • How to use arrays in stored procedure??Please do help me.......

    hi, i need to make a procedure where i may execute a query.The query returns multiple rows.Now i want to use 1 row.i needs to fetch all colums as out parameter...can anyone please help me.....i will be very thankful to the person.

    you cannot just force only one column from a select statement to be a out parameter, you need to collect all the columns into a collection type and use the collection type as out parameter or use refcursor as out parameter and fetch the rows
    using collection type
    create type obj_typ is object(
    a_val number,
    b_val varchar2(100)
    create type nest_typ is table of obj_typ
    create or replace procedure retrieve_emp(mgr_no number,e_details out nest_typ) is
    begin
    select obj_typ(empno,ename) bulk collect into e_details from emp
    where mgr = mgr_no;
    end;
    declare
    nest_var nest_typ;
    begin
    retrieve_emp(7698,nest_var);
    for i in 1..nest_var.count loop
    dbms_output.put_line(nest_var(i).a_val || ' - '||nest_var(i).b_val);
    end loop;
    end;
    7499 - ALLEN
    7521 - WARD
    7654 - MARTIN
    7844 - TURNER
    7900 - JAMESUsing ref cursor
    create or replace procedure retrieve_emp2(mgr_no number,e_details out sys_refcursor) is
    begin
    OPEN e_details FOR select empno,ename from emp
    where mgr = mgr_no;
    end;
    declare
    empno_val emp.empno%type;
    ename_val emp.ename%type;
    edetails_ref_Cur sys_refcursor;
    begin
    retrieve_emp2(7698,edetails_ref_Cur);
    loop
    fetch edetails_ref_cur into empno_val,ename_val;
    exit when edetails_ref_cur%notfound;
    dbms_output.put_line(empno_val ||' - '||ename_val);
    end loop;
    close edetails_ref_cur;
    end;
    7499 - ALLEN
    7521 - WARD
    7654 - MARTIN
    7844 - TURNER
    7900 - JAMESHTH,
    Prazy

Maybe you are looking for

  • AT EXIT-COMMAND doesn't work

    Hi experts, In screen painter I use AT EXIT-COMMAND to exit current screen as the following code. But it doesn't exit the screen if ok_code = 'create' while other ok_code work well. Can anyone tell me that's why? Thanks! module exit.   if SY-UCOMM =

  • How do you change the order of the sections

    How do you change the order of the sections?

  • Photo Booth is "Deleted"

    Hi, my photobooth is deleted, it just vanished. It's not in my spotlight, and not in my applications folder. What happened, and what do I do?

  • Cannot get app updates in my iPad.

    I can access everything in the app store except my updates, I have reset my iPad and shut down the app and started it back up and nothing is working, please help.

  • Slides won't auto advance?

    I have just a few slides ina presentation that won't auot-advance.  I don't know how to get them too.  When I imported it in from PPT if removed the on a click setting and the majority of the presentation wroks jsut fine.  It is jsut a few slides at