Advertisement
| 03.25.2008 at 03:00PM PDT, ID: 23268811 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: |
-- This is an example of the SQL string found in the TXT/SQL file
SELECT DATE_FORMAT(m.created_at, '%y%m%d') 'entrydate'
,m.member_id
,n.full_name 'name1'
,n.main_phone2
,n.address1
,n.city
,s.abbreviation
,n.postal_code2
,n.email
,u.fullname 'user'
FROM db1.members m
JOIN db1.names n ON m.id = n.member_id
JOIN db1.states s ON n.state_id = s.id
JOIN db1.users u ON m.user_id = u.id
WHERE m.partner_id = 4
AND m.sub_partner_id != 3
AND n.name_type_id = 1
AND m.expiration_date > DATE_ADD(CURRENT_DATE(), INTERVAL -18 MONTH);
--------------------------------------------------------------------
-- This is an example of the VBScript found in the ActiveX task
Function Main()
Dim oPkg
Dim oDataPump
Dim sSQL
Dim choice
Dim path
sSQL = "TESTING"
path = ""
'// Prompt user for input - need to flesh this out
choice = InputBox("Select a query")
SELECT CASE choice
CASE 1
path = "\\Server\Share\qry_Text1.txt"
CASE 2
path = "\\Server\Share\qry_Text2.txt"
CASE ELSE
path = "\\Server\Share\qry_Text0.txt"
END SELECT
'// Get reference to the DataPump Task
Set oPkg = DTSGlobalVariables.Parent
Set oDataPump = oPkg.Tasks("DTSTask_DTSDataPumpTask_1").CustomTask
'// Get the SQL string from the file based upon user input
''''ENTER THE FileScriptingObject Code here
''''Pass the path variable to this piece of the code
''''Read the file into variable
sSQL = Results of reading the TextFile
'// Set the value
oDataPump.SourceSQLStatement = sSQL
'// Clean Up
Set oDataPump = Nothing
Set oPkg = Nothing
Main = DTSTaskExecResult_Success
End Function
|