SQL plus usage for Oracle Study Notes

Source: Internet
Author: User
SQL plus usage in Oracle learning notes ① After installation is complete, of course, you have to log in and enter the user name and password. Note that if you want to have dba permissions when entering the password, you need to enter: password assysdba For example: enter username: scott enter password: 12345assysdba ② when entering in sqlplus, it is inevitable that errors a, even if

SQL plus usage in Oracle learning notes ① After installation is complete, of course, you have to log in and enter the user name and password. Note that if you want to have dba permissions when entering the password, you need to enter: password assysdba example: enter username: scott enter password: 12345 as sysdba ② when entering in sqlplus, it is inevitable that an error occurs.

SQL plus usage for Oracle Study Notes


① After the installation is complete, log on to the system. Enter the user name and password. Note that if you want to have dba permissions when entering the password, enter the password + as + sysdba.

For example:

Enter the User name: scott
Enter Password: 12345As sysdba

② Errors are inevitable when input in sqlplus

A. If it is incorrect, you can execute the command first, and then the corresponding command will be recorded in the buffer, and enter"Ed"Call up Notepad, save the changes, and the changed command will write the buffer, and enter"/"Execution;

B. InputListDisplay the commands of the buffer, enterList NLocate N rows and enter"Change/original statement/new statement", Enter"/"for execution;


③ Added and available in the existing bufferInputCommand


④ Save the buffer command to the fileSQL> save + d: \ test replace (replace if any)

Execute this fileSQL> @ d: \ test. SQL or SQL> start d: \ test. SQL


⑤ Replace variables I personally feel that this function is similar to the function and stored procedure, but the amount of code is much smaller and simpler;

Eg:

Select Ename, job from emp
Where Ename =& Ename;

During execution, the corresponding & Ename value is required and can be executed multiple times, which is convenient;


However, if the input is a variable but requires two or more places, it is inconvenient to enter the variable multiple times &&

Select Ename,& JobFrom emp
Order& Job;

You only need to enter the variable once, but then the variable value is determined, that is, repeated execution is also the first result.

InputSQL> defineIt is found that the job has been defined and can be usedUndefine jobDelete Defined variables

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.