The following question is taken from DB2 9 Fundamentals Certification Study Guide, by Roger E. Sanders (copyright...
2007) and is reprinted here with permission from MC Press.
Test your knowledge of DB2 9 by answering the question below, which is from a real, previous DB2 9 Fundamentals exam (exam 730). When you are finished, check your answer and read an explanation using the answer key.
IBM DB2 9 Fundamentals certification exam study guide
Given the following table:
TEMP_DATA TEMP DATE
And the following SQL statement:
TE FUNCTION degf_to_c (temp INTEGER)
NO EXTERNAL ACTION
DECLARE newtemp INTEGER;
SET newtemp = temp - 32;
SET newtemp = newtemp * 5;
RETURN newtemp / 9;
Which two of the following SQL statements illustrate the proper way to invoke the calar function DEGF_TO_C?
A. VALUES degf_to_c(32)
B. SELECT date, degf_to_c(temp) AS temp_c FROM temp_data
C. CALL degf_to_c(32)
D. SELECT * FROM TABLE( degf_to_c(temp)) AS temp_c
• Read the answer and explanation
• Go back to the list of sample exam questions