crystaljen
MIS
some one out there help me please
i've written a simple loop whereby
i've inserted 1 rec into a #temp table using store procedure.
Using the same rec, i attempted to update the fields
named col2, col3 but the record dont seems to update
the records in #TEMP_AGE IS
REC_TYPE is varchar, trans_age int, col1 to col8 are all varchar
Below is the update during the loop...what could be wrong here.
begin
SET @a = 2
start_loop:
BEGIN
select @colnm = 'col'+convert(varchar,@a)
begin tran @transname
update #temp_age
set @colnm = convert(varchar,(@interval * @a))
where rec_type = 'title'
commit tran @transname
set @a = @a + 1
END
if @a < 9 goto start_loop
end
i've written a simple loop whereby
i've inserted 1 rec into a #temp table using store procedure.
Using the same rec, i attempted to update the fields
named col2, col3 but the record dont seems to update
the records in #TEMP_AGE IS
REC_TYPE is varchar, trans_age int, col1 to col8 are all varchar
Below is the update during the loop...what could be wrong here.
begin
SET @a = 2
start_loop:
BEGIN
select @colnm = 'col'+convert(varchar,@a)
begin tran @transname
update #temp_age
set @colnm = convert(varchar,(@interval * @a))
where rec_type = 'title'
commit tran @transname
set @a = @a + 1
END
if @a < 9 goto start_loop
end