Advertisement
Guest User

Untitled

a guest
May 8th, 2016
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. import fdb
  2. import os
  3.  
  4. ruta = 'localhost:C:/Users/Beto/Documents/Proyectos python/Ruby/sama.fdb'
  5.  
  6. try:
  7. con = fdb.connect(
  8. dsn = ruta,
  9. user = 'sysdba',
  10. password = '*******',
  11. charset = 'utf-8'
  12. )
  13. print('Conectado !!')
  14. except:
  15. print('Fallo la conexion', ruta)
  16.  
  17.  
  18.  
  19. cx = con.cursor()
  20. sql = 'SELECT * FROM user'
  21. cx.execute(sql)
  22.  
  23. filas = cx.fetchall()
  24. print(filas)
  25. con.commit()
  26. con.close()
  27.  
  28. Traceback (most recent call last):
  29. File "C:UsersBetoDocumentsProyectos pythonRubyfire.py", line 22, in <module>
  30. cx.execute(sql)
  31. File "C:UsersBetoAppDataLocalProgramsPythonPython35libsite-packagesfdbfbcore.py", line 3573, in execute
  32. self._ps = PreparedStatement(operation, self, True)
  33. File "C:UsersBetoAppDataLocalProgramsPythonPython35libsite-packagesfdbfbcore.py", line 2182, in __init__
  34. "Error while preparing SQL statement:")
  35. fdb.fbcore.DatabaseError: ('Error while preparing SQL statement:n- SQLCODE: -104n- Dynamic SQL Errorn- SQL error code = -104n- Token unknown - line 1, column 15n- user', -104, 335544569)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement