Ad Widget

Collapse

trunk, r7737: ORA-01747 in timer.c

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • oldsam
    Junior Member
    • Feb 2009
    • 5

    #1

    trunk, r7737: ORA-01747 in timer.c

    Hi all,

    I`m using zabbix with Oracle DB 10g.

    The table timeperiods has column named "date", which is Oracle reserved word and it is causing troubles in timer.c when starting zabbix server.

    timer.c line 303 - 310:
    Code:
            result = DBselect(
                            "select m.maintenanceid,m.maintenance_type,m.active_since,tp.timeperiod_type,tp.every,"
                                    "tp.month,tp.dayofweek,tp.day,tp.start_time,tp.period,tp.date "
                            "from maintenances m,maintenances_windows mw,timeperiods tp "
                            "where m.maintenanceid=mw.maintenanceid and "
                                    "mw.timeperiodid=tp.timeperiodid and "
                                    "%d between m.active_since and m.active_till",
                            now);
    the tp.date has to be changed to tp.\"date\" or better not to use reserved words for column naming.
    Last edited by oldsam; 14-08-2009, 11:11.
  • oldsam
    Junior Member
    • Feb 2009
    • 5

    #2
    ORA-01747: Column name problem

    I have found another problem with this table timeperiods and column date in php frontend. When I try to save new maintenance, I get:

    Code:
     ociexecute() [<a href='function.ociexecute'>function.ociexecute</a>]: ORA-01747: invalid user.table.column, table.column, or column specification[/var/www/html/zabbix.pre.1.7.0/include/db.inc.php:483]
     SQL error [ORA-01747: invalid user.table.column, table.column, or column specification] in [INSERT INTO timeperiods (timeperiodid,timeperiod_type,every,month,dayofweek,day,start_time,period,date) VALUES (1,2,1,0,0,1,43200,3600,0)]
     ociexecute() [<a href='function.ociexecute'>function.ociexecute</a>]: ORA-00936: missing expression[/var/www/html/zabbix.pre.1.7.0/include/db.inc.php:483]
     SQL error [ORA-00936: missing expression] in [INSERT INTO maintenances_windows (maintenance_timeperiodid,timeperiodid,maintenanceid) VALUES (1,,1)]
    the problem is in maintenances.inc.php line 203 - 212:
    Code:
    	$result = DBexecute('INSERT INTO timeperiods (timeperiodid,timeperiod_type,every,month,dayofweek,day,start_time,period,date) '.
    				' VALUES ('.$timeperiodid.','.
    						$timeperiod['timeperiod_type'].','.
    						$timeperiod['every'].','.
    						$timeperiod['month'].','.
    						$timeperiod['dayofweek'].','.
    						$timeperiod['day'].','.
    						$timeperiod['start_time'].','.
    						$timeperiod['period'].','.
    						$timeperiod['date'].')');
    where date in insert statement have to be enclosed with double quotes "date".

    Comment

    Working...