You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
A very useful addition to the simple-ddl-parser would be the ability to parse and process the SQL Create Table Using Another Table. Currently there is support only for the Create command, and hence this feature will extend the functionality of this DDL parser.
Describe the solution you'd like
The solution must be able to parse the SQL CREATE command and create the table structure by referencing the table in the select statement which must exist in the same file. The new table gets the same column definitions.
Describe alternatives you've considered
NA
Additional context
Here are some examples for the Create Table Using Another Table command
Syntax
CREATE TABLE new_table_name AS
SELECT column1, column2,...
FROM existing_table_name
WHERE ....;
Example
CREATE TABLE Person (
person_id int,
last_name varchar(255),
first_name varchar(255),
address varchar(255),
city varchar(255)
);
CREATE TABLE TestTable AS
SELECT person_id, first_name, last_name
FROM Person;
The text was updated successfully, but these errors were encountered:
It's quite difficult it's require a db connection to derive SQL Select statement INTO a valid table definition and project the metadata with sp_help_text or get_ddl functions. the module doesn't include a database engine for derivation you are looking for.
https://dev.mysql.com/doc/refman/8.0/en/create-table-like.html - we have support for 'LIKE' and 'CLONE' statements. I don't like idea to add SELECT - because it is part of DML, not DDL, but I will think about it, maybe add support only for this case
Is your feature request related to a problem? Please describe.
A very useful addition to the simple-ddl-parser would be the ability to parse and process the SQL Create Table Using Another Table. Currently there is support only for the Create command, and hence this feature will extend the functionality of this DDL parser.
Describe the solution you'd like
The solution must be able to parse the SQL CREATE command and create the table structure by referencing the table in the select statement which must exist in the same file. The new table gets the same column definitions.
Describe alternatives you've considered
NA
Additional context
Here are some examples for the Create Table Using Another Table command
Syntax
CREATE TABLE new_table_name AS
SELECT column1, column2,...
FROM existing_table_name
WHERE ....;
Example
CREATE TABLE Person (
person_id int,
last_name varchar(255),
first_name varchar(255),
address varchar(255),
city varchar(255)
);
CREATE TABLE TestTable AS
SELECT person_id, first_name, last_name
FROM Person;
The text was updated successfully, but these errors were encountered: