Quantcast
Channel: Oracle, MySQL, Sybase, Informix and other databases
Viewing all articles
Browse latest Browse all 1350

Create calendar table of next year using stored procedure in MySQL

$
0
0

hi all

i need create calendar table of next year using stored procedure in MySQL.

on this code the problem is setting value of next year, because the result is

Procedure execution failed
1064 - You have an error in your SQL syntax; check the manual that corresponds 
to your MySQL server version for the right syntax to use near 
'(tbl_calendar_2025') t3
WHERE
	(d0 * 10 + d1) < 24
ORDER BY
	start_d' at line 21

I can't set next year in this part of code

SET @tbl = DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 5 YEAR),'%Y');

SET @s = CONCAT('SELECT ...
JOIN CONCAT(tbl_calendar_', @tbl ,'\') t3
WHERE
	(d0 * 10 + d1) < 24
ORDER BY
	start_date,
	end_date;');

PREPARE stmt FROM @s;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;

how do i set the next year variable in this procedure?

any idea?

thanks in advance for any help


Viewing all articles
Browse latest Browse all 1350

Trending Articles



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