31
Views
2
Comments
SQL error appear
Question
Application Type
Reactive

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).

2026-02-26 06-29-24
Rahul
 
MVP

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

2021-01-19 14-07-32
Tom Zhao

@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

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.