dbTalk Databases Forums  

[Info-Ingres] FW: Ingres command line client - vertical output?

comp.databases.ingres comp.databases.ingres


Discuss [Info-Ingres] FW: Ingres command line client - vertical output? in the comp.databases.ingres forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Martin Bowes
 
Posts: n/a

Default [Info-Ingres] FW: Ingres command line client - vertical output? - 03-22-2011 , 05:57 AM






Hi All,

In MySQL's command line client, if you end a query with \G (as opposed to \g) it outputs results in vertical format instead of the usual table format (handy as it makes tables with large numbers of columns a bit more readable).

Is this possible in Ingres? I'm pretty sure the answer is no. I've just read the manual and can't see anything that would say otherwise.

Here's an example of what I mean from MySQL. Vertical:


mysql> select * from op_sys \G
*************************** 1. row ***************************
id: 1
value: All
sortkey: 100
isactive: 1
visibility_value_id: NULL
*************************** 2. row ***************************
id: 5
value: Other
sortkey: 500
isactive: 1
visibility_value_id: NULL

Marty

Reply With Quote
  #2  
Old   
Martin Bowes
 
Posts: n/a

Default Re: [Info-Ingres] FW: Ingres command line client - vertical output? - 03-22-2011 , 06:21 AM






Actually I think I'd prefer a \[no]vertical switch over a case sensitive \G.

Once the \vertical is issued the display become vertical on each subsequent query until the \novertical is issued at which point the normal tabular format is returned.

Sounds lika an OpenSource project to me.

Marty

-----Original Message-----
From: Martin Bowes [mailto:martin.bowes (AT) ctsu (DOT) ox.ac.uk]
Sent: 22 March 2011 11:57
To: Ingres and related product discussion forum
Subject: [Info-Ingres] FW: Ingres command line client - vertical output?

Hi All,

In MySQL's command line client, if you end a query with \G (as opposed to \g) it outputs results in vertical format instead of the usual table format (handy as it makes tables with large numbers of columns a bit more readable).

Is this possible in Ingres? I'm pretty sure the answer is no. I've just read the manual and can't see anything that would say otherwise.

Here's an example of what I mean from MySQL. Vertical:


mysql> select * from op_sys \G
*************************** 1. row ***************************
id: 1
value: All
sortkey: 100
isactive: 1
visibility_value_id: NULL
*************************** 2. row ***************************
id: 5
value: Other
sortkey: 500
isactive: 1
visibility_value_id: NULL

Marty


_______________________________________________
Info-Ingres mailing list
Info-Ingres (AT) kettleriverconsulting (DOT) com
http://ext-cando.kettleriverconsulti...fo/info-ingres

Reply With Quote
  #3  
Old   
Karl Schendel
 
Posts: n/a

Default Re: [Info-Ingres] FW: Ingres command line client - vertical output? - 03-22-2011 , 06:21 AM



On Mar 22, 2011, at 7:57 AM, Martin Bowes wrote:

Quote:
Hi All,

In MySQL's command line client, if you end a query with \G (as opposed to \g) it outputs results in vertical format instead of the usual table format (handy as it makes tables with large numbers of columns a bit more readable).

Is this possible in Ingres? I'm pretty sure the answer is no. I've just read the manual and can't see anything that would say otherwise.
Ingres's terminal monitor doesn't do it. QBF can do something
vaguely similar to this vertical format.

It would certainly be possible; it's just a formatting change in the tm.
I think I'd be tempted to use something other than \G, though;
maybe \v or something like that.

Sounds like a good sprint project. :-)

Karl

Reply With Quote
  #4  
Old   
Martin Bowes
 
Posts: n/a

Default Re: [Info-Ingres] FW: Ingres command line client - vertical output? - 03-22-2011 , 06:46 AM



I've just been told PostgresSQL does this with a \x toggle switch.

So the session starts in tabular, the first \x converts it to vertical, the next \x converts it to tabular and so on.

