How to call the function and Procedure in trigger?
Answers were Sorted based on User's Feedback
Answer / rakesh keshu
With the help of call statement..without semicolon
create or replace trigger tri_call
begin
call p1()
end tri_call;
| Is This Answer Correct ? | 12 Yes | 0 No |
Answer / pranabesh
Procedures can be called directly by name with parameters
[if any] in the trigger
ex:
suppose i have a procedure pro1(var1 in number, var2 in
number) which i want to call from trigger trig1
CREATE OR REPLACE TRIGGER TRIG1
AFTER UPDATE OF SAL ON EMP
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
DECLARE
L_VAR1 NUMBER;
...
...
BEGIN
...
...
-- CALLING THE PROCEDURE
pro1(10,20);
END
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / pradeep aryan
hi this is Sql server Statement:
Create table findSalary(salay int)
-- create procedure
Create proc stp_testdata
as
begin
select * from findsalary
end
-- Create function
create function Function4()
returns varchar
as
begin
return 'test data'
end
-- insert command
insert into findsalary values (89)
this is working fine
| Is This Answer Correct ? | 0 Yes | 3 No |
What is AUTH_ID and AUTH_USER in pl/sql ?
How to write html code in pl sql?
Is a foreign key always unique?
what are tables and fields? : Sql dba
What is procedure explain with program?
Is sql similar to python?
What is the difference between local and global temporary table?
When do we use triggers?
HP Interview -2016 Unix 1) grep command in unix 2) what is set command
table name: prod there are three fields in the table that are 1.proddate 2.prodQty 3.model Day wise prodQty is stored in the table prod write a query to display total prodqty in the year 2004 april.
How to create a menu in sqlplus or pl/sql?
What is sql entity?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)