Chat2DB icon indicating copy to clipboard operation
Chat2DB copied to clipboard

Bug: DM database generated table DDL error

Open CobraStarLE opened this issue 1 year ago • 0 comments

Chat2DB Version

3.1.22

Describe the bug

When I right-click the table, the ddl generated is empty. After checking, this is because the lookup table annotation is using sql (SELECT comments FROM user_tab_comments WHERE table_name = '#table_name'), but my database has two schemas. Tables with the same name will cause this sql to return multiple rows of data and cause an error. I suggest that the schema should be distinguished when generating table ddl. Because user_tab_comments does not return schema, it is recommended to use select * from SYS.SYSTABLECOMMENTS where SCHNAME='#SCHEMA' and TABLE_TYPE = 'TABLE' and TVNAME='#table name'; return table annotations

CobraStarLE avatar May 22 '24 01:05 CobraStarLE