Oracle supports the neeto subquery syntax so you can combine the queries, with no joins, like this
SELECT birthdate from USERDETAILS
where userID IN (SELECT userID FROM USER where name like '%John%');
The other option is to use a temporary table, and do a join on that table. I'm not sure I understand why you don't want to use a join. Otherwise, you'll want to create a stored procedure... this would look something like this :
CREATE OR REPLACE
PROCEDURE get_birthdate (name_match IN VARCHAR(255)) IS
Emp_id NUMBER;
birthdate VARCHAR(255);
CURSOR c1 (match VARCHAR(255)) IS
SELECT id FROM users
WHERE name like match;
CURSOR c2 (birthdate VARCHAR(255)) IS
SELECT birthdate FROM userDetails
WHERE id=Emp_id;
BEGIN
OPEN c1(name_match);
LOOP
FETCH c1 INTO Emp_id;
OPEN c2(Emp_id);
LOOP
FETCH c2 INTO birthdate;
DBMS_OUTPUT.PUT_LINE(birthdate);
EXIT WHEN C2%NOTFOUND
END LOOP
EXIT WHEN C1%NOTFOUND;
END LOOP;
CLOSE c1;
END;
Then you would make a call like select get_birthdate('%John%');
Hope that helps
Chris
Come see the BiteSize SQL Tutorial
http://www.bitesizeinc.net