This script demonstrates returning clause
SQL> CREATE TABLE book (
2 id NUMBER (10) PRIMARY KEY,
3 isbn CHAR(10 CHAR),
4 description CLOB,
5 descr NCLOB,
6 book_cover BLOB,
7 chapter_title VARCHAR2(30 CHAR),
8 chapter BFILE
9 ) ;
Table created.
SQL>
SQL>
SQL>
SQL> SET SERVEROUTPUT ON LONG 64000
SQL>
SQL> DECLARE
2 v_clob CLOB;
3 BEGIN
4 INSERT INTO book (id,isbn,description,descr,book_cover,chapter)VALUES (1,'3', 'A',EMPTY_CLOB(),EMPTY_BLOB(),BFILENAME('book_LOC', '3.jpg'))RETURNING description INTO v_clob;
5 COMMIT;
6
7 DBMS_OUTPUT.PUT_LINE(v_clob);
8 EXCEPTION
9 WHEN OTHERS
10 THEN
11 DBMS_OUTPUT.PUT_LINE(SQLERRM);
12 END;
13 /
A
PL/SQL procedure successfully completed.
SQL>
SQL>
SQL>
SQL>
SQL> drop table book;
Table dropped.
SQL>
SQL>
SQL>
Related examples in the same category