When exporting tables with foreign keys using Export User Objects, in a single file, the file looks like this:
create table1;
add foreign keys for table1;
create table2;
add foreign keys for table2;
...
create tableN;
add foreign keys for tableN;
It seems it sorts the tables, putting tables referenced by foreign keys first, so when the foreign keys are created the required tables exist.
This works fine, unless you have circular references like this:
table A with foreign key referencing table B;
table B with foreign key referencing table A;
In this case, sorting the tables in the script won't do any good, the script will fail when creating the foreign key on the first table, because the second table doesn't exist yet.
I think the simplest solution to fix this issue would be generate a script that creates the foreign keys after ALL the tables are created, not after each table, like this:
create table1;
create table2;
...
create tableN;
add foreign keys for table1;
add foreign keys for table2;
...
add foreign keys for tableN;
And I still can't use this forum with internet explorer. I can log in, but whenever I click anything I am logged out.
create table1;
add foreign keys for table1;
create table2;
add foreign keys for table2;
...
create tableN;
add foreign keys for tableN;
It seems it sorts the tables, putting tables referenced by foreign keys first, so when the foreign keys are created the required tables exist.
This works fine, unless you have circular references like this:
table A with foreign key referencing table B;
table B with foreign key referencing table A;
In this case, sorting the tables in the script won't do any good, the script will fail when creating the foreign key on the first table, because the second table doesn't exist yet.
I think the simplest solution to fix this issue would be generate a script that creates the foreign keys after ALL the tables are created, not after each table, like this:
create table1;
create table2;
...
create tableN;
add foreign keys for table1;
add foreign keys for table2;
...
add foreign keys for tableN;
And I still can't use this forum with internet explorer. I can log in, but whenever I click anything I am logged out.