Mysql Compound Statements


  1. Multiple statement execution is enabled by default.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    The ‘multiple-statement’ execution is not enabled by default, so the server must be told that it is intended to be used. There are two ways to tell the server to enable the execution.


  1. Which option enables multiple-statement execution?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    There are two ways to enable the multiple-statement execution. The first is to add the ‘CLIENT_MULTI_STATEMENTS’ option in the flags argument to ‘mysql_real_connect()’ at connect time.



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



  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.