-
SQL stored procedure does not work
Hi, I've tried creating a procedure to spread revenue over 13 periods using MySQL as follows. Error's thrown at declaration/ setting variables. drop procedure if exists load_foo_test_data; delimiter $$ create procedure load_foo_test_data() BEGIN Set @v_max = 13; Set @v_counter =1; start transaction; while `v_counter` <…
-
Data truncated: Incorrect TimeStamp
Hi, I'm using Mysql to insert 12 new rows with an interval of 28 days I've tried date_add function. But, an error appears which reads as " Incorrect datetime value :Time stamp truncated" . insert ignore wouldn't iterate for 12 times. Kindly, help me solve this issue: create procedure MonthlyDeferredRevenue() BEGIN Set…
-
With clause CTE redshift issue
Hi, I'm trying to use a recursive CTE in Redshift to defer revenue over 13 periods ( iteration). The select statement after UNION ALL queries on the table deferredrevenue created within the scope of the "with" clause. The error here reads as relation "deferredrevenue" table name doesn't exist. with…