Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm
No new posts SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am
No new posts NDM syntax checking without actually ... GAPX1 All Other Mainframe Topics 0 Wed Jun 07, 2017 2:36 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us