using pl/sql to update a table

From: <ianr_ekha_at_my-dejanews.com>
Date: Mon, 26 Apr 1999 09:59:58 GMT
Message-ID: <7g1deu$37$1_at_nnrp1.dejanews.com>



[Quoted] I am trying to update one field in a table using the contents of a field in another table, using this script;

declare

        CURSOR curs_temp_cds_id is select user_49, user_50 from cds_inpatients_load_temp;

	var_cds_id	cds_inpatients_load_temp.user_49%TYPE;
	var_loc_spec	cds_inpatients_load_temp.user_50%TYPE;
begin
	open curs_temp_cds_id;
	loop
		fetch curs_temp_cds_id into var_cds_id, var_loc_spec;
		exit when curs_temp_cds_id%NOTFOUND;
		update cds_inpatients_load
		set user_50 = var_loc_spec
		where user_44 = var_cds_id;
	end loop;
	close curs_temp_cds_id;

end;
/

[Quoted] The common field in the two tables is an ID located in user_44 of the cds_inpatients_load table and user_49 of the cds_inpatients_load_temp table, and the field which I wish to update is user_50 in the cds_inpatients_load, with the corresponding data in user_50 of the cds_inpatients_load_temp table.

The above script ran without any feedback for a long period, does anyone have any suggestions what I am doing wrong? I am fairly happy with SQL, but new to PL/SQL. -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Mon Apr 26 1999 - 11:59:58 CEST

Original text of this message