Skip to Content
avatar image
Former Member

selecting from hdbscalarfunction


I've created a basic scalar UDF, but I'm not able to select from it using SQL for some reason. Does anyone know what is going on?

I'm able to define a .hdbscalarfunction file, activate it, see it in the catalog - but when I select I get this:

14:18:02 (SQL Editor) (dberror) 328 - invalid name of function or procedure: public::thefunc: line 1 col 28 (at pos 28)

Thanks for your help,

1.png (15.4 kB)
2.png (6.9 kB)
3.png (3.2 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Dec 20, 2017 at 04:42 AM

    It's not possible to SELECT from a scalar function, because the scalar function does not produce a row set, like tables, views, table-typed functions or procedures do.

    Any data source in your FROM clause has to produce a row set. That is pretty much fundamental to SQL in general, not just SAP HANA.

    Scalar functions are meant to be used like other built-in functions (e.g. UPPER(), or CURRENT_DATE()) - they provide a result for a single value (a scalar).

    In your example, you should be able to use

         "public::thefunc"(1, 0) 

    All this is of course described in the SAP HANA developer guides (included in SAP HANA Studio and freely available on

    Add comment
    10|10000 characters needed characters exceeded