"[SOLVED] Using Macro in ReadDatabase connection"

JEdwardJEdward RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 578 Unicorn
edited June 2019 in Help
Hi all,

Does anyone know if I can safely use Macros in the names of predefined connections in the ReadDatabase operator?  
i..e. replace the name in the process XML with %{connection_name} so that it can be set by an earlier part of the process?  


Thanks,
JEdward.
Tagged:

Answers

  • Marco_BoeckMarco_Boeck Administrator, Moderator, Employee, Member, University Professor Posts: 1,993 RM Engineering
    Hi,

    yes, you can.

    Regards,
    Marco
  • JEdwardJEdward RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 578 Unicorn
    Hi Marco,

    I get an error when I try this.  It says "Cannot find connection" and then gives the name of the connection that I passed with the Macro (this is exactly the same as the named connection on my setup).  I can see the Macro has passed the right value, but for some reason it isn't enough for RapidMiner to recognise the connection name. 

    Using RapidMiner 5.3.
  • JEdwardJEdward RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 578 Unicorn
    An update.  I have it working now. 
    It seems that if I generate the Macro within the process using SetMacro it works, but if I pass it to the process via the context it doesn't. 

    Still investigating to find out why, but going to assume it's something I did with the setup. 
  • bkrieverbkriever RapidMiner Certified Analyst, Member Posts: 11 Contributor II
    This worked for me when entering the Macro in the Context dialogue.
    One of the parameter lines in my XML disappeared for a Write Database operator,
    but I was able to paste in:  <parameter key="connection" value="%{DBConnectionName}"/> which worked fine.
    It was working for Read, Write and Update Database in my process, RM version 6.0.008.

    If it is still not working from the Context input you may be able to use Generate Macro and have the the value linked to the Macro in the Context.
Sign In or Register to comment.