on ‎2019 Mar 18 3:52 PM
Hello,
I would like to execute queries in Python 2 (and 3 if possible) to ASE and IQ Sybase servers.
What are the most performant implementations in Python 2/3 ?
Best regards,
Request clarification before answering.
Hello joe.woodhouse, where can I download CPython driver to execute queries ? I've read https://help.sap.com/doc/4c40a79c93f4485ca2a01c5ba806c2f5/16.0.3.6/en-US/Adaptive_Server_Enterprise_... but it seems only Python 2 (released in 2012) is available on SourceForge.
I'm looking for a driver that will run on Python 3, GNU/Linux, Windows, IQ and ASE. Does that driver exist ? 🙂
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Richard,
Here is the setup using the SAP driver.
SDK 16.0 SP03 PL07:
$ source
$SYBASE/SYBASE.csh
$ setenv PYTHONPATH
$SYBASE/$SYBASE_OCS/python/python37_64r/lib
$ setenv PATH
/pse/hansenr/python37/bin:$PATH
$ cat firstapp.py
import sybpydb
conn =
sybpydb.connect(user='DBA', password='sql')
cur = conn.cursor()
cur.execute("select
* from mytable")
while True:
row = cur.fetchone()
if (not row):
break
print("%s: %s" % (row[0],
row[1]))
cur.close()
conn.close()
$ cat
$SYBASE/interfaces
ASE
query tcp ether ASEHOST ASEPORT
IQ
query tcp ether IQHOST IQPORT
isql -UDBA -Psql
-SIQ
1>create table
mytable (c1 int, c2 varchar(50))
2>go
1> insert into
mytable values (1, "test")
2> go
(1 row affected)
isql -Usa -Ppassword
-SASE
1> create table
mytable (c1 int, c2 varchar(50))
2> go
1> insert into
mytable values (2, "test2")
2> go
(1 row affected)
$ setenv DSQUERY ASE
$ python3
firstapp.py
2: test2
$ setenv DSQUERY IQ
Modify username and
password
$ python3
firstapp.py
1: test
Hope this helps,
Ryan
| User | Count |
|---|---|
| 9 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.