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:
2019-03-08, 874👍, 0💬
Popular Posts:
What Are the Underflow and Overflow Behaviors on FLOAT Literals in SQL Server Transact-SQL? If you e...
Where Is the Export Dump File Located in Oracle? If you are not specifying the dump directory and fi...
How Can Windows Applications Connect to Oracle Servers in Oracle? A Windows application can connect ...
How To Import One Table Back from a Dump File in Oracle? If you only want to import one table back t...
How to run Queries with "sqlcmd" tool in SQL Server? "sqlcmd" is a client tool that you can use to i...