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
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
  • 713 views
  • 0 likes
  • 2 in conversation