Please help me in this….
-
There are few databases DB1,DB2,DB3,DB4,DB5….
-
each database has same tables T1,T2,T3…..Tn. (each table has same columns C1, C2, C3……Cn… but data in those tables are different)
-
Requirement: *query:* select C1, C2, C3 from T1 inner join T2 on T1.C4 = T2.C4
the query will be same for all databases.
-
First step is to create drop down menu for Databases DB1, DB2, DB3, DB4, DB5
-
Then select one or more databases after that the query should run for selected database or databeses.
What source should I select and how to create dataset for them?
Create a parameter called something like SelectedDatabase.
Hard-code the values of the available databases within it.
Change the query expression to be something like:
This is an example of a dynamic query – you can find out more here.
Note that if users can directly enter values that will be used in a dynamic query, you will be opening your code to the risk of SQL injection attacks (obligatory XKCD reference here). This is why you should hard-code the available values (if possible).