[sqlalchemy] Re: oracle insert problem

2010-03-04 Thread celord
Thanks a lot Michael, now it works! this is my final script, maybe it
could help others:

engine = create_engine('oracle://user:passw...@host:1521/dbname',
echo=True)
metadata = MetaData()

pushmail_table = Table('pushmail', metadata,
Column('telefono', String, primary_key=True),
Column('fecha', DateTime, default=datetime.datetime.now ),
Column('correo', String),
schema='manpushmail'
)

On sqlplus I do a : SELECT * FROM MANPUSHMAIL.PUSHMAIL;



On 2 mar, 16:34, Michael Bayer mike...@zzzcomputing.com wrote:
 additionally don't shove a schema/owner name into your table's name field.  
 Use the schema kw arg for that.

 On Mar 2, 2010, at 4:23 PM, celord wrote:

  Thanks Michael, I have changed all UPERCASE to lowercase
 http://www.pastebin.org/100149, the output has changed a bit but the
  table name is still quoted and the insert does not work

  sqlalchemy.exc.DatabaseError: (DatabaseError) ORA-00942: table or view
  does not exist
  'INSERT INTO manpushmail.pushmail (telefono, fecha, correo) VALUES
  (:telefono, :fecha, :correo)' {'correo': 'cgar...@ice.co.cr', 'fecha':
  ' ', 'telefono': '87445511'}

  On 2 mar, 12:39, Michael Bayer mike...@zzzcomputing.com wrote:
  read the note about case sensitivity in

 http://www.sqlalchemy.org/docs/reference/dialects/oracle.html?highlig...

  celord wrote:
  Hello guys, I have the table on an oracle db:

  SQL desc MANPUSHMAIL.PUSHMAIL;
   Nombre                                     Nulo?  Tipo
   - 
  
   TELEFONO                             NOT NULL VARCHAR2(12)
   FECHA                                                 DATE
   CORREO                                        VARCHAR2(40)
   ESTADO                                        NUMBER(1)
   FECHA_EJECUCION                               DATE
   FECHA_EJECUTADO                               DATE
   RESPUESTA                                     VARCHAR2(500)

  I can insert data succesfully  via sqlplus like this:

  insert into MANPUSHMAIL.PUSHMAIL values
  ('',sysdate,'t...@domain.con','','','','');

  but using this scripthttp://www.pastebin.org/100014viasqlalchemy I
  get this:

  sqlalchemy.exc.DatabaseError: (DatabaseError) ORA-00942: table or view
  does not exist
   'INSERT INTO MANPUSHMAIL.PUSHMAIL (FECHA, CORREO) VALUES
  (:FECHA, :CORREO) RETURNING MANPUSHMAIL.PUSHMAIL.TELEFONO
  INTO :ret_0' {'CORREO': None, 'FECHA': None, 'ret_0':
  cx_Oracle.STRING with value None}

  I do not know if the error could be here: 'INSERT INTO
  MANPUSHMAIL.PUSHMAIL, because when I try to do the insert with the
  table name between quotes I get the same error:

  insert into MANPUSHMAIL.PUSHMAIL values
  ('',sysdate,'te...@domain.com','','','','')
  ORA-00942: table or view does not exist

  I am using sqlalchemy version: 0.6beta1 , Python 2.6 on a Solaris 10
  box, and Oracle Database 10g Enterprise Edition Release 10.2.0.1.0

  Thanks a lot!!!

  --
  You received this message because you are subscribed to the Google Groups
  sqlalchemy group.
  To post to this group, send email to sqlalch...@googlegroups.com.
  To unsubscribe from this group, send email to
  sqlalchemy+unsubscr...@googlegroups.com.
  For more options, visit this group at
 http://groups.google.com/group/sqlalchemy?hl=en.

  --
  You received this message because you are subscribed to the Google Groups 
  sqlalchemy group.
  To post to this group, send email to sqlalch...@googlegroups.com.
  To unsubscribe from this group, send email to 
  sqlalchemy+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://groups.google.com/group/sqlalchemy?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.



[sqlalchemy] Re: oracle insert problem

2010-03-02 Thread celord
Thanks Michael, I have changed all UPERCASE to lowercase
http://www.pastebin.org/100149, the output has changed a bit but the
table name is still quoted and the insert does not work

sqlalchemy.exc.DatabaseError: (DatabaseError) ORA-00942: table or view
does not exist
 'INSERT INTO manpushmail.pushmail (telefono, fecha, correo) VALUES
(:telefono, :fecha, :correo)' {'correo': 'cgar...@ice.co.cr', 'fecha':
' ', 'telefono': '87445511'}

On 2 mar, 12:39, Michael Bayer mike...@zzzcomputing.com wrote:
 read the note about case sensitivity in

 http://www.sqlalchemy.org/docs/reference/dialects/oracle.html?highlig...

 celord wrote:
  Hello guys, I have the table on an oracle db:

  SQL desc MANPUSHMAIL.PUSHMAIL;
   Nombre                                     Nulo?  Tipo
   - 
  
   TELEFONO                             NOT NULL VARCHAR2(12)
   FECHA                                                 DATE
   CORREO                                        VARCHAR2(40)
   ESTADO                                        NUMBER(1)
   FECHA_EJECUCION                               DATE
   FECHA_EJECUTADO                               DATE
   RESPUESTA                                     VARCHAR2(500)

  I can insert data succesfully  via sqlplus like this:

  insert into MANPUSHMAIL.PUSHMAIL values
  ('',sysdate,'t...@domain.con','','','','');

  but using this scripthttp://www.pastebin.org/100014via sqlalchemy I
  get this:

  sqlalchemy.exc.DatabaseError: (DatabaseError) ORA-00942: table or view
  does not exist
   'INSERT INTO MANPUSHMAIL.PUSHMAIL (FECHA, CORREO) VALUES
  (:FECHA, :CORREO) RETURNING MANPUSHMAIL.PUSHMAIL.TELEFONO
  INTO :ret_0' {'CORREO': None, 'FECHA': None, 'ret_0':
  cx_Oracle.STRING with value None}

  I do not know if the error could be here: 'INSERT INTO
  MANPUSHMAIL.PUSHMAIL, because when I try to do the insert with the
  table name between quotes I get the same error:

  insert into MANPUSHMAIL.PUSHMAIL values
  ('',sysdate,'te...@domain.com','','','','')
  ORA-00942: table or view does not exist

  I am using sqlalchemy version: 0.6beta1 , Python 2.6 on a Solaris 10
  box, and Oracle Database 10g Enterprise Edition Release 10.2.0.1.0

  Thanks a lot!!!

  --
  You received this message because you are subscribed to the Google Groups
  sqlalchemy group.
  To post to this group, send email to sqlalch...@googlegroups.com.
  To unsubscribe from this group, send email to
  sqlalchemy+unsubscr...@googlegroups.com.
  For more options, visit this group at
 http://groups.google.com/group/sqlalchemy?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.