How does Oracle get rid of spaces on either side of a field? ____oracle

Source: Internet
Author: User

Turn from: http://www.jb51.net/article/53576.htm

The actual examples are as follows:

Update Sys_dictionary_bak Set display_name = Trim (display_name)
where Table_name= ' T_guardian '
and Column_name= ' Zy '
;

Extended:

such as trim (' character 1 ' from ' String 2 '), character 1 can only be a single character.

1. Trim () deletes the spaces on either side of the string.
2. LTrim () deletes the space to the left of the string.
3. RTrim () deletes the space to the right of the string.
4. Trim (' character 1 ' from ' String 2 ') starts from both sides of the character 2 string, and deletes the specified character 1.
5. Trim ([leading | trailing | both] Trim_char from string) deletes the specified character Trim_char from string strings.
Leading: Deletes from the header of the string.
Trailing: Deletes from the tail of the string.
Borth: Delete from both sides of the string.
6. Tim () can only remove half-width spaces.

For example:
Trim (' tech ') would return ' tech ';
Trim (' from ' tech ') would return ' tech ';
Trim (Leading ' 0 ' 000123 ') would return ' 123 ';
Trim (trailing ' 1 ' Tech1 ') would return ' Tech ';
Trim (both ' 1 ' 123tech111 ') would return ' 23Tech ';

Description

Where the Sys_dictionary_bak table is defined as:

CREATE TABLE "SCOTT". " Sys_dictionary_bak "
("pk_id" number (10,0) not NULL ENABLE,
"table_name" NVARCHAR2 (100),
"column_name" NVARCHAR2 (100),
"VALUE" NVARCHAR2 (100),
"Display_name" NVARCHAR2 (100),
"By" number (10,0),
"MEMO" NVARCHAR2 (512),
"Create_time" char (char),
"Update_time" char (char),
"DR" Number (3,0)
) SEGMENT Creation IMMEDIATE
PCTFREE pctused Initrans 1 Maxtrans 255 nocompress LOGGING
STORAGE (INITIAL 65536 NEXT 1048576 minextents 1 maxextents 2147483645
Pctincrease 0 freelists 1 freelist GROUPS 1 buffer_pool default Flash_cache default Cell_flash_cache default)
Tablespace "USERS";

ALTER TABLE "SCOTT". " Sys_dictionary_bak "MODIFY (" pk_id "not NULL ENABLE);



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.