开发者

Creating database constraints on tables on the fly

开发者 https://www.devze.com 2023-01-14 19:34 出处:网络
I am creating tables from java on the fly as they are needed. Now to define constraints and indexes on these tables we need to come up with unique names.

I am creating tables from java on the fly as they are needed. Now to define constraints and indexes on these tables we need to come up with unique names.

I am planning to query the system views to get the constraint and index system views to get a list of all existing names and then come up with a random name and check against these values.

I am doing this since the table name itself might not be unique after being truncated to include the PK suffix.

Is there a be开发者_如何转开发tter way to do this.


Create a UUID but remove the non AlphaNumerics.

0

精彩评论

暂无评论...
验证码 换一张
取 消