String manipulation in a MACRO

UDA
Enthusiast

String manipulation in a MACRO

REPLACE MACRO mydb.emp_mac_test(in_emp_id varchar(300) )
AS
(

sel * from db.emp where emp_id in (: in_emp_id);

);

The requirement is that the macro will be executed as follows:
exec mydb.emp_mac_test('A101,A102,A103,A104');

How to modify the input string and convert it as 'A101','A102','A103','A104' in the macro.

1 REPLY

Re: String manipulation in a MACRO

Hey

Use index and substring functions to extract the items from string.