If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Using Aliases in SQL

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-17-04, 23:30
boybles boybles is offline
Registered User
 
Join Date: Mar 2004
Posts: 7
Question Using Aliases in SQL

I am new to DB2 and am wondering how I could write the following
SQL statement (from Oracle) for DB2:

Select
T.SERV_CITY,
T.ST_DIRCTN_INDIC,
T.ST_FRAC,
T.ST_NAME,
T.ST_NUM,
T.ST_SUFX_CD,
T.ST_UNIT,
T.ZIP_CD,
H.INSTALL_DT,
H.REMOVAL_DT,
H.STATION_ID
FROM NM.TNM615_SERVICE S ,
NM.TNM614_CUST_ADDR T ,
NF.TNF202_STA_XFM_HIS H
WHERE S.STATION_ID = H.STATION_ID
AND T.ACCOUNT_NUM_19 = S.ACCOUNT_NUM_19
AND H.REMOVAL_DT IS NULL
AND T.ACCOUNT_NUM_19='1010041501914000000'

Any help would be appreciated.
Boybles
Reply With Quote
  #2 (permalink)  
Old 06-17-04, 23:35
trinmoy trinmoy is offline
Registered User
 
Join Date: Nov 2003
Location: kualaumpur
Posts: 33
Thumbs up Try the same ..

you can try the same SQL in db2 , u can get the result.

TIA

Trinmoy
Reply With Quote
  #3 (permalink)  
Old 06-17-04, 23:40
boybles boybles is offline
Registered User
 
Join Date: Mar 2004
Posts: 7
But even trying something simple like

Select
T.SERV_CITY,
T.ST_DIRCTN_INDIC,
T.ST_FRAC,
T.ST_NAME,
T.ST_NUM,
T.ST_SUFX_CD,
T.ST_UNIT,
T.ZIP_CD
FROM NM.TNM614_CUST_ADDR T
WHERE T.ACCOUNT_NUM_19='1010041501914000000'

brings up the following error:


[IBM][CLI Driver][DB2] SQL0904N Unsuccessful execution caused by an unavailable resource. Reason code: "00C200F9", type of resource: "00000220", and resource name: "DBT1.DSNDBC.DNM6.XNM614CR.I0001.A001 ". SQLSTATE=57011


Why is that?

Boybles
Reply With Quote
  #4 (permalink)  
Old 06-17-04, 23:47
trinmoy trinmoy is offline
Registered User
 
Join Date: Nov 2003
Location: kualaumpur
Posts: 33
Verify the source

pls verify the required schema and tablespace is in proper state .

sql0904N means "resource "<resource-name>" of type "<resource-type>" was not
available at the time for the reason indicated by
"<reason-code>". Refer to the Problem Determination
documentation of DB2 for MVS for an explanation of resource type
codes. "
Reply With Quote
  #5 (permalink)  
Old 06-18-04, 00:51
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
You need the Messages and Codes manual(s) which can downloaded at the IBM website. Check out Useful DB2 Stuff thread for teh website, and please read Must Read Before Posting thread.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390

Last edited by Marcus_A; 06-18-04 at 00:54.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On