Results 1 to 4 of 4
  1. #1
    Join Date
    May 2003
    Location
    UK
    Posts
    22

    Unanswered: UNION ALL in a view ???

    All,

    I have two identical tables with different data and I want to create a view combining the data from both tables.

    I can do it in a SELECT statement using the UNION ALL command, but you can not create views using this command.

    Does anyone know an easy way of doing this ????


    Many thanks in advance.

    syb_fkup

  2. #2
    Join Date
    May 2003
    Location
    UK
    Posts
    22
    Okay I found out that UNION in view is not supported on my pre 12.5 sybase and no option to upgrade!

    Does anyone know of an effective workaround???????

    Many thanks in advance

  3. #3
    Join Date
    Jul 2004
    Posts
    61
    Hi


    You try this separately, Sybase 5.0:

    create table ttt (id integer)
    create table ttt1 (id integer)
    -----------
    insert into ttt (id) values (1)
    insert into ttt1 (id) values (2)
    -----------
    create view v_ttt() as
    select id from ttt
    union all
    select id from ttt1
    ------------
    select * from v_ttt

    Thi Nguyen

  4. #4
    Join Date
    Nov 2002
    Location
    Switzerland
    Posts
    524

    Thumbs up

    Thi, you're speaking about Sybase ASA, and syb_fkup is speaking about Sybase ASE. Don't mix !

    syb_fkup, a workaround exist, bu it's not trivial:
    1) create a stored procedure executing your select union select
    2) create a remote server that is your local server
    3) create a proxy table as RPC, pointing in your stored procedure

    Good luck !
    F. Celaia
    DBA Sybase/DB2/Oracle/MS-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
  •