Mysql Compound Statements
- How many of the following take a connection handler as argument?
mysql_store_result(), mysql_use_result()
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
The functions ‘mysql_store_result()’ and ‘mysql_use_result()’ are similar because both of them take a connection handler argument and then return a result set after carrying out the processes.
- Which of these has lower memory requirement?
mysql_use_result(), mysql_store_result()
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
The function ‘mysql_use_result()’ has lower memory requirements than ‘mysql_store_result()’ because only enough space to handle a single row at a time needs to be allocated. This can be faster.
- Which of these is preferred when stored procedures are not being used?
CLIENT_MULTI_STATEMENTS, mysql_set_server_option()
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
If the program does not use stored procedures anyone is suitable. If the program uses stored procedures and invokes a ‘CALL’ statement that returns a result set, the first method is better.
- Which option executes all SQL statements in a SQL script irrespective of the number of errors?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
If SQL queries in a file are run using mysql in batch mode, mysql either quits after the first error. If the –force option is specified all the queries are executed indiscriminately.
- mysql_next_result() returns a status.
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
The function ‘mysql_next_result()’ returns a status and initiates retrieval of the next set if more results are available. The status is zero if more results are available and -1 if not.