I was wondering if it is possible to have multiple SQL select statements within an if statement using PL/SQL. I wanted different select statements based on the value of another field.
This is what I tried so far but I'm stuck and can't go on
BEGIN
IF
:P3_COMPAREWITH <> 'OTHER TABLES'
THEN
SELECT TABLE_NAME AS TARGET, TABLE_NAME AS TARGETTABLE
FROM ALL_TABLES@target.hu.nl
WHERE OWNER = 'TOSAD_2017_2D_TEAM4_TARGET';
ELSIF
:P3_COMPAREWITH = 'OTHER TABLES'
THEN
SELECT TABLE_NAME AS TARGET, TABLE_NAME AS TARGETTABLE
FROM ALL_TABLES@target.hu.nl
WHERE OWNER = 'TOSAD_2017_2D_TEAM4_TARGET' AND TABLE_NAME <> :P3_TARGETTABLE;
END IF;
END;
If someone could help me out, thanks in advance.
Aucun commentaire:
Enregistrer un commentaire