-
1. Re: Setting TEIID_MULTI_DATA_SOURCE_COLUMN attribute
rareddy Feb 12, 2016 3:08 PM (in response to shekhar78)How does user select the data source? Give me an example. (the above will not work). I want you think Teiid as just another database like Oracle, postgres etc and devise a way. Or this property can be a user's "role".
Then look at Data Roles, and Access Patterns sections in Teiid documentation.
-
2. Re: Setting TEIID_MULTI_DATA_SOURCE_COLUMN attribute
shekhar78 Feb 12, 2016 3:37 PM (in response to rareddy)Using a userDefinedFunction ( or stored procedure) which provides list of available datasource associated with the VDB. I am thinking of datasources as different schema in Oracle. User connects to a URL. Get the list of datasource ( similar to schema of similar types).
Select a datasource to work with. Set the current_Session to the selected data source and all the subsequent query is against the selected datasource.
-
3. Re: Setting TEIID_MULTI_DATA_SOURCE_COLUMN attribute
rareddy Feb 12, 2016 4:04 PM (in response to shekhar78)Shekhar,
You did not answer the question I was looking for
Select a datasource to work with. Set the current_Session to the selected data source and all the subsequent query is against the selected datasource.
You are thinking like programming language, as I mentioned Teiid behaves like RDBMS.
Let me ask you differently, if we can pass in the user name to the UDF, can you return a data source name from that code?
-
4. Re: Setting TEIID_MULTI_DATA_SOURCE_COLUMN attribute
shawkins Feb 15, 2016 9:07 AM (in response to rareddy)Shekhar,
Functionality like this is targeted at Teiid 9.0 [TEIID-3738] Add multi-tenant functionality - JBoss Issue Tracker
The current multi-source feature was designed for maximum flexibility in accessing partitions rather than restricting to a single one. A workaround is to use multi-source and data roles with a row level permission on each applicable table that adds in a predicate against the partitioning column based upon the user/session.
Steve