HELP - PL/SQL

From: Robert J. Huber <huberrj_at_apci.net>
Date: 1997/03/26
Message-ID: <3339E114.500E_at_apci.net>#1/1


[Quoted] 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 [Quoted] there. Any help greatly appreciated. EMAIL ME! In SQL the first part of the IF statement would be:         

create procedure get_geo IS
BEGIN

[Quoted] 	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;

END
-- 
Robert J. Huber

huberrj_at_apci.net - home
huberrj_at_hqamc.safb.af.mil - office
Received on Wed Mar 26 1997 - 00:00:00 CET

Original text of this message