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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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