Insert Text Literal and Concatenation in Oracle SQL Inserire il testo letterale e la concatenazione di Oracle SQL
In Oracle, it’s possible to insert literal or concatenate 2 or more charater strings or SQL result output together. In Oracle, è possibile inserire letterale o concatenare 2 o più stringhe charater o SQL risultato di output insieme. This manipulation allows you to manipulate the format of data returned by SQL query. Questa manipolazione permette di manipolare il formato dei dati restituiti dalla query SQL.
Two solid vertical bar || operator is used to concatenate 2 or more strings. Due solidi barra verticale | | operatore è usato per concatenare 2 o più stringhe. 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. Accanto, Oracle fornisce anche la funzione Concat carattere come alternativa alla barra verticale operatore nel caso in cui non vi è situazione in cui è difficile o impossibile per controllare la traduzione eseguita dal sistema operativo o della rete di pubblica utilità. This function should be used in applications that will be moved between environments with differing character sets. Questa funzione dovrebbe essere usato in applicazioni che verranno spostati tra ambienti con diversi set di caratteri.
Oracle will automatically casts values into types which can be concatenated. Oracle si mette automaticamente in tipi di valori che possono essere concatenati. 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. Come interpreta Oracle NULL come il vuoto (lunghezza zero) stringa di caratteri, che non restituisce NULL se uno è NULL operando, nel senso concatenating uno di lunghezza zero stringa di caratteri con un altro operando semper risultati in altre operando, in modo nulla può risultare solo dalla concatenazione di due stringhe null. To concatenate an expression that might be null, use the NVL function to explicitly convert the expression to a zero-length string. Per concatenare un'espressione che potrebbe essere nullo, utilizzare la funzione NVL di convertire esplicitamente l'espressione di uno zero stringa di lunghezza.
Concatenating two strings results in another character string. Concatenating due stringhe di risultati in un'altra stringa di caratteri. If both character strings are of datatype CHAR, the result has datatype CHAR and is limited to 2000 characters. Se entrambe le stringhe di caratteri sono di datatype CHAR, il risultato ha dato CHAR ed è limitata a 2000 caratteri. If either string is of datatype VARCHAR2, the result has datatype VARCHAR2 and is limited to 4000 characters. Se una stringa è di datatype VARCHAR2, il risultato ha dato VARCHAR2 ed è limitato a 4000 caratteri. Trailing blanks in character strings are preserved by concatenation, regardless of the strings’ datatypes. Spazi vuoti nelle stringhe di caratteri sono conservati concatenazione, indipendentemente dalle corde 'di dati.
For literal insertion, put the strings between the single quote ‘ in the SQL statement. Per l'inserimento letterale, mettere le corde tra la singola citazione 'in SQL.
Example and Usage : Esempio e Uso:
SELECT ‘Name is ‘ || name FROM table; Selezionare 'Nome' | | nome FROM tabella;
Name is whatever_name Nome è whatever_name
SELECT number || ‘ - ‘ || description FROM table ORDER BY number Selezionare il numero | | '-' | | descrizione FROM tabella ORDER BY numero
1 - description 1 1 - descrizione 1
2 - description 2 2 - descrizione 2
Advance Usage : Anticipo Utilizzo:
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. E 'possibile utilizzare Concatenazione e letterale Inserimento di generare una serie di query SQL lingua automaticamente, soprattutto quando necessario eseguire stessa operazione per lotti di tabelle, vale a dire abbandonare un sacco di tabelle. 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. Per effettuare questa operazione, il formato dei dati di SQL Query Language per produrre il risultato della query SQL in formato valido, e la bobina risultati della query SQL in un file. Then execute the file that contains SQL statements. Quindi eseguire il file che contiene istruzioni SQL.
Example: Esempio:
SELECT ‘DROP TYPE ‘ || type_name || ‘;’ Selezionare 'DROP TIPO' | | type_name | | ';'
will generates: si genera:
DROP TYPE type_name DROP TIPO type_name
that can be run at SQL*Plus by calling the file with @filename. che può essere eseguito in SQL * Plus chiamando il file con il nome del file @. All types that been selected from first SQL statements will be dropped from the database. Tutti i tipi che state selezionate dal primo dichiarazioni di SQL saranno eliminati dal database.
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. IMPORTANTE: Questa è una macchina tradotto pagina che è fornito "così come sono" senza garanzia. Machine translation may be difficult to understand. La traduzione automatica può essere difficile da capire. Please refer to Si prega di fare riferimento a original English article articolo originale in inglese whenever possible. ogniqualvolta ciò sia possibile.
Share and contribute or get technical support and help at Condividere e contribuire o ottenere supporto tecnico e contribuire a My Digital Life Forums La mia vita digitale forum .
Related Articles Articoli correlati
- Insert and Fill Random Filler Text and Lorem Ipsum Into Office Word, Execel and PowerPoint 2007 Inserire e compilare casuale riempitivo testo e Lorem ipsum in Office Word, Execel e PowerPoint 2007
- Download Free Ultra Hal Text-to-Speech Reader 1.0 for Convenient Text Reading Download gratuito Ultra Hal Text-to-Speech Reader 1.0 per Convenient Lettura Testo
- Download Free Ease PDF to Text Extractor v1.10 to Convert PDF to Text Files in Bulk Facilità di download gratuito di PDF Testo Extractor v1.10 Converti a PDF file di testo in massa
- Text Snip Keeps Your Text and Codes Formatting Safe from IM and Email Snip testo mantiene il vostro testo e dei codici di formattazione al sicuro da chat ed e-mail
- Add and Insert to Put Google AdSense Ads Units Between Blog Posts in Blogger.com Aggiungi e mettere inserire annunci AdSense di Google unità tra i post del blog di Blogger.com
- Insert Real Time Web Sites Into PowerPoint Presentation Slides With LiveWeb Inserire in tempo reale i siti web in presentazione di PowerPoint con diapositive LiveWeb
- Check Oracle Version Controllare la versione di Oracle
- Oracle Database Link Oracle Database link
- Oracle JDeveloper Reviews Oracle JDeveloper recensioni
- IMP-00013 Oracle Import Error IMP-00013 Oracle Import Errore


























March 2nd, 2007 21:57 2a marzo, 2007 21:57
Good article. Buona articolo. Got what I was looking for… Hai ciò che io stavo cercando ...