Employee

DB2 UNIQUE pseudo column

Hello

In one of the DB2Input components, the SELECT statement uses a pseudo columns called ‘UNIQUE’

 

"SELECT

  WF.UNIQUE

FROM "+context.BDU_DB2_Schema_BDU+".WATCHFOLDER WF

INNER JOIN "+context.BDU_DB2_Schema_BDU+".WATCHPATTERN P ON WF.ID = P.WATCHFOLDER_ID

WHERE P.ID = "+context.patternID

  

I am trying to find out what this is and so far online search is not yielding anything useful.

 

I am guessing that the ‘unique’ pseudo column retrieves the number of unique rows based on a number of non-unique columns that taken together may constitute a unique value (i.e. composite key), but clearly the above SQL does not suggest that.

 

When I attempt to execute the above SQL using SquirreL connected to DB2 DB, I get 5 rows of zeros.

 UNIQUE.jpg

 

Does anyone know what does this UNIQUE column supposed to do ?

 

Appreciate your help

 

Thanks

 

Patrice

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Thirteen Stars TRF
Thirteen Stars

Re: DB2 UNIQUE pseudo column

Hi,
Is UNIQUE present when you ask for a desc of the table WATCHFOLDER?
If so this not a pseudo-column.
Else you should get the answer from the DB2 documentation.

TRF
2 REPLIES
Thirteen Stars TRF
Thirteen Stars

Re: DB2 UNIQUE pseudo column

Hi,
Is UNIQUE present when you ask for a desc of the table WATCHFOLDER?
If so this not a pseudo-column.
Else you should get the answer from the DB2 documentation.

TRF
Employee

Re: DB2 UNIQUE pseudo column

Thanks. You were absolutely right. I have been a bozo. 'UNIQUE' is actually a column in the table rather then a pseudo column. 

I have been staring at this SQL way to long to notice, the explanation is much simpler.

 

Thanks very much.

Patrice