Insert Text Literal and Concatenation in Oracle SQL Вставити текст літературно-конкатенаціі в Oracle SQL

In Oracle, it's possible to insert literal or concatenate 2 or more charater strings or SQL result output together. В Oracle, можна включити або сцеплять буквально 2 чи більше рядків charater або SQL результаті виходу разом. This manipulation allows you to manipulate the format of data returned by SQL query. Ця маніпуляція дозволяє маніпулювати формат даних, що повертаються SQL запитів.

Two solid vertical bar || operator is used to concatenate 2 or more strings. Два твердих Вертикальна риса | | оператор використовується для об'єднання 2 чи більше рядків. 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. Крім того, Oracle також надає CONCAT характер функції в якості альтернативи до вертикальної рисою оператора тільки у випадку, якщо ситуація, коли важко або неможливо контролювати переклад виконується операційної системи або мережі комунальних послуг. This function should be used in applications that will be moved between environments with differing character sets. Ця функція повинна використовуватися у програмах, які будуть переміщені між середовищ з різними наборами символів.

Oracle will automatically casts values into types which can be concatenated. Oracle буде автоматично відкидає цінностей на види, які можуть бути разом. 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 NULL інтерпретує як порожній (нульової довжини) символ рядка, він не повертає NULL, якщо один операндів є недійсним, а це означає, concatenating нульової довжини рядка символів з іншого операндів завжди результати в інших операндів, так недійсним може призвести лише від конкатенаціі двох нульових рядків. To concatenate an expression that might be null, use the NVL function to explicitly convert the expression to a zero-length string. Для сцеплять вирази, які можуть бути недійсними, використовуйте функцію NVL явно перетворити вираз з нульової довжини рядка.

Concatenating two strings results in another character string. Concatenating два рядки результатів в іншу рядок символів. If both character strings are of datatype CHAR, the result has datatype CHAR and is limited to 2000 characters. Якщо обидва символу рядки з даних CHAR, в результаті даних CHAR і обмежується до 2000 символів. If either string is of datatype VARCHAR2, the result has datatype VARCHAR2 and is limited to 4000 characters. Якщо яка-небудь рядок з даних VARCHAR2, в результаті даних VARCHAR2 і обмежується до 4000 символів. Trailing blanks in character strings are preserved by concatenation, regardless of the strings' datatypes. Причіпний прогалини в символ рядка зберегли конкатенаціі, незалежно від рядка 'даних.

For literal insertion, put the strings between the single quote ' in the SQL statement. У буквальному вставки, поставити струни між єдиним цитатою "в SQL заяву.

Example and Usage : Приклади та застосування:

SELECT 'Name is ' || name FROM table; Виберіть 'Назва' | | ім'я таблиці;

Name is whatever_name Назва whatever_name

SELECT number || ' – ' || description FROM table ORDER BY number Виберіть кількість | | '-' | | опис із таблиці ORDER BY число

1 – description 1 1 - опис 1
2 – description 2 2 - опис 2

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. Можна використовувати й конкатенаціі символьних вставки, щоб створити набір SQL Query Language автоматично, особливо коли необхідно виконати аналогічну операцію з безліччю столів, тобто втрачає дуже багато таблиць. 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. Щоб зробити це, формат даних SQL мова запитів для виведення результатів запиту в форматі SQL силі, а катушка на SQL запитів результатів у файл. Then execute the file that contains SQL statements. Потім виконати файл, який містить SQL заяви.

Example: Приклад:

SELECT 'DROP TYPE ' || type_name || ';' Виберіть "DROP ТИПА '| | type_name | |'; '

will generates: буде генерує:

DROP TYPE type_name DROP ТИП type_name

that can be run at SQL*Plus by calling the file with @filename. які можуть бути запущені в SQL * Plus, зателефонувавши фото з @ назва_файла. All types that been selected from first SQL statements will be dropped from the database. Всі види, які були відібрані з перших заяв SQL буде виключений з бази даних.

