CONVERT @scalar variable SQL Server to Postgres/pgAdmin

24 Views Asked by At

I have SQL Server script that has scalar variable that can be used in single execution scripts

Just want to ask is there any way I can declare scalar variable like in PostgreSQL.

See sample code below:

DECLARE @samplevar varchar(max)= null
set @samplevar = 'test'
select @samplevar

PS: This is not in function nor stored procedure. This is TSQL execution

Thanks

0

There are 0 best solutions below