mathewspsimon (6/15/2009)
sir,that was a dummy table for this cae.I dont know what is the reason,is it becuase there are 1000 rows?the output of the cursor shows as I mentioned as 121.1 instead of 121.08.And this is not happening for all only an few.Is there a way to prevent this?
I just wrote that in my previous post. did u try that?
-----------------------Try this if ur base table can accept decimal numbers in quantity col---
DECLARE @val4 varchar(20),@val1 varchar(20),@val2 varchar(50), @val3 decimal(10,2), @Sql varchar(8000);
set @val1='SQLSRV'
set @val4=CONVERT(VARCHAR(10), GETDATE(), 101)
Declare sample_cur cursor for
SELECT Item_Code,Quantity
FROM ReorderS
OPEN sample_cur
Fetch next from sample_cur into @val2, @val3
While (@@fetch_status-1)
BEGIN
SET @Sql='Begin XXOH_INV_INTERFACE_PKG.insert_trx(''' + @val4 + ''', ''' + @val1 + ''' , '''+@val2 + ''','+cast(@val3 as varchar)+'); End;'
print @Sql
Fetch next from sample_cur into @val2, @val3
END
Close sample_cur
Deallocate sample_cur