Forum Discussion
AGo
8 years agoPost Patron
Parameter changing datasource type DB2->ODBC
Hi, I have this M code and trying to return the TABLE1 table for conditionally 2 datasources (ODBC and DB2) which has the same structure. I'm not good at M: I think that the third row generates ...
- 8 years ago
Hi AGo,
in M, every query step can be seen as a variable. So your requirement can be solved like this:
let Odbc = Odbc.DataSource("dsn=dsnname", [HierarchicalNavigation=true]), DB2 = DB2.Database("servername", "test", [Implementation="IBM"]), Origine = if para = "ODBC" then Odbc else DB2 in Origine
Greg_Deckler
8 years agoCommunity Champion
Invoking ImkeF
- ImkeF8 years agoCommunity Champion
Hi AGo,
in M, every query step can be seen as a variable. So your requirement can be solved like this:
let Odbc = Odbc.DataSource("dsn=dsnname", [HierarchicalNavigation=true]), DB2 = DB2.Database("servername", "test", [Implementation="IBM"]), Origine = if para = "ODBC" then Odbc else DB2 in Origine- AGo8 years agoPost Patron
Works like a charm! And thanks forthe functioning explaining.