How to Escape Characters in Oracle PL/SQL Queries Kaip Escape Žmonės Oracle PL / SQL užklausų
Oracle databases reserve some special characters with specific meaning and purpose within Oracle environment. Oracle duomenų bazės rezervą tam tikrų specialių simbolių, turinčių specifinę reikšmę ir paskirtį aplinkos 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. Šie saugomos simbolių įtraukti _ (pabrėžti) laukinių kortelė simbolių, kurie naudojami palyginimui tiksliai vienas ženklas,% (procentais), kurie naudojami palyginimui nulį ar daugiau įvykių, bet simbolių ir "(kabutes ar kabutės), kuris naudojamas ženklo vertė pateikta. 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. Šie specialūs simboliai nebus aiškinama pažodžiui, kai statybos SQL užklausą į "Oracle", ir gali sukelti klaidos rezultatus, ypač atliekant string paieška PANAŠUS raktažodžiu. 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. Norėdami naudoti šiuos simbolius, kad "Oracle" gali interpretuoti juos pažodžiui kaip dalis eilutės reikšmė, o ne iš anksto reiškia, gelbėjimosi pobūdį, turi būti priskirtos.
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 leidžia priskyrimo specialiųjų pabėgti simbolių rezervuoti simboliai ir "Oracle" galima pabėgo į normalius pavadinimus, kad būtų aiškinama pažodžiui, naudojant ESCAPE raktažodžiu.
For example, to select the name of guests with _ (underscore) in it, use the following statement: Pavyzdžiui, norėdami pasirinkti pavadinimą svečiams su _ (pabraukimo) į jį, naudokite tokį pareiškimą:
SELECT guest_name FROM guest_table WHERE name LIKE '%\_%' ESCAPE '\'; PASIRINKITE guest_name IŠ guest_table KUR vardas LIKE '% \ _% "ESCAPE" \ ";
Without specifying the \ (backslash) as escape clause, the query will return all guest names, making the unwanted results problem. Nenurodant \ (backslash) su išlyga, kad prašymas bus grąžinti visus svečių pavadinimų, todėl nepageidaujamas rezultatus problema.
The above syntax will not work on ' (quote). Pirmiau sintaksė nebus darbo "(citata). 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. Norėdami išvengti šios kabutės ir parodyti citata pažodžiui į eilutę, įterpti kitą citata (iš viso 2 kabučių) į kiekvieną pasiūlymą, kad nori būti rodomas. For example: Pavyzdžiui:
SELECT 'This will display line with quote''s word.' PASIRINKITE "Tai bus rodomas atitinka quote' žodis". FROM temp_table; IŠ temp_table;
SELECT 'This will display ””double quoted”” word.' PASIRINKITE "Tai bus rodomas" dvigubo cituojamą "žodis". FROM temp_table; IŠ temp_table;
will return the following respectively: sugrįš taip atitinkamai:
This will display line with quote's word. Rodomas liniją su citata žodis.
This will display ”double quoted” word. Tai bus rodomas "dvigubo cituojamą" žodis.
IMPORTANT : The page is machine translated and provided "as is" without warranty. DĖMESIO: Šis puslapis yra mašina išvertė ir pateikiama "kaip yra" be garantijų. Machine translation may be difficult to understand. Mašininio vertimo, gali būti sunku suprasti. Please refer to Remkitės original English article originalas anglų straipsnis whenever possible. jei įmanoma.
Related Articles Susiję straipsniai
- Insert Text Literal and Concatenation in Oracle SQL Įtraukti Tekstas Literal ir concatenation į Oracle SQL
- Using Character Map (charmap) to Type and Input Special Characters and Accents in Windows Vista Naudojant Rašmenų žemėlapis (charmap) tipo ir įvesties Specialūs simboliai ir akcentai Windows Vista
- Oracle EXP-00091 Error When Export Database "Oracle" Tinka iki-00091 Klaida Eksporto duomenų bazė
- Check Oracle Version Pabandykite Oracle versija
- Remove or Trim First or Last Few Characters in MySQL Database with SQL Šalinti arba TRIMs Pirmasis ar pastaruosius keletą simbolių MySQL duomenų bazę su 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 Vieta Baras didinimas: Specialūs simboliai apriboti paiešką & Smart Raktažodis iki Paieška Specialioji Tinklalapis
- Change Oracle Database User Password Keisti Oracle Vartotojas Slaptažodis
- IMP-00016 Required Character Set Conversion Not Supported Error when Import to Oracle Database IMP-00016 Reikalingos simbolių rinkinys Konversijų nepalaikomas Klaida kai Importo Oracle duomenų bazė
- ORA-01502 Oracle Index in Unusable State ORA-01502 Oracle indeksas Nenaudojamos narė
- You Are Not Authorized to Execute SQL Queries in vBulletin Maintenance Jums neleidžiama vykdyti SQL užklausų pagal vBulletin priežiūra










































September 26th, 2008 00:28 Rugsėjis 26, 2008 00:28
Thank you very much – I'ma SQL Server gent with an Oracle source and I was going nuts! Thank you very much - Aš SQL Server džentelmenas su Oracle šaltinis ir aš vyko riešutų!
September 17th, 2008 20:44 Rugsėjis 17, 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 "_" seul sa marche mais si prieš je chercher des mots avec le "_"
exmple: exmple:
SELECT * from Test WHERE nom LIKE '1%\_%test' ESCAPE '\'; SELECT * nuo bandymų KUR nom PANAŠUS 1% \ _% bandymo "ESCAPE" \ ";
sa me renvoie : sa man renvoie:
1_test 1_test
10_test ?? 10_test?
or que normalement sa devait rendre que: arba que Normalement sa devait rendre que:
1_test ?? 1_test?
je comprend pas je comprend pas
July 13th, 2007 19:27 13 liepa 2007 19:27
[...] about Escape Characters. [...] Apie Escape simbolių. Escape Characters Oracle Wildcards Wildcard Characters Escape Character How to Escape Characters in Oracle PL/SQL Queries Escape ženklai Oracle Pakaitos simboliai Escape Rašmenų Kaip Escape Žmonės Oracle PL / SQL užklausų