Creating Table Using MySQL Stored Procedure

MySQL Stored Procedure Example - Creating Table

open your SQL Query Editor then copy & paste the below code to make the Stored Procedure to create a test table:

delimiter |
CREATE PROCEDURE SP_CREATE_TABLE_TEST ()
   BEGIN
      CREATE TABLE TEST 
      (
        TestID int(11) default NULL,
        TestName varchar(100) default NULL
      ) 
      ENGINE=InnoDB DEFAULT CHARSET=utf8;
   END;
|

MySQL Stored Procedure Example - Creating Table - SQL Query Editor Output

Again open your SQL Query Editor then copy & paste the below code to execute the Stored Procedure:

   CALL SP_CREATE_TABLE_TEST;

MySQL Stored Procedure Example - Executing Stored Procedure - SQL Query Editor Output

 

Related Tutorial Examples

  1. MySQL Stored Procedure Function: Making hello world Function using aliase Example
  2. MySQL Stored Procedure: Variable Example
  3. MySQL Stored Procedure: Batch Salary Increment Example
  4. MSSQL PRINT Like Function in MySQL Example
  5. MySQL TRUNCATE TABLE Example
  6. MySQL IF() Nested Function Example
  7. 20 steps to make CakePHP Blog Project
  8. step 2: download cakephp and setup cakeblog
  9. step 11: admin view posts for cakephp blog
  10. PERL Example: Use of Multidimentional Array in PERL

No comments:

Post a Comment

leave your comments here..