How to use a constant defined as a concat of char values in an IN clause

Greetings,
I defined a CONSTANT as a concatenation of values and attempted to use it in an IN clause without success ...
CREATE OR REPLACE PACKAGE PKG_TEST AS
Q_IDS CONSTANT VARCHAR2(25) : = '''3'''||','||'''14'''||','||'''16'''||','||'''18'''||','||'''24''';
procedure insert_test;
END PKG_TEST;
CREATE OR REPLACE PACKAGE BODY PKG_TEST AS
PROCEDURE insert_test as
BEGIN
insert into test1
select *
from test_table
where q_id in ( Q_IDS );
END insert_test;
END PKG_TEST;
I'm guessing this doesn't work because the CONSTANT is being treated as one long string as opposed to a succession of comma separated values.
Is there a way to do this?
Any feedback would be appreciated.
Thank you.

One example:
SQL> ed
Wrote file afiedt.buf
  1  select *
  2  from emp
  3  where ename in (
  4    with t as (select '&input_string' as txt from dual)
  5    select REGEXP_SUBSTR (txt, '[^,]+', 1, level)
  6    from t
  7    connect by level <= length(regexp_replace(txt,'[^,]*'))+1
  8*   )
SQL> /
Enter value for input_string: SCOTT,JAMES
old   4:   with t as (select '&input_string' as txt from dual)
new   4:   with t as (select 'SCOTT,JAMES' as txt from dual)
     EMPNO ENAME      JOB              MGR HIREDATE                   SAL       COMM     DEPTNO
      7788 SCOTT      ANALYST         7566 19-04-1987 00:00:00       3000                    20
      7900 JAMES      CLERK           7698 03-12-1981 00:00:00        950                    30
SQL>