I know Geraint Jones was planning a few terminal monitor additions for the UKIUA codesproint in Slough, 4-6th June.
Perhaps I can persuade him to add this as well.

BTW. Are you turning up to Codesprint and/or the UKIUA Conference this year?

I'm fully prepared to let you drink all of Roy's Red wine.

Marty

-----Original Message-----
From: Martin Bowes [mailto:martin.bowes (AT) ctsu (DOT) ox.ac.uk]
Sent: 22 March 2011 12:21
To: Ingres and related product discussion forum
Subject: Re: [Info-Ingres] FW: Ingres command line client - vertical output?

Actually I think I'd prefer a \[no]vertical switch over a case sensitive \G.

Once the \vertical is issued the display become vertical on each subsequent query until the \novertical is issued at which point the normal tabular format is returned.

Sounds lika an OpenSource project to me.

Marty

-----Original Message-----
From: Martin Bowes [mailto:martin.bowes (AT) ctsu (DOT) ox.ac.uk]
Sent: 22 March 2011 11:57
To: Ingres and related product discussion forum
Subject: [Info-Ingres] FW: Ingres command line client - vertical output?

Hi All,

In MySQL's command line client, if you end a query with \G (as opposed to \g) it outputs results in vertical format instead of the usual table format (handy as it makes tables with large numbers of columns a bit more readable).

Is this possible in Ingres? I'm pretty sure the answer is no. I've just read the manual and can't see anything that would say otherwise.

Here's an example of what I mean from MySQL. Vertical:


mysql> select * from op_sys \G
*************************** 1. row ***************************
id: 1
value: All
sortkey: 100
isactive: 1
visibility_value_id: NULL
*************************** 2. row ***************************
id: 5
value: Other
sortkey: 500
isactive: 1
visibility_value_id: NULL

Marty


_______________________________________________
Info-Ingres mailing list
Info-Ingres (AT) kettleriverconsulting (DOT) com
http://ext-cando.kettleriverconsulti...fo/info-ingres


_______________________________________________
Info-Ingres mailing list
Info-Ingres (AT) kettleriverconsulting (DOT) com
http://ext-cando.kettleriverconsulti...fo/info-ingres

Reply With Quote
  #5  
Old   
Karl Schendel
 
Posts: n/a

Default Re: [Info-Ingres] FW: Ingres command line client - vertical output? - 03-22-2011 , 06:55 AM



On Mar 22, 2011, at 8:46 AM, Martin Bowes wrote:

Quote:
I've just been told PostgresSQL does this with a \x toggle switch.

So the session starts in tabular, the first \x converts it to vertical, the next \x converts it to tabular and so on.

I know Geraint Jones was planning a few terminal monitor additions for the UKIUA codesproint in Slough, 4-6th June.
Perhaps I can persuade him to add this as well.


I liked your idea of \v and \nov much better than \x. I'm not
sure which language has a word-equivalent for "vertical"
that starts with the letter x ...

I just took a very very quick look at front/tm/qr, and I don't think that
a vertical mode would be hard to implement at all. Definitely
a good sprint project. (And yes, I plan on being there!)

Karl

Reply With Quote
  #6  
Old   
Ingres Forums
 
Posts: n/a

Default Re: [Info-Ingres] FW: Ingres command line client - vertical output? - 03-22-2011 , 09:04 AM



Quote:
I know Geraint Jones was planning a few terminal monitor additions
Well, since Marty mentions it there are a few small changes I was
looking at. Nowhere near submissible as they stand I'm sure, and no
design spec yet (that's doing things the wrong way round really isn't
it...)
Nevertheless, if there's to be a sprint this year I'd apprecate the
opportunity to maybe get some sanity checking, pointers for improvement,
what-to-do-next...?

Briefly the changes are:
\sh <command> (if a command's specified run it & return, rather than
starting an interactive shell - trivial change)
\redir <file> (send query output to a file)
\colformat colname format (if a following query includes column name
"colname", output it using display format "format" - just pulling some
of the existing report writer display formatting into tm)

The vertical display stuff sounds equally worthwhile - if not more so
if it's something users are asking about.

GJ


--
geraintjones

Reply With Quote
  #7  
Old   
Karl Schendel
 
Posts: n/a

Default Re: [Info-Ingres] FW: Ingres command line client - vertical output? - 03-22-2011 , 09:24 AM



On Mar 22, 2011, at 11:04 AM, Ingres Forums wrote:

Quote:
I know Geraint Jones was planning a few terminal monitor additions

Well, since Marty mentions it there are a few small changes I was
looking at. Nowhere near submissible as they stand I'm sure, and no
design spec yet (that's doing things the wrong way round really isn't
it...)
No, no, that's the right way. Don't let anyone tell you different. :-)

Quote:
Briefly the changes are:
\sh <command> (if a command's specified run it & return, rather than
starting an interactive shell - trivial change)
\redir <file> (send query output to a file)
\colformat colname format (if a following query includes column name
"colname", output it using display format "format" - just pulling some
of the existing report writer display formatting into tm)
How is /redir different from /script?

I rather like the others. Some might argue that \colformat colname
should in fact be \colformat table.colname, but I think they
would be wrong...

Karl

Reply With Quote
  #8  
Old   
Ingres Forums
 
Posts: n/a

Default Re: [Info-Ingres] FW: Ingres command line client - vertical output? - 03-22-2011 , 09:30 AM



Hello GJ,

A few of these topics are already available:
- \s or \sh or \shell ==>Escapes to the operating system.
- \w or \write filename ==>Writes the contents of the query buffer to
the named file.
- \script [filename] ==> Toggles between logging and not logging the
session to a file.
Here whole options:
http://tinyurl.com/4jphrnp

Great thoughts :-)
Bilgihan


--
bilgihan

Reply With Quote
  #9  
Old   
Roy Hann
 
Posts: n/a

Default Re: [Info-Ingres] FW: Ingres command line client - vertical output? - 03-22-2011 , 09:52 AM



Ingres Forums wrote:

Quote:
Nevertheless, if there's to be a sprint this year [...].
The sprints are organized by Ingres Corp, but I have been told several
times in the last few weeks that there will be a sprint the weekend
before the UK IUA conference again this year. So plan accordingly and
watch for the official announcement.

--
Roy

UK Ingres User Association Conference 2011 will be on Tuesday June 7 2011.
Register at http://www.regonline.co.uk/ukiua2011

Reply With Quote
  #10  
Old   
Ingres Forums
 
Posts: n/a

Default Re: [Info-Ingres] FW: Ingres command line client - vertical output? - 03-22-2011 , 09:59 AM



Quote:
How is /redir different from /script?
The idea with /redir is it sends only the output of the query to the
file, stdout still gets the rowcount and any errors etc.
I thought it might be useful after I'd been creating a large csv file
using the new tm commands /silent, /vdelim etc:
http://tinyurl.com/4lvssza

Perhaps an example:
[ingres@vm64 tm]$ sql iidbdb
INGRES TERMINAL MONITOR Copyright 2010 Ingres Corporation
Ingres Linux Version II 10.1.0 (a64.lnx/00)NPTL login
Tue Mar 22 15:45:03 2011
continue
* select 1\p\g
/* SQL Startup File */
select 1
Executing . . .


┌──────┐
│col1 │
├──────┤
│ 1│
└──────┘
(1 row)
continue
* \redir /tmp/outputfile1
Query output redirected into `/tmp/outputfile1'.
* * select 2\p\g

select 2
Executing . . .

(1 row)
continue
* \q
Your SQL statement(s) have been committed.

Ingres Version II 10.1.0 (a64.lnx/00)NPTL logout
Tue Mar 22 15:45:20 2011
[ingres@vm64 tm]$ cat /tmp/outputfile1

┌──────┐
│col1 │
├──────┤
│ 2│
└──────┘
[ingres@vm64 tm]$


--
geraintjones

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.