create a auto-increment column

One Star

create a auto-increment column

Hi,
I don't know which component I should use to add auto-increment column that does not exist in the source table. actually I'm trying to extract some columns from a postgreSQL input and meantime trying to add an autoincrement column which i want to turn into primary key in the output table.I've been trying with Tmap but in vain...for example :
(from postgreSQL input -----> Tmap ------------> postgreSQL output)
postgreSQL input
_____________________________
TASK_NAME | TASK_DESCRIPTION
-----------------------------------------
ADD | add_client_op
-----------------------------------------
CHNG | change_client_ref
----------------------------------------
and I wish to have as a result in the output db
___________________________________________
PK_DIM_TASK | TASK_NAME | TESK_DESCRIPTION
------------------------------------------------------------
1 |ADD | add_client_op
------------------------------------------------------------
2 |CHNG | change_client_ref
-----------------------------------------------------------
any help please? I'd be so grateful.
fantom
One Star

Re: create a auto-increment column

Hi Fantom
You might simply add a new column in Out1 of tMap.
Type Numeric.sequence("s1",1,1) in the expression field of this column.
Regards,
Pedro
One Star

Re: create a auto-increment column

Hi pedro,
thanks a lot for your help, it worked, and actually the mistake I've been doing is that I was trying to write something like altering the table to add a column then turn it into primary key I didn't mention the 'sequence' in Numeric from the categories (does the same work)
I'm so grateful.
best regards.