We have this option to pass table valued parameters in SQL Server Stored procedure.
For example :
CREATE OR ALTER PROCEDURE [dbo].[TestProcedure]
(
@Id INT,
@StartDate DATETIME,
@EndDate DATETIME,
@TestIds1 dbo.UserDefinedTableType1 READONLY,
@TestIds2 dbo.UserDefinedTableType2 READONLY
)
Do we have a similar option in MySQL?
Currently I am passing comma separated string as Text parameter and extracting from that.
For example, if I want
Id
1
2
I am passing,
'[{"Id":1},{"Id":2}]'
CALL TestProcedure ( ID1, '[{"Id":1},{"Id":2}]', '[{"Id2":1}]', 'No' );
and extracting like
SELECT *
FROM JSON_TABLE(Ids,"$[*]"
COLUMNS(Id INT PATH "$.Id")) AS XX;