|
|
Archives of the TeradataForum
Message Posted: Wed, 11 Dec 2013 @ 22:23:42 GMT
Subj: | | Macro with In List parm |
|
From: | | Pinti, Michele A |
I have created a macro and it executes when I pass 1 customer number but I have not been able to passing multiple customer numbers to the In
List. Is there any way to pass multiple values?
I couldn't find a definitive answer on the Forum. I also tries a Stored Procedure but couldn't figure out how to return multiple rows.
REPLACE MACRO PRODMD.Customer_Forms
(Customer_Nb VARCHAR(500))
as (
SELECT
Customer_C_alias_CCN.Customer_Nm,
Customer_C_alias_CCN.Customer_Nb,
PRODVW.Product_Hierarchy_C.Product_Group_2_Nm,
PRODVW.Product_Segmentation_C.Solution_Cd,
PRODVW.Product_Segmentation_C.Category_Cd,
PRODVW.Invoice_History_by_Invoice_Dt.Customer_Form_Nb,
PRODVW.Invoice_History_by_Invoice_Dt.Customer_Form_Nm
FROM
PRODVW.Product_Segmentation_C
RIGHT JOIN PRODVW.Product_Hierarchy_C
ON
PRODVW.Product_Segmentation_C.Product_Id=PRODVW.Product_Hierarchy_C.Product_Id
LEFT JOIN PRODVW.Invoice_History_by_Invoice_Dt
ON
PRODVW.Invoice_History_by_Invoice_Dt.Product_Id=PRODVW.Product_Hierarchy_C.Product_Id
LEFT JOIN PRODVW.Customer_C Customer_C_alias_CCN
ON
PRODVW.Invoice_History_by_Invoice_Dt.Control_Customer_Id=Customer_C_alias_CCN.Customer_Id
WHERE
PRODVW.Invoice_History_by_Invoice_Dt.Invoice_Dt between '2013-01-01' and '2013-01-30'
And Customer_C_alias_CCN.Customer_Nb in :Customer_Nb; );
exec prodmd.customer_forms ('7900201') this works exec prodmd.customer_forms('''7900201'',''8705356'',''1304132''')
this executes but no data is returned
Michele
| |