473,471 Members | 4,629 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Updating Multile rows in a table

1 New Member
Hello All,
I have got a table like below :-

Name (varchar2) Code(varchar2) Details
ABC 123_o kkkk
PQR 456_U RRR

I just put only two rows where as there will be 1000 rows.

I want the table to be like below after update

Name (varchar2) Code(varchar2) Details
100_Name 100 kkkk
101_Name 101 RRR

Please note that i just want to update the name which is based on the code value and code value should be in the ascending order, where as the code and Name orginal field values wont have any link with the the values with which it is going to be get updated.


Please send me the update query for the above issue.

Thanking you in advance.

Regards,
Dhanya
Jan 22 '08 #1
3 1302
debasisdas
8,127 Recognized Expert Expert
Try to do the same using a cursor inside an anonymous block or use a procedure.
Jan 22 '08 #2
cvraghavan1979
28 New Member
Try to do the same using a cursor inside an anonymous block or use a procedure.
Hi,

can u send the exact form of original data and the data form u want to convert with. i couldn't get the clear idea of the modification u require.
regards,
vijay
Jan 29 '08 #3
subashsavji
93 New Member
Expand|Select|Wrap|Line Numbers
  1.  
  2. create or replace procedure proc11(v_ename1 in varchar2,v_ename2 in varchar2) is
  3. CURSOR CUR2 is SELECT empno from emp where ename=v_ename1 order by empno;
  4. begin
  5. for i in CUR2 loop
  6. update emp
  7. set ename=v_ename2
  8. where empno=i.empno;
  9. end loop;
  10. end;
  11. /
  12.  
  13. EXECUTE PROC11('KING','EMPAROR');
  14.  
  15.  


NOW USE THIS PROCEDURE IN ANY PROGRAMME WHERE WE CAN PASS ONE BY ONE VALUES IN LOOP STATEMENT.
Jan 30 '08 #4

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

Similar topics

1
by: Srinadh | last post by:
Hi all, We have files with about 20 to 30 fields per row. We are trying to update such files with about 60 rows as contiguous data in a CLOB field. It passes through. But when we try...
2
by: George | last post by:
The flow of my app is as follows 1) Pull up an order and change the quantity of a textbox item. (Ex: change the quantity from 1 to 2 2) Click on the Update button 3) When the page posts back you...
1
by: Luis Esteban Valencia | last post by:
Hello Everyone, Iam an intermediate ASP.Net programmer and iam facing a challenging task. I have a table in MS-SQL server database called 'Members'. The table has following fields... ...
14
by: Lars Netzel | last post by:
A little background: I use three Datagrids that are in a child parent relation. I Use Negative Autoincrement on the the DataTables and that's workning nice. My problem is when I Update these...
4
by: Geoff | last post by:
Hi I'm hoping somebody can help me with the following problem that has occurred to me. Suppose I have two tables in an SQL Server database. Let's call these tables A and B. Assume that A has...
3
by: RSH | last post by:
Hi, I have a situation in where i have two instances of SQL server, the first is our Production Environment, the second is our Development environment. Both servers contain the same databases...
6
by: Rich | last post by:
Dim da As New SqlDataAdapter("Select * from tbl1", conn) dim tblx As New DataTable da.Fill(tblx) '--works OK up to this point da.UpdateCommand = New SqlCommand da.UpdateCommand.Connection =...
8
by: michael sorens | last post by:
I have written a few applications to read data from a database but now, as I turn my attention to writing to a database, I am apparently missing some fundamentals. I created a new database with...
2
by: =?Utf-8?B?VmFuZXNzYQ==?= | last post by:
Hi All! I am with a situation where I am not getting the right updating to the form's fields. The situation is the following one: I have one combobox and one textbox. I am using the...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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 ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.