Triggers - Accessing all NEW data

Triggers - Accessing all NEW data

am 08.09.2011 16:23:16 von Chris Tate-Davies

--------------040003000909010802060002
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hello. I want to know if there is a special way I can access all the
data in the NEW/OLD data?

I realise I can access it by referencing NEW.fieldname but I want to
serialise the NEW object so I can save as a string. Is this possible or
do I need to write a function?

Thanks, Chris



*Chris Tate-Davies*

*Software Development*
Inflight Productions Ltd
Telephone: 01295 269 680
15 Stukeley Street | London | WC2B 5LT
*Email:*chris.tatedavies@inflightproductions.com

*Web:*www.inflightproductions.com





-----------------------------


Registered Office: 15 Stukeley Street, London WC2B 5LT, England.
Registered in England number 1421223

This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. Please note that the information provided in this e-mail is in any case not legally binding; all committing statements require legally binding signatures.


http://www.inflightproductions.com


--------------040003000909010802060002--

Re: Triggers - Accessing all NEW data

am 13.09.2011 08:40:13 von Luis Motta Campos

On 8 Sep 2011, at 16:23, Chris Tate-Davies wrote:

> Hello. I want to know if there is a special way I can access all the =
data in the NEW/OLD data?
>=20
> I realise I can access it by referencing NEW.fieldname but I want to =
serialise the NEW object so I can save as a string. Is this possible or =
do I need to write a function?


Hi,=20

You'll have to write your own function for that.=20

Cheers
--
Luis Motta Campos
is a DBA, Foodie, and Photographer


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2@m.gmane.o rg

Re: Triggers - Accessing all NEW data

am 13.09.2011 10:44:38 von Chris Tate-Davies

--------------090304070200030001080909
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Thanks,

I kinda guessed that, but I'm not sure how to pass the OLD object to it
as MySQL cannot handle a rowset datatype.

Has anyone had any experience with this? Not sure where to start or how
to proceed.

Chris


On 13/09/11 07:40, Luis Motta Campos wrote:
> On 8 Sep 2011, at 16:23, Chris Tate-Davies wrote:
>
>> Hello. I want to know if there is a special way I can access all the data in the NEW/OLD data?
>>
>> I realise I can access it by referencing NEW.fieldname but I want to serialise the NEW object so I can save as a string. Is this possible or do I need to write a function?
>
> Hi,
>
> You'll have to write your own function for that.
>
> Cheers
> --
> Luis Motta Campos
> is a DBA, Foodie, and Photographer
>

--

*Chris Tate-Davies*

*Software Development*
Inflight Productions Ltd
Telephone: 01295 269 680
15 Stukeley Street | London | WC2B 5LT
*Email:*chris.tatedavies@inflightproductions.com

*Web:*www.inflightproductions.com





-----------------------------


Registered Office: 15 Stukeley Street, London WC2B 5LT, England.
Registered in England number 1421223

This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. Please note that the information provided in this e-mail is in any case not legally binding; all committing statements require legally binding signatures.


http://www.inflightproductions.com


--------------090304070200030001080909--

Re: Triggers - Accessing all NEW data

am 13.09.2011 10:53:39 von Claudio Nanni - TomTom

--0016363b83c8a56fdf04accec767
Content-Type: text/plain; charset=ISO-8859-1

Hi,
Just quick reading your email, forgive me if I'm mistaken
what about serializing using *concat(old.f1,'|||',old.f2,'|||',old.f3)
('|||' = any separator that works for you)*
and deserialize inside the function?

does this make any sense to you?

Cheers

Claudio

2011/9/13 Chris Tate-Davies

