Cursor Loop

Not sure what I am doing wrong, this works in 6.7, but if you run the following:

declare
cursor dale_curs is
select 1 my_val from dual
union
select 2 my_val from dual
union
select 3 my_val from dual
union
select 4 my_val from dual
union
select 5 my_val from dual;
begin
for x in dale_curs loop
dbms_output.put_line('VAL: ’ || x.my_val);
end loop;
end;
/

My output is:

**** SCRIPT STARTED Session: APPS@ITLCDEV(1) 10/22/2013 07:33:55 ****
declare
cursor dale_curs is
select 1 my_val from dual
union
select 2 my_val from dual
union
select 3 my_val from dual
union
select 4 my_val from dual
union
select 5 my_val from dual;
begin
for x in dale_curs loop
dbms_output.put_line('VAL: ’ || x.my_val);
end loop;
end;
==>
PL/SQL block executed
VAL: 1

**** SCRIPT ENDED 10/22/2013 07:33:55 ****
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

It seems to stop after the first time. I have spent a bunch of time trying to figure out why one of my cursors was not working and finally tried it in 6.7 and it worked fine.

Has some setting changed that I need to update?

As I run more selects in a different database I am getting this. I must have some sort of setting wrong…

07:39:24 PL/SQL block executed

VAL: 1

07:39:24 **** SCRIPT ENDED 10/22/2013 07:39:24 ****

07:39:25 End Script Execution

08:20:11 Start Script Execution …

08:20:11 **** SCRIPT STARTED: 10/22/2013 08:20:11 ****

08:20:11 select * from lozierapps.cmp_iim_asi

08:20:11 Data Set is Read-Only; 250 row(s) fetched (Partial)

VAL: 2

08:20:11 **** SCRIPT ENDED 10/22/2013 08:20:11 ****

08:20:11 End Script Execution

08:20:25 Start Script Execution …

08:20:25 **** SCRIPT STARTED: 10/22/2013 08:20:25 ****

08:20:25 select * from lozierapps.cmp_iim_asi

08:20:25 Data Set is Read-Only; 250 row(s) fetched (Partial)

VAL: 3

08:20:25 **** SCRIPT ENDED 10/22/2013 08:20:25 ****

08:20:25 End Script Execution

08:23:26 Start Script Execution …

08:23:26 **** SCRIPT STARTED: 10/22/2013 08:23:26 ****

08:23:26 select * from lozierapps.cmp_iim_asi

08:23:26 Data Set is Read-Only; 250 row(s) fetched (Partial)

VAL: 4

08:23:26 **** SCRIPT ENDED 10/22/2013 08:23:26 ****

08:23:26 End Script Execution

Are you using Oracle 9i client? We have a known issue with 9i client in 7.0. When 9i client is used, dbms output only returns the first line from buffer. We will try to fix this as soon as we can.

Here goes that picture thing again. I believe I am using 10... I'm sorry, I'm not very good at the Oracle Client thing...

Hi Dale,

It should work well with 10g client. And o far I couldn’t reproduce your problem yet, I suspect it might be related to some of your settings. So could you please send me your profile to have a further check?

Backup your profile: Tools | Profile Manager | Backup user profile

You can send it to me directly: shirly.nie@quest.com

Thanks,

Shirly

Hi Dale,

Thank you for your profile. :slight_smile:

Finally we found out that this issue happens to any client below 10gR2. From the screen shot we can see you are using 10.1.

Anyway this is an issue of SQLNavigator, we have story SQLNAV-1202 for it already and hopefully it will be fixed in next 7.0 patch later this week. Any news will let you know, thx.

Best regards,

Shirly

Hi Dale,

This issue has been fixed in our v7.0.1 patch build. you can download it from our support link:

support.quest.com/…/download-new-releases

Thanks a lot for your feedback.

Thanks again,

Shirly