Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

3939 there is a mismatch between the number of parameters specified and the number of parameters required - response (1) by saurabhkamath

$
0
0

Here :FOD and :TOD are considered as strings.
DBC.SYSEXECSQL doesnot replace :FOD and :TOD with their date values while running the Replace view query.
 
Now its working fine

REPLACE PROCEDURE DB1.TEMP_SP(#IN_DATE DATE)
                        BEGIN
                        DECLARE TOD CHAR(10);
                        DECLARE FOD CHAR(10);
                        
                         SET FOD = CAST(CAST((#IN_DATE-(365*2)-1) AS FORMAT 'YYYY-MM-DD')AS CHAR(10));
                        SET TOD = CAST(CAST(#IN_DATE AS FORMAT 'YYYY-MM-DD') AS CHAR(10));
                        
                         CALL DBC.SYSEXECSQL('REPLACE VIEW DB1.TEMP_VIEW
                        AS
                        SELECT 
                                                            CAST(CAST(CAST( CALENDAR_DATE AS FORMAT ''YYYYMM'') AS CHAR(6)) AS INTEGER) AS YEAR_MONTH_ID,
                                                            RANK() OVER( ORDER BY YEAR_MONTH_ID DESC ) AS "PERIOD_RANK"                                                            FROM
                                                            SYS_CALENDAR.CALENDAR
                                                            WHERE CALENDAR_DATE BETWEEN '''||:FOD||''' AND '''||:TOD||'''                                                
                                                GROUP BY YEAR_MONTH_ID');
                                    END;

 


Viewing all articles
Browse latest Browse all 27759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>