Generate scripts from object and data (select, insert)

Feature requests and their debate

Generate scripts from object and data (select, insert)

Postby joselitux » Tue Jan 15, 2013 8:43 am

joselitux
 
Posts: 43
Joined: Thu Oct 25, 2012 12:11 pm

Re: Generate scripts from object and data (select, insert)

Postby Serge » Wed Jan 16, 2013 9:31 am

Hi,

I agree, it would be a helpfull feature, I think we'll add it in the next version.

Thanks
Serge
 
Posts: 1526
Joined: Sat Feb 26, 2011 8:24 pm
Location: SPb

merge script

Postby maslopo » Fri Jan 18, 2013 9:19 am

I often use the construct sql MERGE I never found the generation of this construct that performs the update / insert / delete, I'd like dbever was one of the few to implement

an example for Database : VERTICA,ORACLE,SQLSERVER ...

MERGE INTO target_table AS Target
USING source_table AS Source
ON ( Target.key_field = Source.key_field )
WHEN MATCHED
THEN UPDATE SET
data= target.data , data2=target.data2
WHEN NOT MATCHED
THEN INSERT ( key_field,dat,data2)
VALUES
( target.key_field,target.dat,target.data2 );
maslopo
 
Posts: 25
Joined: Fri Dec 28, 2012 4:17 pm

Re: Generate scripts from object and data (select, insert)

Postby Serge » Fri Jan 18, 2013 2:59 pm

Concerning MERGE operation it is not obvious how UI auto-generation may help here.
While basic DML statement needs just some table/data selection to generate statement MERGE (or any other multi-table opeations, e.g. joins) is much more intelligent.
And I'd prefer to write SQL manually than use some complex UI... But maybe you may add more arguments for this feature ;)
Serge
 
Posts: 1526
Joined: Sat Feb 26, 2011 8:24 pm
Location: SPb

Re: Generate scripts from object and data (select, insert)

Postby maslopo » Wed Jan 23, 2013 10:24 am

I simply need (on tables with many fields) that is defined as a primary key constraint or unique to infer the match fields ... and produce a script that emulates the merge of a table to itself (so sorce and target field name are the same ... this appen for me in 100% of cases) .. giving a generic name for the source table ...

if necessary one can edit the script by hand...

thank you Serge for the work you do ..
maslopo
 
Posts: 25
Joined: Fri Dec 28, 2012 4:17 pm


Return to Feature Requests



Who is online

Users browsing this forum: No registered users and 4 guests