How to get return code of compiling a package

Hi,
i want to compile a package and if it was not succesfull to write the error_message from "show errors" into a file.
thx
Wolle

the problem with compiling individual packages is that you might inadvertently invalidate others. you should also programmatically check package dependencies too so you dont break any accidentally.
if you're only compiling package bodies, this shouldn't be an issue, but if youre also compiling specs, this is something you should keep an eye on.
i wrote an application that uploads new packages i commit in cvs to our database and then recompiles them. it then reports whether or not compilation was successful. this helps eliminate alot of user error when people manually recompile packages in HA environments. however, i recompile the entire schema when i do this (this is not something run very often). i can get away with this at my shop because the schema is very small, but this might not be a practical solution for everyone.
this is how i check for dependencies:
FROM public_dependency pd, user_objects uo
WHERE referenced_object_id IN (select object_id from user_objects where object_name= UPPER(?))
AND uo.object_id = pd.object_id
this is useful for saving a snapshot of current package (in case of reversion):
SELECT TEXT FROM USER_SOURCE WHERE NAME = ?
this is how you can recompile the schema:
DBMS_UTILITY.COMPILE_SCHEMA(?, TRUE, TRUE);
i do a check for invalid objects in the schema before i even start (And exit with error if any are found) :
SELECT OBJECT_NAME, STATUS
FROM USER_OBJECTS
WHERE (OBJECT_TYPE='PACKAGE' OR OBJECT_TYPE='PACKAGE BODY')
AND STATUS <> 'VALID'
Hope this info helps.
Edited by: user577162 on Aug 25, 2008 2:21 PM

