Hi
Im trying to create a Procedure to create (or not) tables dynamically. Does Monet can do something like the following??
CREATE PROCEDURE(pdate date, tname varchar(10)) BEGIN SET TABLENAME = CONCAT(tname, '_', YEAR(pdate)*100+MONTH(pdate));
CREATE TABLE IF NOT EXIST TABLENAME;
END
Thanks in advance! Rgds
Hi
No. Aside from missing details (e.g. attributes), the sketched procedure can not be statically typechecked for correctness, because the expression is evaluated at runtime.
On 15/06/16 00:00, Ariel Abadi wrote:
Hi
Im trying to create a Procedure to create (or not) tables dynamically. Does Monet can do something like the following??
CREATE PROCEDURE(pdate date, tname varchar(10)) BEGIN SET TABLENAME = CONCAT(tname, '_', YEAR(pdate)*100+MONTH(pdate));
CREATE TABLE IF NOT EXIST TABLENAME;
END
Thanks in advance! Rgds
users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
Hi,
you can use a Python or R UDF with loopback queries to achieve this.
Hannes
On 15 Jun 2016, at 00:00, Ariel Abadi aabadi@starconnecting.com wrote:
Hi
Im trying to create a Procedure to create (or not) tables dynamically. Does Monet can do something like the following??
CREATE PROCEDURE(pdate date, tname varchar(10)) BEGIN SET TABLENAME = CONCAT(tname, '_', YEAR(pdate)*100+MONTH(pdate));
CREATE TABLE IF NOT EXIST TABLENAME;
END
Thanks in advance! Rgds _______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
participants (3)
-
Ariel Abadi
-
Hannes Mühleisen
-
Martin Kersten