SqlDbx Forum

SqlDbx

You are not logged in.

#1 2014-04-14 10:35:24

ptoniolo
Member

Oracle PL/SQL, functions within procedure declarations

In Oracle I frequently use function declarations inside the declare section of procedures. But I cannot find a way for SqlDbx to accept this kind of syntax, that is perfectly legal in Oracle.

For example, this code, accepted by sqlplus, gives a lot of errors in sqldbx 3.64:

create procedure prova(str varchar2)
as
	function q(s varchar2) return varchar2 as begin return '''' || replace(s,'''','''''') || ''''; end;
begin
	dbms_output.put_line(q(str));
end;
/

The errrors I get are:

1	ORA-24344: success with compilation error
3	PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
3	
3	   begin function pragma procedure
5	ORA-06550: line 2, column 23:
5	PLS-00201: identifier 'Q' must be declared
5	ORA-06550: line 2, column 2:
5	PL/SQL: Statement ignored
5	SQL parse error location

Apparently SqlDbx misunderstands the first "end" and tries to execute only the first two lines of code. Ideally it should give all the string batch to oracle, up to the end, that I signal with an isolated slash as I do with sqlplus. Looks like SqlDbx is trying to do too much... parsing the code and splitting it in an incorrect way.

In the Oracle options, the only option that seems to be related someway is the "SQL*Plus Compatible Scripting", but this behavior is the same, whichever value I choose for this option.

Offline

#2 2014-04-14 18:48:13

sqldbxhelp
Administrator

Re: Oracle PL/SQL, functions within procedure declarations

This is a bug and it will be fixed in a follow up to the latest release in about two weeks.

Offline

#3 2014-04-29 04:58:24

ptoniolo
Member

Re: Oracle PL/SQL, functions within procedure declarations

I tried that code on the 4.0 version of SqlDbx, but I still get the same errors.

Offline

#4 2014-04-29 18:16:50

sqldbxhelp
Administrator

Re: Oracle PL/SQL, functions within procedure declarations

It was reported after 4.0 release.
If you want to get fixed version please send email to support with your license information.

Offline

Board footer

Powered by FluxBB