Similar Messages

  • How to get return code or parameters from PL/SQL in my shell script ?

    My shell script must check the result of PL/SQL's running, and decide what to do in the next step.

    I think you put the problem the wrong way.
    You should try to do as much as possible through your SQL scripts, and, if you need to make OS calls, you may do that using host(command_string).
    If you need to transfer parameters from other programs to your FORMS (PL/SQL), then you have to see user_exit.
    Some other means would be to have your PL/SQL write to certain OS files that the shell script may read, but that doesn't seem like good practice to me.

  • How to get return value from Java runtime.getRuntime.exec?

    I'm running shell commands from an Oracle db (11gr2) on aix.
    But, I would like to get a return value from a shell comand... like you get with "echo $?"
    I use a code like
    CREATE OR REPLACE JAVA SOURCE NAMED common."Host" AS
    import java.io.*;
    public class Host {
      public static int executeCommand(String command) {
        int retval=0;
        try {
            String[] finalCommand;
            finalCommand = new String[3];
            finalCommand[0] = "/bin/sh";
            finalCommand[1] = "-c";
            finalCommand[2] = command;
          final Process pr = Runtime.getRuntime().exec(finalCommand);
          pr.waitFor();
       catch (Exception ex) {
          System.out.println(ex.getLocalizedMessage());
          retval=-1;
        return retval;
    /but I do not get a return value... because I don't know how to get return value..
    Edited by: user9158455 on 22-Sep-2010 07:33

    Hi,
    Have your tried pr.exitValue() ?
    I think you also need a finally block that destroys the subprocess
    Regards
    Peter

  • Error Getting return code while FTPing file through JAVA

    Hello experts
    My requirement is to send file to Mainframe server in a JOBQ.I used a socket to connect to server. A designated FTP ID is provided for authentication.
    I tried to FTP file to mainframe sever, but while getting return code from server, i m recieving Junk values.I am reading return code through BufferReader.readline().
    I have set up the connection mode to ASCII mode.I tried to set up the connection mode to EBSIDIC mode too, but i revieve the same error.
    Any one have tried to FTP file to mainframe in got the same error.What could be the possible reason.
    Here is the error looks like :-
    Inside SocketClient() class, in connect(String hostname, int port) socket = Socket[addr=xxx.xx.xx.com/xx.xxx.xx.xx,port=21,localport=2500]
    Inside SocketClient() class, in connectAction() method (InputStream) input = java.net.SocketInputStream@696fc610
    Inside SocketClient() class, in connectAction() method (OutputStream) output = java.net.SocketOutputStream@695b8610
    Inside FTP class, in __getReply() method _controlInput = java.io.BufferedReader@15370617
    Inside FTP class, in __getReply() method Line = ��&�&#63641;����(��&����/������<�������<&#63641;��|(?>
    Any help in this topic is appriciated
    Regards
    Samit

    This is the third party API's i have used
    http://www.enterprisedt.com/downloads/ftp.html
    download this.
    Version 1.2.1 (Jan 29, 2003). Download here. (tar.gz format. WinZip will unpack this). Compiled/tested for JDK1.4.x. Will work for 1.3.x etc

  • How to get the sparc c compiler in solaris 9.

    How to get the sparc c compiler in solaris9 is the licence one?. If it is license what was the procedure to get the software.

    The gcc compiler is available on the "extra" disk in Solaris 9, but we don't recommend using gcc for Solaris development. (You can if you want to, but you will get better performance using the Studio C compiler.
    For Solaris 9, which is now obsolete, the most recent version of Studio that supports it is Sun Studio 12 (released in 2007). You can download it here:
    http://www.oracle.com/technetwork/server-storage/solarisstudio/downloads/ss12-136026.html
    Patches for Studio 12 are available to fix known bugs, but you need a service contract with Oracle to get them. Click on the "Support" tab for details.

  • Get return code in command line

    Hi,
    Is possible modify or get return code diferent 0 or 1 when start scenario using command line?

    i use control+M, and result with erros in E$, send to "hospital" whit this

  • Error in LSMW getting return code 6

    Hi all,
                 i Am getting a  Error in LSMW getting return code 6 , after asign a file , in the read data step i am getting the error , please help me it is very urgent,
    sridhar

    Hi,
    If the Sy-Subrc is 0 then Success, if the Sy-SUBRC is 4 then failure, if the Sy-SUBRC = 6 then the user might be not access to read the file
    AUTHORITY-CHECK sets SY-SUBRC to 0 if the user has the necessary authorization, otherwise 4, 8, 12, 16, 24, 28, 32, or 36 depending on the cause
    Regards
    Sudheer

  • How to get PPA Code

    Hi Friends,
                      Can u please let me know how to get PPA Code from ZZ_PPA_C.
    Please help me its urgent.
    Regards,
    Rajiv Kaushal

    What do you mean?
    The restriction code would be whatever you set it to be.
    There is no restriction codeunless you set it.

  • Getting return code as 1 for SD_SHIPMENT_PROCESS_HU

    Hi All,
    Could you please tell me what is the use of SD_SHIPMENT_PROCESS_HU function module.
    I am debugging one standard program in that after processing  this FM in  SD_SHIPMENT_PROCESS Function module getting return code is 1.
    Could you please tell me,what might be the reason.
    Thanks in Advance.
    Regards,
    Rama.

    Hi Rama,
    if you will look into the specified function module
    CALL FUNCTION 'SD_SHIPMENT_PROCESS_HU'
      IMPORTING
        e_logfile =                 " v56e_logfile
      CHANGING
        c_activities =              " v56e_shipment_activities
        c_shipment =                " v56e_shipment
      EXCEPTIONS
        ERROR = 1                   "
    so if you are getting returned code as 1, it means there is any error.

  • How to get cliam code on officejet 6600

    how to get cliam code officejet 6600

    Hi there, you need to enable web services from the printer display panel once the printer is connected to the internet (wireless or ethernet). The information page that prints out when you do this contains the printers ePrint code that serves as its email address.
    Hope this answers your question but post back if you're still unsure of how to enable or use ePrint on your OJ 6600.
    Best
    If my reply helped you, feel free to click on the Kudos button (hover over the "thumbs up").
    If my reply solved your problem please click on the Accepted Solution button so other Forum users may benefit from viewing the post.
    I am an HP employee.

  • How to get function code of enter button in bdc manually

    hi
    i need to know how to get function code of enter button in bdc manually like in screen i want to capture techincal infor of enter buttion and itd fucntion cod ehow can i get it i mean what is the key in keyboard to display that
    i want to capture enter button and for eg status button etc funtion code
    pls suggest
    arora

    Hi,
    Want you need to do is go to transaction SHDB and record the bdc for the transaction you want, during transaction press the buttons for which you want the bdc code. And after this go press the back button and check the list of all the things recorded in Recorder.
    And for SHDB help check this link:
    http://abaplovers.blogspot.com/2008/02/recording-bdc-using-transaction-shdb.html
    Hope this helps.
    Regards,
    Qamar.

  • How to get list of tables used in packages

    Dear All
    Can you pls tell me how to get list of tables used in packages
    Regards

    select referenced_name
      from user_dependencies
    where name = 'your_package'
       and referenced_type = 'TABLE'Regards,
    Rob.

  • Getting return code from remote script after Unix rsh call

    I hope one of you guys can help me with this issue. I think I've gotten the 'rsh' command to work from the CES application so that the sqr report generation can execute on a remote machine (instead of the app server machine). I'm actually doing this by having the app still execute the ces_sqr script, however, now the ces_sqr script will just have an 'rsh' command in it which will cause the actual real sqr processing to occur remotely.
    I am executing a Unix script which does a remote shell call to another script on a remote machine. The remote script sends a return code when run locally, however, how can I get the calling rsh script to get that return code?
    If I do the following in the rsh script:
    rsh -l resdev morph "/dev/bin/remote_script"
    rc=$?
    echo "$rc\n"
    then the return code that I get is not actually the return code from the remote_scrpit, but it is the return code from the rsh command that is 0 (success) because the rsh command actually executed successfully even though the remote_script could've returned something other than success. How can I get the return code from the remote_script passed back to the rsh calling script?
    Jan Miller
    [email protected]
    202-237-9584

    Please ignore the first paragraph of my previous post.

  • Getting return code from subprocess execution

    Hi,
    I am executing a batch file as a subprocess and need to get the return code from it.
    The batch file executes a java class, which exits (System.exits(rc)) with a return code on error and how this can be captured in the calling program.
    i am calling the batch file as follows: (fragment)
    Runtime r;
    process p = r.exec(execCmd, null, mqsiToolFile);
    istr = p.getInputStream();
    br = new BufferedReader(new InputStreamReader(istr));          
    returnCode = p.waitFor();
    System.out.println("exit value: "+p.exitValue());
    This successfully executes the subprocess and always returns with code '0', even though the sub-process exits with a code >0.
    p.waitFor() or p.exitValue() - doesn't giving the exit value of the subprocess.
    How can i capture the exit value (System.exit(rc)) from the sub-process.
    I am running the app on Windows NT4 sp6
    Any help would be greatful.
    Thanks in Advance.

    Peter,
    can u be more explanative on this, i can see the run time result (0, 1). But couldn't get familiar on the sample you have given.
    My code is as follows:
    Process p = null;
    Runtime r = Runtime.getRuntime();
    for loop {
    execSubProcess(.., .., ..)
    public int execSubProcess(String excmd, String[] env, File fileDir) throws Exception {
    int res = 0;
         try {
              System.out.println(excmd);
              p = r.exec(excmd, null, fileDir);
              istr = p.getInputStream();
              br = new BufferedReader(new InputStreamReader(istr));
              line = null;
              while ((line = br.readLine()) != null) {
                   System.out.println(line);
              res = p.waitFor();
         System.out.println("sub-process return code: "+p.waitFor());
              System.out.println("sub-process exitValue: "+p.exitValue());
         } catch (Exception e) {
         throw e;
         return res;
    Here i get all the time 'res=0' , even though the subprocess execCmd exits with a return code > 0.
    Is tehre any environment setup or ..needed to capture the subprocess exit code val (System.exit(rc)) in the calling program.
    Please provide more details as per ur convinience.
    thanks

  • How to get return values from task flow in af:region ?

    Hi!
    I'm working with a taskFlow that is rendered inside a popup using the "popup inside a region pattern" (http://www.oracle.com/technology/products/adf/patterns/popupregionpattern.pdf), but now this taskFlow has an input parameter and a return value definition. So the question is how to get a value returned by this taskFlow thas is called inside a region?
    Any suggestion?
    Thanks in advance!

    Hi,
    write the value to a shared memory scope like session and read it in the regionNavigation listener. If you follow the paper you refer to then the listener determines of the viewId is null, this a return happens. It wuld then look in the memory scope for the return value.
    Another option would be to use an object that you pass as an argument to the task flow you open in the popup. Then you change the object you passed in, which then makes the return information available in teh calling flow. The object you pass in would have to be in a shared scope too
    Frank

Maybe you are looking for

  • Apple loops download doesn't work?

    Just upgraded to a new iMac and noticed many of the standard Apple loops are greyed out. When I double-click one, I get: "The Software Instrument or Apple Loop selected is not currently installed on your computer. Would you like to install the comple

  • No sound with Keynote?

    Hi, I just tried to view the MacWorld Keynote and cannot get sound. I have an Intel MacBook with the latest updates. -Dan Uff

  • Does the new X1-01 support only MP3?

    Hello people! I'm currently an X6 16GB user and I'm planning to get the X1-01 as my second phone. I just like to know if the X1-01 supports MP3 only? I'm asking this because almost all my music files are in AAC format. Regardless, I'll just convert m

  • IPod skips over purchased music

    I have a weird problem with my iPod, and I was hoping someone here could help me with it. Every couple of weeks, my iPod goes through this weird stage. It will not play any of the songs I purchased from iTunes. I can click on them normally, but then

  • TOMCAT server problem at startup

    Hello I use apache-tomcat-4.1.37. When I start tomcat I get an long error-output in catalina.out. Can anybody help me to fix this? Sorry for this long error-posting! Jan 13, 2006 12:18:54 AM org.apache.catalina.core.StandardHostDeployer install INFO: