RhythmAddict112
Programmer
Hi all,
It's friday at 4:57 and my brain is not performating optimally by any means....I'm going wrong somewhere in this proc. with the concats and was hoping someone could point out my error(s?)
I can't get past the first select..so I'm not sure if there are concat errors in the execute immediate/insert statement at the bottom (yet)
description is a VARCHAR, so the 's are throwing me off on the select...Any help is greatly appreciated, thank you
All hail the INTERWEB!
It's friday at 4:57 and my brain is not performating optimally by any means....I'm going wrong somewhere in this proc. with the concats and was hoping someone could point out my error(s?)
Code:
AS
PROCEDURE ADD
(i_area IN area.id%TYPE,
i_group IN ciw_groups.id%TYPE,
i_table IN varchar2,
i_description IN group_accounts.description%TYPE,
RC1 IN OUT REF_CUR
)
IS
v_Exist varchar2(100);
BEGIN
OPEN RC1 FOR
'SELECT * FROM accounts;';
|| i_table
|| ' WHERE Area = '
|| i_area
|| ' AND GroupID = '
|| i_group
|| ' AND description = ''
|| i_description
|| '';';
-- fetch rc1 into v_exist;
-- dbms_output.put_line(i_description);
EXCEPTION
WHEN NO_DATA_FOUND THEN
EXECUTE IMMEDIATE ('INSERT INTO ' ||i_table|| '
(Description, Area, GroupID)
VALUES ('
||i_description||','
||i_area||','
||i_group||');');
END;
END;
I can't get past the first select..so I'm not sure if there are concat errors in the execute immediate/insert statement at the bottom (yet)
description is a VARCHAR, so the 's are throwing me off on the select...Any help is greatly appreciated, thank you
All hail the INTERWEB!