Alain,
If you're just looking to extract a client's email, it's fairly simple. You can add a branch, where you'll have a PlanetPress Database connector. You'll have to use the "Dynamic SQL" option. Use ODBC to connect to your database, and then, you can type your SQL. The Dynamic SQL allows you to insert variable data selections in the SQL, so you could use something like this:
SELECT * FROM Table1 WHERE CUSTNO = @(1,1,1,1,20,KeepCase,NoTrim)
This is a simple example, but basically, this would extract a customer ID from the data, and find the matching record in a database.
It will put it into a "PlanetPress Database" format, so you'll need to switch the emulation to Database. Then you could store the client's email into a variable, using the Set Job Info and Variable, and set it to this: field(1,0,0,'EMAIL',KeepCase,NoTrim)
And then you'd have the email stored. It will then finish the branch, and go back to the main branch with the original data file.
Doing what you want to do in your original post will be similar, although you won't need to store any data in any variables. You will, however, need a more complex SQL code in order to perform conditional INSERTS and UPDATES. I also recommend that you uncheck the "Expect record set", so that it doesn't expect a record set, since you don't need to actually extract anything.
This may be a lot of information. If you're not confortable, feel free to open a technical support issue for further assistance. (do be aware, however, that we cannot provide you with a SQL syntax for this, as this would be considered custom code, which is out of scope. We will be able to point you in the right direction, however...)
Regards,
Raphaël Lalonde Lefebvre