From the course: Oracle Database 19c: PL/SQL
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Programming constructs: SELECT INTO and %ROWCOUNT - Oracle Database Tutorial
From the course: Oracle Database 19c: PL/SQL
Programming constructs: SELECT INTO and %ROWCOUNT
- [Instructor] The beauty of PL/SQL is that you can take any SELECT query or DML statement you write in Oracle 19c SQL and run them several different ways in PL/SQL. You'll discover how that works and how to use the column data you retrieve with SELECT INTO and for DML statements that populate built-in variables like SQL% ROWCOUNT and SQL% FOUND. One of the key features of PL/SQL is the integration of Oracle SQL and the PL/SQL programming constructs like cursors, FOR LOOPs, and IF-THEN. You can use SELECT statements as well as the DML statements you're familiar with, INSERT, DELETE, UPDATE, MERGE, and so on. All DML statements can run unaltered in PL/SQL, and that's a great benefit for translating ad hoc scripts into stored procedures and functions. Look at this anonymous procedure. It could very well be a stored procedure too. I'm running an INSERT INTO and a DELETE FROM the department's archive table. I could run those statements without PL/SQL as well unchanged. Both run without…