Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2009
    Posts
    9

    Unanswered: Calling a procedure from a trigger

    I have created a procedure which is designed to copy a row of data from one table to another. I want to know how to run this procedure, do you do it from a trigger? If so, how?

    The procedure is called copy_calls

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    Last edited by anacedent; 12-10-09 at 14:38.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    What tool are you using to develop and run the code?

    I would heartily suggest you don't do this from a trigger

    Do you allow data modifications from other that packages/procedures

    And isn't it...

    EXEC package.procedure

    When in doubt on how to be nice...read the good news
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  4. #4
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Quote Originally Posted by Brett Kaiser View Post
    And isn't it...

    EXEC package.procedure
    Yes, it is - but only if the procedure is stored within the package. Otherwise, "EXEC procedure_name" is enough.

    On the other hand, EXEC works within SQL*Plus but not in triggers (which are PL/SQL programs). In there, you'd call a procedure just by its name, something like
    Code:
    declare 
      my_var number;
    begin
      select some_value 
        into my_var
        from some_table
        where some_condition;
    
      blabla
    
      my_procedure(my_var);     
    end;
    It will call a procedure named "my_procedure" and pass "my_var" as an argument.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •