Out Parameters in PREPARE
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
Out parameters in PREPARE
were only available for an earlier version of MariaDB.
You can use question mark placeholders for out-parameters in the PREPARE statement. Only SELECT … INTO can be used this way:
PREPARE test FROM "select id into ? from t1 where val=?";
EXECUTE test USING @out, @in;
This is particularly convenient when used with compound statements:
PREPARE stmt FROM "BEGIN NOT ATOMIC
DECLARE v_res INT;
SELECT COUNT(*) INTO v_res FROM t1;
SELECT 'Hello World', v_res INTO ?,?;
END"|
This page is licensed: CC BY-SA / Gnu FDL