Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How can we retrieve the data from a table

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: How can we retrieve the data from a table
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    Post subject:
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    Post subject: Re: How can we retrieve the data from a table
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    Post subject:
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    Post subject: Re: How can we retrieve the data from a table
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts Table(Unicode(Graphic) table) loading... muralikrishnan_new DB2 0 Thu Oct 05, 2017 5:10 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us