Collections:
Use SQL Statements in PL/SQL in Oracle
How To Use SQL Statements in PL/SQL in Oracle?
✍: FYIcenter.com
SQL DML (Data Manipulation Language) statements can be included in PL/SQL code blocks directly without any changes. See the script below for examples:
SQL> CREATE TABLE tip (id NUMBER(5) PRIMARY KEY,
2 subject VARCHAR(80) NOT NULL,
3 description VARCHAR(256) NOT NULL);
Table created.
SQL> BEGIN
2 INSERT INTO tip VALUES(1, 'PL/SQL',
3 'Good for beginners.');
4 UPDATE tip SET description = 'Good for beginners.';
5 END;
6 /
PL/SQL procedure successfully completed.
SQL> COL subject FORMAT A12;
SQL> COL description FORMAT A24;
SQL> SELECT * FROM tip;
ID SUBJECT DESCRIPTION
---------- ------------ -------------------
1 PL/SQL Good for beginners.
SQL> DROP TABLE tip;
Table dropped.
This script example actually has 3 parts:
⇒ Process Query Result in PL/SQL in Oracle
⇐ Execution Flow Control Statements in Oracle
2019-03-08, 2310🔥, 0💬
Popular Posts:
Why I Can Not Enter 0.001 Second in DATETIME values in SQL Server Transact-SQL? If you enter millise...
Where to find answers to frequently asked questions I am new to Oracle database. Here is a list of f...
How to download and install Microsoft SQL Server Management Studio Express in SQL Server? Microsoft ...
How To Assign Debug Privileges to a User in Oracle? In order to run SQL Developer in debug mode, the...
How to execute statements under given conditions in SQL Server Transact-SQL? How to use IF ... ELSE ...