Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify Column Names in Insert/Create Statement #212

Closed
woshiniuren opened this issue Jan 17, 2022 · 3 comments · Fixed by #371
Closed

Specify Column Names in Insert/Create Statement #212

woshiniuren opened this issue Jan 17, 2022 · 3 comments · Fixed by #371
Labels
enhancement New feature or request

Comments

@woshiniuren
Copy link

Hi ~
"insert into aaa(de00001) select name from a;" for this sql string expect to be .aaa.de00001<- .a.name
but it turns out to be .aaa.name <- .a.name, is this something wrong ?

@reata reata added the enhancement New feature or request label Jan 17, 2022
@reata
Copy link
Owner

reata commented Jan 17, 2022

To specify column name in the query is not supported yet. The following also doesn't work:

create table tab1 (col1 string) AS
select col2 from tab2;

create view tab1 (col1, col2) AS
select col3, col4 from tab2;

I'll see what I can do to improve on this.

@nickhuang1996
Copy link

@reata Sure! Thank you for your explanation!

@reata reata changed the title insert into aaa(de00001) select name from a; Specify Column Names in Insert Statement Apr 11, 2023
@reata
Copy link
Owner

reata commented Jun 11, 2023

This is supported by ansi dialect. Note we won't port it back to default non-validating as sqlparse cannot generate correct AST for this case.

@reata reata changed the title Specify Column Names in Insert Statement Specify Column Names in Insert/Create Statement Jun 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants