Mysql Compound Statements


  1. How many of the following take a connection handler as argument?
    mysql_store_result(), mysql_use_result()











  1. 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.


  1. Which of these has lower memory requirement?
    mysql_use_result(), mysql_store_result()











  1. 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.



  1. Which of these is preferred when stored procedures are not being used?
    CLIENT_MULTI_STATEMENTS, mysql_set_server_option()











  1. 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.


  1. Which option executes all SQL statements in a SQL script irrespective of the number of errors?











  1. 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.



  1. mysql_next_result() returns a status.











  1. 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.