We know what to retrieve when changing data into a different format or performing data analysis, but we may get stuck on how to access it. This is a circumstance while working with MySQL in which I need to concatenate two strings that should return the data in different lines. Obviously, different approaches will be taken for each implementation.
MySQL Code:
SET @sql1 = ‘DELIMITER //’;
SET @sql2 = ‘USE TestDB2 //
CREATE PROCEDURE sometest(p1 int, p2 int)
BEGIN
select ”Hai”;
END //
‘;
SELECT CONCAT(@sql1 , CHAR(13), @sql2);
The result is as follows:
DELIMITER //
USE TestDB2 //
CREATE PROCEDURE sometest(p1 int, p2 int)
BEGIN
select ‘Hai’;
END //
Hope you find it helpful.
Please subscribe for more interesting updates.