mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-10411 Providing compatibility for basic PL/SQL constructs
Part 10: Default variable value: x INT := 10;
This commit is contained in:
@ -1,4 +1,19 @@
|
||||
SET sql_mode=ORACLE;
|
||||
# Testing ":=" to set the default value of a variable
|
||||
CREATE FUNCTION f1 () RETURNS NUMBER(10) AS
|
||||
a NUMBER(10) := 10;
|
||||
BEGIN
|
||||
DECLARE
|
||||
b NUMBER(10) DEFAULT 3;
|
||||
BEGIN
|
||||
RETURN a+b;
|
||||
END;
|
||||
END;
|
||||
/
|
||||
SELECT f1();
|
||||
f1()
|
||||
13
|
||||
DROP FUNCTION f1;
|
||||
# Testing labels
|
||||
CREATE FUNCTION f1 (a INT) RETURNS CLOB AS
|
||||
BEGIN
|
||||
|
Reference in New Issue
Block a user