user2079954 user2079954 - 4 years ago 102
SQL Question

SELECT INTO clause in combined queries

I am using Oracle forms, and in the

WHEN-BUTTON-PRESSED
trigger I am combining two query results using
UNION
operator, my question is how to use the
SELECT INTO
clause to assign the selected values to variables.

Answer Source

The SELECT statement will be same as what you use in plsql. There's no difference. Note that it can result in too many rows exception.

select column_value into l_value
from some_table
where column_value = 'some_value'
union
select column_value
from other_table
where column_value = 'some_value';
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download