evaluate expression

Database
Enthusiast

evaluate expression

Hi,
i want to do the following in a stored procedure

if (a v_op b) then
...
end if;

where v_op is a variable (can have values like '>=', '<', .....)

Again, for expressions like
SET d = a v_op b
where v_op is a variable (like '+', '-', ...)

How to tell teradata to resolve the operator value and then evaluate?

Thanks,
-srinivas yelamanchili
2 REPLIES
Teradata Employee

Re: evaluate expression

Hello,

Perhaps, you can use dynamic SQL for this or you can use CASE statement and check for variable value and perform the task.

Regards,

Adeel
Enthusiast

Re: evaluate expression

Right now i am using case statement.

The expression is part of stored procedure, but not part of any SQL,
so not sure how to use dynamic sql here.

Thanks,
-srinivas