Skip to main content
Solved

Run SQL query on database with dots in the table name

  • January 26, 2023
  • 1 reply
  • 693 views

Forum|alt.badge.img+1

Hello,

I am trying to use database procedure function to extract some data from a HANA view database.

Unfortunately, table name has dots (“.”), so it seems like AIMMS cannot parse it for SQL query properly. For example, the table name is something like xx.yy.zz/pp, where you can see some dots between xx, yy, and zz.  

Can you help us to figure out proper syntax to write sql query with this type of name?

Thank you!

 

 

Best answer by Mischa

Hi,

 

I am not sure which database server you are using, but I tried this out on a MySQL database with a table called Mischa.Dot.Test. The following syntax works:

 

select * from testDBMS.`Mischa.Dot.Test`;

 

However, when searching on the Internet about this, using dots in table names is not considered as good practice. See the remarks made here, for example.

 

Kind regards,

Mischa

 

View original

1 reply

Mischa
AIMMSian
Forum|alt.badge.img+6
  • AIMMSian
  • 29 replies
  • Answer
  • January 27, 2023

Hi,

 

I am not sure which database server you are using, but I tried this out on a MySQL database with a table called Mischa.Dot.Test. The following syntax works:

 

select * from testDBMS.`Mischa.Dot.Test`;

 

However, when searching on the Internet about this, using dots in table names is not considered as good practice. See the remarks made here, for example.

 

Kind regards,

Mischa