Skip to Content
avatar image
Former Member

Whether all table functions are read only?

When I try to use create or insert statement in a table function I always get error info: : EXPLAIN PLAN and CALL statement are not allowed; DDL is not supported in the READ ONLY procedure/function...

I just wonder how can I use create or insert statement in table function or there cannot use such statement in table function at all?If all table function are read only and whether I can set this property

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Jan 09, 2017 at 10:37 AM

    As the documentation clearly describes (CREATE FUNCTION). This is not possible. For a user defined function all DDL and DML statements are not allowed. You can do this in SQLScript only with procedures.

    Regards,
    Florian

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 09, 2017 at 10:24 AM

    Yes, table function are read-only (source : HA300).

    Regards,

    Frederic

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 04, 2017 at 03:43 PM

    Sorry, but this is just bad. It would be immensely useful to have table functions at least be able to call a procedure. Why this is not possible is beyond me and very frustrating.

    Add comment
    10|10000 characters needed characters exceeded

    • You're saying that you cannot evaluate the OUT parameter "userChatID" in your calling code? Why's that?

      Why is there the need for an additional SELECT in your code?

      Turning a simple SELECT into a write operation certainly is not more elegant - it would just add confusion about what your code is doing.