INSERT INTO new_registration
(
`Ownership_Category`,
`Is_Govt_Org`,
`Title_Category`,
`Nationality`,
`Owner_Name`,
`Owner_Pan_Card`,
`Upload_pan_card_Document`,
`Mobile_No`,
`Email_ID`,
`PinCode`,
`State`,
`District`,
`City`,
INSERT INTO new_registration
(
`Ownership_Category`,
`Is_Govt_Org`,
`Title_Category`,
`Nationality`,
`Owner_Name`,
`Owner_Pan_Card`,
`Upload_pan_card_Document`,
`Mobile_No`,
`Email_ID`,
`PinCode`,
`State`,
`District`,
`City`,
-- 1. Change the statement delimiter
DELIMITER $$
DROP PROCEDURE IF EXISTS insert_data_loop;
-- 2. Create the stored procedure
CREATE PROCEDURE insert_data_loop()
BEGIN
DECLARE i INT DEFAULT 1; -- Declare a variable for the loop counter
DECLARE max_value INT DEFAULT 50; -- Set the loop limit
-- Start the WHILE loop
WHILE i <= max_value DO
-- 3. The INSERT query inside the loop
SET i = i + 1;
INSERT INTO new_registration
(
`Ownership_Category`,
`Is_Govt_Org`,
`Title_Category`,
`Nationality`,
`Owner_Name`,
`Owner_Pan_Card`,
`Upload_pan_card_Document`,
`Mobile_No`,
`Email_ID`,
`PinCode`,
`State`,
`District`,
`City`,
`Address`,
`DOB`,
`Upload_DOB_Certificate`,
`GST_No`,
`Upload_GST_Certificate`)
VALUES
(
'Individual',
1,
'News Paper',
'Indian',
'Yash Kapoor','45YYH87Y','Documents/test1.jpg',
457851,'test@test.com',
110022,'Haryana',
'Sonepat','Sonepat','Jangpura, Delhi',
' 15/01/1945', 'Documents/test1.jpg' ,
'JHJDFHJDF8787DF',
'Documents/test1.jpg');
-- Increment the counter
END WHILE;
END $$
-- 4. Reset the delimiter
DELIMITER ;
-- 5. Call the procedure to run the insert loop
CALL insert_data_loop();
-- Optional: verify the results
SELECT * FROM new_registration;
Note:- You cannot use for loop without Creating stored procedure.
NOW()
CURRENT_DATE
CURRENT_TIMESTAMP
in Default/Expression Column
INSERT INTO `test`.`new_registration`
(
`Ownership_Category`,
`Is_Govt_Org`,
`Title_Category`,
`Nationality`,
`Owner_Name`,
`Owner_Pan_Card`,
`Upload_pan_card_Document`,
`Mobile_No`,
`Email_ID`,
`PinCode`,
`State`,
`District`,
`City`,
`Address`,
`DOB`,
`Upload_DOB_Certificate`,
`GST_No`,
`Upload_GST_Certificate`)
VALUES
(
'Individual',
1,
'News Paper',
'Indian',
'Yash Kapoor','45YYH87Y','Documents/test1.jpg',
457851,'test@test.com',
110022,'Haryana',
'Sonepat','Sonepat','Jangpura, Delhi',
' 15/01/1945', 'Documents/test1.jpg' ,
'JHJDFHJDF8787DF',
'Documents/test1.jpg');
Right Click on Table(New_Reg_Table)
>Click on Send to SQl Editor
> Click on Create Statement