Running a SQL SELECT statement in USER NAMESPACE to get data from another NAMESPACE

SQL, Caché

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.

  • + 1
  • 1
  • 237
  • 7
  • 2

Answers

Hi,

You need to map the other Global database into your namespace. This is the only way to have visibility of other database

Please, you have to map the class too. It is into Routine database.

Check previously what is the Global name to map it.

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

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.

 

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 .