Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- con = psycopg2.connect(dbname=dbname, host=host, port=port, user=user, password=password)
- cur = con.cursor()
- try3 = "TRUNCATE TABLE (%s);"
- values = ("schema_one.tbl_six",)
- cur.execute(try3,values)
- try4 = "TRUNCATE TABLE %s;"
- values = ("schema_four.tbl_four",)
- cur.execute(try4,values)
- $ ./test_qry.py
- Traceback (most recent call last):
- File "./test_qry.py", line 23, in <module>
- cur.execute(try3,values)
- psycopg2.ProgrammingError: syntax error at or near "("
- LINE 1: TRUNCATE TABLE ('schema_one.tbl_six');
- $ ./test_qry.py
- Traceback (most recent call last):
- File "./test_qry.py", line 28, in <module>
- cur.execute(try4,values)
- psycopg2.ProgrammingError: syntax error at or near "'schema_four.tbl_four'"
- LINE 1: TRUNCATE TABLE 'schema_four.tbl_four';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement