gaurav sharma
asked on
Call a procedure on command line
I have the below procedure. how can i call it on the command line with sqlplus
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
If I were to put this call in a file would it be .sql ? and what would be the contents of a file ?
It would be one line:
exec recomp;
Then from within SQL*Plus, you would run that using
@<path_to_script>/<script_ name>
exec recomp;
Then from within SQL*Plus, you would run that using
@<path_to_script>/<script_
ASKER
This is the error I get:
Failed to execute: EXEC RECOMP
java.sql.SQLException: ORA-00900: invalid SQL statement
Failed to execute: EXEC RECOMP
java.sql.SQLException: ORA-00900: invalid SQL statement
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
BEGIN
FOR cur IN (SELECT object_name,
object_type,
owner
FROM all_objects
WHERE object_type IN ('PACKAGE',
'PACKAGE BODY')
AND owner = 'TRON2000'
-- AND object_name like 'EM%'
ORDER BY object_name)
LOOP
BEGIN
IF cur.object_type = 'PACKAGE BODY' THEN
EXECUTE IMMEDIATE 'alter package "' || cur.owner || '"."' ||
cur.object_name || '" compile body';
ELSE
EXECUTE IMMEDIATE 'alter ' || cur.object_type || ' "' || cur.owner ||
'"."' || cur.object_name || '" compile';
END IF;
EXCEPTION
WHEN OTHERS THEN
NULL;
END;
--dbms_output.put_line('Re
-- cur.owner || '.' || cur.OBJECT_NAME);
END LOOP;
END;
/