Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > IBM DB2 > Re: Again again...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 8 Topic 8858 of 9366
Post > Topic >>

Re: Again against generated columns or (missing) row value

by Tonkuma <tonkuma@[EMAIL PROTECTED] > May 7, 2008 at 06:54 AM

I couldn't understand your issue(might be by my poor English
capability).

Here are some thoughts which are inspired by your article.
1) Although it is not do***ented, you can specify row comparison
predicate in(on?) DB2 for LUW 9.1.
For example:
------------------------------ Commands Entered
------------------------------
SELECT empno, workdept
     , firstnme || RTRIM(' '||midinit) || ' '||lastname AS fullname
     , edlevel
  FROM employee
 WHERE (workdept, edlevel) = ('D11', 16)
;
------------------------------------------------------------------------------

EMPNO  WORKDEPT FULLNAME                       EDLEVEL
------ -------- ------------------------------ -------
000060 D11      IRVING F STERN                      16
000150 D11      BRUCE ADAMSON                       16
000170 D11      MASATO**** J YO****MURA               16
000190 D11      JAMES H WALKER                      16
000200 D11      DAVID BROWN                         16
200170 D11      KIYO**** YAMAMOTO                    16

  6 record(s) selected.

And you can specify full-select (including VALUES clause) in predicate
on DB2 for LUW prior V9.1.
Here are two examples:
------------------------------ Commands Entered
------------------------------
SELECT empno, workdept
     , firstnme || RTRIM(' '||midinit) || ' '||lastname AS fullname
     , edlevel
  FROM employee
 WHERE (workdept, edlevel) = ANY (VALUES ('D11', 16) )
;
------------------------------------------------------------------------------

EMPNO  WORKDEPT FULLNAME                       EDLEVEL
------ -------- ------------------------------ -------
000060 D11      IRVING F STERN                      16
000150 D11      BRUCE ADAMSON                       16
000170 D11      MASATO**** J YO****MURA               16
000190 D11      JAMES H WALKER                      16
000200 D11      DAVID BROWN                         16
200170 D11      KIYO**** YAMAMOTO                    16

  6 record(s) selected.


------------------------------ Commands Entered
------------------------------
SELECT empno, workdept
     , firstnme || RTRIM(' '||midinit) || ' '||lastname AS fullname
     , edlevel
  FROM employee
 WHERE (workdept, edlevel) IN (VALUES ('D11', 16), ('D11', 17) )
;
------------------------------------------------------------------------------

EMPNO  WORKDEPT FULLNAME                       EDLEVEL
------ -------- ------------------------------ -------
000060 D11      IRVING F STERN                      16
000150 D11      BRUCE ADAMSON                       16
000160 D11      ELIZABETH R PIANKA                  17
000170 D11      MASATO**** J YO****MURA               16
000180 D11      MARILYN S SCOUTTEN                  17
000190 D11      JAMES H WALKER                      16
000200 D11      DAVID BROWN                         16
000210 D11      WILLIAM T JONES                     17
200170 D11      KIYO**** YAMAMOTO                    16

  9 record(s) selected.

2) One usage of generated column is to create a functional index.
http://groups.google.com/group/comp.databases.ibm-db2/browse_frm/thread/eb4bdb66f5868e16/b66e3ac5739087f7?lnk=gst&q=functional+index#b66e3ac5739087f7
 




 8 Posts in Topic:
Again against generated columns or (missing) row value construct
Bernard Dhooghe <dhoog  2008-05-06 03:11:14 
Re: Again against generated columns or (missing) row value
Tonkuma <tonkuma@[EMAI  2008-05-07 06:54:45 
Re: Again against generated columns or (missing) row value
Bernard Dhooghe <dhoog  2008-05-08 01:30:25 
Re: Again against generated columns or (missing) row value co
Serge Rielau <srielau@  2008-05-08 11:37:04 
Re: Again against generated columns or (missing) row value
Tonkuma <tonkuma@[EMAI  2008-05-08 17:30:17 
Re: Again against generated columns or (missing) row value
Tonkuma <tonkuma@[EMAI  2008-05-08 17:54:05 
Re: Again against generated columns or (missing) row value
Bernard Dhooghe <dhoog  2008-05-13 00:04:53 
Re: Again against generated columns or (missing) row value
Bernard Dhooghe <dhoog  2008-05-13 04:28:38 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Oct 10 12:52:32 CDT 2008.