Errore creating trigger

This is a discussion on Errore creating trigger within the MySQL Database forums, part of the Database Forums category; I'm trying to create a trigger on a mysql 5 database. Here follows the script: CREATE TRIGGER awbparposinsert AFTER ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-24-2008
Manuele Piastra
 
Posts: n/a
Default Errore creating trigger

I'm trying to create a trigger on a mysql 5 database. Here follows the
script:

CREATE TRIGGER awbparposinsert AFTER INSERT ON awbparzialipos
FOR EACH ROW BEGIN
INSERT INTO tabdogins(awbparzialeId, house, colli, peso, data,
posmag, origId, origtipo) values( new.awbparzialeId, new.house,
new.colli, new.peso, CURDATE(), new.codPosMagazzino, new.id, 'P');
INSERT INTO tabdoggia(awbparzialeId, house, colli, peso, data,
posmag) values(new.awbparzialeId, new.house, new.colli, new.peso,
CURDATE(), new.codPosMagazzino);
END;

I get this error message:

Unknown column 'new.awbparzialeId' in 'field list'

Anyone has a solution? Thanks in advance
Reply With Quote
  #2 (permalink)  
Old 04-24-2008
Rik Wasmus
 
Posts: n/a
Default Re: Errore creating trigger

On Thu, 24 Apr 2008 10:20:43 +0200, Manuele Piastra <manupia@gmail.com>
wrote:

> I'm trying to create a trigger on a mysql 5 database. Here follows the
> script:
>
> CREATE TRIGGER awbparposinsert AFTER INSERT ON awbparzialipos
> FOR EACH ROW BEGIN
> INSERT INTO tabdogins(awbparzialeId, house, colli, peso, data,
> posmag, origId, origtipo) values( new.awbparzialeId, new.house,
> new.colli, new.peso, CURDATE(), new.codPosMagazzino, new.id, 'P');
> INSERT INTO tabdoggia(awbparzialeId, house, colli, peso, data,
> posmag) values(new.awbparzialeId, new.house, new.colli, new.peso,
> CURDATE(), new.codPosMagazzino);
> END;
>
> I get this error message:
>
> Unknown column 'new.awbparzialeId' in 'field list'


What columns does the table awbparzialipos have?
--
Rik Wasmus
Reply With Quote
  #3 (permalink)  
Old 04-24-2008
Manuele Piastra
 
Posts: n/a
Default Re: Errore creating trigger

On 24 Apr, 10:24, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote:
> On Thu, 24 Apr 2008 10:20:43 +0200, Manuele Piastra <manu...@gmail.com>
> wrote:
>
>
>
> > I'm trying to create a trigger on a mysql 5 database. Here follows the
> > script:

>
> > CREATE TRIGGER awbparposinsert AFTER INSERT ON awbparzialipos
> > FOR EACH ROW BEGIN
> > INSERT INTO tabdogins(awbparzialeId, house, colli, peso, data,
> > posmag, origId, origtipo) values( new.awbparzialeId, new.house,
> > new.colli, new.peso, CURDATE(), new.codPosMagazzino, new.id, 'P');
> > INSERT INTO tabdoggia(awbparzialeId, house, colli, peso, data,
> > posmag) values(new.awbparzialeId, new.house, new.colli, new.peso,
> > CURDATE(), new.codPosMagazzino);
> > END;

>
> > I get this error message:

>
> > Unknown column 'new.awbparzialeId' in 'field list'

>
> What columns does the table awbparzialipos have?
> --
> Rik Wasmus


adding SET NAMES utf8; on top of the create trigger command
it works....thank you so much
Reply With Quote
  #4 (permalink)  
Old 04-24-2008
Rik Wasmus
 
Posts: n/a
Default Re: Errore creating trigger

Manuele Piastra wrote:
> On 24 Apr, 10:24, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote:
>> On Thu, 24 Apr 2008 10:20:43 +0200, Manuele Piastra <manu...@gmail.com>
>> wrote:
>>
>>
>>
>>> I'm trying to create a trigger on a mysql 5 database. Here follows the
>>> script:
>>> CREATE TRIGGER awbparposinsert AFTER INSERT ON awbparzialipos
>>> FOR EACH ROW BEGIN
>>> INSERT INTO tabdogins(awbparzialeId, house, colli, peso, data,
>>> posmag, origId, origtipo) values( new.awbparzialeId, new.house,
>>> new.colli, new.peso, CURDATE(), new.codPosMagazzino, new.id, 'P');
>>> INSERT INTO tabdoggia(awbparzialeId, house, colli, peso, data,
>>> posmag) values(new.awbparzialeId, new.house, new.colli, new.peso,
>>> CURDATE(), new.codPosMagazzino);
>>> END;
>>> I get this error message:
>>> Unknown column 'new.awbparzialeId' in 'field list'

>> What columns does the table awbparzialipos have?

>
> adding SET NAMES utf8; on top of the create trigger command
> it works....


Is that so? Seems strange to me as there are no 'special' characters,
all ascii,,,,

> thank you so much


Well, glad to have been of help apparantly?

--
Rik Wasmus
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:40 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0