Error with subform

Discuss the database features
Post Reply
kenwong
Posts: 3
Joined: Tue Feb 26, 2019 5:51 pm

Error with subform

Post by kenwong »

I connect Libreoffice (6.1.5.2) Base to a database in PostgreSQL (11.2) via JDBC.

I made two forms with subforms without any issue. Now I get an error with the third form with subform. I created the form and subform by using the Form Navigator, specified the master and slave fields, saved the forms. Everytime when I open the form, the error message pops up, saying:
The data content could not be loaded. ERROR: operator does not exist: integer = character varying Hint: No operator matches the given name and argument types. You might need to add explicit type casts. Position: 92
Further, the SQL Status is 42883.

"Replace named parameters with '?'" has been ticked.

Thanks in advance for any help.
Libreoffice 6.1.5.2 on Windows 10
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Error with subform

Post by Villeroy »

With form-subform relations you should use named parameters in "parsed mode". These relations don't work in "direct SQL mode" where the SQL is interpreted by the database backend.

The SQL syntax in parsed mode is the same syntax as used with the built-in HSQL, for instance:
SELECT "Case sensitive name in dbl-quotes" FROM "Table" WHERE UPPER( :Named_Parameter ) = UPPER("Field Name")
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
kenwong
Posts: 3
Joined: Tue Feb 26, 2019 5:51 pm

Re: Error with subform

Post by kenwong »

Thanks Villeroy.

I forgot to give more details in my first post. There was no the error with only the main form in place, and even up to the point where I added the sub-form and I specified the underlying table for the sub-form. Once I input the master and slave fields in the form Properties, the error was thrown out when I opened the form for data input.

I have just resolved the issue. Previosly I input only the column names in the master and slave fields. Now I include the table name before each of the column names, like "table_name"."column_name", and the form opens with no issue.

Hope the above would help those who might be faced with the similar problem.
Libreoffice 6.1.5.2 on Windows 10
Post Reply