For NVARCHAR2
and VARCHAR2
maximum size is 4000 bytes, or 32767 bytes if the MAX_STRING_SIZE
initialization parameter is set to EXTENDED
. This is useful you have to allocate more data to a variable.
The SELECT INTO is actually a standard SQL query where the SELECT INTO clause is used to place the returned data into predefined variables.
create or replace function auth_Name
( v_auth_state IN author.author_state%type)
return varchar2
as
v_authName author.author_last_name%type;
begin
select author_last_name into v_authName
from author
where author_state = v_auth_state;
return v_authName;
exception
when TOO_MANY_ROWS
then return 'Too Many Authors in that State';
when NO_DATA_FOUND
then return 'No Authors in that State';
when others
then raise_application_error(-20011,'Unknown Exception in authName Function');
end;
What are your thoughts on this post?
I’d love to hear from you! Click this link to email me—I reply to every message!
Also use the share button below if you liked this post. It makes me smile, when I see it.