I’m out on vacation this week, but you’re in luck. I have to do the Southwest 24 hour check-in thing, so that means I’m stuck on my laptop for a few minutes.
If you’re a command-line kind of guy or gal, then you know all about SQL*Plus. If you’ve spent any time here, then you also know all about SQLcl – our new, modern CLI for Oracle Database.
You’ve probably seen that the tool automatically keeps track of your previous work, and that you can recall it. We call this feature, ‘History’ – and that’s the same name of the command.
Here’s 10 reasons you’re gonna love using this feature.
1. It’s on by default.
You don’t have to do anything to turn it on – it just works out of the box.
2. You don’t need to learn any new commands.
You can just use the up or down arrow keys to cycle through your recent history.
3. You don’t have to worry about exposing critical information, like passwords.
Out of the box, SQLcl does NOT store commands like ‘CONNECT.’ You also don’t have to worry about filling up your history list with a bunch of SET commands. Of course, you can always set the blacklist to dis-allow anything you want.
4. The history isn’t just for this session.
The application stores your history in your OS user $HOME directory, and it’s available from one session to the next.
5. You can change the history limit.
We save 100 of your last ‘things’ out of the box. If you don’t like this limit, you can just change it.
6. We don’t save ‘bad’ queries in the history…
If your query or script fails, it won’t go into the history. But, you might not like that, so you can change it. Just toggle using the SET HISTORY command.
7. We’re not just saving queries.
If you run an anon block, we’re saving those too. Oh, and they count as just a single entry or ‘statement.’
8. Curious how much time said query took to run?
We auto-magically append the SET TIMING ON numbers to your queries. You can see these with the HISTORY TIME command.
9. Run the same things, over and over?
Don’t worry, you won’t see your
SELECT * FROM HR.EMPLOYEES;
queries filling up your history list – we just store it once. And if you run HISTORY USAGE, you’ll see just how many times each item has been executed in SQLcl.
10. If you can’t remember anything else, just remember ‘HISTORY.’
Type it. Run it. See your list. Find the item you want, then add it to the buffer via a ‘history #.’ That history item will now be ready for you to execute or edit.
Oh, and about those Southwest boarding passes…
A49 – A52 acquired for the family. I wonder what’s happened in the real-world these past few days?