Error with Database when installing block

Permalink
Hello, I'm currently trying to create a block, but when i install it, i get this error in a red square..:

mysql error: [1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' RefProc INTEGER, RefConstat INTEGER, IndProc ' at line 5] in EXECUTE("CREATE TABLE btGestionProcedures ( bID INTEGER UNSIGNED NOT NULL, Designation TEXT, Machine TEXT, TypeControle VARCHAR, RefProc INTEGER, RefConstat INTEGER, IndProc VARCHAR, IndConstat VARCHAR, PRIMARY KEY (bID) )")

I can't get where this error is coming from... here is my db.xml file, it's a rather simple one.

Am I missing something obvious ?

Thanks in advance

<?xml version="1.0"?>
<schema version="0.3">
   <table name="btGestionProcedures">
      <field name="bID" type="I">
         <key />
         <unsigned />
      </field>
      <field name="Designation" type="X">
      </field>
      <field name="Machine" type="X">
      </field>
      <field name="TypeControle" type="C">
      </field>
      <field name="RefProc" type="I">
      </field>

gloglo
 
JohntheFish replied on at Permalink Best Answer Reply
JohntheFish
Maybe a type mismatch between your code and the db.xml. Maybe integers passed through as strings. Or a string too long for the C field.

Maybe a case mismatch between filed names and names in code.

Also check for a name mismatch between your block name and the table name (But I think that usually gives a different error message)
gloglo replied on at Permalink Reply
gloglo
Thanks, I solved it, for some reason it didn't like the type 'C'.

Replaced them by 'X' type and it worked.

Maybe it's MySQL... I'm running Xampp on Linux
JohntheFish replied on at Permalink Reply
JohntheFish
Just checked on

http://www.concrete5.org/documentation/how-tos/developers/creating-...

and it looks like C needs a specified size.

If a table is being used a lot, and particularly when searching on that field, C may be more efficient than X.

As you are just using it as a standard block table, I doubt if the difference is significant.