MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Selecting all columns of a table while using Alias

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
ranga_subham
Intermediate


Joined: 31 Jan 2006
Posts: 255
Topics: 72

PostPosted: Wed Dec 10, 2008 5:37 am    Post subject: Selecting all columns of a table while using Alias Reply with quote

Hi,

I want to select all rows from a table 'B' used in below query.

Code:

SELECT B.TRE_CUST_NBR,                 
       B.OPTO_BARCDE_1,                 
       B.OPTO_BARCDE_2,                 
       B.OPTO_BARCDE_3                 
  FROM DB01.TRE_CUST A,             
       DB01.TRE_CUST_OPTO B         
 WHERE A.TRE_CUST_CD = '2500'     
   AND B.TRE_CUST_NBR = A.TRE_CUST_NBR
WITH UR;                               


There are 10 columns in DB01.TRE_CUST_OPTO table. Is mentioning all of them the only way or any shortcut possible?

Please help.

Thanks.
_________________
Ranga
*****
None of us is as smart as all of us - Ken Blanchard
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Wed Dec 10, 2008 8:13 am    Post subject: Reply with quote

You could use
Code:

SELECT B.*

but that is BAD. As you only have 10 columns it is a minor thing to specify them all - just cut and paste from somewhere e.g DCLGEN
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
ranga_subham
Intermediate


Joined: 31 Jan 2006
Posts: 255
Topics: 72

PostPosted: Thu Dec 11, 2008 5:32 am    Post subject: Reply with quote

Thanks Nic Clouston.
_________________
Ranga
*****
None of us is as smart as all of us - Ken Blanchard
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group