Insert Text Literal and Concatenation in Oracle SQL Masukkan Teks Literal dan rentetan dalam Oracle SQL

In Oracle, it's possible to insert literal or concatenate 2 or more charater strings or SQL result output together. Dalam Oracle, mungkin untuk memasukkan literal atau menyatukan 2 atau lebih charater string SQL atau hasil keluaran bersama. This manipulation allows you to manipulate the format of data returned by SQL query. Manipulasi ini memungkinkan Anda untuk memanipulasi data format dikembalikan oleh SQL query.

Two solid vertical bar || operator is used to concatenate 2 or more strings. Solid dua bar vertikal | | operator digunakan untuk menggabungkan 2 atau lebih string. 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. Disamping, Oracle juga menyediakan CONCAT karakter berfungsi sebagai alternatif dari vertikal bar operator hanya dalam kasus dimana terdapat situasi sulit atau mustahil untuk mengendalikan terjemahan dilakukan oleh sistem operasi atau jaringan utilitas. This function should be used in applications that will be moved between environments with differing character sets. Fungsi ini harus digunakan dalam aplikasi yang akan dipindahkan antara lingkungan yang berbeda dengan rangkaian karakter.

Oracle will automatically casts values into types which can be concatenated. Oracle akan secara otomatis membuat nilai menjadi jenis yang dapat 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. Oracle sebagai menafsirkan NULL sebagai kosong (nol-panjang) karakter string, ia tidak kembali jika operand NULL adalah NULL, yang berarti concatenating nol-string dengan panjang karakter lain operand selalu hasil yang lainnya operand, jadi hanya dapat menghasilkan null dari rangkaian dua null string. To concatenate an expression that might be null, use the NVL function to explicitly convert the expression to a zero-length string. Untuk menyatukan kalimat yang mungkin null, menggunakan fungsi NVL secara eksplisit mengkonversi ekspresi ke nol-panjang string.

Concatenating two strings results in another character string. String hasil Concatenating dua karakter dalam string lain. If both character strings are of datatype CHAR, the result has datatype CHAR and is limited to 2000 characters. Jika kedua karakter string adalah data CHAR, hasilnya memiliki data CHAR dan dibatasi hingga 2000 karakter. If either string is of datatype VARCHAR2, the result has datatype VARCHAR2 and is limited to 4000 characters. Jika salah satu dari string adalah data VARCHAR2, hasilnya telah VARCHAR2 datatype dan dibatasi hingga 4000 karakter. Trailing blanks in character strings are preserved by concatenation, regardless of the strings' datatypes. Trailing kosong di string karakter yang diawetkan oleh rentetan, apapun yang string 'datatypes.

For literal insertion, put the strings between the single quote ' in the SQL statement. Untuk literal insersi, menempatkan string antara satu kutipan 'dalam pernyataan SQL.

Example and Usage : Contoh dan Penggunaan:

SELECT 'Name is ' || name FROM table; SELECT 'Nama' | | nama FROM tabel;

Name is whatever_name Nama whatever_name

SELECT number || ' – ' || description FROM table ORDER BY number SELECT nomor | | '-' | | keterangan FROM tabel ORDER BY nomor

1 – description 1 1 - deskripsi 1
2 – description 2 2 - deskripsi 2

Advance Usage : Advance Penggunaan:

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. Kemungkinan untuk menggunakan rangkaian dan Literal Tepat untuk menghasilkan satu set bahasa SQL query secara otomatis, terutama bila harus melakukan operasi sama ke banyak meja, yakni menurun banyak meja. 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. Untuk melakukan ini, formatah SQL bahasa permintaan data ke output hasil pencariannya dalam format SQL berlaku, dan yang spool Permintaan SQL hasil ke file. Then execute the file that contains SQL statements. Kemudian jalankan file yang berisi pernyataan SQL.

Example: Contoh:

SELECT 'DROP TYPE ' || type_name || ';' SELECT 'DROP JENIS' | | type_name | | ';'

will generates: akan menghasilkan:

DROP TYPE type_name DROP TYPE type_name

that can be run at SQL*Plus by calling the file with @filename. yang dapat dijalankan di SQL * Plus oleh memanggil file dengan nama file @. All types that been selected from first SQL statements will be dropped from the database. Semua jenis yang telah dipilih dari statemen SQL pertama akan turun dari database.

