-
Notifications
You must be signed in to change notification settings - Fork 0
/
func.sql
47 lines (40 loc) · 799 Bytes
/
func.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#test
delimiter //
CREATE PROCEDURE simpleproc (OUT param1 INT)
BEGIN
SELECT COUNT(*) INTO param1 FROM t;
END//
#ignore
<some code then comment> # mysql function
DELIMITER $func$
CREATE FUNCTION hello_world()
RETURNS text
LANGUAGE sql
BEGIN
# sample query
SELECT name from test where `lastname` = "singh";
RETURN 'Hello World';
END;
$func$
DELIMITER ;
DELIMITER //
CREATE PROCEDURE GetAllProducts()
BEGIN
SELECT * FROM products;
END //
DELIMITER ;
#test
delimiter //
CREATE PROCEDURE simpleproc (OUT param1 INT)
BEGIN
SELECT COUNT(*) INTO param1 FROM t;
END//
# comment!!
delimiter //
CREATE procedure world_record_count ()
begin
select 'country', count(*) from country;
select 'city', count(*) from city;
select 'CountryLanguage', count(*) from CountryLanguage;
end;
//