
Hi, It looks like, as if otrs runs now with the SQL server. A few data types and a table name in the database had to be however adapted. the table name system_user cannot be used, in MS SQL this name is reserved of the system. Therefore I renamed the table in sys_user. The data base schema I use is attached on this mail. A (hopefully) last problem exists however still: the field a_body in the table article is in the origin of the data type text. The data type text can only with IS ZERO or LIKE be compared or sorted within MS SQL, not with GROUP BY. ( ntext and image too) Therefore I use varchar with a length of 8000 for as data type for a_body. But I think 8000 indications could be too few, for a very big incoming email? The error message in the logfiles, if the data type stands on text: This error messages will appear in the logfiles if I want to Zoom a ticket (a_body data type = text) otrs log: [Thu Jul 10 11:48:32 2003][Error][Kernel::Modules::AgentZoom::Run][164] [Microsoft][ODBC SQL Server Driver][SQL Server]Die Datentypen text, ntext und image können nur mithilfe des Operators IS NULL oder LIKE verglichen oder sortiert werden. (SQL-42000) [Microsoft][ODBC SQL Server Driver][SQL Server]Anweisung(en) konnte(n) nicht vorbereitet werden. (SQL-42000)(DBD: st_execute/SQLExecute err=-1), SQL: 'SELECT sa.id, st.tn, sa.a_from, sa.a_to, sa.a_cc, sa.a_subject, sa.a_body, st.create_time_unix, st.tn, st.user_id, st.ticket_state_id, st.ticket_priority_id, sa.create_time, stt.name as sender_type, at.name as article_type, su.login, sl.name as lock_type, sp.name as priority, sp.id as priority_id, tsd.name as state, sa.content_path, sq.name as queue, st.create_time as ticket_create_time, sa.a_freekey1, sa.a_freetext1, sa.a_freekey2, sa.a_freetext2, sa.a_freekey3, sa.a_freetext3, st.freekey1, st.freekey2, st.freetext1, st.freetext2, st.customer_id, st.customer_user_id, sq.group_id, st.ticket_answered, sq.escalation_time, sa.a_content_type, sa.incoming_time, st.until_time FROM article sa, ticket st, article_sender_type stt, article_type at, sys_user su, ticket_lock_type sl, ticket_priority sp, ticket_state tsd, queue sq WHERE sa.ticket_id = st.id AND sq.id = st.queue_id AND stt.id = sa.article_sender_type_id AND at.id = sa.article_type_id AND sp.id = st.ticket_priority_id AND sl.id = st.ticket_lock_id AND tsd.id = st.ticket_state_id AND sa.ticket_id = 1 AND su.id = st.user_id GROUP BY sa.id, st.tn, sa.a_from, sa.a_to, sa.a_cc, sa.a_subject, sa.a_body, st.create_time_unix, st.tn, st.user_id, st.ticket_state_id, st.ticket_priority_id, sa.create_time, stt.name, at.name, su.login, sl.name, sp.name, sp.id, tsd.name, sa.content_path, sq.name, st.create_time, sa.a_freekey1, sa.a_freetext1, sa.a_freekey2, sa.a_freetext2, sa.a_freekey3, sa.a_freetext3, st.freekey1, st.freekey2, st.freetext1, st.freetext2, st.customer_id, st.customer_user_id, sq.group_id, st.ticket_answered, sq.escalation_time, sa.a_content_type, sa.incoming_time, st.until_time ' apache log: [Thu Jul 10 12:20:28 2003] nul: DBD::ODBC::st execute failed: [Microsoft][ODBC SQL Server Driver][SQL Server]Die Datentypen text, ntext und image können nur mithilfe des Operators IS NULL oder LIKE verglichen oder sortiert werden. (SQL-42000) [Thu Jul 10 12:20:28 2003] nul: [Microsoft][ODBC SQL Server Driver][SQL Server]Anweisung(en) konnte(n) nicht vorbereitet werden. (SQL-42000)(DBD: st_execute/SQLExecute err=-1) at d:/otrs_ms//Kernel/System/DB.pm line 265. ERROR: OTRS-CGI-10 Perl: 5.6.1 OS: MSWin32 Time: Thu Jul 10 12:20:28 2003 Message: [Microsoft][ODBC SQL Server Driver][SQL Server]Die Datentypen text, ntext und image können nur mithilfe des Operators IS NULL oder LIKE verglichen oder sortiert werden. (SQL-42000) [Microsoft][ODBC SQL Server Driver][SQL Server]Anweisung(en) konnte(n) nicht vorbereitet werden. (SQL-42000)(DBD: st_execute/SQLExecute err=-1), SQL: 'SELECT sa.id, st.tn, sa.a_from, sa.a_to, sa.a_cc, sa.a_subject, sa.a_body, st.create_time_unix, st.tn, st.user_id, st.ticket_state_id, st.ticket_priority_id, sa.create_time, stt.name as sender_type, at.name as article_type, su.login, sl.name as lock_type, sp.name as priority, sp.id as priority_id, tsd.name as state, sa.content_path, sq.name as queue, st.create_time as ticket_create_time, sa.a_freekey1, sa.a_freetext1, sa.a_freekey2, sa.a_freetext2, sa.a_freekey3, sa.a_freetext3, st.freekey1, st.freekey2, st.freetext1, st.freetext2, st.customer_id, st.customer_user_id, sq.group_id, st.ticket_answered, sq.escalation_time, sa.a_content_type, sa.incoming_time, st.until_time FROM article sa, ticket st, article_sender_type stt, article_type at, sys_user su, ticket_lock_type sl, ticket_priority sp, ticket_state tsd, queue sq WHERE sa.ticket_id = st.id AND sq.id = st.queue_id AND stt.id = sa.article_sender_type_id AND at.id = sa.article_type_id AND sp.id = st.ticket_priority_id AND sl.id = st.ticket_lock_id AND tsd.id = st.ticket_state_id AND sa.ticket_id = 1 AND su.id = st.user_id GROUP BY sa.id, st.tn, sa.a_from, sa.a_to, sa.a_cc, sa.a_subject, sa.a_body, st.create_time_unix, st.tn, st.user_id, st.ticket_state_id, st.ticket_priority_id, sa.create_time, stt.name, at.name, su.login, sl.name, sp.name, sp.id, tsd.name, sa.content_path, sq.name, st.create_time, sa.a_freekey1, sa.a_freetext1, sa.a_freekey2, sa.a_freetext2, sa.a_freekey3, sa.a_freetext3, st.freekey1, st.freekey2, st.freetext1, st.freetext2, st.customer_id, st.customer_user_id, sq.group_id, st.ticket_answered, sq.escalation_time, sa.a_content_type, sa.incoming_time, st.until_time ' Traceback (1352): Module: Kernel::Modules::AgentZoom::Run (v1.34.2.1) Line: 164 Module: Apache::ROOT::otrs::index_2epl::handler (v1.58) Line: 608 Module: (eval) (v2.01) Line: 149 Module: Apache::Registry::handler (v2.01) Line: 149 [Thu Jul 10 12:20:28 2003] nul: DBD::ODBC::st fetchrow_hashref failed: (DBD: no select statement currently executing err=-1) at d:/otrs_ms//Kernel/System/DB.pm line 302. [Thu Jul 10 12:20:28 2003] nul: Use of uninitialized value in pattern match (m//) at d:/otrs_ms//Kernel/Output/HTML/Agent.pm line 391. [Thu Jul 10 12:20:28 2003] nul: Argument "?" isn't numeric in numeric gt (>) at d:/otrs_ms//Kernel/Output/HTML/Generic.pm line 737. [Thu Jul 10 12:20:28 2003] [error] Can't use an undefined value as a HASH reference at d:/otrs_ms//Kernel/Output/HTML/Agent.pm line 549. any idea somebody? Regards Holger

