Re: when i use sum() in my sql, my code will be ORA-00907

Anthony Tuininga <[email protected]> Sat, 15 Aug 2015 08:47:54 -0600
Newsgroups gmane.comp.python.db.cx-oracle
Message-ID <CAE1XR-6AFd2ckhy-uyEqsCNqUKxuaoqqAqXN8_FiFhcWMj-6VA@mail.gmail.com>
Hi,

It looks like the omitted code is rather important....as the last line you
keep talks about __midSql but the line that actually errors talks about
__dtlSql. Take a look at __dtlSql -- there will be a syntax error in your
SQL there. :-)

Anthony

On Sat, Aug 15, 2015 at 2:00 AM, 地铁怪0 <[email protected]> wrote:

> Hi all:
>     This is my first time to use cx_Oracle, i get a problem,
>
>    -    This is my code:
>
>         --omit--
>         self.__midSql = "select sum(primal_fee) from ad.ca_daily_bill"
>         self.__db = cx_Oracle.Connection(self.__user, self.__passwd,
> self.__dns)
>         self.__cursor = self.__db.cursor()
>         self.__cursor.execute(self.__midSql)
>         --omit--
>
>
>
>    -     and the error:
>
>         Traceback (most recent call last):
>           File "check_daily_bill_1.4.py", line 293, in <module>
>             query_DB.dailyQueryFromDB()
>           File "check_daily_bill_1.4.py", line 281, in dailyQueryFromDB
>             self.__cursor.execute(self.__dtlSql)
>             cx_Oracle.DatabaseError: ORA-00907: missing right parenthesis
>
>       Sorry for my omit , i should keep secret for my customer. The code
> is copy from my real code, i just change the table_name.
>       and my table_name do not contain a "(" or ")" .
>       I don't omit the error message.  that is all.
>       the last, sorry for my english, if you know how to deal this error,
> please tell me, thanks for your help!
>
> Best Wishes For You
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> cx-oracle-users mailing list
> cx-oracle-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users
>
>

------------------------------------------------------------------------------

_______________________________________________
cx-oracle-users mailing list
cx-oracle-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/cx-oracle-users