Howto get data over 2 tables

Hello,

i am a beginner of scriptcase an have a problem with a search over 2 tables.

i hope someone can help me.

in mysql the following code do what in want!

SELECT Zaehlertyp_id, Wohnungs_ID, Installationsort 
INTO @typ
FROM Messeinrichtung_WE 
WHERE Seriennr_Zaehler = '23736264'
ORDER BY Zaehlertyp_id;
-- SELECT @typ, @wohnung, @ort;
SELECT Name
FROM Zaehler_typ
WHERE idZaehler_typ = @typ

But when i enter this in the lookup field in a new field i get an error.

Fehler
Fehler beim Datenbankzugriff:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT Name FROM Zaehler_typ WHERE idZaehler_typ = @typ' at line 6
SELECT Zaehlertyp_id INTO @typ FROM Messeinrichtung_WE WHERE Seriennr_Zaehler = '2376274' ORDER BY Zaehlertyp_id; SELECT Name FROM Zaehler_typ WHERE idZaehler_typ = @typ