I have 1000 rows in a db2 table.I want to update first 100
records,How do I do it?
Answer Posted / brooks
is there identity column in this table, for example, if
there is a column indexnum int(supposed start from 1), you
can use the Update Table Set XXX=XXX where indexnum < 101
| Is This Answer Correct ? | 0 Yes | 6 No |
Post New Answer View All Answers
Mention the definition of cobol in varchar field.
What is bind and rebind in db2?
Explain about mirror activator disk mirroring?
What do you mean by cursor?
Explain the contents that are a part of dclgen.
How do you select a row using indexes in db2?
How does a cursor work?
What is the difference between bind and rebind in db2?
What is the difference between db2 and oracle?
Explain in detail about buffer manager and its functionalities?
What is dclgen in db2?
SET is the ANSI standard for variable assignment, SELECT is not. SET can only assign one variable at a time, SELECT can make multiple assignments at once. If assigning from a query, SET can only assign a scalar value. If the query returns multiple values/rows then SET will raise an error. SELECT will assign one of the values to the variable and hide the fact that multiple values were returned (so you'd likely never know why something was going wrong elsewhere - have fun troubleshooting that one) When assigning from a query if there is no value returned then SET will assign NULL, where SELECT will not make the assignment at all (so the variable will not be changed from it's previous value) As far as speed differences - there are no direct differences between SET and SELECT. However SELECT's ability to make multiple assignments in one shot does give it a slight speed advantage over SET.
What is the maximum number of columns in a db2 table?
How to find the maximum value in a column in the db2 database?
What are the various data types available in db2?