Executing proc

CREATE OR REPLACE PROCEDURE SPAC_FE_GET_FERM_TYPES(
error_no      IN OUT NUMBER,
error_msg      IN OUT VARCHAR2,
RC1      IN OUT Omwb_emulation.globalPkg.RCT1)
AS
what should I be calling to exec this proc?
I m using
SQL>VAR C1 REFCURSOR
SQL>EXEC SPAC_FE_FERM_TYPES(0,NULL,:C1)
and its giving this error:
BEGIN SPAC_FE_GET_FERM_TYPES(0,NULL,:C1); END;
ERROR at line 1:
ORA-06550: line 1, column 30:
PLS-00363: expression '0' cannot be used as an assignment target
ORA-06550: line 1, column 32:
PLS-00363: expression ' NULL' cannot be used as an assignment target
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Please help me.....what should I be using to exec this proc.....
Thanks!

ERROR at line 1:
ORA-06550: line 1, column 30:
PLS-00363: expression '0' cannot be used as an
assignment target
ORA-06550: line 1, column 32:
PLS-00363: expression ' NULL' cannot be used as an
assignment target
ORA-06550: line 1, column 7:
PL/SQL: Statement ignoredit needs a parameter variable to assign the value being pass by the procedure.
Declare
vErrNo     Number := 0;
vErrMsg    Varchar2(240);
c1         RefCursor;
Begin
SPAC_FE_FERM_TYPES(vErrNo,vErrMsg,c1);
End;
/

