ALTER TABLE to Convert TEXT to CLOB
Posted in 2009
IDS 11.50.FC5 AIX 5.3
I have a byte column that my client wants to relocate to a smart blobspace.
This is the table's current schema:
create table "ifxrept".rptrepositoryfile
(
i_reportfile_id serial not null ,
i_repository_id integer,
i_filetype_id integer,
b_file_byte byte in reportsblob,
c_process_user char(8),
d_process_date date,
c_process_time char(8),
primary key (i_reportfile_id)
) extent size 148738 next size 25496 lock mode row;
onspaces -c -S was used to create a new smart blobspace named reportsbs
I then tried to execute the following statement within dbaccess:
alter table rptrepositoryfile
modify b_file_byte CLOB,
PUT b_file_byte IN (reportsbs) (EXTENT SIZE 41879, LOG, KEEP ACCESS TIME);
Sadly, I received the following error:
-9633 ALTER TABLE cannot modify column (column_name) type. Need a cast from
the current type to the new type.
Conversions of column types require a cast. Use the CREATE CAST statement to
define a cast from the source to destination type.
Questions:
1. Why is it requesting a create a cast? I copied this statement directly out
of an Informix Training Manual and it did not mention the need for a cast.
2. Having not used the CREATE CAST statement before, to convert this field
from byte to clob, what must the CREATE CAST statement look like?
3. Will the cast statement have any effects on any other byte columns within
other tables?
It is fun trying new things ... but not when the manual leave out things.
Thanks in advance.
Clifton
_________________________________________________________________
Find the right PC with Windows 7 and Windows Live.
http://www.microsoft.com/Windows/pc-scout/laptop-set-criteria.aspx?cbid=wl&filt=
200,2400,10,19,1,3,1,7,50,650,2,12,0,1000&cat=1,2,3,4,5,6&brands=5,6,7,8,9,10,11
,12,13,14,15,16&addf=4,5,9&ocid=PID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_evergree
n2:112009