Re: SQL error
Hi, Ralf.
This is version 1.8.001.
Вы писали 17 февраля 2017 г., 9:08:36:
Hi,
what version is that, I tried to use a column-filter with a custom
field, while displaying custom fields and dont get the SQL error.
Ralf
Hello.
We have added some “custom fields” in Addressbook.
And now when we use them combining with search we getting following error:
Database error
Invalid SQL: SELECT SQL_CALC_FOUND_ROWS DISTINCT egw_addressbook.* FROM
egw_addressbook LEFT JOIN egw_addressbook_extra ON
egw_addressbook.contact_id=egw_addressbook_extra.contact_id JOIN
egw_addressbook_extra extra_filter ON
egw_addressbook.contact_id=extra_filter.contact_id AND
extra_filter.contact_name=’???’ AND extra_filter.contact_value=’??-123’
LEFT JOIN egw_accounts ON egw_addressbook.account_id=egw_accounts.account_id
WHERE contact_tid=‘n’ AND (egw_addressbook.contact_owner=9 OR
contact_private=0 AND egw_addressbook.contact_owner IN
(-1,-25,-26,-71,-76,12,9,0) OR egw_addressbook.contact_owner IS NULL) AND
(account_expires IS NULL OR account_expires = -1 OR account_expires >
1486904109) AND (n_family LIKE ‘%1171%’ OR n_given LIKE ‘%1171%’ OR n_middle
LIKE ‘%1171%’ OR n_prefix LIKE ‘%1171%’ OR n_suffix LIKE ‘%1171%’ OR n_fn
LIKE ‘%1171%’ OR n_fileas LIKE ‘%1171%’ OR contact_bday LIKE ‘%1171%’ OR
org_name LIKE ‘%1171%’ OR org_unit LIKE ‘%1171%’ OR contact_title LIKE
‘%1171%’ OR contact_role LIKE ‘%1171%’ OR contact_assistent LIKE ‘%1171%’ OR
contact_room LIKE ‘%1171%’ OR adr_one_street LIKE ‘%1171%’ OR
adr_one_street2 LIKE ‘%1171%’ OR adr_one_locality LIKE ‘%1171%’ OR
adr_one_region LIKE ‘%1171%’ OR adr_one_postalcode LIKE ‘%1171%’ OR
adr_one_countryname LIKE ‘%1171%’ OR contact_label LIKE ‘%1171%’ OR
adr_two_street LIKE ‘%1171%’ OR adr_two_street2 LIKE ‘%1171%’ OR
adr_two_locality LIKE ‘%1171%’ OR adr_two_region LIKE ‘%1171%’ OR
adr_two_postalcode LIKE ‘%1171%’ OR adr_two_countryname LIKE ‘%1171%’ OR
tel_work LIKE ‘%1171%’ OR tel_cell LIKE ‘%1171%’ OR tel_fax LIKE ‘%1171%’ OR
tel_assistent LIKE ‘%1171%’ OR tel_car LIKE ‘%1171%’ OR tel_pager LIKE
‘%1171%’ OR tel_home LIKE ‘%1171%’ OR tel_fax_home LIKE ‘%1171%’ OR
tel_cell_private LIKE ‘%1171%’ OR tel_other LIKE ‘%1171%’ OR tel_prefer LIKE
‘%1171%’ OR contact_email LIKE ‘%1171%’ OR contact_email_home LIKE ‘%1171%’
OR contact_url LIKE ‘%1171%’ OR contact_url_home LIKE ‘%1171%’ OR
contact_freebusy_uri LIKE ‘%1171%’ OR contact_calendar_uri LIKE ‘%1171%’ OR
contact_note LIKE ‘%1171%’ OR contact_geo LIKE ‘%1171%’ OR contact_pubkey
LIKE ‘%1171%’ OR contact_value LIKE ‘%1171%’) ORDER BY contact_created IS
NULL,contact_created DESC,org_name DESC,n_family DESC,n_given DESC:
Column ‘contact_value’ in where clause is ambiguous
This is because field contact_value exist both in egw_addressbook_extra
table and in table extra_filter.
So it should be egw_addressbook_extra.contact_value or
extra_filter.contact_value instead, that way its work without errors.
My question is how do I modify the code to fix it?
–
View this message in context: http://egroupware.219119.n3.nabble.com/SQL-error-tp4015063.html
Sent from the egroupware-users mailing list archive at Nabble.com.
Check out the vibrant tech community on one of the world’s most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
eGroupWare-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/egroupware-users
–
Ralf Becker
EGroupware GmbH [www.egroupware.org]
Handelsregister HRB Kaiserslautern 3587
Geschäftsführer Birgit und Ralf Becker
Leibnizstr. 17, 67663 Kaiserslautern, Germany
Telefon +49 631 31657-0
Check out the vibrant tech community on one of the world’s most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
eGroupWare-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/egroupware-users
signature.asc (817 bytes) Download Attachment
**If you reply to this email, your message will be added to the discussion below:
**http://egroupware.219119.n3.nabble.com/SQL-error-tp4015063p4015108.html
To unsubscribe from SQL error, click here.
NAML
*–
С уважением,
Роман Горохов.
*http://razumit.ru