Similar Messages

  • How to use a user defined function in XI

    Hi Experts,
    I would like learn how to use a user defined function  in Xi during mapping . Is there any step by step on that.
    Besides during when me make communcaton channels I see the following tabs...Paramters ..Identifiers ...Module...
    The module that is given here ...where and how it is used.

    Hi,
    You can write UDFs in java in Graphical mapping to enhance your XI Graphical mapping functionality
    The steps for doing it would be:
    1. Click on Create New function Button found on Bottom left corner on your XI Mapping window.
    2. Write your java code.
    3. Run the Mapping Test as usual.
    >>The module that is given here ...where and how it is used.
    The adapters in the Adapter Framework convert XI messages to the protocols of connected external systems and the other way around. When doing so, some
    functionality might need to be added specific to a situation which is possible with the use of custom modules.
    Typical example would be validation of file content when using a File Adapter or modification of the message payload to a common content structure which is not supported by any of the standard SAP modules.
    An Adapter module is developed as an Enterprise Java Bean and is called locally by the Adapter.
    An example on modules :
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/da5675d1-0301-0010-9584-f6cb18c04805">How to develop a module for reading file name in a sender file adapter XI 3.0</a>
    Cheers,
    Chandra

  • How to use a user defined function module in IP

    Hi All,
    Can you please guide me on how to use a user created function module in IP? My requirement is to have 2 exit function modules to be used in IP to load the falt file data into a cube..
    Regards,

    Hi,
    /people/marc.bernard/blog/2007/11/25/how-to-load-a-file-into-sap-netweaver-bi-integrated-planning-part-1
    thanks to Marc Bernard
    Regards

  • How to use a user defined function in where cluase condition

    Hi,
    I have designed a query by selecting some columns in the tables and some columns are retrieved directly from table and some columns are passing to a user defined function. Now my requirement is i need to use that user defined function result in oracle where condition clause.
    Ex : select marketing_user_id,get_name(marketing_user_id),item_id,get_item_name(item_id),get_country_name(country_id),
    from
    where get_item_name(item_id) in ('x','y','z')
    and get_country_name(country_id) in ('India','America','China');
    When am i trying the query by above format i am getting the wrong resultset.
    BR,
    uma

    I am not sure why your getting the wrong results but you should seriously reconsider the approach your are taking. Using functions like this is very ineffecient and should be avoided at all cost.

  • How to use two view Accessor's in a List of Values

    Hi
    I have one Transient VO , dragged on to .jsff page. One of the attribute of the transient VO has list of values.
    I have two View Accesors, First View Accesor consists of only ID's and Second View Accesor consists of Description value associated to each ID in the first View Accesor, Now I have to use these both View Accesor in such a way , Values are from First View Accesor and Description is from the second View Accesor as a drop down on my jsff page.
    The source for these both View Accesors are different. There is no relation ship between the two View Accesors. Is it possible to have these two View Accesors to a single drop down list ?

    Hi..
    yes ..on the same line i was getting ERROR.I got it resolved by rebinding it to the perticular column again.below is my code..
    <af:inputListOfValues id="valueId"
    popupTitle="Search and Select: #{bindings.Value.hints.label}"
    value="#{bindings.Value.inputValue}"
    model="#{bindings.Value.listOfValuesModel}"
    required="#{bindings.Value.hints.mandatory}"
    columns="#{bindings.Value.hints.displayWidth}"
    shortDesc="#{bindings.Value.hints.tooltip}"
    label="#{bindings.Value.hints.label}"
    inlineStyle="size:small;">
    <f:validator binding="#{bindings.Value.validator}"/>
    But i had to edit the value and validator parameter to make it row binding as shown below.I dont understand even after i bind the perticular datacontrol to the ADF table..it was still showing as
    value="#{bindings.Value.inputValue} not as value="#{row.bindings.Value.inputValue},because of this it was not able to function properly..
    <af:inputListOfValues id="valueId"
    popupTitle="Search and Select: #{bindings.Value.hints.label}"
    value="#{row.bindings.Value.inputValue}" model="#{bindings.Value.listOfValuesModel}"
    required="#{bindings.Value.hints.mandatory}"
    columns="#{bindings.Value.hints.displayWidth}"
    shortDesc="#{bindings.Value.hints.tooltip}"
    label="#{bindings.Value.hints.label}"
    inlineStyle="size:small;">
    <f:validator binding="#{row.bindings.Value.validator}"/>
    ~Harish
    Edited by: 886523 on Sep 28, 2011 2:52 AM

  • How to use global variable defined in planning area in FOX

    Hi guys
    I meet a situation that needs to use variables defined in planning area in FOX.How to code?
    My situation as follows:
    Two variables are defined in planning area,one is zcomp_code,the other is zfiscyear.
    There are two key figures in the planning area,one is sales volume,the other is delta(%).
    I want to use sales volume multiplied by delta(%) in selected zcomp_code and zfiscyear by users.
    Anyone can help?
    Thanks in advance.

    Hi Eric
    check this example
    in fox you shoud declare your data and after call your variable
    after this you could easily operate on data using the f4 for definig the right fox operators
    DATA FYEAR TYPE 0FISCYEAR.
    FYEAR = VARV(PLANYEAR).
    {0COPANETRV, FYEAR,CRA,020} =
    {0COPANETRV,FYEAR,CRA,020} *
    ({ 0CP_DELTAB,FYEAR,CRA,020} + 100 ) /100.
    {0CP_DELTAB,FYEAR,CRA,020} = 0.

  • How to use a constant rather than a "getter"?

    I'd like to refer to a constant rather than a property using a "getter" (accessor), but I'm not sure how.
    For example:
    <f:selectItem itemLabel="Option1" itemValue="#{Constants.MINIMUM}"/>
    But of course this results in trying to call getMINIMUM(), which isn't what I'm trying to so.
    Any ideas?

    hi ,
    as far i know u cannot access a variable unless using a getter method !!
    Viel spasss...

  • How to use a portal defined alias for a system

    Hello,
    we have in the portal Netweaver 2004s, sp11, defined systems, which contain SAP-Routerstrings. For Everey System we have given a Systemalias.
    No we want to use the Systemalias managed by the portal use in our Java-Applivcation deployed on the portal-server.
    How to to this?
    Best regards
    Oliver Prodinger

    Oliver,
    From whatever I could understand from your question I would answer that in this way. You need to create a iView out of the application. It will ask for a System parameter. One needs to provide the system alias name into the System paramter.
    If this does not answer your query, plz elaborate your question.
    Warm regards,
    Sukanta

  • How to use AME to define Compensation Workbench Manager Hierarchy?

    Hi,
    I have set up the CWB to allow HR managers to allocate all the compensation using AME Hierarchy in R12. However, after running the CWB Participant Process using the manager login, there is no employee attached to this manager.
    For e.g. a company has 2 compensation managers that determine all the compensation within the company including himself and upper level manager.
    My question:
    How to setup the CWB to use AME hierarchy to allow the 2 compensation managers to view all the employee in the worksheet?
    Regards,
    ShiauChin

    Even i am facing the same issue.
    if i use supervisor hierarchy for the plan. the worksheet is listing the plan and people.
    If i use AME transaction, plan is not attaching to the worksheet. I am working with Oracle SR to find the issue.
    If you find any solution for this problem please share at [email protected]
    thanks in advance
    Srinivas B

  • How to use integer constants in switch

    Hello!
    I try:
    Connection.m
    #define CHANNEL_A = 0x01;
    #define CHANNEL_B = 0x02;
    #define CHANNEL_C = 0x03;
    switch (channel){
    case CHANNEL_A:
    return 0;
    case CHANNEL_B:
    return 1;
    case CHANNEL_C:
    return 2;
    default:
    return -1;
    and get: "error: syntax error before '=' token" after "case CHANNEL_A:" string
    Then, I try:
    Connection.h
    extern const int CHANNEL_A;
    extern const int CHANNEL_B;
    extern const int CHANNEL_C;
    Connection.m
    const int CHANNEL_A = 0x01;
    const int CHANNEL_B = 0x02;
    const int CHANNEL_C = 0x03;
    switch (channel){
    case CHANNEL_A:
    return 0;
    case CHANNEL_B:
    return 1;
    case CHANNEL_C:
    return 2;
    default:
    return -1;
    and get: "case label does not reduce to an integer constant" after "case CHANNEL_A:" string

    Or try an enum
    enum CHANNELS {
    CHANNEL_A = 0x01
    CHANNEL_B = 0x02
    CHANNEL_C = 0x03
    enum CHANNELS channel;
    switch(channel) {
    case CHANNEL_A:
    ... do something ...
    break;
    case CHANNEL_B:
    ... do something ...
    break;
    case CHANNEL_C:
    ... do something ...
    break;
    #defines DO NOT HAVE EQUAL SIGNS! What C book are you reading?
    #define CHANNEL_A = 0x01;
    Associates "= 0x01" with the pre-processor macro CHANNEL_A. The pre-processor will substitute "= 0x01" everywhere it sees CHANNEL_A. So when you say
    case CHANNEL_A:
    the pre-processor replaces that with
    case = 0x01:
    and that is NOT correct case syntax, hence your compiler error.
    And *const int* is not a compile time constant, or at least not one that switch/case wants to see. *const int* is a variable that you promise will not change.

  • How to use the classpath defined in a manifest file when debugging

    Using Jdeveloper 10.1.3.3.0 (or any version)
    I'd like to be able to debug using an executable jar which specifies my classpath and main class, without having to manually add all the jars to my debug configuration. Is there a way the debugger can extract that information from the manifest?
    The set of jar files included in my classpath varies depending on which client configuration the client wants to run and we could potentially have a hundred different configurations so there isn't an easy way to manage static libraries. Currently I have to open the jar, extract the manifest and manually add the jars so I can debug. Which is really painful when the configuration can change each time I run. The manifest and jar file are created at runtime based on what client configuration the user is trying to run and there can be multiple versions of a jar file in the directory with mangled names - so I can't just include all the jars.
    Any ideas?

    Run the program from command line, this way you will see the errors, if any.
    example.: java -jar theJarfile.jar
    I was successful in creating a comm application. I placed the win32com.dll in the same directory of my application jar file and all worked.
    I also extracted the comm.jar , and jar'd my app with the extracted comm files to make one jar.
    I also had a fileWriter() to get the clients jre path and my app would write the javax.properties file to the correct place.
    It took me severel weeks and late nights to accomplish this, but it was all necessary to be able to install only my app, and not a bunch of api's that were needed.

  • How to use an equal sign as a part of the value in a property file

    say I have this line in a properties file:
    args = -Xms512m -Xmx512m -XX:MaxPermSize=256m
    obviously I can't use the (=) as is. What should I do to make it work?
    I tried to use \= and \:, but it doesn't work as well.
    thanks.

    A property file contains "key" lines or "key=value" lines the '=' character loses its special meaning after a key is read so you can use '=' characters in the 'value' part of a property.
    kind regards,
    Jos

  • How to use audit command to track the old and new values by any DML?

    Hi,
    I want to track all the changes done by any DML. I also want to capture who did it, when it was done and where it was done.
    Or is it possible to capture the user realted details in CDC feature of Oracle 10g?
    Which will be the best possible solution?

    You can Capture DML statements fired on a database by the following way, too.
    satyaki>
    satyaki>select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    Elapsed: 00:00:00.22
    satyaki>
    satyaki>AUDIT ALL BY SCOTT BY ACCESS;
    Audit succeeded.
    Elapsed: 00:00:01.80
    satyaki>
    satyaki>Regards.
    Satyaki De.

  • How to use the structure in the EXIT_SAPMM06E_013 function module

    Hello Experts,
    Please guide me how to use the structure defined in function modules under  table tab in the driver program for smart form to fetch the data. Please post some sample code if available.
    Best Regards,
    Sandesh.Sreyamsh

    Can you please elaborate little bit more what is the actual requirement?

  • How to use FM bapi_cfg_create???

    Hello folks,
    can anybody tell me how to use bapi bapi_cfg_create.
    i want to configure material characteristic values... i have difficulties to understand this function module.. so plz help.
    -Shweta

    Create a purchase order with configuration using the BAPI
    This took some time to figure out how to setup. It may be useful.
    call function 'BAPI_CFG_CREATE'  exporting    object_id     = 'MYMATCODE'    root_type     = 'MARA'    root_name     = 'MYMATCODE'    plant         = 'MYPLANT'  importing    cfg_handle    = l_handle    root_instance = l_instance  exceptions    error         = 1    others        = 2.l_characts_vals-atnam = 'WIDTH'.l_characts_vals-atwtb = '500'.append l_characts_vals to it_characts_vals.
    call function 'BAPI_CFGINST_CHARCS_VALS_SET'  exporting    object_id         = 'MYMATCODE'    instance          = l_instance  tables    characts_vals     = it_characts_vals    characts_vals_err = it_characts_vals_err.
    call function 'CE_C_SET_CBASE'....l_poitem-int_obj_no = l_handle....c
    all function 'BAPI_PO_CREATE1'   exporting    poheader  = l_poheader    poheaderx = l_poheaderx   importing    expheader = l_expheader    exppurchaseorder = l_exppurchaseorder   tables    poitem      = lt_poitem    poitemx     = lt_poitemx            poschedule  = lt_poschedule            poschedulex = lt_poschedulex    return      = lt_return.
    call function 'BAPI_TRANSACTION_COMMIT'.Labels: code

Maybe you are looking for

  • Anyone use Adobe Media Player?

    Hi, i posted this question in that forum: http://forums.adobe.com/thread/593289?tstart=0 But to simplify, here're the questions: System: WinXP, CS4 1/ How do i clear the list of played or attempted to play clips from the left hand panel? 2/ There see

  • Downloading songs from iPOD to new computer

    OK, seems like a common problem, yet all the FAQs and questions don't seem to get me where I need to go. My first authorized computer is fritzed, can't access itunes, so I loaded new version of itunes onto my new computer and want to download all of

  • GDS Documents

    Hi Can any please send me the documents or any blogs on Global data Synchronisation & MDM horminization. Thanks Sri

  • STMS config

    Hi, Currently we have three system landscape DEV>QA>Prod Now we are introducing one more environment (Training) .That means when you release the request from QA then it has to be populate to Production and Training environment. Now my question is how

  • How do I change default no of copies on printer

    Every-time I print the default number of copies is set to three. I have to change it if I only want to print a single copy of a doc. I would be grateful on information on how to change this. Regards