when does the SQL statement gets executed when you use
cursor in the application programming ?
Answer Posted / s
When you open the cursor the result set is built.
Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
What is the role of schema in the db2 database?
Explain about rct.
How will you return the number of records in table?
Why db2 is called db2?
What is a plan and package in db2?
What are union and union all?
Is db2 free?
How can you find out the # of rows updated after an update statement?
What is a collection in db2?
What is db2 connect?
What is the difference between cursor stability and repeatable read isolation levels?
How to find primary key of a table in db2?
What are the uses of db2 optimizer?
What are foreign keys 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.