Insert Text Literal and Concatenation in Oracle SQL Legen Sie wörtlichen Text und Verkettung in einem Oracle SQL -

In Oracle, it’s possible to insert literal or concatenate 2 or more charater strings or SQL result output together. In Oracle ist es möglich, wörtliche oder Zusammenfügen 2 oder mehr Strings charater oder SQL-Ergebnis-output zusammen. This manipulation allows you to manipulate the format of data returned by SQL query. Diese Manipulation ermöglicht es Ihnen zu manipulieren das Format der zurückgegebenen Daten von SQL-Abfrage.

Two solid vertical bar || operator is used to concatenate 2 or more strings. Zwei solide senkrechten Strich | | Operator dient zum Zusammenfügen 2 oder mehr Strings. 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. Neben Oracle bietet auch die Funktion CONCAT Charakter als Alternative zu den senkrechten Strich Betreiber nur für den Fall gibt es Situation, wo es schwierig oder unmöglich zu kontrollieren Übersetzung von Betriebssystem oder Netzwerk-Utilities. This function should be used in applications that will be moved between environments with differing character sets. Diese Funktion sollte in Anwendungen verwendet werden Waren zwischen Umgebungen mit unterschiedlichen Zeichensätzen.

Oracle will automatically casts values into types which can be concatenated. Oracle wird automatisch wirft Werte in der Arten verkettet werden können. 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. Wie Oracle interpretiert NULL als leere (Null-Länge) Zeichenkette, sie nicht zurückkehren NULL, wenn ein Operand NULL ist, was bedeutet, dass die Verkettung einer Null-Länge Zeichenkette mit einer anderen Operanden immer Ergebnisse in den anderen Operanden, also null kann dazu führen, nur aus der Verkettung von zwei Zeichenketten null. To concatenate an expression that might be null, use the NVL function to explicitly convert the expression to a zero-length string. Verketten ein Ausdruck, vielleicht ist null, verwenden Sie die Funktion NVL ausdrücklich zu konvertieren der Ausdruck auf ein Null-String Länge.

Concatenating two strings results in another character string. Konkatenation zweier Zeichenketten Ergebnisse in einer anderen Zeichenkette. If both character strings are of datatype CHAR, the result has datatype CHAR and is limited to 2000 characters. Wenn beide Zeichenketten sind der Datentyp CHAR, das Ergebnis hat Datentyp CHAR und ist begrenzt auf 2000 Zeichen. If either string is of datatype VARCHAR2, the result has datatype VARCHAR2 and is limited to 4000 characters. Wenn entweder String ist der Datentyp VARCHAR2, das Ergebnis hat Datentyp VARCHAR2 und ist begrenzt auf 4000 Zeichen. Trailing blanks in character strings are preserved by concatenation, regardless of the strings’ datatypes. Trailing Blanks in Zeichenketten werden durch Verkettung, unabhängig von der Zeichenketten "Datentypen.

For literal insertion, put the strings between the single quote ‘ in the SQL statement. Für wörtliche Einfügung, die die Saiten zwischen den einzelnen Zitat "in der SQL-Anweisung.

Example and Usage : Beispiel und Anwendung:

SELECT ‘Name is ‘ || name FROM table; SELECT 'Name ist' | | Name aus der Tabelle;

Name is whatever_name Name ist whatever_name

SELECT number || ‘ - ‘ || description FROM table ORDER BY number Wählen Sie Nummer | | '-' | | beschreibung aus der Tabelle ORDER BY Zahl

1 - description 1 1 - 1 Beschreibung
2 - description 2 2 - Beschreibung 2

Advance Usage : Advance Anwendung:

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. Es ist möglich, mit Verkettung und Literal Insertion generieren eine Reihe von SQL-Abfrage automatisch die Sprache, vor allem, wenn notwendig, um dieselbe Operation zu viele Tabellen, dh eine Menge von Tabellen. 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. Um dies zu tun, das Format der Daten von SQL Abfragesprache bis zur Ausgabe der Abfrageergebnis in gültige SQL-Format und Spool-SQL-Abfrage der Ergebnisse in einer Datei. Then execute the file that contains SQL statements. Dann führen Sie die Datei mit SQL-Anweisungen.

Example: Beispiel:

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

will generates: wird erzeugt:

DROP TYPE type_name DROP TYPE type_name

