SQlite: Incomplete input

I passed two fields names in an INPUT command with two Strings instead of 5 or 6 or… and I get the error below:

I checked the Xojo online Documentation for INPUT, and see jnothing related.

Of course, I will check the real number of Columns in my TABLE and add the correct number of Columns in my INSERT statemnt.

I am only curious (I could not do that earlier because I have only one hand to type / my view was very low — I guessed what I was doing), now I can do things correctly and will do.

What is the syntax of your INSERT statement?

It seems like you’re expecting, say, 6 variables and only passing 5. The opposite can also cause an error.

It is the one from the documentation:

INSERT INTO Team (Name, Coach, City) VALUES ('Seagulls', 'Mike', 'New York');

Excepted I use 2 Columns and the TABLE have 8 + 1 COLUMNs (+ 1 stands for the Primary Key).

I will add the other COLUMNs asap. I was in a hurry then and only wanted to add a Record or two to make tests…

This may be reserved to UPDATE.
(some days, thinking is more difficult than others)

1 Like

The syntax you’re showing me is correct.

If the other three missing fields accept NULL, you can perform the INSERT without problems.

If the other three fields require a specific value, incorporate them into the syntax.

Let me know how it went.

1 Like

Apparently, Incomplete input is a wrong error message.

I get it also because I do not have selected a sqlite file to write in (and forget to place a test against Cancel at file dialog selection).

I modify my code, reboot and continue the debud / code change process…

I do not understand how INSERT is meant to work.

I asked elsewhere and get code that use DataBaseRow and add the record as I wanted.

I take that INSERT example.

Time is no more on my side

Insert requires you to provide a value for every field that is defined as ‘Not NULL’

eg table can have 7 columns, if only 3 of them are defined as not NULL, you must provide values for at least those 3. Any that you do not provide values for, will be NULL when you read that data back.

1 Like

Thank you for your answer.

That is what I ended to do, but for some reason, I failed.
(I was at the beginning, so the project is a skeleton. Usually, when I am after writing Records, I come back addins Error Checking and refinements in code, then I add an export Method, then an Import Method - so in case I have to trash the db I can import the previous data, etc.)

So, I used DataBaseRow and it works fine.

I left Xojo 1 hour ago and now I am playing with comics and html (Xojo is not involved there).

I am trying to left my fever to a reasonable temperature (I really hate lost my time searching how to do this or that / searching another project where I already have done that)

At a time, earlier this morning, I realized that my Columns are wrong, so I changed the code, trashed the .sqlite file and run: no new .sqlite file was create !

After a reboot, it was created ! Grrrrrr !

Have a nice Sunday.

1 Like

Oh well