Use multivalue parameter in "in" clause.

Hi expert,
I pass a status string 'OPEN;CLOSED;REOPEN' into procedure, and in the procedure I converted it into variable v_status in format 'OPEN','CLOSED','REOPEN', then used it in the procedure as follows:
select * from table where status in v_status
but no record retrieved from statement, please tell me how to make it work?
Many Thanks,

918440 wrote:
Hi expert,
I pass a status string 'OPEN;CLOSED;REOPEN' into procedure, and in the procedure I converted it into variable v_status in format 'OPEN','CLOSED','REOPEN', then used it in the procedure as follows:
select * from table where status in v_status
but no record retrieved from statement, please tell me how to make it work?
Many Thanks,(ab)use EXECUTE IMMEDIATE

Similar Messages

  • Split Field and MultiValue parameter

    I have a multi-value parameter.  Options for example are: Zebra, Elephant, and Seal.  Then I have a table (actually a sharepoint list) which one field contains other animals in delimited fashion. For example: Elephant;Lion.
    What I have set up is a filter (on either the datasource or the tablix) of [Field] IN @parameter which works fine... as the field isn't also multi-valued.  I've tried using the Split function, but then it errors trying to evaluate the filter expression.
    What I want to do is to return the row if any selected parameter matches any value in the field.
    Does that make sense?  I'm trying not to get too wordy.  Thanks in advance for any responses.

    Hi There
    You might be able to do this by the help of some custom code so please do the following
    Create a custom function in your report which will convert your string to array as you know your fields contain string value you need to convert that in to array first so please go to your report properties
    and code and paste this function
    Public Shared Function ConvertStringtoArray(sourceString as String) As string()
    Dim arrayOfStrings() As String = sourceString.Split(",")
    return arrayOfStrings
    End Function
    Public Shared Function ConvertStringtoArray(sourceString as String) As string()
    Dim arrayOfStrings() As String = sourceString.Split(",")
    return arrayOfStrings
    End Function
    Now in you tablix filter please do the expression like this
    =instr(join(code.ConvertStringtoArray(Fields!Country.Value),","),join(Parameters!CountryPram.Value,","))
    =instr(join(code.ConvertStringtoArray(Fields!Country.Value),","),join(Parameters!CountryPram.Value,","))
    Where please change Parameters!CountryPram.Value to your parameter value and please change Fields!Country.Value to your sharepoint list fields values.
    I am assuming that you have used multivalued parameter
    I am putting some screenshot for your help
    If you have any question please let me know
    Many thanks
    Syed Qazafi Anjum

  • PL/SQL: how to use in parameter in select sql where clause

    Hi
    in a procedure, I need to apply 'in parameter' in 'where clause' along with other table fields. Purpose is to create dynamic select querry with multiple conditions.
    select count(*) from table xx
    where y_code=2008 and v_type in ('SI', 'TI', 'DI') ;
    my requirement is replace 'and v_type in ('SI', 'TI', 'DI')' with in parameter. pls note in paramter may contain null value.
    Regards

    ... e.g. why on earth do you want to pass in a string to be appended to the WHERE clause of an SQL.I second that and I strongly advice NOT to do it. If you really want to do it, then come back and show us, how you would prevent SQL injection. This approach is too dangerous (and too complex) IMHO.
    Do it straight forward as in the article of Tom Kyte (link in the post of BluShadow above)

  • How to use a parameter field value as a substring in a "like" statement?

    Hi all,
    I'm trying to use a parameter field in a Record selection formula where the parameter field value would be a substring of the data stored in the field.
    My parameter field (SlctResearcher) is constructed as follows:
    Type: string
    List of Values: static
    Value Field: (Reports) RptAuthors
    (in Value Options) Allow custom values?: True
    {Reports.PubDate} in DateTime (2009, 04, 01, 00, 00, 00) to DateTime (2010, 03, 31, 23, 59, 59) and
    {Reports.RptAuthors} like "*{?SlctResearcher}*"
    When I hit F5 to generate the data, I get no results (and the parameter prompt field does not even come up...)
    If I modify the formula to put a hard-coded string, like
    "*Jones*"
    after the 'like', I get results (all the reports where "Jones" is a substring in the RptAuthors string.) If I modify the formula to just use the parameter field without the quotes/stars like:
    {Reports.PubDate} in DateTime (2009, 04, 01, 00, 00, 00) to DateTime (2010, 03, 31, 23, 59, 59) and
    {Reports.RptAuthors} like {?SlctResearcher}
    I do get the parameter prompt field, but still no results even if I put in a valid substring value (since it is not searching for a substring anymore...)
    How can I do this?
    Thanks,
    Will

    1st thing... Make a copy of your report before doing anything!!!
    To use a SQL Command, you'll want to open the Database Expert and look at the Current Connections. Expand the data source and the 1st option you see is the Add Command option.
    To find the SQL That CR is currently using, choose Database from the menu bar and select Show SQL Query...
    You can copy this and paste it directly into the command window. (If you you can write your own SQL you don't need copy CR's, it's just an option.)
    You'll also want to take not of any parameters that you have, you'll need to add them the the Parameter List of the command as well... be sure to spell them EXACTLY as they are in the design pane.
    Anyway, once the SQL statement is in the Command window you'll be able to alter the WHERE clause to use the wild cards.
    For future reference... What type of database are you reporting against???
    Jason

  • Creating multivalue parameter in SSRS on top of DB2 views

    How to create multivalue parameterized report in SSRS for belo scenerio:
    Data source is DB2 and we don't need to write whole query as expression while creating dataset.
    But if we don't need to write whole query as expression in SSRS, is that possible to create the view in DB2 with same expression query and while calling the view in SSRS, how multivalue report can be generated.

    Hi Andy,
    Based on my understanding, you want to create a multivalued parameter in your report. When creating the parameter, you don’t want to write a whole query to specify the parameter’s value which is used in the main dataset, right?
    In Reporting Services, if we want to create a multivalued parameter, we can create a new dataset to populate the valid values for the parameter. Within the new dataset, we needn’t write a whole query which is used in the main dataset, we can only retrieve
    those data which will be used by the parameter. So in your scenario, you can write a simple query to populate the valid values for the multivalued parameter. If you create a view on database side, you can also call the view in SSRS to retrieve the corresponding
    data, then specify the values for the parameter with those data.
    Reference:
    Lesson 3: Adding Parameters to Select Multiple Values in a List (SSRS)
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

  • Bug while using string parameter values in postgresql query

    Hi,
    I have the following query for the postgresql database:
    Code:
    <queryString><![CDATA[SELECT
    evt_src_mgr_rpt_v."evt_src_mgr_name" AS esm_name,
    evt_src_collector_rpt_v."evt_src_collector_name" AS collector_name,
    evt_src_grp_rpt_v."evt_src_grp_name" AS grp_name,
    evt_src_grp_rpt_v."state_ind" AS state_ind,
    evt_src_rpt_v."evt_src_name" AS src_name,
    evt_src_rpt_v."date_modified" AS date_modified,
    evt_src_rpt_v."date_created" AS date_created,
    CASE WHEN $P{mysortfield} = 'evt_src_mgr_name' THEN evt_src_mgr_name
    WHEN $P{mysortfield} = 'evt_src_collector_name' THEN evt_src_collector_name
    WHEN $P{mysortfield} = 'evt_src_grp_name' THEN evt_src_grp_name
    ELSE evt_src_name END as sort
    FROM
    "evt_src_mgr_rpt_v" evt_src_mgr_rpt_v
    LEFT JOIN
    "evt_src_collector_rpt_v" evt_src_collector_rpt_v
    ON EVT_SRC_MGR_RPT_V."evt_src_mgr_id" = evt_src_collector_rpt_v."evt_src_mgr_id"
    LEFT JOIN
    "evt_src_grp_rpt_v" evt_src_grp_rpt_v
    ON evt_src_collector_rpt_v."evt_src_collector_id" = evt_src_grp_rpt_v."evt_src_collector_id"
    LEFT JOIN
    "evt_src_rpt_v" evt_src_rpt_v
    ON evt_src_grp_rpt_v."evt_src_grp_id" = evt_src_rpt_v."evt_src_grp_id"
    LEFT JOIN
    "evt_src_offset_rpt_v" evt_src_offset_rpt_v
    ON evt_src_rpt_v."evt_src_id" = evt_src_offset_rpt_v."evt_src_id"
    WHERE
    $P!{mysortfield} LIKE '$P!{searchvalue}' || '%']]></queryString>
    That is I try to select only the records where the field which is
    selected by user as report parameter ($P{mysortfield}) contains data
    starting with the text entered by user as a report parameter
    ($P{searchvalue}).
    When I try to run the report in iReport with active connection to the
    database the report is generated as expected.
    But when I try to run the report from Sentinel Log Manager I get the
    following error: "java.lang.String cannot be cast to
    net.sf.jasperreports.engine.JRValueParameter".
    After several detailed debug sessions I finally came into a conclusion
    that this error is related to the use of parameter values (
    $P!{mysortfield} and $P!{searchvalue} ).
    I even tried using the following WHERE clause (which emulates the
    queries as used in standart reports (especially at VendorProduct related
    SQL queries ) with no success:
    Code:
    WHERE
    ($P{mysortfield} = 'evt_src_mgr_name' AND evt_src_mgr_name LIKE ($P{searchvalue} || '%')) OR
    ($P{mysortfield} = 'evt_src_collector_name' AND evt_src_collector_name LIKE ($P{searchvalue} || '%')) OR
    ($P{mysortfield} = 'evt_src_grp_name' AND evt_src_grp_name LIKE ($P{searchvalue} || '%')) OR
    ($P{mysortfield} = 'evt_src_name' AND evt_src_name LIKE ($P{searchvalue} || '%'))
    Any suggestions?
    hkalyoncu
    hkalyoncu's Profile: http://forums.novell.com/member.php?userid=63527
    View this thread: http://forums.novell.com/showthread.php?t=450687

    bweiner12345;2167651 Wrote:
    > I'm not 100% sure the $P! (instead of just $P) is needed in that WHERE
    > portion of your SQL statement.
    >
    > What I would suggest doing is building the WHERE portion of your query
    > up again step by step. That is, instead of using any parameters in your
    > WHERE:
    >
    > $P!{mysortfield} LIKE '$P!{searchvalue}' || '%'
    >
    > ... take a step back and literally hard-code some values in there, such
    > as:
    >
    > evt_src_mgr_name LIKE '%' || '%'
    >
    > ... and run it on your box to make sure it works fine.
    >
    > If it works fine, start substituting the parameters one by one:
    >
    > $P{mysortfield} LIKE '%' || '%'
    >
    > .... test on the box.
    >
    > $P{mysortfield} LIKE '$P{searchvalue}' || '%'
    >
    > .... test on the box.
    >
    > It may be a little tedious, but at least you'll find out where the
    > problem is occurring... and may be quicker in the long run.
    >
    > (Note: In my above example steps I didn't use the ! in with the
    > parameters, as I don't think they are needed in the WHERE clause... but
    > I could be wrong... and by following the above step-by-step technique
    > should answer that for sure.)
    Thank you for the suggestions:
    While trying to implement your suggestions I realized that there was a
    error at the parameter name I used inside the where clause (it should be
    $P{searchfield}).
    Here are my results:
    Code:
    vt_src_mgr_name LIKE '%' || '%'
    worked as expected.
    Code:
    $P{searchfield} LIKE '%' || '%'
    produced PDF but wrong output.
    Code:
    $P!{searchfield} LIKE '%' || '%'
    resulted with the error "java.lang.String cannot be cast to
    net.sf.jasperreports.engine.JRValueParameter" and no PDF.
    Then I tried the following where clause which resulted in exactly as
    expected PDF:
    Code:
    WHERE
    ($P{searchfield} = 'evt_src_mgr_name' AND evt_src_mgr_name LIKE ($P{searchvalue} || '%')) OR
    ($P{searchfield} = 'evt_src_collector_name' AND evt_src_collector_name LIKE ($P{searchvalue} || '%')) OR
    ($P{searchfield} = 'evt_src_grp_name' AND evt_src_grp_name LIKE ($P{searchvalue} || '%')) OR
    ($P{searchfield} = 'evt_src_name' AND evt_src_name LIKE ($P{searchvalue} || '%'))
    As a summary:
    * The query which works in iRepord do not work in Sentinel Log
    Manager.
    * I found a workaround for my case.
    * I did not checked, but the reports provided in Sentinel RD which use
    the same technique for VendorProduct parameter (i.e. the reports with
    query string containing
    Code:
    LIKE ($P{VendorProduct} || '%')
    will most probably not work as expected IF Sentinel RD uses the same
    code as Sentinel Log Manager.
    hkalyoncu
    hkalyoncu's Profile: http://forums.novell.com/member.php?userid=63527
    View this thread: http://forums.novell.com/showthread.php?t=450687

  • Problems using a parameter

    Hi, I am running into a problem that I can't fix.
    This is the code I have in the after parameter form trigger. I am selecting a character field from the holder table that has characters in like this '010204050709' I then put these numbers into a parameter called :p_condit_comma and I add a comma between each set of two numbers. I then use this parameter in my query in the where clause as can be seen below. This should work unless I am missing something.
    Using the parameter in the query produces no output and no error, if I replace the parameter in the query with (01,02,03) the report produces the desired output. I have also checked that the parameter contains what I am expecting eg. 01,02,04
    Thank you
    Michael
    function AfterPForm return boolean is
    v_conditions holder.conditions%type;
    v_num NUMBER(2) := 1;
    begin
    SELECT conditions INTO v_conditions
    FROM holder
    WHERE authority = :authority;
    LOOP
         EXIT WHEN SUBSTR(v_conditions,v_num,2) IS NULL;
         IF v_num = 1 THEN
         :p_condit_comma := SUBSTR(v_conditions,v_num,2);
         ELSE     
         :p_condit_comma := :p_condit_comma || ',' || SUBSTR(v_conditions,v_num,2);
         END IF;
         v_num := v_num + 2; END LOOP;     
         return (TRUE);
    end;
    SQL Query
    SELECT ALL CONDIT.CONDITION, CONDIT.CONDIT_MEM
    FROM CONDIT
    WHERE condition IN (:p_condit_comma)

    Hi M
    I have tried what you suggested
    :p_condit_comma := :p_condit_comma ||''''|| ',' || SUBSTR(v_conditions,v_num,2);
    this gives you something like this 01',02',03',04' and if you add an inverted comma before the number like this
    :p_condit_comma := :p_condit_comma ||''''|| ',' ||''''|| SUBSTR(v_conditions,v_num,2);
    you get the following error "ORA-06502 PL/SQL Numeric or value error"
    I have tried many different combinations of this and I still have problems, maybe I need a new approach.
    Thanks
    Michael

  • How to use lexical parameter in report

    i want to use lexical parameter in report and pass parameter from form how it is possible in detail
    A.R

    Hi,
    typically you fill your lexical paramter in the after-paramform-trigger out of the values of your bind-parameters (giving end users directly control over lexical parameters might not be a good idea). Inside PL/SQL a lexical parameter is referenced like bind parameters with ":". In the query it's referenced via "&" and represents a part of the query.
    A simple example.
    - p_deptno as bind parameter
    - p_where as lexical paramter
    - end user choose value for p_deptno (10,20,... or nothing)
    - Trigger: if :p_deptno is not null then
    :p_where := 'WHERE deptno = :p_deptno'
    else
    :p_where := null;
    end if;
    - Query select ... from emp &p_where
    Regards
    Rainer

  • How to pass parameter in where clause in custom folder?

    I have the follow query
    blue color are the parameters
    i have paste this to a custom folder
    and
    select last_update_date, creation_date
    from ra_customer_trx_all
    where trunc(last_update_date)='29-SEP-2012'
    and customer_trx_id=1109
    to another custom folder returning 1 row only and create another worksheet in the same workbook and create
    3 parameter and 2 of them pointing to the 1 row query and create calcualtion
    SET_CONTEXT('Date_From',TO_CHAR(:Date From)) and SET_CONTEXT('Date_TO',TO_CHAR(:Date To))
    and 1 condition 1= SET_PARAM3(:Period)
    but this doesnt work for me, no data return please help
    select m.party_name TENANT_NAME 
    , b.interface_line_attribute10 lease_num
    --, b.interface_line_attribute12 "PPS Number" 
    ,b.interface_line_attribute2 LOCATION_CODE
    ,flexv.description property_name
    , a2.trx_number INVOICE_NUMBER
    --, t.name "Transaction Type" 
    --, e.attribute15 "AS400 Key" 
    , b2.description "BILL_ITEM_INVOCIE_DESCRIPTION" 
    ,case when gcc.segment5 like '6%' then 'P/L'
    when gcc.segment5 like '7%' then 'P/L'
    when gcc.segment5 like '8%' then 'P/L'
    when gcc.segment5 like '9%' then 'P/L'
    else 'B/S'
    end as account_nature
    --, gcc.concatenated_segments as "Charge Account" 
    ,gcc.segment1 company_code
    ,gcc.segment2 department_code
    ,gcc.segment3 property_code
    ,gcc.segment4 business_segment
    ,gcc.segment5 account_code
    ,gcc.segment6 project_code
    ,gcc.segment7 intercom_code
    ,gcc.segment8 spare1
    ,gcc.segment9 spare2
    , b2.extended_amount BILL_ITEM_INVOICE_AMOUNT
    ,to_char(substr(ps.gl_date,4,8)) gl_period
    , b.interface_line_attribute11 bill_start_date
    , b.interface_line_attribute14 bill_end_date 
    , decode(a2.invoicing_rule_id, '-2',  
       DECODE(TO_CHAR(b.RULE_START_DATE, 'YYYYMM'), to_char(to_date(to_char(TRUNC(to_date(SETPARAM.GET_PARAM3,'yyyymm') , 'Month')-1),'DD-MON-YYYY'),'YYYYMM'), 'Current', 'In Advance'), 
       'Current') bill_nature 
    , to_char(a2.trx_date, 'DD-MON-YYYY') invoice_date
    ,pal.lease_commencement_date
    ,pal.lease_termination_date
    ,h.user_name created_by
    --, NULL as remarks 
    from ra_customer_trx_all a 
    , ra_customer_trx_lines_all b 
    , pn_leases_all d 
    , pn_tenancies_all e 
    , hz_cust_accounts l 
    , hz_parties m 
    , fnd_user h 
    , ar_payment_schedules_all ps 
    , RA_CUST_TRX_LINE_GL_DIST_ALL dist 
    , gl_code_combinations_kfv gcc 
    , AR_RECEIVABLE_APPLICATIONS_all app 
    , ra_customer_trx_all a2 
    , ra_customer_trx_lines_all b2 
    , RA_CUST_TRX_TYPES_all t 
    , fnd_flex_values_vl flexv
    ,pn_lease_details_all pal
    where  
    app.APPLICATION_TYPE = 'CM' 
    and flexv.flex_value=gcc.segment3
    and flexv.FLEX_VALUE_SET_ID=1014916
    and pal.lease_id=d.lease_id
    and app.applied_customer_trx_id = a.customer_trx_id 
    and app.customer_trx_id = a2.customer_trx_id 
    and a2.cust_trx_type_id = t.cust_trx_type_id(+) 
    and a2.org_id = t.org_id(+) 
    and b.customer_trx_line_id = b2.previous_customer_trx_line_id 
    and dist.CUSTOMER_TRX_LINE_ID = b2.CUSTOMER_TRX_LINE_ID 
    and dist.account_class = 'REV' 
    and dist.account_set_flag = DECODE(NVL(a2.invoicing_rule_id,1), -2, 'Y', 'N') 
    and gcc.CODE_COMBINATION_ID(+) = dist.CODE_COMBINATION_ID 
    and b.interface_line_attribute10 = d.lease_num 
    and d.lease_id = e.lease_id 
    and e.primary_flag = 'Y' 
    and b2.customer_trx_id = a2.customer_trx_id 
    and a2.bill_to_customer_id = l.cust_account_id 
    and l.party_id = m.party_id 
    and a2.created_by = h.user_id 
    and ps.customer_trx_id = app.customer_trx_id 
    and ps.gl_date between trunc(trunc(TO_DATE(SYS_CONTEXT('DISCO_CONTEXT','Date_From')),'MM')-1,'MM') and trunc(TO_DATE(SYS_CONTEXT('DISCO_CONTEXT','Date_To')),'MM')-1

    What exactly is wrong with the results? Can you make the report include the gl_date so that you can see exactly what is being included?
    The only way to troubleshoot this is to go back to basics. You have to be 100% certain that the parameter and calculations for the dates are working. You have granted execute permission over the function to your EUL owner - yes? What I did was create the function in a package owned by EUL_US then I had no issue with grants or permissions.
    Also, gl_date is a DATE and not a string right? I ask because if it is not a date but a string then some dates might be left out.
    Assuming you are 100% certain of the building blocks you should start by including only the gl_date and primary key from the table you are using. Once you are sure you are getting the right data you can start to add in more fields.
    I do notice you are using E-Business Suite objects. I copied the code into my system where I am not using leasing. So I commented out the references to the 3 PN tables. I got 150 rows of data when I queried using the parameter and again when I hard coded the BETWEEN for the gl_date. You do have to make sure that your EUL owner has been granted SELECT right from all the tables and views used in your code and, if you intend to share this code with someone else, you will also need to have GRANT rights.
    Try your code in a SQL tool such as TOAD and see what happens. Are you absolutely sure that every one of your transactions has an entry in the PN tables? This might be why you are not getting the results you expect. You could try, as I did, to comment those lines out and then see what happens.
    Hope this has given you enough to solve your issue
    Michael
    PS. It would be nice to know your name. You haven't used it once in your thread.

  • How to use import parameter to be instead of SQL where sub-sentence ?

    I wrote a RFC to read data from SAP table. To fetch data flexibility, I want to use import parameter xx instead of where sub-sentence in SQL sentence.
       For example, "SELECT * FROM T WHERE XXX",  and "XXX" is a importing parameter.
       How can I use it.
       Thanks a lot.
       Frank.

    FUNCTION ZRFC_04.
    *"*"Local Interface:
    *"  IMPORTING
    *"     VALUE(TARGETTABLE) LIKE  MAKT-MAKTX
    *"     VALUE(TWHERE) LIKE  MAKT-MAKTX
    *"  EXPORTING
    *"     VALUE(ZRETURN) LIKE  MAKT-MAKTX
    *"  TABLES
    *"      TMP_TEST1 STRUCTURE  ZTEST1
      DATA:
      TRANSACTION_ID LIKE ARFCTID,
      V_VAILD(1) TYPE C,
      scond(80) TYPE c.
      V_VAILD = 'X'.
    GET PARAMETER twhere fields scond.
    The error " 'LATE FIELDS' expected, not 'TWHERE FIELDS' " generated.

  • Want to use one parameter of first command into second parameter.

    Hi, Experts,
    Please help me out I am stuck in a crystal report. Actually i have written two commands in crystal report.
    first one is as follows:-
    Select * from oinv T0 inner join inv1 T1 on T0.DocEntry = T1.DocEntry Where T0.DocNum = {?Invoice No}
    Second One is as follows:-
    Select * from ibt1_Link Where BaseNum = {?Invoice No}
    What i want is I am passing Parameter in both Command Which took Invoice no as an input, So i don't want to input ttwo parameter both for invoice no. can i use first parameter in my second command or not. If Yes then please tell me.How can i do the same.
    Regards
    Hanes

    Have you tried joining your commands on the basenum = docnum fields? That should filter the second command?

  • Using bind variable with IN clause

    My application runs a limited number of straight up queries (no stored procs) using ODP.NET. For the most part, I'm able to use bind variables to help with query caching, etc... but I'm at a loss as to how to use bind variables with IN clauses. Basically, I'm looking for something like this:
    int objectId = 123;
    string[] listOfValues = { "a", "b", "c"};
    OracleCommand command = new OracleCommand();
    command.Connection = conn;
    command.BindByName = true;
    command.CommandText = @"select blah from mytable where objectId = :objectId and somevalue in (:listOfValues)";
    command.Parameters.Add("objectId", objectId);
    command.Parameters.Add("listOfValues", listOfValues);
    I haven't had much luck yet using an array as a bind variable. Do I need to pass it in as a PL/SQL associative array? Cast the values to a TABLE?
    Thanks,
    Nick

    Nevermind, found this
    How to use OracleParameter whith the IN Operator of select statement
    which contained this, which is a brilliant solution
    http://oradim.blogspot.com/2007/12/dynamically-creating-variable-in-list.html

  • How can we use DECODE function in where clause.

    Hi Guys,
    I have to use DECODE function in where clause.
    like below
    select * from tab1,tab2
    where a.tab1 = b.tab2
    and decode(code, 'a','approved')
    in this manner its not accepting?
    Can any one help me on this or any other aproach?
    Thanks
    -LKR

    >
    I am looking for to decode the actual db value something in different for my report.
    like if A then Accepted
    elseif R then Rejected
    elseif D then Denied
    these conditions I have to check in where clause.
    >
    what are you trying to do?
    may be you are looking for
    select * from tab1,tab2
    where a.tab1 = b.tab2
    and
       (decode(:code, 'A','Accepted') = <table_column>
        or
        decode(:code, 'R','Rejected') = <table_column>
       or
        decode(:code, 'D','Denied') = <table_column>
       )

  • Using CLOB datatypes in WHERE clause

    Hi All,
    I have a table with two columns as CLOB datatype. I'm using Oracle 8i Enterprise Edition. I can do a query, insert, update and even delete the data in the CLOB field using Oracle's SQL Plus.
    What I want is to do a search on those fields.. that is include that field in a WHERE clause. I'm using this datatype to store large number of data.
    I'd like to see this query working...
    SELECT * FROM MyTable WHERE CLOBFLD LIKE 'Something...';
    Now this query doesn't work. It returns: 'Inconsistent datatype' near the word CLOBFLD.
    Please Help me out.
    Regards,
    Gopi
    null

    I presume you want to query based on the contents of the CLOB, right ? If that is true, then you have to create a text index, using Oracle Context and then use "Contains" in the where clause to query. Hope this helps.

  • HR ABAP: Issue with using 'nocommit' parameter on FM HR_INFOTYPE_OPERATION

    Issue with using nocommit parameter on FM HR_INFOTYPE_OPERATION:
    My client has a requirement to create the following 4 infotypes in sequence in a LUW, i.e either all are created or none is created.
    9045   (custom infotype)
    0045
    0078
    0015
    I tried to use the nocommit parameter on FM HR_INFOTYPE_OPERATION to insert the 4 infotypes
    in a nocoomit mode and then at the end I have issued
    'Commit Work', but to my surprise only I/T 0015 is created in the database and the first three (9045, 0045 and 0078) did not make it to database.
    I searched many threads on SDN but could not find a solution.
    Please let me know if there could be any solution to implement the LUW.
    YOur inputs will be appreciated.

    Hi ,
    i think u can also try with this FM HR_MAINTAIN_MASTERDATA , see its documentations.
    no commit works like a simulation mode , what u can do is  ,
    call FM for all Infotypes and collect all error msgs if any , then finally call FM for all infotypes again without passing nocommit work ( i.e space).
    regards
    prabhu

Maybe you are looking for