Insert Text Literal and Concatenation in Oracle SQL Tekst invoegen letterlijke en concatenatie in Oracle SQL
In Oracle, it’s possible to insert literal or concatenate 2 or more charater strings or SQL result output together. In Oracle, is het mogelijk in te voegen of letterlijke aaneenschakelen 2 of meer charater strings of SQL resultaat output samen. This manipulation allows you to manipulate the format of data returned by SQL query. Deze manipulatie kun je manipuleren van de vorm van de gegevens teruggegeven door SQL-query.
Two solid vertical bar || operator is used to concatenate 2 or more strings. Twee solide verticale balk | | exploitant wordt gebruikt voor het aaneenschakelen 2 of meer strijkers. 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. Naast Oracle heeft ook nog de functie concat karakter als een alternatief voor de verticale balk exploitant voor het geval er situatie waarin het moeilijk of onmogelijk is om de vertaling uitgevoerd door het besturingssysteem of netwerk nutsbedrijven. This function should be used in applications that will be moved between environments with differing character sets. Deze functie moet worden gebruikt in toepassingen die zullen worden verplaatst tussen omgevingen met verschillende tekensets.
Oracle will automatically casts values into types which can be concatenated. Oracle zal automatisch afgietsels waarden in typen die kunnen worden samengevoegd. 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. Zoals Oracle interpreteert NULL als de lege (nul-lengte) tekenreeks, maar niet terugkeren NULL als een operand is NULL, een zin concatenating nul-lengte karakter string met een andere operand altijd de resultaten van de andere operand, dus nietig kan alleen het gevolg zijn van de concatenatie van twee null strings. To concatenate an expression that might be null, use the NVL function to explicitly convert the expression to a zero-length string. Om aaneenschakelen een uitdrukking die zou kunnen worden nietig, gebruikt u de NVL functie om de expressie expliciet converteren naar een zero-length string.
Concatenating two strings results in another character string. Concatenating twee strings resultaten in een andere tekenreeks. If both character strings are of datatype CHAR, the result has datatype CHAR and is limited to 2000 characters. Als beide karakterstrings zijn van datatype CHAR, het resultaat is datatype CHAR en is beperkt tot 2000 tekens. If either string is of datatype VARCHAR2, the result has datatype VARCHAR2 and is limited to 4000 characters. Indien een string is van het datatype VARCHAR2, het resultaat is datatype VARCHAR2 en is beperkt tot 4000 tekens. Trailing blanks in character strings are preserved by concatenation, regardless of the strings’ datatypes. Trailing blanks in karakterstrings worden bewaard door concatenatie, ongeacht de snaren 'datatypes.
For literal insertion, put the strings between the single quote ‘ in the SQL statement. Voor letterlijke insertie, die de strijkers tussen enkele aanhalingstekens "in de SQL-instructie.
Example and Usage : Voorbeeld and Usage:
SELECT ‘Name is ‘ || name FROM table; Selecteer 'Naam is' | | naam FROM tabel;
Name is whatever_name Naam is whatever_name
SELECT number || ‘ - ‘ || description FROM table ORDER BY number SELECT-nummer | | '-' | | beschrijving FROM tabel ORDER BY aantal
1 - description 1 1 - beschrijving 1
2 - description 2 2 - beschrijving 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. Het is mogelijk om gebruik te maken Aaneenschakeling Letterlijke plaatsingskosten en voor het genereren van een reeks van SQL-query taal automatisch, vooral wanneer nodig voor het uitvoeren van dezelfde operatie te veel tafels, dwz een daling veel 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. Om dit te doen, het formaat waarin de gegevens SQL query language to output in het query resultaat geldig SQL-formaat, en spoolbestanden de SQL query resultaten naar een bestand. Then execute the file that contains SQL statements. Voer daarna het bestand met SQL statements.
Example: Voorbeeld:
SELECT ‘DROP TYPE ‘ || type_name || ‘;’ SELECT "DROP TYPE '| | type_name | |';"
will generates: zal genereren:
DROP TYPE type_name DROP TYPE type_name
that can be run at SQL*Plus by calling the file with @filename. die kunnen worden uitgevoerd op een SQL * Plus door te bellen naar het bestand met @ filename. All types that been selected from first SQL statements will be dropped from the database. Alle soorten die werden geselecteerd uit de eerste SQL statements zullen worden verwijderd uit de database.
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. BELANGRIJK: Dit is een machine vertaalde pagina die wordt verstrekt "as is" zonder garantie. Machine translation may be difficult to understand. Machine vertaling wellicht moeilijk te begrijpen. Please refer to Raadpleeg original English article origineel Engels artikel whenever possible. als dat mogelijk is.
Share and contribute or get technical support and help at Aandeel en bijdragen of het vinden van technische ondersteuning en hulp bij My Digital Life Forums My Digital Life Forums .
Related Articles Gerelateerde artikelen
- Insert and Fill Random Filler Text and Lorem Ipsum Into Office Word, Execel and PowerPoint 2007 Plaats en vul Random Filler tekst en Lorem Ipsum in Office Word, PowerPoint 2007 en Execel
- Download Free Ultra Hal Text-to-Speech Reader 1.0 for Convenient Text Reading Download Gratis Ultra Hal Text-to-Speech Reader 1.0 voor Handig Text Reading
- Download Free Ease PDF to Text Extractor v1.10 to Convert PDF to Text Files in Bulk Download Gratis Ease PDF naar tekst Extractor v1.10 voor het converteren van PDF-bestanden naar tekst in bulk
- Add and Insert to Put Google AdSense Ads Units Between Blog Posts in Blogger.com Toevoegen en steek om Google AdSense-advertenties eenheden tussen blogberichten in Blogger.com
- Insert Real Time Web Sites Into PowerPoint Presentation Slides With LiveWeb Plaats real-time web sites in PowerPoint-presentatie met dia's LiveWeb
- Check Oracle Version Check Oracle versie
- Oracle Database Link Oracle Database koppeling
- Oracle JDeveloper Reviews Oracle JDeveloper beoordelingen
- IMP-00013 Oracle Import Error IMP-00013 Oracle Import Error
- How to Escape Characters in Oracle PL/SQL Queries How to escape-tekens in Oracle PL / SQL queries


























March 2nd, 2007 21:57 2 maart, 2007 21:57
Good article. Goed artikel. Got what I was looking for… Heb je wat ik zocht ...