Advertisement
Advertisement
| 08.06.2008 at 09:26AM PDT, ID: 23626292 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
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: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: |
CREATE PROCEDURE getAccountRefData
(
@application varchar(15),
@accountNumber char(9),
@accountSystem int
)
AS
BEGIN
/*
************************************************************************
Dynamic SQL for MDA
************************************************************************
*/
declare @execCmd varchar(250),@fixParam varchar(2000),@param1 varchar(8000)
select @fixParam = '[UniqueExecutionID ='+newid(1)+'][ServerUserID='+convert(varchar,suser_id())+'][HostName='+host_name()+']'
select @execCmd= ' exec getAccountRefData '
select @param1 = "@application="+case when @application is null then "NULL" else "'"+rtrim(@application)+"'" end +"," +
"@accountNumber="+case when @accountNumber is null then "NULL" else "'"+rtrim(@accountNumber)+"'" end +"," +
"@accountSystem="+case when @accountSystem is null then "NULL" else rtrim(convert(varchar,@accountSystem)) end
exec('--'+@fixParam+@execCmd+@param1)
/////////////////////////////////////////////////////////////////////
select DISTINCT TA.accountNumber, TA.accountSystemRN, TA.accountStatus, TA.accountCategoryRN,countryOfCitizenship, countryOfResidence,
TGA.fullname1, TGA.address1, TGA.city, TGA.stateCode, RN.refName, TGA.postalCode
from rdeTAPSAccount TA,
TAPSGeneralAddress TGA,
TAPSCustomerDesiStreetAccount TCDSA,
refName RN
where TA.accountNumber = TCDSA.accountNumber
and TA.accountSystemRN = TCDSA.accountSystemRN
and TCDSA.accountNumber = TGA.accountNumber
and TCDSA.accountSystemRN = TGA.accountSystemRN
and TGA.mainAddressInd = 'Y'
and TGA.countryCode = RN.refCode
and TA.accountNumber = @accountNumber
and TA.accountSystemRN = @accountSystem
end
**************************************
There are 4 params as follows:
0 - result - integer
1 - @application
2 - @accountNumber
3 - @accountSystem
///////////////////////////////////////////////////////////////////////
Set oConn = CreateObject("ADODB.Connection")
oConn.Open "DSN=PAP_ED_RPT1;" & _
"Uid=fsmainXX;" & _
"Pwd=XXXXXX"
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
rst.Open "SELECT AccountNumber FROM tblNameAddress", CurrentProject.Connection
Do Until rst.EOF
Set cmd = New ADODB.Command
With cmd
.ActiveConnection = oConn
.CommandType = adCmdText
.CommandText = "exec getTATGATCDSAByAccount @ApplnNm='test', @accountNumber='" & rst("AccountNumber") & "'"
.CommandText = .CommandText & ",@accountSystem=1435,@selectFields='accountNumber, accountStatus"
.CommandText = .CommandText & ", fullName1, address1, city, stateCode, postalCode, taxID, accountClassification"
.CommandText = .CommandText & ", fullName2, countryCode, countryOfResidence, countryOfCitizenship, accountCategory"
.CommandText = .CommandText & ", cashIndicator, marginIndicator, codIndicator'"
Set recNameAdress = .Execute
End With
strAccountNumber = recNameAdress("accountNumber")
strFullName1 = Nz(recNameAdress("fullName1"), " ")
strFullName2 = Nz(recNameAdress("fullName2"), " ")
CurrentProject.Connection.Execute "Update tblNameAddress Set FullName1 ='" & Replace(strFullName1, "'", "''") & "', " & _
"statecode ='" & strStateCode & "', postalcode ='" & strpostalCode & "', taxID ='" & strtaxID & "', "
recNameAdress.Close
rst.MoveNext
Loop
|