| 发表于:2007-09-12 16:54:251楼 得分:0 |
动态sql的话,你需要付权限,比如select等 string stringvar, sqlstatement integer intvar sqlstatement = "select emp_id from employee" prepare sqlsa from :sqlstatement ; describe sqlsa into sqlda ; declare my_cursor dynamic cursor for sqlsa ; open dynamic my_cursor using descriptor sqlda ; fetch my_cursor using descriptor sqlda ; // if the fetch is successful, the output // descriptor array will contain returned // values from the first row of the result set. // sqlda.numoutputs contains the number of // output descriptors. // the sqlda.outparmtype array will contain // numoutput entries and each entry will contain // an value of the enumerated data type parmtype // (such as typeinteger!, or typestring!). choose case sqlda.outparmtype[1] case typestring! stringvar = getdynamicstring(sqlda, 1) case typeinteger! intvar = getdynamicnumber(sqlda, 1) end choose close my_cursor ; | | |
|