0

I can retrieve a command history from sqlline 1.9.0 using !history, for example:

0: jdbc:phoenix:> !history
  139  16:45:44  SELECT DISTINCT BIOBANKSUBJECTID FROM VCF;
  ...
  145  20:06:20  !/139
  146  20:06:30  !rerun 139
  147  20:07:00  !rerun !139

I'd like to be able to rerun a command as in Unix, where I type !139 to get that previous command to execute. That doesn't seem to work in sqlline, nor do the things I tried in commands 145-147. Is there any way to rerun a command besides copy and paste?

Here's a screen shot showing a later failed attempt. enter image description here

kc2001
  • 5,008
  • 4
  • 51
  • 92

1 Answers1

0

To rerun a command from sqlline's command history, follow these steps:

  1. Open sqlline and connect to your database.

  2. Type !history and press Enter. This will display a list of all the commands you have entered in the current session, along with their corresponding line numbers.

  3. Identify the line number of the command you want to rerun.

  4. Type !<line_number> and press Enter. For example, if the line number of the command is 5, you would type !5 and press Enter.

  5. The command will be executed again.

Note: If you want to edit the command before rerunning it, use the !edit <line_number> command instead. This will open the command in your default text editor, allowing you to make any necessary changes before running it again.

Arzu
  • 1
  • 1