Collation of Oracle commands and related functions

Source: Internet
Author: User

If you are confused about Oracle commands and functions, you can use the following articles to learn about its practical application and functions. The following is a detailed introduction of the article.

Oracle commands and some functions

Oracle online log file recovery

SQL * PLUS command SQL programming manual

Oracle9i analysis functions

Set linesize 500

Set pagesize 100

Run or r or (Symbol) indicates that the previous command is re-executed.

 
 
  1. alter session set NLS_date_format='YYYY-MM-DD';  

Modify a user's session to modify the Date Format

The default date format is: 'dd-MON-YY'

 
 
  1. SQL> insert into scott.emp(empno,ename,sal) 
    values(&employeeid,'&name',&employeesal); 

Enter the value of employeeid: 9001

Enter the value of name: jiake02

The value of employeesal is 4000.

Original Value 2: values (& employeeid, '& name', & employeesal)

New Value 2: values (9001, 'jiake02', 4000)

During Oracle commands and some functions, this command can be used multiple times, for example, by symbol/and then press enter, you can repeatedly input values.

Use subqueries in insert statements. For example

 
 
  1. insert into managers(id,name,salary,hiredate)  
  2. select empno,ename,sa,hiredate  
  3. from emp  
  4. where job='manager'; 

02

1. Each SQL statement in Oracle is a transaction. When commit or rollback is used to end the transaction

2. savepoint update_dept; set the save point;

You can use the rollback to update_dept; Method to Solve the Problem of step-by-step processing or selective execution;

Orcale connects two strings and uses two |, while SQL uses &

% Represents Multiple Arbitrary characters, and _ represents one arbitrary character.

Is null is used to determine whether it IS NULL

Iii. lesson 03

SQL functions:

Single Row function: ----> General/Character/Number/Date/Conversion

1. Character Functions

In Oracle commands and some functions, convert the function ----> LOWER select lower (ename) from scott. emp;

/UPPER select * from scott. emp where ename = upper ('King ');

The first letter of/INTCAP is in upper case, and the other letters are in lower case.

SQL> select initcap (ename) from scott. emp;

INITCAP (EN

Smith

Character manipulation functions ------> CONCAT

Select empno, concat (ename, job) from scott. emp; <=> select ename | job from scott. emp;

Empno concat (ENAME, JOB)

7369 SMITHCLERK

7499 ALLENSALESMAN

/LENGTH

1. select empno, ename, length (ename) from scott. emp;

Empno ename length (ENAME)

The above content is an introduction to Oracle commands and some functions. I hope you will get something better.

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.