Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import psycopg2
- import psycopg2.extras
- cursor = %(connection/client)%.cursor(cursor_factory=psycopg2.extras.RealDictCursor)
- cursor.execute('''
- INSERT INTO %table_name% (
- Number,
- Color,
- Odd_even,
- Low_high,
- Column,
- Sector
- ) VALUES (
- %(Number)s,
- %(Color)s,
- %(Odd_even)s,
- %(Low_high)s,
- %(Column)s,
- %(Sector)s
- )
- ''', {
- 'Number': '15',
- 'Color': 'black',
- 'Odd_even': 'odd',
- 'Low_high': '1/18',
- 'Column': 'Column3',
- 'Sector': 'Sector2'
- })
- cursor.commit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement