Advertisement
sathyashrayan

example 2

Jan 30th, 2012
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.42 KB | None | 0 0
  1. CREATE PROCEDURE operators()
  2. BEGIN
  3.         DECLARE a INT DEFAULT 2;
  4.         DECLARE b INT DEFAULT 3;
  5.         DECLARE c FLOAT;
  6.  
  7.         SET c=a+b; SELECT 'a+b=',c;
  8.         SET c=a/b; SELECT 'a/b=',c;
  9.         SET c=a*b; SELECT 'a*b=',c;
  10.  
  11.  
  12.         IF (a<b) THEN
  13.                 SELECT 'a is less than b';
  14.         END IF;
  15.         IF NOT (a=b) THEN
  16.                 SELECT 'a is not equal to b';
  17.         END IF;
  18. END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement