Sample Vertica SQL with the inputs from an application

Moderator: NorbertKrupa

Post Reply
rsaveetha
Newbie
Newbie
Posts: 5
Joined: Sat Oct 31, 2015 2:53 pm

Sample Vertica SQL with the inputs from an application

Post by rsaveetha » Mon Apr 11, 2016 7:22 am

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

NorbertKrupa
GURU
GURU
Posts: 527
Joined: Tue Oct 22, 2013 9:36 pm
Location: Chicago, IL
Contact:

Re: Sample Vertica SQL with the inputs from an application

Post by NorbertKrupa » Mon Apr 11, 2016 6:56 pm

Code: Select all

INSERT INTO your.table (column1, column2) VALUES (value1, value2);
Checkout vertica.tips for more Vertica resources.

User avatar
JimKnicely
Site Admin
Site Admin
Posts: 1768
Joined: Sat Jan 21, 2012 4:58 am
Contact:

Re: Sample Vertica SQL with the inputs from an application

Post by JimKnicely » Mon Apr 11, 2016 9:52 pm

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;
Jim Knicely

Image

Note: I work for HPE. My views, opinions, and thoughts expressed here do not represent those of my employer.

rsaveetha
Newbie
Newbie
Posts: 5
Joined: Sat Oct 31, 2015 2:53 pm

Re: Sample Vertica SQL with the inputs from an application

Post by rsaveetha » Fri Apr 22, 2016 12:18 pm

i have used a java query builder to construct the query based on the user input from the UI.

Post Reply

Return to “New to Vertica SQL”