cx_Oracle CREATE TABLE AS returns ORA-01036: illegal variable name/number

Marcus Diniz <[email protected]>
Newsgroups gmane.comp.python.db.cx-oracle
Message-ID <CAOKSmtdQ1UC_8moQtNiWs-DCZb+KZfn9wPHt3RCqnL5WVc5A-g@mail.gmail.com>
Hello there


I'm trying to CREATE TABLE AS using cx_Oracle on Python 2.4.6
The following code:

    query = '''CREATE TABLE TMP_STATS_1 AS
    select NUM from INF_CARD where IMPORT_DATE between
    to_date(:datepass || ' 00:00:00','dd/mm/yyyy hh24:mi:ss') and
    to_date(:datepass || ' 23:59:59','dd/mm/yyyy hh24:mi:ss')'''
    curs.execute(query, datepass=datep)


Returns: cx_Oracle.DatabaseError: ORA-01036: illegal variable name/number

Taking out the CREATE TABLE TMP_STATS_1 AS and leaving only the SELECT
statement, works perfectly. Also, when using CREATE TABLE AS statement on
SQLPLUS it runs correctly.

Is there any specific syntax for CREATE TABLE AS to be used in cx_Oracle?
Tried to find examples for this, but none found so far.

Regards,
Marcus

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs

_______________________________________________
cx-oracle-users mailing list
cx-oracle-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/cx-oracle-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.