Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify the purpose/use of delimiters #4

Open
michael-small opened this issue Feb 13, 2019 · 0 comments
Open

Clarify the purpose/use of delimiters #4

michael-small opened this issue Feb 13, 2019 · 0 comments

Comments

@michael-small
Copy link
Contributor

The following section of the lab writeup was confusing. My group spent a lot of time wondering why the function definition would terminate after writing so many lines.

Except that the ; is interpreted by the mariaDB client incorrectly. bangbang You need to change the command delimiter first:

DELIMITER //
CREATE FUNCTION FortyTwo() RETURNS TINYINT DETERMINISTIC
BEGIN
DECLARE x TINYINT;
SET x = 42;
RETURN x;
END
//
DELIMITER ;

Clarification on how "the ; is interpreted by the mariaDB client incorrectly" would be useful. I would say something along the lines of this StackOverflow user.

Additionally, a mention of how the delimiter declaration is something that affects not just the function definition process but all future commands would be good. That would establish why "DELIMITER ;" needs to be called at the end, because even after we sort of understood why "DELIMITER //" was declared, we were still flailing around with terminating other commands because we never changed it back to a semicolon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant