Home » RDBMS Server » Server Administration » within a trigger, trying to select values into variables based on the trigger statement
within a trigger, trying to select values into variables based on the trigger statement [message #370252] Tue, 13 July 1999 19:57 Go to next message
scott campbell
Messages: 13
Registered: July 1999
Junior Member
Hi,
I'm trying to use the column that I designate in the trigger statement (after update on NSN in nsntable1) to write columns in the row updated to variables. I'm trying to use a select into statement. I'm not at work at the moment and forget the exact syntax but patterned it after printed examples. My code fails with a meesage to the effect that the select is trying to fetch more data than is available. I'm guessing that this is easily doable but I haven't found the technique. Any help is very much appreciated.
Re: within a trigger, trying to select values into variables based on the trigger statement [message #370256 is a reply to message #370252] Wed, 14 July 1999 10:30 Go to previous message
scott campbell
Messages: 13
Registered: July 1999
Junior Member
Martin,

Thanks for taking a look at this problem. I've pasted the trigger in question below and hope that the comments give you some idea of what I'm trying to accomplish.

----------

/* I'm trying to check a column in a table for update activity. If I see it, I want to move a an associated UNIX file to a different
file system. I can hard code the values associated with the holder
variables to make this routine work but can't insert them with a select
statement. The code below compiles but the holder variables aren't
being loaded. */
--
--
create or replace trigger trgr_test_pass
after update of nsn on nsn2ktrans
--
--
declare
holder1 varchar2(20);
holder2 varchar2(20);
--
--
-- read columns nfile and kfile from nsn2ktrans into the two
-- variables to be passed to the procedure when n = 1
--
begin
select nfile, kfile into holder1, holder2 from nsn2ktrans where nsn = 1;
--
-- calling procedure that will rename UNIX files
-- associated with nfile and file values
--
begin
proc_test_pass(holder1, holder2);
end;
end;
/
Previous Topic: Re: Help on Date type with OO4O
Next Topic: Formatting numerical data
Goto Forum:
  


Current Time: Thu Oct 22 05:03:39 CDT 2020