Advanced Query, Insert from Select from {external entity}

Advanced Query, Insert from Select from {external entity}

  

I'm trying to insert records into an outsystems entity with records  from from an external SQL Server Database.  I created a .net extension and included the external table in the extension.  I can query the entity with a simple query and an advance query, but when I try to add the insert into {entity Name}, I get this message.

query cannot be simultaneously using Entities (Platform Database) and the following Foreign Entities: PLD_UNITXREF_VIEW

Hello Dean,

Try to use the fields instead the letter A, for example INSERT INTO {table} SELECT {table}.* FROM {table} 

regards.

Dean wrote:

I'm trying to insert records into an outsystems entity with records  from from an external SQL Server Database.  I created a .net extension and included the external table in the extension.  I can query the entity with a simple query and an advance query, but when I try to add the insert into {entity Name}, I get this message.

query cannot be simultaneously using Entities (Platform Database) and the following Foreign Entities: PLD_UNITXREF_VIEW

Hi Dean,

Like the error message states, you cannot mix External Entities and regular Entities. This is enforced by the platform for performance reasons.

You will need to separate this in a query to get your data from the External Entity and cycle through its result set (using the For Each tool, for example) and use the Entity Actions to create new records of the regular Entities.