Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

WITH AS doesnt work with INSERT INTO ?

$
0
0
Hallo everyone,

as simple as the title, I wonder why this code doesnt work.

Code:

WITH
    myBasic AS
    (
        SELECT
                test_column1,
            test_column2 
        FROM
            mySchema.myTable
        FETCH
            FIRST 1000 rows only)

insert into mySchema.test(test_column1, test_column2)
select * from myBasic;

I have already created the table mySchema.test
The error:
Code:

Error Code: -104, SQL State: 42601]  An unexpected token "mySchema" was found following "s only)
It must be possible to insert table from a "with as table"?

Thank you everyone.

Regards,
Ratna

Viewing all articles
Browse latest Browse all 13329

Trending Articles