Change CCK field data type I have a CCK field with a data type 'text', that I want to change to 'decimal'.

I have used a hook_update_N and db_change_field in order to do this.

Here is an example how I tried to do it:

function ptm_foo_update_6005() {
  db_change_field(
    $ret,
    'content_type_',
    'field_foo_value',
    'field_foo_value',
    array(
      'type' =&gt; 'decimal(10,2)',
      'description' =&gt; 'Foo'
    )
  ); 
}


But when I execute the update, it gives me the following error message:


  User warning: You have an error in your SQL syntax; check the manual
  that corresponds to your MySQL server version for the right syntax
Based on the comments on your question, I certainly hope you're doing this in a .install file and not a .module file.

The $ret variable is expected to be a reference, so you'll need to declare it before hand. 

$ret = array();
db_change_field($ret ...);


Is your table name really content_type_?

And you may want to look at this and stick in a couple dsm() calls to see what the db_change_field() function is actually passing to MySQL and then you could trouble shoot the query directly.