protected void writeExternalForeignKeyCreateStmt(Database database, Table table, ForeignKey key, int numKey) throws IOException
protected void writeExternalForeignKeyCreateStmt(Database database, Table table, ForeignKey key) throws IOException
    protected void writeExternalForeignKeyCreateStmt(Database database, Table table, ForeignKey key, int numKey) throws IOException    {        if (key.getForeignTable() == null)        {            _log.warn("Foreign key table is null for key " + key);        }        else        {            writeTableAlterStmt(table);            print("ADD CONSTRAINT ");            print(getConstraintName(null, table, "FK", Integer.toString(numKey)));            print(" FOREIGN KEY (");            writeLocalReferences(key);            print(") REFERENCES ");            print(getTableName(database.findTable(key.getForeignTable())));            print(" (");            writeForeignReferences(key);            print(")");            printEndOfStatement();        }    }