CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Error on setting new Prefix (Miss)
Pages: [1]

Author Topic: Error on setting new Prefix (Miss)  (Read 1985 times)

myles

  • I post frequently
  • ***
  • Posts: 263
  • Karma: 11
Error on setting new Prefix (Miss)
June 17, 2008, 06:01:50 am
Can anyone help, or guide me in debugging please?

I need to add the prefix 'Miss' 

When I attempt to do so I get the following error -


Home › Administer CiviCRM
Individual Prefix Options

unrecoverable error
    Sorry. A non-recoverable error has occurred.

    Database Error Code: 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 'DECIMAL)) AS max_weight FROM civicrm_option_value WHERE option_group_id = 35' at line 1, 1064

    Return to home page.

Error Details:

Array
(
    [callback] => Array
        (
           
  • => CRM_Core_Error
  • [1] => handle
            )

       
Code: [Select]
=> -2
    [message] => DB Error: syntax error
    [mode] => 16
    [debug_info] => SELECT MAX(CONVERT(value, DECIMAL)) AS max_weight FROM civicrm_option_value WHERE option_group_id = 35 [nativecode=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 'DECIMAL)) AS max_weight FROM civicrm_option_value WHERE option_group_id = 35' at line 1]
    [type] => DB_Error
    [user_info] => SELECT MAX(CONVERT(value, DECIMAL)) AS max_weight FROM civicrm_option_value WHERE option_group_id = 35 [nativecode=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 'DECIMAL)) AS max_weight FROM civicrm_option_value WHERE option_group_id = 35' at line 1]
    [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT MAX(CONVERT(value, DECIMAL)) AS max_weight FROM civicrm_option_value WHERE option_group_id = 35 [nativecode=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 'DECIMAL)) AS max_weight FROM civicrm_option_value WHERE option_group_id = 35' at line 1]"]
)

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Error on setting new Prefix (Miss)
June 17, 2008, 12:47:47 pm
I just tried this on our 2.0 public demo and it worked fine. What version of CiviCRM and MySQL are you using (might be an issue of an older version of MySQL not supporting the query syntax used below) ??

http://drupal.demo.civicrm.org/civicrm/admin/options?group=individual_prefix&reset=1&action=browse
Protect your investment in CiviCRM by  becoming a Member!

thomjjames

  • Guest
Re: Error on setting new Prefix (Miss)
June 20, 2008, 02:04:18 am
Hi,

i'm also having this exact same problem, i'm using mySQL 4.1.20 and civiCRM 2.0.4 Drupal PHP5.
is there any fix out or is it a case of inserting new preffixes manually via the database?

thanks in advance
Tom

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Error on setting new Prefix (Miss)
June 20, 2008, 09:49:17 am
CiviCRM 2.0 + requires MySQL 5.0.x or higher with INNODB support - as noted at the top of the installation documentation:
http://wiki.civicrm.org/confluence/display/CRMDOC/Install+2.0+for+Drupal

I suspect that the error is a result of the query using a MySQL function that's not available in 4.1. I also suspect that you'll see other issues over time unless you upgrade MySQL.
Protect your investment in CiviCRM by  becoming a Member!

myles

  • I post frequently
  • ***
  • Posts: 263
  • Karma: 11
Re: Error on setting new Prefix (Miss)
June 24, 2008, 11:13:55 am
Thanks for your reply and I'm sorry that I missed it earlier  :-[

It is a MySQL version problem - the host is running a 4. something and I'm stuck with it for the moment.

I've added the row to the table using the following query:

INSERT INTO civicrm_option_value (option_group_id,label,value,name,weight) VALUES
(35,'Miss','5','Miss',5);

Notes
1) All my tables in the database are prefixed with civicrm_ I'm not sure if that will be true for anyone else.

2) The option_group_id is 35, not 6. In the option_group table there are two entries for individual_prefix - numbers 6 and 35. I presume that number 6 is the preset group only - when I set my new entry to 6 it didn't show up in the drop down or in the admin screen. It does now.

By the way - my users and I think this system is awesome! Wish I was as well!

Thanks

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Error on setting new Prefix (Miss)

This forum was archived on 2017-11-26.