| | |
update a record on load
Please support our Oracle advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Oct 2008
Posts: 17
Reputation:
Solved Threads: 1
Hi
I'd like to know if is possible update a record when load a table. The update must be over a record with a primary key.
For example:
I have a record with: id|date_begin|date_end|data
2|02/03/2009|NULL|0
and I want that line to be update when a record like
2|02/03/2009|10/03/2009|56,7
comes.
Is it possible? Primary key is defined by id, date_begin.
What I want is an update instead a reject record.
Thanks in advance.
I'd like to know if is possible update a record when load a table. The update must be over a record with a primary key.
For example:
I have a record with: id|date_begin|date_end|data
2|02/03/2009|NULL|0
and I want that line to be update when a record like
2|02/03/2009|10/03/2009|56,7
comes.
Is it possible? Primary key is defined by id, date_begin.
What I want is an update instead a reject record.
Thanks in advance.
Hi vimotaro,
Are you asking if you receive a record you want to update an existing one with the data in that received record? If so, you can do this quite easily by running a
If this wasn't what you were asking, please clarify your question for me and I will try to help further
Are you asking if you receive a record you want to update an existing one with the data in that received record? If so, you can do this quite easily by running a
SELECT COUNT(*) statement and seeing if this returns 1. If it does, run your UPDATE statement.If this wasn't what you were asking, please clarify your question for me and I will try to help further
There are no stupid questions, only those too stupid to ask for help.
echo is a web developer's best friend. •
•
Join Date: Oct 2008
Posts: 17
Reputation:
Solved Threads: 1
umm that's the solution as I explained the problem... but I explained it bad. Sorry. 
I've doing a periodic load of a file with about 3000 records. The problem is that the new files (each 2 hours I have a new file) have data with the same pk but different info.
I'm wondering if it's possible doing a PL/SQL or any method to update the old records with the new information, avoiding rejected records for unique constraint.
I think the only way is loading the data in a stage table and later load the real table with the processed data, deleting all records before, but I'd like to avoid the staging table and process the staging table twice (one for delete the old data from real table, and one for insert the new data).
Maybe that's the only way to do it, but I wonder if an easier way is possible.
Thanks!!! and sorry for my bad explanation.

I've doing a periodic load of a file with about 3000 records. The problem is that the new files (each 2 hours I have a new file) have data with the same pk but different info.
I'm wondering if it's possible doing a PL/SQL or any method to update the old records with the new information, avoiding rejected records for unique constraint.
I think the only way is loading the data in a stage table and later load the real table with the processed data, deleting all records before, but I'd like to avoid the staging table and process the staging table twice (one for delete the old data from real table, and one for insert the new data).
Maybe that's the only way to do it, but I wonder if an easier way is possible.
Thanks!!! and sorry for my bad explanation.
![]() |
Similar Threads
- Update record Problem. (ASP.NET)
- Adodc.recordset.update (Visual Basic 4 / 5 / 6)
- retrieving current record in database (Visual Basic 4 / 5 / 6)
- Database manipulation with AVL tree.. please help (Java)
- update but not updated (ASP.NET)
- Help with Dataset update (VB.NET)
- URGENT: JSP - StackOverFlow Error (JSP)
- Login and retrieve user data from database (ASP.NET)
- ComboBox UpDate Problem (VB.NET)
- AHAR! No more windows update fer me (IT Professionals' Lounge)
Other Threads in the Oracle Forum
- Previous Thread: problem with update
- Next Thread: deleting the tables
| Thread Tools | Search this Thread |
2009predictions acquisition amazon.com bartz bernanke cia citrix cloudcomputing crm database dell economy editor enterprise enterprise2.0 enterprisesoftware federalreserve forbes hp ibm intellipedia internet larryellison layoffs linux loughridge mediawiki michaeljackson microsoft neverland nortel notebooks oil operatingsystem oracle palm rimm saas salesforce sap seagate socialcomputing sql sun sybase technologystocks virtualiron virtualization vmware wiki wikipedia xen yahoo zoho






