I’m getting my first experience with Oracle and TOAD (I know SSMS). I came across this “%Type” next to an input parameter in an update procedure and I have no idea what it is or what it means. I found links on Google related to “%Rowtype”. Is the same thing or something entirely different?
If this is vague, I apologize. As always, thanks for the help.
Oracle (and PostgreSQL) have:
%TYPE
%TYPEis used to declare variables with relation to the data type of a column in an existing table:The benefit here is that if the data type changes, the variable data type stays in sync.
Reference: http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/fundamentals.htm#i6080
%ROWTYPE
This is used in cursors to declare a single variable to contain a single record from the resultset of a cursor or table without needing to specify individual variables (and their data types). Ex: