Thanks for the link
I'm not highly qualified on the development side.
I wrote a c simple c code which can send operating system commands as
int main (int argc, char** argv)
and compile it with "cc OS2.c -o OS2" command and copied it into sqllib/function directory.
Then I create an external stored procedure as
CREATE PROCEDURE OS_COMMAND (IN COMMAND VARCHAR(20)) EXTERNAL NAME 'OS2!main' FENCED LANGUAGE C PARAMETER STYLE GENERAL;
When I call the procedure; I'm getting DARI errors.
db2inst1@DBTEST:~/sqllib/adm> db2 "call OS_COMMAND('ls')"
SQL1131N DARI (Stored Procedure) process has been terminated abnormally.
The examples that I find in sqllib/samples/c/spserver.c code are too complicated for me.
Are there any simple examples for creating external stored procedures?