Q311
The function returning reference to array of row values is . . . . . . . .
A.
fetchrow_array()
B.
fetchrow_arrayref()
AnswerC.
fetch()
D.
fetchrow_hashref()
Answer: Option B
Solution
Answer: Option B
Solution:
This question is about getting data from a MySQL database using Perl's DBI module. Let's break down the options:
Option A: fetchrow_array()
This function retrieves a row from a result set and returns it as an array. Each element in the array corresponds to a column in the row.
Option B: fetchrow_arrayref()
This function is similar to fetchrow_array(), but it returns a reference to an array, which is a special way to point to the array without copying the entire array.
Option C: fetch()
This function retrieves the next row from a result set and returns it as a hash (like a dictionary). The keys of the hash are the column names.
Option D: fetchrow_hashref()
This function is similar to fetch(), but it returns a reference to a hash.
So, the function that returns a reference to an array of row values is fetchrow_arrayref().
Therefore, the correct answer is Option B.