Home Discussion Discuss: Create After Insert Trigger in SQL

  • my sqlerror 1442saranya jothiprakasam November 23, 2011 at 5:18 PM

    i got the error as can't update table dctblloaddata in stored function/trigger because it is already used by statement which invoked this stored fuction/trigger when trying to insert the row.. my trigger is as follows delimiter $$ create trigger s after insert on dctblloaddata for each row begin declare v_value long; select LoadProfileID from cfw.dctblloaddata order by LoadProfileID desc limit 1 into v_value; update `dctblloaddata` set AvgCurrent=-99999.99, AvgVolt=-99999.99, ActiveDemandFwd=-99999.99, ApperentDemandFwd=-99999.99 where ((LoadProfileID=v_value ) AND (AvgCurrent>800 OR AvgCurrent = 0 OR AvgCurrent =-99999.99 OR AvgVolt >300 OR AvgVolt=0 OR AvgVolt=-99999.99 OR ActiveDemandFwd=0 OR ActiveDemandFwd=-99999.99 OR ApperentDemandFwd=0 OR ApperentDemandFwd=-99999.99)) ; end $$ delimiter ; give me some suggestion for me why it is not properly working.

Post your Comment



Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Related Articles
Programming Tutorials

Create After Insert Trigger in SQL
Create After Insert Trigger in SQL   ... from 'Create After Insert Trigger in SQL'. In this Example, we create...)); Create Trigger Stu_Insert The Query createtrigger stu_insert 

Java-Tutorials

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

SQL Question

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

General

Trigger
Trigger After Insert The Tutorial illustrate an example from Mysql Trigger After Insert. To understand this, we create a table 'Employee...; Mysql Trigger After Delete The Tutorial illustrate 

SQL Tutorial

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

SQL Tutorial

Create After Insert Trigger in SQL
Create After Insert Trigger in SQL   ... from 'Create After Insert Trigger in SQL'. In this Example, we create..._log. delimiter $$ CREATE TRIGGER stu_insert AFTER 

SQL Tutorial

Mysql Trigger After Insert
Mysql Trigger After Insert       Mysql Trigger After Insert fired the trigger after you... The Tutorial illustrate an example from Mysql Trigger After Insert. To understand 

MySQL

MySQL After Trigger
MySQL After Trigger This example illustrates how to create the trigger...' and 'description'. A trigger is defined to activate when an INSERT, DELETE, or UPDATE... before or after the triggering statement. Query CREATE TABLE Roseindia 

SQL Question

How to trap Trigger Error - SQL
NVARCHAR(2000) ) select * froM ERROR_LOG CREATE OR REPLACE TRIGGER LogErrors AFTER SERVERERROR ON DATABASE BEGIN INSERT INTO error...How to trap Trigger Error  Hi Guys, Can you please help with my 

Programming Tutorials

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

SQL Tutorial

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

SQL Question

using trigger - SQL
it is possible ? Create trigger tr1 on student after update as begin update m...://www.roseindia.net/mysql/mysql5/triggers.shtml http://www.roseindia.net/sql/create-update-trigger.shtml http://www.roseindia.net/sql/trigger/mysql-trigger-after 

SQL Tutorial

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

SQL Tutorial

Mysql Trigger after Update
; delimiter $$ mysql> CREATE TRIGGER Employee_Trigger -> AFTER UPDATE...Mysql Trigger after Update       Mysql Trigger after  Update fired automatically after we perform 

SQL Question

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 

SQL Question

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

SQL Question

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

SQL Tutorial

Create Delete Trigger in SQL
Create Delete Trigger in SQL       Create Delete Trigger in SQL fire this trigger before... The Tutorial illustrate an example from 'Create Delete Trigger in SQL 

Java-Tutorials

Create Delete Trigger in SQL
Create Delete Trigger in SQL       Create Delete Trigger in SQL fire this trigger before... The Tutorial illustrate an example from 'Create Delete Trigger in SQL 

SQL Tutorial

Mysql Time Trigger
. The trigger event can be before trigger, after trigger  and instead of trigger... Trigger. To grasp this example we create a table 'Stu_Table1'. The create table... Timelastdeleted); Query to create trigger:- Now we use create trigger stu_delete 

MySQL

Mysql Time Trigger
. The trigger event can be before trigger, after trigger  and instead of trigger... Trigger. To grasp this example we create a table 'Stu_Table1'. The create table...); Query to create trigger:- Now we use create trigger stu_delete on table stu_table 

Programming Tutorials

Create Before Update Trigger in SQL
Create Before Update Trigger in SQL       Create Before Update Trigger in SQL is used in SQL... Update Trigger in SQL' . To understand this example we create a table 'Stu 

SQL Tutorial

Create Before Update Trigger in SQL
Create Before Update Trigger in SQL       Create Before Update Trigger in SQL is used in SQL... Update Trigger in SQL' . To understand this example we create a table 'Stu 

Java Beginners

insert rows from browsed file to sql database
insert rows from browsed file to sql database  i need to insert rows... the databases using odbc i can do this. but after browsing and uploaded the file, content of the file has to go to database. how can i insert record into database 

SQL Question

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 

SQL Question

The INSERT INTO Statements in SQL?
The INSERT INTO Statements in SQL?  The INSERT INTO Statements in SQL?   Hi, The INSERT INTO statement is used to insert a new row or multiple rows into a table. SQL INSERT INTO Syntax INSERT INTO table_name VALUES 

SQL Question

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

PHP

Php Sql Query Insert
Php Sql Query Insert  This example illustrates how to execute insert query with values in php application. In this example we create two mysql query for insert statement with separate values in the database table. The table before 

SQL Question

trigger
 

Free SQL books

SQL Example, Codes and Tutorials
; Create After Insert Trigger in SQL Create a Trigger is a special kind...; Create Before Insert Trigger in SQL The Create Before Insert Trigger... Trigger in SQL  After Trigger in SQL is fired before update the column 

DMCA.com