IT Community - Software Programming, Web Development and Technical Support

ONE SHOT option in Mysql

This is a discussion on ONE SHOT option in Mysql within the Database Support forums, part of the Web Development category; ONE_SHOT This option is a modifier, not a variable. It can be used to influence the effect of variables that ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > Database Support

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 12-13-2007, 05:00 AM
Murali Murali is offline
D-Web Master
 
Join Date: Feb 2007
Location: India-Chennai.
Posts: 386
Murali is on a distinguished road
Send a message via AIM to Murali
Default ONE SHOT option in Mysql

ONE_SHOT

This option is a modifier, not a variable. It can be used to influence the effect of variables that set the character set, the collation, and the time zone.

ONE_SHOT is primarily used for replication purposes: mysqlbinlog uses SET ONE_SHOT to modify temporarily the values of character set, collation, and time zone variables to reflect at rollforward what they were originally.

ONE_SHOT is for internal use only and is deprecated for MySQL 5.0 and up.

You cannot use ONE_SHOT with other than the allowed set of variables; if you try, you get an error like this:

Code:
mysql> SET ONE_SHOT max_allowed_packet = 1;
ERROR 1382 (HY000): The 'SET ONE_SHOT' syntax is reserved for purposes
internal to the MySQL server
If ONE_SHOT is used with the allowed variables, it changes the variables as requested, but only for the next non-SET statement. After that, the server resets all character set, collation, and time zone-related system variables to their previous values. Example:
Code:
mysql> SET ONE_SHOT character_set_connection = latin5;

mysql> SET ONE_SHOT collation_connection = latin5_turkish_ci;

mysql> SHOW VARIABLES LIKE '%_connection';
+--------------------------+-------------------+
| Variable_name            | Value             |
+--------------------------+-------------------+
| character_set_connection | latin5            |
| collation_connection     | latin5_turkish_ci |
+--------------------------+-------------------+

mysql> SHOW VARIABLES LIKE '%_connection';
+--------------------------+-------------------+
| Variable_name            | Value             |
+--------------------------+-------------------+
| character_set_connection | latin1            |
| collation_connection     | latin1_swedish_ci |
+--------------------------+-------------------+
__________________
-Murali..
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Export to Excel option is not working in Crystal Report with service pack 2 tsureshk ASP and ASP.NET Programming 1 10-06-2007 03:57 AM
RightClick option for menu in Flash bluesky Flash Actionscript Programming 2 08-14-2007 12:16 AM
double clicking the option in drop down list menu vijayanand HTML, CSS and Javascript Coding Techniques 3 08-06-2007 07:27 AM
How to disable right click option? Sabari HTML, CSS and Javascript Coding Techniques 1 07-23-2007 10:55 PM
"Which is the better option Servlet's HttpSession object.. mobilegeek Java Programming 1 07-19-2007 01:08 AM


All times are GMT -7. The time now is 05:26 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0