Skip to Main Content

SQL Developer for VS Code

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to copy table like drag and drop in old SQL Developer?

Jared COct 11 2024

Hi, I noticed that when I create a table like this

CREATE TABLE MY_TABLE AS
   SELECT *
   FROM MY_SCHEMA.MY_TABLE;

It doesn't necessarily copy all constraints. For instance, it isn't copying a Primary_Key constraint.

I tried the DBMS_METADATA.GET_DDL on the table, but the resulting script includes a lot of low-level details such as instructions on which block of memory to which to save the table (I'm new to Oracle DB, and I'm a developer, not a DBA). So I was reluctant to run it.

The other thing you can do (both in the VS Code extension and the original SQL Developer) is right-click > Table > Copy, but that doesn't include the Primary_Key constraint either.

What DID work was dragging and dropping the table in the original SQL Developer from Schema A to Schema B. This copied EVERYTHING. However, I can't seem to replicate the drag and drop behavior in the SQL Developer for VS Code extension.

I don't really enjoy using the original SQL Developer. I also don't enjoy dragging and dropping.

Is there a recommended/known way I can replicate the results of the drag and drop copy table functionality from the original SQL Developer in the new SQL Developer VS Code extension?

This post has been answered by gsalem-Oracle on Oct 14 2024
Jump to Answer
Comments
Post Details
Added on Oct 11 2024
2 comments
660 views