![]() |
|
Archives of the TeradataForumMessage Posted: Thu, 09 Feb 2012 @ 19:55:46 GMT
<-- Anonymously Posted: Thursday, February 09, 2012 11:27 --> Hi, I have a requirement that the the following statement in a MACRO .
SELECT *
FROM EMPLOYEE
WHERE NAME IN ( 'NAME_1', 'NAME_2', 'NAME_3' ) ;
However , the input to the macro is in the format 'NAME_1, NAME_2, NAME_3'. I tried passing the input as '''name_1'', ''name_2'', ''name_3'''
REPLACE MACRO TEST(NAMES VARCHAR(100))
AS
(
SELECT *
FROM EMPLOYEE
WHERE NAME IN ( :NAMES ) ;
);
EXEC TEST ( '''name_1'', ''name_2'', ''name_3''' ) ;
Is there any way to do this or am I missing anything ? Thanks
| ||||||||||||||||||||||||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||