Delete on a Database

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
Pavan_Yelugula
Premium Member
Premium Member
Posts: 133
Joined: Tue Nov 23, 2004 11:24 pm
Location: India

Delete on a Database

Post by Pavan_Yelugula »

Hi All
What is the best way of firing a delete command on the database.
One of the threads in the forum sugested that any operations on the database from Datastage Basic will stop working after 30 days as there are separate licences need to be brought for doing that from Data direct.
I guess the other method being A job with a oracle stage and some output link with a custom SQL in the oracle stage should do the trick.
Is there a much better of firing the delete on the database?

Any help will be really appreciated

Thanks
Pavan
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Create a job that sends zero rows to the table, and set its rule to "truncate table then insert rows".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Pavan_Yelugula
Premium Member
Premium Member
Posts: 133
Joined: Tue Nov 23, 2004 11:24 pm
Location: India

Post by Pavan_Yelugula »

Hi ray
Sorry if the question was not properly asked...I don't intend to delete the whole table but delete it based on a some criterion in the where clause...
And can you also please re-confirm me that my understanding that SQL commands through basic will be revoked after 30 days without proper licensce from Datadirect for oracle or for that matter any database...I got this information from you and i was all over the documentation but still couldn't find this....

Thanks
Pavan
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Send the keys of the records to be deleted from the job, and use user-defined SQL of the form DELETE FROM tablename WHERE key = :1

Data Direct ODBC drivers do expire after 30 days. But you can use other ODBC drivers (with different DSNs) from Windows-based servers. These - for example the Microsoft ODBC drivers - do not expire.
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 »

:? Why are you even considering a 'basic' approach for this? The functionality is built into the stage - the update action of 'Delete existing rows' for example. You just need to send it the proper keys.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

The only reason you'd need to use 'custom sql' is if you were using an ODBC stage as it doesn't have that update action for some silly reason. The OCI stage does.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Pavan_Yelugula
Premium Member
Premium Member
Posts: 133
Joined: Tue Nov 23, 2004 11:24 pm
Location: India

Post by Pavan_Yelugula »

Hi ray and chulett
Thanks for all the help
Post Reply