trigger after insert for deletion0 Answer(s) 2 years and 4 months ago
Posted in : SQL

String query2 = "create TRIGGER trig after insert on "cart"
+ " FOR EACH ROW "
+ " BEGIN "
+ " declare expiry1 date ;"
+ " select expiry into expiry1 from cart; "
+ " if expiry1 > (1 month of purchase) then "
+ " delete from cart ;"
+ " END if ;"
+ " END ;";
int rs = st1.executeUpdate( query2);
i have to do the above trigger operation, but i'm stuck with how to write the if condition.
I would be thankful for any help.

Advertisement

View Answers

Post Answer

Preview:

Related Tutorials/Questions & Answers:

trigger after insert for deletiontriggerafterinsert for deletion String query2 = "create TRIGGER trig afterinsert on "cart"
+ " FOR EACH ROW... = st1.executeUpdate( query2);
i have to do the above trigger operation, but i'm stuck

Create After Insert Trigger in SQL
Create AfterInsertTrigger in SQL
&nbsp... from 'Create AfterInsertTrigger in
SQL'. In this Example, we create...));
Create Trigger Stu_Insert
The Query create a trigger stu_insert

Create After Insert Trigger in SQL
Create AfterInsertTrigger in SQL
&nbsp... a example from 'Create AfterInsertTrigger in
SQL'. In this Example, we... $$
CREATE TRIGGER stu_insertAFTERinsert ON stu_table FOR EACH ROW
BEGIN

Create After Update Trigger in SQL
Create After Update Trigger in SQL
AfterTrigger in SQL is fired before update... illustrate an example from 'Create After Update Trigger in
SQL'. In order

Mysql Trigger After Delete
Employee_TriggerAFTER delete ON employee
FOR EACH ROW
BEGIN
insert into employee... Mysql TriggerAfter Delete
Trigger in Mysql fired trigger automatically after you

Create After Update Trigger in SQL
Create After Update Trigger in SQL
AfterTrigger in SQL is fired before update... illustrate an example from 'Create After Update Trigger in
SQL'. In order

Create Before Insert Trigger in SQL
Create Before InsertTrigger in SQL
The Create Before InsertTrigger in SQL fires the trigger... Tutorial describe you a code on 'Create Before InsertTrigger in
SQL'. To grasp

TriggerTriggerAfterInsert
The Tutorial illustrate an example from Mysql TriggerAfterInsert. To understand this, we create a table 'Employee...;
Mysql
TriggerAfter Delete
The Tutorial illustrate

Create Before Insert Trigger in SQL
Create Before InsertTrigger in SQL
The Create Before InsertTrigger in SQL fires the trigger before we insert
the value into the table.
Understand with Example

MySQL After Trigger
MySQL AfterTrigger
This example illustrates how to create the trigger...' and 'description'. A trigger is defined to activate when an INSERT, DELETE, or UPDATE... to
insert the data in Roseindia_log table after inserting the data

trigger
trigger write a trigger program before insert into salary that it must not below Rs 1000

trigger
trigger write a trigger program before insert into salary that it must not below Rs 1000

can i use trigger to insert data within a time period ?
can i use trigger to insert data within a time period ? Hello sir,
i... this trigger concept the data will be insert to each Employee's ID.
Plz sir help me regarding this problem.how to solve this issue and how i will use this trigger

trigger
trigger write a trigger to see every manager must be highest salary

Mysql Time Trigger
Mysql Time Trigger
Mysql Time Trigger is fired when a specified event is occurred. The trigger
event can be before trigger, after trigger and instead of trigger

Mysql Time Trigger
Mysql Time Trigger
Mysql Time Trigger is fired when a specified event is occurred. The trigger
event can be before trigger, after trigger and instead of trigger

What is Trigger?
What is Trigger? What is Trigger?
Hi,
A trigger... in the database server.The event can be any event including INSERT, UPDATE and DELETE. The difference between a trigger and a
stored procedure

deletion in b plus treedeletion in b plus tree please help me out!!
i need a code for deletion on b-plus tree in JAVA.
its urgent please help

Updation and deletion - JSP-Servlet
Updation and deletion How to provide updation and deletion in data view of jsp Hi Friend,
Please visit the following links:
http://www.roseindia.net/jsp/user-search.shtml
http://www.roseindia.net/servlets

How to insert new line after every space in java
How to insert new line after every space in java Hii Sir,
I have a string with values 69 17 17 16 2 1 1 26 26 56 like this .Now as per my need i have to put all these values into new lines on getting space

using trigger - SQL
using trigger sir i want to use this trigger in ado.net. how it is possible ?
Create trigger tr1 on student
after update as
begin
update m...-update-trigger.shtml
http://www.roseindia.net/sql/trigger/mysql-trigger-after