Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2006
    Posts
    1

    Unanswered: Use of DB2 Views question

    Hi, is it possible for a view definition to be the following? or something like it w/o actually selecting anything from a table

    SELECT 'X' FROM SYSIBM.SYSDUMMY

    We basically want to make the view as fast as absolutely possible and we know the value we want it to return...Is know this is strange, but we cannot eliminate the reference to the view in many different SQLs throughout the system, so we want to alter it to almost act as a host variable value.

    Thanks

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    defnitely possible to do this


    sathyaram
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  3. #3
    Join Date
    Jul 2006
    Location
    Pune , India
    Posts
    433
    CREATE VIEW MA_TRIAL (age, NAME) AS SELECT 26, 'RAHUL' FROM eone.TSYS_EXCLSN_FTRE
    DB20000I The SQL command completed successfully.

    select * from MA_TRIAL fetch first 1 rows only

    AGE NAME
    ----------- -----
    26 RAHUL

  4. #4
    Join Date
    Jan 2003
    Posts
    1,605
    Quote Originally Posted by FiguringItOut
    SELECT 'X' FROM SYSIBM.SYSDUMMY
    Hi,
    SYSDUMMY does not exist, there is SYSDUMMY1. You can use for example:
    Code:
    db2 create view view_schema.view_name
    as select 'X' AS ColName from SYSIBM.SYSDUMMY1
    Hope this helps,
    Grofaty

Posting Permissions

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