#if defined(__STDC__)||defined(__cplusplus)
QUERY(TPSVCINFO *rqst)
#else
QUERY(rqst)
TPSVCINFO *rqst;
#endif
{
/* declare section */
................
/*定义接收变量与光标变量*/
EXEC SQL BEGIN DECLARE SECTION;
sql_cursor sys_cursor;
.......
EXEC SQL VAR error IS STRING(ERRINFO_LEN);
EXEC SQL END DECLARE SECTION;
......
transftemp =(FBFR *)rqst->data;
transf = (FBFR *)tpalloc("FML32",NULL,10240);
if (transf == (FBFR *)NULL)
{
tpreturn(TPFAIL,0,(char *)transf,0L,0);
}
Finit(transf,(FLDLEN)Fsizeof(transf));
/*分配关闭内存*/
EXEC SQL ALLOCATE :test_cursor;
/*执行存储过程*/
EXEC SQL EXECUTE
BEGIN
proc_query(:test_cursor,:error,:iRet);
END;
END-EXEC;