I have the following code in my stored procedure.
PREPARE seedrecordfetchStatement FROM
"CREATE TEMPORARY TABLE seedrecordfetch
ENGINE = MEMORY
SELECT s.id, i.thumbnailImageUrl, s.daysUntilHarvest,
s.minimumGerminationTemperature, s.plantHeight, s.color
FROM seedrecord s
LEFT JOIN image i ON s.image_id = i.id
WHERE s.id IN ( ? )
AND s.deleted = false";
the value for ? is a commaseperated string of ids of seedrecord rows of which i know they are present in the SeedRecord
table. Yet, no matter how many ids i include the temporary table seedrecordfetch
is always created with one row only. That row always corresponds with the first id in the comma separated id string.
Running the select query separatly returns all the ids that are in the list, so the problem is not with the SELECT statement.
Am i forgetting something here? Or is it simply not possible to create a temporary table with multiple rows of data?
Thank you