Insert Text Literal and Concatenation in Oracle SQL Vložte text Literal a zreťazenie v Oracle SQL

In Oracle, it's possible to insert literal or concatenate 2 or more charater strings or SQL result output together. V Oracle, je možné vložiť doslovnom alebo spájať 2 a viac charater reťazcov alebo SQL výsledok výstup spoločne. This manipulation allows you to manipulate the format of data returned by SQL query. Táto manipulácia umožňuje manipulovať s formátom dát vrátených SQL dotazu.

Two solid vertical bar || operator is used to concatenate 2 or more strings. Dve pevná zvislá čiara | | operátor sa používa na spájať 2 alebo viac reťazcov. Beside, Oracle also provides the CONCAT character function as an alternative to the vertical bar operator just in case there is situation where it is difficult or impossible to control translation performed by operating system or network utilities. U, Oracle taktiež charakter CONCAT fungovať ako alternatíva ku zvislej prevádzkovateľ baru len v prípade, že situácia, kedy je ťažké alebo nemožné kontrolovať preklady realizované podľa operačného systému alebo siete verejnej služby. This function should be used in applications that will be moved between environments with differing character sets. Táto funkcia by mala byť použitá v aplikáciách, ktoré sa bude pohybovať medzi prostrediach s rôznymi znakovej sady.

Oracle will automatically casts values into types which can be concatenated. Oracle bude automaticky vrhá hodnoty, na druhy, ktoré môžu byť dlhých. As Oracle interprets NULL as the empty (zero-length) character string, it doesn't return NULL if an operand is NULL, meaning concatenating a zero-length character string with another operand always results in the other operand, so null can result only from the concatenation of two null strings. Ako Oracle NULL interpretuje ako prázdne (nula-dĺžka) reťazec znakov, nevráti NULL, ak operand je NULL, znamená zřetězování nula-dĺžka reťazca znakov iným operandov vždy výsledky v druhej operand, takže môže dôjsť iba null od zreťazenie dvoch reťazcov null. To concatenate an expression that might be null, use the NVL function to explicitly convert the expression to a zero-length string. Ak chcete spájať výraz, ktorý by mohol byť Null, použite funkciu NVL explicitne previesť výraz-nulovej dĺžky reťazca.

Concatenating two strings results in another character string. Zřetězování dva reťazce výsledky v inom reťazci znakov. If both character strings are of datatype CHAR, the result has datatype CHAR and is limited to 2000 characters. Ak sú oba reťazce znakov sú Datatyp CHAR, výsledok je dátový typ CHAR, a je obmedzená na 2000 znakov. If either string is of datatype VARCHAR2, the result has datatype VARCHAR2 and is limited to 4000 characters. Ak je niektorý reťazec je Datatyp VARCHAR2, výsledok je dátový typ VARCHAR2, a je obmedzená na 4000 znakov. Trailing blanks in character strings are preserved by concatenation, regardless of the strings' datatypes. Nasledujúcim nulami v reťazca znakov sú chránené zreťazenie, bez ohľadu na dátové typy reťazcov '.

For literal insertion, put the strings between the single quote ' in the SQL statement. Pre vloženie doslovný, dal reťazca medzi jednoduché úvodzovky 'v príkazu SQL.

Example and Usage : Príklad a použitie:

SELECT 'Name is ' || name FROM table; SELECT 'Meno je' | | jmeno FROM tabulka;

Name is whatever_name Meno je whatever_name

SELECT number || ' – ' || description FROM table ORDER BY number SELECT číslo | | '-' | | opis FROM tabulka ORDER BY číslo

1 – description 1 1 - opis 1
2 – description 2 2 - opis 2

Advance Usage : Advance Použitie:

It's possible to use Concatenation and Literal Insertion to generate a set of SQL query language automatically, especially when need to perform same operation to lots of tables, ie dropping a lot of tables. Je možné použiť zreťazenie a Literal vloženia vytvoriť súbor SQL dotazu jazyk automaticky, zvlášť keď potrebujete vykonať rovnakú operáciu na mnoho tabuliek, tj zvrhnutie veľa tabuliek. To do this, format the SQL data query language to output the query result in valid SQL format, and spool the SQL query results to a file. K tomu, formát dát SQL dopytovací jazyk pre výstup výsledku dotazu v platnom formáte SQL a spool SQL dotazu výsledky do súboru. Then execute the file that contains SQL statements. Potom spustiť súbor, ktorý obsahuje SQL príkazy.

Example: Príklad:

SELECT 'DROP TYPE ' || type_name || ';' SELECT 'DROP TYPE' | | type_name | | ','

will generates: sa vytvára:

DROP TYPE type_name DROP TYP type_name

