Advertisement
Guest User

Untitled

a guest
Apr 11th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. CREATE OR REPLACE FUNCTION Add_to_stroke(my_stroke VARCHAR(50))
  2. RETURNS VOID
  3. AS $$
  4. BEGIN
  5. INSERT INTO stroke VALUES (my_stroke);
  6. END $$
  7. LANGUAGE plpgsql
  8. VOLATILE;
  9.  
  10. conn = psycopg2.connect("dbname=postgres user=postgres password=psswd")
  11. cur = conn.cursor()
  12. cur.callproc('Add_to_stroke','freestyle')
  13.  
  14. ProgrammingError: function add_to_stroke(unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown) does not exist
  15. LINE 1: SELECT * FROM add_to_stroke('f','r','e','e','s','t','y','l',...
  16. ^
  17. HINT: No function matches the given name and argument types. You might need to add explicit type casts.
  18.  
  19. SELECT Add_to_stroke('Freestyle')
  20.  
  21. foo = 'Freestyle'
  22. cur.execute("SELECT add_to_stroke(%s)",(foo,))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement