Insert Text Literal and Concatenation in Oracle SQL Ievietot teksta gramatisko un konkatenācija ar Oracle SQL

In Oracle, it's possible to insert literal or concatenate 2 or more charater strings or SQL result output together. Oracle, ir iespējams ievietot gramatisko vai saķēdēt 2 vai vairāk charater virknes vai SQL rezultāts izejas kopā. This manipulation allows you to manipulate the format of data returned by SQL query. Šajā manipulācijā ļauj manipulēt formātu datiem, ko SQL vaicājumu.

Two solid vertical bar || operator is used to concatenate 2 or more strings. Divi cietu vertikāla josla | | operators izmanto saķēdēt 2 vai vairāk stīgas. 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. Blakus Oracle nodrošina arī CONCAT raksturs kalpo kā alternatīva vertikāla josla operators tikai gadījumā, ja ir situācija, kad ir grūti vai neiespējami kontrolēt tulkojumu, ko veic operētājsistēmā vai tīklā kom. This function should be used in applications that will be moved between environments with differing character sets. Šī funkcija jāizmanto pieteikumi, kas tiks pārvietotas starp vidi ar atšķirīgu rakstzīmju kopu.

Oracle will automatically casts values into types which can be concatenated. Oracle automātiski rada vērtības pēc to tipiem, kurus var saliktās. 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. Kā Oracle interpretē NULL kā tukšā (nulles garumu) rakstzīmju virkne, tas neatgriež NULL ja operands ir NULL, kas nozīmē concatenating nulles garuma rakstzīmju virkne ar citu operands vienmēr rezultātiem citās operands, lai null var rasties tikai no konkatenācija diviem null stīgas. To concatenate an expression that might be null, use the NVL function to explicitly convert the expression to a zero-length string. Lai saķēdēt izteiksme, kas varētu būt spēkā, izmantot NVL funkcijas skaidri konvertētu izteiksmi uz nulles garuma virkni.

Concatenating two strings results in another character string. Concatenating divas virknes rezultātā citu rakstzīmju virkni. If both character strings are of datatype CHAR, the result has datatype CHAR and is limited to 2000 characters. Ja abas rakstzīmju virknes ir datatype CHAR, rezultāts datatype CHAR un ir ierobežots līdz 2000 rakstzīmēm. If either string is of datatype VARCHAR2, the result has datatype VARCHAR2 and is limited to 4000 characters. Ja kāds no virknes ir datatype VARCHAR2, rezultāts datatype VARCHAR2 un ir ierobežots līdz 4000 rakstzīmēm. Trailing blanks in character strings are preserved by concatenation, regardless of the strings' datatypes. Trailing sagataves raksturs, stīgas konservēti konkatenācija neatkarīgi no virknes "datatypes.

For literal insertion, put the strings between the single quote ' in the SQL statement. Par gramatisko ievietošanas, ielieciet virknes starp vienu citātu ", kas SQL.

Example and Usage : Piemērs un Usage:

SELECT 'Name is ' || name FROM table; SELECT "nosaukums ir" | | name FROM table;

Name is whatever_name Nosaukums ir whatever_name

SELECT number || ' – ' || description FROM table ORDER BY number SELECT numurs | | '-' | | Apraksts FROM tabula ORDER BY numurs

1 – description 1 1 - apraksts 1
2 – description 2 2 - apraksts 2

Advance Usage : Advance Usage:

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. Ir iespēja izmantot konkatenācija un gramatisko ievietošana radīt kopumu SQL vaicājumu valodas automātiski, jo īpaši, ja vajadzēs veikt pašu darbību daudz tabulas, ti, krītot daudz tabulas. 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. Lai to izdarītu, formāts SQL vaicājumu valodu izvades vaicājumu rezultātu derīgu SQL formātā, un tītavas SQL vaicājuma rezultātus failā. Then execute the file that contains SQL statements. Tad izpildīt fails, kas satur SQL.

Example: Piemērs:

SELECT 'DROP TYPE ' || type_name || ';' Izvēlieties 'DROP TYPE' | | type_name | | '; "

will generates: būs rada:

DROP TYPE type_name DROP TYPE type_name

that can be run at SQL*Plus by calling the file with @filename. ka var palaist SQL * Plus, zvanot ar failu @ filename. All types that been selected from first SQL statements will be dropped from the database. Visi veidi, kas ir izvēlēta no pirmā SQL būs samazinājies no datu bāzes.

