on 2018 Sep 09 3:21 PM
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
Request clarification before answering.
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;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
See if there is a data type mismatch between return table declaration.
Regards,
Deo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 12 | |
| 9 | |
| 7 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.