Quantcast
Channel: sqlcl | ThatJeffSmith
Viewing all articles
Browse latest Browse all 125

SQLcl: Optimizing Your History Lists

$
0
0

Since SQLcl is a command line tool, it’s not super helpful to have a huge command history list. How do I mean? Well, in the SQL Developer GUI, we have a History panel. It allows for sorting, filtering, scrolling, etc. So you can go ‘crazy’ and set your History limit to 1000 if you want. But, in SQLcl, we limit the user to their last 100 commands.

Now there are many commands you’ll be running in SQLcl that you won’t necessarily want to be stored in the history. For example, do you want to reserve 1% of your history to remember how to clear the screen?

So in the latest drop, available today, you can now tell SQLcl NOT to store certain things.

Scroll down to the bottom of the SQL Developer downloads page to get to the 12MB SQLcl package.

But, by default, the history will store EVERYTHING. So you have to take extra step(s) to prevent things going into the history.

Blacklisted Commands

The developers know that there will be lots of questions as they had new features, above and beyond what SQL*Plus offers. So you’ll find lots of good stuff in the HELP.

give us a comma delimited list of commands you don't want to go into your history

give us a comma delimited list of commands you don’t want to go into your history

Ok, so I don’t want to see SET commands or where I go to clear the screen, and a couple of other things.

NEW items won’t go into the history if they start with these words.

NEW items won’t go into the history if they start with these words.

If you already have a SQL History, you’ll need to clear it first, and then going forward these items won’t go in. Or just let them age out…

HISTORY CLEAR — this will clear your history :)

Failures

Ok, now maybe you’re going to work on a query. And you know it’s not going to work for awhile. Or, maybe you’re like me and you rarely get the SQL just right on your first try. In that case you MAY not want to save the failures.

It's a toggle. Run it to switch the mode.

It’s a toggle. Run it to switch the mode.

So I’m going to disable bad SQL going into the history.

Remember, by default, we record EVERYTHING.

Remember, by default, we record EVERYTHING.

I don’t think I’ll run in this mode that often. If I do turn it on, it will be on a short term basis, and then I’ll probably turn it off.


Viewing all articles
Browse latest Browse all 125

Trending Articles