> Tech > Listings (2)

Listings (2)

Tech - Par iTPro - Publié le 24 juin 2010
email


Listing 6 : Script ActiveX pour la Type1 Refresh DDQ Task

‘ Type 1 Refresh Process
Function Main()
DTSDestination(“package”) = DTSSource(“package”)
DTSDestination(“productname”) = DTSSource(“productname”)
DTSDestination(“productid_app”) = DTSSource(“productid”)
Select Case DTSSource(“tran_type”)
Case “I”
Main = DTSTransformstat_InsertQuery
Case “D”
Main = DTSTransformstat_DeleteQuery
Case “U”
Main = DTSTransformstat_UpdateQuery
End Select
End Function


Listing

7 : Script ActiveX pour la Type2 Refresh DDQ Task

‘ Type 2 Refresh Process
Function Main()
DTSDestination(“package”) = DTSSource(“package”)
DTSDestination(“productname”) = DTSSource(“productname”)
DTSDestination(“productid_app”) = DTSSource(“productid”)
DTSDestination(“effective_date”) = DTSSource(“log_date”)
Select Case DTSSource(“tran_type”)
Case “I”
Main = DTSTransformstat_InsertQuery
Case “D”
Main = DTSTransformstat_DeleteQuery
Case “U”
If DTSSource(“packagechg”) = False Then
DTSDestination(“package”) = -1
Main = DTSTransformstat_UpdateQuery
End Select
End Function

Listing 8 : Script ActiveX pour la procédure stockée usp_Update_Products_type2

CREATE PROC usp_Update_Products_type2
@productid_app AS INT,
@productname AS VARCHAR(25),
@package AS INT,
@effective_date AS DATETIME
AS
IF @package <> -1
BEGIN
UPDATE Products_type2
SET to_date = @effective_date
WHERE productid_key = (SELECT MAX(productid_key)
FROM Products_type2
WHERE productid_app = @productid_app)
INSERT INTO Products_type2(productid_app, productname, package, effective_
date)
VALUES(@productid_app, @productname, @package, @effective_date)
END
ELSE
BEGIN
UPDATE Products_type2
SET productname = @productname
WHERE productid_app = @productid_app
END
GO

Listing 9 : Script de création pour la procédure stockée usp_Update_Products_type3

CREATE PROC usp_Update_Products_type3
@productid_app AS INT,
@productname AS VARCHAR(25),
@package AS INT,
@effective_date AS DATETIME
AS
IF @package <> -1
BEGIN
UPDATE Products_type3
SET productname = @productname,
package2 = package1,
package1 = package,
package = @package,
effective_dat2 = effective_dat1,
effective_dat1 = effective_date,
effective_date = @effective_date
WHERE productid_app = @productid_app
END
ELSE
BEGIN
UPDATE Products_type3
SET productname = @productname
WHERE productid_app = @productid_app
END
GO

Téléchargez cette ressource

Guide de sécurité de l’adoption du Cloud

Guide de sécurité de l’adoption du Cloud

Avec la pandémie, l’adoption du Cloud s'est emballée, les failles de sécurité aussi. Sécuriser les données au niveau de l’organisation est la clé d'une utilisation sûre du Cloud. Dans ce livre blanc, découvrez les risques liés à cette adoption et les origines de faiblesse de sécurité des données.

Tech - Par iTPro - Publié le 24 juin 2010

A lire aussi sur le site

Revue Smart DSI

La Revue du Décideur IT