Results 1 to 10 of 10

Thread: Mysql query update

  1. #1
    sbell22 is offline Member
    Join Date
    Mar 2010
    Posts
    11

    Default Mysql query update

    Hello Everyone,

    Trying Sugar for the first time and I have some questions:

    1. Installed Sugar and imported some users and everything works fine. But when I go to the server I can't use the the command line for mysql. How can I do this?

    2. I did something wrong on the import and I would like to run a query to fix it. How can I do that?

    I could always export it and change it and then re-import it but I would like to know how to connect to the db and this seems like a simple way to do it.

    Thanks...

  2. #2
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    4,813

    Default Re: Mysql query update

    Why can't you use the mysql command line? Are you getting an error? You don't have access to it? Please elaborate.
    Regards,

    Angel Magaña
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

    ________
    | Projects: |_____________________________________
    |
    | CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
    | GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
    | CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
    | Round Robin Leads Assignment
    | Phone Number Formatter
    | CaseTwit (Twitter Integration)
    ______________________________________________

  3. #3
    sbell22 is offline Member
    Join Date
    Mar 2010
    Posts
    11

    Default Re: Mysql query update

    Quote Originally Posted by Angel View Post
    Why can't you use the mysql command line? Are you getting an error? You don't have access to it? Please elaborate.

    That was my fault. I didn't have a my.cnf file, added it and I can now log in. But I don't know where to look for a custom field. I added a field to the account detail page called Division. Let me know if you know where this might be.


    Thanks again for replying.

  4. #4
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    4,813

    Default Re: Mysql query update

    Custom fields for the Accounts module would be in the accounts_cstm table.
    Regards,

    Angel Magaña
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

    ________
    | Projects: |_____________________________________
    |
    | CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
    | GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
    | CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
    | Round Robin Leads Assignment
    | Phone Number Formatter
    | CaseTwit (Twitter Integration)
    ______________________________________________

  5. #5
    lending is offline Junior Member
    Join Date
    Mar 2010
    Posts
    1

    Default Re: Mysql query update

    Yep..thanks for the update..i am a frequent user of Mysql.
    Last edited by lending; 2010-09-27 at 11:04 AM.

  6. #6
    sbell22 is offline Member
    Join Date
    Mar 2010
    Posts
    11

    Default Re: Mysql query update

    Quote Originally Posted by Angel View Post
    Custom fields for the Accounts module would be in the accounts_cstm table.
    Thanks for the reply.

    I only see 2 schemas (information_schema and test). I don't see accounts_cstm table in either of these 2 schema. What schema should this table be in?

    Thanks...

  7. #7
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    4,813

    Default Re: Mysql query update

    Those are 2 of the default databases that MySQL users.

    Have you already selected the database that you are using for your SugarCRM system? i.e. use <your sugar db name>; ?
    Regards,

    Angel Magaña
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

    ________
    | Projects: |_____________________________________
    |
    | CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
    | GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
    | CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
    | Round Robin Leads Assignment
    | Phone Number Formatter
    | CaseTwit (Twitter Integration)
    ______________________________________________

  8. #8
    freelancer05 is offline Junior Member
    Join Date
    Mar 2010
    Posts
    3

    Default Re: Mysql query update

    Single-table UPDATE assignments are generally evaluated from left to right. For multiple-table updates, there is no guarantee that assignments are carried out in any particular order.
    If you set a column to the value it currently has, MySQL notices this and does not update it.
    If you update a column that has been declared NOT NULL by setting to NULL, the column is set to the default value appropriate for the data type and the warning count is incremented. The default value is 0 for numeric types, the empty string ('') for string types, and the “zero” value for date and time types.
    UPDATE returns the number of rows that were actually changed. In MySQL 3.22 or later, the mysql_info() C API function returns the number of rows that were matched and updated and the number of warnings that occurred during the UPDATE.
    Starting from MySQL 3.23, you can use LIMIT row_count to restrict the scope of the UPDATE. A LIMIT clause works as follows:
    • Before MySQL 4.0.13, LIMIT is a rows-affected restriction. The statement stops as soon as it has changed row_count rows that satisfy the WHERE clause.
    • From 4.0.13 on, LIMIT is a rows-matched restriction. The statement stops as soon as it has found row_count rows that satisfy the WHERE clause, whether or not they actually were changed.
    If an UPDATE statement includes an ORDER BY clause, the rows are updated in the order specified by the clause. ORDER BY can be used from MySQL 4.0.0. This can be useful in certain situations that might otherwise result in an error. Suppose that a table t contains a column id that has a unique index. The following statement could fail with a duplicate-key error, depending on the order in which rows are updated:

  9. #9
    ferozeh786 is offline Junior Member
    Join Date
    Mar 2010
    Location
    USA
    Posts
    1

    Default Re: Mysql query update

    Thanks for sharing , it really helped me .

  10. #10
    sbell22 is offline Member
    Join Date
    Mar 2010
    Posts
    11

    Default Re: Mysql query update

    Quote Originally Posted by Angel View Post
    Those are 2 of the default databases that MySQL users.

    Have you already selected the database that you are using for your SugarCRM system? i.e. use <your sugar db name>; ?
    Found it. Updated the table and no problems.

    Thanks for your help.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Query Failed: ::MySQL error 1065: Query was empty
    By darcy.rippon in forum Developer Help
    Replies: 3
    Last Post: 2008-10-10, 07:24 AM
  2. Replies: 3
    Last Post: 2008-09-30, 08:43 PM
  3. Replies: 2
    Last Post: 2006-10-20, 12:00 AM
  4. Query Failed: ::MySQL error 1065: Query was empty
    By suruchi in forum Developer Help
    Replies: 1
    Last Post: 2006-01-21, 03:16 PM
  5. Query Failed: ::MySQL error 1065: Query was empty
    By suruchi in forum General Discussion
    Replies: 0
    Last Post: 2006-01-21, 12:04 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •