Can aliases made by CREATE ALIAS , be retrieved by SQL?

43 views
Skip to first unread message

Rinse Lemstra

unread,
May 2, 2024, 1:50:31 PMMay 2
to H2 Database
Can aliases made by  CREATE ALIAS , be retrieved by SQL?

could not find any documentation about this




also seached the system tables without any result. 

Evgenij Ryazanov

unread,
May 2, 2024, 8:12:03 PMMay 2
to H2 Database
Hello!

In H2 2.* you can read them from standard INFORMATION_SCHEMA.ROUTINES and INFORMATION_SCHEMA.PARAMETERS views.

In historic versions of H2 you need non-standard INFORMATION_SCHEMA.FUNCTION_ALIASES and INFORMATION_SCHEMA.FUNCTION_COLUMNS tables.

Christian Buchegger

unread,
May 22, 2024, 7:14:19 PMMay 22
to h2-da...@googlegroups.com
I have not tried with the latest version, but for 2.1.214

CREATE ALIAS MY_SQRT FOR 'java.lang.Math.sqrt';
SELECT * FROM INFORMATION_SCHEMA.FUNCTION_ALIASES;

returns the metadata for the defined alias.
> --
> You received this message because you are subscribed to the Google Groups "H2 Database" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to h2-database...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/h2-database/c930849a-c17c-4ddf-9356-03ad1f65aef8n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages