|
|||||||
QTIPS - Embedded SQLMark Hirst the author of the excellent graphics routines on the current diskette writes as follows "The embedded SQL statement EXEC SQL SELECT CLI, SUM(RES_T), SUM(CALL_T) INTO :RECORD FROM CALLS WHERE DATE BETWEEN :START_DATE AND :END_DATE GROUP BY CLIENT END EXEC should work fine and yet just as it seems to be ready to report issues a message saying that it cannot sum non-numeric data! After changing the dictionaries and so forth, nothing could stop these frustrating messages, even when the RES_T and CALL_T columns had been redefined as INTEGER. During my investigation I went back to TCL and used the equivalent SQL there. As the statement was executed, the "Compiling Protection Code" message appeared and the statement worked - the same one! The Compiling Protection Code message is triggered when a change in the dictionary is detected and an SQL statement is attempted. It appears that no such trigger takes place when executing embedded SQL My conclusion is that the non-numeric error in this case really meant a discrepancy in dictionary type in the definition of the field and the Protection Code. The solution is to run an SQL statement from TCL or SQL window to force the Protection Code to be recompiled - then your embedded SQL should work." It seems possible that this was caused by PROTECT.MFS not being attached to the file thus not keeping %PROTECT_SPEC% in sync with the dictionary definition. To avoid this ensure that PROTECT.MFS is installed on all files on which it is intended to do embedded SQL. (Volume 3, Issue 3, Page 10) |
|||||||
| |||||||