cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Incorrect ; placement #SAPHANA #SQLSCRIPT

venkatesh_veera2
Participant
0 Likes
1,173

Hi All,

I'm trying to create a table function in sap Hana.

the requirement is like I need to add an extra column and the condition is when the department name is 'IT' it needs to write Information technology in the new column etc.

I wrote the same code in SQL console it worked fine but in the table function its throwing error.

SQL Console:

Table Function:I tried removing; after from but it did not work.

Please let me know where am I doing a mistake. I know its easy for many people but I just started learning.

Thank in advance.

Venkatesh

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Likes

write case statement in closing brackets ,

(CASE WHEN "DEPTNAME"='IT' THEN 'INFORMATION TECHNOLOGY' WHEN "DEPTNAME"='HR' THEN 'HUMAN RESOURCE' ELSE 'ADMINISTRATION' END) DEPTDESC

FROM "SCHEMA_NAME"."TABLE_NAME";

END;

deodutt_dwivedi
Active Participant
0 Likes

Hi,

See if there is a data type mismatch between return table declaration.

Regards,

Deo