On the Kuika platform, you can define a variable using the “DECLARE” command in the SQL Editor. This command allows you to specify the name of a variable, its data type and, if necessary, its initial value.
DECLARE @variable_name data_type;
There are two ways to assign a value to a variable:
1. SELECT Assignment:
SELECT @variable = değer FROM table_name;
2. Assignment with SET:
SET @variable = değer;
DECLARE @top1Product nvarchar(256);SELECT TOP 1 @top1Product = productName FROM table_name;
DECLARE @rowCount int;SET @rowCount = (SELECT COUNT(Id) FROM table_name);
On the Kuika platform, you can manually type the “DECLARE” command in the SQL Editor or you can get support from the Artificial Intelligence Assistant.
By activating the “Generate with AI” switch, you can enter a command by specifying the relevant table in the Search Box field. For example:
In this way, you can create your query quickly and easily.