Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> HELP - PL/SQL
This is what I'm trying to do:
From the first table I want to select all the values from field1. Then I want to pull all records which contain this value from table2. This is no problem; however, if the value from table_name1, field1 is not in table_name2 I still need to pull the data from table_name1 and then create null values for the fields from table_name2, or atleast still pull the data from table_name1. The following procedure is what I came up with. The IF statement doesn't work because the statement must be a unary operator, boolean or some declared variable, but the logic is there. Any help greatly appreciated. EMAIL ME! In SQL the first part of the IF statement would be:
create procedure get_geo IS
BEGIN
IF (field1_table_name1 in (select field1_table_name2 from table_name2)) THEN select field1, field2, field# from table_name1, table_name2; ELSE select field1, field2 from table_name1; END IF;
-- Robert J. Huber huberrj_at_apci.net - home huberrj_at_hqamc.safb.af.mil - officeReceived on Wed Mar 26 1997 - 00:00:00 CST
![]() |
![]() |