(no subject)

"James B. Byrne via Aubit4gl-discuss" <[email protected]> Thu, 24 Jun 2021 10:07:29 -0400
Newsgroups gmane.comp.lang.4gl.aubit.general
Message-ID <[email protected]>
This is an coding exercise program that I created earlier and which worked at
the time.  In fact, I have a binary from that period which still works. 
However, I can no longer compile it so that I get a functioning program.

When I compile I see this.  I cannot recall now if this was always present of
if it is something new.  I suspect that the compile warning has always been
present as there is a sequence attached to customer_num.

$ 4glpc ex6.4gl -o ex6.4ae
Warning : Serial column dropped from UPDATE statement (serial columns cannot be
updated) @ line 575

$ ./ex6.4ae

When I run the program the screen displays.  When I try to select select any
customer by any value, or all customers, and press <esc> I see this:

Err:Program ./ex6.4ae stopped at 'ex6.4gl', line number 123.
Error status number -30038.
Field name not found.

4gl function call stack :
    ex6.4gl (Line 63) calls  browse_custs(selstmt=SELECT * FROM customer WHERE
customer.customer_num=111)
    MAIN


Line 123 contains this:

DISPLAY BY NAME gr_customer.*

gr_customer is defined like this in the program:

    gr_customer               RECORD LIKE customer.*,
    gr_workcust               RECORD LIKE customer.*

and like this in the PostgreSQL schema:

CREATE TABLE IF NOT EXISTS public.customer
(
    customer_num integer NOT NULL DEFAULT
nextval('customer_customer_num_seq'::regclass),
    fname character(15) COLLATE pg_catalog."default",
    lname character(15) COLLATE pg_catalog."default",
    company character(20) COLLATE pg_catalog."default",
    address1 character(20) COLLATE pg_catalog."default",
    address2 character(20) COLLATE pg_catalog."default",
    city character(15) COLLATE pg_catalog."default",
    state character(2) COLLATE pg_catalog."default",
    zipcode character(5) COLLATE pg_catalog."default",
    phone character(18) COLLATE pg_catalog."default",
    oid integer NOT NULL DEFAULT nextval('customer_oid_seq'::regclass),
    CONSTRAINT customer_pkey PRIMARY KEY (customer_num),
    CONSTRAINT customer_state_code_fk FOREIGN KEY (state)
        REFERENCES public.state (code) MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION
        NOT VALID
)
WITH (
    OIDS = FALSE
)
TABLESPACE pg_default;

The program code is in a git repo. I do a checkout the commit from February,
when the program worked, and recompile that then I get the same result.  The
program compiles but it fails doing a lookup on customers.

I am unable to guess what field the select if complaining about.  Any
suggestion as to how I can debug this would be appreciated.

-- 
***          e-Mail is NOT a SECURE channel          ***
        Do NOT transmit sensitive data via e-Mail
   Unencrypted messages have no legal claim to privacy
 Do NOT open attachments nor follow links sent by e-Mail

James B. Byrne                mailto:[email protected]
Harte & Lyne Limited          http://www.harte-lyne.ca
9 Brockley Drive              vox: +1 905 561 1241
Hamilton, Ontario             fax: +1 905 561 0757
Canada  L8E 3C3