Insert Text Literal and Concatenation in Oracle SQL Isingit ang teksto ng literal at pagdudugtong sa Oracle SQL
In Oracle, it’s possible to insert literal or concatenate 2 or more charater strings or SQL result output together. Sa Oracle, posible na ipasok literal o pagdugtungin 2 o higit pang mga charater string o SQL resulta output magkasama. This manipulation allows you to manipulate the format of data returned by SQL query. Ang pagmamanipula ay nagbibigay-daan sa iyo upang manipulahin ang format ng data na ibinalik sa pamamagitan ng SQL query.
Two solid vertical bar || operator is used to concatenate 2 or more strings. Dalawang solid patayong bar | | operator ay ginagamit upang pagdugtungin 2 o higit pang mga instrumento. 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. Sa tabi, Oracle ay nagbibigay din ng mga CONCAT character function bilang isang alternatibo sa patayong bar operator lamang sa mga kaso doon ay sitwasyon na kung saan ito ay mahirap o imposibleng control ginanap sa pagsasalin sa pamamagitan ng operating system o network utilities. This function should be used in applications that will be moved between environments with differing character sets. Function na ito ay dapat na ginagamit sa mga aplikasyon na ito ay inilipat sa pagitan ng mga kapaligiran sa differing character set.
Oracle will automatically casts values into types which can be concatenated. Oracle ay awtomatikong casts halaga sa mga uri na maaaring 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. Bilang Oracle interprets null bilang ng mga walang laman (zero-length) ng character string, ito ay hindi na bumalik null kung ang isang operand ay null, ibig sabihin concatenating ng isang zero-haba ng character string sa ibang operand palaging resulta sa iba pang mga operand, kaya null ay maaaring magresulta lamang mula sa pagdudugtong ng dalawang null string. To concatenate an expression that might be null, use the NVL function to explicitly convert the expression to a zero-length string. Pagdugtungin sa isang pagpapahayag na ito ay maaaring maging null, gamitin ang NVL function sa explicitly-convert ang mga expression sa isang zero-length string.
Concatenating two strings results in another character string. Concatenating dalawang string ng mga resulta sa isa pang character string. If both character strings are of datatype CHAR, the result has datatype CHAR and is limited to 2000 characters. Kung ang parehong mga character string ay datatype ng pansamantalang trabaho, ang resulta ay datatype pansamantalang trabaho at ito ay limitado sa 2000 characters. If either string is of datatype VARCHAR2, the result has datatype VARCHAR2 and is limited to 4000 characters. Kung alinman sa string ay ng datatype varchar2, ang resulta ay datatype varchar2 at ito ay limitado sa 4000 characters. Trailing blanks in character strings are preserved by concatenation, regardless of the strings’ datatypes. Trailing blanks sa character string ay nakapreserba sa pamamagitan ng pagdudugtong, hindi alintana ang string 'datatypes.
For literal insertion, put the strings between the single quote ‘ in the SQL statement. Para sa literal insertion, ilagay sa mga string sa pagitan ng mga single quote 'sa SQL statement.
Example and Usage : Halimbawa at Paggamit sa:
SELECT ‘Name is ‘ || name FROM table; PUMILI 'Pangalan ay' | | pangalan MULA table;
Name is whatever_name Pangalan ay whatever_name
SELECT number || ‘ - ‘ || description FROM table ORDER BY number PUMILI numero | | '-' | | paglalarawan MULA table Isaayos ayon sa numero ng
1 - description 1 1 - paglalarawan 1
2 - description 2 2 - paglalarawan 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. Posible na gamitin ang pagdudugtong at literal Insertion upang bumuo ng isang set ng mga wika ay awtomatikong SQL query, lalo na kapag kailangan mong gawin ang mga parehong operasyon sa maraming mga tables, ibig sabihin bumababa ng isang pulutong ng mga tables. 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. Upang gawin ito, ang format ng SQL data query wika sa output sa tanong na resulta sa wastong SQL format, at ulak ng SQL query ng mga resulta sa isang file. Then execute the file that contains SQL statements. Pagkatapos pugutan ng ulo ang file na naglalaman ng SQL statements.
Example: Halimbawa:
SELECT ‘DROP TYPE ‘ || type_name || ‘;’ PUMILI 'DROP TYPE' | | type_name | | ';'
will generates: ay bumubuo ng:
DROP TYPE type_name DROP TYPE type_name
that can be run at SQL*Plus by calling the file with @filename. na maaaring tumakbo sa SQL * Plus pamamagitan ng pagtawag ng file sa @ filename. All types that been selected from first SQL statements will be dropped from the database. Lahat ng uri na napili mula sa unang SQL pahayag ay bumaba mula sa database.
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. MAHALAGA: Ito ay isang makina isinalin pahina na kung saan ay ibinigay "bilang ganito" walang warranty. Machine translation may be difficult to understand. Makina ng pagsasalin ay maaaring mahirap maintindihan. Please refer to Mangyaring sumangguni sa original English article orihinal na Ingles article whenever possible. hangga't maaari.
Share and contribute or get technical support and help at Share at kontribusyon o makakuha ng teknikal na suporta at tulong sa My Digital Life Forums Aking Digital buhay Forums .
Related Articles Mga Kaugnay na Akda
- Insert and Fill Random Filler Text and Lorem Ipsum Into Office Word, Execel and PowerPoint 2007 Insert at punan Random filler text at Lorem ipsum sa Opisina ng salita, Execel at PowerPoint 2007
- Download Free Ultra Hal Text-to-Speech Reader 1.0 for Convenient Text Reading I-download ang Libreng Ultra hal Text-to-Speech Reader 1.0 para sa maginhawang Text Reading
- Download Free Ease PDF to Text Extractor v1.10 to Convert PDF to Text Files in Bulk I-download ang Libreng Dali PDF sa Text bunot v1.10 sa Pag-convert ng PDF file sa Text sa Bulk
- Add and Insert to Put Google AdSense Ads Units Between Blog Posts in Blogger.com Magdagdag at ipasok sa Ilagay Google AdSense ads units sa pagitan ng mga post sa blog sa Blogger.com
- Insert Real Time Web Sites Into PowerPoint Presentation Slides With LiveWeb Insert real-time web site sa PowerPoint slide sa pagtatanghal LiveWeb
- Check Oracle Version Suriin ang Oracle bersyon
- Oracle Database Link Oracle database link
- Oracle JDeveloper Reviews Oracle JDeveloper Reviews
- IMP-00013 Oracle Import Error Malikot na bata-00013 Oracle Import Error
- How to Escape Characters in Oracle PL/SQL Queries Paano sa escape karakter sa Oracle pl / sql queries


























March 2nd, 2007 21:57 March 2nd, 2007 21:57
Good article. Magandang article. Got what I was looking for… Got kung ano ako ay naghahanap ng ...