you have to write the query in your pl/sql block
also the results returned by the query should be stored in a variable
DECLARE stu_id number;
v_name varchar(10);
Begin
stu_id :=403984
SELECT s.name
INTO v_name
FROM students s
WHERE s.student_id = stu_id;
END;
/
if you use a simple datatype like string, you can store only the name
to store the complete record, you will require a record set
Its not that difficult once you get used to it
Also the above program wont display anything because there is no print statement
if you want to print, write
DBMS_OUTPUT.PUT_LINE(v_name);
before the END;
and if it still doesnt print, use the SQL * plus commad : - SET SERVEROUTPUT ON
before you run the program