IMPORTANT : The page is machine translated and provided "as is" without warranty. PENTING: Halaman yang diterjemahkan mesin dan diberikan "sebagaimana adanya" tanpa jaminan. Machine translation may be difficult to understand. Mesin terjemahan mungkin sulit dimengerti. Please refer to Silakan merujuk ke original English article artikel asli Inggris whenever possible. bila memungkinkan.


One Response to “Insert Text Literal and Concatenation in Oracle SQL” Satu Respon untuk "Sisipkan Teks Literal dan rentetan dalam Oracle SQL"

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

    Good article. Good artikel. Got what I was looking for… Got what I was looking for ...

Leave a Reply Meninggalkan Balas

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> Anda dapat menggunakan tag ini: <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. Berlangganan ke fitur komentar telah dinonaktifkan. To receive notification of latest comments posted, subscribe to Untuk menerima pemberitahuan komentar diposting terbaru, berlangganan My Digital Life Comments RSS feed Saya Digital Life Komentar RSS feed or atau register to receive mendaftar untuk menerima new comments in daily email digest. komentar baru di email harian digest.
Custom Search

New Articles Artikel Baru

Incoming Search Terms for the Article Cari Syarat masuk untuk Artikel

oracle concatenation oracle rentetan - -- oracle sql concatenate oracle sql menyatukan - -- concatenation in oracle sql rentetan dalam oracle sql - -- sqlplus concat sqlplus concat - -- oracle query string concatenation oracle string permintaan rentetan - -- sql literal sql literal - -- how to concatenation with the value in oracle query bagaimana rangkaian dengan nilai di oracle query - -- Oracle SQL Concatenation operator Oracle SQL rentetan operator - -- oracle concatenate text oracle menggabungkan teks - -- sqlplus concatenate sqlplus menyatukan - -- oracle select concat pilih oracle concat - -- sqlplus concatenate string sqlplus menggabungkan string - -- oracle query concat oracle query concat - -- oracle concat text oracle concat teks - -- SQL literal string SQL string literal - -- Oracle query concatenate Oracle permintaan bergabung - -- concatenate sql oracle - -- oracle concat null oracle null concat - -- concatenate oracle sql menyatukan oracle sql - -- concatenate in oracle sql bergabung dalam oracle sql - -- concatenation oracle sql rentetan oracle sql - -- oracle sql string concatenation oracle sql string rentetan - -- concatenate string sql oracle menggabungkan string sql oracle - -- oracle concatenate char 4000 oracle menggabungkan char 4000 - -- concatenation oracle rentetan oracle - -- sqlplus concatenation sqlplus rentetan - -- sql spool insert new line sql spool menyisipkan baris baru - -- oracle sql concatenation oracle sql rentetan - -- concatenating strings in oracle concatenating string di oracle - -- insert 2 characters in sql field 2 memasukkan karakter dalam sql bidang - -- oracle SELECT LITERAL oracle SELECT Literal - -- oracle sql and concatenate oracle sql dan menyatukan - -- concatenate oracle select menggabungkan oracle pilih - -- oracle text concatenation oracle rangkaian teks - -- oracle select concat string pilih oracle concat string - -- Oracle SQL functions concatenate Oracle SQL menggabungkan fungsi - -- oracle insert concat oracle memasukkan concat - -- oracle concat oracle concat - -- sqlplus insert spanish characters Spanyol sqlplus memasukkan karakter - -- string concat oracle sql string concat oracle sql - -- oracle string concatenation sql oracle sql string rentetan - -- oracle insert concatenate oracle memasukkan menyatukan - -- oracle concatenate string char oracle menggabungkan string char - -- oracle sql literal oracle sql literal - -- sql insert concatenate sql memasukkan menyatukan - -- oracle insert character oracle memasukkan karakter - -- CONCATENATE SELECT RESULT ORACLE Menyatukan SELECT HASIL Oracle - -- concat in oracle sql concat dalam oracle sql - -- oracle sql plus query concatenate oracle sql plus permintaan bergabung - -- oracle string concatenation null oracle null string rentetan - --