Page 122 - Computer Software Application TP - Volume 1
P. 122

COMPUTER SOFTWARE APPLICATION - CITS



           EXERCISE 33 : Creating Cursors in MYSQL


            Objectives

            At the end of this exercise you shall be able to
           •  create stored procedure with cursor

           Requirements



           Tools/Materials
           •   Desktop/Laptop with latest configuration
           •   Operating system: window 10:11
           •  XAMPP server r3.3.0

           Procedure


           TASK 1 :Create cursors in MySQL
           1  CONNECT TO YOUR DATABASE –
           mysql -u your username –p
           Enter your password when prompted.
           2  SELECT YOUR DATABASE –

           USE your database name;
           Replace your database name with the name of your actual database
           3  CREATE A TABLE –
           Let’s create a simple table for this example:













           CREATE TABLE example table (
               id INT PRIMARY KEY AUTO INCREMENT,

               data VARCHAR(255)
           );




















                                                           107
 CITS : IT & ITES - Computer Software Application - Exercise 32
   117   118   119   120   121   122   123   124   125   126   127