Help - MYSQL and Swi Prolog

It looks like the ODBC connection is working based on

ERROR: ODBC: State 42522: [MySQL][ODBC 8.0(w) Driver][mysqld-5.7.24]Unknown column '12' in 'field list'

but as I have not used MySQL with ODBC I would start from the ground up in resolving this problem.

  1. Check the ODBC configuration using iusql.

When I created a Wiki for using ODBC with PostgreSQL it starts with checking the ODBC configuration using iusql. You should be able to do the same but instead using your ODBC configuration. If you are not on Linux then you should find a similar tool.

  1. Check ODBC connection using the SWI-Prolog DSN configuration.

The wiki also has some simple test cases. You should be able to create similar queries and get similar results using MySQL.

  1. Check your Prolog quires without using MySQL.

  2. Add some guard statements using must_be/2 for the quires connecting to MySQL, e.g.

insertar_registros(X,Y) :-
   must_be(ground,X),
   must_be(ground,Y),
   odbc_query( ... ),
   ...

There is not much more help I can give you than this without installing MySQL which is not on my task list for the day.

Also please translate the error messages in images into text as it makes it better for others seeking help on the same problem and makes it easier for us helping you to read the full error message. :grinning: