473,509 Members | 2,880 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

increase the size of UNIX window to see the entire output of a selectdb2 query

hi ,

I am running a " select " query on my DB2 Table ....which has around
45 columns ..from UNIX prompt .
The query output is quiet staggered . Cant we set the window size to
accomodate all the DB2 columns .
Is their any way out to do that .

just the way we do in SQL prompt in Oracle .

Please guide me .

Best Regards
Bikash Karan

Apr 9 '08 #1
2 2182
karanbik...@gmail.com wrote:
I am running a " select " query on my DB2 Table ....which has around
45 columns ..from UNIX prompt . The query output is quiet staggered .
I'd write a small script in my favorite scripting language (such as
Perl) to add a little control over the formatting:

use strict;
use warnings;
use Data::Dumper;
use DBI;

my ($rownum, $dbh, $sth) = (0, undef, undef);
my $query = q{select id integer, firstname, birthday from person};

$dbh = DBI->connect('DBI:DB2:viper', 'db2inst1', '*******') or
die(q{ouch});
$sth = $dbh->prepare($query) or die(q{ouch});
$sth->execute() or die(q{ouch});

while (my $hashref = $sth->fetchrow_hashref()) {
$rownum++;
print qq{$rownum;$_;} . $hashref->{$_} for (keys %{$hashref});
}
$sth->finish() or die(q{ouch});

__END__
$ /usr/bin/perl -wl row_number.pl
1;INTEGER;1
1;BIRTHDAY;2008-04-09 12:08:40.606969
1;FIRSTNAME;bart
2;INTEGER;2
2;BIRTHDAY;2008-04-09 12:08:40.606969
2;FIRSTNAME;lisa
3;INTEGER;3
3;BIRTHDAY;2008-04-09 12:08:40.606969
3;FIRSTNAME;homer
Apr 9 '08 #2
On Apr 9, 10:15 am, karanbik...@gmail.com wrote:
hi ,

I am running a " select " query on my DB2 Table ....which has around
45 columns ..from UNIX prompt .
The query output is quiet staggered . Cant we set the window size to
accomodate all the DB2 columns .
Is their any way out to do that .

just the way we do in SQL prompt in Oracle .

Please guide me .

Best Regards
Bikash Karan
Here is what I do (dont know your platform so it might not work for
you)

db2 "select ....." | less -S

now you can scroll sideways with the arrowkey's

/Lennart
Apr 9 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
4877
by: Stephen Witter | last post by:
I am getting the error: Parameter 4: '@IDENTITY' of type: String, the property Size has an invalid size: 0 When trying to execute a sproc with an varchar output. Here is the asp.net code: ...
1
1481
by: joy_julia446 | last post by:
Hi there, I would like to print my result as below in an output file. I would appreciate if someone can give me some advice. RESULT ClassA,96.678,88.196,8.048,-0.233,456.231,5.890, 1...
2
2084
by: Novice | last post by:
Hi all, as you can see from the subject, I'm try to use an asp:button to create a new browser window and output contents to new window But default if I do the Response.Write("..." The output...
2
3481
by: yoshitha | last post by:
Hi Can any one tell me how to increase size of an array in C#.net with ASP.Net? its very urgent for me thanks yoshitha
5
9305
by: John A Grandy | last post by:
I have a js function that dynamically generates a block of html that includes an anchor tag : <a href="http://www.google.com" target="_blank" /> When the user clicks this link, the new IE6...
1
1792
by: Nagendar | last post by:
Hi, I need Javascript to restrict the size of window after window is resized to 300X400. i.e min width is 300 and min height 400
2
1615
by: Tom Lee | last post by:
hello. i use commonDialogBox in visual basic 6.0 for open file but the contol has short size file browsing box and i want to increase the size or add horizental scroll bar How can i do this? ...
1
4614
by: nagmvs | last post by:
Hello I am unable to upload More than 200kb in to my server and also i can downlaod only less than 4MB file from my server .When i am searching in internet i found solution as u can...
0
7237
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7347
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7416
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7073
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5656
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5062
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3218
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3207
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1571
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.