Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I created a similar demo to yours and it worked well. Thanks I stand corrected on the serials. Then I created a similar test but replaced SERIAL with uuid:

CREATE TABLE public.sales2 ( c_uuid uuid PRIMARY KEY DEFAULT uuid_generate_v1(), company character varying(25) );

CREATE TABLE public.sales2_items ( c_uuid uuid PRIMARY KEY DEFAULT uuid_generate_v1(), sales2_uuid uuid NOT NULL REFERENCES public.sales2(c_uuid), item_name character varying(25) NOT NULL );

In base when I look at the table design it identifies the uuid columns as type MEMO.

I created a sales2 record and all worked well in the table view. Then created a 1:M form and could add child records.
Now things got strange. The first time I created a new parent record in the form it wouldn't allow me to create a child. The second time I tried to create a parent record it gave me this error when I tabbed into the child control.

Error code: 1

pq_driver: [PGRES_FATAL_ERROR]ERROR: invalid input syntax for type uuid: "uuid_generate_v1()" LINE 1: ..." WHERE ( "public"."sales2_items"."sales2_uuid" = 'uuid_gene... ^ (caused by statement 'SELECT * FROM "public"."sales2_items" WHERE ( "public"."sales2_items"."sales2_uuid" = 'uuid_generate_v1()' )')

It appears that Base is sending the uuid command with single quotes ('uuid_generate_v1') when it should not be quoted since it is a function.

Then if I close the form and re-open it, now the form will allow me to add child records to the previously added parent record.

Is there a way to manually modify the update sql command? Or is there a way to get the parent form the save the record properly when I then tab to the child record once the parent form is modified?

Thanks, Phil