0
Test = '''
SELECT      /*+ INDEX (s_evt_act acc_temp_teste) */ todo_cd tipoemail, 
            name subject,  email_sndr_addr remetente, 
            evt_stat_cd status, 
            to_char(trunc(created), 'yyyy-mm-dd') data, 
            COUNT(1) quantidade
FROM        sblprod.s_evt_act
WHERE       created >= TO_DATE(:DATAI, 'yyyy-mm-dd hh24:mi:ss')
AND         created <= TO_DATE(:DATAF, 'yyyy-mm-dd hh24:mi:ss')
AND         todo_cd IN ('Email - Entrada','Redução de Preço','Fax - Entrada','Email - Saída')
GROUP BY    todo_cd, name, email_sndr_addr, evt_stat_cd, to_char(trunc(created), 'yyyy-mm-dd');'''


I need to run this query in Oracle and perform an insert into a table of postgre database. Queries work with minors, but this generates an error:

Traceback (most recent call last):
File "C:\Monitoramentos\carga\s_evt_act_carga.py", line 62, in <module>
curSiebel.execute(Oracle,{'DATAI': atualini, 'DATAF': atualfim})
cx_Oracle.DatabaseError: ORA-00911: invalid character

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by slate
0

This is not a python issue.
However...
This oracle error comes out, when in some expression an implicit or explicit conversion fails on some line and field value.


Most likely your

:DATAI

and

:DATAF

bind variables are not in the format 'yyyy-mm-dd hh24:mi:ss'

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.