Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The MariaDB transaction method for adding variables in insert into statements is to use the SET keyword to assign the value of the variable before the insert statement.

Here's an example:

SET @first_name = 'John';
SET @last_name = 'Doe';

INSERT INTO employees (first_name, last_name) VALUES (@first_name, @last_name);

In this example, we first set the variables @firstname and @lastname to their respective values. We then use those variables in the insert into statement to insert a new employee record into the employees table.