Skip to content

Instantly share code, notes, and snippets.

@klang
Last active Aug 29, 2015
Embed
What would you like to do?
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