PL/SQL from HeidSQL UI

amshh's profile image amshh posted 2 weeks ago in General Permalink

Good morning!

I'd like to switch to PL/SQL with MariaDB but failed until now.

!! The SQL_MODE is set to 'ORACLE'. !! The Delimiter is set to /.

And giving a very simple PL/SQL Function as an SQL-Statement into a Query-Tab works as expected.

But if I open this just compiled function in the HeidiSQL procedure User Interface, it cannot be compiled. Obvious is, that "Returns" in the Options-Tab is empty. Seems that this UI cannot work with PL/SQL?? Or do I have missed a switch?

A "Save" then always raises a SQL Error (1064) Popup.

What can I do to create and maintain PL/SQL in HeidiSQL's Procedure and Function Editor?

Thank you

Regards Andree

3 attachment(s):
  • HSQL1
  • HSQL2
  • HSQL3
ansgar's profile image ansgar posted 2 weeks ago Permalink

PL/SQL is Oracle proprietary. HeidiSQL does not support Oracle. But I guess anyway you mean compound statements

If you write compound statements in a query tab, you did it exactly right setting the delimiter to something different than the default semicolon. Only then HeidiSQL does not split your compound statements into multiple single queries.

But on MySQL and MariaDB, a functions return clause is a bit different than the one I see on your screenshots. It should be CREATE FUNCTION xyz RETURNS DOUBLE BEGIN RETURN 77; END

amshh's profile image amshh posted 2 weeks ago Permalink

PL/SQL is oficcialy part of MariaDB since Version 10.3 link text

ansgar's profile image ansgar posted 2 weeks ago Permalink

That does not mean that HeidiSQL supports it everywhere. It only allows you to use such stuff in a custom query. Things like HeidiSQL's table editor still expect MySQL or MariaDB default code. I bet you will find more of such incompatibilities.

Is that difference in your CREATE FUNCTION code part of PL/SQL?

amshh's profile image amshh posted 2 weeks ago Permalink

Hello Ansgar, yes, it is.

e.g. TutorialsPoint

ansgar's profile image ansgar posted 2 weeks ago Permalink

Yea I see.

Though for HeidiSQL's procedure editor I don't see that Oracle mode in the near future. There are many things which come first, for example compatibility to MS SQL is hopelessly more incompatible.

Anyway, that should not block you from using HeidiSQL. I would just recommend not to enable Oracle mode when you intend to use the specialized function/table/event editors at the same time.

amshh's profile image amshh posted 2 weeks ago Permalink

Hello ansgar,

I was afraid to read this ... :-) During my professional work (years ago) I was used to Oracle and PL/SQL and loved it. When I stepped into MariaDB while hobby work it was a pain to learn what the MDB language (does it have name?) NOT can do in comparison to PL/SQL. Either way ... one can achieve mostly all you need ... but PL/SQL is better. No doubt for me. And HeidiSQL continous to be one of the best MySQL/MariaDB-Tool I know!

Regards A

Please login to leave a reply, or register at first.