db2ibm-data-studio

IBM Data Studio Table name issue


When I create a new SQL script , for example

select * from table

When I execute this the sql that gets ran is

SELECT * FROM MYNAME.TABLE

I understand DB2 does this , but I want the schema name to be concatenated onto the table names, not my username.

SELECT * FROM SCHEMANAME.TABLE

It did this for me before, but I dont know what changed that it now only puts the database username at the end of the tables.

Does anyone know how to set it so the schema name gets added on?


Solution

  • Best way in my eyes for Data Stuio is setting the special register "Current schema" on the Special Registers tab of the SQL Editor. Here is a screenshot enter image description here