Toad World® Forums

line break one or two characters

Hello,

compliling a program like

procedure mbrtest
is
mbr varchar2(10):= ’
‘;
begin
dbms_output.put_line(‘len=’||length(mbr));
for c1 in 1…length(mbr) loop
dbms_output.put_line(‘mbr(’||c1||’)=’||ascii(substr(mbr, c1, 1)));
end loop;
end;

with SQLNAV 7.0 and running it gives

len=2
mbr(1)=13
mbr(2)=10

when (re)loaded and saved again with SQLNAV 6.7

I get

len=1
mbr(1)=10

Is it supposed to work that way?

Andres

this is even worse - it appears every line with unterminated string gets a chr(13) in the end. So when i have compiled code like

procedure z
begin
execute immediate ‘begin
null;
end;’;
end;
it won’t run - i get

ORA-06550: line 1, column 29:
PLS-00103: Encountered the symbol “” when expecting one of the following:

( ) - + case mod new not null others

table avg count current exists max min prior sql stddev sum
variance execute multiset the both leading trailing forall
merge year month DAY_ hour minute second timezone_hour
timezone_minute timezone_region timezone_abbr time timestamp
interval date

because of the chr(13) in the anonymous block

Hi Andres,

Thanks for reporting the issue.

7.0 uses a new component in the Code Editor and it chooses #13#10 as the default line breaks, while 6.7 chooses #10. Currently there is no setting to allow user to specify the line break character in the Code Editor yet. I just raised issue SQLNAV-1240 to log this.

I could compile the 2nd procedure after I added the missing IS back to the end of the 1st line. I don’t think #13 would stop it from compiling. Could you please check it again?

Thanks,

Vincent

Yes, compiling works fine, but executing fails…with ORA - and you can’t see anything wrong - and you can’t fix it in SQLNAV 7.0 - unless you put everything to one line or terminate the string every line by adding " '||chr(10)|| "

Andres

Hello,

Is there a solution available now ? I have exactly the same Problem. Execute Immediate doesn’t work with anonymous blocks. Compiling OK, but executing Fails

ORA-06550: line 1, column 29:

PLS-00103: Encountered the symbol “” when expecting one of the following:

is this issue in schedule to be fixed?

Thanks

Beat

I could not reproduce any error when I run the procedures I created. The script I use listed below:

create or replace procedure pro_run is

begin

execute immediate 'begin

dbms_output.put_line(’‘run.’’);

end;’;

end;

create or replace procedure z is

begin

execute immediate 'begin

null;

end;’;

end;

Could you attach the procedure that you have problem with?

Thanks,

Vincent

It probably makes no difference when being run against windows database. Vincent, did you try it against a database running on a non-windows machine?

select platform_name from v$database

==>

PLATFORM_NAME


HP-UX IA (64-bit)

-------- End of Data --------

1 row(s) fetched

I get it. #13#10 is the default line break style for Windows, while Linux takes #10 by default.

We will revert it back to #10 like what it is in 6.7. A new option to set line break style is also under consideration.

From: Andres [mailto:bounce-Andres@toadworld.com]

Sent: Thursday, 17 April 2014 3:35 PM

To: sqlnav@toadworld.com

Subject: RE: [SQL Navigator - Discussion Forum] line break one or two characters

RE: line break one or two characters

Reply by Andres

It probably makes no difference when being run against windows database. Vincent, did you try it against a database running on a non-windows machine?

select platform_name from v$database

==>

PLATFORM_NAME


HP-UX IA (64-bit)

Could you send a note when the next beta will be available with the fix included (I know this is not a beta forum)?

Hi Andres,

This should be fixed in our latest beta3, download from the link below:

www.toadworld.com/…/21915.aspx

Any issues please feel free to let us know, thanks.

Best Regards,

Shirly