Re: Calling PL/SQL Procedure from Trigger

From: Thomas J. Kyte <tkyte_at_us.oracle.com>
Date: 1996/11/08
Message-ID: <32834b62.2093740_at_dcsun4>#1/1


Just like in Ada, the NumArrayTyp declared in your trigger is a different Type then the numArrayTyp declared in your package (they may look the same, but they are different.).

Code:

   x_vals dbcalls.NumArrayTyp;
   y_vals dbcalls.NumArrayTyp;

And remove your definition of NumArrayTyp from the trigger. That'll fix it.

On Thu, 07 Nov 1996 20:45:27 -0600, Jim Anderson <anderson_at_h2o.mrd.usace.army.mil> wrote:

>Platform: Solaris 2.5.1
>Oracle Version: 7.2.3
>
>I have a trigger that is calling a procedure. Part of the code follows:
>
>CREATE OR REPLACE TRIGGER tsv_ins_121996_gen
> AFTER INSERT ON tsv_121996
> FOR EACH ROW
> DECLARE
> TYPE NumArrayTyp IS TABLE OF REAL
> INDEX BY BINARY_INTEGER;
> stat_code VARCHAR2(4);
> parm_code VARCHAR2(2);
> x_vals NumArrayTyp;
> y_vals NumArrayTyp;
> num_vals INTEGER;
> ratid INTEGER;
> err_num INTEGER;
> BEGIN
> <code deleted>
> DBCALLS.SELECT_RATING (stat_code, x_vals, y_vals,
> num_vals, ratid, err_num);
> <etc.....>
> When I try to create the trigger, I get the following error:
>
>CREATE OR REPLACE TRIGGER tsv_ins_121996_gen
>*
>ERROR at line 1:
>ORA-06550: line 23, column 7:
>PLS-00306: wrong number or types of arguments in call to 'SELECT_RATING'
>ORA-06550: line 23, column 7:
>PL/SQL: Statement ignored
>
>I am certain that the error is caused by x_vals and y_vals.
>When I try to call procedures without TABLE OF.. parameters, I get no
>errors. When I try to call procedures with TABLE OF.. parameters, I get
>errors.
>
>The SELECT_RATING procedure has the exact same declaration for the
>x_vals and y_vals parameters. I have tried several different approaches,
>but get the same results. Is there something special I must do to call
>a procedure with TABLE OF.. parameters? I call this procedure from a
>PRO*Fortran program with no probblms.
>
>Thanks,
>Jim Anderson

Thomas Kyte
Oracle Government
tkyte_at_us.oracle.com                          

http://govt.us.oracle.com

  • Check out Oracle Governments web site! ----- Follow the link to "Tech Center" and then downloadable Utilities for some free software...

statements and opinions are mine and do not necessarily reflect the opinions of Oracle Corporation Received on Fri Nov 08 1996 - 00:00:00 CET

Original text of this message