DB2 UNIQUE pseudo column

Highlighted
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
Sixteen Stars TRF
Sixteen 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

View solution in original post


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

View solution in original post

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

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog