I am trying to assign the output of multiple pl/sql select queries to a variable in a pl/sql procedure. This works for a single select query:
select field1 into mystring from mytab1;
But I wanted to concatenate the outputs of two separate sql queries into the variable:
In know this does not work:
mystring := (select field1 into mystring from mytab1) || ' ' || (select field2 into mystring from mytab2);
How could I write a single (if possible) sql statement to achieve the above?
I also have a second problem above. If the sql (in the later case concatenated o/p) returns null, I get no-data-found exception. How could I assign "mystring" to NULL in the event above sql(s) return null and it never raise exception?