Update

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
martin
Participant
Posts: 67
Joined: Fri Jul 30, 2004 7:19 am
Location: NewJersy

Update

Post by martin »

Hi Guys,

I want to update into ORACLE table :
4 columns(feilds are empty) - NotNull And Not part of PrimaryKeys
Col1
Col2
Col3
Col4
Out of 25 columns(data is existing).
And Data Also doen't have NULL Values
Ihave Searched this Forum and Itried But I couldnot Do Update,
Some one, Any Solution.

Thanks In Advance
Martin.H
rasi
Participant
Posts: 464
Joined: Fri Oct 25, 2002 1:33 am
Location: Australia, Sydney

Post by rasi »

Explain a bit more to help you. Do remember spaces are considered to be values and not null. Check the length of those columns in the table.

Thanks
Siva
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Martin, you're going to need to restate your problem. We can't really tell what your issue is or why you "could not do update" from your post. :?

Are you using one of the OCI stages? Did you notice you could change the "Update Action", and that there are several that do various forms of updates? When you have your columns and table name populated, switch to the SQL tab and you'll see the SQL the stage will run against your table. Switch the update action and the SQL will change. Just looking at what it will do is a good way to learn the differences between the various actions.

If all you want to do is update four columns in a table and leave the other 21 alone, all you need to include in your job are those four fields (plus whatever key fields are needed to identify a record) and use the "Update existing rows only" update action. If the fields are required, meaning they will not allow null values, you'll need to ensure that you don't deliver any to the table by using appropriate constraints and derivations in the job. As Siva mentioned, some people will put a space in a not-null character field to signify it is "empty", or a zero in a numeric field.

When you come back with more questions, please make them as specific and clear as possible. Otherwise you may get answers to questions that you didn't even ask. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If you try to update and the row does not exist, the update will fail. In this case you need to do an insert.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

It won't "fail" in the sense that you'll get an error message, it will just fail to update any rows. :wink: Perhaps some other databases are different, but Oracle (and what I recall of Informix) is perfectly happy updating zero records.
-craig

"You can never have too many knives" -- Logan Nine Fingers
martin
Participant
Posts: 67
Joined: Fri Jul 30, 2004 7:19 am
Location: NewJersy

Post by martin »

sorry to reply Back,

Key Columns were not defined........i didnt see it .....i was confident that part was okay.........later i figured out........now its ok.

Thanks guys
Post Reply