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 Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am
No new posts Overriding PS data in rexx Shaheen Shaik CLIST & REXX 8 Fri Mar 03, 2017 5:08 pm
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm


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