If tutorials available on this website are helpful for you, please whitelist this website in your ad blocker😭 or Donate to help us ❤️ pay for the web hosting to keep the website running.
So , MySQL में DELIMITER का मतलब है किसी statement का अंत होना। जैसे आप programing language like PHP , Java , C , C++ etc. में semicolon ; use करते हैं statement end करने के लिए उसी तरह से MySQL में DELIMITER
होता है।
By default , MySQL में भी semicolon का use होता है , जैसे आप कोई query के अंत में लिखते हैं जो बताता है कि query end हो रही है।
For Example
SELECT * FROM users;
or
SELECT * FROM user_orders;
हालाँकि MySQL में DELIMITER का use करके आप default delimiter को change कर सकते हैं।
DELIMITER //
हमने अभी default delimiter semicolon (;)
को change करके double slash //
कर दिया है , अब आप कोई भी statement लिखेंगे तो end में //
लगाना पड़ेगा।
For Example
SELECT * FROM users//
इसी तरह से जो भी character आपको as a delimiter use करना है , कर सकते हैं।
Well , जब आप कोई single line statement लिखते हैं तब तो कोई problem नहीं होती लेकिन जब आप multiple statements को एक साथ run करना चाहते हों तब आपको इसे set करने की जरूरत पड़ती हैं।
***
जैसे पिछले topic Stored Procedure define करते समय एक से ज्यादा statements थे जिसमे हर statement को semicolon से separate किया गया था , लेकिन सभी statements को तो एक साथ compile करना था इसीलिए हमने temporarily default delimiter को change किया था।
DELIMITER $$
CREATE PROCEDURE get_users()
BEGIN
SELECT
name, mobileno, address, salary
FROM
users
ORDER BY
name ASC;
END$$
DELIMITER;
और last statement में आप देख सकते हैं कि हमने Procedure define करने के बाद फिर से semicolon (;) को ही set कर दिया है।
Hi ! I'm Rahul Kumar Rajput founder of learnhindituts.com. I'm a software developer having more than 4 years of experience. I love to talk about programming as well as writing technical tutorials and blogs that can help to others. I'm here to help you navigate the coding cosmos and turn your ideas into reality, keep coding, keep learning :)
Get connected with me. :) LinkedIn Twitter Instagram Facebook