Why can I not assign a SQL statement to a variable? Thanks!
Code:
CREATE OR REPLACE FUNCTION Lookup(id_no IN NUMBER, table_name IN VARCHAR2)
RETURN VARCHAR2
IS
BEGIN
IF table_name = "vendor"
THEN
return_value := (SELECT vendor_number_tx FROM table_name WHERE vendor_id_no = id_no;)
ELSEIF table_name = "contract"
THEN
return_value := (SELECT contract_num_tx FROM table_name WHERE contract_id_no = id_no;)
END IF;
RETURN return_value
END Lookup;