| Calling stored procedures with supported databases / Stored procedure call with Oracle MySQL | |
The following example shows how to retrieve the return value of a stored function with MySQL:
MAIN
DEFINE n INTEGER
DEFINE c VARCHAR(200)
DATABASE test1
EXECUTE IMMEDIATE "create function func1(p1 integer)"
|| " no sql begin"
|| " return concat( 'Value = ', p1 );"
|| " end;"
PREPARE stmt FROM "select func1(?)"
LET n = 111
EXECUTE stmt USING n INTO c
DISPLAY c
END MAIN