Expand my Community achievements bar.

SOLVED

update query in AEP query service

Avatar

Level 2

While using update statement in query service getting the below error before the dataset, Please could anyone have solution?

 

What is MODEL here?

 

 ErrorCode: 42601 queryId: 9fad4729-3cf8-4832-ba50-65763ca26fd8 Syntax error encountered. Reason: [line 1:8: missing 'MODEL'

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 2

Hi @Pareek1 , below is the query i used and it worked. 

 

INSERT INTO dataset_name SELECT struct(customerid, first_name, lastname, email ) AS _spnam from
(
select 1 AS customerid, _spnam.first_name as first_name, _spnam.lastname as lastname, struct(_spnam.email.address as address) as email from dataset (from which you want to get the attributes)
)

View solution in original post

4 Replies

Avatar

Employee Advisor

@Balraj_M I looked into previous tickets and internal references and ErrorCode: 42601 seems usually a syntax error. I saw an example where a user was using a SELECT on 'userAgentString' where 'Model' was a device name / brand but I guess the 'Model' in question will very much depend on the nature of your query. 

 

I also found https://experienceleague.adobe.com/en/docs/experience-platform/query/sql/syntax where data model is mentioned a few times, see if that helps. If not, I'd advise you raise a Support ticket with the full query so the team can take a closer look.

 

Avatar

Level 2

Hi @Balraj_M ,
Did you solve the issue, If so, please tell how were you able to solve.

Avatar

Correct answer by
Level 2

Hi @Pareek1 , below is the query i used and it worked. 

 

INSERT INTO dataset_name SELECT struct(customerid, first_name, lastname, email ) AS _spnam from
(
select 1 AS customerid, _spnam.first_name as first_name, _spnam.lastname as lastname, struct(_spnam.email.address as address) as email from dataset (from which you want to get the attributes)
)