473,586 Members | 2,695 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 2189
karanbik...@gma il.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:D B2: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_hashr ef()) {
$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;bar t
2;INTEGER;2
2;BIRTHDAY;2008-04-09 12:08:40.606969
2;FIRSTNAME;lis a
3;INTEGER;3
3;BIRTHDAY;2008-04-09 12:08:40.606969
3;FIRSTNAME;hom er
Apr 9 '08 #2
On Apr 9, 10:15 am, karanbik...@gma il.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
4884
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: with myCommand.Parameters .Add("@ECO_DESCRIPTION", SqlDbType.VarChar).Value = txtECODescription.text
1
1499
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 11.371,-0.906,-0.025,9999.888,76.888,0.001,3456.899 2 20.422,-20.979,0.422,4567.987,987.987,0.985,0.445, 3...
2
2087
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 gets sent directly to the window or frame that the button was contained in - if I was using regular anchor links I could just specify the target - i.e....
2
3496
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
9312
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 browser window is full vertical size, but only half horizontal size (of available screen area). Starting iexplore.exe independently opens a full-size...
1
1799
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
1626
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? thanks for reading
1
4620
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 increase size of Metabase.xml (In IIS) file up to 1GB. Suppose if i increase size of Metabase.xml file up to 200 MB.is there any problems i can...
0
7836
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8199
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8336
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6606
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5710
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3835
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3863
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2343
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 we have to send another system
0
1175
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.