Practical application of Oracle9i analysis functions

Source: Internet
Author: User

We may encounter many headaches in Oracle commands and some functions, but sometimes we cannot solve this problem, we recommend that you use the Oracle9i analysis function to solve related problems in order to relieve your difficulty in sorting out Oracle commands and some functions.

SQL * PLUS command SQL programming manual

Oracle9i analysis functions

Recommendation circle: Database circle

1. More related recommendations -------------------------> 01

 
 
  1. set linesize 500  
  2. set pagesize 100  

Run or r or (Symbol)/------------> both indicate re-executing the previous command.

Alter session set NLS_date_format = 'yyyy-MM-DD '; modify a user 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)

This command can be used multiple times during the Oracle9i function analysis, such as pressing the symbol/And then pressing the Enter key to repeatedly enter the value.

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';  

II ------------------> 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: ---->

 
 
  1. General/Character/Number/Date/Conversion 

1. Character Functions

Conversion Function ---->

 
 
  1. 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.

 
 
  1. SQL> select initcap(ename) from scott.emp;  
  2. INITCAP(EN  
  3. Smith  

The above content is an introduction to some of Oracle9i analysis functions.

Related Article

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.