6

Im making an export of data on sql developer, and im getting the database name or user name before every table, like this:

Insert into FAUSTO.CLIENT (ID, Name) ...

So the database in this case is FAUSTO. I want this export to be independent of database name. I have another script that creates the schema and then i run some scripts that inserts data. So, no matter the database name, it should work always.

Thanks

1
  • 1
    That's the schema (which is the same as the user), not the database name. Commented Jun 23, 2016 at 16:54

1 Answer 1

10

This is slightly unintuitive, but in the SQL Developer Export Wizard, uncheck the 'Show schema' option from the Export DDL section, before unticking that whole section.

Export Wizard dialog

The insert statements honour that setting even if you exclude the DDL.

With that turned off the generated script looks like:

--------------------------------------------------------
--  File created - Thursday-June-23-2016   
--------------------------------------------------------
REM INSERTING into A
SET DEFINE OFF;
Insert into A (NAME,AGE) values ('Tom',1);
Insert into A (NAME,AGE) values ('John',2);
...

If I export again but leave that 'show schema' checkbox on instead I get:

--------------------------------------------------------
--  File created - Thursday-June-23-2016   
--------------------------------------------------------
REM INSERTING into STACKOVERFLOW.A
SET DEFINE OFF;
Insert into MYSCHEMA.A (NAME,AGE) values ('Tom',1);
Insert into MYSCHEMA.A (NAME,AGE) values ('John',2);
...
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.