Hi all,
Finally I cam up with the following solution for H2, because it is not
possible to retrieve and in a single query/sub query.
SELECT DISTINCT constraint_name FROM information_schema.constraints WHERE
table_name = 'YOUR_TABLE_NAME';
then use the constraint_name and build the query to alter
Hi Devs,
I need to perform a SQL table alteration to remove a foreign key which is
unnamed. As per my findings it is possible to find the automatically
assigned constraint name in mysql by using *information_schema* table [1]
Also it is possible in mssql[2] and oracle[3]
[1] -
Hi Madushanka,
This article [1] provides the step by step explanation on how to solve this
kind of issue.
Hope this is helpful.
[1] http://www.briskbee.com/posts/changing_unnamed_constraints_in_play_
*Madhuranga Sampath Bandara*
Software Engineer
WSO2, Inc.;http://wso2.com/
Hi Madusanka,
Look in to the following stackoverflow question[1]. This might also help
you.
https://groups.google.com/forum/?hl=en#!searchin/h2-database/unnamed/h2-database/Lb4QdF9jkOc/2uw1pA7i0T8J
[1] -
http://stackoverflow.com/questions/10008476/dropping-unique-constraint-for-column-in-h2
On
Hi Thusitha,
I tried the subquery approach before but it does not get the identifier
properly from the sub query. When I run the subquery only, it shows me the
constraint name. But when it comes to the main query, it does not get the
identifier.
Hi Madhuranga,
Thanks for the reply, but the