Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Scripting language with a support for array interface

Re: Scripting language with a support for array interface

From: Egor Starostin <egorst_at_gmail.com>
Date: 28 Nov 2005 11:03:26 -0800
Message-ID: <1133204606.531704.142500@f14g2000cwb.googlegroups.com>


> Is there any scripting language with the support for array
> interface? Perl doesn't have it nor does PHP. What about Python?
> Does it support array bind and, if it does, does it cheat like DBI
> which breaks the array under the hood and internally performs a
> loop, or does it do it for real?

I think, python doesn't cheat here.
Here's the code sample:
***
import cx_Oracle
c = cx_Oracle.connect('scott/tiger')
crs = c.cursor()
rows = [ { "intval":n , "charval":'text '+str(n) } for n in range(200) ]
stmt = "insert into test_table values (:intval,:charval)" crs.executemany(stmt, rows)
c.commit()
***
And here's part of tkprof output:
***
insert into test_table
values
 (:intval,:charval)

call count cpu elapsed disk query current

    rows
------- ------ -------- ---------- ---------- ---------- ----------


Parse        1      0.00       0.00          0          0          0
       0
Execute      1      0.00       0.00          0          1          5
     200
Fetch        0      0.00       0.00          0          0          0
       0

------- ------ -------- ---------- ---------- ---------- ----------
total        2      0.00       0.00          0          1          5
     200


Elapsed times include waiting on following events:
  Event waited on                             Times   Max. Wait  Total
Waited
-- 
Egor
http://www.oracledba.ru
Received on Mon Nov 28 2005 - 13:03:26 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US