When you select and execute different parts of the text and then move through the history you will see the selection change for each history entry.
The previous statement can be recalled by pressing key) this will not clear the statement history.
You can configure SQL Workbench/J to automatically jump to the next statement, after executing the current statement.
Simply select When executing all statements in the editor you have to delimit each statement, so that SQL Workbench/J can identify each statement.
If your statements are not delimited using a semicolon, the whole editor text is sent as a single statement to the database. Microsoft SQL Server), but most DBMS will throw an error in that case.
A script with two statements could look like this: DELETE FROM person; DELETE FROM address; COMMIT; INSERT INTO person (id, firstname, lastname) VALUES (1, 'Arthur', 'Dent'); INSERT INTO person (id, firstname, lastname) VALUES (4, 'Mary', 'Moviestar'); INSERT INTO person (id, firstname, lastname) VALUES (2, 'Zaphod', 'Beeblebrox'); INSERT INTO person (id, firstname, lastname) VALUES (3, 'Tricia', 'Mc Millian'); COMMIT; You can specifiy an alternate delimiter that can be used instead of the semicolon.
See the description of the alternate delimiter for details. for stored procedures) that contain semicolons that should not delimit the statements.