All Forums Database
mikegtown 1 post Joined 12/11
03 Mar 2014
Passing Macro Paramaters to a With Clause

I am having trouble with a macro.  I cannot pass paramaters to a WITH statement.  Below is an example.  When I pass a paramater I get an error:
"EXECUTE FAILED [3939] There is a mismatch between the number of paramaters specified and the number of paramaters required"
 
Is it possible to do this?
 
REPLACE MACRO MACRO_Test(P_Date Date)
AS
(
WITH qrySub (AccountNumber) AS
(SELECT AccountNumber FROM Tbl_Accounts WHERE Tbl_Accounts.CreatedDate < :P_Date)
SELECT * FROM qrySub
UNION ALL
SELECT * FROM qrySub;
);
 
 

Raja_KT 1246 posts Joined 07/09
04 Mar 2014

I login to  bteq thru linux.
I am in 14.10 and it works fine for me.  I executed 
exec macro_test('1992-01-21');
Cheers,

Raja K Thaw
My wiki: http://en.wikipedia.org/wiki/User:Kt_raj1
Street Children suffer not by their fault. We can help them if we want.

You must sign in to leave a comment.