Page 1 of 1

Sample Vertica SQL with the inputs from an application

Posted: Mon Apr 11, 2016 7:22 am
by rsaveetha
Hi,

I am new to Vertica as well as SQL.
I have an requirement to create a table and populate with the data from different table. The user enter these details(new table name and the source table name) in the front end application.

Can you any one share me the sample query to capture the user inputs. or let me know, which document i can refer for this

Thanks,
Saveetha

Re: Sample Vertica SQL with the inputs from an application

Posted: Mon Apr 11, 2016 6:56 pm
by NorbertKrupa

Code: Select all

INSERT INTO your.table (column1, column2) VALUES (value1, value2);

Re: Sample Vertica SQL with the inputs from an application

Posted: Mon Apr 11, 2016 9:52 pm
by JimKnicely
Maybe this is what you need?

Code: Select all

create table <<new_table_name>> like <<source_table_name>>;
insert into <<new_table_name>> select * from <<source_table_name>>;
commit;

Re: Sample Vertica SQL with the inputs from an application

Posted: Fri Apr 22, 2016 12:18 pm
by rsaveetha
i have used a java query builder to construct the query based on the user input from the UI.