Use Escape character * as wildcard chacater.

I'm using Oracle 11.2.0.3.

Select * from TEXT_TBL where catsearch(srch_nm,'B\*BANK','') > 0

gives me:

B * BANK MARKETS LLC

B * BANK LLC

However, select * from TEXT_TBL where catsearch (srch_nm,'B\ * BANK*', ") > 0 is not return all records.  I think that the 2nd instance of * is also to be escaped and not used as a wildcard. Is it possible to escape the first failure of * and use the second failure of * as a reserved word.

Thanks for you time.

HeraldtenDam wrote:

the wildcard character in Oracle Text is not * but the %

The wildcard character for contains a context index is %, but the wildcard for catsearch with a ctxcat index *.  The following example shows that you get good results without defining the asterisk as a printjoin, but his definition of the asterisk as a printjoin gives incorrect results.

Scott@orcl_11gR2 > select * from version $ v

2.

BANNER

--------------------------------------------------------------------------------

Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production

PL/SQL Release 11.2.0.1.0 - Production

CORE 11.2.0.1.0 Production

AMT for 64-bit Windows: Version 11.2.0.1.0 - Production

NLSRTL Version 11.2.0.1.0 - Production

5 selected lines.

Scott@orcl_11gR2 > create table text_tbl

2 (srch_nm varchar2 (30))

3.

Table created.

Scott@orcl_11gR2 > insert all

2 in text_tbl values ('B * BANK MARKETS LLC "")

3 in text_tbl values ('B * BANK LLC "")

4 in text_tbl values ('B * BANKtest LLC "")

5 in text_tbl values ("BaBANKtest LLC")

6 in text_tbl values ("another name")

7 select * of the double

8.

5 rows created.

Scott@orcl_11gR2 > create index text_idx

2 on text_tbl (srch_nm)

3 indextype is ctxsys.ctxcat

4.

The index is created.

Scott@orcl_11gR2 > select Dr.$ Dr. chips $ text_idx$ I

2.

TOKEN OF $ DR

----------------------------------------------------------------

ANOTHER

B

B

B

BABANKTEST

BANK

BANK

BANKTEST

LLC

LLC

LLC

LLC

MARKETS

NAME

14 selected lines.

Scott@orcl_11gR2 > select * from TEXT_TBL

2 where catsearch (srch_nm, ' B\ * BANK ', ") > 0

3.

SRCH_NM

------------------------------

B * BANK MARKETS LLC

B * BANK LLC

2 selected lines.

Scott@orcl_11gR2 > select * from TEXT_TBL

2 where catsearch (srch_nm, ' B\ * BANK *', ") > 0

3.

SRCH_NM

------------------------------

B * BANK MARKETS LLC

B * BANK LLC

B * BANKtest LLC

3 selected lines.

Scott@orcl_11gR2 > drop index text_idx

2.

The index is deleted.

Scott@orcl_11gR2 > start

2 ctx_ddl.create_preference ('text_lexer', 'basic_lexer');

3 ctx_ddl.set_attribute ('text_lexer', 'printjoins', ' *');

4 end;

5.

PL/SQL procedure successfully completed.

Scott@orcl_11gR2 > create index text_idx

2 on text_tbl (srch_nm)

3 indextype is ctxsys.ctxcat

4 parameters ("lexer text_lexer")

5.

The index is created.

Scott@orcl_11gR2 > select Dr.$ Dr. chips $ text_idx$ I

2.

TOKEN OF $ DR

----------------------------------------------------------------

ANOTHER

B * BANK

B * BANK

B * BANKTEST

BABANKTEST

LLC

LLC

LLC

LLC

MARKETS

NAME

11 selected lines.

Scott@orcl_11gR2 > select * from TEXT_TBL

2 where catsearch (srch_nm, ' B\ * BANK ', ") > 0

3.

SRCH_NM

------------------------------

B * BANK MARKETS LLC

B * BANK LLC

2 selected lines.

Scott@orcl_11gR2 > select * from TEXT_TBL

2 where catsearch (srch_nm, ' B\ * BANK *', ") > 0

3.

no selected line

Tags: Database

Similar Questions

  • How to use the escape character in the update statement.

    Hi all

    I'm trying to update using the following table update statement in sql, but whenever he asks me to enter the value 'and' below sql.
    UPDATE xyz_xyz
       SET NAME = 'ABC & PQR'
     WHERE ID = (SELECT ID
                   FROM abc_abc
                  WHERE NAME = 'C & PQR');
    Please let me know how to use escape character syntax or let me know if there is no alternative.

    Thank you
    Vishwas

    If you use SQL * more then use SET DEFINE OFF.

    Also, you can do something like this

    UPDATE xyz_xyz
       SET NAME = 'ABC' ||'&' || 'PQR'
     WHERE ID = (SELECT ID
                   FROM abc_abc
                  WHERE NAME = 'C' ||'&' ||'PQR');
    
  • Deactivation of the PowerShell escape character

    I need to use Get-VMGuestNetworkInterface on about 100 mV.  They are members of domain created from the same template with the same local administrator account.  Unfortunately, the local administrator password using the 'character.  The "character is the PowerShell escape character.  The escape character will not allow itself be included with a string value, so when I try to pass the parameter - GuestPassword, it does not include the "character, the password is incorrect, and the authentication will fail.  Anyone know who to use the "character in a string literal?

    Depends on hwo you pass the string between apostrophes, the backtick didn't need to be escaped (' pass'word ').

    Quotation marks, use the back-slash ("past" word")

  • UTL_HTTP parameter with escape character

    Hi guys

    We implement our database to send SMS via a footbridge and to have a little problem with parsing the message to the htl_http package. We use the script below to send SMS

    DECLARE
        HTTP_REQ      UTL_HTTP.REQ;
        HTTP_RESP     UTL_HTTP.RESP;
        URL_TEXT      VARCHAR2(32767);
        URL VARCHAR2(2000);
        
        SMS_MSG VARCHAR2(160) :='This is a test message sent from Oracle Database';
        
    BEGIN
        DBMS_OUTPUT.ENABLE(1000000);
        
        URL := 'http://mysmsgateway/alerts/api/web2sms.php?username=test&password=test&to=9999555555&sender=ORASMS&message='||SMS_MSG;
             
        UTL_HTTP.SET_HEADER(HTTP_REQ, 'User-Agent', 'Mozilla/4.0');
        HTTP_RESP := UTL_HTTP.GET_RESPONSE(HTTP_REQ);
    
        -- Process Request
        LOOP
            BEGIN
                URL_TEXT := null;
                UTL_HTTP.READ_LINE(HTTP_RESP, URL_TEXT, TRUE);
                DBMS_OUTPUT.PUT_LINE(URL_TEXT);
    
                EXCEPTION
                    WHEN OTHERS THEN EXIT;
            END;
        END LOOP;
    
        UTL_HTTP.END_RESPONSE(HTTP_RESP);
    END;
    

    Now our problem is, while the SMS is received, we get just 'this' which is the first word of the variable SMS_MSG. It is because of the management of escape character, we believe. How to "escape" this problem?

    Any suggestions?

    Kind regards

    REDA

    Something like this:

    URL: = 'http://mysmsgateway/alerts/api/web2sms.php?username=test&password=test&to=9999555555&sender=ORASMS&message=' |
           UTL_URL. Escape (SMS_MSG, TRUE);

  • Before escape character point in the dn entry after provisioning OID

    Our users IOM are automatically provisioned to OID using OID box connector. Everything works well except this issue.

    When the value of "User login" IOM contains the character (called BILLY. (BOB), the dn entry in OID is created with an escape character (dn: uid = BILLY\.) BOB, cn is users, dc = abc, dc = com).

    Example:
    'User Login' IOM = BILLY. BOB
    :
    :
    OID entry created as
    DN: uid is BILLY\. BOB, cn is users, dc = abc, dc = com
    First name: Billy
    UID: BILLY. BOB
    CN: Billy Bob
    :
    :

    Note that the uid does not get the escape character, only the dn value is getting affected.

    Thanks in advance!
    Kabi

    You must remove. in the definition of research, which comes with STANDARD connector.

    Re: OID Connector.User Id includes "------" seen by DOHAD

  • escape character must be the string of length 1 (error ORA-01425)

    Hi all!

    I get this error message (SQL error: ORA-01425: escape character must be the string of length 1) when querying an oracle 9i database with:

    SELECT * FROM table WHERE column LIKE '%' ESCAPE ' \';

    Bar which makes it a double backslash (included with apostrophes) would solve the problem, however, with this change, the request is more executable in a 10g database.

    Is there a way to make the executable SQL above (with a single backslash escape) code in both (and latest) versions, without changing it? Maybe a server definition database that could solve this problem...

    Suggestions for the problem described are greatly appreciated!

    Thank you

    col2 NVARCHAR2 (100)

    OK, you should have mentioned before using unicode ;)

    However, should not always identical fields be treated identically in any database?...

    Yes, they should :(

    In any case the escape string should obviously be treated as unicode so the right way, I guess, would be

      select * from mytable where col2 like N'%' escape N'\'; 
    

    Note the front N ' \' to make the unicode string.

  • Using the "character in a be executed the command (EMM)

    Hello

    I ran against a little challenge construction of a function on a menu based EMM.

    I would like to have a user to change the number dialed in a chat script, but the script of cat command uses the character "in his order.

    The same character "is also used to mark the beginning and the end in the and the .

    When the execution of the function, it gives an error message indicating return: TCL EMM error: extra characters after the end-winding

    Which is weird because there are a lot of "in the command line and, normally, you can put multiple lines in a single ExecCommand command - or ConfigCommand line to mark the beginning and end of a single line of command."

    "According to the script language TCL, you can write the character"-"or -" but neither one of them circled to make it work.

    The ConfigCommand I want to run looks like this:

    "no internet chat script" "internet chat script ' ' ' ATDT * 98 * 2 #" TIMEOUT 60 CONNECT»

    Does anyone have an idea how to solve this problem?

    I'm just stuck with it.

    Kind regards

    Jorn van Riel

    Instead of using IOSConfigCommand, use EmbeddedTCL.  For example:

    ios_config "no chat-script internet" {chat-script internet "" "ATDT*98*2#" TIMEOUT 60 CONNECT}

  • Server uses the character WE8ISO8859P15 (possible character set conversion) set

    Hello
    When EXP in 9i receive:
    Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    Export done in WE8PC850 character set and AL16UTF16 NCHAR character set
    server uses WE8ISO8859P15 character set (possible charset conversion)
    What is the problem?

    Thank you.

    I exported just a table, how to see if it is exported?

    Dear user522961,

    You have not defined or clarification of the environment variable NLS_LANG before trying to run the command export.

    Here's a small illustration;

    *$ echo $NLS_LANG*
    *AMERICAN_AMERICA.WE8ISO8859P9*
    $ exp system/password@opttest file=ogan.dmp owner=OGAN
    
    Export: Release 10.2.0.4.0 - Production on Mon Jul 12 18:10:47 2010
    
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    
    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    *Export done in WE8ISO8859P9 character set and AL16UTF16 NCHAR character set*
    
    About to export specified users ...
    . exporting pre-schema procedural objects and actions
    . exporting foreign function library names for user OGAN
    . exporting PUBLIC type synonyms
    . exporting private type synonyms
    . exporting object type definitions for user OGAN
    About to export OGAN's objects ...
    . exporting database links
    . exporting sequence numbers
    . exporting cluster definitions
    . about to export OGAN's tables via Conventional Path ...
    . exporting synonyms
    . exporting views
    . exporting stored procedures
    . exporting operators
    . exporting referential integrity constraints
    . exporting triggers
    . exporting indextypes
    . exporting bitmap, functional and extensible indexes
    . exporting posttables actions
    . exporting materialized views
    . exporting snapshot logs
    . exporting job queues
    . exporting refresh groups and children
    . exporting dimensions
    . exporting post-schema procedural objects and actions
    . exporting statistics
    Export terminated successfully without warnings.
    
    *$ export NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P15*
    $ exp system/password@opttest file=ogan.dmp owner=OGAN
    
    Export: Release 10.2.0.4.0 - Production on Mon Jul 12 18:12:41 2010
    
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    
    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    *Export done in WE8ISO8859P15 character set and AL16UTF16 NCHAR character set*
    *server uses WE8ISO8859P9 character set (possible charset conversion)*
    
    About to export specified users ...
    . exporting pre-schema procedural objects and actions
    . exporting foreign function library names for user OGAN
    . exporting PUBLIC type synonyms
    . exporting private type synonyms
    . exporting object type definitions for user OGAN
    About to export OGAN's objects ...
    . exporting database links
    . exporting sequence numbers
    . exporting cluster definitions
    . about to export OGAN's tables via Conventional Path ...
    . exporting synonyms
    . exporting views
    . exporting stored procedures
    . exporting operators
    . exporting referential integrity constraints
    . exporting triggers
    . exporting indextypes
    . exporting bitmap, functional and extensible indexes
    . exporting posttables actions
    . exporting materialized views
    . exporting snapshot logs
    . exporting job queues
    . exporting refresh groups and children
    . exporting dimensions
    . exporting post-schema procedural objects and actions
    . exporting statistics
    Export terminated successfully without warnings.
    

    It will be useful,

    Ogan

  • Query of queries (QofQ) escaped character problem

    Hi all

    I am trying to run a query or queires (QofQ) and I do a LIKE comparison which finds support ([]) characters in the string, but ColdFusion ignores the media. How can I escape the character of support? So far, I couldn't escape the percentage based on the Docs sign live ColdFusion. The error message I get when I run the query below is:

    «"" "Invalid escape sequence.»»»" Pairs of valid sequence for this escape character are: "------%", or "\".

    This is the query:
    < cfquery dbtype = "query" name = "getLogs" >
    SELECT *.
    OF GetLogs
    WHERE Description LIKE '\[User:#UserID#\]% %' ESCAPE ' \'
    < / cfquery >

    Thanks for your help!

    What of it?

    WHERE my Description LIKE ' % [[] user: #UserID #] %'

  • Search by prefix in the escape character

    Hello experts,

    I'm using Oracle 11.2.03.  I have a clue of context and I want to be able to precede the generic search on escape characters.

    For example

    Select * from indvl where contains (indvl_nm, {abc} %)

    It only gives me abc and no abcd

    Note :{} charchter are also defined as the character of printjoin for my index

    As far as I know, you cannot combine a sentence with surrounded by {} with wildcard characters escape sequence.  However, you can combine the preface escape characters by------with wildcards.  I'm guessing you're automatically encompassing all with {and}.  I suggest that you not do this and escape individual characters instead.  For more convenience, you can write a function for this.  I presented a demo below with a few characters.  You can expand that to include more characters.  If there are a lot of things that you want to automatically escape, then you might want to use regexp_replace instead of replace it.

    Scott@orcl12c > create table indvl

    2 (indvl_nm varchar2 (30))

    3.

    Table created.

    Scott@orcl12c > insert all

    2 in indvl values ('abc')

    3 in indvl values ("abcd")

    4 in indvl values ('is 3')

    5 Select * of the double

    6.

    3 lines were created.

    Scott@orcl12c > start

    2 ctx_ddl.create_preference ('indvl_lex', 'basic_lexer');

    3 ctx_ddl.set_attribute ('indvl_lex', 'printjoins', ' {} = "");

    4 end;

    5.

    PL/SQL procedure successfully completed.

    Scott@orcl12c > create index indvl_idx

    2 on indvl (indvl_nm)

    3 indextype is ctxsys.context

    4 parameters ("lexer indvl_lex")

    5.

    The index is created.

    Scott@orcl12c > create or replace function format_search

    2 (p_string in varchar2)

    3. return varchar2

    4, as

    5 v_string varchar2 (4000): = p_string;

    6 start

    7 v_string: = replace (v_string, ' {',' \ {'}});

    8 v_string: = replace ({v_string, '} {','------} "");

    9 v_string: = replace (v_string, 'is', ' \ =');

    10 and so on for all other special characters

    11 return v_string;

    12 end format_search;

    13.

    The function is created.

    Scott@orcl12c > display errors

    No errors.

    Scott@orcl12c > select * from indvl where contains (indvl_nm, format_search ('abc %')) > 0))

    2.

    INDVL_NM

    ------------------------------

    ABC

    ABCD

    2 selected lines.

    Scott@orcl12c > select * from indvl where contains (indvl_nm, format_search ('== %')) > 0))

    2.

    INDVL_NM

    ------------------------------

    is 3

    1 selected line.

  • How to use the character (%) wild for php/DW research?

    I am trying to create a search engine that searches in the database to print documents on the basis of several criteria defined by the user.

    DW uses sprintf() to compile the MySQL query.

    I have my attempts to find a portion of a string that should come back to something like -'% xyz %' to give results like "xyzabc abc'"

    But as sprintf uses %s defined by the user to take the values of '%' is a special character.

    I tried to use: % s %%, / % s/%, \%%s\%, but nothing works. There is no error, but the php page opens not at runtime.

    How to find a sub string in the database using the query written in php using sprintf?

    All Solutions?

    pp140 wrote:

    I am trying to create a search engine that searches in the database to print documents on the basis of several criteria defined by the user.

    DW uses sprintf() to compile the MySQL query.

    I have my attempts to find a portion of a string that should come back to something like -'% xyz %' to give results likexyabc abc'

    As you have discovered, sprintf() using %s as a placeholder for the string. The % wild card must be in your channel. It is an example of my book for Dreamweaver CS4:

    $query_getAuthors = sprintf("SELECT first_name, family_name FROM authors  WHERE first_name LIKE %s OR family_name LIKE %s ORDER BY family_name ASC",     GetSQLValueString("%" . $colname_getAuthors . "%", "text"),     GetSQLValueString("%" . $colname2_getAuthors . "%", "text"));
    

    Two instances of %s in the sprintf() function are replaced by the values passed to GetSQLValueString(). In both cases, the wildcard character is concatenated to the variable passed as the first argument of GetSQLValueString().

  • Add e-mail aliases using the character '+' is not allowed

    I am trying to add an alias to my gmail account. Using the normal e-mail account to send and receive works fine.

    I've read and tested this post on gmail you can use '+' followed by a string in your e-mail address to facilitate filtering, explains: http://gmailblog.blogspot.nl/2008/03/2-hidden-ways-to-get-more-from-your.html

    Now, I want to also add a variant of my e-mail with a character '+' in it as an alias for I can use it as a ' answer to ", but thunderbird doesn't let me because he thinks that it is an invalid e-mail address. As noted in the article is not an illegal address, and I can confirm receipt e-mail on this topic.

    Tools (alt menu
    + (T) > account settings
    Click on the name of the account and click on identity management.
    Select Add

    Insert the e-mail to use, as well as name, address etc.
    Save it.
    Select it in the window of writing. That's all there is to it.

    Maybe you used a comma instead of a period in the address. I have this all the time.

  • How to make a star of five strong points by using the character map?

    I can't get a solid star of five points of the "character map". I tried all the fonts that have a star, and when I paste, I get a different, but no star character. I tried the system, to get the characters using the 'ALT KEY' and the numeric keypad on the right side of the keyboard, but, here again, when I type the code for a solid Star (9733 in the list that I got on the internet) a different character appears. I have Vista and use Firefox. I tried to use 'IE' but still have the same problem. Any suggestion will be highly appreciated. Thank you

    Hello Cor - el, I thank you for your help. I used some of your information, and after going to different websites, I found one that had a small application that allows me to insert the star.
    Best regards, Dave

  • QML Javascript escape character

    I am trying to use a regular expression in javascript in a QML file function, as follows:

    function parseAndHandleHyperlinks(inString)
    {
        result = inString.replace(\[.*\]\(.*\)/g, "");
        return result;
    }
    

    Each backslash is stressed and has the following error: "mismatched of entry"------"expected LF.

    The backslashes are used to escape their characters, so I can match the literals [,], (en)

    p.s. the function does nothing, just trying to make QML accept my regular expression at the present time.

    That doesn't look like a regular expression valid in JavaScript. You're not missing a leader / (slash) to go with the final just before the 'g '?

  • Add numbers of sequential endnote using a character style

    Hello

    I wonder if anyone knows of a script that could insert numbers of endnote sequentially to each instance of a character style.

    Our editing process, we use 'hard' note numbers that are based on numbers of items of the text. When the editing process is finished, we go through and manually change the sequential numbers. The endnote numbers have a special character style, so such a script would go to the first instance of this style of character, replace the characters by '1', then go to the next occurrence of the character style and replace the characters by '2' and so on.

    Any help would be appreciated.

    Alicia Dole

    A standard operation. In the third line, replace "number of hard endnote" with the name of the character style that you use for notes end.

    app.findGrepPreferences = null;
    app.findGrepPreferences.findWhat = '\\d+';
    app.findGrepPreferences.appliedCharacterStyle = 'Hard endnote number';
    found = app.documents[0].findGrep();
    for (i = found.length-1; i >= 0; i--) {
      found[i].contents = String (i+1);
    }
    

    Peter

Maybe you are looking for