[comp.databases] UNIFY compatibility ... argh!!!

len@geac.UUCP (Leonard Vanek) (03/30/87)

In article <382@sdd.UUCP> root@sdd.UUCP (Root) writes:
>
>	ARGH!!  I have discovered what appears to be an incompatibility
>between UNIFY and c++!  There is a function in UNIFY called delete(),
>which deletes a record which conflicts with the c++ reserved word
>delete!!!!		Anyone know of how I can deal with this?  (I only
>have object for UNIFY!).

In fact, "delete" is a key word of SQL, so any DBMS which uses
SQL may have trouble being used with C++. Since we do intend to
combine INGRES/SQL with C++ we certainly intend to work on this
problem.

A possible solution is to modify the C++ compiler, but this would
sacrifice the portability of the resulting source files.

To get around the problem with the Unify FUNCTION "delete()" you
could just write another function which does nothing but pass its
parmeters through to delete and pass back delete's return value.
This function should be compiled as ordinary C and linked to the C++
main program. Thus, the C++ compiler will never see the call to
"delete()" and will not get confused.

However, for us SQL users there is another problem. Can a C++
program be passed through the various SQL preprocessors? If yes,
the key word "delete" in a C++ program will confuse the SQL
preprocessor. If not, the SQL code may have to be segregated in C
subroutines in order to preprocess it, and the problem of the two
deletes goes away because no source code ever goes through both
the C++ compiler and the SQL preprocessor.

Does anyone else have thoughts on this problem? Note that I have
added comp.databases to the distribution list.
---------------------------------------------------------------------
Leonard Vanek                       phone (416) 475-0525
Geac Computers International
350 Steelcase Rd. West
Markham Ontario L3R 1B3
Canada

allbery@ncoast.UUCP (04/08/87)

As quoted from <607@geac.UUCP> by len@geac.UUCP (Leonard Vanek):
+---------------
| However, for us SQL users there is another problem. Can a C++
| program be passed through the various SQL preprocessors? If yes,
| the key word "delete" in a C++ program will confuse the SQL
| preprocessor. If not, the SQL code may have to be segregated in C
| subroutines in order to preprocess it, and the problem of the two
| deletes goes away because no source code ever goes through both
| the C++ compiler and the SQL preprocessor.
| 
| Does anyone else have thoughts on this problem? Note that I have
| added comp.databases to the distribution list.
+---------------

Informix ESQL/C won't... providing that C++ will accept the generated C
code.  ESQL/C consists of statements from a $ in column 1 to a semicolon;
it only scans from a $, so variables to be known to ESQL/C have to be
declared with

$ long n ;

or similar.  Thus, fancy C++ types probably can't be made visible to ESQL/C.
The generated code still has "delete" in it, but in a quoted string.

Note:  I only know this much from analyzing ESQL/C intermediate code from
Informix-4GL.  It's the only way I can explain the code I see generated.
Any ESQL/C gurus want to comment?

++Brando
-- 
 ____   ______________
/    \ / __   __   __ \   Brandon S. Allbery		|  QUOTE OF THE DAY:
 ___  | /__> /  \ /  \    aXcess Company		|
/   \ | |    `--, `--,    6615 Center St. #A1-105	|	  `
|     | \__/ \__/ \__/    Mentor, OH 44060-4101		|
\____/ \______________/   +1 216 974 9210		|
cbatt!cwruecmp!ncoast!allbery ncoast!allbery%case.CSNET@relay.CS.NET BALLBERY
	    (UUCP)                      (CSNET/Internet)             (MCIMail)