venkat


{ City } hyderabad
< Country > india
* Profession * senior consultant
User No # 110267
Total Questions Posted # 0
Total Answers Posted # 2

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 1
Users Marked my Answers as Wrong # 0
Questions / { venkat }
Questions Answers Category Views Company eMail




Answers / { venkat }

Question { 2451 }

hi all,

i have installed oracle xe software in windows 7.

iam unable to connect sqldeveloper tool.

can you please tell me how to connect. provide completed
procedure.


Answer

Hi,
Can you share error message that SQl Developer throws while connecting XE Oracle DB.

Is This Answer Correct ?    0 Yes 0 No

Question { 3158 }

What WHERE CURRENT OF clause does in a cursor?


Answer

If you want to UPDATE or DELETE record from table by using cursor which is defined from same table,"WHERE CURRENT OF" clause can be used. We have to create cursor with "FOR UPDATE" clause to use above clause.

The most recent record fetched from the table (by looping of cursor records) should be updated or deleted by using "WHERE CURRENT OF". When a cursor open with FOR UPDATE clause ,cursor's active set will have row level Exclusive Lock. Other sessions can query the table records, and not able to delete/update or SELECT with FOR UPDATE clause.


Example: Want to update value for GRADE column to '1' for the student who has Id = '1'.

Declare
cursor C1 is
select st_id, grade,st_last_name from student where st_id = 3;
for update of grade;
[ variable declaration ……] ;
begin
open C1;
fetch C1 into v_id,v_grade,v_name;
if C1%notfound then
dbms_output.put_line (‘No Record is found.’);
else
update student set grade=1 WHERE CURRENT OF;
COMMIT;
END IF;

CLOSE C1;
end;

Is This Answer Correct ?    1 Yes 0 No