Page 1 of 1

Generate scripts from object and data (select, insert)

PostPosted: Tue Jan 15, 2013 8:43 am
by joselitux

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

PostPosted: Wed Jan 16, 2013 9:31 am
by Serge
Hi,

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

Thanks

merge script

PostPosted: Fri Jan 18, 2013 9:19 am
by maslopo
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 );

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

PostPosted: Fri Jan 18, 2013 2:59 pm
by Serge
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 ;)

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

PostPosted: Wed Jan 23, 2013 10:24 am
by maslopo
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 ..