I'm using Python 2.4, cx_Oracle-4.1 on Linux with Oracle instant client
10.1.0.3. This is the sql string:
SQL = """insert into D.D_NOTIFY values (:CARDREF, :BANKKEY, :OK1, :OK2 \
:DEBTEUR, :DEBTDEN, to_date(:INVOIC E_DATE,'DD.MM.Y Y'),
to_date(:PAYMEN T_DEADLINE,'DD. MM.YY'), :POINTS)"""
And I'm trying to execute it as:
c = db.cursor()
c.execute(SQL, CARDREF=id, BANKKEY=dc_kluc , OK1=okd, OK2=okc,
DEBTEUR=iznos_e ur, DEBTDEN=iznos_m kd, INVOICE_DATE=da tum_g,
PAYMENT_DEADLIN E=datum_d, POINTS=bodovi)
And I get an ORA-01036 exception.
I also have tried
args = dict(CARDREF=id , BANKKEY=dc_kluc , OK1=okd, OK2=okc,
DEBTEUR=iznos_e ur, DEBTDEN=iznos_m kd, INVOICE_DATE=da tum_g,
PAYMENT_DEADLIN E=datum_d, POINTS=bodovi)
c = db.cursor()
c.execute(SQL, **args)
Same thing.
Everything works If I use python string substituion, like this sql:
SQL = """insert into D.D_NOTIFY values (%s,'%s','%s',' %s','%s','%s', \
to_date('%s','D D.MM.YY'),to_da te('%s','DD.MM. YY'),'%s')""" % fields
Any ideas?
--
damjan 4 3750
"Damjan" <gd*****@gmail. com> schrieb im Newsbeitrag
news:42******** @x-privat.org...
| I'm using Python 2.4, cx_Oracle-4.1 on Linux with Oracle instant client
| 10.1.0.3. This is the sql string:
|
| SQL = """insert into D.D_NOTIFY values (:CARDREF, :BANKKEY, :OK1, :OK2 \
| :DEBTEUR, :DEBTDEN, to_date(:INVOIC E_DATE,'DD.MM.Y Y'),
| to_date(:PAYMEN T_DEADLINE,'DD. MM.YY'), :POINTS)"""
|
| And I'm trying to execute it as:
| c = db.cursor()
| c.execute(SQL, CARDREF=id, BANKKEY=dc_kluc , OK1=okd, OK2=okc,
| DEBTEUR=iznos_e ur, DEBTDEN=iznos_m kd, INVOICE_DATE=da tum_g,
| PAYMENT_DEADLIN E=datum_d, POINTS=bodovi)
| And I get an ORA-01036 exception.
|
| I also have tried
| args = dict(CARDREF=id , BANKKEY=dc_kluc , OK1=okd, OK2=okc,
| DEBTEUR=iznos_e ur, DEBTDEN=iznos_m kd, INVOICE_DATE=da tum_g,
| PAYMENT_DEADLIN E=datum_d, POINTS=bodovi)
| c = db.cursor()
| c.execute(SQL, **args)
Shouldn't that be c.execute(SQL, args) (no **-unpacking of the dictionary)?
--
Vincent Wehren
| Same thing.
|
| Everything works If I use python string substituion, like this sql:
| SQL = """insert into D.D_NOTIFY values (%s,'%s','%s',' %s','%s','%s', \
| to_date('%s','D D.MM.YY'),to_da te('%s','DD.MM. YY'),'%s')""" % fields
|
| Any ideas?
|
|
| --
| damjan
vincent wehren wrote: | c = db.cursor() | c.execute(SQL, **args)
Shouldn't that be c.execute(SQL, args) (no **-unpacking of the dictionary)?
Actually I tried that too, I still get the same error.
--
damjan
Damjan wrote: I'm using Python 2.4, cx_Oracle-4.1 on Linux with Oracle instant client 10.1.0.3. This is the sql string:
SQL = """insert into D.D_NOTIFY values (:CARDREF, :BANKKEY, :OK1, :OK2 \ :DEBTEUR, :DEBTDEN, to_date(:INVOIC E_DATE,'DD.MM.Y Y'), to_date(:PAYMEN T_DEADLINE,'DD. MM.YY'), :POINTS)"""
And I'm trying to execute it as: c = db.cursor() c.execute(SQL, CARDREF=id, BANKKEY=dc_kluc , OK1=okd, OK2=okc, DEBTEUR=iznos_e ur, DEBTDEN=iznos_m kd, INVOICE_DATE=da tum_g, PAYMENT_DEADLIN E=datum_d, POINTS=bodovi)
And I get an ORA-01036 exception.
Try using a variable name other than "id" for the CARDREF variable... say
"card_id". id is a built in function name; I suspect your problem may be
that you are assiging that function to the variable rather than your intended
value...
Miles
>> SQL = """insert into D.D_NOTIFY values (:CARDREF, :BANKKEY, :OK1, :OK2 \ :DEBTEUR, :DEBTDEN, to_date(:INVOIC E_DATE,'DD.MM.Y Y'), to_date(:PAYMEN T_DEADLINE,'DD. MM.YY'), :POINTS)"""
Try using a variable name other than "id" for the CARDREF variable... say "card_id". id is a built in function name; I suspect your problem may be that you are assiging that function to the variable rather than your intended value...
I changed it to 'cardref' but I'm still getting the same error.
--
damjan This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Mike Stenzler |
last post by:
Does anyone have any sample code for the cx_Oracle library?
www.computronix.com
I have the doco and can connect and do simple ops against my database but
I'm struggling with
the correct syntax for implementing bind variables with a cursor.
TIA
|
by: Greg Lindstrom |
last post by:
>Shouldn't this be '/u01/app/oracle/product/9.2.0' ? Based on the following
values, that's what I'd expect.
I changed the ORCALE_HOME environment variable to the above suggested value
and got a new error!! That's progress, right? I'm now told:
cx_Oracle.DatabaseError: ORA-12154: TNS:could not resolve service name
/usr/bin/sh:...
|
by: Andrew Dalke |
last post by:
In searching I find there several different ways to
connect to an Oracle server on MS Windows:
mxODBC - http://www.egenix.com/files/python/mxODBC.html
built on top of the ODBC drivers for a given database
DCOracle2 - http://www.zope.org/Members/matt/dco2/
last update is 1.3 beta released 2 years ago?
cx_oracle -...
|
by: Maxim Kuleshov |
last post by:
Hello!
Trying to fetch long varchar2 column and get the following error:
cx_Oracle.DatabaseError: column at array pos 0 fetched with error: 1406
i.e. string buffer is not much enough to fetch the string.
# fragment of code...
myCon = cx_Oracle.connect(user, psw, dsn)
|
by: Daniel |
last post by:
Hello from Brazil :-)
I'm trying to bring cx_Oracle alive on my Python 2.4.1 @ HP-UX 11
(suckz) and Oracle 10.1.0 64bits without success
I've already tryied the suggestions from Bernard Delmée and Martin v.
Löwis (topic "Python 2.3b1 + cx_oracle 3.0 on HP-UX"), but it didn't
work, even when I recompiled Python with the "-lc -lpthread"...
| |
by: infidel |
last post by:
I have a stored procedure that has a single output parameter. Why do I
have to pass it a string big enough to hold the value it is to receive?
Why can't I pass an empty string or None?
>>> import cx_Oracle as oracle
>>> connection = oracle.connect('usr/pwd@tns')
>>> cursor = connection.cursor()
>>> network_name, =...
|
by: lblr33 |
last post by:
I downloaded cx_Oracle from
http://www.cxtools.net/default.aspx?nav=cxorlb and selected the windows
installer for Oracle 8i, Python 2.4
>From the readme.txt file:
BINARY INSTALL:
Place the file cx_Oracle.pyd or cx_Oracle.so anywhere on your Python
path.
So I tried this and set PYTHONPATH.
|
by: [12]Nitro |
last post by:
Greetings,
I'm currently working in a Python project to create a multi-platform
database replication tool, and cx_Oracle was the chosen provider to
handle the Oracle connections. So far the results have been very
interesting, but I've been experiencing some problems when inserting
CLOB objects through executemany (meaning, using a...
|
by: Carl K |
last post by:
I am trying to use this:
http://python.net/crew/atuining/cx_Oracle/html/cx_Oracle.html
it is a real module, right?
sudo easy_install cx_Oracle did not easy_install cx_Oracle.
http://www.python.org/pypi/cx_Oracle/4.3.1 doesn't give me any clue.
I got the source from...
|
by: lukasz.f24 |
last post by:
Hello,
I'm trying to pass array as an argument into PL/SQL procedure.
According to cursor manual (http://cx-oracle.sourceforge.net/html/
cursorobj.html) arrayvar() should be use to do it. I've created my
array type in PL/SQL:
CREATE OR REPLACE TYPE cx_array_string is table of varchar2(200);
and simple procedure:
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |