Using an Alias for Column Names
BEGIN
-- We assign an alias (complete_name) to the expression value, because
-- it has no column name.
FOR item IN (SELECT first_name
||' '
||last_name complete_name
FROM employees
WHERE ROWNUM < 11)
LOOP
-- Now we can refer to the field in the record using this alias.
dbms_output.Put_line('Employee name: '
||item.complete_name);
END LOOP;
END;
/
0 comments:
Post a Comment