user2393425
user2393425

Reputation: 61

How to update datawindow itemstatus for all the rows in the datawindow without using loops

I have a datastore, in certain condition i need all of the rows in that to be inserted into database, So i just made a loop and set each item staus to newmodified! and fired update, its working but time consuming, Is there any other ways to handle this without looping, Pelase suggest.

Upvotes: 0

Views: 535

Answers (2)

ali.boussouf
ali.boussouf

Reputation: 13

You have to use the update() method, so all updates will be done to database.

Source: http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.help.ase.15.7/title.htm

Upvotes: 0

Matt Balent
Matt Balent

Reputation: 2407

You can use the Rowscopy method to copy all the rows into a separate datastore. This gives them all a 'NewModified! status which will generate inserts. Something like this

li = ds_1.Rowscopy(1, ds_1.Rowcount(), Primary!, ds_2, 1, Primary!)

IF li > 0 THEN ds_2.update()...

Upvotes: 1

Related Questions