473,379 Members | 1,335 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,379 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 1781

"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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.