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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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