Update tabla through Oracle Stage
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 26
- Joined: Thu Apr 15, 2004 12:54 am
Update tabla through Oracle Stage
How do I achieve Update as TFM --> Oracle Stage.
Query: UPDATE Meta_Ftp_Adapter SET col1=:1 WHERE col1=:2
Since DStage does not let two columns with same name in the col definitions.
Thanks
Query: UPDATE Meta_Ftp_Adapter SET col1=:1 WHERE col1=:2
Since DStage does not let two columns with same name in the col definitions.
Thanks
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Within DataStage use different column names. The first column in the grid replaces the parameter marker :1, the second replaces :2, and so on. Make sure that the one to appear in the WHERE clause is marked as Key.
Choose user-defined SQL as the preferred method, then create the UPDATE statement that you indicated. You may get a warning about metadata mismatch, but it will work.
Choose user-defined SQL as the preferred method, then create the UPDATE statement that you indicated. You may get a warning about metadata mismatch, but it will work.
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.
-
- Participant
- Posts: 26
- Joined: Thu Apr 15, 2004 12:54 am
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
I am not sure whether you have successfully implemented the logic described by Ray or whether you are having problems.
You need to use 2 columns in your link to update - say fld1 and fld2. One of them (say fld2) is to be marked as key. The datatype for both fields must be identical to that of col1.
In your update SQL, you say,
update tablename set col1 = :1 where col1 = :2
You need to use 2 columns in your link to update - say fld1 and fld2. One of them (say fld2) is to be marked as key. The datatype for both fields must be identical to that of col1.
In your update SQL, you say,
update tablename set col1 = :1 where col1 = :2
-
- Participant
- Posts: 26
- Joined: Thu Apr 15, 2004 12:54 am
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Participant
- Posts: 26
- Joined: Thu Apr 15, 2004 12:54 am
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Participant
- Posts: 26
- Joined: Thu Apr 15, 2004 12:54 am
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Participant
- Posts: 26
- Joined: Thu Apr 15, 2004 12:54 am
This is a... strange... requirement. I have no idea what value you would bring to the table by pulling the ROWID out into a data field.Devyani Sarkar wrote:I have this requirement where I have a column named rowid_id which holds the value of rowid of the record.
However, it can be done. Keep in mind the fact that ROWID is a psuedo-column, so the only way I know you can achieve this is by pulling it out and putting it in a VARCHAR2 or CHAR field. Use the ROWIDTOCHAR function to get it out and into a 'saveable' format. Of course, there's a CHARTOROWID function to get it put back.
Or is your 'existing design' storing it in a different datatype?
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers