Not a Perl answer, and may not be practical depending how many examples of this you have and/or access to db schema, but I'd be tempted to put a view in front of the table to combine those two fields. <br><br>Ian Macdonald<br>
Armaguard<br><br><div class="gmail_quote">On Fri, Nov 4, 2011 at 11:47 AM, Malcolm Herbert <span dir="ltr"><<a href="mailto:melbourne-pm@mjch.net">melbourne-pm@mjch.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
What's the recommended way to deal with cases where multiple fields<br>
in a database record need to be combined to produce a value? How does<br>
one then arrange to automatically split these back into their various<br>
components for insert/updates?<br>
<br>
I'm thinking here of cases where a database field has a string<br>
representing multiple values (I didn't write this schema) in a<br>
key=value;key=value format and other cases where I need to combine a<br>
date (without timezone) and a string containing the zone name into a<br>
DateTime object.<br>
<br>
Ideally I'd like to deal with that with the DBIx::Class inflate/deflate<br>
mechanism which should make things more portable ...<br>
<br>
In the case of the multi-value field I can create a class to represent<br>
this easily enough and write parse/dump routines as appropriate, but<br>
I'm stumped on how to work with the dates, split as they are over two<br>
database fields ...<br>
<br>
Has anyone had to tackle this before?<br>
<br>
Regards,<br>
Malcolm<br>
<font color="#888888"><br>
--<br>
Malcolm Herbert                                This brain intentionally<br>
<a href="mailto:mjch@mjch.net">mjch@mjch.net</a>                                                left blank<br>
_______________________________________________<br>
Melbourne-pm mailing list<br>
<a href="mailto:Melbourne-pm@pm.org">Melbourne-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/melbourne-pm" target="_blank">http://mail.pm.org/mailman/listinfo/melbourne-pm</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Ian Macdonald<br><br>