Αυτόν τον καιρό δουλεύω ένα project του οποίου τμήμα είναι η μεταφορά δεδομένων από μία Oracle db στον SQL Server 2005. Φυσικά, το εργαλείο για τη δουλειά είναι τα SQL Server Intergrated Services.
Στο σενάριο του project λοιπόν, θέλουμε να εξάγουμε από την Oracle τις παραγγελίες των δύο τελευταίων ημερών. Μάλιστα, ενδέχεται για διάφορους λόγους να θέλουμε άλλοτε των τελευταίων τριών ημερών, άλλοτε της τελευταίας εβδομάδας, κλπ. Έφτιαξα λοιπόν ένα Package που μέσα στα άλλα έχει ένα βασικό Data Flow Task το οποίο περιέχει ένα OLE DB Source για να τραβάει τα data από την Oracle. Αυτό το OLE DB source χρησιμοποιεί τον Oracle OLE DB Provider της Microsoft και το query που τρέχει είναι κάτι σαν το παρακάτω:
SELECT ...
FROM ...
WHERE stmntdate >= ? AND stmntdate <= ?
Με σκοπό, να κάνω assign στις δύο παραμέτρους, δυναμικά δύο τιμές τις οποίες θα τραβάω από κάποιον config πίνακα ή κάποιο config εξωτερικό αρχείο.
ΑΜ ΔΕ! Ο Oracle OLEDB provider της Microsoft δεν υποστηρίζει parameters!
Λέω, ας πάω στο site της Oracle μπας και έχει OLE DB Providers να κατεβάσω για να δοκιμάσω αν υποστηρίζουν παραμέτρους...
Πράγματι, βρίσκω το link και βγαίνει η σελίδα του License Agreement. Θαυμάστε:
Ι Agree that...
- I am not a citizen, national or resident of, and am not under the control of, the government of: Cuba, Iran, Sudan, Libya, North Korea, Syria, nor any other country to which the United States has prohibited export.
- I will not download or otherwise export or re-export the Programs, directly or indirectly, to the above mentioned countries nor to citizens, nationals or residents of those countries.
- I am not listed on the United States Department of Treasury lists of Specially Designated Nationals, Specially Designated Terrorists, and Specially Designated Narcotic Traffickers, nor am I listed on the United States Department of Commerce Table of Denial Orders.
- I will not download or otherwise export or re-export the Programs, directly or indirectly, to persons on the above mentioned lists.
- I will not use the Programs for, and will not allow the Programs to be used for, any purposes prohibited by United States law, including, without limitation, for the development, design, manufacture or production of nuclear, chemical or biological weapons of mass destruction.
(Και είναι το πρώτο μέρος, έχει και δεύτερο με όλα τα νομικά mambo-jambo)
Και πανευτυχής, είμαι έτοιμος να κατεβάσω τον OLEDΒ Provider. Και λέει το link:
Oracle10g Provider for OLE DB Version 10.1.0.4.0 (including ODAC) Download the File
ODAC101040.exe (174MB)
174MB για έναν OLEDB provider!!!
Αααααχχχχ... Άλλος έχει το όνομα και άλλος τη χάρη...
Τώρα, δουλεύω σε ένα workaround που θα αλλάζω μέσω κώδικα το statement ώστε να βρίσκει έτοιμες τις τιμές και να μην χρειάζεται μεταβλητές.
Vir prudens non contra ventum mingit