From: Paolo M. <pa...@i-...> - 2007-03-15 09:57:16
|
I have a problem with AutoExecute in oci8 interface. My call are: AutoExecute('utenti', array of fields to update, 'UPDATE', "cod_utente='prova'") This call fail. If i look the sql generated i find: UPDATE utenti SET ........ WHERE cod_utente='prova') where rownum <= :adodb_offset In adodb-lib.inc.php function _adodb_getupdatesql after the line 465: preg_match('/\sWHERE\s(.*)/is', $rs->sql, $whereClause); The element 1 of $whereClause field are: cod_utente='prova') where rownum <= :adodb_offset Can help me? An other help: i must make portable this MySql SQL statement: select data_scadenza, successivo from pagine where ((data_scadenza between date_sub('2007-03-14', INTERVAL '25' day) and date_add('2007-03-14', INTERVAL '26' day)) or (data_scadenza < date_sub('2007-03-14', INTERVAL '25' day) and date_add(data_scadenza, INTERVAL successivo day) >= date_sub('2007-03-14', INTERVAL '25' day))) and tipo_pagina='C' and lingua='IT' I have maked two Database Function in Oracle for simulate date_sub and date_add , but my problem are the execution of the interval on the table field 'successivo' (an integer). The function are: DATE_ADD: CREATE OR REPLACE function date_add(data1 in STRING, intervallo IN INTERVAL DAY TO SECOND ) return date IS data2 DATE; BEGIN select to_date(data1, 'yyyy-mm-dd') + intervallo into data2 from dual ; return(data2); END; / DATE_SUB: CREATE OR REPLACE function date_sub(data1 in STRING, intervallo IN INTERVAL DAY TO SECOND ) return date IS data2 DATE; BEGIN select to_date(data1, 'yyyy-mm-dd') - intervallo into data2 from dual ; return(data2); END; / Any suggestion? Thank Paolo Morandi |