Insert Text Literal and Concatenation in Oracle SQL Lisää tekstin kirjaimellinen ja ketju on Oracle SQL

In Oracle, it’s possible to insert literal or concatenate 2 or more charater strings or SQL result output together. Vuonna Oracle, on mahdollista lisätä kirjaimellinen tai yhdistää 2 tai enemmän charater merkkijonoja tai SQL seurauksena tuotanto yhdessä. This manipulation allows you to manipulate the format of data returned by SQL query. Tämä manipulointi voit manipuloida muodossa tiedot palautetaan SQL-kyselyn.

Two solid vertical bar || operator is used to concatenate 2 or more strings. Kaksi kiinteää pystypalkki | | toimija on käytetty peräkkäin 2 tai useampia merkkijonoja. 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. Vieressä, Oracle tarjoaa myös CONCAT merkki toimia vaihtoehtona on pystypalkki toimija vain, jos on tilanteessa, jossa se on vaikeaa tai mahdotonta valvoa käännös suorittaa käyttöjärjestelmän tai verkon palveluja. This function should be used in applications that will be moved between environments with differing character sets. Tätä toimintoa tulisi käyttää sovelluksia, jotka on siirretty välillä ympäristöissä eri merkistöä.

Oracle will automatically casts values into types which can be concatenated. Oracle automaattisesti heittää arvot tyyppeihin, jotka voidaan concatenated. 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. Koska Oracle tulkitsee NULL kuin tyhjä (nolla-pituus) merkkiä pitkä merkkijono, se ei palauta NULL, jos operandi on NULL, mikä tarkoittaa concatenating nolla-pituus merkin merkkijonon toisen operandin aina tuloksia muiden operandin, joten null voi johtaa vain alkaen ketju kahden null jousille. To concatenate an expression that might be null, use the NVL function to explicitly convert the expression to a zero-length string. Voit yhdistää ilmaus, joka saattaa olla mitätön, käytä NVL-toiminto, joka nimenomaan muuntaa ilmauksen nolla-pituus merkkijono.

Concatenating two strings results in another character string. Concatenating kaksi jousille tuloksia toisen merkin merkkijono. If both character strings are of datatype CHAR, the result has datatype CHAR and is limited to 2000 characters. Jos molemmat luonteeltaan jouset ovat tietotyyppi CHAR, tulos on tietotyyppi CHAR ja on enintään 2000 merkkiä. If either string is of datatype VARCHAR2, the result has datatype VARCHAR2 and is limited to 4000 characters. Jos jompikumpi merkkijono on tietotyyppi VARCHAR2, tulos on tietotyyppi VARCHAR2 ja on enintään 4000 merkkiä. Trailing blanks in character strings are preserved by concatenation, regardless of the strings’ datatypes. Tyhjämerkillä luonteeltaan jouset ovat säilötyt ketju, riippumatta siitä, jousille "tietotyypit.

For literal insertion, put the strings between the single quote ‘ in the SQL statement. Saat kirjaimellisesti sijoittelua, laita jousten välinen tarjouksen ", koska SQL-lauseke.

Example and Usage : Esimerkki Käyttöaiheet:

SELECT ‘Name is ‘ || name FROM table; Valitse nimi on '| | nimi taulukosta;

Name is whatever_name Nimi on whatever_name

SELECT number || ‘ - ‘ || description FROM table ORDER BY number SELECT numero | | '-' | | Kuvaus taulukosta ORDER BY-numero

1 - description 1 1 - kuvaus 1
2 - description 2 2 - kuvaus 2

Advance Usage : Advance Käyttö:

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. On mahdollista käyttää Ketjutus ja kirjaimellinen Sijoittelu tuottaa joukon SQL-kyselyn kieli automaattisesti, erityisesti silloin, kun tarve suorittaa saman operaation paljon taulukoita, eli pudottamalla paljon taulukoita. 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. Voit tehdä tämän, muoto SQL tiedot kyselyn kieli tuotos kyselyn tulos on voimassa SQL-muodossa, ja kela SQL-kyselyn tulokset tiedostoon. Then execute the file that contains SQL statements. Sitten suorita tiedoston, joka sisältää SQL-lauseet.

Example: Esimerkki:

SELECT ‘DROP TYPE ‘ || type_name || ‘;’ Valitse 'DROP TYPE' | | type_name | | ";"

will generates: tulee tuottaa:

DROP TYPE type_name DROP TYYPPI type_name

that can be run at SQL*Plus by calling the file with @filename. joka voidaan suorittaa milloin SQL * Plus soittamalla tiedosto @ tiedostonimi. All types that been selected from first SQL statements will be dropped from the database. Kaikki tyypit, jotka on valittu ensimmäisen SQL-lauseet on poistettu tietokannasta.

IMPORTANT : This is a machine translated page which is provided "as is" without warranty. TÄRKEÄÄ: Tämä on koneellisesti käännetty sivu, joka tarjotaan "sellaisenaan" ilman takuu. Machine translation may be difficult to understand. Machine translation voi olla vaikea ymmärtää. Please refer to Tutustu original English article alkuperäinen Englanti artikkeli whenever possible. aina kun mahdollista.

Share and contribute or get technical support and help at Osake ja edistää tai saada teknistä tukea ja apua My Digital Life Forums My Digital Life-foorumit .



One Response to “Insert Text Literal and Concatenation in Oracle SQL” Yksi vastaus "Lisää teksti kirjaimellinen ja Ketjutus in Oracle SQL"

  1. Arun
    March 2nd, 2007 21:57 2 maaliskuu, 2007 21:57
    1

    Good article. Hyvä artikkeli. Got what I was looking for… Sain mitä olin etsit ...

Leave a Reply Jätä vastaus

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> Voit käyttää näitä koodeja: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del Datetime = ""> <em> <i> <q Cite=""> <strike> <strong>

Subscribe to comments feature has been disabled. Tilaa kommentit ominaisuus on poistettu käytöstä. To receive notification of latest comments posted, subscribe to Jos haluat saada ilmoituksen Uusimmat kommentit lähetetty, tilata My Digital Life Comments RSS feed My Digital Life kommentit RSS-syöte or tai register to receive rekisteri ottaa vastaan new comments in daily email digest. uusia kommentteja päivittäin emaildigest.
Custom Search

New Articles Uudet artikkelit

Incoming Search Terms for the Article Saapuvat Search Terms oleva artikla

oracle concatenation oraakkeli ketju - -- concat char oracle concat char oraakkeli - -- concatenation in oracle sql ketju on oraakkeli sql - -- concat integer with string in sql oracle concat kokonaisluku kanssa merkkijono sql-oracle - -- concatenate strings with select in oracle peräkkäin merkkijonon valita oraakkeli - -- last character from sql string in oracle viimeinen merkki sql merkkijono oraakkeli - -- oracle insert oraakkeli lisätä - -- oracle concat string oraakkeli concat merkkijono - -- oracle concatenate sql string then execute oraakkeli peräkkäin sql merkkijono sitten suorittaa - -- oracle select statement concatenate strings oraakkeli valitse julkilausuma peräkkäin jouset - -- oracle sql escape translate Oracle SQL paeta kääntää - -- sql select literal example sql valitse kirjaimellinen esimerkki - -- sql literal sql kirjaimellinen - -- SQL SELECT literal SQL SELECT kirjaimellinen - -- string concatenation in sql string ketju on sql - -- string concatenation on an insert string ketju, joka lisätään - --