Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Table Question
Hi arthur
First of all i didn;t understand whether the matching sequence number from poruction and of first table and the second one refers to same information (let's say as an example - the same employee information). If that is the same then declare a cursor on table A(PROD) for update with matching sequence number in TABLE B. For the matching entry you update the contents of table B into table A. Non-matching records in TABLE B can be simply inserted.
However if the information for matching sequence number from table A and table B differs then simply take the maximum sequence number from TABLE A.
create a new sequence with start value as max_seq(TABLE A) + 1
Insert the records from table B into table A with new_sequence.nextval so that you won't get unique constraint violation
regards
vittal
Arthur Merar wrote:
> Hello,
>
> I have a question about inserting data into tables. We have two
> tables.....one is production, and the other are transactions that need
> to be inserted into production.
>
> However, the production table has many constraints on it. And, it has
> a sequence on it.
>
> So, my question is: When I insert the records, I get a unique
> constraint error on the sequence number. How can I insert these
> records and have the sequence work correctly? This transaction table
> has sequence numbers that must conflict with the production table.
>
> Also, when I export a table, have can I not export the constraints so
> when I import it I do not get all the errors if the object exists?
>
> Any help would be appreciated.
>
> Please e-mail a copy of your response.
>
> Thanks,
>
> Arthur
> amerar_at_unsu.com
> amerar_at_ci.chi.il.us
Received on Sun May 16 1999 - 08:21:56 CDT
![]() |
![]() |