cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Why create table as select statement is not working

0 Likes
2,870

Hi All,

I have table in S4 schema and i need to create another table in custom schema. I just wrote a simple SQL statement in SQL Console Create Table <TableName> as Select * from S4.<Tablename>. It's getting failed.

I tried in all methods what we can use in SQL but it's getting failed. I'm not sure what i'm missing in conceptual.

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Likes

Thanks Witalij,

Last night i tried below statement and it worked. Thanks for your inputs.

create column table "<TargetSchemaName>"."TEMP_DOCA" as (

select * from "<SourceSchemaName>"."DOCA" where GJAHR = '2021' and month(werks) <> '12')with data; -- with no data

with no data : it will create only structure

Vitaliy-R
Developer Advocate
Developer Advocate
0 Likes

Can you try with ()

Create Table <TableName> as (Select * from S4.<Tablename>)

?

Please see https://help.sap.com/viewer/c1d3f60099654ecfb3fe36ac93c121bb/2021_4_QRC/en-US/20d58a5f75191014b2fe92...

Regards.