SQL Status: 37000 Error code: -11 Unexpected token: Type in statement ["Type"]

Uing Version: 7.4.7.2 (x64) / LibreOffice Community
Build ID: 723314e595e8007d3cf785c16538505a1c878ca5
CPU threads: 8; OS: Windows 10.0 Build 22621; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded


I receive this error code when opening the form created from Getting Started Guide. The list box does not show up when clicking the payment type boxes. How do I fix this?

Have had a look at the guide. This should be the SQL code:

SELECT "Type" FROM "PaymentType"

There are so much list boxes for “Type”… Might be there is missing in data tab of the list box bounded field has to be set to ‘0’.
Please open such a list box and show the content of tab “Data”

Thank you for replying. Here is the properties of the form box requireing list box entries


So I have it exactly the way the getting started guide said to do, so not sure what else is causing the issue?

Just from first view: You have a second set of outer quotation marks " around the statement. I’d try to remove them…

1 Like

@andieguess : Could you add the file here? There is more than one list box - all should have the same content.
@Wanderer : Quotation marks at start and end in this box for list content will show: It is the first value of the array. It won’t be send as a part of the SQL-code.

My_Practice.odb (59.5 KB)

I named it a bit different from the guide. I removed the quotations, they came back after Iclicked ellipses and set the table to collect the list box from.

One field with a wrong entry:
Have a look at the field “Payment Type” in the table control (last field). SELECT is missing and the table is called without a blank. By the way: I would never use special signs like blanks in a name for table, query, form or report.

1 Like

I went to the table in the form and it is correct the SELECT is not there. Thank you for taking the time to review my practice file. I corrected it, but issue remains. I have no experience with data bases, but I want to start and go forward with learning it. I’ve ran my businesses with adhoc google workspace, excel and an accounting program. I want to do better. The Getting Started Guide is what I was following so I could learn the program. So the Getting Started guide recommended putting a space in the names. Is there a particular reason a space would not be desired in the names?

So the error I am getting is making me think the table with the “list box” can not be found. What I did, " the getting started guide did not give complete instructions on exactly how to go about creating the “table” for the “List Box” I went to the Base Guide for the answer on creating the List Box, there isn’t information there that actually gives the information on creating a listbox or connecting it to a table for reference ( or at least I did not find it with a search of the document) So I assumed that it needed to be in the Payment Type Table. Is this correctly how to do that? I created a file before this one and created a simple table with the names listed, but that didn’t work either. I know it is because I am doing something wrong, I just don’t know where it is I have messed up.
I just reviewed the instructions and I am correct in the assumption that when assigning the SQL code I have to select a table for the code to look the contents of the table, so an extra table isn’t required. However, this error is it can’t find the list box…May I scream?

I went back in the form, ( Reviewed each “Payment Type fmt” I was missing the sql on the last one and had sql native there, I corrected. I went through and added a space to Payment Type in the sql because it was missing. The error is gone, but I still don’t get a selection of the payment type as shown here

Which issue? I have changed it in you example, added the space and it worked:

SELECT "Type" FROM "Payment Type"

Using of spaces: I have read a little bit in Getting Started. Must be updated: The table should be saved as Payment Type (page 302, also 309) and is called PaymentType later (page 309, 310, 311) and also in the code: SELECT "Type" FROM "PaymentType".
And exactly this, what happens there, is the problem: You will need exactly the same names. Have seen people who added a space inside a field description and SQL couldn’t find the field. Or people, who appended a space while creating a a field for a table - and you couldn’t find the reason why query didn’t work.

Next step will be: The table you created is wrong. On p. 302 I could read a table should be created with 2 fields. This fields are called “Type” and “PaymentID”. ‘Cash’, ‘Dan’ and ‘Kevin’ should be entries the field “Type” so you could select this entries in the list box. You could delete the 3 field you appended. Open the table for adding values. Write ‘Cash’ in field “Type” and ‘1’ in field “PaymentID”. This will be the first entry in the field. Do the same with ‘Dan’, ‘2’ and ‘Kevin’, ‘3’ and you could chose one of this types.

I don’t know why the content for “Type” is something like ‘Kevin’ or ‘Dan’. Also I don’t know why there is a field “PaymentID”. “Type” could also be the primary key, because the content, which should be saved in all other tables in this example, is “Type”.

I would prefer easier example like you could read in Base Guide. Don’t know if the translation shows all the same as I wrote for the German Base Handbuch…

1 Like

I’ve been changing all sorts of tables etc. I no longer have the error but can’t get any of the listboxes to give me a name to select as in the example of getting started. I’ve went with the bas guide and added several things…is there a guide that actually gives a person step by step what to do to build a database? I’ve followed the getting started guide to only end up with errors. I’ve followed the base guide and the solutions or instructions there do not work for the above database. I’ve noticed in the guides that it insinuates some type of table or list box being created as in this example


We are going to assume that the student is following along the guide and gets to this point, guess what no instructions were given how to set up tblSports the fields are not shown as to how to do that. But let’s go with said student then creates the alleged table and now what to do? Are all the perimeters " ID integers, text etc set correctly? Is there an ID or what? Well who knows because the instructions are not written in a way a “student” or someone who is trying to learn the software would understand. ie…flow of work to create said database is not complete. Interesting.

Thank you, when I come back in I will apply the solutions you gave. Glad to see you agree with me, I was some type of frustrated. LOL

You have created a table tblSports. Open this table for input data. Write the data into this table as it has been shown in the table.

The above resolved the issues as posted. There is one thing I need to request information on and that is after making these changes, the form does not list the results in the table on the form as shown:

@RobertG is there something I may have messed up in the links that show the records in the subform table? I am so sorry for having to ask more from you. But I really appreciate the level of intelligence you display here. Thank you so much for helping me. edited to add, the table has the entries as shown above, but thetable in the form is also suppose to show the record correct?

@andieguess,
I took a look at the guide and totally understand your frustrations.
the instructions are incomplete.
the example database is dysfunctional and its structure is shambolic with zero regard to normalisation.
.
it’s pointless to post a fix for specific issues because the original is an example of how not to design a database.

Thank you! So with that said, do you know of a proper tutorial that could show me how to create a database? I want to eventually create a CRM that contains information about all of my customers that I can quickly find every contact I’ve had with them. I currently keep simple record in a spreadsheet. I would also like to create an accounting database.

@andieguess : Have seen the screenshot, which doesn’t show any entry in table control. When testing your example I will get the content here.
Open the form for editing, not for input data.
Mark the table control → right mouse click → control properties → font. Change the font from default font to any other font. Also change the width of the font.
First screenshots you have made will show the data - and suddenly there aren’t shown data? Might be something with refresh of the screen …

@andieguess,
I personally know nothing about tutorials but highly recommended by many and utilising both the BASE module and HSQLDB embedded is:
From Newbie to Advocate in a one, two… three!