INSERT INTO table
(column1, column2, ... column_n )
VALUES
(expression1, expression2, ... expression_n );
INSERT INTO table
(column1, column2, ... column_n )
SELECT expression1, expression2, ... expression_n
FROM source_table
[WHERE conditions];
FUNCTION mfi_cust_details(vacid VARCHAR2) return my_table%ROWTYPE as
my_table%ROWTYPE vcustdetails;
BEGIN
SELECT a.cust_title_code,
a.cust_id,
b.address_line1,
b.address_line2,
mfi_citycountry (b.country, b.city),
b.zip
INTO vcustdetails
FROM tbaadm.cmg a, crmuser.address b
WHERE TRIM (a.cif_id) = TRIM (b.orgkey)
AND UPPER (b.addresscategory) IN ('MAILING', 'REGISTERED')
AND cust_id IN (SELECT cust_id
FROM tbaadm.gam
WHERE acid = vacid);
RETURN vcustdetails;
END;