[Rets-dev] How to calculate field sizes

JP Fielding jp.fielding at threewide.com
Thu Mar 22 19:36:07 CDT 2007


the only tricky datatype should multi lookup, and that is something like
(max select *  max length)+(max select-1) ,  thats one slot for each max
size, i space for the separator for each value.  the other field sizes are
pretty straight forward from the metadata.   ill send you (directly) an
example for mysql5 innodb.   its generated directly from the metadata, so it
should be pretty accurate.    in general, metadata is pretty good for most
rets servers, but the problem is the occasional whack value.  for
instance.... we used to use this to auto generate temp tables client side
for client side joining (as rets doesnt provide for that server side,
although mris does via extensions i believe).   we used to use this to
generate tables on the fly.   the problem was, occasionally,  we'ld see
something like 'TUESDAY' come back for a _datetime_ field, so we had to scap
it and just store it all as strings appropriately long enough for each
column.  in general, mris' rets server has shadowed well when we worked with
it.


On 3/22/07, Allen Schmidt Sr <aschmidt at fredericksburg.com> wrote:
>
> General question:
>
> We pull MRIS data using a Python script. Works great for data and
> images. We used to use Conduit in console mode and pulled the whole
> file onto the filesystem and then used Python to parse it apart into
> MySQL tables. The table had been defined long ago and still used the
> old names we had like LIST_NUMB, etc.
> The current script pulls all the data but I only use maybe 30 of the
> fields for our online application.
>
> Now I would like to pull LOTS more data fields and use the
> system/standard names (I get them confused.)
>
> I want to define the DDL for a new table that more closely matches the
> data I want to pull in. So I want to only define the db fields using
> the exact max field size. How can I do that? Is guess simple question
> is does anyone have a MySQL table structure for MRIS data they wanna
> share??
>
> Out side of that, I notice that in the metadata, for a lookup field,
> it only shows the field size as the lookup table ID rather than the
> actual largest possible size of the data in that field.
>
> I think I am rambling now. Anyone understand what I am going for?
>
> Thanks for the time.
>
> Allen
> _______________________________________________
> Rets-dev mailing list
> Rets-dev at rets.org
> http://lists.rets.org/mailman/listinfo/rets-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rets.org/pipermail/rets-dev/attachments/20070322/c053f542/attachment.html


More information about the Rets-dev mailing list