Hi Holger, On Thu, Jul 10, 2003 at 12:28:43PM +0200, Holger.Struck@sqs.de wrote:
It looks like, as if otrs runs now with the SQL server. A few data types and a table name in the database had to be however adapted.
the table name system_user cannot be used, in MS SQL this name is reserved of the system. Therefore I renamed the table in sys_user.
The data base schema I use is attached on this mail.
A (hopefully) last problem exists however still: the field a_body in the table article is in the origin of the data type text. The data type text can only with IS ZERO or LIKE be compared or sorted within MS SQL, not with GROUP BY. ( ntext and image too) Therefore I use varchar with a length of 8000 for as data type for a_body. But I think 8000 indications could be too few, for a very big incoming email?
That's right. Data type text would be better.
The error message in the logfiles, if the data type stands on text:
This error messages will appear in the logfiles if I want to Zoom a ticket (a_body data type = text)
otrs log:
[Thu Jul 10 11:48:32 2003][Error][Kernel::Modules::AgentZoom::Run][164] [Microsoft][ODBC SQL Server Driver][SQL Server]Die Datentypen text, ntext und image können nur mithilfe des Operators IS NULL oder LIKE verglichen oder sortiert werden. (SQL-42000) [Microsoft][ODBC SQL Server Driver][SQL Server]Anweisung(en) konnte(n) nicht vorbereitet werden. (SQL-42000)(DBD: st_execute/SQLExecute err=-1), SQL: 'SELECT sa.id, st.tn, sa.a_from, sa.a_to, sa.a_cc, sa.a_subject, sa.a_body, [...] any idea somebody?
Yes! :) In the current CVS version we rewrote the AgentZoom module and moved the SQL stuff to the backend. -=> So this old 'bin' SQL statements exists not anymore. :) If you are not familiar with CVS try the CVS snapshot: ftp://ftp.otrs.org/pub/otrs/misc/snapshots/
Holger
Martin -- Martin Edenhofer - <martin at edenhofer.de> - http://martin.edenhofer.de/ -- "The number of Unix installations has grown to 10, with more expected." The Unix Programmer's Manual, 2nd Edition, June 1972
participants (2)
-
Holger.Struck@sqs.de
-
Martin Edenhofer