Home » SQL & PL/SQL » SQL & PL/SQL » urgent..How to get the creation script for the objects java sources,libraries and type bodies..
urgent..How to get the creation script for the objects java sources,libraries and type bodies.. [message #20826] Mon, 24 June 2002 02:58 Go to next message
ksr
Messages: 112
Registered: January 2002
Senior Member
How to get the creation script for the objects java sources,libraries and type bodies..

Hi,

How to get the creation script for the objects java sources,libraries and type bodies..

What i want exactly is,i want to get the creation script for each user and export to a file,each one separately..
i have a code for the functions,but how to get for the java sources,libraries ,type and type bodies..

I code i have for functions is..

prompt Parameter 1 = SCHEMA_OWNER
prompt Parameter 2 = DESTINATION_DIR (with trailing '/')
prompt Parameter 3 = FILTER_STRING
prompt Export oracle code from user '&1' to dir '&2' with '&3' as Filter

set linesize 1000
set pagesize 0
set heading off
set verify off
set echo off
set feedback off
set termout off

spool export_functions_xxx.sql

SELECT 'spool &2' || OWNER || '/function_' || OBJECT_NAME || '.exp' || CHR(10)
|| 'SELECT DECODE(LINE,1,''CREATE OR REPLACE '' || TYPE || '' '' || OWNER || ''.'' || LTRIM(SUBSTR(TEXT,LENGTH(TYPE)+1,LENGTH(TEXT))),TEXT) '
|| 'FROM SYS.DBA_SOURCE WHERE NAME=''' || OBJECT_NAME || ''' AND OWNER=''' || OWNER
|| ''' AND TYPE=''FUNCTION'' ORDER BY LINE;'
|| CHR(10) || CHR(10)
|| 'SELECT CHR(10) || ''/'' || CHR(10) || ''GRANT '' || Privilege || '' ON '' || Owner || ''.'' || Table_Name || '' TO '' || Grantee || '';''' || CHR(10)
|| 'FROM SYS.DBA_TAB_PRIVS ' || CHR(10)
|| 'WHERE TABLE_NAME = ''' || O.OBJECT_NAME || ''' AND OWNER = ''' || O.OWNER || ''' ORDER BY Grantee, table_name, PRIVILEGE,GRANTABLE;' || CHR(10)
|| 'spool off' || CHR(10)
FROM SYS.DBA_OBJECTS O
WHERE OBJECT_TYPE = 'FUNCTION'
AND OBJECT_NAME LIKE '&3'
AND O.OWNER = '&1'
GROUP BY OWNER, OBJECT_NAME;

spool off

@export_functions_xxx.sql
Re: urgent..How to get the creation script for the objects java sources,libraries and type bodies.. [message #20833 is a reply to message #20826] Mon, 24 June 2002 12:20 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
You can get JAVA SOURCE; TYPE; TYPE BODY from USER_SOURCE or ALL_SOURCE.
Libraries are simply pointers - see USER_LIBRARIES or ALL_LIBRARIES.
Previous Topic: returning result set in procedure
Next Topic: urgent
Goto Forum:
  


Current Time: Wed Apr 24 19:49:02 CDT 2024