How to add regular expression in viewobject bind variables

Hi,
Am using java class to set the adf bind variables
vm.setWhereClause("FIRST_NAME = :fname");
vm.defineNamedWhereClauseParam("fname", null, null);
vm.setNamedWhereClauseParam("fname","Alana");
It works fine and it returns Alana
But what i want is to set a regular expression where it returns all the names that are starting with A.
I tried with this.
vm.setNamedWhereClauseParam("fname","A*");
also
vm.setNamedWhereClauseParam("fname","A%");
but both didn work.
Please help.
Thanks,
Hari

Perfect... Thanks Arun.
I tried including last name too. i.e when either of the one matches (first name or last name)
vm.setWhereClause("upper(FIRST_NAME) LIKE upper(:fname||'%')");
vm.defineNamedWhereClauseParam("fname", null, null);
vm.setNamedWhereClauseParam("fname","A");
vm.setWhereClause("upper(LAST_NAME) LIKE upper(:lname||'%')");
vm.defineNamedWhereClauseParam("lname", null, null);
vm.setNamedWhereClauseParam("lname","A");
But i guess we should not give it like this as it doesnt seem to work.
Hari

Similar Messages

  • How to add '%' to a query with bind variables

    Hi,
    I am using oracle jdeveloper 11g.
    I am trying to create a table to display rows using the below query in a jspx page,
    select * from ade_txns where series='WORKPLACE_PT.11.1.1.8.0_GENERIC' and transaction like 'rkumara%'
    I am using a view with query and binding variables as below,
    select * from ade_txns where series= :p_series and transaction like :p_QAEngineer
    I will be passing p_QAEngineer using binding variable using 'ExecuteWithParams' using a dropdown(eg: 'rkumara'). But I need to add a '%' to this value as I am using a 'LIKE' clause in my query.
    I tried using,
    select * from ade_txns where series= :p_series and transaction like :p_QAEngineer+'%'
    But this is not working for me.
    Can someone please tell me how i can solve this.
    Thanks,
    Ranjeet

    does this help also?
    How to add regular expression in viewobject bind variables
    ~Abhijit

  • SSRS 2008 Work order report , in sub total donot want to add the 0 level in ( how to add the expression )

    working in Work order report, this report has different level , for example
    0 level transaction
    1 level transaction
    in subtotal don't want to add 0 level transaction,
    when I did the sub total it added all the level , so in sub total amount double up because of that
    how to add the expression so I can the level 0 take out from sub total , so it does not include in sub total
    can some one please help me with this
    thanks in advance

    Hi Simon_ Hou
    I tried the expr the way you suggested , it did not work  getting  error message,  the exp I added is below
    this the expression I added on sub total where is highlighted in Yellow,  under Cost amount column,
    I really appreciate the help
    =Sum(IIF(Fields!COLLECTREFLEVEL.Value=
    "0",0,Fields!CostAMOUNT.Value),"DataSet1")
    please see below my QUERY, can you please help and let me know what I did wrong in my exp
    SELECT        PRODTABLE.PRODID, PRODCALCTRANS.COSTGROUPID, PRODTABLE.QTYCALC, PRODTABLE.PRODSTATUS, PRODCALCTRANS.COSTAMOUNT,
                             PRODCALCTRANS.COSTMARKUP, PRODCALCTRANS.REALCOSTAMOUNT, PRODCALCTRANS.CALCTYPE, PRODTABLE.DATAAREAID, PRODCALCTRANS.KEY3,
                             PRODCALCTRANS.CONSUMPVARIABLE, PRODCALCTRANS.REALCONSUMP, PRODTABLE.ITEMID, PRODTABLE.SCHEDDATE, PRODTABLE.FINISHEDDATE,
                             PRODCALCTRANS.KEY1, PRODCALCTRANS.TRANSDATE, PRODCALCTRANS.QTY, PRODCALCTRANS.KEY2, PRODCALCTRANS.COLLECTREFLEVEL,
                             PRODCALCTRANS.LINENUM
    FROM            PRODTABLE INNER JOIN
                             PRODCALCTRANS ON PRODTABLE.PRODID = PRODCALCTRANS.PRODID AND PRODTABLE.DATAAREAID = PRODCALCTRANS.DATAAREAID
    WHERE        (PRODTABLE.PRODSTATUS = 7) AND (PRODTABLE.DATAAREAID = N'AR1') AND (PRODTABLE.ITEMID = @itemid) AND
                             (PRODTABLE.FINISHEDDATE >= @Paramfromdate) AND (PRODTABLE.FINISHEDDATE <= @Paramtodate)

  • How to write regular expression to find desired string piece *duplicate*

    Hi All,
    Suppose that i have following string piece:
    name:ali#lastname:kemal#name:mehmet#lastname:cemalI need
    ali
    mehmetI use following statement
    SQL> select lst, regexp_replace(lst,'(name:)(.*)(lastname)(.*)','\2',1,1) nm from (
      2    select 'name:ali#lastname:kemal#name:mehmet#lastname:cemal' as lst from dual
      3  );
    LST                                                NM
    name:ali#lastname:kemal#name:mehmet#lastname:cemal ali#lastname:kemal#name:mehmet#
    SQL> But it does not return names correctly. When i change 5th parameter(occurence) of regexp_replace built-in function(e.g. 1,2), i may get ali and mehmet respectiveley.
    Any ideas about regexp?
    Note : I can use PL/SQL instr/substr for this manner; but i do not want to use them. I need regexp.
    Regards...
    Mennan
    Edited by: mennan on Jul 4, 2010 9:53 PM
    thread was posted twice due to chrome refresfment. Please ignore the thread and reply to How to write regular expression to find desired string piece

    The approach is to do cartesian join to a 'number' table returning number of records equal to number of names in the string.I have hardcoded 2 but you can use regexp_count to get the number of occurrences of the pattern in the string and then use level <=regexp_count(..... .
    See below for the approach
    with cte as(
    select
    'name:ali#lastname:kemal#name:mehmet#lastname:cemal' col ,level lev
    from dual connect by level <=2)
    select substr(regexp_substr('#'||col,'#name:\w+',1,lev),7)
    from cte
    /

  • Add regular expression to spotlite!

    hello!
    i don't really know where to put this request, so i just do it here:
    please add regular expression search to spotlite!
    would be really great and i think not that much of a work..

    And even more effective would be to do a bit of digging before making suggestions to Apple.
    For instance, a simple googling of "spotlight regex" immediately provides a suggestion or two. Checking Spotlight's query syntax might also lead in interesting directions. And, of course, Spotlight (which is a mighty <censored> excuse for a search engine anyway) is really mdfind, and we all know we can pipe mdfind results to grep, don't we?

  • Regular Expression Required for Checksum variable

    I am wanting to create a regular expression that extracts a variable checksum value (cs=) which is unique to a given server response string.
    The issue I am having is that a simple regex being name="cs" value="(.+?)" just does not work because there are 18 different checksum values being returned per session id/server response.
    So a simple regex just picks up any "cs" value and I guess gets confused since there are 18 different ones contained within the server response (all user related)
    What i need is a regex to use say this value from the server response (JONHONEYMAN%40YAHOO.COM) or any other unique value which is contained within the string response from the server then extract the cs (Checksum) value from that string and make it variable :)
    Here is the server response string:-
    "fp=220:1200:2977638312763704:: NO::P1200_EMAIL_ADDRESS,P1200_ORGANISATION_NAME,P1200_UCRN,P1200_ORG_ID,P1200_CALLING_PAGE:JONHONEYMAN%40YAHOO.COM%2C john%20Honeyman%2C260%2C220%2C1190&cs=336788D01EC6E80B1877B3EE982E8B2D8" >Select</td></tr
    can anyone help?
    Thanks

    You need an XML Parser.

  • How can I add Regular Expression verify?

    I need to write a Regular Expression for date whose format is 'yyyy-mm-dd'('2004-5-3' or '2004-05-03') and a Regular Expression for phone number whoes format is '12345678' or '1234567' or '13809441234'.
    Thanks for any help.

    The date format is a little tricky as there are many invalid combinations. You'd be better off calling TO_DATE with your user input and format mask. If an error is returned, the date is invalid.
    For the phone number assuming a valid phone number could be 7, 8, or 11 digits (it's a little difficult to tell what the format your suggest is) then you could apply something like the following:
    ^[0-9]{7}([0-9]|[0-9]{4})?$
    Regards.

  • How to find Regular Expressions in a Hash Map

    Hi,
    I Have a hash map with some keys. The Keys are like this(Java.util.regex, Javax.swing.table, javax.swing.text, Java.util.jar, Java.text etc). Suppose if the user gives the search pattern as "text", the o/p should be javax.swing.text and java.text.. How to do it using regular Expressions

    // Sample code...
    import java.util.regex.*;
    public class TestRegex {
        public static void main(String[] args) {
            String test1 = "java.util.regex";
            String test2 = "javax.swing.text";
            String test3 = "java.util.jar";
            String test4 = "java.text";
            Pattern pat = Pattern.compile(".*text.*");
            Matcher mt1 = pat.matcher(test1);
            System.out.println("1> " +mt1.matches());
            Matcher mt2 = pat.matcher(test2);
            System.out.println("2> " +mt2.matches());
            Matcher mt3 = pat.matcher(test3);
            System.out.println("3> " +mt3.matches());
            Matcher mt4 = pat.matcher(test4);
            System.out.println("4> " +mt4.matches());
    }

  • How to use regular expression to delete a character?

    Hello,
    I have a query,
    select partition_name from dba_tab_partitions where table_owner='xxx'and num_rows <>0 and table_name = 'xxx';
    P5
    P6
    P7
    P12
    P13
    P14
    P17
    P18
    P19
    P20
    P24
    How can I use regular expression in above SQL query to get result without letter 'P', like..
    5
    6
    7
    12
    13
    14
    17
    18
    19
    20
    24
    thank you

    I find answer...
    select regexp_replace(partition_name,'P','')
    thanks anyway

  • How to use regular expression to find string

    hi,
    who know how to get all digits from the string "Alerts 4520 ( 227550 )  (  98 Available  )" by regular expression, thanks
    br, Andrew

    Liu,
    You can use RegEx as   
    d+
    Whether you are using CL_ABAP_REGEX class then
    report  zars.
    data: regex   type ref to cl_abap_regex,
          matcher type ref to cl_abap_matcher,
          match   type c length 1.
    create object regex exporting pattern = 'd+'
                                  ignore_case = ''.
    matcher = regex->create_matcher( text = 'Test123tes456' ).
    match = matcher->match( ).
    write match
    You can find more details regarding REGEX and POSIX examples here
    http://www.regular-expressions.info/tutorial.html

  • How to build regular expression

    I am trying to build a regular expression that will search the following array of strings for the sequence 3.1
    Read Modem Information:
    Device Type .......................... 2
    Serial Number ........................ 11437
    Primary Phone Number ................. 1800...
    Secondary Phone Number ............... 1800...
    Modem Software ....................... BOOT.3.1 Jun 17 2004 17:02:26
    Bracelet Software .................... 4.0
    Validation Number .................... Default
    Login Name ........................... Default
    Login Password ....................... Default
    Case Number .......................... Default
    Primary Encryption Key ............... Default        
    Secondary Encryption Key ............. Default        
    Dialing Format ....................... True
    Call In Format ....................... True
    Modem Download Flag is Clear ......... True
    SCRAM Download Flag is Clear ......... True
    SCRAM Char Table Load Flag is Clear .. True
    Download Inhibit ..................... True
    Exiting Boot (8 sec) ................. Switching to operating memory.
    Main Revision ........................ SLCP.3.1 Jun 17 2004 17:02:46
    Reset ................................ Complete
    This is my first real foray into regular expressions and so I am lost trying to understand the help file.
    Thanks!
    Tay
    Message Edited by slipstick on 09-25-2008 09:34 AM

    I think the OP was puzzled about how to form a RE.
    For the specific case or how to find the exact string "3.1", and to not match anything else, the RE is "3\.1"
    Why?
    For the most part, a RE search string is an exact character match. However things change when certain "special characters" are included in the search string. The RE help message says what they are, but the descriptions can be a bit daunting at first.
    As a first example of special characters, the RE of "." (The single character fullstop) will match ANY single character. Thus a RE of "3.1" will match "3.1", "301", "3Z1", but not "31" or 3aa1".
    Another special character is "*". It modifies the match to allow zero or more of the preceeding bit. So "3.*1" matches "3", followed by any number of any character (including no characters), followed by "1". so it will match "31", "301", "3ABC51", "31111111"
    The action of a special character is cancelled by preceeding it with a backslash. So in the example above "3\.1" matches ONLY the string "3.1"
    The best way to discover exactly how RE's work is to try some out. Make a VI containing Match Pattern, and suitable controls and indicators. Work through the examples and see how they operate. Now try your own!

  • How to use regular expression in editor?

    I tried to add some text to all line in selected text in editor
    ie .
    x:= x+1 ; change to x:=x+1; log_something;
    y:= y-1; -> y:= y-1 ; log_something;
    and so on.
    Then
    1. select  some text in editor
    2.pressed Ctrl-R
    3.in "text to search for" I put "^\(.*\)$"
    4.in "replace with" I put "\1 log_something;
    5.check "Regular expressions"
    6. check "Selected text only"
    I got "The search text "^\(.*\)$" was not found."
    What am I doing wrong?

    Thanks. But now editor wants to replace whole text, not only selected by me, regardless of <<check "Selected text only" >>
    Update: if I pick "scope: all" instead of "prompted" it shows popup "text not found" but replaces text as requested.
    Message was edited by: user4879976

  • How to use Regular expression

    Hi,
    I have a file that contains this format (separated by ;(semicolon) ):
    user id;user name;email address;password;integer;list of integer(separated by ,(comma))
    below is the example data :
    abc;Abc;[email protected];password1;1;1,2
    def;Def;[email protected];password;2;1,2,3
    ghi;Ghi;[email protected];password;2;1
    my question is how to verify the valid input for each row using regular expression..? TQ

    @Op. Doing a correct validation of e-mailaddresses
    is very hard using regular expressions (doingbasic
    validation is however easy)
    http://www.regular-expressions.info/email.html
    I like the RFC 822 compliant regexp :)

  • How to use regular expressions to generate test data ?

    Hi
    Someone can help me on what I have to do in order to create test data with regular expressions ?
    For example, I want to introduce a random telephone number (XXX-XXXX) in the phone number Form Field, I want to create the phone number using regular expressions in order to test different values in each playback of the script.
    I don't want to use VB or vbscript in e-tester, I'm just trying to do this with e-load nav editor and e-load
    Thanks a lot

    Hi and thanks for your answer!, it's a great trick ^_^
    I'm doing a research on how to improve the execution speed of the scripts in e-load, so actually I'm trying to avoid the use of databanks and VB code also.
    I was expecting that maybe e-load, e-load nav editor or e-tester can automatically generate test data via Regular Expressions. Someone Knows if this is possible ?
    Also can anyone tell me what the option "Automatically Generated (complex)" means ? I think that this will help me a lot
    *you can find this option in e-load Nav Editor when you select a parameter in the tree view, then go to the  "type" listbox in the properties pane, there you will find this option and some more options like :"Databanked variable", "Custom Dynamic Value", "Function".. etc.
    Thanks again

  • How to add Airport Express and USB 2?

    Hello all,
    I have a Titanium 1ghz that currently has no Airport. I'd like to add Airport Express and USB 2. I know I can do both via the PCMCIA slot, but only one at a time.
    (Before you say: Just add USB 2 via the slot, and then add a WiFi dongle via the new USB -- I need to use the Airport for Internet Sharing (the PB is going to be a slim little server/Airport hub), and I've never seen anyone (including me) succeed at getting an internet connection shared via a dongle.)
    FWIW, the main reason I need the USB 2 is to connect a pair of external hard drives. If I could connect the USB drives via the Firewire ports, I'd be all set. Are there adapters that would let me do this?
    Thoughts? They're much appreciated.
    SJ

    FWIW, the main reason I need the USB 2 is to connect a pair of external hard drives. If I could connect the USB drives via the Firewire ports, I'd be all set. Are there adapters that would let me do this?
    No, there aren't. But it would be simple enough to replace your USB-only external drive enclosures with enclosures that have FireWire ports. Just swap the drive mechanisms themselves into the new enclosures. FireWire would give you better speed than USB2, and if your enclosures have two FW ports (say, one FW 400 and one FW 800) and their own power supplies, then you could daisy-chain both drives on the Tibook's single FW port.
    Of course if you can get by without having the two drives connected at the *same time* as you're using the wifi connection, then a USB2 PC Card and a wifi PC Card (like this one) will serve you just fine.

Maybe you are looking for

  • BT Widget YVM105 Problem unable to use

    Hiya there Brand new YV user here I've set up the YV box and almost everything works really well, except The BT widget (the BT on the on demand section to access BT films etc.) now I have both an e-mail and phone confimation that it is et up but when

  • Connect MacBook to Performa 6400

    I want to connect my Performa 6400 to my MacBook. Both have Ethernet. What's the proper technique?

  • Financial Statement version (f.01)

    Hi All, T code F.01 Can any one can hint me to change the ITEM no. in the ALV Grid control list of a  FSV.(one of the three types of outputs ) I need to change the Item no. of of two gl accounts which appear in FSV (from NO.1 to 83) Is there any poss

  • Adobe premiere elements 8.0

    When I use large files of approxiamtely 10gb, the program can't handle it and it gets stuck all the time. Very enoying, because I can't edit proper with this problem. The computer should be perfect for the program and has all the requirements on it.

  • Time Management Problem

    Hi Guys This issue is faced by one of friend ,please any suggestions are appreciated . What is the  upload program to move all personal paid leave (85) to vacation leave (04)?? Do we have any upload program for this ,never heard like this ,Though 85