REPLACE exact match in string

Hi,
I am using SQL Server 2008 R2 Standard Edition. My question is:
How to use the REPLACE function (or any other T-SQL function if you have a better suggestion than the REPLACE function) to replace an
exact match in a string? For instance, let's say I have this string:
'success and successfully'. I would like to change the word "success" to "failure"
without changing the word "successfully" to "failurefully". This is exactly what happens when the function REPLACE is used. 
REPLACE('success and successfully', 'success', 'failure')
How to force an exact match?
Thank you!

I thank all of you for your interesting and clever answers. I believe each one of them can be applied depending on the situation. In my case, I have found a practical and simple solution to my own problem.
The bulk of the problem with T-SQL "REPLACE" function arises when a word is a subset of another word in the initial string. In my example, "success" is a
subset of "successfully" in the initial string "success and successfully".
To simulate an exact match with the "REPLACE" function, just include in both the
replaced string and in the
replacer string the first extra character that causes a difference between the word and its subset. In my example, the space after the subset "success" constitute the breaking character from the word "successfully". Thus, the
code becomes (note the space after both "success" and "failure"):
REPLACE('success and successfully', 'success ', 'failure ')
The expected output result is: failure and successfully
This simple technique works in all other situations where the extra character does not have to be a space; any breaking point character will work fine.
Thank you again to all of you for pitching in!
LOL... this wont work in some situations.
Imagine if you have a string like 'Successfully and success.'. You will have to add an additional replace function. And if your string equals to the replaced word, such as in 'success', it won't work either.

