Force Update of Target Table

More
1 year 11 months ago - 1 year 11 months ago #24270 by MikeG
Hello team,

I am sending files to an Oracle DB. The error message is Unique Constraint violated. Given my settings in Visual Importer, I expected an update of the old record. Instead, it seems its trying to Insert, triggering the Oracle message. Any suggestions? Please note there  are 2 screenshots in the attachment. 

This browser does not support PDFs. Please download the PDF to view it: Download PDF

Last edit: 1 year 11 months ago by MikeG. Reason: Notifying that there are 2 screenshots in the attachment.

Please Log in or Create an account to join the conversation.

More
1 year 11 months ago #24271 by admin
Replied by admin on topic Force Update of Target Table
The update fields might have trailing spaces which are not visible.
Please try removing them using calculation

Just to clarify

Our software checks of record exits using count statement
select count(*) from table where field ='id '
Note single trailing space, so no record is found
When data inserted into oracle varchar field trailing spaces are automatically removed (BY ORACLE AND NOT US)
So the record actually exists but it has no trailing spaces and insert fails


  

Mike
ETL Architect

Please Log in or Create an account to join the conversation.

More
1 year 11 months ago #24272 by MikeG
Replied by MikeG on topic Force Update of Target Table
Hello again Mike. Can you just confirm my understanding. Should I be adding trailing spaces when I insert a field that's part of the Primary Key, or removing it? For example:

SELECT TRIM(CAST(p.ID AS VARCHAR(100))) AS "LocationID"

Please Log in or Create an account to join the conversation.

More
1 year 11 months ago #24273 by admin
Replied by admin on topic Force Update of Target Table
You should trim it and also trim the the values which are already loaded

EG:
 
UPDATE  TABLE TABLE_NAME SET LocationID = TRIM(LocationID)

Mike
ETL Architect
The following user(s) said Thank You: MikeG

Please Log in or Create an account to join the conversation.

More
1 year 11 months ago #24274 by admin
Replied by admin on topic Force Update of Target Table
FYI:


Mike
ETL Architect

Please Log in or Create an account to join the conversation.

More
1 year 11 months ago #24284 by MikeG
Replied by MikeG on topic Force Update of Target Table
Thanks. What does F1 refer to in TRIM([F1]) ?

Please Log in or Create an account to join the conversation.

Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Read more
Marketing
Set of techniques which have for object the commercial strategy and in particular the market study.
Google
Accept
Decline
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Google Analytics
Accept
Decline
Functional
Tools used to give you more features when navigating on the website, this can include social sharing.
Advertisement
If you accept, the ads on the page will be adapted to your preferences.
Google Ad
Accept
Decline
Save