[sqlalchemy] compile().params

2009-06-30 Thread Ash
Hello, I am trying to make the in clause and appending in where clause with and/or I used in_ to make the in clause I want to make the dynamic where so i go on makking the and_, or _and the end result i put in where Now the priblem is with in clause. Eg : i made in like res = id in_((1,2,3,4

[sqlalchemy] Dynamic making of the where clause

2009-06-23 Thread Ash
Hello, I am tryin to make the dynamic where clause using append_whereclause. But how i can do that, For eg : I have a==b and c in (1,2,3,4) or d like %s So i made three sqlalchemy expression 1. a==b 2. c in (1,2,3,4) [ using in_] 3. d like %s [using like] now i want this 3 to stuff in where

[sqlalchemy] insert statment

2009-06-08 Thread Ash
Hello , I am trying to insert in the table using two ways in the values which i show below engine = sqlalchemy.create_engine() metadata = MetaData() t1 = Table('master',metadata) # assume master has 2 feilds name , city t1.insert({'name':'','city':'bank'}) engine,execute(t1) This works f

[sqlalchemy] Adding alias to columns

2009-05-28 Thread Ash
Hello, I want to add the alias for the columns is it possible in sqlalchemy. Say i have select id as uid from xyz so i do like this t1 = Table("xyz", metadata) id = Column("id") Now i want to add alias to it id = Column("id",alias_= "uid") :( didnt work Can i add it later like i make default

[sqlalchemy] making join with using clause

2009-05-28 Thread Ash
Hello I want to make a join with using . Eg. Table1 join table2 using (id) How can i do this? I have tried for join like table1 join table on t1.xx = t2.xx Making the object like t1 = Table(t1 ,metadata) t2 = Table(t2 ,metadata) t1xx = Column(xx) t1.append_column(t1xx) t2xx = Column(xx) t2.ap

[sqlalchemy] deepcopy of sqlalchemy object

2009-03-25 Thread Ash
I have made some sql.expression and add them in dict like {'where':[ ]} something like this In the process it goes in some other dict When now i try to do deepcopy i get error File "/var/lib/python-support/python2.5/sqlalchemy/util.py", line 574, in __setitem__ self._list.append(key) Attribu

[sqlalchemy] Creating SQL Expression

2009-02-24 Thread Ash
Hello , I am trying to make query like select (a+b) from xyz; to do this xyz = sqlalchemy.Table('xyz',metadata) a = sqlalchemy.Column('a', sqlalchemy.Integer) xyz.append_column(a) b = sqlalchemy.Column('b', sqlalchemy.Integer) xyz.append_column(b) column = [(a + b)] select = sqlalchemy.selec

[sqlalchemy] Re: metadata.bind.echo = True

2009-01-02 Thread Ash
but i dont want to see all this queries only the query i execute On Jan 1, 10:29 pm, Michael Bayer wrote: > thats the SQL which SQLAlchemy is emitting. > > On Jan 1, 2009, at 2:31 AM, Ash wrote: > > > > > Hello > > > i am using sqlalchemy > > > and t

[sqlalchemy] metadata.bind.echo = True

2008-12-31 Thread Ash
Hello i am using sqlalchemy and to trace the query i use metadata.bind.echo = True but the o/p is very strange it gives the catalog queries. like INFO:sqlalchemy.engine.base.Engine.0x..4c: SELECT attname FROM pg_attribute WHERE attrelid = ( SELECT indexrelid FR

[sqlalchemy] sqlalchemy.func.sum

2008-12-08 Thread Ash
Hello , I am usinng sqlalchemy for making the sum on column i am using sqlalchemy.func.sum (col_name). I am getting the error while dng it . Code snnipet aggregator=sqlalchemy.func.sum('product_sold') make_select = sqlalchemy.select(from_obj=[sales],columns= [aggregator],distin

[sqlalchemy] Cross Join

2008-11-21 Thread Ash
Hello, I want to know how to implement the cross join using sqlalchemy I create the metadata say metadata i have table a and b which i want to cross join. a_o = sqlalchemy.Table('a',metadata,autoload=True) b_o = sqlalchemy.Table('b',metadata,autoload=True) j = join(a_o,b_o, onclause=a_o.c.b_i

[sqlalchemy] Re: Problem in Code

2008-11-14 Thread Ash
Sorry i got the error and now its working On Nov 15, 11:10 am, Ash <[EMAIL PROTECTED]> wrote: > Hello, > > I am using sqlalchemy version 0.4.6 > > While running i am gettng the error > Code : > engine = sqlalchemy.create_engine("postgres://[EMAIL PROTECTED]:54

[sqlalchemy] Problem in Code

2008-11-14 Thread Ash
Hello, I am using sqlalchemy version 0.4.6 While running i am gettng the error Code : engine = sqlalchemy.create_engine("postgres://[EMAIL PROTECTED]:5432/ aaa",echo=True) metadata = sqlalchemy.MetaData(engine) table_a1=sqlalchemy.Table('table_a1', metadata, autoload=True) I am getting error i

[sqlalchemy] Problem in making joins

2008-09-14 Thread Ash
Hello, I tried with joins on sqlalchemy (Postgres) It gives me a error that i cant figure out . But the query it gives me (echo True) Works fine seems to be no error in this . Thanks in advance --~--~-~--~~~---~--~~ You received this message because you are subs

[sqlalchemy] Getting quater wise result using date_part

2007-11-22 Thread Ash
Hi to everyone I am using date_part to get data from PostgresSQL and i want to fetch data quarter wise (Q!,Q2,Q3,Q4) The query date_part('month', ) in (1,2,3) works well in postgres and fetch for first 3 months but how to put it in sqlalchemy ... I hope u got what i am asking for . Pls help i