or sqlplus doesn't see the instance that you are connecting to. Connect using sqlplus user/pasw@DATABASE ... or, alternatively, you can set your ORACLE_SID variable.
Hi all,
I am new to sqlplus, anyone can help me to explain what's the following code is doing?
DECLARE
cursor c1 is select bts_int_id,
max(ave_busy_tch/res_av_denom14) maxBusyTch
from p_nbsc_res_avail
where to_char(period_start_time,'yyyymmdd')=to_char((sysdate-1),'yyyymmdd')
group by bts_int_id;
BEGIN
FOR x IN c1 LOOP
update RNP_temp_table set
bts_id = x.bts_int_id,
max_busy_tch=x.maxBusyTch
where bts_id = x.bts_int_id;
IF SQL%NOTFOUND THEN
insert into RNP_temp_table
( bts_id,
max_busy_tch)
values
( x.bts_int_id,
x.maxBusyTch);
END IF;
COMMIT;
END LOOP;
COMMIT;
END;
/