Questions tagged [sql]
The sql tag has no summary.
46 questions
4
votes
1
answer
131
views
Is my reasoning correct in regard to speeding up this core query, and if so how can I contribute the change to core?
Doing some performance tuning so I turned on the slow query log and found this absolute beast taking 3 minutes:
SELECT COUNT(*) FROM (SELECT ANY_VALUE(civicrm_case.id) as case_id, ANY_VALUE(...
0
votes
0
answers
75
views
Relationship cache rebuild failure in upgrade to 5.72.3
Upgrading from 5.67.3 to 5.72.3 I get a warning that the relationship cache needs to be rebuilt. Very similar to this SE question, but different. The rebuild failed. I then used api4 to run the ...
2
votes
1
answer
210
views
Issues with CiviCRM Tables During MySQL 8.0 Upgrade
During the upgrade to MySQL 8.0, I encountered three different warnings related to CiviCRM tables and I want to take the correct steps in this regard. These warnings are listed below:
Usage of db ...
0
votes
1
answer
30
views
Transfer a D7 view sql query to a D9 view
We are converting a number of D7 views (for reports) to D9 version. Is it possible to copy the sql query from a D7 view to use in a D9 view. The fields in Civi are the same.
2
votes
1
answer
69
views
How to get "Last contribution amount" and "Last contribution date" into report?
I'm needing a way to add 2 columns to contribution summary report, 1 for displaying "last contribution date" and 1 for "last contribution amount" in a CiviReport. Is there an easy ...
1
vote
0
answers
38
views
Search Builder: Using "in" operator on a custom multi value field giving unexpected results
we encountered a problem when building searches using the "in" operator.
While this should work as if making multiple where statements connected with or, we noticed that on one of our custom ...
1
vote
2
answers
127
views
How to split CiviCRM multiple database values with SQL?
The CiviCRM database stores multiple values as a varchar field (a string with separator characters). For example, the IDs 3, 9 and 15 are internally saved as #3#9#15# (where # is in fact the character ...
1
vote
0
answers
104
views
CiviCRM 5.31.0 Wordpress unable to change default language
I currently have CiviCRM 5.31.0 for Wordpress installed. I want to change the default language from EN_US to Dutch (NL). After a quick google i found a tutorial and did the following steps:
...
0
votes
1
answer
26
views
Why is this Activity Search failing?
Activity Search is failing every time for this install (Search/Find Activities) no matter what search parameters are used. The problem is the following SQL error:
SELECT count( DISTINCT ( ...
1
vote
2
answers
48
views
Constraint violation when viewing Mailing Detail Report (group_id the cause)
CiviCRM version: 5.19.4
CMS: Drupal 7.69
PHP version: 7.1
When trying to view the Mailing Details Report page, I get the following error:
DB Error: Constraint violation
Looking in the error logs, ...
2
votes
0
answers
70
views
Updating Contribution payment instrument based on Financial Trxn payment instrument when there are multiple transactions
I have a task where I need to clean up payment instrument data. The basic problem was caused by a custom payment instrument of TBD, which is somehow preventing contributions from updating correctly, ...
3
votes
2
answers
154
views
Trouble saving changes to a report
EDIT: This question turned out to be, in practical terms, something different than I originally thought I was asking. I am changing the title so that others will find the answer more easily in the ...
3
votes
2
answers
267
views
How do you separate wordpress and civicrm tables?
When we first installed CiviCRM - the installer was super eager to install using the existing WordPress database. We were just testing out CiviCRM at the time, so it was not a big deal - however we ...
2
votes
2
answers
120
views
Custom field default values at database level, not form level?
When you set a default value for a custom field, it only exists at the form level. Is there a practical way to enforce them at the database level? For instance, by altering the SQL table definition?
...
4
votes
1
answer
97
views
Ran direct SQL update to bulk update contact names, changes not appearing until editing and saving
I'm finishing up a migration to CiviCRM from a homegrown Python application I wrote, and without going into too much detail as to the why, I needed to do a bulk update of all the contact name fields ...