on ‎2023 Jul 22 2:13 PM
Request clarification before answering.
DSP already includes automatically some parts of the function that you don't have to write in the SQL Script, such as the definition of the table it returns, the parameters or the BEGIN/END that encompasses the whole function.
Apart from that, it is already a normal function, you can put the variable DECLARES at the top, use conditionals, etc.
Something that in HANA is:
FUNCTION "XP"."TF_SAMPLE_SUM" ( IP_A INT, IP_B INT)
RETURNS TABLE
(
RESULT INT
)
LANGUAGE SQLSCRIPT
SQL SECURITY INVOKER AS
BEGIN
DECLARE TMP_VAR INT = 10;
RETURN SELECT (:IP_A + :IP_B) * :TMP_VAR AS "RESULT" FROM DUMMY;
END;
In DSP is:
DECLARE TMP_VAR INT = 10;
RETURN SELECT (:IP_A + :IP_B) * :TMP_VAR AS "RESULT" FROM DUMMY;
The table definition and parameters are defined in the graphical interface, not in the code.
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Remove the Begin and End
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 | |
| 2 | |
| 2 | |
| 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.