Results 1 to 2 of 2

Thread: SQL Help

  1. #1
    Join Date
    Apr 2005

    Unanswered: SQL Help

    We have table to store address information. Table structure like this
    Col1  CHAR(6)
    AddressLine1 CHAR(25)
    AddressLine2 CHAR(25)
    AddressLine3 CHAR(25)
    AddressLine4 CHAR(25)
    AddressLine5 CHAR(25)
    AddressLine6 CHAR(26)
    ZIPCD  CHAR(5)
    The address data is inconsistent in these columns. 
    For. e.g:
    AddressLine1   C/O xxxxxxxx            xxxxx                  xxxxxxx
    AddressLine2   374 West Broad St    15 East Road        C/O  xxxxxxx
    AddressLine3   St. 302                    COLUMBUS OH      525 East Land
    AddressLine4   NORTH LAND  OH       null                     Apt. 321
    AddressLine5   null                         null                     FAIRFAX VA
    AddressLine6   null                         null                     null
    ZIPCD            89201                      78211                 89012
    We need to extract data into another table with proper format. 
    Is this some thing can be done through SQL? We are in DB2 V9 on z/OS. 
    New table would look like
    Col1     CHAR(6)
    Name    CHAR(30)
    Incareof CHAR(30)
    AddressLine1 CHAR(25)
    AddressLine2 CHAR(25)
    City   CHAR(18)
    State CHAR(2)
    Zip     CHAR(9)

  2. #2
    Join Date
    Apr 2002
    Toronto, Canada
    Quote Originally Posted by schintala View Post
    Is this some thing can be done through SQL?
    not easily, no | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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