IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How can we retrieve the data from a table


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rameshbabu
Warnings : 1

New User


Joined: 23 May 2005
Posts: 27

PostPosted: Wed Jul 13, 2005 7:10 pm
Reply with quote

Hi
plse clarify my doubt

I want retrieve the first ten columns with out knowing their name(columns)
from a table(table name X)
Back to top
View user's profile Send private message
parikshit123

Active User


Joined: 01 Jul 2005
Posts: 269
Location: India

PostPosted: Mon Jul 18, 2005 5:47 pm
Reply with quote

Hi Ramesh babu,

Its not possible to retrive first N columns from a database table.
Back to top
View user's profile Send private message
Gops

New User


Joined: 21 Jul 2005
Posts: 23

PostPosted: Tue Aug 02, 2005 3:44 pm
Reply with quote

Hi Guys,

Try out these queries.

select * from TABLENAME fetch first row only;

select * from TABLENAME fetch first 50 rows only; ==> will fetch first 50 rows from the table.

Cheers icon_smile.gif
Gops
Back to top
View user's profile Send private message
paru

New User


Joined: 24 Jun 2005
Posts: 9
Location: INDIA

PostPosted: Wed Aug 03, 2005 3:59 pm
Reply with quote

The queries suggested would only fetch select rows and not select colomns.i.e, in the example stated the 50 rows would contain all the colomns.So i think its not possible to select certain colomns alone from any table.

Cheers,
Paru
Back to top
View user's profile Send private message
Prasanthhere

Active User


Joined: 03 Aug 2005
Posts: 306

PostPosted: Wed Aug 03, 2005 4:36 pm
Reply with quote

Try out these queries.

select * from TABLENAME fetch first N only; where n= no of rows u want2 fetch
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts How to save SYSLOG as text data via P... All Other Mainframe Topics 4
No new posts Store the data for fixed length COBOL Programming 1
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
Search our Forums:

Back to Top