A few quick things to remember:
Try to always use statement delimiters
![We're confused - this looks like one statement to us.](https://www.thatjeffsmith.com/wp-content/uploads/2014/09/statement1.png)
Even before I go to execute this ‘statement’, SQL Devleoper is telling me I have a problem. The grammar check is failing. Notice those red squiggle lines? They actually mean something.
So, add a semi-colon, or do this:
![Highlight what you want to run, and hit ctrl+enter](https://www.thatjeffsmith.com/wp-content/uploads/2014/09/statement2.png)
Know the difference between executing a statement and executing a statement(s) as a script
![First button executes a query, gives you a grid if it has a resultset. Second button sends the command(s) through our SQL*Plus engine and you get standard text output back.](https://www.thatjeffsmith.com/wp-content/uploads/2014/09/statement3.png)
3 Comments
Hello Jeff
What about anonymous blocks?
—
begin
dbms_output.put_line(‘Hello’);
end;
select sysdate from dual;
—
As soon as I have an anonymous block I cannot execute following sql statements with ctrl-enter
Is this intended behaviour or am I missing something?
Regards Erik
@Erik,
Here is what i did in SQL Developer 4.0.2
begin
dbms_output.put_line(‘Hello World’);
end;
/
select sysdate from dual with control – Enter the below sql get executed.
ok, thanks!