How to re-run a query?

Moderator: NorbertKrupa

Post Reply
User avatar
usli06
Intermediate
Intermediate
Posts: 93
Joined: Wed Jan 25, 2012 4:53 am

How to re-run a query?

Post by usli06 » Mon May 21, 2012 8:43 pm

Hi all,

In vsql how can I re-run a query with out typing it again? Is the query stored in a buffer like in sql*plus in Oracle?

Thanks!

rajasekhart
Intermediate
Intermediate
Posts: 87
Joined: Wed Apr 25, 2012 8:10 am

Re: How to re-run a query?

Post by rajasekhart » Tue May 22, 2012 2:04 pm

Hi,

I think you dont need to retype it again. just click on up arrow key. It will appear and u can run it.
Let me know if it works.

Thanks,
Raj.
Rajasekhar.T|HP ATP Vertica Big Data Solutions V1

User avatar
JimKnicely
Site Admin
Site Admin
Posts: 1825
Joined: Sat Jan 21, 2012 4:58 am
Contact:

Re: How to re-run a query?

Post by JimKnicely » Tue May 22, 2012 4:55 pm

Hi,

The up arrow only repeats the last line entered. I think usli06 wants to re-send the entire buffer for execution.

The \g meta-command can be used to send query buffer to the server:

Example:

Code: Select all

dbadmin=> select count(*)
dbadmin->   from test1
dbadmin->   join test2 on test2.col2 = test1.col1;
 count
-------
     1
(1 row)

dbadmin=> \g
 count
-------
     1
(1 row)
Jim Knicely

Image

Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.

rajasekhart
Intermediate
Intermediate
Posts: 87
Joined: Wed Apr 25, 2012 8:10 am

Re: How to re-run a query?

Post by rajasekhart » Wed May 23, 2012 7:07 am

Hi Jim,

Today i learned a new command. Thanks for the info.

Raj.
Rajasekhar.T|HP ATP Vertica Big Data Solutions V1

User avatar
usli06
Intermediate
Intermediate
Posts: 93
Joined: Wed Jan 25, 2012 4:53 am

Re: How to re-run a query?

Post by usli06 » Thu May 24, 2012 6:29 pm

Thanks, guys! This was what I needed!

jpcavanaugh
Intermediate
Intermediate
Posts: 149
Joined: Mon Apr 30, 2012 10:04 pm
Location: New York
Contact:

Re: How to re-run a query?

Post by jpcavanaugh » Mon May 28, 2012 5:14 pm

In addition to this, \s will show you the history of the commands that you have run and you can cut/paste to run previous queries.

Post Reply

Return to “vSQL”