Why can't I use sequences directly in a view?
Posted in 2019
Topics: General Discussion
Hi, The customer wants to use the sequence value of the remote Informix server. However, using view to lookup the nextval value gives error 8319. So I created a view that references the nextval value using a user-defined function as shown below. Neither oracle nor db2, including Informix, can reference the nextval and currval values in the View. Why can't I use sequences directly in a view? Does this restriction maintain the integrity of the database or is it for some other purpose? ------------------------------ SangGyu Jeong Software Engineer Infrasoft Seoul Korea, Republic of ------------------------------ #Informix
I guess the developers did not think it would be useful Normally you get the next value directly from the sequence, why would you need a view? Regards, David. ------------------------------ David Williams ------------------------------
Hello David, Thanks for your response. The reason I reproduced this problem is that my customer was trying to reference a sequence object on a remote server. In fact, this was an issue for customers using db2, but I was personally curious and tested it in my Informix environment. ------------------------------ SangGyu Jeong Software Engineer Infrasoft Seoul Korea, Republic of ------------------------------