• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 63
  • Last Modified:

Fetch emails and save in mysql

I'm been working with an windows service to fetch emails (imap) and save them in mysql but every time I save all of them so any one know how get just the doest exist in my database??


any example or how can do this maybe in other way?


Im working with VB.net
0
PLCITS
Asked:
PLCITS
2 Solutions
 
Ryan ChongCommented:
but every time I save all of them so any one know how get just the doest exist in my database??
first, you may try an approach to limit the emails you fetching per your (ETL) job, let's say only fetching for yesterday's emails. second, we need to do a checking in your database insert scripts, before the insert, check for record existence. if exist, you may escape or update it, if not exist, then do the insertion.

hope that make sense.
0
 
theGhost_k8Database ConsultantCommented:
There could be better ways than this but this is something quickly came to my mind:

- make your email field as UNIQUE (add unique key to email)
- to load data use INSERT IGNORE statement.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now