when I want to update a column and set the column_a = column_a * percent in a table in a stage, also in the input link there are two columns and named to key_1 and percent.
so the sql i want to write to like :
update table_name set column_a = column_a * percent where key_1=? ;
but when i run the job there is a error :
Task_one_point_two..Employee: [IBM][CLI Driver][DB2/AIX64] SQL0206N "percent" is not valid in the context where it is used. SQLSTATE=42703
who can help me out thanks.
How to update a table there is a expression in the sql
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 35
- Joined: Tue Feb 07, 2012 2:28 am
- Location: China BeiJing
How to update a table there is a expression in the sql
Dong Ying Ying Come on.
Re: How to update a table there is a expression in the sql
Which DB stage do you use for custom sql?
In case of using the DB2 Connector for example try this ...
update table_name set column_a = column_a * orchestrate.percent where key_1=orchestrate.key_1 ;
'orchestrate' means taking the column value out of the ETL flow at runtime
In case of using the DB2 Connector for example try this ...
update table_name set column_a = column_a * orchestrate.percent where key_1=orchestrate.key_1 ;
'orchestrate' means taking the column value out of the ETL flow at runtime
-
- Participant
- Posts: 35
- Joined: Tue Feb 07, 2012 2:28 am
- Location: China BeiJing