Similar Messages

  • Security error - User is not allowed to execute Proces - Resolved

    Enabled security on my domain by editing message-handlers.xml :
    <inbound-flow>
    <!-- <message-handler id="default" />-->
    <message-handler id="security" />
    </inbound-flow>
    commented out <property id="SecuredProcesses" > .. </property> to apply security to all processes.
    Now when I initiate process through BPELConsole I tick the WS-Security and use bpeladmin/welcome1 as credentials (I'm logged into console as this), I get the following error. In fact I get the very same error if I make up a username/password.
    <2007-10-24 08:17:41,343> <ERROR> <archi2.collaxa.cube> <BaseCubeSessionBean::lo
    gError> Error while invoking bean "delivery": [com.collaxa.cube.engine.handlers.
    HandlerInvocationException: Error while invoking inbound message handler.
    An error has occurred while attempting to invoke the inbound message handler cla
    ss "class com.collaxa.cube.security.Authenticator" for the message "". The exce
    ption reported was: User is not allowed to execute Proces, User[true] process [f
    alse]
    ORABPEL-02175
    In bpel.xml of the process itself I have this:
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <BPELSuitcase>
    <BPELProcess id="SQTest2" src="SQTest2.bpel">
    <partnerLinkBindings> ....snip...
    </partnerLinkBindings>
    <preferences>
    <property name="user" encryption="plaintext">bpeladmin</property>
    <property name="pw" encryption="plaintext">welcome1</property>
    </preferences>
    </BPELProcess>
    </BPELSuitcase>
    If I don't supply username/password then I get "Could not apply security [No username provided, security expects user]" which sounds right enough.
    I'm using the default authentication scheme system-jazn-data.xml and using 10.1.3.3 patchset on linux.

    My own fault, putting user credentials in wrong place in bpel.xml:
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <BPELSuitcase>
    <BPELProcess id="SQTest2" src="SQTest2.bpel">
    <partnerLinkBindings> ....
    </partnerLinkBindings>
    <configurations>
    <property name="user" encryption="plaintext">bpeladmin</property>
    <property name="pw" encryption="plaintext">welcome1</property>
    </configurations>
    </BPELProcess>
    </BPELSuitcase>

  • Execute proc with out parameter

    hi
    I dont know whether this question fits this forum,eventhough i'm asking
    how to execute a procedure in toad having out parameter
    Edited by: user588120 on Sep 28, 2010 4:51 AM

    declare
    <variable> <variable type>;
    begin
    <your procedure>(<variable>);
    end;
    PL/SQL doc question.
    Sybrand Bakker
    Senior Oracle DBA

  • Executing proc from sqlplus.

    Hi all,
    can you please let me know how to run a procedure with an OUT paramater using sqlplus?
    I ran from Toad and got the output..but not able to do so in sqlplus.
    CREATE OR REPLACE PROCEDURE IDM.GET_CAP_DATE
    CAP_DATE OUT VARCHAR2
    ) IS.....................................
    I tried the following from sqlplus
    variable CAP_DATE VARCHAR2(100);
    exec GET_CAP_DATE;
    print :CAP_DATE;
    Am I right in doing this?
    Appreciate your help!
    Thanks in advance!
    MN

    Hi,
    You're almost right, but you need to use your variable when executing your procedure:
    exec GET_CAP_DATE(:CAP_DATE);
    Infact you're better off using a function instead:
    - procedure usually 'do stuff'.
    - a function always needs to return a value.
    MHO%xe> create or replace procedure get_date_proc
      2  (p_date out date)
      3  as
      4  begin
      5    select sysdate
      6    into   p_date
      7    from   dual;
      8  end get_date_proc;
      9  /
    Procedure is aangemaakt.
    MHO%xe> set autoprint on
    MHO%xe> var my_date varchar2(25)
    MHO%xe> exec get_date_proc(:my_date);
    PL/SQL-procedure is geslaagd.
    MY_DATE
    10-09-2009 20:39:42
    MHO%xe> create or replace function get_date_func
      2  return date
      3  as
      4  begin
      5    return(sysdate);
      6  end get_date_func;
      7  /
    Functie is aangemaakt.
    MHO%xe> select get_date_func from dual;
    GET_DATE_FUNC
    10-09-2009 20:40:13
    MHO%xe> exec :my_date := get_date_func
    PL/SQL-procedure is geslaagd.
    MY_DATE
    10-09-2009 20:40:34And don't use strings to store dates, always use the DATE datatype for DATES.
    Never store a date in a string.
    The function can be selected from DUAL easily (procedures cannot) and your DATE still is a DATE.

  • Error in executing proc

    For a declared cursor variable i am getting the following error
    what may be the problem
    7/16 PL/SQL: SQL Statement ignored
    7/62 PL/SQL: ORA-00942: table or view does not exist
    9/1 PL/SQL: Statement ignored
    9/22 PLS-00364: loop index variable 'CUR_REC' use is invalid
    and the corresponding code in line 7 is
    FOR C_REC IN (SELECT DISTINCT col_1,col_2 from tablename)
    and the code in line 9 is
    proc_name(C_REC.param1 type,C_REC.param2 type);
    what may be the error

    Now see these two
    proc_name(C_REC.param1..type,C_REC.param2..type);
    is ther any gap where I made the dots.
    Thanks

  • The First execution of a Stored Proc shows a delay between SP:StmtStarting and SP:Starting

    We experience a performanceproblem with some of our Stored Procedures. SQL Server is "Microsoft SQL Server 2012 (SP1) - 11.0.3128.0 (X64)"
    Situation:
    SQL Server Proc1 executes some SQL Statement and starts some other SQL Stored Procedures. I open a SQL Management Studio Session "example session_id 105", trace the session 105 with the SQL Server Profiler.
    I start Proc 1, when Proc1 starts the execution of Proc 2, the Profiler Trace shows a delay of 6 seconds between SP:StmtStarting "execute db..proc2 @SomeVar" and SP:Starting "execute db..proc2 @SomeVar".
    All following executions of Proc1 in the Session 105 runs without a delay between SP:StmtStarting "execute db..proc2 @SomeVar" and SP:Starting "execute db..proc2 @SomeVar".
    But when i open a new SQL Server Management Session "session_id 124", the first execution of Proc1 when it executes Proc 1, there is again the delay of 6 seconds between SP:StmtStarting "execute db..proc2 @SomeVar" and SP:Starting "execute
    db..proc2 @SomeVar".
    Proc 1 starts the execution of Proc2 with a simple execute statement like this:
    Execute DB..Proc2 @SomeVar
    So its not dynamic SQL.
    What is SQL Server doing? I understand that SQL Server has to do some work when it executes the first time a Stored Procedure. But why is the SQL Server doing it in every new Session?
    How can i prevent this behavior or how to make it faster?
    Best Regards
    Paolo

    >In my case the temp tables ruined the performance.
    Creating temp tables takes time & resources. Temporary table usage should be justified and tested in stored procedures. There are cases when temporary table usage is helpful especially with very complex queries.
    In your case it appears that not one but several temp tables were applied. That can be punishing.
    Paul White's blog: "Ask anyone what the primary advantage of temporary tables over
    table variables is, and the chances are they will say that temporary tables support statistics and table variables do not.  This is true, of course; even the indexes that enforce PRIMARY KEY and UNIQUE constraints on table variables do not have
    populated statistics associated with them, and it is not possible to manually create statistics or non-constraint indexes on table variables.  Intuitively, then, any query that has alternative execution plans to choose from ought to benefit from using
    a temporary table rather than a table variable.  This is also true, up to a point.
    The most common use of temporary tables is in stored procedures, where they can be very useful as a way of simplifying a large query into smaller parts, giving the optimizer a better chance of finding good execution plans, providing statistical
    information about an intermediate result set, and probably making future maintenance of the procedure easier as well.  In case it is not obvious, breaking a complex query into smaller steps using temporary tables makes life easier for the optimizer in
    several ways.  Smaller queries tend to have a smaller number of possible execution plans, reducing the chances that the optimizer will miss a good one.  Complex queries are also less likely to have good cardinality (row count) estimates and statistical
    information, since small errors tend to grow quickly as more and more operators appear in the plan.
    This is a very important point that is not widely appreciated.  The SQL Server query optimizer is only as good as the information it has to work with.  If cardinality or statistical information is badly wrong
    at any point in the plan, the result will most likely be a poor execution plan selection from that point forward.  It is not just a matter of creating and maintaining appropriate statistics on the base tables, either.  The optimizer does
    use these as a starting point, but it also derives new statistics at every plan operator, and things can quickly conspire to make these (invisible) derived statistics hopelessly wrong.  The only real sign that something is wrong (aside from poor performance,
    naturally) is that actual row counts vary widely from the optimizer’s estimate.  Sadly, SQL Server does not make it easy today to routinely collect and analyse differences between cardinality estimates and runtime row counts, though some small (but welcome)
    steps forward have been made in SQL Server 2012 with new row count information in the
    sys.dm_exec_query_stats view.
    The benefits of using simplifying temporary tables where necessary are potentially better execution plans, now and in the future as data distribution changes and new execution plans are compiled.  On the cost side of the ledger we have
    the extra effort needed to populate the temporary table, and maintain the statistics.  In addition, we expect a higher number of recompilations for optimality reasons due to changes in statistics.  In short, we have a trade-off between potential
    execution plan quality and maintenance/recompilation cost.
    LINK:
    http://sqlblog.com/blogs/paul_white/archive/2012/08/15/temporary-tables-in-stored-procedures.aspx
    Kalman Toth Database & OLAP Architect
    IPAD SELECT Query Video Tutorial 3.5 Hours
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • System calls through Java stored Proc

    Hi,
    Aim: Execute host command from pl/sql thru java stored proc.
    1. Created a java class to take system command that could be executed.
    2. It runs fine when the class file is executed.
    3. when the java file is loaded to database to access it as java stored proc, for any valid and invalid system commands it is giving out 'PL/SQL successfully completed.
    Results were not seen.
    4. Java source file.
    import java.io.*;
    import java.lang.*;
    public class Util extends Object
    public static int RunThis(String[] args) {
    Runtime rt = Runtime.getRuntime();
    int rc = -1;
    String s = null;
    try
    Process p = rt.exec(args);
    BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));
    BufferedReader stdError = new BufferedReader(new InputStreamReader(p.getErrorStream()));
    // read the output from the command
    System.out.println("Here is the standard output of the command:\n");
    while ((s = stdInput.readLine()) != null) {
    System.out.println(s);
    // read any errors from the attempted command
    System.out.println("Here is the standard error of the command (if any):\n");
    while ((s = stdError.readLine()) != null) {
    System.out.println(s);
    System.exit(0);
    catch (Exception e){
    e.printStackTrace();
    rc = -1;
    finally {
    return rc;
    public static void main(String[] args){
    Util.RunThis(args);
    public static String exec(String args){
              Util.RunThis(args);
              return "Srini it is successful";
    5. When ran from host prompt (unix),
    executed successfully,
    $ /opt/java1.3.1/bin/java Util /usr/bin/ls -l
    Here is the standard output of the command:
    total 30862
    -rwxrwxrwx 1 xyz develope 1348218 Jan 2 17:47 02Jan03-2.zip
    -rw-r----- 1 xyz develope 21864 Jul 9 2002 109-60_2_modified7.sql
    -rw-r----- 1 xyz develope 44934 Jul 9 2002 109-60_2_modified8.sql
    Here is the standard error of the command (if any):
    xyz@xxxxx:abcd:/home/xyz
    $
    6. loadjava,
    $ loadjava -user username/password Util.java
    7. Create proc,
    SQL> create procedure echo_input(s1 varchar2) as language java name 'Util.main(java.lang.String[])';
    2 /
    Procedure created.
    8. Execute proc.
    SQL> exec echo_input('/usr/bin/ls -l');
    PL/SQL procedure successfully completed.
    SQL> exec echo_input('/home/o_report/reports/rcli_ASCT &');
    PL/SQL procedure successfully completed.
    SQL> set serverout on
    SQL> exec echo_input('/home/o_report/reports/rcli_ASCT');
    PL/SQL procedure successfully completed.
    SQL> exec echo_input('ddsafafasf');
    PL/SQL procedure successfully completed.
    TIA,
    Srini.

    Hi Srini,
    This is just a suggestion, but try entering the following commands (in your SQL*Plus session) before executing your stored procedure:
    set serveroutput on size 1000000
    exec dbms_java.set_output(1000000)Hope this helps.
    Good Luck,
    Avi.

  • Execute a sql procedure with java?

    Hi
    Got this CREATE OR REPLACE PROCEDURE legg_til_student (p_fnavn student.fornavn%TYPE, p_enavn student.etternavn%TYPE, p_klasseid student.klasseid%TYPE) IS
    v_id student.id%TYPE;
    BEGIN
         SELECT MAX(id) +1 INTO v_id
         FROM student;     
         IF p_klasseid > 3 THEN
         DBMS_OUTPUT.PUT_LINE ('Ugyldig klasseid');
         ELSE
         INSERT INTO student VALUES (v_id, p_fnavn, p_enavn, p_klasseid);
         END IF;
    END;
    /  Procedure that are mad in sql+ , the problem is how to run this trough java ?
    Thanks :)

    Hey I wrote this :
    public void registrerStudent(StudentVO student) {
              Connection con = null;
              CallableStatement proc;
              try {
                   proc = con.prepareCall("{call legg_til_student(?, ?) }");
                   proc.setString(1, student.finnFornavn());
                   proc.setString(2, student.finnEtternavn());
                   proc.setInt(3, student.finnKlasse());
                   proc.execute();
                   proc.close();
              } catch (SQLException e) {
                   System.out.println("BLEHHH");
                   e.printStackTrace();
         }And Testing with this class :
    public class Test {
         public static void main(String args[]){
              StudentDAO dao = new StudentDAO();
              StudentVO t = new StudentVO("Arne", "Nilsen", 3);
              dao.registrerStudent(t);
    }But i am getting a
    java.lang.NullPointerException
         at ver002.student.StudentDAO.registrerStudent(StudentDAO.java:44)
         at ver002.student.Test.main(Test.java:22)
    Exception in thread "main" Any idea what i am doing wrong ?

  • Is there a way to execute a procedure referenced in an XML string?

    The XML string can contain a stand-alone procedure/function or one within a package. The procedure/functions themselves may contain any number of inputs or outputs for procedures. I'm not sure how the procedure that will process this XML string will "know" the datatypes for the IN/OUT parameters for any given stored program. Does Oracle have any built-in mechanism that will execute stored procs in an XML, or would I have to write something that loops through the XML, extracting the proc names, parameters, and parameter values, then query the data dictionary for what type of OUT parameter data type should be used?
    I am told that SQL*Server is able to execute procs reference in XML, so I'm assuming Oracle must have some sort of API to use as a gateway for executing a procedure.

    Hi ,
    Open your edgeProject/index_edgeActions.js.Replace the following with single line comment. Open in edge animate 2014 and publish again. Published content will work
             /*================================================================================
             change Q number to match breakers || Q should = breakers +1 to account for 0 value if no BK0 exists
                     |    |
                     |    |
                     |    |                   DOUBLE CHECK BECAUSE OF BK0
                     |    |
                     |    |
                     |    |
                   __|    |__
             ================================================================================*/
    Like this.
             //================================================================================
             //change Q number to match breakers || Q should = breakers +1 to account for 0 value if no BK0 exists
             //        |    |
             //        |    |
             //        |    |                   DOUBLE CHECK BECAUSE OF BK0
             //        |    |
             //        |    |
             //        |    |
             //      __|    |__
             //================================================================================

  • Cannot figure out why "ORA-01000 Maximum open cursors" is shown...

    Hello there ...
    I am programming a PL/SQL Code that is throwing 0RA-01000 Maximum Open Cursors Exceeded.
    Having already read quite a lot about ORA-01000 errors, I know I should be closing cursors, and have already tried setting OPEN_CURSORS parameter to a high number (1000).
    I declared a lot of procedures in my pl/sql, each of which uses one cursor since i am working with a non-Oracle table linked by ODBC ... and each procedure sometimes does thousands of inserts -- but all WITHIN the explicit cursors. The explicit cursors are not declared within each loop.
    I already checked the code many times, and made sure all open cursors are closed. In addition, I also verified the numberopen cursors generated by the PL/SQL by running the following SQL after every procedure i run... and outputting it... and it appears the value just keeps on increasing, even though I had explicitly closed all the cursors in all the earlier procedures.
    What is funny is that the most number of cursors reported by the code below only hits 150+ cursors. Nowhere near the 1000 open_cursors limit per session.
    select a.value into strtxt --, b.name        
            from v$mystat a, v$statname b
            where a.statistic# = b.statistic#
            and a.statistic#= 3;When I run the procedures separately though, all the procedures run smoothly (even when I had not yet updated the open_cursors parameter).
    I was thinking of the following, but maybe you have some other ideas?
    Does this have anything to do with my procedures not being stored procedures?
    Or should i be committing records within my procedures instead of out of it?
    I really have run into a wall and would really appreciate any tips or helps on this. Thanks in advance!
    My basic pl/sql code looks like below. I did not give the actual details cause it will be too long (up to 5000 lines).
    DECLARE
    PROCEDURE proc1
    IS
        CURSOR cur_hca
           is
               select ...from..where;
       TYPE cur_hca_fetch
            Is TABLE OF cur_hca%ROWTYPE
                INDEX BY PLS_INTEGER;
        temp_collect cur_hca_fetch;
    BEGIN
       open cur_hca;         --cur_hca is the cursor name.
                                      --i use exactly the same cursor name in the other procedures
          loop
             fetch cur_hca bulk collect into temp_collect LIMIT 1000;
             exit when temp_collect.count=0
             for indx in 1 .. temp_collect.count
                loop
                  ...run some sql
                end loop;
          end loop;
      close cur_hca;
    END proc1;
    PROCEDURE proc2   --almost the same as above the only changes are the query for the
                                 -- cursor and the sql that happens for each record
    IS
    BEGIN
       open cur_hca;         --cur_hca is my cursor name
          loop
          end loop;
      close cur_hca;
    END proc2;
    ... up to 40 other very similar procedures
    BEGIN
       proc1;
       commit;
       select a.value into strtxt
            from v$mystat a, v$statname b
            where a.statistic# = b.statistic#
            and a.statistic#= 3;
      DBMS_OUTPUT.PUT_LINE('Number of Cursors After STATUSproc1: ' || strtxt); 
       proc2;
       commit;
       select a.value into strtxt
            from v$mystat a, v$statname b
            where a.statistic# = b.statistic#
            and a.statistic#= 3;
       DBMS_OUTPUT.PUT_LINE('Number of Cursors After STATUSproc2: ' || strtxt); 
       ... 40 other procedures
    END;Edited by: user4872285 on May 6, 2013 6:49 PM
    Edited by: user4872285 on May 6, 2013 7:01 PM
    Edited by: user4872285 on May 6, 2013 8:02 PM
    Edited by: user4872285 on May 6, 2013 8:03 PM

    PL/SQL code usually leaks reference cursors and DBMS_SQL cursors - as the ref cursor/DBMS_SQL interface used has a global (session static) scope.
    PL/SQL has an intelligent garbage collector that will close local implicit and explicit cursors, when the cursor variable goes out of scope.
    If you define an explicit cursor globally (package interface), then it can only be opened once. The 2nd attempt results in a ORA-06511: PL/SQL: cursor already open exception. So code cannot leak explicit cursors as code cannot reopen an existing opened explicit cursor.
    I have never seen Oracle leaking cursors internally. So I would be hesitant to call what you are seeing, a bug. If your code is using explicit cursors (even static/global ones), your code cannot leak these cursors, even if your code does not close them. Worse case - the cursor remains open, however new copies cannot be created while it is open.
    So I think your are looking at the wrong thing - explicit cursors. These are not the cursors that are leaking in my view (simply because code cannot reuse and open an already opened explicit cursor). Here is an example:
    SQL> show parameter cursors
    NAME                                 TYPE        VALUE
    open_cursors                         integer     300
    session_cached_cursors               integer     50
    // procedure that seems to "leak" an explicit cursor handle
    // as it does not explicitly closes the handle
    SQL> create or replace procedure CursorUse is
      2          cursor c is select e.* from emp e;
      3          empRow  emp%RowType;
      4  begin
      5          open c;
      6          fetch c into empRow;
      7          --// not closing explicit cursor handle
      8          --// and going out-of-scope
      9  end;
    10  /
    Procedure created.
    // current session stats
    SQL> select b.name, a.value from v$mystat a, v$statname b where a.statistic# = b.statistic# and b.name like '%open%cursor%';
    NAME                                  VALUE
    opened cursors cumulative                91
    opened cursors current                    2
    // execute proc that "leaks" a cursor, 10000 times
    SQL> begin
      2          for i in 1..10000 loop
      3                  CursorUse;
      4          end loop;
      5  end;
      6  /
    PL/SQL procedure successfully completed.
    // no errors due to cursor leakage
    // session stats: no cursor leakage occurred as
    // PL/SQL's garbage collector cleaned (and closed)
    // cursor handles when these became out-of-scope
    SQL> select b.name, a.value from v$mystat a, v$statname b where a.statistic# = b.statistic# and b.name like '%open%cursor%';
    NAME                                  VALUE
    opened cursors cumulative            10,095
    opened cursors current                    2
    SQL> So the cursor leakage you are seeing is caused by something else... so what else is part of the code, or the session, that you have not yet mentioned?

  • Oracle SQL Developer  error - "The file-based source procedure Name is not present in the database."

    I recently started working on the Oracle SQL developer. I have 'select' privileges on the QA schema and when tried to execute proc in QA. It is giving the error as 'The file-based source <procedure Name>  is not present in the database.  Was it compiled?'
    instead 'you do not have sufficient privileges to execute this procedure'. Did research on internet but with no luck.What configuration changes needed to be done to make it work.Guide me.

    Sounds like you do not have the correct privileges.  What should have been granted to you by the QA user, or some other user with appropriate privileges, is...
    grant EXECUTE on "QA"."<PROCEDURE_OF_INTEREST>" to "<YOUR_USERID>" ;
    Note that a grant of execute on a procedure has nothing to do with grants of select on some or all of QA's tables and views.
    So, as Vadim suggests, from your connection node in SQL Developer's Connections view, if you expand the Other Users node, then expand QA and look in the Procedures node, do you see the procedure of interest?  If not, you cannot expect to be able to execute it from your userid's connection. And even if you do see it, you may have some other privilege that permits viewing but not executing, like...
    The role SELECT_CATALOG_ROLE
    The system privilege SELECT ANY DICTIONARY
    And even if you do not see it there, then having certain other privileges granted to you could permit executing it in general, like...
    The role EXECUTE_CATALOG_ROLE
    The system privilege EXECUTE ANY PROCEDURE
    Also, note that the 3.0 release is a bit dated nowadays. Upgrading to 4.0.3 production or even the 4.1 EA2 (early adopter) release will, in general, give you a better experience.
    Best wishes,
    Gary

  • DBMS_JOB

    I'm sure you have all had enough questions from me in the past few days! but you all are so helpful i can't stop my self from attempting to get as much help as i can :D its hard to read through documentation 50 pages long when you all usually have a paragraph answer that gives me the important stuff that i am missing linking together...
    I've figured out how to send an e-mail using a trigger and a procedure when an employee is inserted into the employee table. (this is for school- but showing that you can e-mail someone to notify them that an event has occured within the database).
    I've been reading about DBMS_JOB and it looks like i could use this in the procedure so intead of sending the e-mail right away, i could add this to a list of jobs and it would take place after the commit?
    I don't understand the documentation on dbms_job very well...
    Is it possible to make dbms_job occur when commit has taken place?
    Would this work for my situation? i've included some code.
    Any ideas on where i'd get started with it?
    Any input would be wonderful- thanks again everyone.
    create or replace
    PROCEDURE proc (p_sender IN VARCHAR2,
    p_recipient IN VARCHAR2,
    p_message IN VARCHAR2, p_subject IN VARCHAR2)
    as
    l_mailhost VARCHAR2(255) := 'my smtp';
    l_mail_conn utl_smtp.connection;
    nline VARCHAR2(2):= UTL_TCP.CRLF;
    BEGIN
    l_mail_conn := utl_smtp.open_connection(l_mailhost, 25);
    utl_smtp.helo(l_mail_conn, l_mailhost);
    utl_smtp.mail(l_mail_conn, p_sender);
    utl_smtp.rcpt(l_mail_conn, p_recipient);
    utl_smtp.open_data(l_mail_conn );
    utl_smtp.write_data(l_mail_conn, nline || 'From' || ': ' || p_sender || nline);
    utl_smtp.write_data(l_mail_conn, 'To' || ': ' || p_recipient || nline);
    utl_smtp.write_data(l_mail_conn, 'Subject'|| ': ' || p_subject || nline);
    utl_smtp.write_data(l_mail_conn, 'Message' || ': ' ||p_message || nline);
    utl_smtp.close_data(l_mail_conn );
    utl_smtp.quit(l_mail_conn);
    end;
    CREATE OR REPLACE TRIGGER emailInsertTrigger
    BEFORE INSERT ON EMPLOYEE
    FOR EACH ROW
    DECLARE msg varchar2(2000);
    BEGIN
    msg := chr(13) || chr(10) || chr(13) || chr(10) || 'New Employee Information: ' || chr(13) || chr(10) || 'SSN: ' || to_char(:new.ssn) || chr(13) || chr(10) || 'Name: ' || :new.fname || ' ' || :new.minit || ' ' || :new.lname || chr(13) || chr(10) || 'Birth Date: ' || to_char(:new.bdate, 'Month DD, YYYY') || chr(13) || chr(10) || 'Address ' || :new.address || chr(13) || chr(10) || 'Sex: ' || :new.sex || chr(13) || chr(10) || 'Salary: ' || to_char(:new.salary,'$9999,999.00') || chr(13) || chr(10) || 'Supervisor SSN: ' || to_char(:new.super_ssn) || chr(13) || chr(10) || 'Department Number: ' || to_char(:new.dno);
    proc('my e-mail','my e-mail','msg','subject');
    dbms_output.put_line('e-mail sent');
    END;
    Edited by: user12264910 on Nov 30, 2009 12:19 PM

    It is giving me an error- i can't figure out these last two variables.... i tried the one you suggested and got error as well.
    CREATE OR REPLACE TRIGGER emailInsertTrigger
    BEFORE INSERT ON EMPLOYEE
    FOR EACH ROW
    DECLARE
    msg varchar2(2000);
    l_jobno integer;
    BEGIN
    msg := chr(13) || chr(10) || chr(13) || chr(10) || 'New Employee Information: ' || chr(13) || chr(10) || 'SSN: ' || to_char(:new.ssn) || chr(13) || chr(10) || 'Name: ' || :new.fname || ' ' || :new.minit || ' ' || :new.lname || chr(13) || chr(10) || 'Birth Date: ' || to_char(:new.bdate, 'Month DD, YYYY') || chr(13) || chr(10) || 'Address ' || :new.address || chr(13) || chr(10) || 'Sex: ' || :new.sex || chr(13) || chr(10) || 'Salary: ' || to_char(:new.salary,'$9999,999.00') || chr(13) || chr(10) || 'Supervisor SSN: ' || to_char(:new.super_ssn) || chr(13) || chr(10) || 'Department Number: ' || to_char(:new.dno);
    dbms_output.put_line('e-mail sent');
    dbms_job.submit(l_jobno, 'execute proc(''[email protected]'', ''[email protected]'', ' || msg || ' , ''TESTINGNEW'');', SYSDATE, SYSDATE);
    dbms_output.put_line( 'Job ' || l_jobno || ' submitted.');
    END;
    SQL> @newtrig.sql
    Trigger created.
    SQL> insert into EMPLOYEE values ('test1f','test1l1','A','111135111', to_date('2001/01/01','yyyy/mm/dd'), '1 test rd', 'M', 11111, '123411111' , 1)
    ERROR at line 1:
    ORA-06550: line 1, column 166:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    ( - + case mod new not null others <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> avg
    count current exists max min prior sql stddev sum variance
    execute forall merge time timestamp interval date
    <a string literal with character set specification>
    <a number> <a single-quoted SQL string> pipe
    ORA-06512: at "SYS.DBMS_JOB", line 79
    ORA-06512: at "SYS.DBMS_JOB", line 136
    ORA-06512: at "MDIBLA1.EMAILINSERTTRIGGER", line 7
    ORA-04088: error during execution of trigger 'MDIBLA1.EMAILINSERTTRIGGER'
    any suggestion?

  • DML visibility in stored procedures called via JDBC

    Hello,
    I have two stored procedures, A and B. Proc A inserts Q into table X. Proc B selects Q from table X to insert it into table Y. Neither procedure does a COMMIT.
    My Java class executes Proc A and then Proc B within a transaction (autocommit is false). But Proc B fails to select Q from table X with the No Data Found error, apparently unable to see the recently inserted Q.
    If these two procedures are called from a SQL*Plus block, everything succeeds.
    Does anyone have a clue about what I am missing? All my DML should be visible to my session.
    Thank you in advance for any suggestions.
    - CJ

    Thank you, Joe, for your reply!
    To the best of my knowledge, all of my stored procedure calls are being made from the same connection so I can rollback everything if necessary. I have not explicitly closed the connection between calls. The debugger indicates my connection session id never changes across calls.
    Do you know of any JDBC trace tools that might help me verify my connections? I've enabled logging with oracle.jdbc.driver.OracleLog.setTrace(true) but it doesn't really give me specific connection information - at least not that I can tell. :)
    Thanks!
    Cori

  • Problem with ORA-24372 invalid object for describe

    I have unresolved problem with oracle message: ORA-24372 invalid object for describe. There is the client-server application which installed on users PCs. Client application is program on Delphi 7 that installed on several users PCs which works with Oracle DB 10g server (clients on users side 8.1.7) by means ODAC 5.7. Each user by means this application works with data on Oracle server. Each group of users uses its own schema. Each of this schema has grants to select data and execute procs in the main schema. During the time of operation I modified and compiled some procs in the main schema. As the result I found some depended Invalid objects in main schema. I recompiled them. There is no invalid objects in all schemas. But when I starts application in one user place (he uses for example schema X1) I see oracle message: ORA-24372 invalid object for describe. Other users in group which uses schema X1 works without this problem. There is finite aggregate of users of schema Х1 which has this message but some users of schema Х1 has no problem. All users has identical software and there is no any invalid objects in schemas! I try to start application on my PC using schema X1 and finds ORA-24372 then I try to start application on neighbors PC and it is all ok! It happened after I recompiled main schema in the time of users operation. What should I do to resolve this problem? Where to find the source of the problem: in client or in server?

    To Mr. Sven Weller
    The purpose of creation X1 (X2, Х3…) was restriction of users to access objects in the Main Schema. X1 has no any objects except function that returns her name for internal purposes. X1 has many synonyms for objects in the Main schema. There is no invalid objects in X1!

  • Running SQL Server Function and Procedures from Oracle

    I am trying to run SQL Server 2005 functions and/or procedures from a SQL statement in Oracle. I have gone throught the hetergeneous services and have connected to the SQL Server database successfully. I can also do a query to a table in SQL Server successfully; but I have not been able to execute a procedure or a function.

    Have you tried Oracle syntax? It seems to me that you have only tried T-SQL syntax, e.g. execute proc.
    Wrap it in a begin..end tag like you would a normal PL/SQL function or proc call. Assumption is that as Oracle makes the remote database (via the dblink) look like an Oracle database, you should also play along and pretend it is one and treat it as such.
    E.g.declare
      r integer;
    begin
      -- execute remote proc
      procFoo@dblink( 'ABC' );
      -- call a remote function
      r := funcFoo@dblink( 123 );
    end;

Maybe you are looking for

  • Is the power cord covered under warranty?

    i was just wondering because mine is already ruined and it's only a couple months old. there's a cut in the cord leading to the computer from the block and the plug part that goes into the computer also has rips on the cord. is this covered?

  • How to get the page numbers of a word/mpp/execl doc using Java?

    Hi, I meet a problem in Java programming. I want to get the page numbers of a Word/MPP/EXECL/PDF document. For exmaple, if a PDF docment have 10 pages, I need get the 10 . How to get it using Java? Please advise me as soon as possible if you have any

  • Error-CIN-J1IIN - Tax code A0 in procedure TAXINJ is invalid.

    hi All, While posting excise invoice in J1IIN, getting errror "Tax code A0 in procedure TAXINJ is invalid" Tax code A0 not crated in FTXP at all. Also I have not assigned ths tax code to company code in CIN config. From where system is picking this A

  • Duplicate Applications in "Open With" List

    Okay so heres the issue, if I right click on a file and go to the "open with" flyout in many cases there's duplicates of apps sometimes it mentions a different version number other times not. I was just curious as to what might be causing this and ho

  • MAC OSX 10.1.5

    Im still using the old osx ...Can i buy the osx 10.4 tiger without buying the previous OS software? like jaguar? Thanks