yeah thnks for the help.

one more dbt. do i have to provide values as dict always ie. with
column name. Can i give direct values like we do in normal sql.?
thnks in advance

On Jun 9, 9:02 am, Michael Bayer <mike...@zzzcomputing.com> wrote:
> you need to use the executemany form described 
> athttp://www.sqlalchemy.org/docs/05/sqlexpression.html#executing-multip...
>   .
>
> On Jun 8, 2009, at 11:54 PM, Ashish Bhatia wrote:
>
>
>
>
>
> > Sorry, Its my typing mistake :( . I put : insted , . But still my
> > question yeat remained unanswered. :(
>
> > On Jun 8, 7:50 pm, Didip Kerabat <did...@gmail.com> wrote:
> >> You have Syntax Error here:
>
> >> ('sdsd':'sdsds')
>
> >> That one should be tuple right?
>
> >> - Didip -
>
> >> On Mon, Jun 8, 2009 at 6:14 AM, Ash <ashishsinghbha...@gmail.com>  
> >> wrote:
>
> >>> Hello ,
>
> >>> I am trying to insert in the table using two ways in the values  
> >>> which
> >>> i show below
>
> >>> engine = sqlalchemy.create_engine(<to poastgres>)
> >>> metadata = MetaData()
>
> >>> t1 = Table('master',metadata) # assume master has 2 feilds name ,  
> >>> city
>
> >>> t1.insert({'name':'tttt','city':'bank'})
>
> >>> engine,execute(t1)
>
> >>> This works for fine me.
>
> >>> If i make values like this
> >>> tt = [('asasas','belhium'),('sdsd':'sdsds')]
>
> >>> t1.insert(values=tt)
>
> >>> i get error
> >>> sqlalchemy.exceptions.ProgrammingError: (ProgrammingError) syntax
> >>> error at or near ")"
> >>> LINE 1: INSERT INTO abc () VALUES ()
> >>>                                ^
> >>>  'INSERT INTO abc () VALUES ()' {}
>
> >>> Can any one guide whts wrong... i jnow  value is not being passed so
> >>> anyother way.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@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
-~----------~----~----~----~------~----~------~--~---

Reply via email to