How to refer to a CONSTRAINT by SELECT?
Omari Stephens <[email protected]>
| Newsgroups | gmane.comp.java.hsqldb.user |
|---|---|
| Message-ID | <CAA8ki2u2xShZftFqLSu7hDf+-zi=oO2=j4mj62FUJqw+Y_6Nyw@mail.gmail.com> |
This is a follow-on to the SCHEMA modification question. Here's where I'm
at right now:
query = String.format("ALTER TABLE %s " +
"DROP CONSTRAINT ( " +
"SELECT CONSTRAINT_NAME FROM
INFORMATION_SCHEMA.TABLE_CONSTRAINTS " +
"WHERE TABLE_NAME = %s AND CONSTRAINT_TYPE = 'PRIMARY KEY' " +
") CASCADE",
TABLE, TABLE);
sql.execute(query);
This is apparently invalid syntax:
java.sql.SQLSyntaxErrorException: unexpected token: (
So the SELECT statement is correct. I'm pretty sure the DROP CONSTRAINT
statement is correct also. How do I put them together?
Thanks,
--xsdg
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Hsqldb-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hsqldb-user