SQL> declare
2 v_authName author.author_last_name%type;
3 begin
4 select
5 author_last_name into v_authName
6 from
7 author
8 where
9 author_key = ‘A103′;
10
11 dbms_output.put_line(‘Name: ‘||v_authName);
12 end;
13 /
SQL> declare
2 v_author author%rowtype;
3 begin
4 select
5 * into v_author
6 from
7 author
8 where
9 author_key = ‘A103′;
10
11 dbms_output.put_line(‘Name: ’||v_author.author_first_name||’ ‘|| v_author.author_last_name);
12 end;
13 /
Źródła:
http://www.dba-oracle.com/t_pl_sql_plsql_select_into_clause.htm