> Thanks,
>
> I kinda guessed that, but I'm not sure how to pass the OLD object to it as
> MySQL cannot handle a rowset datatype.
>
> Has anyone had any experience with this? Not sure where to start or how to
> proceed.
>
> Chris
>
>
>
> On 13/09/11 07:40, Luis Motta Campos wrote:
>
>> On 8 Sep 2011, at 16:23, Chris Tate-Davies wrote:
>>
>> Hello. I want to know if there is a special way I can access all the data
>>> in the NEW/OLD data?
>>>
>>> I realise I can access it by referencing NEW.fieldname but I want to
>>> serialise the NEW object so I can save as a string. Is this possible or do I
>>> need to write a function?
>>>
>>
>> Hi,
>>
>> You'll have to write your own function for that.
>>
>> Cheers
>> --
>> Luis Motta Campos
>> is a DBA, Foodie, and Photographer
>>
>>
> --
>
> *Chris Tate-Davies*
>
> *Software Development*
> Inflight Productions Ltd
> Telephone: 01295 269 680
> 15 Stukeley Street | London | WC2B 5LT
> *Email:*chris.tatedavies@**inflightproductions.com > chris.tatedavies@**inflightproductions.com
> >
> *Web:*www.inflightproductions.**com <
> http://www.**inflightproductions.com/
> >
>
>
>
>
>
> -----------------------------
>
>
> Registered Office: 15 Stukeley Street, London WC2B 5LT, England.
> Registered in England number 1421223
>
> This message is for the designated recipient only and may contain
> privileged, proprietary, or otherwise private information. If you have
> received it in error, please notify the sender immediately and delete the
> original. Any other use of the email by you is prohibited. Please note that
> the information provided in this e-mail is in any case not legally binding;
> all committing statements require legally binding signatures.
>
>
> http://www.**inflightproductions.com
>
>


--
Claudio

--0016363b83c8a56fdf04accec767--

Re: Triggers - Accessing all NEW data

am 13.09.2011 11:15:52 von Chris Tate-Davies

--------------040204000404080901040600
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit


I could do that, but I was hoping I wouldn't have to specify the
individual fields, and just pass the collection for parsing.

If I were to add any fields I would have to re-write the trigger which
is something I was trying to avoid.


On 13/09/11 09:53, Claudio Nanni wrote:
> Hi,
> Just quick reading your email, forgive me if I'm mistaken
> what about serializing using *concat(old.f1,'|||',old.f2,'|||',old.f3)
> ('|||' = any separator that works for you)*
> and deserialize inside the function?
>
> does this make any sense to you?
>
> Cheers
>
> Claudio
>
> 2011/9/13 Chris Tate-Davies
>
>> Thanks,
>>
>> I kinda guessed that, but I'm not sure how to pass the OLD object to it as
>> MySQL cannot handle a rowset datatype.
>>
>> Has anyone had any experience with this? Not sure where to start or how to
>> proceed.
>>
>> Chris
>>
>>
>>
>> On 13/09/11 07:40, Luis Motta Campos wrote:
>>
>>> On 8 Sep 2011, at 16:23, Chris Tate-Davies wrote:
>>>
>>> Hello. I want to know if there is a special way I can access all the data
>>>> in the NEW/OLD data?
>>>>
>>>> I realise I can access it by referencing NEW.fieldname but I want to
>>>> serialise the NEW object so I can save as a string. Is this possible or do I
>>>> need to write a function?
>>>>
>>> Hi,
>>>
>>> You'll have to write your own function for that.
>>>
>>> Cheers
>>> --
>>> Luis Motta Campos
>>> is a DBA, Foodie, and Photographer
>>>
>>>
>> --
>>
>> *Chris Tate-Davies*
>>
>> *Software Development*
>> Inflight Productions Ltd
>> Telephone: 01295 269 680
>> 15 Stukeley Street | London | WC2B 5LT
>> *Email:*chris.tatedavies@**inflightproductions.com >> chris.tatedavies@**inflightproductions.com
>> *Web:*www.inflightproductions.**com <
>> http://www.**inflightproductions.com/
>>
>>
>>
>>
>> -----------------------------
>>
>>
>> Registered Office: 15 Stukeley Street, London WC2B 5LT, England.
>> Registered in England number 1421223
>>
>> This message is for the designated recipient only and may contain
>> privileged, proprietary, or otherwise private information. If you have
>> received it in error, please notify the sender immediately and delete the
>> original. Any other use of the email by you is prohibited. Please note that
>> the information provided in this e-mail is in any case not legally binding;
>> all committing statements require legally binding signatures.
>>
>>
>> http://www.**inflightproductions.com
>>
>>
>

--

*Chris Tate-Davies*

*Software Development*
Inflight Productions Ltd
Telephone: 01295 269 680
15 Stukeley Street | London | WC2B 5LT
*Email:*chris.tatedavies@inflightproductions.com

*Web:*www.inflightproductions.com





-----------------------------


Registered Office: 15 Stukeley Street, London WC2B 5LT, England.
Registered in England number 1421223

This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. Please note that the information provided in this e-mail is in any case not legally binding; all committing statements require legally binding signatures.


http://www.inflightproductions.com


--------------040204000404080901040600--