🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Marc E. Kenig Tue, 29 May 1984 15:00
EQUEL/C preprocessor bug
#3
Author: Marc E. Kenig
Date: Tue, 29 May 1984 15:00
52 lines
2380 bytes
<Goodbye-come again>


I have encountered the following bug with the EQUEL/C parser.  It is in a
section of code where I wish to find the next sequence number from a
coded key field. The sequence number is the last two characters. I substring
the right two chars, coerce them to type integer, and then take the 
aggregate max (adding one to get the next sequence number).  Works fine
in QUEL on the INGRES monitor:

##	int seq
		.
		.
	Non-EQUEL-code
		.
		.
##		range of p is problem
##		retrieve (seq=1+max(int1(right(p.tr,2))))
		.
		.

But when pre-processed by eqc, produces:

{IIwrite("range of p=problem");IIsync(0);}{IIwrite("retrieve(seq=1+max(int1(right(p. ");IIwrite(
tr);IIwrite(" ,2))))");IIsetup();while(IIn_get(0)){IIn_ret(&seq,6);if(IIerrtest())continue;

NOTE that the retrieve is broken into 3 IIwrites.  This produces a:

2601 line1 Syntax error on ',', the correct syntax is:
     RETRIEVE [[INTO] relname] (target_list) [WHERE qual] [SORT[BY] attname1
       [:sortorder] {,attname2,[:sortorder]}]
     RETRIEVE UNIQUE (target_list) [WHERE qual] [SORT [BY]
[HIT RETURN]

when the program is run. Note the program does continue...but with seq == 0.
If I change the C program generated by eqc thus:

{IIwrite("range of p=problem");IIsync(0);}{IIwrite("retrieve(seq=1+max(int1(right(p.tr,2))))");
IIsetup();while(IIn_get(0)){IIn_ret(&seq,6);if(IIerrtest())continue;

changing the 3 IIwrites to one containing the whole retrieve, the program
predictably works. 

This is the first EQUEL bug I have run into in over a year of use (albeit
most on VMS).  My 'solution' is, to me unacceptable (what is the possible
value of an unreliable pre-processor).  Does RTI have a uucp node? Who
within ATT is laison?

M. Kenig ["Share and enjoy"],
ATT-IS (consultant), S. Plainfield
bell: (201) 668 3283
uucp: ...!abnjh!cbspt002
Re: EQUEL/C preprocessor bug
#2
Author: bogie
Date: Wed, 30 May 1984 12:48
18 lines
1103 bytes
i believe the solution to your problem is to deactivate variable
substition on tr in p.tr
[i'm assuming you have declared a c variable called tr - there is
where the problem lies]

the retrieve statement would then read:

##		retrieve (seq=1+max(int1(right(p.#tr,2))))

problem is that equel will do variable substition on database,
relation, and field names if a variable has been defined to ingres
with that name (## type cvar  - type declaration).

rona 

r.j.kopp
201-576-6315
phoenix!bogie   [pegasus!phoenix!bogie]
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads