Skip to main content
Balraj_Maskale
Level 2
July 22, 2024
Solved

update query in AEP query service

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'

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Balraj_Maskale
Balraj_MaskaleAccepted solution
Level 2
August 27, 2024

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

4 replies

Tof_Jossic
Adobe Employee
Adobe Employee
July 22, 2024

@balraj_maskale 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.

 

Translate
Balraj_Maskale
Level 2
August 27, 2024

Thanks @tof_jossic  for your response.

Translate
Level 2
July 31, 2024

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

Translate
Balraj_Maskale
Balraj_MaskaleAuthorAccepted solution
Level 2
August 27, 2024

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

Translate