DECLARE DBName VARCHAR(100); ApplicationURL VARCHAR(100);
BEGIN
select NAME into DBName FROM v$database;
IF DBName = 'WAMDEV' THEN ApplicationURL := 'http://srpwam10:9080/maximo';
ELSIF DBName ='WAMDEVPJ' THEN ApplicationURL := 'http://srpwam10:9080/maximo';
ELSIF DBName = 'WAMTST' THEN ApplicationURL := 'http://wamtest/maximo'
ELSIF DBName = 'WAMTSTPJ' THEN ApplicationURL := 'http://wamtest/maximo'
ELSIF DBName = 'WAMQA' THEN ApplicationURL := 'http://wamqa/maximo'
ELSIF DBName = 'WAMQAPJ' THEN ApplicationURL := 'http://wamqa/maximo'
ELSE DBName = 'WAMP' THEN ApplicationURL := 'http://wam/maximo'
END IF ;
DBMS_OUTPUT.PUT_LINE(ApplicationURL)
END
It gives me error: ORA-06550: line 9, column 7: PLS-00103: Encountered the symbol "ELSIF" when expecting one of the following:
- & = - + ; < / > at in is mod remainder not rem
<> or != or ~= >= <= <> and or like like2
like4 likec between || multiset member submultiset
- 00000 - "line %s, column %s:\n%s" *Cause: Usually a PL/SQL compilation error.
;
terminates statements, meaning yourif
terminates after the first "then", leavingelsif
a naked/illegal usage. – Marc BELSIF
on line 9 because there isn't a semicolon at the end of line 8 – Alex Poole