I am having a functions of this type:
FUNCTION mfi_cust_details (vacid VARCHAR2)
RETURN VARCHAR2
IS
vcustdetails VARCHAR2 (300);
BEGIN
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);
EXCEPTION
WHEN NO_DATA_FOUND
THEN
vcustdetails :=
NULL
|| ','
|| NULL
|| ','
|| NULL
|| ','
|| NULL
|| ','
|| NULL
|| ','
|| NULL
|| ','
|| NULL;
END;
RETURN vcustdetails;
END mfi_cust_details;
and I need to insert data from these into a table for example:
insert into my_table values(mfi_cust_details(myacid),anotherFunction());
but My procedure is not even compiling with an error:
not enough values
is whatever I am trying to do even possible?
EDIT My table definitions
create table my_table cust_title_code varchar2(10),
cust_id varchar2(10),
address1 varchar2(10),
address_2 varchar2(10),
city_code varchar2(5),
country_code varchar2(5),
zip_code varchar2(10));
INSERT INTO..SELECTstatement.INSERT INTO A(col1,col2) VALUES(val1.val2)