This winter holiday season, give a precious gift to your career by upgrading your skills. | Get Flat 15 - 20% OFF on All Courses | Save Today

[iqquestion id=27]

4 thoughts on “Database : Database Operations Discussion 8

  • nasir

    % wildcard SELECT * FROM Customers WHERE City LIKE ‘ber%’;
    _ wildcard SELECT * FROM Customers WHERE City LIKE ‘_erlin’;
    [ ] wildcard SELECT * FROM Customers WHERE City LIKE ‘[bsp]%’;

  • Palwinder

    Databases often treat % and _ as wildcard characters. In pattern-match queries in the SQL repository (such as CONTAINS, STARTS WITH, or ENDS WITH), we assume that a query that includes % or _ was intended as a literal search including those characters, and was not intended to include wildcard characters. The query generated therefore uses an escape character in front of the characters % and _ in pattern-match queries. An exception is where we use a pattern-match query to simulate a text search query, since in that case we want to allow wildcards to be passed through.

    You can disable this behavior by setting the escapeWildcards property of the SQL repository component to false.

    The escape character is \ (backslash) by default. You can set a different escape character using the wildcardEscapeCharacter property of the SQL repository component.

  • Olubunmi Ogunsola

    % means that it replaces letters when doing a SELECT command. For example MON% means that it will produce any word containing MON as the first three letters.
    _ this is just to substitute for a single letter
    [] this sets and ranges characters to match, so if I had [NGH] it would produce any variable that I’ve chosen starting with an N, G, or H
    – Tomiwa

  • sivi ramesh

    % A substitute for zero or more characters
    _ A substitute for a single character
    [charlist] Sets and ranges of characters to match

Leave a Reply