Subject | Re: [IBO] Using parameters in a trigger |
---|---|
Author | slsolutions2002 |
Post date | 2002-02-14T21:51:33Z |
Hello:
The table is created as follows:
Create Table Jobs(
JobNo Integer Not Null,
...
The store procedure is created as follows:
Create Procedure spAddSupportRecords(JobNo Integer) As
...
The trigger is created as follows:
Set Term !! ;
Create Trigger trgAddSupportRecords For Jobs
After Insert
Position 0
As
Begin
Execute Procedure spAddSupportRecords(JobNo);
End !!
Set Term ; !!
Commit;
When I execute it I get an error message "Unknown column".
If I create the trigger as:
Set Term !! ;
Create Trigger trgAddSupportRecords For Jobs
After Insert
Position 0
As
Begin
Execute Procedure spAddSupportRecords(:JobNo);
End !!
Set Term ; !!
Commit;
I get the same error message.
If I create the trigger as:
Set Term !! ;
Create Trigger trgAddSupportRecords For Jobs
After Insert
Position 0
As
DECLARE JOBNO INTEGER;
Begin
Execute Procedure spAddSupportRecords(JobNo);
End !!
Set Term ; !!
Commit;
I get no error but, of course, this does not do what I need. It
simply proves the "unknown column" is JobNo.
Thanks
The table is created as follows:
Create Table Jobs(
JobNo Integer Not Null,
...
The store procedure is created as follows:
Create Procedure spAddSupportRecords(JobNo Integer) As
...
The trigger is created as follows:
Set Term !! ;
Create Trigger trgAddSupportRecords For Jobs
After Insert
Position 0
As
Begin
Execute Procedure spAddSupportRecords(JobNo);
End !!
Set Term ; !!
Commit;
When I execute it I get an error message "Unknown column".
If I create the trigger as:
Set Term !! ;
Create Trigger trgAddSupportRecords For Jobs
After Insert
Position 0
As
Begin
Execute Procedure spAddSupportRecords(:JobNo);
End !!
Set Term ; !!
Commit;
I get the same error message.
If I create the trigger as:
Set Term !! ;
Create Trigger trgAddSupportRecords For Jobs
After Insert
Position 0
As
DECLARE JOBNO INTEGER;
Begin
Execute Procedure spAddSupportRecords(JobNo);
End !!
Set Term ; !!
Commit;
I get no error but, of course, this does not do what I need. It
simply proves the "unknown column" is JobNo.
Thanks
--- In IBObjects@y..., Daniel Rail <drail@n...> wrote:
> Could you show us how you are doing it?
>
> Daniel Rail
> Senior System Engineer
> ACCRA Med Software Inc. (www.accramed.ca)
>
> At 14/02/2002 05:20 PM, you wrote:
> >I am trying to create a after insert trigger that will execute a
> >stored procedure. I need to pass one of the fields to the stored
> >procedure. No mater what I do I get a unknown column error. How
can
> >I pass a a field as a variable to the stored procedure from within
> >the trigger. Thanks.