Skip to Main Content

SQLcl: MCP Server & SQL Prompt

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!

SQLcl CTAS Command question

daniel_haukeAug 24 2018 — edited Aug 27 2018

Hi everybody,

we are using Oracle SQLDeveloper Command-Line (SQLcl) version: 18.2.0.0.

I was trying to use the ctas Command to create the ddl from a table in a different tablespace. I was executing this command as sys User.

But it always throws me the following error:

SQL> ctas user1.test1 test;Create Table As Select command failed to get DDL for table "user1"

Is it not possible to use this command to create a table from different schemas? The command execute without errors when i want to create a table from my own schema.

Greetings Daniel

This post has been answered by Glen Conway on Aug 24 2018
Jump to Answer

Comments

Glen Conway
Answer

Even when logged in as HR, if I run

SQL> ctas hr.employees hr.employees_Clone

then it returns

Create Table As Select command failed to get DDL for table "HR"

so the issue is with the CTAS command not expecting "table" or "new_table" to be provided in the form of "schema"."table".

Sounds like a bug, or at least an enhancement request.  Best to log an SR on MOS if you have an account.

Marked as Answer by daniel_hauke · Sep 27 2020
Glen Conway

In the meanwhile, check out the BRIDGE command:

Capture.JPG

daniel_hauke

Hi Glen,

thanks for the reply. I also came across the bridge command which sounds also very interessting. I will try that command.

And also i will raise an SR in MOS.

Greetings Daniel

1 - 3

Post Details

Added on Aug 24 2018
3 comments
375 views