I'm working on a project for my systems analysis class, which involves creating a few tables and printing out information from them. Our teacher has taught us nothing of use for this project so I have been winging it thus far. Any way, I have tried to get one of his sample snippets to compile under the worksheet view in Oracle SQL Developer:
DECLARE
n number;
BEGIN
n:=50;
dbms_output.Put_Line('The value of n is ' || n);
END;
However, when I try to run it I get the following error: Incorrect syntax near the keyword 'DECLARE'. I tried writing the most simple thing I could think of:
BEGIN
dbms_output.Put_Line('the value of n is 20');
END;
But I receive a similar error: Incorrect syntax near the keyword 'BEGIN'. I've been able to get normal SQL table queries to work just fine, so my question is what am I doing wrong here?