Due to recent updates, all users are required to create an Altair One account to login to the RapidMiner community. Click the Register button to create your account using the same email that you have previously used to login to the RapidMiner community. This will ensure that any previously created content will be synced to your Altair One account. Once you login, you will be asked to provide a username that identifies you to other Community users. Email us at Community with questions.
building up dynamic SQL queries
rschilling
Member Posts: 1 Learner III
I am not certain how to do this, although my research into macros seems to indicate they're involved somehow.
I have a database table (MySQL) with some meta-data in it. Say, one column in the data is a table name:
select tbl_name from mymetadata;
That returns a list of table names that I want to feed into a SQL statement. So, for each item from tbl_name, I want to run:
select count(*) from %{tbl_name}
How do I do this?
Thanks in advance..
Richard Schilling
I have a database table (MySQL) with some meta-data in it. Say, one column in the data is a table name:
select tbl_name from mymetadata;
That returns a list of table names that I want to feed into a SQL statement. So, for each item from tbl_name, I want to run:
select count(*) from %{tbl_name}
How do I do this?
Thanks in advance..
Richard Schilling
0
Answers
you should iterate over the examples, extract a macro for the table name and use the [tt]Read Database[/tt] operator in the loop to read the tables. It should work like this... Hope that gives you a hint,
Tobias