Re: calculating collength in syscolumns
Posted in 1998
Yes and no. collength is au claire when it's char, or int, even the NOT NULL isn't that hard to get out. When it comes to decimals, datetimes, intervals and such it gets trickier. Check the SQL Reference manual for a discussion of how to interpret these. Also check out dbdiff2 from www.iiug.org, this has thre or four functions in it which read the syscolumns entry and return the datatype and length. For that matter there is code there to read most of the system catalogues. and if I ever get off my duff, get an engine again and get set up for beta testing I'll release the 2.0 version which reads ALL of the system catalogues (well at least as of 7.3). (Please don't volunteer - I've got enough volunteers - I apologize to everyone who has volunteered that I haven't got back to yet - see the above.) cheers j.