467,172 Members | 1,259 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,172 developers. It's quick & easy.

using Dynamic SQL for Update

Hai,
i would like to use dynamic sql for update records in the DB@ db.
Means, the value to be updated will be send as concatenated string.
Then based on the concatnation value i need to retrieve the records into cursor..then update the set..
how can i do that..

say for example,
i would like to update the salary for all the employees in my company.
I have different grade of employee. In my User interface(.net )i can view all the employees belongs to Admin Department. In admin i may have cleark, Admin assitant, admin officer..All the three are different grade..so salary will be updated based on the category. so i will be passing
Grade, salary as input parameter. i would like to write the Update statement for this. Pls help me...Im very very new to DB2.
Now my idea is first, retrieve the record into cursor based on the input parameter(using dynamic SQL) - [i would like to use dyanmic sql as, i may have more than one record at any time of update..so instead of going to database everytime,i just want to pass the input parameter in one stretch, whatever the logic i need to do, can do in SP.].
then update each record by looping the cursor...
Can i do that...can someone send me simple exmaple to loop the cursor.
Thanks
Sara
Aug 12 '07 #1
  • viewed: 1612
Share:

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Japhy | last post: by
5 posts views Thread by bughunter@ru | last post: by
4 posts views Thread by vagrantbrad@yahoo.com | last post: by
4 posts views Thread by Simon Tamman {Uchiha Jax} | last post: by
3 posts views Thread by Mukesh | last post: by
6 posts views Thread by insirawali@gmail.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.