Re: Forms and Cursors
Posted in 1994
Topics: Installation, Setup & Upgrades, Connectivity: ESQL/C, 4GL & Embedded SQL
In article <37a88r$b7j@emory.mathcs.emory.edu>, Jonathan Leffler <johnl@informix.com> wrote: >} >}When I use C functions with Forms, and use cursors in these functions and >}try to compile them with cperf, there are multiple definitions of symbols, >}such as _iqlocate_cursor, _iqcdcl >}Without using cursors, everything works perfectly. >}But only one string like $declare cursor ... > >I diagnose that you are using 4.1x ISQL and 5.0x ESQL/C. This mixture >doesn't work -- as you've just found out. You either have to use 4.1x >ESQL/C, or upgrade all the way to 6.0x ISQL and ESQL/C. Jonathan, I don't think the version mismatch is the only problem, although it might contribute to the problem. I have observed the same problem using OnLine 5.02.UC1 and ESQL/C 5.02.UC1. If I used local, simple SQL statements (e.g., "$select ... into ...") in the C functions that I tried to compile into PERFORM using the 'cperf' program, everything compiled fine. However, when I tried to include some of the following statements: $database ... $declare ... cursor ... $fetch ... and others, I got the same "symbol multiply defined" error as mentioned above. I took from this the following conclusions about PERFORM, OnLine 5.02, and ESQL/C 5.02: 1. In C functions called from PERFORM, you are restricted to the same database declared in the PERFORM "database" statement. 2. You may not use any type of cursor in such a C function, because it would apparently confuse PERFORM's internal cursor logic. 3. Any of {$INSERT, $SELECT, $UPDATE, $DELETE} in such a C function is permissible; anything else is potentially dangerous. (This may not be strictly true for all cases, but it's the rule we use.) Strangely, none of these restrictions applied to ACE, although the calling conventions for ACE for external C functions are similar. ...gwr... -- George Rapp Mail: gwr@metronet.com (home, preferred) - grapp@cps.cio.eds.com (work) Phone: 214/604-1036 (voice - work) 214/604-1126 (fax) Babe Ruth (career): 22 seasons, 714 home runs ... and 1,330 strikeouts.