suppose in my table 10 rows are there , i want to update odd
rows salary as 90000 ? how u do it ? any one help me ? what
do we use here cursor-fetch or normal sql ?
Answer Posted / pandu
Hi Krishna, Actually your answer is ok but i have a small
doubt "he want to update odd rows salary as 9000" but in ur
answer i didn't find the odd rows.how will you divide that
table in odd rows and even rows? kindly tell me.
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
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.
If anyone has IBM Certification Dumps pls forward to me & also let me know what are the Certification Codes that are available in DB2
What is page size in db2?
When do you specify the isolation level?
What kind of database is db2?
What language is db2 written in?
What is a bind card?
When reorg is used?
In an sql table that is embedded, what is the procedure to retrieve rows that are part of a db2 table?
How to find the number of rows in a db2 table?
What is db2?
What is a storage group (stogroup)?
How do I connect my db2 database to ibm?
How do I start db2 in windows?
What are union and union all?