0

With the jaydebeapi package in python it is possible to read from Teradata tables (or probably from every other DB). However i did not find any documentation about writing to the database via jdbc? (The best documentation I found was this --> Link)

Is this not possible?

Or is it just possible with another package?

Mimi Müller
  • 416
  • 8
  • 25

1 Answers1

0

As stated in the REAMDE JayDeBeApi implements Python DB-API v2.0. Basically you have to call the execute on a cursor and pass the insert statement.

But you are right. Some more guidance for novices would be nice. Mybe the Python Wiki or the docs for the sqlite implementation give you some guidance.

Adapting one rather basic sqlite example:

import jaydebeapi
conn = jaydebeapi.connect(...)
curs = conn.cursor()     
curs.execute("INSERT INTO stocks VALUES ('2006-01-05','BUY','RHAT',100,35.14)") ##changes c to curs
conn.commit()
conn.close()
bastian
  • 1,122
  • 11
  • 23