Re: How to get dbspace for a table???
Posted in 1994
glidden@informix.com (Bill Glidden) writes: >jlumbley@netcom.com (Joe Lumbley) writes: >>Bill, >> The other way is to look at the tbstat -t output. First, you have >>to be sure that your table is in use. Secondly, you need to know how to >>identify the table. This can be done by SELECT hex(partnum) from systables >>where tabname="YOURTABLENAME". This hex(partnum) corresponds to the physical >>address in the tbstat -t output. The first digit of physical address or >>tblnum in this output then corresponds to the dbspace number from the tbstat -d >>output. (See, I told you the tbcheck -pe was easiest :) >You don't need tbstat -t output. Nor does your table have to be in use. >Select hex(partnum) from systables where tabname="whatever"; >You'll get a hex value like 0x02000245 > ^^---------dbspace number is first 2 digits >From this, you can determine that the table is in dbspace 2. >partnum (or tblspace num) is a constant that doesn't change whether the >table is currently in use of not. Ok this is great, but how can I use this to generate sql code to recreate the table in the same dbspace. What I want to do is unload, drop do some processing, recreate, and reload a table. Things have to happen in this order, because I need the temp tablespace generated by the drop for the processing. Thanks, Tony -- _______________________________________________________________________________ Automata Consulting | P.O. Box 260798 Specializing in Network Development. | Plano, Tx. 75023-0798 Unix/C/C++ | (214)532-6063 Unix Internals | automata@netcom.com | Blessed are the politicians, for grace | must be given them in abundance. | _________________________________________|_____________________________________