473,465 Members | 1,538 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

using Dynamic SQL for Update

1 New Member
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
0 1842

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

Similar topics

4
by: marc | last post by:
I've been developing a stored procedure that uses a user defined function in the query portion of the procedure. However, since the end product needs to allow for dynamic table names, the UDF will...
4
by: Japhy | last post by:
Hello, I'm am pulling data from a mysql db and want to use the data to populate a <ul. Here are relavent parts of my code : $wohdate = mysql_result($wohRS,$wohndx,woh_date); $woh_display...
5
by: bughunter | last post by:
For example - very large table with a lot indexes and updates work very slow. I'd like found unused or rarely used indexes. How? Yes, for static I found all sql in packages and, after analyse,...
4
by: vagrantbrad | last post by:
I'm using python 2.4 running on Fedora Core 4. I have written a python program called ipscan.py that checks the external ip address of my cable internet connection, and on change, will update the...
4
by: Simon Tamman {Uchiha Jax} | last post by:
Scenario: Two System.Windows.Forms: Form1 and Form2. Form1 is displayed, Form2 is hidden. At this juncture, is it possible to take the graphics from Form2 and output that to Form1's display...
3
by: Mukesh | last post by:
sir, i am developing a database, which will store the users profile both personal and professional which includes the address, telephone, gender and etc. in my main table i have created a column...
0
by: FrankieBakerJr | last post by:
I'm looking for a way to ensure the display of official dynamic documents on my company’s website, including fonts, images, letter-head, etc. Since users have the ability to change the way their...
0
by: tickle | last post by:
Need to convert this PL/SQL script to Dynamic SQL Method 2 * copybook - celg02u3.sql SIR 24265 * * updates dt_deny for all rows in * * ...
6
by: insirawali | last post by:
Hi all, I have this problem, i need to know is there a way i cn use the data adapter's update method in this scenario. i have 3 tables as below create table table1{ id1 int identity(1,1)...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.