cancel
Showing results for 
Search instead for 
Did you mean: 

Issue in generating multiple values

Former Member
0 Kudos

Hi all,

I have a requirement like I have to select  IP for a particular Employee Number. If the IP is null then I want every IP from a different table.

I created the following statement for understanding.

select

  case when (select

  ip_main_id

  from "SPEND"."FACT_DATA_EXCEPTIONS_TMX"

  where employee_number = '583853') is not null

then (select

  ip_main_id

  from "SPEND"."FACT_DATA_EXCEPTIONS_TMX"

  where employee_number = '583583')

else (select

  iou

  from "_SYS_BIC"."Spend/CV_CLAIMS_TREND_DASHBOARD_IOU" )

end

from dummy

But I am getting error as

"

Could not execute 'select case when (select ip_main_id from "SPEND"."FACT_DATA_EXCEPTIONS_TMX" where employee_number = ...' in 1.041 seconds .

SAP DBTech JDBC: [305]: single-row query returns more than one row:"

Because "_SYS_BIC"."Spend/CV_CLAIMS_TREND_DASHBOARD_IOU" contains more than one IOU.

Is there any way I can create the above query in HANA or create a procedure.

Regards,

Nakul Kothari

+919987039379

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member182302
Active Contributor
0 Kudos

Hi Nakul,

This Query:


select ip_main_id from "SPEND"."FACT_DATA_EXCEPTIONS_TMX"

where employee_number = '583583'

Is giving more than one value and hence you are getting that error. So use count statement to check if there are records and then you can do what you required.

Regards,

Krishna Tangudu