Running a SQL SELECT statement in USER NAMESPACE to get data from another NAMESPACE
Hello,
I am trying to run a simple SELECT STATEMENT in USER NAMESPACE.
SELECT * FROM projectname.table
What is the syntax if i need to get data for a table in another namespace eg. SAMPLES., SYS
SELECT * FROM SAMPLES.projectname.table is not working.
Thanks in advance.
Jimmy Christian.
Hi,
You need to map the other Global database into your namespace. This is the only way to have visibility of other database
Thank you .
Be aware that if you're using InterSystems IRIS Community Edition you can't do this.
If you agree with me that InterSystems decision to disable the mapping features in Community Edition should be reversed, please go to https://github.com/intersystems-community/iris-community-edition/issues/2 and +1 this issue.
Thank you all. At this time, i will not be able to map the USER db to rest of it. But i will try to call support .
Please, you have to map the class too. It is into Routine database.
Check previously what is the Global name to map it.
You need to map both data global and class package.
Thank you all. Only reason i have to do it is because i cannot import the csv file data into my table in USER namespace using IMPORT WIZARD. Wizard is not working and throwing CSP error.
I will try and see if i am able to map the class and package. and then run the query i need to extract the data. Thank you
Call support. Its a known bug
If the C++ binding is installed you could/should be able to use a %RemoteResultSet object to accomplish what you're wanting to do. I've never done so myself so I can't confirm from experience.