Skip to content

Instantly share code, notes, and snippets.

@klang
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save klang/8880393 to your computer and use it in GitHub Desktop.
Save klang/8880393 to your computer and use it in GitHub Desktop.
code text added to database with f.sql and extracted with dump_source.sql, resulting in F.sql (notice uppercase) .. Seen from a versioning system (git) perspective, most of the lines in the original source have changed. The lines containing "begin" and "end;" are the only ones that are unchanged. Git's model state that, if the SHA-1 of the conte…
-- create directory REPOSITORY as '/REPOSITORY';
-- GRANT READ,WRITE ON DIRECTORY REPOSITORY TO oraclegit;
DECLARE
v_ddl_clob CLOB;
BEGIN
FOR c IN ( SELECT object_name, object_type
FROM user_objects
WHERE object_type IN ('PROCEDURE','FUNCTION') )
LOOP
v_ddl_clob := dbms_metadata.get_ddl(c.object_type, c.object_name);
dbms_xslprocessor.clob2file(v_ddl_clob, 'REPOSITORY', c.object_name||'.sql');
END LOOP;
END;
/
CREATE OR REPLACE FUNCTION "ORACLEGIT"."F" return varchar as
begin
return
'Hello world';
end;
create or replace function f return varchar as
begin
return 'Hello world';
end;
/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment