error while creating trigger
am 15.12.2009 05:30:52 von jeetendra.ranjan
------=_NextPart_000_0023_01CA7D6D.7C9F4380
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
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=20
-> INSERT INTO =
DELETED_CONSUMER_PROFILE(CONSUMER_ID,CONSUMER_TYPE_ID,ENTERP RISE_URL_ID,C=
ONSUMER_FIRST_NAME,CONSUMER_MIDDLE_INITIAL,CONSUMER_LAST_NAM E,DATE_OF_BIR=
TH,GENDER,MARITAL_STATUS,MARRIED_TO,LOCALE_ID,PROFILE_PHOTO_ PATH,STATUS,S=
KIP_STEP,LAST_MOD_TIME,LAST_MOD_BY )=20
-> =
VALUES(old.CONSUMER_ID,old.CONSUMER_TYPE_ID,old.ENTERPRISE_U RL_ID,old.CON=
SUMER_FIRST_NAME,old.CONSUMER_MIDDLE_INITIAL,old.CONSUMER_LA ST_NAME,old.D=
ATE_OF_BIRTH,old.GENDER,old.MARITAL_STATUS,old.MARRIED_TO,ol d.LOCALE_ID,o=
ld.PROFILE_PHOTO_PATH,old.STATUS,old.SKIP_STEP,old.LAST_MOD_ TIME,old.LAST=
_MOD_BY );
-> INSERT INTO =
DELETED_CONSUMER_ACTION_AUDIT(CONSUMER_ID,CAMPAIGN_ID,CAMPAI GN_ACTION_ID,=
STATE_ID,LAST_MOD_TIME) =
VALUES(old.CONSUMER_ID,old.CAMPAIGN_ID,old.CAMPAIGN_ACTION_I D,old.STATE_I=
D,old.LAST_MOD_TIME);
-> END;
-> //
ERROR 1054 (42S22): Unknown column 'CAMPAIGN_ID' in 'OLD'
But this column is exist in DELETED_CONSUMER_ACTION_AUDIT table.
What are the possible causes of this error ?
Thanks in advance=20
Jeetendra Ranjan
------=_NextPart_000_0023_01CA7D6D.7C9F4380--
Re: error while creating trigger
am 15.12.2009 06:39:19 von Peter Brawley
--------------020106040607000409020808
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
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
>
>
>
> 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,ENTERP RISE_URL_ID,CONSUMER_FIRST_NAME,CONSUMER_MIDDLE_INITIAL,CONS UMER_LAST_NAME,DATE_OF_BIRTH,GENDER,MARITAL_STATUS,MARRIED_T O,LOCALE_ID,PROFILE_PHOTO_PATH,STATUS,SKIP_STEP,LAST_MOD_TIM E,LAST_MOD_BY )
> -> VALUES(old.CONSUMER_ID,old.CONSUMER_TYPE_ID,old.ENTERPRISE_U RL_ID,old.CONSUMER_FIRST_NAME,old.CONSUMER_MIDDLE_INITIAL,ol d.CONSUMER_LAST_NAME,old.DATE_OF_BIRTH,old.GENDER,old.MARITA L_STATUS,old.MARRIED_TO,old.LOCALE_ID,old.PROFILE_PHOTO_PATH ,old.STATUS,old.SKIP_STEP,old.LAST_MOD_TIME,old.LAST_MOD_BY );
> -> INSERT INTO DELETED_CONSUMER_ACTION_AUDIT(CONSUMER_ID,CAMPAIGN_ID,CAMPAI GN_ACTION_ID,STATE_ID,LAST_MOD_TIME) VALUES(old.CONSUMER_ID,old.CAMPAIGN_ID,old.CAMPAIGN_ACTION_I D,old.STATE_ID,old.LAST_MOD_TIME);
> -> END;
> -> //
>
>
> ERROR 1054 (42S22): Unknown column 'CAMPAIGN_ID' in 'OLD'
>
> But this column is exist in DELETED_CONSUMER_ACTION_AUDIT table.
>
> What are the possible causes of this error ?
>
>
>
>
> Thanks in advance
> Jeetendra Ranjan
>
> ------------------------------------------------------------ ------------
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.5.427 / Virus Database: 270.14.107/2564 - Release Date: 12/14/09 07:37:00
>
>
--------------020106040607000409020808--