Version 6.1.1 or earlier.
Error codes and messages have been changed in version 6.3.1.
The following error occurs when using the function in the SELECT statement.
In version 6.3.1, error codes and messages have been changed as follows.
The description of the error can be checked using the altierr utility as follows.
# Version 6.1.1 or earlier
When using a function within a SELECT statement, the function must contain only the SELECT statement.
If the function includes INSERT/UPDATE, the above error occurs.
Functions used within the SELECT statement must contain only the select statement.
# Example of where an error occurs when a function including an insert statement is used in a SELECT statement
# Example of executing the above function using execute statement
Executed successfully in the execute statement.
# Example that is successfully executed when the above function is used in the SELECT statement after removing the insert statement to use it in the SELECT statement.