I want to insert records into the Employ table based on a count.
The Count parameter specifies how many records to insert.
The Key parameter provides the value for a column.
Example: If ABC is the Key value, it should be inserted into the Employ Name column of the Employ table 10 times (as specified by the Count parameter).
Hi @Dilmi Amar ,
You don't need to use Declare statement. Also your insert query is wrong.
It should be-
WHILE @i < @Count
BEGIN
INSERT INTO {ProductInformation} ({ProductInformation}.[ProductName])
VALUES (@key)
SET @i = @i+1
END
i variable is integer type and default value is 0 and it will increase so no need to declare.
Use in this way it will run without error.
Regards
Rahul
@Dilmi Amar
This is a bit off topic, but OutSystems recommends using Entity Actions instead of SQL whenever possible to update Entity's data.
REGARDS