ven. 18 janvier 2013, 14h51
belou
Madagascar
atoutfox.public.association
Reecriture en Base de donnée SQL Server
Bonjour !
j'ai un Script SQL d'un triger et des Procedure en Oracle j'ai des difficulté a le traduire en SQL Server pour que je puisse le faire en marche
Es ce que quelle qu'un peut m'aider ?
Voici le Script en Oracle
CREATE OR REPLACE TRIGGER "APPLYVM".T_DELETE
BEFORE DELETE ON OREntete -- table OREntete
FOR EACH ROW
DECLARE
change_not_Compteur EXCEPTION;
BEGIN
EXEC DELETE_OrDiagnostic
EXCEPTION
WHEN change_not_Compteur THEN
raise_application_error(-20000, 'Supression Impossible');
END;
/
CREATE PROCEDURE "DELETE_OrDiagnostic" (
val1 number
)
as
begin
select result_OrDiagnostic = count(*) from OrDiagnostic WHERE OrDiagnostic.Or_numero = val1
if result_OrDiagnostic <> 0 then
delete from OrDiagnostic WHERE OrDiagnostic.Or_numero = val1;
EXEC DELETE_OrPiecePropose;
else if
EXEC DELETE_OrPiecePropose;
end if
commit;
end;
/
CREATE OR REPLACE PROCEDURE "DELETE_OrPiecePropose" (
val1 number
)
as
begin
select result_OrPiecePropose = count(*) from OrPiecePropose WHERE OrPiecePropose.Or_numero = val1;
if result_OrPiecePropose <> 0 then
delete from OrPiecePropose WHERE OrPiecePropose.Or_numero = val1;
EXEC DELETE_OrPiece;
else
EXEC DELETE_OrPiece;
end if
commit
end;
/
CREATE OR REPLACE PROCEDURE "DELETE_OrPiece" (
val1 number
)
as
begin
select result_OrPiece = count(*) from OrPiece WHERE OrPiece.Or_numero = val1;
if result_OrPiece <> 0 then
delete from OrPiece WHERE OrPiece.Or_numero = val1;
EXEC DELETE_ORTiming;
else
EXEC DELETE_ORTiming;
end if
commit
end;
/
CREATE OR REPLACE PROCEDURE "DELETE_ORTiming" (
val1 number
)
as
begin
select result_ORTiming = count(*) from ORTiming WHERE ORTiming.Or_numero = val1;
if result_ORTiming <> 0 then
delete from ORTiming WHERE ORTiming.Or_numero = val1;
EXEC DELETE_OREntete;
else
EXEC DELETE_OREntete;
end if
commit
end;
/
CREATE OR REPLACE PROCEDURE "DELETE_OREntete" (
val1 number
)
as
begin
select result_OREntete = count(*) from OREntete WHERE OREntete.Or_numero = val1;
if result_OREntete <> 0 then
delete from OREntete WHERE OREntete.Or_numero = val1;
else
commit
end if
commit
end;
/
Merci d'avance !!
Permalink : http://www.atoutfox.org/nntp.asp?ID=0000010751