dimanche 13 octobre 2019

Syntax error while trying to declare a variable in sql and using if-else statement. - syntax error at or near "VARCHAR"

Below code shows error near datatype Varchar and also near if statement - syntax error at or near "VARCHAR"

i have tried checking case sensitive and assigning value.

Declare
Userstate VARCHAR := 'Active' ;
begin
if u.disabled_at is null
then
Userstate = 'Inactive';
else
Userstate = 'Active';
end if
end

i have to declare a variable and use it in if-else statement.

Aucun commentaire:

Enregistrer un commentaire