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.

Declaring and using user-defined types

Declaring and using user-defined types - Oracle Database Tutorial

From the course: Oracle Database 19c: PL/SQL

Declaring and using user-defined types

- [Lecturer] All data types available in Oracle tables are available in PL/SQL. Once you're in PL/SQL, you can use some of PL/SQL's built-in data types to make your code more robust and efficient. All native SQL data types are fully compatible with PL/SQL with some minor exceptions, primarily in the maximum length. SQL max size refers to the size of the variable that can be stored in a database table outside of PL/SQL. If you have a column and a table defined as CHAR, it can be up to 2,000 bytes. In PL/SQL, up to 32,767 bytes. By default, VARCHAR2 columns have a maximum size of 4,000, but you can set the max string size to extend it to support VARCHAR2 in tables up to 32,767. Large objects like BLOBS and CLOBS can be up to 128 terabytes in PL/SQL, but when you store one of those in a database table, it's maximum size is limited depending on the database block size. With a 32K database block size, you can store 128 terabyte CLOB in your database. Otherwise, you're limited to only 32…

Contents