in reply to using dbi to set database variables

I should have added more detail to the question. Imagine this trigger
CREATE TRIGGER bar AFTER INSERT ON foo FOR EACH ROW BEGIN DECLARE x INT; SET x = NEW.i; SET @a = x; -- set user variable outside trigger END//
I would need to be able to perform the following in perl
SET @a = 0; SELECT @a;
Can i perform a select @a using the standard dbi methods? What would i use to issue the SET command. Could i just use a sth execute call? I will look at this now. By asking the question I have helped myself answer it i think