that can be run at SQL*Plus by calling the file with @filename. , Ktoré možno spustiť v SQL * Plus volaním súbor @ filename. All types that been selected from first SQL statements will be dropped from the database. Všetky druhy, ktoré boli vybrané z prvého príkazov SQL budú vypustené z databázy.

IMPORTANT : The page is machine translated and provided "as is" without warranty. Upozornenie: stránka je stroje preložené a za predpokladu, "ako je" bez záruky. Machine translation may be difficult to understand. Strojový preklad môže byť ťažké pochopiť. Please refer to Nájdete na original English article originál Anglicky artikl whenever possible. ak je to možné.


One Response to “Insert Text Literal and Concatenation in Oracle SQL” Jedna reakcia na "Vložiť text Literal a zreťazenie v Oracle SQL"

  1. Arun Arun
    March 2nd, 2007 21:57 2.března 2007 21:57
    1 1

    Good article. Dobrý článok. Got what I was looking for… Dostal to, čo som hľadal ...

Leave a Reply Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> Môžete použiť tieto značky: href = "" <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime = ""> <em> <i> <q cite=""> <strike> <strong>

Subscribe to comments feature has been disabled. Prihlásiť sa k pripomienkam funkcia bola zakázaná. To receive notification of latest comments posted, subscribe to Ak chcete dostávať oznámenia o najnovšie komentáre vyslaný, prihláste sa My Digital Life Comments RSS feed Má Digital Life Komentáre RSS or alebo register to receive zaregistrovať na new comments in daily email digest. nové komentáre v dennom email Digest.
Custom Search

New Articles Nové články

Incoming Search Terms for the Article Vcházející Hľadať Čas do člen určitý Artikel

oracle concatenation veštba zreťazenie - -- sqlplus concatenate string sqlplus spájať string - -- oracle sql concatenate Oracle SQL spájať - -- adding literals to sql query pridanie literály k SQL dotazu - -- sql literal sql doslovný - -- concatenate in oracle query spájať v veštba dotazu - -- how to concatenate in oracle sql ako sa spájať v Oracle SQL - -- oracle sql insert string Oracle SQL insert string - -- oracle sql literal Oracle SQL doslovný - -- "inserting text containing ' in oracle" "vkladanie textu obsahujúce 'v veštba" - -- oracle query concatenate veštba dotaz spájať - -- oracle text concatenation Oracle Text zreťazenie - -- sqlplus concat sqlplus concat - -- oracle select literal veštba vybrať doslovný - -- ARM concatenate strings ARM spájať reťazce - -- concatenate oracle 1 character from column with 7 characters from another column spájať veštba 1 znak zo stĺpca so 7 znakov z iného stĺpca - -- concaténation de chaine oracle Spájanie de Chaine veštba - -- concat empty string in oracle concat prázdny reťazec v Oracle - -- literal oracle doslovný veštba - -- oracle concat string query veštba concat string query - -- oracle literal quotes veštba doslovné citácie - -- oracle insérer concatener veštba insérer concatener - -- oracle concat if null veštba concat ak null - -- oracle sqlplus concat veštba sqlplus concat - -- oracle query concat veštba dotaz concat - -- oracle select string literal veštba vybrať řetězcový literal - -- select oracle concatenieren vyberte veštba concatenieren - -- SQL Orace JOIN WITH string manipulation SQL Orac spojiť sa s manipulácie s reťazcami - -- sql oracle concatenate character sql veštba spájať znak - -- sql insert text sql insert text - -- sql literals sql literály - -- string concat in Oracle SQL query string concat v Oracle SQL dotaze - -- string concatenation in oracle zreťazenie v Oracle - -- +Oracle +SQL +concatenation + Oracle + SQL + zreťazenie - -- ARM concat strings ARM concat struny - -- COLUMNAS LITERALES ORACLE Columnas LITERALES ORACLE - -- concating string in oracle query concating reťazec dotazu v Oracle - -- concatenation in oracle query zreťazenie v veštba dotazu - -- concat string + oracle string concat + oracle - -- concatenation with blank problem+oracle zreťazenie s prázdnou problém + oracle - -- concatener texte oracle concatener texte veštba - -- Concatenating two oracle select statements Zřetězování dva veštba vybrať výkazy - -- function Funkcia - -- how to write the query concatenation in oracle 9i ako napísať dotaz zreťazenie v Oracle 9i - -- how to insert text in sql query ako vložiť text v SQL dotaze - -- how isert text data sql ako Isert textové dáta sql - -- oracle literal veštba doslovný - -- oracle sql select combine Oracle SQL vybrať kombinovať - -- oracle concat in query oracle concat v dotaze - -- oracle text in sql results oracle text v SQL výsledky - --