You need to change default query terminator([;]) to sth else than ; and you may need to add this separator and new line between blocks of code:

SqlFiddleDemo
DECLARE
x NUMBER := 100;
BEGIN
FOR i IN 1..10 LOOP
IF MOD(i,2) = 0 THEN
INSERT INTO temp VALUES (i, x, 'i is even');
ELSE
INSERT INTO temp VALUES (i, x, 'i is odd');
END IF;
x := x + 100;
END LOOP;
COMMIT;
END;
Answer from Lukasz Szozda on Stack OverflowWhat's up with that [ ; ] button under each panel?
This obscure little button determines how the queries in each of the panels get broken up before they are sent off to the database. This button pops open a dropdown that lists different "query terminators." Query terminators are used as a flag to indicate (when present at the end of a line) that the current statement has ended. The terminator does not get sent to the database; instead, it merely idicates how I should parse the text before I execute the query.
Oftentimes, you won't need to touch this button; the main value this feature will have is in defining stored procedures. This is because it is often the case that within a stored procedure's body definition, you might want to end a line with a semicolon (this is often the case). Since my default query terminator is also a semicolon, there is no obvious way for me to see that your stored procedure's semicolon isn't actually the end of the query. Left with the semicolon terminator, I would break up your procedure definition into incorrect parts, and errors would certainly result. Changing the query terminator to something other than a semicolon avoids this problem.
sqlfiddle - SQL Fiddle - ORACLE 11G and Stored procedure - Stack Overflow
oracle database - how to get PL/SQL in SQLFiddle? - Stack Overflow
SQL Fiddle - Oracle Stored Procedure not updating rows - Stack Overflow
oracle - DB<>Fiddle: Custom type and function (ORA-24344) - Database Administrators Stack Exchange
UPDATE: All seems to be working again. See the answer from Jake Feasel (the creator of SQL Fiddle).
To summarise info from the comments as an answer and bring up to date as of writing:
- SQLFiddle was broken for about a year but as of 2017-07-07 it is working for Oracle 11g R2.
- It also seems to be broken for MS SQL Server 2008, MS SQL Server 2014 and MySQL 5.5 but MySQL 5.6 is working.
(Please comment if any of the above changes and I'll update the answer accordingly).
SQLFiddle Alternatives
- http://rextester.com has options for MySQL, Oracle, PostgreSQL and SQL Server in the "Language" dropdown (as well as the ability to save work online in a similar way to SQLFiddle).
- http://db-fiddle.com has options for MySQL 5.5 / 5.6 / 5.7 / 8.0, PostgreSQL 9.4 / 9.5 / 9.6 / 10.0 and SQLite 3.16 / 3.17 / 3.18.
- https://dbfiddle.uk has options for MariaDB 10.2 / 10.3, MySQL 8.0, Oracle 11g Release 2, Postgres 8.4 / 9.4 / 9.5 / 9.6 / 10 / 11, SQL Server 2012 / 2014 / 2016 / 2017 / 2017 (Linux) and SQLite 3.8 / 3.16 (as well as the ability to save work online in a similar way to SQLFiddle). See further discussion here.
- Suggested alternatives for Oracle are Oracle Application Express and Oracle Live SQL.
- A MySQL alternative with more limited functionality is sqlize.com.
- A clunky MySQL alternative is sqltest.net (if you can find your way around the adverts).
- As a last resort, I've occasionally seen answers that use Stack Exchange Data Explorer to create custom queries (in SQL Server 2016) that aren't based on the built-in tables. [Disclaimer: I'm not sure it's really supposed to be used for this kind of purpose.]
if you are still interested in using SQL Fiddle I have some good news. Today I have gone live with a new version of the site which aims to improve both performance and reliability. If you are still having trouble, please let me know. Thanks
Any website that emulate SQL code where one could write a small database?