I use MariaDB 10.5.6-MariaDB
with InnoDB 10.5.6
and every time I try to do a select or whatever within a pl/sql block then it says 'Function does not exist'. What am I doing wrong? Is there a library that needs to be sourced before pl/sql can be used? It would not make sense.
This works (on its own, outside of begin/end) and I get the result back: 94
select count(1) from information_schema.all_plugins;
This does not work
BEGIN
select count(1) from information_schema.all_plugins;
END;
/
Error:
Error starting at line : 1 in command -
BEGIN
select count(1) from information_schema.all_plugins;
END;
Error report -
FUNCTION count does not exist
Neither this works:
BEGIN
declare rowCount decimal;
select count(1) into @rowCount from information_schema.all_plugins;
END;
/
Error:
Error starting at line : 1 in command -
BEGIN
declare rowCount decimal;
select count(1) into @rowCount from information_schema.all_plugins;
END;
Error report -
FUNCTION count does not exist
This does not work either
BEGIN
select 'hello world';
END;
/
Error:
Error starting at line : 1 in command -
BEGIN
select 'hello world';
END;
Error report -
FUNCTION 'hello does not exist
And from the CLI client
MariaDB [(none)]> delimiter //
MariaDB [(none)]> begin
-> select 'hello';
-> end;
-> //
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'select 'hello';
end' at line 2
MariaDB [(none)]> begin
-> select "hello";
-> end;
-> //
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'select "hello";
end' at line 2
MariaDB [(none)]> begin
-> select 'hello';
-> end
-> //
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'select 'hello';
end' at line 2
MariaDB [(none)]> begin
-> select "hello";
-> end
-> //
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'select "hello";
end' at line 2