cancel
Showing results for 
Search instead for 
Did you mean: 

How to save the result of CE-function in a scalar variable?

Former Member
0 Kudos

Hi all,

I wonder if it is possible to return the result of a CE-function (in this case a max() aggregation) into a scalar variable instead of a table variable.

It works with SQLScript (select .. into variable..), but using a function could increase the performance.

Any experiences?

Thank you,

Fabian

Accepted Solutions (1)

Accepted Solutions (1)

lbreddemann
Active Contributor
0 Kudos

Hello Fabian,

nope - SELECT INTO is the only way here.

And the performance impact should be rather small, as you're dealing with a single value, aren't you?

In case this is part of a loop-logic or something similar, then it usually pays to spend some time reconsidering if the loop cannot be replaced with a set-approach (and using the CE functions for that).

- Lars

Answers (0)