sqlvectorwise

How to declare variable in vectorWise like SQL Server?


I am new to VectorWise database.

I need to declare variable and pass value in it same like we do in a SQL Server database. Please help me how to do this in VectoreWise database. I am using Squirrel as SQL client.

I need to do it like we do in SQL Server:

Declare @name varchar (100)
set @name ='ABC'
select @name

Output: ABC


Solution

  • I am not particularly familiar with Actian Vector, so I'm not sure if it has a scripting language. I don't see declare as a supported statement.

    If you only need a parameter in a single select, you can use a CTE. For your example:

    with params as (
          select 'ABC' as name
         )
    select params.name
    from params;
    

    I'm not sure if this helps you, but it might.