Import Customer Database?

  
Follow my thoughts ...
I need to import a database from a customer into my structure. As identifiers of my entities are auto increment as I do to maintain the integrity of relationships?
What strategy do you use in these cases?
My problem is the sequence on Oracle.
Allan -

I can't speak for Oracle, but in SQL Server there is a command you can run to turn off auto incrementing. There should be one in Oracle as well. You'd need to use Advanced SQL in OutSystems, or do it externally to the system.

J.Ja
Thanks Justin. In SQL Server I haven't problems. My doubts are  specifically the Oracle.
Some have a tip?
Hi Allan,

After importing the database to your infrastructure, you'll need to set the sequence nextval for a greater value than your maximum identifier. 

You can execute the following PL/SQL to set the proper sequence nextval:

DECLARE
v_newVal NUMBER(12) := 0;
v_incval number(12) := 0;
Begin
SELECT NVL(max(<Auto Increment attribute>),0) INTO v_newVal FROM <TableName>;
v_newVal := v_newVal + 1;
LOOP
    EXIT WHEN v_incval>=v_newVal;
    select <Sequence Name>.nextval into v_incval from dual;
end loop;
end;
/

Bear in mind that you've to execute this PL/SQL for each one of your sequences. A faster solution would be to dynamically generate this scripts for each one of the sequences.

Kind regards,
Ivo Gonçalves