that can be run at SQL*Plus by calling the file with @filename. das kann in SQL * Plus durch den Aufruf der Datei mit @ Dateiname. All types that been selected from first SQL statements will be dropped from the database. Alle Arten ausgewählt worden, dass aus der ersten SQL-Anweisungen werden aus der Datenbank.

IMPORTANT : This is a machine translated page which is provided "as is" without warranty. WICHTIG: Es handelt sich um eine Maschine der Seite übersetzt wird "as is" ohne Garantie. Machine translation may be difficult to understand. Maschinelle Übersetzung ist vielleicht schwierig zu verstehen. Please refer to Bitte wenden Sie sich an original English article Original Englisch Artikel whenever possible. wann immer dies möglich ist.

Share and contribute or get technical support and help at Aktie und einen Beitrag oder erhalten technische Unterstützung und Hilfe an My Digital Life Forums Meine digitalen Lebens Foren .



One Response to “Insert Text Literal and Concatenation in Oracle SQL” Eine Antwort auf "Einfügen Text Literal und Verkettung in einem Oracle SQL"

  1. Arun
    March 2nd, 2007 21:57 2. März, 2007 21:57
    1

    Good article. Guter Artikel. Got what I was looking for… Haben Sie, was ich war auf der Suche nach…

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> Sie können diese Tags: <a href= title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime = ""> <em> <i> <q Cite=""> <strike> <strong>

Subscribe without commenting Abonnieren ohne zu kommentieren


Custom Search

New Articles Neue Artikel

Incoming Search Terms for the Article Eingehender Suchbegriffe für den Artikel

oracle concatenation Oracle-Verkettung - -- oracle sql concatenate Oracle SQL Zusammenfügen - -- concatenation oracle Verkettung Oracle - -- concatenation in oracle Verkettung in Oracle - -- ORACLE CONCAT ORACLE CONCAT - -- oracle sql concatenation Oracle SQL-Verkettung - -- string concatenation in oracle SQL String-Verkettung in einem Oracle SQL - - -- oracle sql string concatenation Oracle SQL-String-Verkettung - -- sql literal SQL-Literal - -- Oracle sql concatenate text Oracle SQL Zusammenfügen Text - -- oracle concatenate text Oracle Zusammenfügen Text - -- concat oracle concat Oracle - -- sqlplus concat sqlplus concat - -- oracle concatenate Oracle Zusammenfügen - -- concatenation in oracle sql Verkettung in einem Oracle SQL - - -- sql concatenation SQL-Verkettung - -- oracle literal Oracle wörtliche - -- oracle query concatenate Oracle Abfrage Zusammenfügen - -- literal of at most 4000 characters Insert Oracle wörtliche von maximal 4000 Zeichen einfügen Oracle - -- sqlplus concatenate string sqlplus Zusammenfügen String - -- all alle - -- SQLPLUS concatenate Sqlplus Zusammenfügen - -- oracle text concatenation Oracle Text-Verkettung - -- sql concatenate oracle Oracle SQL Zusammenfügen - -- oracle string concat Oracle String concat - -- oracle concatenate null Oracle Zusammenfügen null - -- sql concat string oracle SQL-String concat Oracle - -- Oracle Select COncat Oracle Wählen Sie CONCAT - -- CONCAT in oracle CONCAT in Oracle - -- oracle query concat Oracle Abfrage concat - -- oracle concat string Oracle concat string - -- concatenate in oracle Zusammenfügen in Oracle - -- concat oracle query concat Oracle-Abfrage - -- concat in sql concat in SQL - -- oracle sql concat Oracle SQL concat - -- oracle concatenate strings Oracle Zusammenfügen Strings - -- concat sql oracle concat Oracle SQL - -- sql select concatenation SQL-select-Verkettung - -- oracle string concatenation Oracle Konkatenation von Strings - -- oracle concat query Oracle concat Abfrage - -- sql string concatenation oracle SQL-String-Verkettung Oracle - -- literal oracle wörtliche Oracle - -- oracle sql select literal Oracle SQL-select-literal - -- oracle literal sql Oracle SQL wörtliche - -- oracle CONCATENATE WITH NULL Oracle CONCATENATE mit null - -- CONCATENATION IN SQL Verkettung in SQL - -- oracle sql literal string Oracle SQL-String Literal - -- string concatenation in oracle query String-Verkettung in einem Oracle-Abfrage - -- oracle sql string concat Oracle SQL-String concat - -- concatenate in sql query Zusammenfügen in SQL-Abfrage - --