| | |
What's wrong with this query?
![]() |
•
•
Join Date: May 2009
Posts: 1
Reputation:
Solved Threads: 0
Python Syntax (Toggle Plain Text)
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
•
•
Join Date: Jun 2008
Posts: 122
Reputation:
Solved Threads: 30
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 and bind variables are not in the format 'yyyy-mm-dd hh24:mi:ss'
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
Python Syntax (Toggle Plain Text)
:DATAI
Python Syntax (Toggle Plain Text)
:DATAF
Last edited by slate; Jun 1st, 2009 at 8:11 am.
![]() |
Similar Threads
- passing parameter in sql query by page (PHP)
- query problem case syntax error can't figure it out (MS SQL)
- Syntax Errors, Variables & Query, Oh my! (PHP)
- is my query wrong (MySQL)
- sql query (PHP)
- What's wrong with my query? (MySQL)
- query regarding the crontab command (Shell Scripting)
Other Threads in the Python Forum
- Previous Thread: first time programmer stuck
- Next Thread: Python with Cygwin
| Thread Tools | Search this Thread |
abrupt ansi anti apache approximation array assignment avogadro backend beginner binary book builtin calculator character code converter countpasswordentry curved customdialog dan08 dictionaries dictionary dynamic examples exe file float format function gnu graphics gui heads homework import inches input java launcher library line lines linux list lists loop mouse mysql mysqlquery number numbers numeric output parsing path phonebook plugin pointer port prime programming progressbar projects py2exe pygame pysimplewizard python random recursion redirect scrolledtext software statictext statistics string strings sum table terminal text textarea thread threading time tlapse trick tricks tuple tutorial twoup ubuntu unicode urllib urllib2 variable wordgame write wxpython xlib





