Warning: Creating default object from empty value in /www/htdocs/v030397/mysql-qotd/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php on line 4991

Warning: Creating default object from empty value in /www/htdocs/v030397/mysql-qotd/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php on line 4993
Question 37: Which is the correct order of the steps below to execute a prepared statement from the mysql client? – MySQL Question of the Day

Skip to content

By urs in mysql questions

 

1. execute test;
2. deallocate prepare test;
3. prepare test from @a;
4. set @a:=concat('show create database ',ifnull(database(),'mysql'));

 
Which is the correct order?
 

a) 1,2,3,4
b) 4,3,2,1
c) 3,1,2,4
d) 4,3,1,2

 
Extra question: What does the prepared statement in the example actually do?
 
[ Prepared Statements (5%) - Using Prepared Statements from the mysql Client ]
 

Tags: , ,

Comment Feed

One Response


  1.  
    Answer:
     
    d
     
    The prepared statement of thw example will execute show create database for the current database (or for the mysql database if no current db was selected).
     

You must be logged in to post a comment.