I am having some problem with a slightly complex UDF written in C on AIX (DB2 v7.2). I am calling DB2 APIs DB2GetSnapshotSize & DB2GetSnapshot from the C UDF. Both the functions return SQLCODE -487. Error is SQL0487N Routine "<routine-name>" (specific name "<specific-name>") attempted to execute an SQL statement. Apperantly, the API calls are taken as SQL calls. As NO SQL has to be specified in all External UDFs, these calls are being rejected. Is there a way we can use these DB2 APIs in UDFs?