If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Relation Between View and Sequence

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-20-08, 05:44
nav_jav nav_jav is offline
Registered User
 
Join Date: Mar 2008
Posts: 4
Question 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
Reply With Quote
  #2 (permalink)  
Old 03-21-08, 03:11
kiranchinta kiranchinta is offline
Registered User
 
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.
Reply With Quote
  #3 (permalink)  
Old 03-21-08, 03:13
kiranchinta kiranchinta is offline
Registered User
 
Join Date: Mar 2008
Posts: 8
Let me know if you need more info than that.
Reply With Quote
  #4 (permalink)  
Old 03-21-08, 13:31
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
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
Reply With Quote
  #5 (permalink)  
Old 04-05-08, 02:56
nav_jav nav_jav is offline
Registered User
 
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
Reply With Quote
  #6 (permalink)  
Old 04-05-08, 03:21
kiranchinta kiranchinta is offline
Registered User
 
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 03:26.
Reply With Quote
  #7 (permalink)  
Old 04-05-08, 05:17
Peter.Vanroose Peter.Vanroose is offline
Registered User
 
Join Date: Sep 2004
Location: Belgium
Posts: 1,079
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/
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On