Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packages ddl gets space added to the opening line #5

Open
tschf opened this issue Sep 3, 2016 · 1 comment
Open

Packages ddl gets space added to the opening line #5

tschf opened this issue Sep 3, 2016 · 1 comment

Comments

@tschf
Copy link
Owner

tschf commented Sep 3, 2016

SQL> CREATE OR REPLACE PACKAGE "HR"."FOO2"
  2  as
  3      bar NUMBER := 1;
  4  end foo2;
  5  /

Package FOO2 compiled

SQL> spool output.sql
SQL> ddl foo2
  CREATE OR REPLACE PACKAGE "HR"."FOO2" 
as
    bar NUMBER := 1;
end foo2;
/
SQL> spool off
SQL> exit

Disconnected from Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

image

@zhudock
Copy link
Contributor

zhudock commented May 8, 2017

Not sure how to fix this via the DLL command, but if changed to use dbms_metadata.get_ddl, the output can be wrapped in an ltrim to remove leading spaces and newlines

select ltrim(dbms_metadata.get_ddl(objectType, objectName), ' ' || chr(10) || chr(13)) from dual;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants