Do I have to have (or buy) all the necessary resources and then draw and sacrifice a card by placing it under the wonder ?
Technically, you draw the card first and then decide what you want to do with it.
1. Discard for gold
2. Build as building
3. Use to build a wonder
They are mutually exclusive.
Cards in front of you (i.e. cards you built as buildings) stay there the whole game unless they're destroyed by your opponent.