Friday, September 25, 2009

MYSQL Architecture




Thursday, September 24, 2009

MYSQL: Bulk Insert

In mysql, we can quickly insert many rows into a table from one or many tables. This we can easily achive using the insert_select.
insert_select statment syntax
INSERT [LOW_PRIORITY HIGH_PRIORITY] [IGNORE] [INTO] tbl_name [(col_name,...)] SELECT ... [ ON DUPLICATE KEY UPDATE col_name=expr, ... ]
Example:
INSERT INTO table1 (name, description) SELECT c.name,c.description FROM table2 c

MYSQL Database Size

Hi,
Here is the steps to get the Database size details in mysql.
1) excute the following command
show table status like '%';

2) To get the total allocated space to a database
SUM(data_length) + SUM(index_length)

3) Total of actual data:
(SUM(data_length) - SUM(data_free)) + SUM(index_length)

4) Allocated but unused:
SUM(data_free)

Regards
DeepthiMahesh

Wednesday, September 23, 2009

MYSQL Triggers examples.

Trigger syntax
CREATE TRIGGER "trigger_name" "triggger_time"
"trigger_event" ON "table_name_onwhichtriggershouldfire"
FOR EACH ROW
BEGIN
""trigger_statements"
END;

Examples :
CREATE TRIGGER insert_test AFTER INSERT ON component
FOR EACH ROW
BEGIN
INSERT INTO TAG (name) VALUES (new.Name);
END;
Dropping Trigger
DROP TRIGGER [IF EXISTS] [schema_name.]trigger_name
example :
drop trigger [if exists] osmp.testTrigger
Show all the triggers
SHOW TRIGGERS
Show particular Trigger
show create trigger "trigger_name"

How to connect to a NetMeeting

Here are the steps to connect to Net meetings.
1) Go to start --> run --> type "conf" (on both PCs)
2) A window will be opened, type the IP address in the first text box, then click on the "Place call" button.
3) A dialog will open on the other side for acceptance.
4) After we get the acceptance, we can use as MOC (Microsoft Office communicator)

Wednesday, September 9, 2009

what is $() in Jquery?

Hi, jQuery uses "$" as a shortcut for "jQuery" which returns a special Java-Script object, this object contains an array of DOM elements that matches the selector.
So, $("#id") == jQuery("#id") also called Selector($).

Some JavaScript libraries uses $ too (example: prototype). To avoid conflict with those other libraries jQuery provides jQuery.noConflict() function. Calling this function the control of the $ variable goes back to the other library that first implemented it. Doing this to use jQuery you can't do this $('div.someClass') anymore, instead jQuery('div.someClass'). Alternatively can do this: jQuery.noConflict();jQuery.ready(function($) { // use $ for jQuery}//use $ for the other libraryWhen writing plugins to avoid problems with the usage of noConflict you can pass 'jQuery' to a function: function($) {//use $ writing your plugin}(jQuery)

How to get the URL parts using Javascript

Hi,
Here is the code to get the URL parts using Javascript.
1) How to get the path name
var pathname= window.location.pathname;
alert( " Pathname "+ pathname );
2) How to get the hostname
var hostname = window.location.host;
alert( hostname);
3) How to get the complete URL
var URL = window.location;
alert("URL "+URL);
4) How to get the URL with out parameters
var URLWithOutPrameters = window.location.protocol + "//" + window.location.host + "/" + window.location.pathname;
alert(URLWithOutPrameters );
5) How to get the Protocal in the URL.
var protocal = window.location.protocol;
alert( " protocal "+ protocal);
5) How to get the parameters in the URL
var name = "tagName"; // We can place any name , the name should contain in the URL.
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
if( results != null )
alert( results[1]); // will display the value of the name (key value pair) ,
}