You haven't created the stored procedure correctly. The first time you have done it the first SQL line stops at ; because you have failed to specify a delimiter.
In your second attempt you are indeed correct in specifying a BEGIN/END clause as this is what you should be doing.
However what you are mostly likely to want is as follows :
Code:
delimiter //
CREATE PROCEDURE IntSetUp (IN a_var VARCHAR(100))
BEGIN
SELECT a.value, b.value
FROM db2.table1 a inner join db2.table2 b on a.id=b.id
where a.value=a_var;
INSERT into db1.table2
(valueA, valueB)
SELECT a.valueA, a.valueB
FROM db2.table1 a where a.value=a_var;
END;
//
delimiter ;
All of the above wants to be specified at cmd line.