Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2004
    Posts
    7

    Question Unanswered: 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

  2. #2
    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

  3. #3
    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

  4. #4
    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. "

  5. #5
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    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.
    Last edited by Marcus_A; 06-18-04 at 01:54.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •