AnsweredAssumed Answered

python PI SQL DATA ACCESS

Question asked by epotencia on May 16, 2018
Latest reply on May 16, 2018 by tramachandran

Hi, I wanted access a osisoft database with python but I compiled the program and the resut was:

 

#python -m py_compile example.py

#vi example.py

#!/usr/bin/python

import jaydebeapi

conn = jaydebeapi.connect("com.osisoft.jdbc.Driver","jdbc:piintegrator://10.36.15.47/",{'user':

"test_user", 'password': "pwd_user", 'ProtocolOrder' : "Https/Soap:5461,

NetTcp:5462"},":/opt/pipc/jdbc/PIJDBCDriver.jar",)

curs= conn.cursor()

a.curs.execute("select * from my_view ")

pi_data_list= curs.fetchall()

for pi_data in pi_data_list:

    print(pi_data)

a.curs.close()

b.conn.close()

 

And the result was:

# python -m py_compile example.py

  File "example.py", line 4

    "test_user", 'password': "pwd_user21", 'ProtocolOrder' : "Https/Soap:5461,

                                                                      ^

SyntaxError: EOL while scanning string literal

 

Could you help me find the error please?

 

Regards.

Outcomes