2008-11-28

DBMS_METADATA bug?

Today I found this bug in Oracle 10g R2 (I didn't try in 11G) when using the SQLTerminator in DBMS_METADATA:



begin
DBMS_METADATA.set_transform_param (DBMS_METADATA.session_transform,
'SQLTERMINATOR',
TRUE
);
end;


Then if you get a DDL you will get after the execution lines a / so you can concatenate several of this scripts in one big script.
For getting a DDL of an object you use DBMS_METADATA.get_ddl
For instance: DBMS_METADATA.get_ddl('PACKAGE','PACOTE')

Problem: if you have a space after the code of a package, function or procedure the get_ddl will put after the space the / and them the newline char (i.e '/'||chr(10)) but what it should do was chr(10)||'/'||chr(10) !

That way the script originated cannot run in only big script :-(

So make sure you do not have a space after the last ; in the packages specification and body, and "standalone" procedures and functions

No comments:

Post a Comment

Os comentários são moderados.
The comments are moderated.