IMPORTANT : The page is machine translated and provided "as is" without warranty. Увага: Ця сторінка машина переведена і надаються "як є" без гарантії. Machine translation may be difficult to understand. Машинний переклад може бути важким для розуміння. Please refer to Будь ласка, зверніться до original English article Англійська оригінальні статті whenever possible. коли це можливо.


One Response to “Insert Text Literal and Concatenation in Oracle SQL” Один Відповідь до "Вставити текст літературно-конкатенаціі в Oracle SQL"

  1. Arun Аруна
    March 2nd, 2007 21:57 2 березня 2007 21:57
    1 1

    Good article. Гарна стаття. Got what I was looking for… Знайшли те, що я шукав ...

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> Ви можете використовувати ці теги: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <дель Datetime = ""> <em> <i> <q cite=""> <strike> <strong>

Subscribe to comments feature has been disabled. Підписатися на коментарі функція була відключена. To receive notification of latest comments posted, subscribe to Щоб отримувати повідомлення про останніх коментарів, підписка на My Digital Life Comments RSS feed Моя Цифрова життя Коментарі RSS канал or або register to receive зареєструватися, щоб отримати new comments in daily email digest. нових коментарів у щоденній електронній пошті дайджест.
Custom Search

New Articles Нові статті

Incoming Search Terms for the Article Вхідний Умови пошуку для статті

oracle concatenation Oracle конкатенація - -- oracle sql concatenate Oracle SQL сцеплять - -- sql literal SQL буквальне - -- sqlplus concat sqlplus concat - -- concatenation in oracle sql конкатенація в Oracle SQL - -- Concatenation in oracle Конкатенація в Oracle - -- sqlplus concatenate string sqlplus сцеплять рядком - -- sqlplus concatenate sqlplus сцеплять - -- SQL literal string SQL буквальному рядком - -- oracle query string concatenation Oracle запитом конкатенація - -- concatenate sql oracle сцеплять SQL Oracle - -- concatenate in oracle sql сцеплять в Oracle SQL - -- concat in oracle sql concat в Oracle SQL - -- Oracle query concatenate Oracle запитом сцеплять - -- oracle sql literal Oracle SQL буквальне - -- oracle select concat Oracle виберіть concat - -- oracle query concat Oracle запитом concat - -- oracle sql string concatenation Oracle SQL рядок конкатенація - -- concatenation oracle конкатенація Oracle - -- how to concatenation with the value in oracle query Як конкатенаціі зі значенням в Oracle запитом - -- oracle concat null оракул concat недійсними - -- oracle concatenate text Oracle сцеплять текст - -- oracle SELECT LITERAL Oracle SELECT символьних - -- concatenation oracle sql конкатенація Oracle SQL - -- Oracle SQL Concatenation operator Oracle SQL оператор конкатенаціі - -- oracle concat text оракул concat текст - -- concatenating strings in oracle concatenating рядка в Oracle - -- oracle text concatenation Пророцтво текст конкатенація - -- concatenate string sql oracle сцеплять рядок SQL Oracle - -- sqlplus concatenation sqlplus конкатенація - -- concat Oracle SQL concat Oracle SQL - -- oracle sql concatenate text from several records Oracle SQL сцеплять текст з декількох записів - -- oracle concatenation in sql конкатенація в Oracle SQL - -- concatenate oracle sql сцеплять Oracle SQL - -- oracle concat Oracle concat - -- all всі - -- oracle select string literal Oracle виберіть рядок буквальне - -- concatenate strings in oracle sql сцеплять рядка в Oracle SQL - -- oracle query concatenation Oracle запитом конкатенація - -- oracle sqlplus concat Oracle sqlplus concat - -- string concat in oracle sql concat рядки в Oracle SQL - -- oracle string concatenation Oracle рядок конкатенація - -- oracle sql string manipulation Oracle SQL рядок маніпуляції - -- oracle sql concatenation Oracle SQL конкатенація - -- concatenate oracle select сцеплять Oracle виберіть - -- oracle select concat string оракул concat виберіть рядок - -- concat query result oracle concat результат запиту Oracle - -- oracle concatenate char 4000 Oracle сцеплять символ 4000 - -- oracle sql concat Oracle SQL concat - -- sql insert concatenate SQL вставити сцеплять - --