first, what is PL/SQLPL/SQL is an extension of the language. The SQL language is a non-procedural language in which the user simply tells the computer what to do without needing to understand how the computer is doing it. For example, users want to query a table of a column of data, only need to input:selectcolunm_name
Handling */END;
The execution part is required.PL/SQL blocks can be divided into three types:1. Unknown block: it is a dynamic structure and can only be executed once.2. Subroutine: stored procedures, functions, and packages in the database. After the database is established, you can call them in other programs.3. Trigger: When a database operation occurs, some events are triggered to automatically execute
record.
SQL code
Create or replace procedure sp_pro2 is
Begin -- execution part
Delete from mytest where name = 'Han shunping ';
End;
Createor replace procedure sp_pro2 is
Begin -- execution part
Deletefrom mytest where name = 'Han shunping ';
End;
PL/SQL Introduction
Introduction
When developers use PL/
Chapter 2 procedural performance tuning of PL/SQL applications
I. Reasons for PL/SQL Performance problems
When the execution efficiency of PL/SQL-based applications is low, it is usually caused by poor
optional, indicating the maximum length that the string can store.
Declaration of variables in PL/SQL is not the same as that in other languages. It is declared from right to left. For example, to declare a variable v_id of the number type, the form should be:
V_id number;
If you assign values to the above v_id variable, you cannot use
SQL Server DDL triggers (Trigger)-Create a server-level DDL triggerIf you create a server-level DDL trigger, you can track server-level events by changing the previous on database to the on all server, using the same principle as the DDL triggers at the DB level, which differ only in the events that are tracked.CREATE TRIGGER
describes variables, constants, cursors, and subprograms. The package body fully defines subprograms and cursors.Trigger)A trigger is associated with a table or database event. When a trigger event occurs, the trigger defined in the table is triggered.Variables and constantsThe variable is stored in the memory to obtain the value. It can be referenced by
portion of the PL/SQL block is required. Notice that the end keyword is followed by a semicolon.③ Exception Handling section: This section is optional, the section uses the exception keyword to divide the executable part into two small parts, the previous program is the normal operation of the program, in the event of an exception to jump to the exception part of the execution.PL/
not meeting the criteria ');When Too_many_rows ThenDbms_output.put_line (' Too much data ');END; Because a department with number 100 does not exist, the PL/SQL program throws a No_data_found exception when it executes to this SELECT statement.However, if you query an existing department, multiple rows of data may be returned. For example, if you change the cond
Oracle tutorial pl/SQL introduction, oracle tutorial plsql
This example describes Oracle pl/SQL. We will share this with you for your reference. The details are as follows:
I. What is pl/SQL
PL/SQL program block Declarations section, this is more obvious is the subroutine, the subroutine can be in the execution part of the reference, can also be referenced in the Exception handling section. PL/SQL blocks can be compiled independently and stored in a database, and any application connected to the database
Tags: database pl-sqlDatabase Review CH10 PL/SQL 10.1 PL/SQL IntroductionPL /SQL is the process of Oracle's expansion of the procedure for the implementation of a program of SQL-related
Misunderstanding #4: DDL triggers (introduced after SQL Server 2005) are INSTEAD triggers
This is wrong
The implementation principle of DDL triggers is actually an AFTER trigger. This means that a DDL operation is performed first, and then the trigger captures the operation (of course, if you write Rollback in the trigge
database);4) Improve system performance; Disadvantages1) It is not easy to migrate applications to heterogeneous databases (Oracle only); 5. The difference between SQL vs. plAnswer: sql:1) Fourth generation language (smart language);2) What to do, no matter how;3) Lack of process and control statements;4) No algorithmPL/SQL:1) extended variables and types;2) ext
Abstract: In the PL/SQL development process, SQL, PL/SQL can be used to meet most of the requirements. However, in some special cases, standard SQL statements or DML statements in PL/
, similar to T-SQL. PL/SQL uses block syntax to complete a function. The block syntax format of PL/SQL is as follows.[DECLARE]--- DefinitionBEGIN--- Execution part[EXCEPTION]--- Exception handlingENDEach statement in PL/
system, such as the startup and shutdown of an Oracle system. Triggers consist of: Trigger event: In which case the trigger is triggered; For example: INSERT, UPDATE, DELETE. Trigger time: That is, whether the trigger is triggered before the triggering event (before) or
Abstract: In the PLSQL development process, the use of SQL and PLSQL can meet most of the requirements, but in some special circumstances, using standard SQL statements or DML statements in PLSQL cannot meet your needs. for example, dynamic table creation or an uncertain operation must be performed dynamically. This requires dynamic
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.