Modify Stage Column Name Change
Moderators: chulett, rschirm, roy
Modify Stage Column Name Change
I am using the modify stage to change a column name that has '-' (Specification = CAUSE_EN = Cause-en). When I run the job, I get the following error:
main_program: Syntax error: Error in "oraread" operator: Error in output redirection: Error in output parameters: Error in modify adapter: Error in binding: Expected '=', got: "-", line 30 [osl\osl.C:135]
I know the modify stage can change the datatype of a column, but can it rename a column name. If this is not possible should I drop and and a new column using the old column name definition.
main_program: Syntax error: Error in "oraread" operator: Error in output redirection: Error in output parameters: Error in modify adapter: Error in binding: Expected '=', got: "-", line 30 [osl\osl.C:135]
I know the modify stage can change the datatype of a column, but can it rename a column name. If this is not possible should I drop and and a new column using the old column name definition.
Don't need to use a modify stage to change the name of a column. Use the copy stage (or the next stage reading the input). Copy stage gets optimized out of the job when it is compiled so there is no extra overhead.
PS: you can use a modify stage to rename columns, but it functions and rules are different than for other stages.
PS: you can use a modify stage to rename columns, but it functions and rules are different than for other stages.
Mike
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Modify stage certainly can change a column name. For example:
As you note, the problem is reading from Oracle. Are you using direct read or SQL as the extraction method?
There may also be a problem in the Modify stage, but solve the Oracle issue first.
Code: Select all
Specification: newcolumn=oldcolumn
There may also be a problem in the Modify stage, but solve the Oracle issue first.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
The error message was pretty self-explanatory as to what the problem is. When I use the modify stage to rename the column, I am getting the same error on the oraread. Is there possibly another solution or should I create a view of the table and rename the column with the problem, or call IBM and create a case.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Just put the column name in double quotes in the SELECT statement. Otherwise the "-" character could be interpreted as a request to perform subtraction. And/or you can use an alias column name in the SELECT statement; there's no need to create a view.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Charter Member
- Posts: 822
- Joined: Sat Sep 17, 2005 5:25 pm
- Location: USA
Do I have to do anything special with the column name that is imported as part of the table definition. I am still getting the same error. When I look at the OSH output, I still see the '-' in the column name, but I see \'\'column-name\'\' as part of the column name.ray.wurlod wrote:Just put the column name in double quotes in the SELECT statement. Otherwise the "-" character could be interpreted as a request to perform subtraction. And/or you can use an alias column name in the SELECT statement; there's no need to create a view.
-
- Charter Member
- Posts: 822
- Joined: Sat Sep 17, 2005 5:25 pm
- Location: USA