DB2 UNIQUE pseudo column

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


Accepted Solutions
Forteen Stars TRF
Forteen 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

All Replies
Forteen Stars TRF
Forteen 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

Tutorial

Introduction to Talend Open Studio for Data Integration.

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.