Skip to Content
0
Former Member
Nov 19, 2012 at 08:21 PM

Assign Value to Scaler variable from select statement. How?

28 Views

In Sybase ASE I can assign a value to a vaiable as follow :-

DECLARE @foo int

select @foo = max(foo) from foo_table

I'm having trouble doing this in SQLScript.

I know I can assign a value to a scaler like this in SQLScript :-

dayofweek := WEEK( CURRENT_DATE ) ;

But I cannot work out the syntax to assign a value from a select statement to a scaler as per ASE.