BookmarkSubscribeRSS Feed
sarahzhou
Quartz | Level 8

Hi,

 

When I try to update a table form a database:

 

EXECUTE(
UPDATE ##TB_HIST
SET KEY=(SELECT DISTINCT KEY FROM TB_DEMO WHERE KEY =P_KEY ),
ID=(SELECT ID FROM TB__DEMO WHERE KEY =P_KEY)
WHERE UPPER(TYPE_TX)='Disney'
) BY SQLSERVER;

 

I get the error :

 

ERROR: CLI execute error: Subquery returned more than 1 value” and that “This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression”.

 

Kindly advise.

Thanks!

1 REPLY 1
LinusH
Tourmaline | Level 20

Since you whole code executes in SQL Server, this issue should be directed to a SQL Server forum instead.

Data never sleeps

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 632 views
  • 0 likes
  • 2 in conversation