: Assistance with trigger
Hi All
I am hoping this email finds all well.
I would like to request some assistance with a MySQL trigger please.
We need to implement a trigger that will in short terms make a backup of a
row before it gets deleted.
so we have tableA and TableB (backup table
Hi All
I am hoping this email finds all well.
I would like to request some assistance with a MySQL trigger please.
We need to implement a trigger that will in short terms make a backup of a
row before it gets deleted.
so we have tableA and TableB (backup table).
I added a
ment,
name varchar(255)
)//
CREATE TRIGGER TEST_TRIGGER
BEFORE INSERT ON Test
FOR EACH ROW
BEGIN
SET NEW.name = CONCAT(NEW.name, '_X');
END//
RENAME TABLE Test TO TestRenamed//
DROP TRIGGER Test.TEST_TRIGGER//
Are there any workarounds for this?
Thank you for
If you execute the script below, you will get the following error:
'Error Code: 1146. Table 'testschema.TestRenamed' doesn't exist"
delimiter //
CREATE TABLE Test(
id int not null primary key auto_increment,
name varchar(255)
)//
CREATE TRIGGER TEST_TRIGGER
BEFOR
Hi,
I've created a Trigger and want to edit it. Using MySQL Workbench, I can
Alter the table, and click Triggers and select the trigger action I want to
edit (on my local database, MySQL running on same PC)
However, if I try the exact same procedure on a Trigger on a remote
database, I
>>>> 2013/05/29 10:39 +0100, Neil Tompkins >>>>
Using Workbench with MySQL 5.6 how do I edit a existing Trigger. Do I need
to DROP the Trigger and create a new one ? If that is the case how can you
run start command in a live environment ?
<<<<<<<&
Hi,
Using Workbench with MySQL 5.6 how do I edit a existing Trigger. Do I need
to DROP the Trigger and create a new one ? If that is the case how can you
run start command in a live environment ?
Thanks
Neil
I'm using mysql version 5.1.66 on ubuntu and can not add a trigger any more.
When trying to add a trigger In phpmyadmin I get "Your SQL query has been
executed successfully" but when I issue the command show triggers; no triggers
are listed.
Im logged into mysql as root and Im
Is there white space at the end of the trigger name?
A
On Feb 20, 2012 10:04 PM, "Brent Clark" wrote:
> Hi Guys
>
> I wonder if someone could urgently help me
>
> Im trying to drop some triggers. But mysql says the trigger does not exist.
>
> I ran
>
> SELE
>> Physics 302 because a student might want to take both classes. And
>>> obviously, they shouldn't schedule Professor Higgenbothom to teach both
>>> Calculus 212 and Probability 278 at 10:00 AM on Monday, Wednesday, and
>>> Friday.
>>>
>>>
>> Physics 302 because a student might want to take both classes. And
>> obviously, they shouldn't schedule Professor Higgenbothom to teach both
>> Calculus 212 and Probability 278 at 10:00 AM on Monday, Wednesday, and
>> Friday.
>>
>> The problem isn't
t schedule Professor Higgenbothom to teach both
Calculus 212 and Probability 278 at 10:00 AM on Monday, Wednesday, and
Friday.
The problem isn't actually writing mysql to select the conflicts. The
problem is when and how to run the code. I could put it in a trigger but
say someone assigns Dr. Higgy to te
212 and Probability
278 at 10:00 AM on Monday, Wednesday, and Friday.
The problem isn't actually writing mysql to select the conflicts. The
problem is when and how to run the code. I could put it in a trigger but say
someone assigns Dr. Higgy to teach Calc 212 at 10 AM MWF. They need to b
On 7/10/2011 3:32 AM, vishesh kumar wrote:Hi Members
Whats wrong i am doing in following create trigger statement
Create trigger test before insert on user
for each row
begin
set New.host=upper(new.host)
end
Above statement giving error check sql syntax , please guide me
Thanks for reply , but i want to do only for certain record that i will put
using IF
On Sun, Jul 10, 2011 at 2:42 PM, Reindl Harald wrote:
>
>
> Am 10.07.2011 10:32, schrieb vishesh kumar:
> > Hi Members
> >
> > Whats wrong i am doing in following create trigger
Am 10.07.2011 10:32, schrieb vishesh kumar:
> Hi Members
>
> Whats wrong i am doing in following create trigger statement
>
> Create trigger test before insert on user
>for each row
>begin
> set New.host=upper(new.host)
>end
>
> Above
Hi Members
Whats wrong i am doing in following create trigger statement
Create trigger test before insert on user
for each row
begin
set New.host=upper(new.host)
end
Above statement giving error check sql syntax , please guide me. I want to
put host field value in uppercase in
er Windows boxes.
PB
-
On 3/11/2011 10:31 AM, Sándor Halász wrote:
2011/03/10 23:03 -0600, Peter Brawley>>>>
On 3/10/2011 8:10 PM, h...@tbbs.net wrote:
MYSQLDUMP.EXE (Ver 10.13 Distrib 5.5.8, for Win32 (x86)) has flags for
trigger-dumping; the help that I downloaded for this
>>>> 2011/03/10 23:03 -0600, Peter Brawley >>>>
On 3/10/2011 8:10 PM, h...@tbbs.net wrote:
>MYSQLDUMP.EXE (Ver 10.13 Distrib 5.5.8, for Win32 (x86)) has flags for
>trigger-dumping; the help that I downloaded for this version says it dumps
>triggers--but it d
MYSQLDUMP.EXE (Ver 10.13 Distrib 5.5.8, for Win32 (x86)) has flags for
trigger-dumping; the help that I downloaded for this version says it dumps
triggers--but it does not. Now what?
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http
I think if you built a trigger to update value of foo's column after, this
trigger will not be compiled cause it will execute two transactions on the
same one. Try it...
Best regards.
--
Wagner Bianchi
2010/12/21 Jerry Schwartz
> Aha! That was the clue I needed. Thank you so much.
&g
Aha! That was the clue I needed. Thank you so much.
So, to make sure I understand:
A “BEFORE” trigger is executed **between** the time that the record is
assembled and the time that the action occurs. That’s why the constraints on
the field value were being applied before my trigger was
Here's my latest attempt:
localhost >CREATE TRIGGER makefoo BEFORE INSERT ON testtrigger
-> FOR EACH ROW
-> SET NEW.foo = IFNULL(NEW.foo, 'ok')
-> |
Query OK, 0 rows affected (0.00 sec)
As you can see, the trigger syntax is correct; but it doesn't do
we create the trigger:
mysql> create trigger trg_test
-> before insert on testtrigger
-> for each row
-> begin
-> if(NEW.foo IS NULL || NEW.foo = '') then
-> set NEW.foo = 'Ok';
-> end if;
-> end;
-> //
Query OK, 0
The expression you supplied looks right enough.. how was it declared?
as an on UPDATE/on INSERT trigger or just a single case?
- michael dykman
On Mon, Dec 20, 2010 at 5:21 PM, Jerry Schwartz wrote:
> I've never used a trigger before, and I want to make one that sounds like it
>
I've never used a trigger before, and I want to make one that sounds like it
should be simple.
Create Table: CREATE TABLE `testtrigger` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`foo` char(10) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8
H
As far as I know, you can´t change data on the same table in triggers.
"Kevin Labecot" escreveu na mensagem
news:4d2ce38b-d169-478b-aebf-c19f20dce...@labecot.fr...
Hi,
Is there a way to update the same table on a delete trigger ?
I need to call an UPDATE statement when a del
Hi,Is there a way to update the same table on a delete trigger ?I need to call an UPDATE statement when a delete occurs.Best regards
-- Kevin Labecot, Innovanticwww.innovantic.frTél. : 05.56.45.60.54
>
> That is correct. There is as far as I know no way in a MySQL trigger to
> neither to do operations on the table the trigger belongs to (obviously
> except the row that the trigger is operating on through the NEW variables)
> nor reject an insert, update, or delete.
>
than
--- Original Message ---
> From: viraj
> To: mysql@lists.mysql.com
> Sent: 19/2/10, 05:48:41
> Subject: ERROR 1442 (HY000) when delete > inside trigger statement
> issue: ERROR 1442 (HY000): Can't update table 'T1' in stored
> function/trigger becau
i have two table, T1, T2. and 1 trigger.
trigger is before update on T1 and it updates some values in T2. once
it's done, the trigger tries to delete the subject row of T1 (delete
from T1 where id = new.id)
i tried with second trigger on T2 (after/before update) and with a
procedure inside
gt; On Tue, Dec 22, 2009 at 3:26 PM, Jeetendra Ranjan <
> jeetendra.ran...@sampatti.com> wrote:
>
> > Hi,
> >
> > I have created the below trigger from root user with definer:
> >
> > CREATE definer=`*root...@`` TRIGGER `CONSUMER_PROFILE_before_delete`
Hi Ranjan,
User doesn't have sufficient privileges. root access required.
Thanks,
Krishna
On Tue, Dec 22, 2009 at 3:26 PM, Jeetendra Ranjan <
jeetendra.ran...@sampatti.com> wrote:
> Hi,
>
> I have created the below trigger from root user with definer:
>
> CREATE de
is it root or root1 user.
Also is this trigger executed by root user or some other user.
On Tue, Dec 22, 2009 at 3:26 PM, Jeetendra Ranjan <
jeetendra.ran...@sampatti.com> wrote:
> Hi,
>
> I have created the below trigger from root user with definer:
>
> CREATE defin
Hi,
I have created the below trigger from root user with definer:
CREATE definer=`roo...@`` TRIGGER `CONSUMER_PROFILE_before_delete` BEFORE
DELETE ON CONSUMER_PROFILE FOR EACH ROW
begin
INSERT INTO
DELETED_CONSUMER_PROFILE(CONSUMER_ID,CONSUMER_TYPE_ID,ENTERPRISE_URL_ID,CONSUMER_FIRST_NAME
Jeetendra,
ERROR 1054 (42S22): Unknown column 'CAMPAIGN_ID' in 'OLD'
But this column is exist in DELETED_CONSUMER_ACTION_AUDIT table.
But does it exist in consumer_profile?
PB
-
Jeetendra Ranjan wrote:
Hi,
I am getting error while creating a simple trigger
my
Hi,
I am getting error while creating a simple trigger
mysql> CREATE TRIGGER CONSUMER_PROFILE_before_delete BEFORE DELETE ON
CONSUMER_PROFILE FOR EACH ROW
-> begin
-> INSERT INTO
DELETED_CONSUMER_PROFILE(CONSUMER_ID,CONSUMER_TYPE_ID,ENTERPRISE_URL_ID,CONSUMER_F
esday, November 04, 2009 2:33 PM
> To: 'Phil'; Mysql; 'Stefan Onken'
> Subject: RE: trigger
>
> 1. Triggers must have FOR EACH ROW -- it's described in the manual:
> http://dev.mysql.com/doc/refman/5.0/en/create-trigger.html
>
> So the correct syntax wo
Oops, one more mistake:
NOW()-60*60*24*5 isn't the way to do date math. It should be: NOW() - INTERVAL
5 DAY
-Original Message-
From: Gavin Towey
Sent: Wednesday, November 04, 2009 2:33 PM
To: 'Phil'; Mysql; 'Stefan Onken'
Subject: RE: trigger
1. Trigge
1. Triggers must have FOR EACH ROW -- it's described in the manual:
http://dev.mysql.com/doc/refman/5.0/en/create-trigger.html
So the correct syntax would be:
CREATE TRIGGER greylist_ins AFTER INSERT on greylist FOR EACH ROW delete from
greylist where first_seen < NOW()-60*60*24*5;
B
You are missing a BEGIN in the trigger
delimiter |
CREATE TRIGGER greylist AFTER INSERT on greylist
BEGIN
delete from greylist where first_seen < NOW()-60*60*24*5;
END;
|
delimiter ;
Phil
On Wed, Nov 4, 2009 at 2:28 PM, Stefan Onken wrote:
> Hello,
>
> I am new to using triggers
new to using triggers in mysql. I am using mysql 5.1.37 and would like
> to setup a trigger like:
>
> CREATE TRIGGER greylist AFTER INSERT on greylist
> delete from greylist where first_seen < NOW()-60*60*24*5;
> END;
>
> When typing this into mysql I am getting an error. Wh
Hello,
I am new to using triggers in mysql. I am using mysql 5.1.37 and would
like to setup a trigger like:
CREATE TRIGGER greylist AFTER INSERT on greylist
delete from greylist where first_seen < NOW()-60*60*24*5;
END;
When typing this into mysql I am getting an error. Where is my mist
Well that is embarasing, thank you, It always ends up being the simple
things that get you.
On Sat, Oct 17, 2009 at 1:25 PM, Michael Dykman wrote:
> It appears to be a simple enough error message. Here is your trigger
> you are reffering quite explicitly to credits.enabled:
>
> &
It appears to be a simple enough error message. Here is your trigger
you are reffering quite explicitly to credits.enabled:
> select SUM(credits.amount) into total_credits from credits where
> credits.enabled=1 and account=new.account;
and this table has no such column defined. debit
This is the first time I have attempted to expand beyond basic sql for
storing data in a table like structure. So my level of knowledge is
"familiar with basic SQL, but lacking in expanded knowledge". I expect my
error is a newbie mistake.
I have attempted to create a trigger to upda
In the last episode (Jul 09), Marcel Grandemange said:
> Create Trigger hostchange
> BEFORE UPDATE ON host
> FOR EACH ROW
> BEGIN
> IF NEW.status != OLD.status THEN
> use smsgw;
> insert into outbox (number, insertdate, text, phone, dreport) VALUES
> ('0836075
Good Day once again.
Im needing assistance again with triggers!
Create Trigger hostchange
BEFORE UPDATE ON host
FOR EACH ROW
BEGIN
IF NEW.status != OLD.status THEN
use smsgw;
insert into outbox (number, insertdate, text, phone, dreport) VALUES
('0836075144', '
> Curdate() returns a datetime, which you are pushing into a date field.
> It is truncating the time part. Just truncate it and you should be
> fine :)
Hmmm. Not according to
http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_curdate
or, indeed, experiments:
mysql> selec
> When a row is inserted into a table, I want populate a 'date' column with
> the date 45 days hence. I've created a trigger:
>
> CREATE TRIGGER `test`.`setExpiryDate` BEFORE INSERT ON `test`.`mysql_auth`
> FOR EACH ROW SET NEW.expires = curdate()+interval 45 day
>
>
I'm very new to triggers, so I suspect I've done something naive.
When a row is inserted into a table, I want populate a 'date' column with
the date 45 days hence. I've created a trigger:
CREATE TRIGGER `test`.`setExpiryDate` BEFORE INSERT ON `test`.`mysql_auth`
FOR
The DROP TRIGGER command is in the wrong place. You changed the delimiter to $$
but still tried to use the semicolon(;) with DROP TRIGGER.
Your code should read like this:
DROP TRIGGER IF EXISTS cfe_tg_calcular_consumos;
DELIMITER $$
CREATE TRIGGER cfe_tg_calcular_consumos
AFTER
2009/5/13 Mauricio Tellez :
> Hi, I'm developed a trigger with mysql version 5.0.51(ubuntu), and when I
> tried to move this to a production server (version 5.0.22 fedora) I ran into
[...]
> but mysql say there is an error near EXISTS cfe_tg_calculas_consumos. Of
http://dev.mysql.
Hi, I'm developed a trigger with mysql version 5.0.51(ubuntu), and when I
tried to move this to a production server (version 5.0.22 fedora) I ran into
2 problems:
1. I try to install the trigger from a text file, and the first lines were:
DELIMITER $$
DROP TRIGGER IF E
Hi all,
I am having some issues with my replication setup which I have narrowed down
to being a problem on the master, more specifically an issue with the binlog
when using a trigger.
I have a trigger on one of my tables that archives an entry before deleting
it:
DELIMITER //
CREATE TRIGGER
Going back to the OP's problem - the original issue I believe was he was
using "old" instead of "OLD" (case-sensitive) - now that's sorted, MySQL
is complaining about a syntax error toward the end of the function
declaration.
I'm surprised by the case sensitivity of OLD though, it works fine
I think you are missing the point. Where is 'OLD' or 'old' defined?
Before you try to imbed it in a trigger, try the basic query. That seems
to be what its complaining about.
OLD is a virtual table which is only present in a trigger - it's like a
table with the
On Fri, December 5, 2008 12:14, Martijn Tonies wrote:
> Hi,
>
>>>>> What is the exact error message?
>>>>
>>>>
>>>> Here's the latest query:
>>>>
>>>> delimiter //
>>>> create trigger jobposts
Hi,
What is the exact error message?
Here's the latest query:
delimiter //
create trigger jobposts_control
before delete on jobposts for each row
begin
declare dummy varchar(255);
set @counted = (
select count(ad.adsource_id)
from adsource ad, jobposts jp
eate table jobposts(adsource_id int,jobpost_id int);
create table adsource(adsource_id int);
delimiter //
create trigger jobposts_control
before delete on jobposts for each row
begin
declare dummy varchar(255);
set @counted = (select count(ad.adsource_id)
from adsource ad,
Andy Shellam wrote:
I'm guessing it's the first semi-colon in your IF statement. Does
this work...?
if @counted >= 1 then SET dummy = 'Cannot delete this record' end if;
Just a guess!
Andy.
That's not it, unfortunately.
ERROR: You have an error in your SQL syntax; check the manual
th
delimiter //
create trigger jobposts_control
before delete on jobposts for each row
begin
declare dummy varchar(255);
set @counted = (
select count(ad.adsource_id)
from adsource ad, jobposts jp
where ad.adsource_id = jp.adsource_id
and OLD.jobpost_id
Martijn Tonies wrote:
Hi,
What is the exact error message?
Here's the latest query:
delimiter //
create trigger jobposts_control
before delete on jobposts for each row
begin
declare dummy varchar(255);
set @counted = (
select count(ad.adsource_id)
from adsour
Hi,
What is the exact error message?
Here's the latest query:
delimiter //
create trigger jobposts_control
before delete on jobposts for each row
begin
declare dummy varchar(255);
set @counted = (
select count(ad.adsource_id)
from adsource ad, jobposts jp
Martijn Tonies wrote:
What is the exact error message?
Here's the latest query:
delimiter //
create trigger jobposts_control
before delete on jobposts for each row
begin
declare dummy varchar(255);
set @counted = (
select count(ad.adsource_id)
from adsource ad, job
Jim Lyons wrote:
can you not use referential integrity for this - assuming the tables are or
can be made to be innodb?
The tables are myISAM. These could be changed to innodb but I want to
see if i can get this trigger work.
Does the jobposts table have a jobpost_id field, or is it just
is a virtual table that is the same as the table I'm doing
> work on. See <http://dev.mysql.com/doc/refman/5.0/en/trigger-syntax.html>.
> What I need to do is check if jobposts record has jobposts.adsource_id
> (foreign key) which still exists in adsource table (primary key).
I'm trying to create a trigger (5.0.45) and I've read the documentation
at mysql.com. I keep getting a syntax error, but can't figure out what
the error is. Here's the trigger I'm trying to create:
delimiter //
create trigger jobposts_control
before delete on jo
#x27;m
doing work on. See
<http://dev.mysql.com/doc/refman/5.0/en/trigger-syntax.html>. What I
need to do is check if jobposts record has jobposts.adsource_id (foreign
key) which still exists in adsource table (primary key). If adsource
record still exists, then do not proceed with del
On 12/5/08, Lola J. Lee Beno <[EMAIL PROTECTED]> wrote:
>
> I'm trying to create a trigger (5.0.45) and I've read the documentation at
> mysql.com. I keep getting a syntax error, but can't figure out what the
> error is. Here's the trigger I'm trying t
I'm trying to create a trigger (5.0.45) and I've read the documentation
at mysql.com. I keep getting a syntax error, but can't figure out what
the error is. Here's the trigger I'm trying to create:
delimiter //
create trigger jobposts_control
before delete on jo
fo a trigger, but I don't know how to
difine it.
Thanks,
Uwe
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iQIcBAEBAgAGBQJJBDhNAAoJEEJXG7BUuynnJscQAMyQlA8Goq4nVK
On 20 Jun 2008, at 06:43, James wrote:
On Fri, June 20, 2008 9:12 am, robert rottermann wrote:
Hi there,
is it possible to define an update trigger that calls a webservice
(or
just some external method that would do it).
we have a web frontent, that does the indexing of data in its own
James wrote:
On Fri, June 20, 2008 9:12 am, robert rottermann wrote:
Hi there,
is it possible to define an update trigger that calls a webservice (or
just some external method that would do it).
we have a web frontent, that does the indexing of data in its own catalog
(zope/plone).
so I
On Fri, June 20, 2008 9:12 am, robert rottermann wrote:
> Hi there,
> is it possible to define an update trigger that calls a webservice (or
> just some external method that would do it).
>
> we have a web frontent, that does the indexing of data in its own catalog
> (zope/pl
Hi there,
is it possible to define an update trigger that calls a webservice (or just some
external method that would do it).
we have a web frontent, that does the indexing of data in its own catalog
(zope/plone).
so I would like to be able to "push" an update to the frontend.
tha
On May 15, 2008, at 4:30 AM, rustam ershtukaev wrote:
I have been trying to write a trigger in mysql, but can't get it to
work. It's really simple,i just need my trigger to add varchar value
to
a table on insert if postcode = 1000.
Where does postcode come from? Your SELECT
On Thu, May 15, 2008 at 2:30 AM, rustam ershtukaev <[EMAIL PROTECTED]> wrote:
> I have been trying to write a trigger in mysql, but can't get it to
> work. It's really simple,i just need my trigger to add varchar value to
> a table on insert if postcode = 1000.
I have been trying to write a trigger in mysql, but can't get it to
work. It's really simple,i just need my trigger to add varchar value to
a table on insert if postcode = 1000.
this is how i did it:
delimiter |
drop trigger testdep|
create trigger testdep
before insert on de
Hi All,
I want to disable a trigger on a table for the statements that run within a
stored procedure. As DISABLE TRIGGER is not an option I was wondering if any
body has any alternatives/ideas on how to achieve this
Thanks
Olaf
- Confidentiality Notice
uldn't be set prior to the
row being created...
any more pointers/thoughts/...
thanks
-Original Message-
From: joe [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 19, 2007 7:33 PM
To: 'bruce'; 'mysql list'
Subject: RE: trigger question..
create ta
create table foo
(aa varchar(20),
id integer,
cc varchar(20));
delimiter |
create trigger foo_ins before insert on foo
for each row
begin
set new.aa = concat(new.cc,'-',new.id);
end; |
delimiter ;
insert into foo (cc,id) values ('www',1);
select * from foo;
-
hi.
using mysql 5.0.27 and playing with triggers.
a simple db:
create table foo{
aa varchar (10),
bb int auto_increment,
cc varchar (10),
} innondb
i'm trying to figure out how to create a trigger, such that if the user does
an insert into foo (cc) value ("www");
the table
: Thursday, December 13, 2007 7:09 PM
To: mysql@lists.mysql.com
Subject: before insert trigger
Is it possible for a trigger to test the data to be inserted and if it doesn't
meet specific criteria not insert the data at all?
I have an application that writes a lot of data to my table. I don
Is it possible for a trigger to test the data to be inserted and if it doesn't
meet specific criteria not insert the data at all?
I have an application that writes a lot of data to my table. I don't have
control over this application and it writes a lot more data then I need. So I&
Hi Bruce,
> delimiter |
> create trigger mfgtst after insert on masterHostTBL
>
> for each row begin
> set @tmp = 55;
> insert into masterTestResultStartTBL
> set hostID = NEW.id,
> testResultVal = 88;
hi...
i have the following test sql/schema. i'm trying to create a trigger that
would allow an item in tbl2 to be updated, based upon values from the tbl
that's being inserted into, and the value in a 2nd tbl.element.
the sql/schema:
/*
test schema for stratalight file project
#
#
Hi...
I'm trying to get me head around a possible situation involving
locks/triggers.
Suppose I have two tables:
FooTBL
CatTBL
in FooTBL, I have a trigger that operates such that whenever a new row is
added to FooTBL, it's immeadiately copied to CatTBL.
I'm trying to understa
I've come across articles discussing triggers, and I'm
wondering if triggers might prove usefful or this issue.
Is it possible to have a "periodic" trigger, IE a trigger that gets fired
based on time. I could have a cron process that updates a tbl on a periodic
basis, and a trigger o
On Thu, 2007-11-08 at 17:56 -0800, Lucky Wijaya wrote:
> Yes, the trigger code is works. Many thanks !!
> Now I understand the use of delimiter command. Thanks again... =)
>
> My next question is, do we able to view the triggers that has been created ?
> And how ?
>
> D
Yes, the trigger code is works. Many thanks !!
Now I understand the use of delimiter command. Thanks again... =)
My next question is, do we able to view the triggers that has been created ?
And how ?
David Schneider-Joseph <[EMAIL PROTECTED]> wrote: My apologies, try this:
>
My apologies, try this:
DELIMITER ;;
CREATE TRIGGER DEL_TB_INSTRUKSI AFTER DELETE ON Tb_Instruksi
FOR EACH ROW
BEGIN
DELETE FROM Tb_Stuffing WHERE No_Instruksi = OLD.No_Instruksi;
END;
;;
DELIMITER ;
To answer your question:
The DELIMITER statement tells MySQL to use a different set of
No, I didn't set the delimiter. But, it still have an error after I set
delimiter in my trigger as your example. By the way, what's delimiter mean ?
And what it's for ?
Thanks to you Mr. David.
David Schneider-Joseph <[EMAIL PROTECTED]> wrote: Lucky,
Did you make sure
Lucky,
Did you make sure to set your delimiter before and after the CREATE
TRIGGER statement? e.g.:
DELIMITER ;;
CREATE TRIGGER DEL_TB_INSTRUKSI AFTER DELETE ON Tb_Instruksi
FOR EACH ROW
BEGIN
DELETE FROM Tb_Stuffing WHERE No_Instruksi = OLD.No_Instruksi;
END;;
DELIMITER ;
On Nov 6
Hi, my name is Lucky from Indonesia. I build an database application using
Delphi 7 & MySQL as the RDBMS. Now, I'm having problem in creating trigger in
MySQL. Here is the code of the trigger:
CREATE TRIGGER DEL_TB_INSTRUKSI AFTER DELETE ON Tb_Instruksi
FOR EACH ROW
BEGIN
DE
>Mostly because use 2 field to represent the same data is a waste of storage
i think.
Oh, ok. So you're sending a non-date value and you want to transform it into
an
actual character presentation of a date value, but making things easier on
yourself
is a waste of storage.
Feel free to continu jum
Mostly because use 2 field to represent the same data is a waste of storage i
think.
- "Martijn Tonies" <[EMAIL PROTECTED]> escribió:
> >The aplication which is writing to the database is sending the date
> in unix
> format.
> >I can't no change that, so i suposse using a triger will help.
>
>The aplication which is writing to the database is sending the date in unix
format.
>I can't no change that, so i suposse using a triger will help.
>
>The application pass the 'xx.xx' value when is inserting to the table.
Righto. Well, what does this mean then:
>im converting the unixtime to
> If you want to store a DATE, send a date! Don't send a "unixtime", or
> a
> "varchar" in
> some format, send a date.
>
> Why on earth would you go sending a "unixtime" to the server and then
> using
> a trigger
> to convert it into a &
"varchar" in
some format, send a date.
Why on earth would you go sending a "unixtime" to the server and then using
a trigger
to convert it into a "real date"?!
>im correct? if im, should CAST help me?
No, sending the proper value, that's what you should be do
1 - 100 of 260 matches
Mail list logo