Quantcast
Channel: SCN: Message List - Data Warehousing
Viewing all articles
Browse latest Browse all 3366

Updating a column with random numbers in Columnar database(Sybase IQ 16)

$
0
0

Hi Experts,

 

I want to update a column (Value1) in SYbase IQ 16.

Table Contains approx 2 crore records.

 

I have created a simple procedure using cursor.

It works fine with less records but has a performance issue with large dataset.

 

CREATE OR REPLACE PROCEDURE TEMP()

 

 

BEGIN

declare @temp1 int;

declare @rnum int;

declare @count int;

 

  declare c1 DYNAMIC SCROLL cursor for select rownum from temp;

  open c1;

  fetch next c1 into @rnum;

 

 

  while(@@FETCH_STATUS = 0)

      

         Loop

          

         set @temp1=  cast(rand()*10000 AS INT);

       

          update temp

          set  VALUE1=@temp1

          where rownum=@rnum;

 

 

          Fetch next c1 into @rnum;

         

        End loop;

     

  close c1;

  deallocate cursor c1;

commit;

END;

 

As sybase is columnar database is there any other method to increase the performance of updation activity.

 

Regards,

Neha Khetan


Viewing all articles
Browse latest Browse all 3366

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>