I have added personal code to SQLToAppData.java so that primary and foreign key information is added if an oracle "ALTER TABLE ADD PRIMARY KEY" or "ALTER TABLE ADD FOREIGN KEY" statement is encountered.
Attached is the diff output of the 3.0 version and my version (55 lines). It would be nice to see this incorperated into the code.
-Trav
191c191,237
<
---
>
> /**
> * Parses a ALTER TABLE FOO command.
> *
> * @throws ParseException
> */
> private void Alter() throws ParseException
> {
> next();
> if (token.getStr().toUpperCase().equals("TABLE"))
> {
> Alter_Table();
> }
> }
>
> /**
> * Parses a CREATE TABLE sql command
> */
> private void Alter_Table() throws ParseException
> {
> next();
> String tableName = token.getStr(); // name of the table
> Table tbl = appDataDB.getTable(tableName);
> next();
>
> if (token.getStr().toUpperCase().equals("ADD")){
> Alter_Table_Add(tbl);
> }
> }
>
> /**
> * Parses an ALTER TABLE foo ADD sql command
> */
> private void Alter_Table_Add(Table table) throws ParseException
> {
> next();
> if (token.getStr().toUpperCase().equals("FOREIGN"))
> {
> Create_Table_Column_Foreign(table);
> }
> else if (token.getStr().toUpperCase().equals("PRIMARY"))
> {
> Create_Table_Column_Primary(table);
> }
> }
>
>
577a624,627
> }
> else if (token.getStr().toUpperCase().equals("ALTER"))
> {
> Alter();-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
