How to Escape Characters in Oracle PL/SQL Queries Ako Escape Postavy v Oracle PL / SQL dotazov
Oracle databases reserve some special characters with specific meaning and purpose within Oracle environment. Oracle databáz rezervy niektoré špeciálne znaky s konkrétny zmysel a účel v prostredí Oracle. These reserved characters include _ (underscore) wild card character which used to match exactly one character, % (percentage) which used to match zero or more occurrences of any characters and ' (apostrophe or quotation mark) which used to mark the value supplied. Tieto znaky sú vyhradené _ (podčiarkovník) divoká karta charakteru, ktoré používa, aby zodpovedali presne jeden znak% (percento), ktoré používa k zápasu nula alebo viac výskytov libovolné znaky a '(apostrof alebo úvodzovky), ktorý používa pre označenie hodnoty dodáva. These special characters will not be interpreted literally when building SQL query in Oracle, and may caused error in results returned especially when performing string search with LIKE keyword. Tieto špeciálne znaky nebude vykladať doslovne pri budovaní SQL dotazu v Oracle, a spôsobil chybu vo výsledkoch vrátené predovšetkým pri vykonávaní reťazec s PODOBNÝ hľadanie kľúčových slov. To use these characters so that Oracle can interpret them literally as a part of string value instead of preset mean, escape character has to be assigned. Ak chcete používať tieto znaky tak, že Oracle môže vykladať doslovne ako súčasť hodnotu reťazca namiesto predvolenú znamenalo únik charakter má byť priradená.
Oracle allows the assignment of special escape characters to the reserved characters in Oracle can be escaped to normal characters that is interpreted literally, by using ESCAPE keyword. Oracle umožňuje priradenie špeciálne riadiace znaky na vyhradených znakov v Oracle možno unikol do normálne znaky, ktoré je vykladané doslovne, ESCAPE pomocou kľúčových slov.
For example, to select the name of guests with _ (underscore) in it, use the following statement: Napríklad pre zvolenie mená hostí s _ (podčiarkovník) na to, použite nasledujúce vyhlásenie:
SELECT guest_name FROM guest_table WHERE name LIKE '%\_%' ESCAPE '\'; SELECT guest_name OD guest_table KDE meno PODOBNÝ '% \ _%' ESCAPE '\';
Without specifying the \ (backslash) as escape clause, the query will return all guest names, making the unwanted results problem. Bez uvedenia \ (spätné lomítko) ako únikovú doložku, dotaz vráti mená všetkých hostí, čo je neželané výsledky problém.
The above syntax will not work on ' (quote). Vyššie uvedená syntaxe nefunguje na '(citát). To escape this quotation mark and to display the quote literally in string, insert another quote (total 2 quotes) for every quote that want to be displayed. Ak chcete uniknúť túto úvodzovky a na displeji sa citovať doslova v reťazci, vložte inú ponuku (celkom 2 uvodzovky) za každú ponuku, že chcú byť zobrazené. For example: Napríklad:
SELECT 'This will display line with quote''s word.' SELECT 'To bude zobrazovať s quote' to slovo '. FROM temp_table; Z temp_table;
SELECT 'This will display ””double quoted”” word.' SELECT 'To bude zobrazovať "" double citovaný "" Slovo'. FROM temp_table; Z temp_table;
will return the following respectively: vráti nasledujúce poradie:
This will display line with quote's word. To sa zobrazí riadok s citátom slovo.
This will display ”double quoted” word. To bude zobrazovať "double citovaný" slovo.
IMPORTANT : The page is machine translated and provided "as is" without warranty. Upozornenie: Stránka je stroje preložené a poskytované "tak ako sú" bez záruky. Machine translation may be difficult to understand. Strojový preklad môže byť ťažké pochopiť. Please refer to Obráťte sa prosím na original English article Anglický originál článku whenever possible. kedykoľvek je to možné.
Related Articles Súvisiace články
- Insert Text Literal and Concatenation in Oracle SQL Vložiť Text doslovný a spojenia v Oracle SQL
- Using Character Map (charmap) to Type and Input Special Characters and Accents in Windows Vista Použitie mapy znakov (charmap) na druh a vstupné špeciálne znaky a diakritické znamienka vo Windows Vista
- Oracle EXP-00091 Error When Export Database Oracle EXP-00091 chybu pri exporte databázy
- Check Oracle Version Skontrolujte, Oracle Version
- Remove or Trim First or Last Few Characters in MySQL Database with SQL Odstráňte alebo Trim Prvý alebo pár znakov v MySQL databáze pomocou SQL
- Firefox 3.1 Beta Smart Location Bar Enhancement: Special Characters to Restrict Searching & Smart Keyword to Search from Specific Website Firefox 3.1 Beta Smart Miesto Bar zdokonalenie: Špeciálne znaky Obmedziť Vyhľadávanie & Smart na vyhľadávanie kľúčových slov z určitých webových stránok
- Change Oracle Database User Password Zmeniť Oracle Database Užívateľ Heslo
- IMP-00016 Required Character Set Conversion Not Supported Error when Import to Oracle Database IMP-00016 Vyžadováno Character Set Konverzný Nie Podporované Chyba pri importe do Oracle Database
- ORA-01502 Oracle Index in Unusable State ORA-01502 Oracle Obsah v Nepoužiteľné štátu
- You Are Not Authorized to Execute SQL Queries in vBulletin Maintenance Nemáte oprávnenie k výkonu SQL dotazov do vBulletin Údržba










































September 26th, 2008 00:28 26. septembra 2008 00:28
Thank you very much – I'ma SQL Server gent with an Oracle source and I was going nuts! Díky moc - I'ma SQL Server gent s Oracle zdroj a jsem orechy!
September 17th, 2008 20:44 17. septembra 2008 20:44
salut j'ai le mm pb ! Salut j'ai le mm pb! si je fait une recherche sur le '_' seul sa marche mais si v je chercher des mots avec le '_' si je fait une recherche sur le '_' sa marche seul Mais si je v chercher des mots avec le '_'
exmple: exmple:
SELECT * from Test WHERE nom LIKE '1%\_%test' ESCAPE '\'; Select * from test KDE nom OBDOBNÝ'1% \ _% test 'ESCAPE' \ ';
sa me renvoie : sa mi renvoie:
1_test 1_test
10_test ?? 10_test?
or que normalement sa devait rendre que: alebo normalement que sa devait rendre, že:
1_test ?? 1_test?
je comprend pas je comprend pas
July 13th, 2007 19:27 13. júl 2007 19:27
[...] about Escape Characters. [...] O Escape znaky. Escape Characters Oracle Wildcards Wildcard Characters Escape Character How to Escape Characters in Oracle PL/SQL Queries Escape znaky Oracle zástupné zástupných symbolov Escape Charakter Ako Escape Postavy v Oracle PL / SQL dotazov