473,395 Members | 1,462 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

procedure for numering records - no effect

Hi

I'm trying to add numers to "id" field in my "kadry" table. I write
procedure to do it (as follows) but running this procedure does make
no effect.
Where is bug?
best regards

D.T.

PROCEDURE KADRY_PROC_SEQ2
IS
BEGIN
declare
i number;
k number;
nazwisko varchar2(40);
cursor cur1 IS
select * from kadry;
BEGIN
k:=1;
for c1 IN cur1
loop
c1.id:=k;
k:=k+1;
end loop;
commit;
end;
END;
Jul 19 '05 #1
2 1782

"Dariusz Tomon" <d.*****@mazars.pl> wrote in message
news:c7************************@posting.google.com ...
| Hi
|
| I'm trying to add numers to "id" field in my "kadry" table. I write
| procedure to do it (as follows) but running this procedure does make
| no effect.
| Where is bug?
| best regards
|
| D.T.
|
| PROCEDURE KADRY_PROC_SEQ2
| IS
| BEGIN
| declare
| i number;
| k number;
| nazwisko varchar2(40);
| cursor cur1 IS
| select * from kadry;
| BEGIN
| k:=1;
| for c1 IN cur1
| loop
| c1.id:=k;
| k:=k+1;
| end loop;
| commit;
| end;
| END;
welcome to SQL ;-)

this code only reads the KADRY table and resets a variable in memory -- if
you want to change a value in the database you need to use an UPDATE
statement

;-{ mcs
Jul 19 '05 #2
Jan
simple SQL is enough
UPDATE your_table
SET id =rownum;

COMMIT;
d.*****@mazars.pl (Dariusz Tomon) wrote in message news:<c7************************@posting.google.co m>...
Hi

I'm trying to add numers to "id" field in my "kadry" table. I write
procedure to do it (as follows) but running this procedure does make
no effect.
Where is bug?
best regards

D.T.

PROCEDURE KADRY_PROC_SEQ2
IS
BEGIN
declare
i number;
k number;
nazwisko varchar2(40);
cursor cur1 IS
select * from kadry;
BEGIN
k:=1;
for c1 IN cur1
loop
c1.id:=k;
k:=k+1;
end loop;
commit;
end;
END;

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: deprins | last post by:
Hello, I have wrote a stored procedure but its real slow. Its activated by a button on web page but its takes to long to process and the web server gives a timeout message after 5 minutes. Is...
0
by: Nashat Wanly | last post by:
HOW TO: Call a Parameterized Stored Procedure by Using ADO.NET and Visual C# .NET View products that this article applies to. This article was previously published under Q310070 For a Microsoft...
15
by: Philip Mette | last post by:
I am begginner at best so I hope someone that is better can help. I have a stored procedure that updates a view that I wrote using 2 cursors.(Kind of a Inner Loop) I wrote it this way Because I...
13
by: dawatson833 | last post by:
I have several stored procedures with parameters that are defined with user defined data types. The time it takes to run the procedures can take 10 - 50 seconds depending on the procedure. If I...
6
by: Martin Lacoste | last post by:
Ok, before I headbutt the computer... don't know why when I add criteria in a query, I get an 'invalid procedure call'. I also don't know why after searching the help in access, the various access...
6
by: Damon Grieves | last post by:
Hi I just want to be sure I understand how the Access client works. If I have an Access back end with a million records on a server and an Access client. If the client is installed on the users pc...
2
by: red vertigo | last post by:
Hi All, I am trying to write a basic stored procedure to return a range of values but admit that I am stumped. The procedure syntax used is: ALTER PROCEDURE Rpt_LegacyPurchaseOrderSp( ...
2
by: Dariusz Tomon | last post by:
Hi I'm trying to add numers to "id" field in my "kadry" table. I write procedure to do it (as follows) but running this procedure does make no effect. Where is bug? best regards D.T.
5
by: Chris Cowles | last post by:
I use an application that uses Oracle 8.1.7. All functions of the application are completed with calls to stored procedures. A data entry error occurred that caused thousands of records to be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.