about Oracle PL/SQL

Source: Internet
Author: User

The PL/SQL language is the language that Oracle expands on SQL.
1 procedures, functions, triggers are written in PL/SQL
2 procedures, functions, triggers are in Oracle
3 PL/SQL statements can be called directly in Java

Simple Introduction

Write a stored procedure in Sql-plus that can add records to a table.

First step: Create a table
CREATE TABLE mytest (name varchar2, passwd varchar2 (20));

Step Two: Create a process
CREATE PROCEDURE Mypro1 is begin
--Executive Section
INSERT into MyTest value (' wdx ', ' 123 ')
End
/
--Enter
(Note: If the system later has mypro1 this process name, either change the name or add or replace after create, if there is a mistake, the input follows the input show error)

Step three: Call the procedure
Method 1:exec Procedure Name (parameter value 1, parameter value 2 ...)
Method 2:call Procedure Name (parameter value 1, parameter value 2 ...)


Of course, you can also create the above procedure in PL/SQL developer, similar.

PL/SQL can write procedures, functions, triggers, packages, and so on.

Writing Specifications:

1 notes
Single-line Comment--
Multi-line Comment/*...*/

2 naming conventions for identifying symbols
V_ is recommended as a prefix when defining variables
When defining constants, it is recommended to use the C_
When you define a cursor, we recommend that you use _cursor
When defining an exception error, we recommend that you use E_

PL/SQL is used to write blocks, block structures, three parts, respectively, the definition section, the execution part, the exception processing part,
Declear
/* Define START */
Begin
/* Execute part */
exception
/* Exception Handling section */
End

about Oracle PL/SQL

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.