Collections:
Define a Variable to Match Column Data Type in Oracle
How To Define a Variable to Match a Table Column Data Type in Oracle?
✍: FYIcenter.com
If you have a table, and want to define some variables to have exactly the same data types as some columns in that table, you can use table_name.column_name%TYPE as data types to define those variables. The tutorial sample below shows you how to do this:
CREATE OR REPLACE PROCEDURE FYI_CENTER AS my_email employees.email%TYPE; my_salary employees.salary%TYPE; BEGIN SELECT email, salary INTO my_email, my_salary FROM employees WHERE employee_id = 101; DBMS_OUTPUT.PUT_LINE('My email = ' || my_email); DBMS_OUTPUT.PUT_LINE('My salary = ' || my_salary); END; / My email = NKOCHHAR My salary = 17000
⇒ Working with Cursors in Oracle PL/SQL
⇐ Update a Table Row with a RECORD in Oracle
2018-08-14, 1746🔥, 0💬
Popular Posts:
How To Get Year, Month and Day Out of DATETIME Values in SQL Server Transact-SQL? You can use DATEPA...
How to download and install Microsoft .NET Framework Version 2.0 in SQL Server? .NET Framework Versi...
How To Get the Definition of a Stored Procedure Back in SQL Server Transact-SQL? If you want get the...
How to run Queries with SQL Server Management Studio Express in SQL Server? 1. Launch and connect SQ...
Where to find answers to frequently asked questions on Storage Engines: MyISAM, InnoDB and BDB in My...