IMPORTANT : The page is machine translated and provided "as is" without warranty. SVARĪGI: lapa mašīna iztulkot un pasniegts tàds, "kàds tas ir" bez garantijas. Machine translation may be difficult to understand. Mašīntulkošanas var būt grūti saprast. Please refer to Lūdzu, skatiet original English article oriģināls angļu rakstu whenever possible. kad vien iespējams.


One Response to “Insert Text Literal and Concatenation in Oracle SQL” One Response to "Ievietot teksta gramatisko un konkatenācija ar Oracle SQL"

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

    Good article. Labs raksts. Got what I was looking for… Dabūja to, ko es meklēju ...

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> Jūs varat izmantot šos tagus: <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. Parakstīties uz komentāriem iezīme ir atspējota. To receive notification of latest comments posted, subscribe to Saņemt informāciju par jaunāko komentārus, parakstīties uz My Digital Life Comments RSS feed Mana Digital Life Comments RSS feed or vai register to receive reģistrēties, lai saņemtu new comments in daily email digest. jauni komentāri ikdienas e-pasta sagremot.
Custom Search

New Articles Jauns pants

Incoming Search Terms for the Article Ienākošo Meklēt noteikumi pants

oracle concatenation Oracle konkatenācija - -- sqlplus concatenate string sqlplus saķēdēt string - -- oracle sql concatenate Oracle sql saķēdēt - -- adding literals to sql query pievienot literals to sql query - -- sql literal sql burtisks - -- concatenate in oracle query saķēdēt in Oracle query - -- how to concatenate in oracle sql kā saķēdēt no Oracle sql - -- oracle sql insert string Oracle sql ievietot string - -- oracle sql literal Oracle sql burtisks - -- "inserting text containing ' in oracle" "ievietojot tekstu, kurās" Oracle " - -- oracle query concatenate Oracle query saķēdēt - -- oracle text concatenation Oracle teksts konkatenācija - -- sqlplus concat sqlplus concat - -- oracle select literal Oracle izvēlieties burtisks - -- ARM concatenate strings ARM saķēdēt strings - -- concatenate oracle 1 character from column with 7 characters from another column saķēdēt Oracle 1 rakstzīmi no kolonnas ar 7 burtiem no citas kolonnas - -- concaténation de chaine oracle konkatenācija de Chaine Oracle - -- concat empty string in oracle concat tukšs string in Oracle - -- literal oracle burtisks Oracle - -- oracle concat string query Oracle concat string query - -- oracle literal quotes Oracle burtisks quotes - -- oracle insérer concatener Oracle insérer concatener - -- oracle concat if null Oracle concat ja null - -- oracle sqlplus concat Oracle sqlplus concat - -- oracle query concat Oracle query concat - -- oracle select string literal Oracle izvēlieties string burtisks - -- select oracle concatenieren Izvēlieties Oracle concatenieren - -- SQL Orace JOIN WITH string manipulation SQL Orace pievienoties string manipulācijas - -- sql oracle concatenate character SQL Oracle saķēdēt raksturs - -- sql insert text sql ievietotu tekstu - -- sql literals sql literals - -- string concat in Oracle SQL query string concat in Oracle SQL query - -- string concatenation in oracle string konkatenācija no Oracle - -- +Oracle +SQL +concatenation + Oracle + SQL + konkatenācija - -- ARM concat strings ARM concat strings - -- COLUMNAS LITERALES ORACLE Columnas LITERALES ORACLE - -- concating string in oracle query concating string in Oracle query - -- concatenation in oracle query konkatenācija no Oracle query - -- concat string + oracle concat string + Oracle - -- concatenation with blank problem+oracle konkatenācija ar tukšu problēmu + Oracle - -- concatener texte oracle concatener texte Oracle - -- Concatenating two oracle select statements Concatenating divas Oracle SELECT - -- function funkcija - -- how to write the query concatenation in oracle 9i kā uzrakstīt vaicājumu konkatenācijas in 9i Oracle - -- how to insert text in sql query kā ievietot tekstu sql query - -- how isert text data sql kā isert teksta datus sql - -- oracle literal Oracle burtisks - -- oracle sql select combine Oracle SQL Select apvienot - -- oracle concat in query Oracle concat in query - -- oracle text in sql results Oracle tekstu sql rezultāti - --