Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2008
    Posts
    4

    Question Unanswered: Relation Between View and Sequence

    Hi! Frnz Can any1 let me know that what is the relation between view and Sequence.i need it quick.Thanx.God Bless You

  2. #2
    Join Date
    Mar 2008
    Posts
    8
    In short - A view contains part of or all rows and columns of a table. A sequence is used to insert values into a table or view.

  3. #3
    Join Date
    Mar 2008
    Posts
    8
    Let me know if you need more info than that.

  4. #4
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Both are not related at all. A sequence is a database object that you can use to generate new values in, well, sequence. A sequence is not tied to any table or view. You can use the values from a sequence for whatever you like.

    A view is exactly what its name implies: a (different) view on the data in your database. A view can be created on tables or other views and it essentially encapsulates a query, including joins, subselects, olap functions, ... - whatever DB2 (or SQL in general) lets you do in a query.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  5. #5
    Join Date
    Mar 2008
    Posts
    4

    Post ISAm

    Thanx Sir! Can u plz do me a favor again? i want to know that when we use ISAM????Thanx.i want immediate reply.Thanx alot

  6. #6
    Join Date
    Mar 2008
    Posts
    8
    ISAM is a more general term that you used here. Can you elaborate your question more. Is this in regards to DB2 or mainframe...
    Last edited by kiranchinta; 04-05-08 at 04:26.

  7. #7
    Join Date
    Sep 2004
    Location
    Belgium
    Posts
    1,126
    Quote Originally Posted by nav_jav
    what is the relation between view and Sequence.
    The similarity is that both are sort of "virtual tables", i.e., not physically stored but their data is "generated" when they are interrogated.
    Apart from that, not much similarity.

    If by "relation" you mean: use one in the definition of the other:
    it is *not* possible to define a view where one column contains all values ever generated by a sequence. If that's what you want, you have to "materialize" those values, i.e., create a table, not a view.
    And if that's all the sequence would be used for, then an identity column would be the more appropriate thing to use.
    --_Peter Vanroose,
    __IBM Certified Database Administrator, DB2 9 for z/OS
    __IBM Certified Application Developer
    __ABIS Training and Consulting
    __http://www.abis.be/

Posting Permissions

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