Similar Messages

  • How to replace regex match into a char value (in the middle of a string)

    Hi uncle_alice and other great regex gurus
    One of my friends has a peculiar problem and I cant give him a solution.
    Using String#replaceAll(), i.e. NOT a Matcher loop, how could we convert matched digit string such as "65" into a char of its numeric value. That is, "65" should be converted into letter 'A'.
    Here's the failing code:
    public class GetChar{
      public static void main(String[] args){
        String orig = "this is an LF<#10#> and this is an 'A'<#65#>";
        String regx = "(<#)(\\d+)#>";
        //expected result : "this is an LF\n and this is an 'A'A"
        String result = orig.replaceAll(regx, "\\u00$2");
        // String result = orig.replaceAll(regx, "\\\\u00$2"); //this also doesn't work
        System.out.println(result);

    I don't know that we have lost anything substantial.i think its just that the kind of task this is
    especially useful for is kind of a blind-spot in the
    range of things java is a good-fit for (?)
    for certain tasks (eg process output munging) an
    experienced perl programmer could knock up (in perl)
    using built-in language features a couple of lines
    which in java could takes pages to do. If the cost is
    readability/maintainability/expandability etc.. then
    this might be a problem, but for a number of
    day-to-day tasks it isn't
    i'm trying to learn perl at the moment for this exact
    reason :)Yes. And when a Java source-code processor(a.k.a. compiler) sees the code like:
    line = line.replaceAll(regexp,  new String(new char[] {(char)(Integer.parseInt("$1"))}));or,
    line = line.replaceAll(regexp,  doMyProcessOn("$1")); //doMyProcess returns a Stringa common sense should have told him that "$1" isn't a literal string "$1" in this regular expression context.
    By the way, I abhor Perl code becaus of its incomprehensibleness. They can't be read by an average common sense. Java code can be, sort of ...

  • Replace exact string from a list seperated by ":" delimeiter

    Hi,
    How can I replace PROJ1 with PROJ4 and cover all the following options, when items are seperated by ":" delimiter.
    1)     PROJECT_NAME=PROJ1
    2)     PROJECT_NAME=PROJ1:PROJ2
    3)     PROJECT_NAME=PROJ2:PROJ1
    4)     PROJECT_NAME=PROJ1:PROJ11
    5)     PROJECT_NAME=PROJ3:PROJ1:PROJ2
    in case #4 i want to save PROJ11 and to replace only PROJ1
    Thanks,
    Sheli

    Hi, Etbin,
    Sorry, I can't figure out what you're asking.
    Etbin wrote:
    Not wanting to write regular expressions without database checkingAre you asking if this can be done without regular expressions? Yes, but it's not pretty. It would involve several layers of nested REPLACE (and/or other string manipulation) functions, even without worrying about multiple consecutive occurrences of the target string.
    I wonder whether in replacing PROJ1 with PROJ4 we could request to replace PROJ1 only as a complete word ?The solutions above already replace 'PROJ1' only when it is a complete word, not when it is a sub-string of a larger word such as 'PROJ11' or 'SUBPROJ1'.
    In this problem, I'm thinking of a "word" as being something delimited by '=', ':' or end-of-string. Does your question involve some different meaning of "word"?
    PROJ11 seems to represent the only threat to obtain the wrong PROJ41'PROJ11' is the only example in the given sample data, where the word starts with the target, but then continues. Both solutions above would also handle cases where a word ends with the target, but has something extra first (such as 'SUBPROJ1') or where there are extra characters both before and after the target (e.g. 'SUBPROJ11').
    or I'm (lately much too often) missing somethingI'm definitely missing something: a clear idea of what your question is.
    Maybe you're just trying to get me to use my funny name for this problem" "I found love in Slovenia". If so, thank you. I'm always happy to have such an oppoortunity.

  • Search MS Word for Exact Match

    I've got a script that opens an MS Word document, then searches through a directory for each image file (.jpg), then does a find and replace using the filename as the search string, and inserts the image in place of the text it finds. My problem is that
    it's not doing an exact match. This means for example that if it looks for image1.jpg and that text exists in the word document inserts the image in it's place (the text being a placeholder). But if mimimage1.jpg was in place before it then it would insert
    the .jpg there - not doing an exact match.
    Here's the code I've got so far:
    # Get variables from XML file
    $MyDir = Split-Path $MyInvocation.MyCommand.Definition
    # Get settings from variables.xml.
    [xml]$settings = get-content "$MyDir\variables-test.xml"
    # Assign the settings to local variables.
    $SMTP = $settings.Settings.Setting.SMTP
    $port = $settings.Settings.Setting.port
    $from = $settings.Settings.Setting.EmailFrom
    $to = $settings.Settings.Setting.EmailTo
    $subject = $settings.Settings.Setting.Subject
    $body = $settings.Settings.Setting.Body
    $savepath = $settings.Settings.Setting.SavePath
    $docfile = $settings.Settings.Setting.WordDoc
    $XMLpath = "$MyDir\variables.xml"
    [String[]]$strXML=@()
    [xml]$xml = get-content $XMLpath
    $parse_results = New-Object System.Collections.ArrayList
    add-type -AssemblyName "Microsoft.Office.Interop.Word"
    $wdunits = "Microsoft.Office.Interop.Word.wdunits" -as [type]
    $application = New-Object -comobject word.application
    $application.visible = $false
    $document = $application.documents.open($docfile)
    set-variable -name wdGoToLine -value 3 -option constant
    set-variable -name wdGoToAbsolute -value 1 -option constant
    # Create new directory
    $date = (Get-Date -format "dd-MM-yyyy")
    $newdir = $savepath + "archive" + "-" + $date
    New-Item -ItemType directory -Path $newdir
    # Search Word document for filename and insert image
    foreach($file in Get-ChildItem $savepath -Filter *.jpg)
    if ($application.Selection.Find.Text = $file)
    if ($application.Selection.Find.Execute())
    $insertfile = $savepath + $file
    $objSelection = $application.selection
    $objShape = $objSelection.InlineShapes.AddPicture($insertfile)
    $gotoline = $objSelection.GoTo($wdGoToLine, $wdGoToAbsolute,1)
    # Move spreadsheets and images to archive location and cleanup after dfm2xls.ps1 before ending script
    foreach($movexlsx in Get-ChildItem $savepath -Filter *.xlsx)
    $xlpath = $savepath + $movexlsx
    Move-Item $xlpath $newdir
    foreach($movejpg in Get-ChildItem $savepath -Filter *.jpg)
    $imgpath = $savepath + $movejpg
    Move-Item $imgpath $newdir
    # Save document then close application
    $newsave = $savepath + $date + "-report.docx"
    $document.SaveAs([ref]$newsave)
    $document.Close()
    $application.quit()
    At the moment it doesn't do an exact match but I've tried using:
    $MatchWholeWord = $True
    $MatchCase = $False
    and then
    $application.Selection.Find.Execute($MatchWholeWord, $MatchCase)
    But that stopped it from finding any matches. Can anyone help?
    Thanks in advance

    Hi AJ Mellor,
    If you want to replace the words of the .jpg file's name with the picture in word file, this script should be helpful for you to modify your script:
    Hey, Scripting Guy! How Can I Read Words in a Text File and Make Those Same Word Italic in a Word Document?
    Insert pictures in a folder into a Word document (PowerShell)
    In addition, to get the words of the file name instead of the full path name, please refer to the script below:
    $files = Get-ChildItem $savepath -Filter *.jpg
    $words = $files.basename
    foreach($word in $words){
    I hope this helps.

  • SQL Error: ORA-01861: literal does not match format string

    Hello,
    I'm trying to do data mining on a web log which recorded one day web access information from a busy web server. I imported the data into Oracle Data miner, and created a table (WEBLOG). The idea is to create a new field, i.e. session, for the users so that each session could be thought as a representative of a user-intent (aka topic). Now based on this, data mining models would be used to cluster(group) the users based on their similarity. The first step is to prepare the data which involves using SQL queries. So first, all I did was to create a function for date and time. This is the following code I used,
    create or replace function ssndate(p_date in varchar2 default '03-01-18',
    p_time in varchar2)
    return number
    $if dbms_db_version.ver_le_10 $then
    deterministic
    $elsif dbms_db_version.ver_le_11 $then
    result_cache
    $end
    as
    begin
    return trunc((to_date(p_date||' '||p_time, 'dd-mm-yy hh24:mi:ss')
    - to_date('01-01-90','dd-mm-yy')) * (86400/2400));
    end ssndate;
    The function ssndate compiled successfully.
    The next step I took was to create a view through the following query,
    create or replace view WEBLOG_VIEWS
    as
    select (select ssndate(LOG_DATE, LOG_TIME) from dual) as "SESSION_DT",
    C_IP,
    CS_USER_AGENT,
    (CS_URI_STEM||'?'||CS_URI_QUERY) as WEB_LINK
    from WEBLOG;
    This was successful as well. The problem is in the next step where I try to do data grouping.
    create table FINAL_WEBLOG as
    select SESSION_DT, C_IP, CS_USER_AGENT,
    listagg(WEB_LINK, ' ')
    within group(order by C_IP, CS_USER_AGENT) "WEB_LINKS"
    from WEBLOG_VIEWS
    group by C_IP, CS_USER_AGENT, SESSION_DT
    order by SESSION_DT
    For this, I got the error,
    Error starting at line 1 in command:
    create table FINAL_LOG as
    select SESSION_DT, C_IP, CS_USER_AGENT,
    listagg(WEB_LINK, ' ')
    within group(order by C_IP, CS_USER_AGENT) "WEB_LINKS"
    from WEBLOG_VIEWS
    group by C_IP, CS_USER_AGENT, SESSION_DT
    order by SESSION_DT
    Error at Command Line:1 Column:7
    Error report:
    SQL Error: ORA-01861: literal does not match format string
    ORA-06512: at "DMUSER.SSNDATE", line 11
    ORA-06512: at line 1
    01861. 00000 - "literal does not match format string"
    *Cause:    Literals in the input must be the same length as literals in
    the format string (with the exception of leading whitespace).
    If the "FX" modifier has been toggled on, the literal must
    match exactly, with no extra whitespace.
    *Action:   Correct the format string to match the literal.
    I don't know where I'm going wrong with this.. the to_date function should be fine. In the data that I possess, the date and time are in no format. Example: 30118 and 0:00:09 respectively. If anyone has any clue about this I would be sincerely grateful for any help that I can get!! It's quite urgent..
    The Oracle version is 11.2.0.1.0
    Edited by: 975265 on Dec 5, 2012 5:31 PM

    975265 wrote:
    Ok.. Looks like I touched a nerve there. I apologize. I'm still a student, and this is the first time that I've tried something at this level. I'm still in the learning process, so I was hoping that someone could point me in the right direction in order to "fix" the data.Not so much touching a nerve as simply trying to implement a very very poor, but all too common, practice. Since you are a student (which we didn't know until this post) most people will cut you some slack. However, this little exchange should now be burned into your brain as you move forward. One of the very first rules of programming is to ALWAYS use the correct data types for your data. And along with that, never ever depend on implicit type conversions - always use the proper explicit conversion functions.
    And as a slight follow-on, when considering the appropriate data type, don't assume that just because we refer to a given element as a 'something number' that it is indeed a number. Telephone "numbers" are NOT numbers. U.S. Social Security "numbers" are NOT numbers. U.S. Postal Zip codes are NOT numbers. All are just character strings which, by convention, we limit to the same characters we use to represent numbers.
    And since this entire discussion came up around the representation of dates, you might want to take a look at http://edstevensdba.wordpress.com/2011/04/07/nls_date_format/
    Now, go forth and be a smarter programmer than your peers.
    Edited by: EdStevens on Dec 6, 2012 6:12 AM

  • Pattern matching in String

    Hi,
    I want to do pattern matching using String. Here is my requirement.
    String file_name = (String)hash.get("DOCNAME"));
    file_name = file_name.replace("'","285745@");
    So, whereever I have '(apostrophe) I will replace it with pattern "285745@" and then at another jsp where I get this request parameter I do reverse as follows:
    String docname = (String)request.getParameter("doc_name").replace("285745@","'");
    Now I know replace function is not going to do this. It is just a indicative, for you to know what I want to achieve. which other java function / method i can implement to get the desired result.
    thanks,
    pp

    String file_name = (String)hash.get("DOCNAME"));
    file_name = file_name.replace("'","285745@");The problem here is that String.replace() operates only on char arguments, you cannot replace entire substrings with it.
    The String.replaceAll() method, on the other hand, operates on regular expressions. In many common cases (those in which the substring you want to find contains no characters with special meaning to the regular expression processor) you can use it exactly as you would String.replace() except that it operates on substrings.
    But regular expressions are much more powerful than that. The javadoc for the "Pattern" class has some information on how to use them. There is also a tutorial at http://java.sun.com/docs/books/tutorial/extra/regex/intro.html which you might find helpful.
    In the 1.4 edition of Java there is no longer any need to screw around with while loops and StringBuffers. Nearly any text processing operation can be done with regular expressions.

  • Regular expression in exact match

    Hi,
    Please let me know how do i find an exact match within a string using Regular expression,
    var str1:String = "s1 + s2 + sf_s1 + s1 - s2";
    var replceableStr:String = "s1";
    var reggular:RegExp = /\s+(s1)\s+/gi;
    var str2:String;
    str2 = str1.replace(reggular,"format");
    i want only s1 to be replaced with format but sf_s1 should not be replaced, please let me know which Reg exp to use
    Expected output: format + s2 +sf_s1 + format -s2

    Odd, though. I thought regex wouldn't pick upthe
    \n unless you explicitly told it to with DOTALL or
    MULTILINE or (?s) or (?n).
    I thought "String.matches" matched the wholestring.
    So, since the string had a newline, it didn'tmatch.
    It does.Ah, that would explain it then.

  • Search for calendars with exact match

    Hello,
    I am work on customisation of uwc. I have problem with calendar search. I am getting the result of substring matches. I want to have exact matches. I suppose that it is some kind of configuration of Sun Calendar Server. Could you give me please some advices?
    Thank you

    Hi,
    jslezak wrote:
    I am work on customisation of uwc. I have problem with calendar search. I am getting the result of substring matches. I want to have exact matches. I suppose that it is some kind of configuration of Sun Calendar Server. Could you give me please some advices?Which screen are you talking about precisely? Is this the calendar subscription search screen or the attendee search screen?
    A number of the searches are controlled by the calendar ics.conf file. So try matching the directory access entry which relates to your search to the appropriate string in ics.conf and that should provide a guide as to what needs to be changed.
    Regards,
    Shane.

  • How to execute exact match & contains text search simultaneoulsy in Oracle 10g

    Hi,
    We have scenario where there are more than 50 million rows in a table with description column length as 1000 character. We have a web interface from where we generate a rule of comma separated keywords like
    "Standard", Single, Cancel, "deal"    & so on. The words in quotes needs to be checked for exact match & the one without quotes will be searched using contains.
    The problem is that we can have a rule of such a combination as large as 4000 characters of inclusion & 2000 such characters for exclusion (not to consider the description under exclusion) and this search when run on the table with millions of rows does not work using oracle regular expression, but works with smaller no. of search keywords.
    Is there a better way to do such a kind of search in Oracle or if not then outside oracle using any other tool
    Thanks,
    AP

    Please find below the table script, few insert statements along with the SP & function. Please help.
    -- Create Table
    CREATE TABLE Roomdescriptionmaster
    ID long,
    ROOMDESCRIPTION nvarchar2, --- max 1000 charaters
    Createddate datetime
    ----- Insert statements
    INSERT INTO ROOMDESCRIPTION (ID, ROOMDESCRIPTION, Createddate ) VALUES (1, 'Double Room (2 Adults + 2 Children) | FREE cancellation before Mar 16, 2014 PAY LATER All-Inclusive [ Included:10 % VAT] Meals:All meals and select beverages are included in the room rate.Cancellation:If canceled or modified up to 2 days before date of arrival,no fee will be charged.If canceled or modified later,100 percent of the first two nights will be charged.In case of no-show, the total price of the reservation will be charged. Prepayment:No deposit will be charged', sysdate)
    INSERT INTO ROOMDESCRIPTION (ID, ROOMDESCRIPTION, Createddate ) VALUES (1, 'Double or Twin Room | FREE cancellation before Feb 1, 2014 PAY LATER All-Inclusive [ Included:10 % VAT] Meals:All meals and select beverages are included in the room rate.Cancellation:If canceled or modified up to 2 days before date of arrival,no fee will be charged.If canceled or modified later,100 percent of the first two nights will be charged.In case of no-show, the total price of the reservation will be charged. Prepayment:No deposit will be charged', sysdate)
    INSERT INTO ROOMDESCRIPTION (ID, ROOMDESCRIPTION, Createddate ) VALUES (1, 'Quadruple Room (3 Adults + 1 Child) | FREE cancellation before Mar 16, 2014 PAY LATER Full board included [ Included:10 % VAT] Meals:Breakfast, lunch & dinner included.Cancellation:If canceled or modified up to 2 days before date of arrival,no fee will be charged.If canceled or modified later,100 percent of the first two nights will be charged.In case of no-show, the total price of the reservation will be charged. Prepayment:No deposit will be charged', sysdate)
    INSERT INTO ROOMDESCRIPTION (ID, ROOMDESCRIPTION, Createddate ) VALUES (1, 'Triple Room with Lateral Sea View (2 Adults + 1 Child) | FREE cancellation before Dec 6, 2013 PAY LATER All-Inclusive [ Included:10 % VAT] Meals:All meals and select beverages are included in the room rate.Cancellation:If canceled or modified up to 2 days before date of arrival,no fee will be charged.If canceled or modified later,100 percent of the first two nights will be charged.In case of no-show, the total price of the reservation will be charged. Prepayment:No deposit will be charged', sysdate)
    INSERT INTO ROOMDESCRIPTION (ID, ROOMDESCRIPTION, Createddate ) VALUES (1, 'Single Room with Lateral Sea View | FREE cancellation before Dec 6, 2013 PAY LATER All-Inclusive [ Included:10 % VAT] Meals:All meals and select beverages are included in the room rate.Cancellation:If canceled or modified up to 2 days before date of arrival,no fee will be charged.If canceled or modified later,100 percent of the first two nights will be charged.In case of no-show, the total price of the reservation will be charged. Prepayment:No deposit will be charged', sysdate)
    --SP
    CREATE OR REPLACE PROCEDURE
    SP_PGHGETROOMDESCRIPTION(v_BId                number,
                               v_DaysOfData         integer,
                               v_Incl1              nvarchar2,
                               v_Incl2              nvarchar2,
                               v_Incl3              nvarchar2,
                               v_Excl1              nvarchar2,
                               v_CurrentIndex       integer,
                               v_RecordPerPage      integer,
                               v_IndexMultiplier    integer,
                               ref_recordset        out sys_refcursor
                               ) as
    start_index        integer;
    end_index          integer;
    Incl1              nvarchar2(2000);
    Incl2              nvarchar2(2000);
    Incl3              nvarchar2(2000);
    Excl1              nvarchar2(2000);
    v_desc_utf_value   VARCHAR2(10);
    begin
    v_desc_utf_value:= 'utf8';
      if v_incl1 is null or trim(v_incl1) = '' then
         --dbms_output.put_line('include 1 is null or blank');
         Incl1 := '';
      else
         Incl1 := lower(v_Incl1);
      end if;
      if v_incl2 is null or trim(v_incl2) = '' then
         --dbms_output.put_line('include 2 is null or blank');
         Incl2 := '';
      else
         Incl2 := lower(v_Incl2);
      end if;
      if v_incl3 is null or trim(v_incl3) = '' then
         --dbms_output.put_line('include 3 is null or blank');
         Incl3 := '';
      else
         Incl3 := lower(v_Incl3);
      end if;
      if v_Excl1 is null or trim(v_Excl1) = '' then
         --dbms_output.put_line('Exclude 1 is null or blank');
         Excl1 := '';
      else
         Excl1 := lower(v_Excl1);
      end if;
       -- Old code
       --     and regexp_like(lower(ROOMDESCRIPTION), Incl1, 'i')
       --    and regexp_like(lower(ROOMDESCRIPTION), Incl2, 'i')
       --     and regexp_like(lower(ROOMDESCRIPTION), Incl3, 'i')
       --     and not regexp_like(lower(ROOMDESCRIPTION), Excl1, 'i')
    --- First call to SP
      if v_CurrentIndex = 1 then
          start_index := v_RecordPerPage * v_IndexMultiplier;
          end_index   := (v_CurrentIndex - 1 + v_IndexMultiplier) * v_RecordPerPage;
          open ref_recordset for
         select * from (
          select ROOMDESCRIPTION, Createddate,  rownum as rn
          from roomdescriptionmaster
          where BID = v_BId
          and TO_NUMBER(trunc(sysdate) - to_date(to_char(createddate, 'yyyy-mm-dd'),'yyyy-mm-dd')) <= v_DaysOfData
          and length(FN_GET_RESTRICTION(lower(ROOMDESCRIPTION),Incl1,Incl2,Incl3,Excl1,v_desc_utf_value)) > 0
          and row_num <= v_RecordPerPage * v_IndexMultiplier
          order by row_num;
      else
      --- Subsequent calls to SP using paging from UI
          start_index := (v_CurrentIndex - 1) * v_RecordPerPage + 1;
          end_index   := (v_CurrentIndex - 1 + v_IndexMultiplier) * v_RecordPerPage;
          open ref_recordset for
          select * from (
          select ROOMDESCRIPTION, Createddate,  rownum as rn
          from roomdescriptionmaster
          where BID = v_BId
          and TO_NUMBER(trunc(sysdate) - to_date(to_char(createddate, 'yyyy-mm-dd'),'yyyy-mm-dd')) <= v_DaysOfData
          and length(FN_GET_RESTRICTION(lower(ROOMDESCRIPTION),Incl1,Incl2,Incl3,Excl1,v_desc_utf_value)) > 0
          order by roomdescriptionmasterid desc
          where rn >= start_index
          and rn <= end_index
          order by rn;
      end if;
      commit;
    end SP_PGHGETROOMDESCRIPTION;
    --Function
    CREATE OR REPLACE FUNCTION FN_GET_RESTRICTION(
    v_rate_description IN NVARCHAR2,
    v_include_1 IN NVARCHAR2,
    v_include_2 IN NVARCHAR2,
    v_include_3 IN NVARCHAR2,
    v_exclude IN NVARCHAR2, v_desc_utf_value IN VARCHAR2)
      RETURN NVARCHAR2
    IS
    CURSOR include_1_cur IS
    select regexp_substr(str, '[^,]+', 1, level) str
    from (select v_include_1 str from dual)
    connect by level <= length(str)-length(replace(str,','))+1;
    CURSOR include_2_cur IS
    select regexp_substr(str, '[^,]+', 1, level) str
    from (select v_include_2 str from dual)
    connect by level <= length(str)-length(replace(str,','))+1;
    CURSOR include_3_cur IS
    select regexp_substr(str, '[^,]+', 1, level) str
    from (select v_include_3 str from dual)
    connect by level <= length(str)-length(replace(str,','))+1;
    CURSOR exclude_cur IS
    select regexp_substr(str, '[^,]+', 1, level) str
    from (select v_exclude str from dual)
    connect by level <= length(str)-length(replace(str,','))+1;
    include_1_rec include_1_cur%rowtype;
    include_2_rec include_2_cur%rowtype;
    include_3_rec include_3_cur%rowtype;
    exclude_rec exclude_cur%rowtype;
    tmp_var NVARCHAR2(200);
    tmp_var_int NUMBER;
    tmp_flag_int NUMBER;
    return_str NVARCHAR2(200);
    tmp_length NUMBER;
    tmp_length_include_1 NUMBER;
    tmp_length_include_2 NUMBER;
    tmp_length_include_3 NUMBER;
    tmp_length_exclude NUMBER;
    tmp_regex_pattern VARCHAR2(1000);
    flag_include_1_match INTEGER;
    flag_include_2_match INTEGER;
    flag_include_3_match INTEGER;
    flag_exclude_match INTEGER;
    BEGIN
      tmp_length_include_1 := nvl(length(v_include_1),0);
      tmp_length_include_2 := nvl(length(v_include_2),0);
      tmp_length_include_3 := nvl(length(v_include_3),0);
      tmp_length_exclude := nvl(length(v_exclude),0);
      flag_include_1_match := 0;
    flag_include_2_match := 0;
    flag_include_3_match := 0;
    flag_exclude_match := 0;
      IF tmp_length_include_1>0 OR tmp_length_include_2 >0
      OR tmp_length_include_3 >0 OR tmp_length_exclude >0 THEN
      IF v_desc_utf_value ='utf8' THEN
        ----------------------------------------------------- UTF 8 STARTED --------------
    -----------------------------------------   INCLUDE 1
      tmp_length := tmp_length_include_1;
      IF tmp_length > 0 THEN
      tmp_flag_int :=0;
    FOR include_1_rec in include_1_cur
    LOOP
      tmp_var := trim('' || include_1_rec.str);
      --dbms_output.put_line(tmp_var);
      tmp_regex_pattern := '[^[:alnum:]]'||tmp_var||'[^[:alnum:]]|^'||tmp_var||'$|^'||tmp_var||'[^[:alnum:]]|[^[:alnum:]]'||tmp_var||'$';
      tmp_var_int := nvl(regexp_instr(v_rate_description,tmp_regex_pattern,1,1),0);
      IF (tmp_var_int <> 0) THEN
      tmp_flag_int :=1;
      flag_include_1_match := 1;
      EXIT;
      END IF;
    END LOOP;
    ELSE
      flag_include_1_match := 1;
    END IF;
    --------------------------------------------  INCLUDE 2
    tmp_length := tmp_length_include_2;
      IF tmp_length > 0 THEN
        tmp_flag_int :=0;
    IF flag_include_1_match =1 THEN
      FOR include_2_rec in include_2_cur
    LOOP
      tmp_var := trim('' || include_2_rec.str);
    tmp_regex_pattern := '[^[:alnum:]]'||tmp_var||'[^[:alnum:]]|^'||tmp_var||'$|^'||tmp_var||'[^[:alnum:]]|[^[:alnum:]]'||tmp_var||'$';
      tmp_var_int := nvl(regexp_instr(v_rate_description,tmp_regex_pattern,1,1),0);
      IF (tmp_var_int <> 0) THEN
      tmp_flag_int :=1;
      flag_include_2_match := 1;
      EXIT;
      END IF;
    END LOOP;
    END IF;
    ELSE
      flag_include_2_match := 1;
    END IF;
    -------------------------------------------- INCLUDE 3
    tmp_length := tmp_length_include_3;
      IF tmp_length > 0 THEN
      tmp_flag_int :=0;
       IF flag_include_2_match =1 THEN
      FOR include_3_rec in include_3_cur
    LOOP
      tmp_var := trim('' || include_3_rec.str);
    tmp_regex_pattern := '[^[:alnum:]]'||tmp_var||'[^[:alnum:]]|^'||tmp_var||'$|^'||tmp_var||'[^[:alnum:]]|[^[:alnum:]]'||tmp_var||'$';
      tmp_var_int := nvl(regexp_instr(v_rate_description,tmp_regex_pattern,1,1),0);
      IF (tmp_var_int <> 0) THEN
      tmp_flag_int :=1;
      flag_include_3_match := 1;
      EXIT;
      END IF;
    END LOOP;
    END IF;
    ELSE
      flag_include_3_match := 1;
    END IF;
    -------------------------------------------- EXCLUDE
    tmp_length := tmp_length_exclude;
    IF tmp_length > 0 and flag_include_3_match =1 THEN
      FOR exclude_rec in exclude_cur
    LOOP
      tmp_var := trim('' || exclude_rec.str);
    tmp_regex_pattern := '[^[:alnum:]]'||tmp_var||'[^[:alnum:]]|^'||tmp_var||'$|^'||tmp_var||'[^[:alnum:]]|[^[:alnum:]]'||tmp_var||'$';
      tmp_var_int := nvl(regexp_instr(v_rate_description,tmp_regex_pattern,1,1),0);
      IF (tmp_var_int <> 0) THEN
      tmp_flag_int := -1;
      return_str := '';
      EXIT;
      END IF;
    END LOOP;
    END IF;
      ELSE
      ----------------------------------------------------- UTF 16 STARTED --------------
      -----------------------------------------   INCLUDE 1
      tmp_length := tmp_length_include_1;
      IF tmp_length > 0 THEN
      tmp_flag_int :=0;
      FOR include_1_rec in include_1_cur
    LOOP
      tmp_var := trim('' || include_1_rec.str);
      --dbms_output.put_line(tmp_var);
    tmp_var_int := nvl(INSTR(v_rate_description,tmp_var,1,1),0);
      IF (tmp_var_int <> 0) THEN
      tmp_flag_int :=1;
      flag_include_1_match := 1;
      EXIT;
      END IF;
    END LOOP;
    ELSE
      flag_include_1_match := 1;
    END IF;
    --------------------------------------------  INCLUDE 2
    tmp_length := tmp_length_include_2;
      IF tmp_length > 0 THEN
        tmp_flag_int :=0;
    IF flag_include_1_match =1 THEN
      FOR include_2_rec in include_2_cur
    LOOP
      tmp_var := trim('' || include_2_rec.str);
    tmp_var_int := nvl(INSTR(v_rate_description,tmp_var,1,1),0);
      IF (tmp_var_int <> 0) THEN
      tmp_flag_int :=1;
      flag_include_2_match := 1;
      EXIT;
      END IF;
    END LOOP;
    END IF;
    ELSE
      flag_include_2_match := 1;
    END IF;
    -------------------------------------------- INCLUDE 3
    tmp_length := tmp_length_include_3;
      IF tmp_length > 0 THEN
      tmp_flag_int :=0;
       IF flag_include_2_match =1 THEN
      FOR include_3_rec in include_3_cur
    LOOP
      tmp_var := trim('' || include_3_rec.str);
    tmp_var_int := nvl(INSTR(v_rate_description,tmp_var,1,1),0);
      IF (tmp_var_int <> 0) THEN
      tmp_flag_int :=1;
      flag_include_3_match := 1;
      EXIT;
      END IF;
    END LOOP;
    END IF;
    ELSE
      flag_include_3_match := 1;
    END IF;
    -------------------------------------------- EXCLUDE
    tmp_length := tmp_length_exclude;
    IF tmp_length > 0 and flag_include_3_match =1 THEN
      FOR exclude_rec in exclude_cur
    LOOP
      tmp_var := trim('' || exclude_rec.str);
      tmp_var_int := nvl(INSTR(v_rate_description,tmp_var,1,1),0);
      IF (tmp_var_int <> 0) THEN
      tmp_flag_int := -1;
      return_str := '';
      EXIT;
      END IF;
    END LOOP;
    END IF;
    END IF;
    IF tmp_flag_int = 1 THEN
    return_str := 'truely matched';
    ELSE
    return_str := '';
    END IF;
    ELSE
    return_str := '';
    END IF;
    return return_str;
    EXCEPTION
      WHEN OTHERS THEN
      --dbms_output.put_line('Exception');
        RAISE;
    END FN_GET_RESTRICTION;

  • Select exact match in LOV (revisited)

    Hi all,
    Regarding [url http://forums.oracle.com/forums/thread.jspa?messageID=9203960]Thread: Select exact match in LOV, which is already closed:
    LOVs in ADF match the entered value using a LIKE operation. For example, let's say we have an attribute of type String with an associated LOV. When entering the value 'V', even if the value 'V' exists, the LOV will open and show values matching 'V%' ('V', 'Va', 'Vb'...).
    Is there any chance to prevent the LOV opening when the exact match exists?
    Thanks,
    Barbara
    Version
    ADF Business Components 11.1.1.56.60
    Java(TM) Platform 1.6.0_18
    Oracle IDE 11.1.1.3.37.56.60
    Edited by: Barbara Gelabert on 13-ene-2011 10:15

    Hi,
    There is a workaound for the above issue, i will prepare sample and publish soon. watch this thread and my blog
    http://ramadf.blogspot.com
    Regards
    B.Ram

  • Does exact match has priority over extension mapping?

    Hi, i'm using extension mapping in my web application. So one
    servlet is responsible for all requests with extension 'do'.
    Now i would like to have one special request served by another
    servlet. What's the best way to implement this? I'm thinking
    about setting up an exact match mapping for the special request
    and an extension mapping for the rest. There's only one thing
    i worry about: if i use the 'do' extension in my special request
    (for consistency reasons), which servlet will handle this request?
    Thanks in advance for your comments.
    Markus

    A exact match on path will override the extension mappng. Here's the rules from the servlet 2.3 spec (also contains examples)..
    1. The container will try to find an exact match of the path of the request to the
    path of the servlet. A successful match selects the servlet.
    2. The container will recursively try to match the longest path-prefix: This is done
    by stepping down the path tree a directory at a time, using the �/� character as
    a path separator. The longest match determines the servlet selected.
    3. If the last segment in the URL path contains an extension (e.g. .jsp), the servlet
    container will try to match a servlet that handles requests for the extension.
    An extension is defined as the part of the last segment after the last �.� character.
    4. If neither of the previous three rules result in a servlet match, the container will
    attempt to serve content appropriate for the resource requested. If a "default"
    servlet is defined for the application, it will be used.
    The container must use case-sensitive string comparisons for matching.

  • ORA-01861: literal does not match format string

    Hi Experts,
    Whenever i am running the my procedure in oracle appliactions i am getting this error.
    ORA-01861: literal does not match format string .
    pkg is below:--->
    CREATE OR REPLACE PACKAGE Arc0471_Pending_Crc_Prc_Pkg IS
      --Insert into Custom Table
        PROCEDURE Arc_Insert_Data(P_ORG_ID VARCHAR2, P_BC_CODE VARCHAR2, P_GL_DATE VARCHAR2, P_DB_LINK VARCHAR2);
    END Arc0471_Pending_Crc_Prc_Pkg;
    CREATE OR REPLACE PACKAGE BODY Arc0471_Pending_Crc_Prc_Pkg IS
            PROCEDURE Arc_Insert_Data(P_ORG_ID VARCHAR2, P_BC_CODE VARCHAR2, P_GL_DATE VARCHAR2, P_DB_LINK VARCHAR2)
            IS
              v_val         varchar2(32000);          
              v_cursor1     integer;
              v_cursor2     integer;
              v_returncode  integer;
            BEGIN
           v_val   := ' ';
            v_val :=' INSERT INTO ARC.ARC_CRC_PRC_INVC ';
              v_val := v_val||' (CTA_TRX_NUMBER ,CTA_TRX_DATE ,DUE_DATE ,';
              v_val := v_val||' BILL_TO_CUSTOMER_NO,     BILL_TO_CUSTOMER_NAME ,     BILL_TO_LOCATION ,';
              v_val := v_val||' BILL_TO_ADDRESS ,ORIGINAL_AMOUNT ,APPLIED_AMOUNT , EXCHANGE_RATE     ,';
              v_val := v_val||' INVOICE_CURRENCY_CODE , ACCOUNT_CLASS , GL_DATE  , CTA_CUSTOMER_TRX_ID ,';
              v_val := v_val||' ORG_ID , CREATED_BY , CREATION_DATE ,LAST_UPDATE_BY , LAST_UPDATE_DATE , LAST_UPDATE_LOGIN )';
            v_val := v_val||' SELECT  CTA.TRX_NUMBER ,     CTA.TRX_DATE , APS.DUE_DATE ,';
              v_val := v_val||' HCA.ACCOUNT_NUMBER ,     HP.PARTY_NAME ,     HCSUA.LOCATION ,';
              v_val := v_val||' SUBSTR(HL.ADDRESS1 ||'||''' '''||'|| HL.ADDRESS2 ||'||'''  '''|| '||HL.ADDRESS3||'||'''  '''|| '||HL.ADDRESS4|| '||'''  ''' ||'||HL.PROVINCE||'||'''  '''||'|| HL.CITY ||'||'''  '''||'|| HL.STATE ||'||'''  '''||'|| HL.POSTAL_CODE ||'||'''  '''||'||FTL.TERRITORY_SHORT_NAME,0,1500),';
              v_val := v_val||' APS.AMOUNT_DUE_ORIGINAL , APS.AMOUNT_APPLIED,APS.EXCHANGE_RATE, APS.INVOICE_CURRENCY_CODE, CTLA.ACCOUNT_CLASS,';
              v_val := v_val||' APS.GL_DATE , CTA.CUSTOMER_TRX_ID , CTA.ORG_ID ,FND_GLOBAL.USER_ID ,';
              v_val := v_val||' SYSDATE , FND_GLOBAL.USER_ID , SYSDATE , FND_GLOBAL.LOGIN_ID '  ;  
             v_val := v_val||' FROM ' ;
             v_val := v_val||' AR.RA_CUSTOMER_TRX_ALL CTA,';
              v_val := v_val||' AR.RA_CUST_TRX_TYPES_ALL CTTA,';
              v_val := v_val||' AR.RA_CUST_TRX_LINE_GL_DIST_ALL CTLA,';
              v_val := v_val||' AR.HZ_PARTIES HP,';
              v_val := v_val||' AR.HZ_CUST_ACCOUNTS HCA,';
              v_val := v_val||' AR.HZ_CUST_SITE_USES_ALL HCSUA,';
              v_val := v_val||' AR.HZ_LOCATIONS HL,';
              v_val := v_val||' AR.HZ_PARTY_SITES HPS,';
              v_val := v_val||' AR.AR_PAYMENT_SCHEDULES_ALL APS,';
              v_val := v_val||' AR.HZ_CUST_ACCT_SITES_ALL HCASA,';
              v_val := v_val||' GL.GL_CODE_COMBINATIONS GCC,';
              v_val := v_val||' AR.AR_RECEIVABLE_APPLICATIONS_ALL ARAA,';
              v_val := v_val||' APPLSYS.FND_TERRITORIES_TL FTL ,';
              v_val := v_val||' ONT.OE_TRANSACTION_TYPES_TL'|| P_DB_LINK ||' IND_OTT, ' ;
              v_val := v_val||' ONT.OE_ORDER_HEADERS_ALL'||P_DB_LINK ||'  IND_OH, ';
              v_val := v_val||' AR.RA_CUSTOMER_TRX_ALL'||P_DB_LINK ||' IND_RCTA   ';
             v_val := v_val||' WHERE   CTA.ORG_ID = '||''''|| P_ORG_ID||'''';
             v_val := v_val||' AND   CTTA.ORG_ID = '||''''|| P_ORG_ID||'''' ;
             v_val := v_val||' AND   CTLA.ORG_ID = '||''''|| P_ORG_ID||'''' ;
             v_val := v_val||' AND   HCSUA.ORG_ID = '||''''|| P_ORG_ID||'''' ;
             v_val := v_val||' AND   APS.ORG_ID =  '||''''||P_ORG_ID||'''';
             v_val := v_val||' AND   HCASA.ORG_ID = '||''''|| P_ORG_ID||'''' ;
             v_val := v_val||' AND   CTLA.ACCOUNT_CLASS     =     '||'''REC''';
              v_val := v_val||' AND   CTLA.GL_DATE <= TRUNC(TO_DATE( '||''''||P_GL_DATE||''''||','||'''DD/MM/RRRR HH24:MI:SS'''||'))';
             v_val := v_val||' AND   NVL(ARAA.APPLY_DATE,TO_DATE( '||''''||P_GL_DATE||''''||','||'''DD/MM/RRRR HH24:MI:SS'''||')) <= TRUNC(TO_DATE ('||''''||P_GL_DATE||''''||','||'''DD/MM/RRRR HH24:MI:SS'''||'))';
             v_val := v_val||' AND   TO_DATE(APS.TRX_DATE,'||'''DD-MON-RRRR'''||') >'|| '''02-SEP-2007''' ;
             v_val := v_val||' AND     CTA.CUST_TRX_TYPE_ID    =     CTTA.CUST_TRX_TYPE_ID';
             v_val := v_val||' AND     CTLA.CUSTOMER_TRX_ID     =     CTA.CUSTOMER_TRX_ID';
             v_val := v_val||' AND     HCA.CUST_ACCOUNT_ID     =     CTA.BILL_TO_CUSTOMER_ID';
             v_val := v_val||' AND     HCA.PARTY_ID          =     HP.PARTY_ID';
             v_val := v_val||' AND     HCSUA.SITE_USE_ID     =     CTA.BILL_TO_SITE_USE_ID';
             v_val := v_val||' AND     HL.LOCATION_ID          =     HPS.LOCATION_ID';
             v_val := v_val||' AND     HPS.PARTY_ID          =     HCA.PARTY_ID';
               v_val := v_val||' AND     APS.CUSTOMER_TRX_ID     =     CTLA.CUSTOMER_TRX_ID';
             v_val := v_val||' AND     HCASA.CUST_ACCOUNT_ID     =     HCA.CUST_ACCOUNT_ID';
             v_val := v_val||' AND   HCASA.CUST_ACCT_SITE_ID =HCSUA.CUST_ACCT_SITE_ID';
             v_val := v_val||' AND   HCASA.PARTY_SITE_ID=HPS.PARTY_SITE_ID';
             v_val := v_val||' AND     ARAA.APPLIED_CUSTOMER_TRX_ID(+) = CTA.CUSTOMER_TRX_ID';
             v_val := v_val||' AND   IND_RCTA.TRX_NUMBER = CTA.TRX_NUMBER';
             v_val := v_val||' AND     TO_CHAR(IND_OH.ORDER_NUMBER) = IND_RCTA.CT_REFERENCE';
             v_val := v_val||' AND     IND_OTT.TRANSACTION_TYPE_ID = IND_OH.ORDER_TYPE_ID';
              --v_val := v_val||' AND   ARC.Arc0463_Get_Remng_Amt(APS.TRX_NUMBER,'||''''|| P_GL_DATE||''''||','||'APS.INVOICE_CURRENCY_CODE) <> 0';
             v_val := v_val||' AND   IND_OTT.NAME IN ('||'''D0M RC Imported Sale'''||','||'''D0M RC Indigenous Sale'''||')';
             v_val := v_val||' AND   GCC.CODE_COMBINATION_ID = CTLA.CODE_COMBINATION_ID';
             v_val := v_val||' AND   GCC.SEGMENT1 = '|| ''''||P_BC_CODE||'''';
             v_val := v_val||' AND   HL.COUNTRY = FTL.TERRITORY_CODE';
             v_val := v_val||' AND   FTL.LANGUAGE = USERENV('||'''LANG'''||')';          
                v_cursor1 := dbms_sql.open_cursor;
              dbms_sql.parse(v_cursor1,v_val,DBMS_SQL.NATIVE);
              v_returncode := dbms_sql.execute(v_cursor1);
              dbms_sql.close_cursor(v_cursor1);
         COMMIT;
         EXCEPTION     
                    WHEN DUP_VAL_ON_INDEX THEN
                                    NULL;
                   WHEN OTHERS THEN
                        COMMIT;
                   FND_FILE.PUT_LINE(FND_FILE.OUTPUT, 'IN WHEN OTHERS THEN OF INSERT INTO ARC.ARC_CRC_PRC_INVC'||SQLCODE || ' - ' || SQLERRM);
                -- dbms_output.put_line(sqlcode||sqlerrm);
            END Arc_Insert_Data;
    END Arc0471_Pending_Crc_Prc_Pkg;in above procdure APS.TRX_DATE having the format like this..23/3/2006. in Backend this procedure is working fine ..in toad(version 8.0.0.47). database is 9.0.
    but in oracle apps it is giving error like "literal does not match format string".
    please give me the solution...
    Thanks in ADv...

    Hi,
    It is the Date Data type...There's your problem then; NEVER, EVER, EVER to_date a date!! As you have discovered, it leads to problems when your code is run on different clients due to the different NLS settings they may have. You've been lucky, in other words, that your code has been working at all!
    What to_dating a date does is this:
    to_date(to_char(date_value, <format in NLS_DATE_FORMAT parameter>), <format in NLS_DATE_FORMAT parameter>) You've been lucky because your NLS_DATE_FORMAT has the same format as the data, on your client. On the database, however, it is clearly different.
    Simply remove the to_date from your already-a-date value, and you should find that it works fine.

  • How to use replace(CharacterSequence, CharacterSequence) in String class

    Need simple java program using the following
    how to use replace(CharacterSequence, CharacterSequence) in String class
    Kindly help

    From http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html#replace(java.lang.CharSequence,%20java.lang.CharSequence)
    replace
    public String replace(CharSequence target,
    CharSequence replacement)Replaces each substring of this string that matches the literal target sequence with the specified literal replacement sequence. The replacement proceeds from the beginning of the string to the end, for example, replacing "aa" with "b" in the string "aaa" will result in "ba" rather than "ab".
    Parameters:
    target - The sequence of char values to be replaced
    replacement - The replacement sequence of char values
    Returns:
    The resulting string
    Throws:
    NullPointerException - if target or replacement is null.
    Since:
    1.5

  • CONTAINS() with exact match returns a 0

    Hi all, hope someone can help with this urgent problem!
    Our DB has a simple XMLTYPE at itemheader.xheader. A regular Oracle Text index has just been created on it. We are looking to match strings against the node that matches //Identifier[@Type="AN"]
    So, when you run this query:
    SELECT
    CONTAINS(xheader, 'BAGCHEE2-07162 INPATH(//Identifier[@Type="AN"])', 1) as hastheAN,
    EXTRACT(ih.xheader, '//Identifier[@Type="AN"]/text()').getStringVal() AS theAN FROM itemheader ih
    WHERE itemid = 25985144
    you get
    HASTHEAN 0
    THEAN BAGCHEE2-07162
    So, this shows that for the given row, the node exists in xheader and has the requested value - but CONTAINS returns 0 !!
    Also when you run something like
    SELECT itemid
    ,EXTRACT(ih.xheader,'//Identifier[@Type="AN"]/text()').getStringVal() AS theAN
    , SCORE(1)
    FROM itemheader ih
    WHERE
    CONTAINS(xheader, 'BAGCHEE2-07162 INPATH(//Identifier[@Type="AN"])', 1)>0
    AND EXTRACT(ih.xheader, '//Identifier[@Type="AN"]/text()').getStringVal() LIKE 'BAGCHEE2-0716%'
    ORDER BY theAN
    you get the following:
    25984701 BAGCHEE2-07160 11
    39382849 BAGCHEE2-07161 11
    39383043 BAGCHEE2-07163 11
    39386596 BAGCHEE2-07164 11
    etc...
    So - there are many inexact matches with a positive SCORE but for the one row that should match exactly (..07162) it is not returned.
    Anyone know what is up with this? We only need the one exact match but can't get it -
    thanks

    well finally found out that the syntax of the text parameter passed to contains was treating the '-' to mean "discount if the following text matches" so it was returning everything except that. Putting the text inside {} works, like {BAGCHEE2-07162}

  • How to create custom search box will allow up to 60 alphanumericcharacters & User can input a minimum of 1 character and the system will pull back an exact match on the sequence entered.

    Hi,
    Can anyone please help me in creating the Custom Search box with below mentioned functionality
    "The search box will allow up to 60 alphanumeric characters.User can input a minimum of 1 character and the system will pull back an exact match on the sequence entered"

    Hi Pradeep,
    Find the complete JQuery AutoComplete function with along with different events in it like focus, select, open and close. You can modify this code as per your requirement.
    $("#ddlSearchTextBox").autocomplete({
    source: function (request, response) {
    var getUrl = "<site URL>";
    $.ajax({
    url: getUrl,
    type: "GET",
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    data: {
    featureClass: "P",
    style: "full",
    maxRows: 10
    dataFilter: function (data, type) {
    return data.replace(/\\'/g, "'");
    success: function (data) {
    response($.map(data.d, function (result) {
    return {
    label: result.Last_Name + ", " + result.First_Name,
    value: result.id
    focus: function (event, ui) {
    $("#ddlSearchTextBox").val(ui.item.label);
    return false;
    minLength: 1,
    select: function (event, ui) {
    $("#ddlSearchTextBox").val(ui.item.label);
    return false;
    open: function () {
    $("#ddlSearchTextBox").removeClass("ui-corner-all").addClass("ui-corner-top");
    close: function () {
    $("#ddlSearchTextBox").removeClass("ui-corner-top").addClass("ui-corner-all");
    Let us know if you need any further.
    Thanks, Shakir | Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

Maybe you are looking for