Is it possible to set a user-defined variable in a MYSQL query, and then in that same query, call a javascript function, using that variable as an argument?
Here is an example of what I am trying to do. Calling the variable as an argument doesn’t work, I am guessing because it is meaningless inside of the {{}}.
BEGIN;
SELECT @media_id := MAX(id) from media;
INSERT INTO categories (media_id, category_id)
VALUES {{functions.prepare_values_statement(@media_id)}};
COMMIT;