Re: [sqlalchemy] NVARCHAR vs VARCHAR in mssql + convert_unicode='force' Syntax?

2018-10-08 Thread Lukasz Szybalski
On Mon, Oct 8, 2018 at 9:56 AM Mike Bayer wrote: > > > On Mon, Oct 8, 2018 at 10:28 AM Lukasz Szybalski > wrote: > >> >> I have a query in sqlalchemy like below where I lookup contract# in >>>>>> mssql. How do I enforce the varchar instead of nvarcha

Re: [sqlalchemy] NVARCHAR vs VARCHAR in mssql + convert_unicode='force' Syntax?

2018-10-08 Thread Lukasz Szybalski
> I have a query in sqlalchemy like below where I lookup contract# in mssql. How do I enforce the varchar instead of nvarchar? I tried converting my field to "str(mycurrent)" but that didn't do anything. Is there some other spot to force VARCHAR to be sent? >>> >>> >>>

Re: [sqlalchemy] NVARCHAR vs VARCHAR in mssql

2018-06-30 Thread Lukasz Szybalski
On Friday, April 27, 2018 at 4:05:20 PM UTC-5, Lukasz Szybalski wrote: > > > > On Thursday, January 18, 2018 at 11:49:39 AM UTC-6, Mike Bayer wrote: >> >> >> >> On Thu, Jan 18, 2018 at 12:31 PM, Lukasz Szybalski >> wrote: >> >>> Hello, &

Re: [sqlalchemy] NVARCHAR vs VARCHAR in mssql

2018-04-27 Thread Lukasz Szybalski
On Thursday, January 18, 2018 at 11:49:39 AM UTC-6, Mike Bayer wrote: > > > > On Thu, Jan 18, 2018 at 12:31 PM, Lukasz Szybalski <szyb...@gmail.com > > wrote: > >> Hello, >> I have a query in sqlalchemy like below where I lookup contract# in >> m

[sqlalchemy] NVARCHAR vs VARCHAR in mssql

2018-01-18 Thread Lukasz Szybalski
Hello, I have a query in sqlalchemy like below where I lookup contract# in mssql. How do I enforce the varchar instead of nvarchar? I tried converting my field to "str(mycurrent)" but that didn't do anything. Is there some other spot to force VARCHAR to be sent? You can find that the query that

[sqlalchemy] Re: DeferredReflection and mapper

2013-08-14 Thread Lukasz Szybalski
On Wednesday, August 14, 2013 12:10:12 AM UTC-5, Lukasz Szybalski wrote: Hello, How do I go from class like defeinition to below with mapper. The docs in 0.8 say I can use: from sqlalchemy.ext.declarative import DeferredReflectionBase = declarative_base() class MyClass

[sqlalchemy] DeferredReflection and mapper

2013-08-13 Thread Lukasz Szybalski
Hello, How do I go from class like defeinition to below with mapper. The docs in 0.8 say I can use: from sqlalchemy.ext.declarative import DeferredReflectionBase = declarative_base() class MyClass(DeferredReflection, Base): __tablename__ = 'mytable' but how do I do below with

Re: [sqlalchemy] sqlalchemy.exc.DBAPIError: (Error) ('HY003', '[HY003] [FreeTDS][SQL Server]Program type out of range (0) (SQLGetData)') None None

2012-11-21 Thread Lukasz Szybalski
On Friday, November 16, 2012 7:52:00 PM UTC-6, Michael Bayer wrote: On Nov 16, 2012, at 11:44 AM, Lukasz Szybalski wrote: Hello, Any idea what this error message means. I'm trying to execute this: s=session.execute(assp_Checks @begin_date=:start, @end_date=:end,@company_id=1

[sqlalchemy] sqlalchemy.exc.DBAPIError: (Error) ('HY003', '[HY003] [FreeTDS][SQL Server]Program type out of range (0) (SQLGetData)') None None

2012-11-16 Thread Lukasz Szybalski
Hello, Any idea what this error message means. I'm trying to execute this: s=session.execute(assp_Checks @begin_date=:start, @end_date=:end,@company_id=1,params={'start':date_to_process,'end':date_to_process}).fetchall() I get: Traceback (most recent call last): File stdin, line 1, in module

[sqlalchemy] mssql and specifying a schema name?

2012-05-30 Thread Lukasz Szybalski
Hello, I'm trying to autolaod my table image but it keeps complaining that the table doesn't exists. I've enabled the echo = true and I see that you specify in the query: SELECT [COLUMNS_1].[TABLE_SCHEMA], [COLUMNS_1].[TABLE_NAME], [COLUMNS_1].[COLUMN_NAME], [COLUMNS_1].[IS_NULLABLE],

[sqlalchemy] Re: mssql and specifying a schema name?

2012-05-30 Thread Lukasz Szybalski
it? or is it automatically get pulled every time I do a autoload=True? Thanks, Lucas On May 30, 2012, at 1:52 PM, Lukasz Szybalski wrote: Hello, I'm trying to autolaod my table image but it keeps complaining that the table doesn't exists. I've enabled the echo = true and I see

[sqlalchemy] Re: mssql and specifying a schema name?

2012-05-30 Thread Lukasz Szybalski
system it's coming up as MyDatabase.  You'd want to fix that so that it comes up with dbo. Actually, Let me try a different username. That works. The username I was using was admin...so I logged in as me and it has schema name of dbo. Thanks, Lucas On May 30, 2012, at 1:52 PM, Lukasz Szybalski

[sqlalchemy] Re: mssql and specifying a schema name?

2012-05-30 Thread Lukasz Szybalski
On May 30, 2:35 pm, Michael Bayer mike...@zzzcomputing.com wrote: On May 30, 2012, at 3:24 PM, Lukasz Szybalski wrote: On May 30, 1:03 pm, Michael Bayer mike...@zzzcomputing.com wrote: the default schema name is determined by:             SELECT default_schema_name FROM

[sqlalchemy] Re: how to run a stored procedure?

2010-07-22 Thread Lukasz Szybalski
Hello, What if there is a column that is called state When I try to add use_labels inside the execute statement I get below error. Should I be using the use_labels somewhere else?: a[0].State Traceback (most recent call last): File stdin, line 1, in module File

[sqlalchemy] Re: how to run a stored procedure?

2010-07-21 Thread Lukasz Szybalski
how is calling query(colmames)...all() significantly different from simply saying execute(..).fetchall() ?  you get a list of named-tuple like objects in both cases. You are correct, execute().fetchall() does already returns a list of rows, where each row has attributes. I was initially

[sqlalchemy] Re: how to run a stored procedure?

2010-07-20 Thread Lukasz Szybalski
Session.execute() accepts strings that are converted to text(): a=session.execute(assp_ReportDailyTransactions @start_date=:start,@end_date=:end, params={'start':20100701,'end':20100719}) Thanks, That does work. Is it possible to get each record to be returned as object instead of

[sqlalchemy] Re: how to run a stored procedure?

2010-07-20 Thread Lukasz Szybalski
On Jul 20, 3:46 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Jul 20, 2010, at 4:44 PM, Lukasz Szybalski wrote: Session.execute() accepts strings that are converted to text(): a=session.execute(assp_ReportDailyTransactions @start_date=:start,@end_date=:end, params={'start

[sqlalchemy] Re: how to run a stored procedure?

2010-07-20 Thread Lukasz Szybalski
On Jul 20, 4:55 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Jul 20, 2010, at 5:10 PM, Lukasz Szybalski wrote: On Jul 20, 3:46 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Jul 20, 2010, at 4:44 PM, Lukasz Szybalski wrote: Session.execute() accepts strings

[sqlalchemy] Re: how to run a stored procedure?

2010-07-20 Thread Lukasz Szybalski
On Jul 20, 6:02 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Jul 20, 2010, at 6:19 PM, Lukasz Szybalski wrote: On Jul 20, 4:55 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Jul 20, 2010, at 5:10 PM, Lukasz Szybalski wrote: On Jul 20, 3:46 pm, Michael Bayer mike

[sqlalchemy] Re: how to run a stored procedure?

2010-07-19 Thread Lukasz Szybalski
On Jul 15, 3:35 pm, Lukasz Szybalski szybal...@gmail.com wrote: On Jul 15, 2:39 pm, David Gardner dgard...@creatureshop.com wrote: take a look at:http://www.sqlalchemy.org/docs/reference/sqlalchemy/expressions.html?... Now, Could you give me an example of it ? I understand how to run

[sqlalchemy] Re: how to run a stored procedure?

2010-07-19 Thread Lukasz Szybalski
On Jul 19, 10:29 am, Lukasz Szybalski szybal...@gmail.com wrote: On Jul 15, 3:35 pm, Lukasz Szybalski szybal...@gmail.com wrote: On Jul 15, 2:39 pm, David Gardner dgard...@creatureshop.com wrote: take a look at:http://www.sqlalchemy.org/docs/reference/sqlalchemy/expressions.html

[sqlalchemy] how to run a stored procedure?

2010-07-15 Thread Lukasz Szybalski
Hello, I need to get data out of sqlserver by running this stored procedure. From there I convert few fields and add the processed rows to a mysql table that I have created. How can I do the following in sqlalchemy? Is there a pythonic way? Assuming I already have the database connection? What

[sqlalchemy] Re: how to run a stored procedure?

2010-07-15 Thread Lukasz Szybalski
a stored proc? print func.assp_Report_DailyTransactions(start_date='20100701',end_date='20100715') ?? Is this the format? or? Thanks, Lucas On 07/15/2010 12:29 PM, Lukasz Szybalski wrote: Hello, I need to get data out of sqlserver by running this stored procedure

Re: [sqlalchemy] Re: Support for IBM AS/400 database

2010-02-24 Thread Lukasz Szybalski
\ibm_db_sa-0.1.6-py2.6.egg\ibm_db_sa\ibm_db _sa.py, line 24, in module      from sqlalchemy import sql, engine, schema, exceptions, logging ImportError: cannot import name logging   The recipe is assuming SQLAlchemy 0.4.0.  I'm using 0.5.8.      -Jim On 2/19/2010 5:17 PM, Lukasz Szybalski

Re: [sqlalchemy] Support for IBM AS/400 database

2010-02-19 Thread Lukasz Szybalski
http://code.google.com/p/ibm-db/wiki/README Let us know if it worked for you. $ python Python 2.5.1 (r251:54863, Oct 5 2007, 13:36:32) [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2 Type help, copyright, credits or license for more information. import sqlalchemy from

[sqlalchemy] Re: pass any field as a keyword param to the constructor?

2009-11-29 Thread Lukasz Szybalski
I guess the proper solution is to setup your python class mapper like this, and use the update method of the __dict__ instead of setattr. class Recall(object): def __init__(self, **kw): self.__dict__.update(kw) pass Lucas On Thu, Nov 26, 2009 at 3:24 PM, Lukasz Szybalski szybal

Re: [sqlalchemy] Re: pass any field as a keyword param to the constructor?

2009-11-29 Thread Lukasz Szybalski
On Sun, Nov 29, 2009 at 3:58 PM, Michael Bayer mike...@zzzcomputing.com wrote: On Nov 29, 2009, at 2:17 PM, Lukasz Szybalski wrote: I guess the proper solution is to setup your python class mapper like this, and use the update method of the __dict__ instead of setattr. class Recall(object

[sqlalchemy] Re: pass any field as a keyword param to the constructor?

2009-11-26 Thread Lukasz Szybalski
, line 1, in module TypeError: attribute name must be string, not 'NoneType' What is the proper way to do this? Thanks, Lucas On Wed, Nov 25, 2009 at 10:36 PM, Lukasz Szybalski szybal...@gmail.com wrote: http://www.sqlalchemy.org/trac/wiki/UsageRecipes/GenericOrmBaseClass class Recall(OrmObject

[sqlalchemy] pass any field as a keyword param to the constructor?

2009-11-25 Thread Lukasz Szybalski
http://www.sqlalchemy.org/trac/wiki/UsageRecipes/GenericOrmBaseClass class Recall(OrmObject):pass mapper(Recall,recall_table) record=Recall(RECORD_ID=RECORD_ID,CAMPNO=CAMPNO,MAKETXT=MAKETXT) session.add(record) session.flush() This is not working if using the example set in the url. Is setattr

[sqlalchemy] declarative_base vs mapper

2009-07-29 Thread Lukasz Szybalski
Hello, How can I do Index('myindex', xyz.c.type, xyz.c.name, unique=True) in a declarative way? class xyz(DeclarativeBase): __tablename__ = 'xyz' #{ Columns type = Column(Unicode(), nullable=False) name = Column(Unicode(), nullable=False) how do I do index declarative style?

[sqlalchemy] Re: declarative_base vs mapper

2009-07-29 Thread Lukasz Szybalski
On Wed, Jul 29, 2009 at 4:34 PM, Lukasz Szybalskiszybal...@gmail.com wrote: Hello, How can I do Index('myindex', xyz.c.type, xyz.c.name, unique=True) in a declarative way? class xyz(DeclarativeBase):    __tablename__ = 'xyz'    #{ Columns    type = Column(Unicode(), nullable=False)  

[sqlalchemy] ticket_change table

2009-07-28 Thread Lukasz Szybalski
Hello, I want to implement a change log table something similar to ticket_change table in trac. ticket_change table structure: Primary key (ticket, time, field) Index (ticket, time) ticket integer (fk to my table ticket) time inetger author field oldvalue newvalue How can I plugin my

[sqlalchemy] timestamp as int

2009-07-02 Thread Lukasz Szybalski
Hello, What is the equivalent of the following but in the integer version. Column('_last_updated', DateTime(True), default=func.current_timestamp(), onupdate=func.current_timestamp()), Column('_last_updated', Integer,

[sqlalchemy] Re: 0.5.3 ORM, MSSQL and FreeTDS: Invalid Cursor State exception?

2009-06-09 Thread Lukasz Szybalski
On Mon, Jun 8, 2009 at 2:46 PM, ddorothydidoro...@gmail.com wrote: I have looked into this and considered what you have said.  I think I have come up with a potential solution.  It seems to be that the most common driver for mssql on non-windows platforms is going to be freeTDS.  Since there

[sqlalchemy] Re: 0.5.3 ORM, MSSQL and FreeTDS: Invalid Cursor State exception?

2009-04-30 Thread Lukasz Szybalski
On Thu, Apr 30, 2009 at 8:36 AM, Tom Wood thomas.a.w...@gmail.com wrote: Hi Lucas, I don't think #1350 applies here, but just in case, I pass-ed out the mssql dialect do_begin per the suggestion in the discussion thread referenced by that ticket: no impact on the invalid cursor state

[sqlalchemy] Re: 0.5.3 ORM, MSSQL and FreeTDS: Invalid Cursor State exception?

2009-04-29 Thread Lukasz Szybalski
On Wed, Apr 29, 2009 at 9:08 AM, Tom Wood thomas.a.w...@gmail.com wrote: Some additional info, and a possible fix: I can reproduce this problem running the SQLAlchemy dialect unit tests.  Using a trunk (r5930) checkout, FreeTDS 0.82 with tds protocol version 8.0, pyodbc 2.1.4, Python 2.5

[sqlalchemy] Re: 0.5.3 ORM, MSSQL and FreeTDS: Invalid Cursor State exception?

2009-04-27 Thread Lukasz Szybalski
On Mon, Apr 27, 2009 at 10:01 AM, Tom Wood thomas.a.w...@gmail.com wrote: Hi all, Am having a problem with SQLAlchemy 0.5.3 and MSSQL.  Running on a Debian stack, using FreeTDS 0.82, pyodbc 2.1.4, Python 2.5 and (separately) SQL Server 2000 and SQL Server 2005. The (nose) test below fails

[sqlalchemy] Re: 0.5.2 seems to always roll back with mssql

2009-04-17 Thread Lukasz Szybalski
On Mar 25, 2:14 pm, Rick Morrison rickmorri...@gmail.com wrote: Yep, same here. ..on my mssql 2005, I tried this query batch: set implicit_transactions on go select 'After implicit ON', @@trancount exec sp_datatype_info go select 'After query w/implicit', @@trancount begin

[sqlalchemy] Re: 0.5.3 and mssql

2009-04-09 Thread Lukasz Szybalski
the version in that file to 8.0 FreeTS, ODBC, pyODBC and then SQLAlchemy: what a house of cards! ~Matt On Apr 7, 12:58 pm, Lukasz Szybalski szybal...@gmail.com wrote: Hello, Is this still proper connection string for mssql where I specify the tds version and a connection driver name?  e

[sqlalchemy] Re: 0.5.3 and mssql

2009-04-08 Thread Lukasz Szybalski
On Tue, Apr 7, 2009 at 2:58 PM, Lukasz Szybalski szybal...@gmail.com wrote: Hello, Is this still proper connection string for mssql where I specify the tds version and a connection driver name?  e = sqlalchemy.create_engine(mssql://user:p...@server:1433/db_name?driver=TDSodbc_options

[sqlalchemy] 0.5.3 and mssql

2009-04-07 Thread Lukasz Szybalski
Hello, Is this still proper connection string for mssql where I specify the tds version and a connection driver name? e = sqlalchemy.create_engine(mssql://user:p...@server:1433/db_name?driver=TDSodbc_options='TDS_Version=8.0') What is the syntax for driver, and how can I pass TDS_Version=8.0

[sqlalchemy] resultset print keys values

2009-02-10 Thread Lukasz Szybalski
Hello, Could somebody tell me how can I print the object data in my result set without knowing the column names? myresult=session.query(...).all() for i in myresult: print I need to debug some data and its hard to print the object keys and values (column names and its

[sqlalchemy] Re: resultset print keys values

2009-02-10 Thread Lukasz Szybalski
a lot... Lucas On Tuesday 10 February 2009 21:27:09 Lukasz Szybalski wrote: Hello, Could somebody tell me how can I print the object data in my result set without knowing the column names? myresult=session.query(...).all() for i in myresult: print I need to debug some

[sqlalchemy] Re: resultset print keys values

2009-02-10 Thread Lukasz Szybalski
. Then for the remaining items need to loop through to get the value?! I figured there was a uniform function that would return dictionary of key/value pairs that is available on all the possible return objects. __dict__ is good enough for visual inspection for now. Thanks, Lucas Lukasz

[sqlalchemy] Announcing Datahub 0.7

2009-01-11 Thread Lukasz Szybalski
http://lucasmanual.com/mywiki/DataHub *Datahub is a tool that allows faster download/crawl, parse, load, and visualize of data. It achieves this by allowing you to divide each step into its own work folders. In each work folder you get a sample files that you can start coding. *Datahub is for

[sqlalchemy] Re: Error Connecting to MSSQL using pyodbc and SqlAlchemy 0.5.0

2009-01-09 Thread Lukasz Szybalski
On Fri, Jan 9, 2009 at 4:18 PM, TJ Ninneman t...@twopeasinabucket.com wrote: On Jan 9, 2009, at 3:58 PM, TJ Ninneman wrote: Since I've been having troubles with pymssql and 0.5.0 I thought I would try pyodbc on my Mac. I'm able to connect and execute sql using isql without issue: isql

[sqlalchemy] Re: Error Connecting to MSSQL using pyodbc and SqlAlchemy 0.5.0

2009-01-09 Thread Lukasz Szybalski
On Fri, Jan 9, 2009 at 4:46 PM, Rick Morrison rickmorri...@gmail.com wrote: The MSSQL connection string changed for the 0.5 final release. In particular, the dsn keyword is removed, and the pyodbc connection string now expects the DSN to be named where the host was previously placed, so the

[sqlalchemy] Re: MSSQL default_schema

2008-12-23 Thread Lukasz Szybalski
On Tue, Dec 23, 2008 at 3:34 PM, Randall Smith rand...@tnr.cc wrote: Michael Bayer wrote: so if we can confirm this ! .socloseto...release From grepping: For the Oracle dialect get_default_schema_name is used in reflecttable, has_table and has_sequence.

[sqlalchemy] mssql unit tests how?

2008-12-12 Thread Lukasz Szybalski
Hello, During 0.4.6 I was getting some help on mssql via linux, and it was expressed to me that it would be nice to run unit tests of sqlalchemy on mssql. I've just got new sql server 2005 installed if you guys tell me exactly (copy paste) what do I need to do to run these tests, I will run

[sqlalchemy] Re: MSSQL pyodbc connection string - broken for me!

2008-12-10 Thread Lukasz Szybalski
On Wed, Dec 10, 2008 at 1:49 PM, desmaj [EMAIL PROTECTED] wrote: On Dec 10, 1:27 pm, Rick Morrison [EMAIL PROTECTED] wrote: This has been bandied back and forth for months, and I think it's becoming clear that having sqla map dburl's to ODBC connection strings is a losing battle. Yet another

[sqlalchemy] Re: MSSQL pyodbc connection string - broken for me!

2008-12-10 Thread Lukasz Szybalski
On Wed, Dec 10, 2008 at 2:05 PM, Michael Bayer [EMAIL PROTECTED] wrote: On Dec 10, 2008, at 2:49 PM, desmaj wrote: I dislike the idea of relying heavily on DSNs since I don't want SA to tell people how to manage their systems. Giving full support to DSN- less connections let's SA work

[sqlalchemy] Re: MSSQL pyodbc connection string - broken for me!

2008-12-10 Thread Lukasz Szybalski
On Wed, Dec 10, 2008 at 3:42 PM, Rick Morrison [EMAIL PROTECTED] wrote: Whats the status of 0.5, is DSN the default in trunk now ? DSN is the first choice in MSSQLDialect_pyodbc.make_connect_string right now. That's not what I see. I just pulled the 0.5 trunk, which I haven't been

[sqlalchemy] from sqlalchemy all() to subquery to threaded process?

2008-11-21 Thread Lukasz Szybalski
Hello, I am pulling a list of files I need to print from a database and I have all the records after doing the sqlalchemy query with .all() Now I have a list of 3000 files I need to print, around 3 files per userID, I want to print all 3 at the same time in different threads, and my only

[sqlalchemy] Re: select count group_by where ?

2008-10-11 Thread Lukasz Szybalski
On Sat, Oct 11, 2008 at 10:24 PM, Michael Bayer [EMAIL PROTECTED] wrote: We should really fix the MSSQL dialect to not be throwing a SystemError when a SQL statement is not successfully interpreted. I guess syntax error would be more appropriate. I can't see anything wrong with the

[sqlalchemy] Re: select count group_by where ?

2008-10-10 Thread Lukasz Szybalski
On Fri, Oct 10, 2008 at 10:32 AM, Simon [EMAIL PROTECTED] wrote: The statement looks good in my book...what does system error mean exactly? On 10 Okt., 17:15, Lukasz Szybalski [EMAIL PROTECTED] wrote: Hello, Could anybody tell me what is wrong with this select statement? Records

[sqlalchemy] Re: select count group_by where ?

2008-10-10 Thread Lukasz Szybalski
name is), it should be Records.c.TRANS_TYPE. Also, group_by does not take a list but all individual columns as parameters (so just omit those []s). On 10 Okt., 17:38, Lukasz Szybalski [EMAIL PROTECTED] wrote: On Fri, Oct 10, 2008 at 10:32 AM, Simon [EMAIL PROTECTED] wrote: The statement looks

[sqlalchemy] Re: auto incrementing -serializable isolation

2008-10-10 Thread Lukasz Szybalski
and does not rely on Sequence or similar DB-query-and-update mechanims. it also can work on any scheme for numbering - the number itself can be anything, e.g. text, or list dept2-room3-pos7. but i guess can be somewhat too verbose. On Thursday 09 October 2008 23:14:27 Lukasz Szybalski wrote: Hello

[sqlalchemy] Re: mysql to sqlalchemy table definition in .py file?

2008-10-10 Thread Lukasz Szybalski
On Fri, Oct 10, 2008 at 1:50 AM, [EMAIL PROTECTED] wrote: On Friday 10 October 2008 02:06:51 Lukasz Szybalski wrote: On Tue, Sep 30, 2008 at 2:35 AM, [EMAIL PROTECTED] wrote: well it's up to you to extend it to mysql... i don't use mysql, nor i know much about sql anyway; all specific

[sqlalchemy] auto incrementing

2008-10-09 Thread Lukasz Szybalski
Hello, I was wondering if anybody has a good strategy for auto incrementing fields. I want to auto increment field called case# . I have a choice of database auto increment on field case# or do it myself? (correct? No other choices exists? or something in between?) 1. I would like to be able

[sqlalchemy] Re: mysql to sqlalchemy table definition in .py file?

2008-10-09 Thread Lukasz Szybalski
On Tue, Sep 30, 2008 at 2:35 AM, [EMAIL PROTECTED] wrote: well it's up to you to extend it to mysql... i don't use mysql, nor i know much about sql anyway; all specific stuff there is a steal/copy/try/error.

[sqlalchemy] mysql to sqlalchemy table definition in .py file?

2008-09-29 Thread Lukasz Szybalski
Hello, I've asked this about 6 months ago and I was wondering if there was any progress I have existing mysql database, and I would like to connect to it via sqlalchemy using autoload and generate a python file style schema out of it. I want to migrate my existing mysql database to a

[sqlalchemy] from as400 via sqlalchemy to ?

2008-09-25 Thread Lukasz Szybalski
Hello, A while back somebody mentioned they were able to connect to as400. Are there any instructions on how to do that? Could you email them to me. My final goal is to move the data from as400 to mysql or postgresql, while keeping the table layout, and hopefully keys. Any info on what needs to

[sqlalchemy] csv engine?

2008-09-03 Thread Lukasz Szybalski
Hello, I was wondering if there are any plans to have a csv engine for sqlalchemy. I would like to see support for csv. There are some cases where csv is the best way to convert data to and from especially when they require cleaning. What I would like to see is a sqlalchemy wrapping over csv

[sqlalchemy] SqlAchemy and OpenOffice

2008-08-26 Thread Lukasz Szybalski
Hello, I have created a manual and give example on how to use sqlalchemy and openoffice together to create documents. The code shows you how to use openoffice as a document template and fill in the data from the database. I basically use Find and Replace function of openoffice to do the template

[sqlalchemy] Re: Connecting to MySQL

2008-07-10 Thread Lukasz Szybalski
On Thu, Jul 10, 2008 at 8:20 AM, Heston James [EMAIL PROTECTED] wrote: Good afternoon guys, I'm brand new to SQLAlchemy as of about 2 minutes ago, I have a couple of starter questions that I wanted to run past you, with any luck they'll be simple for you to answer. After looking through

[sqlalchemy] Re: Connecting to MySQL

2008-07-10 Thread Lukasz Szybalski
On Thu, Jul 10, 2008 at 11:59 AM, jason kirtland [EMAIL PROTECTED] wrote: Lukasz Szybalski wrote: On Thu, Jul 10, 2008 at 11:26 AM, Heston James - Cold Beans [EMAIL PROTECTED] wrote: Session.add is a version 0.5 method, you're maybe running 0.4.6? In the 0.4.x series, it's going

[sqlalchemy] Re: sqlalchemy in virtualenv Instructions

2008-06-10 Thread Lukasz Szybalski
On Tue, Jun 10, 2008 at 6:12 AM, King Simon-NFHD78 [EMAIL PROTECTED] wrote: Lukasz Szybalski wrote: I have mysqldb installed in the system wide install how do I tell virtualenv to use it? I don't see a need to install it in virtualenv again so I guess I just have to givea right path? How

[sqlalchemy] Re: sqlalchemy in virtualenv Instructions

2008-06-09 Thread Lukasz Szybalski
On Mon, Apr 14, 2008 at 12:12 PM, Lukasz Szybalski [EMAIL PROTECTED] wrote: On Mon, Apr 14, 2008 at 11:38 AM, jason kirtland [EMAIL PROTECTED] wrote: Lukasz Szybalski wrote: On Mon, Apr 14, 2008 at 11:30 AM, jason kirtland [EMAIL PROTECTED] wrote: Lukasz Szybalski wrote: Hello

[sqlalchemy] Re: Transactions and read-only operations

2008-06-07 Thread Lukasz Szybalski
On Sat, Jun 7, 2008 at 2:50 PM, Tomer [EMAIL PROTECTED] wrote: Thanks. What would happen if I didn't do anything (I've seen lots of examples online that will just issue a query like Session.query(User).all() and that's all). Will that query start a transaction if it's a transactional

[sqlalchemy] Re: Creating column comments on the database

2008-06-05 Thread Lukasz Szybalski
On Thu, Jun 5, 2008 at 2:37 AM, Christoph Zwerschke [EMAIL PROTECTED] wrote: Lukasz Szybalski schrieb: I think I prefer info dictionary rather then a string. Dict info which I use already have something like this: sqlalchemy.Column('DRIVE_TRAIN', sqlalchemy.Unicode(4) ,info

[sqlalchemy] mssql and offset support

2008-06-04 Thread Lukasz Szybalski
Hello, From Turbogears website I found out that mssql doesn't support offset query. read below. On Wed, Jun 4, 2008 at 4:20 PM, Lukasz Szybalski [EMAIL PROTECTED] wrote: Paginate uses the same output from the same method, but slices the result differently, that's why

[sqlalchemy] Re: Creating column comments on the database

2008-06-04 Thread Lukasz Szybalski
On Wed, Jun 4, 2008 at 7:41 AM, Christoph Zwerschke [EMAIL PROTECTED] wrote: Does SQLAlchemy support comment on column or comments on other database objects? I expected Column to have a comment keyword, but found nothing of that kind. Maybe I am missing something? I find column comments

[sqlalchemy] Re: mssql and offset support

2008-06-04 Thread Lukasz Szybalski
On Wed, Jun 4, 2008 at 10:22 AM, Rick Morrison [EMAIL PROTECTED] wrote: There's offset support in the current sqla mssql driver. It's implemented using the ansi ROW_NUMBER() OVER construct, which is supported only in mssql 2005 and higher. Since I am using 2000 I don't think its going to work

[sqlalchemy] Re: Creating column comments on the database

2008-06-04 Thread Lukasz Szybalski
On Wed, Jun 4, 2008 at 12:09 PM, Christoph Zwerschke [EMAIL PROTECTED] wrote: Lukasz Szybalski schrieb: I started using info dict on a column names in sa file definitions. It would be nice to save it to db if once could. What db supports comments and what table name is it? Oracle

[sqlalchemy] how many query objects in sa?

2008-05-28 Thread Lukasz Szybalski
Hello, I have used the following to query my data: #start class th(object): pass mapper(th,th_table) a=session.query(th).filter(sqlalchemy.and_(th.APPLIED_TEST==1,th.CODING_DATE=='20080325')).all() #end I noticed that there is a query

[sqlalchemy] Re: how many query objects in sa?

2008-05-28 Thread Lukasz Szybalski
On Wed, May 28, 2008 at 11:59 AM, Michael Bayer [EMAIL PROTECTED] wrote: On May 28, 2008, at 12:36 PM, Lukasz Szybalski wrote: Hello, I have used the following to query my data: #start class th(object): pass mapper(th,th_table) a = session .query (th ).filter

[sqlalchemy] Re: how many query objects in sa?

2008-05-28 Thread Lukasz Szybalski
On Wed, May 28, 2008 at 1:07 PM, Lukasz Szybalski [EMAIL PROTECTED] wrote: On Wed, May 28, 2008 at 11:59 AM, Michael Bayer [EMAIL PROTECTED] wrote: On May 28, 2008, at 12:36 PM, Lukasz Szybalski wrote: Hello, I have used the following to query my data: #start class th(object

[sqlalchemy] Re: how many query objects in sa?

2008-05-28 Thread Lukasz Szybalski
On Wed, May 28, 2008 at 2:07 PM, Michael Bayer [EMAIL PROTECTED] wrote: On May 28, 2008, at 2:44 PM, Lukasz Szybalski wrote: sorry. I copied the wrong query Just for clarification: session.query(th).somefilter is same as th.query().somefilter correct? there is a query attribute

[sqlalchemy] Re: filtering by datetime elements

2008-05-17 Thread Lukasz Szybalski
On Sat, May 17, 2008 at 11:20 AM, Eric Abrahamsen [EMAIL PROTECTED] wrote: On May 17, 2008, at 11:17 PM, [EMAIL PROTECTED] wrote: it's SQL that is not working with python objects, and the column pubdate (associated with type DateTime on python side) has no attr .year or .month. lookup the

[sqlalchemy] Re: Access to AS/400 data

2008-05-16 Thread Lukasz Szybalski
On Fri, May 16, 2008 at 12:03 PM, Carlos Hanson [EMAIL PROTECTED] wrote: On Fri, May 16, 2008 at 8:14 AM, Michael Bayer [EMAIL PROTECTED] wrote: On May 16, 2008, at 10:55 AM, Carlos Hanson wrote: On Fri, May 16, 2008 at 6:13 AM, Jim Steil [EMAIL PROTECTED] wrote: Hi: Can anyone tell

[sqlalchemy] Re: Connecting to an MS SQL server ?

2008-05-15 Thread Lukasz Szybalski
On Thu, May 15, 2008 at 12:51 PM, Yannick Gingras [EMAIL PROTECTED] wrote: TkNeo [EMAIL PROTECTED] writes: Hi, Hello Tarun, This is my first encounter with sqlalchemy. I am trying to connect to an MS SQL server 2000 that is not on local host. I want to connect using Integrated Security

[sqlalchemy] Re: database definitions - was sqlalchemy migration/schema creation

2008-05-14 Thread Lukasz Szybalski
On Fri, May 9, 2008 at 10:14 AM, [EMAIL PROTECTED] wrote: On Friday 09 May 2008 16:32:25 Lukasz Szybalski wrote: On Fri, May 9, 2008 at 4:46 AM, [EMAIL PROTECTED] wrote: On Friday 09 May 2008 03:05, Lukasz Szybalski wrote: Do you guys know what would give me column definition of table

[sqlalchemy] Re: database definitions - was sqlalchemy migration/schema creation

2008-05-09 Thread Lukasz Szybalski
On Fri, May 9, 2008 at 4:46 AM, [EMAIL PROTECTED] wrote: On Friday 09 May 2008 03:05, Lukasz Szybalski wrote: Do you guys know what would give me column definition of table? do u want it as generated source-text or what? Yes. The Final output I would like is the txt version of db

[sqlalchemy] database definitions - was sqlalchemy migration/schema creation

2008-05-08 Thread Lukasz Szybalski
in metadata.tables: ... print i list of columns: for i in metadata.tables['WMI'].original_columns: ... print i How do I get column type, indexes and primary keys? Lucas On Tue, Apr 15, 2008 at 7:44 PM, Lukasz Szybalski [EMAIL PROTECTED] wrote: Hello, Is there maybe a feature in sqlalchemy

[sqlalchemy] Re: mssql, Linux, unixODBC - Could not locate column in row for column

2008-05-02 Thread Lukasz Szybalski
On Tue, Apr 22, 2008 at 9:35 AM, Lukasz Szybalski [EMAIL PROTECTED] wrote: e = sqlalchemy.create_engine(mssql://xxx:[EMAIL PROTECTED]:1433/xx?driver=TDSodbc_options='TDS_Version=8.0') here is a patch to mssql.py that makes above line work. 805c805,808

[sqlalchemy] Re: multiple databases ?

2008-04-23 Thread Lukasz Szybalski
On Tue, Apr 22, 2008 at 11:54 AM, Lukasz Szybalski [EMAIL PROTECTED] wrote: Hello again, So now that I have mssql connection ready and data filtered out and processed I need to save it to a different database. mssql - process data - save to mysql I am wondering how should I create

[sqlalchemy] Re: mssql, Linux, unixODBC - Could not locate column in row for column

2008-04-22 Thread Lukasz Szybalski
e = sqlalchemy.create_engine(mssql://xxx:[EMAIL PROTECTED]:1433/xx?driver=TDSodbc_options='TDS_Version=8.0') here is a patch to mssql.py that makes above line work. 805c805,808 connectors.append(keys.pop('odbc_options')) --- odbc_options=keys.pop('odbc_options')

[sqlalchemy] multiple databases ?

2008-04-22 Thread Lukasz Szybalski
Hello again, So now that I have mssql connection ready and data filtered out and processed I need to save it to a different database. mssql - process data - save to mysql I am wondering how should I create a second database connection? In second database I will create a table and populate the

[sqlalchemy] Re: multiple databases ?

2008-04-22 Thread Lukasz Szybalski
On Tue, Apr 22, 2008 at 6:00 PM, [EMAIL PROTECTED] wrote: On Tuesday 22 April 2008 19:54:16 Lukasz Szybalski wrote: Hello again, So now that I have mssql connection ready and data filtered out and processed I need to save it to a different database. mssql - process data - save

[sqlalchemy] Re: mssql, Linux, unixODBC - Could not locate column in row for column

2008-04-18 Thread Lukasz Szybalski
On Fri, Apr 18, 2008 at 11:07 AM, jason kirtland [EMAIL PROTECTED] wrote: Rick Morrison wrote: Yeah, I was under the impression that config args passed in via create_engine() ctor and via dburi were treated the same, but looking over engine/strategies.py, it looks as if they have two

[sqlalchemy] Re: mssql, Linux, unixODBC - Could not locate column in row for column

2008-04-18 Thread Lukasz Szybalski
On Fri, Apr 18, 2008 at 1:36 PM, Rick Morrison [EMAIL PROTECTED] wrote: Err, on a second look, that's no good. The connect_args are passed directly through to connect(). This thing needs to construct an ODBC connection string from some fragments provided by the dburi, and from some engine

[sqlalchemy] Re: mssql, Linux, unixODBC - Could not locate column in row for column

2008-04-17 Thread Lukasz Szybalski
On Mon, Apr 7, 2008 at 4:37 PM, Rick Morrison [EMAIL PROTECTED] wrote: The limitation here I guess is 30 char identifier limit but I will need to test it. Ah yeah, you're going to have bigger problems than 30 char identifiers with the Sybase TDS settings. MSSQL uses a different set of

[sqlalchemy] Re: mssql, Linux, unixODBC - Could not locate column in row for column

2008-04-17 Thread Lukasz Szybalski
On Thu, Apr 17, 2008 at 10:02 AM, Lukasz Szybalski [EMAIL PROTECTED] wrote: On Mon, Apr 7, 2008 at 4:37 PM, Rick Morrison [EMAIL PROTECTED] wrote: The limitation here I guess is 30 char identifier limit but I will need to test it. Ah yeah, you're going to have bigger problems

[sqlalchemy] Re: mssql, Linux, unixODBC - Could not locate column in row for column

2008-04-17 Thread Lukasz Szybalski
On Thu, Apr 17, 2008 at 12:14 PM, Rick Morrison [EMAIL PROTECTED] wrote: Here are the options as specified by free TDS. What you are talking about is setting it in conf file which is used only for dsn connection. No, I meant as the *default* TDS version here. See here:

[sqlalchemy] Re: mssql, Linux, unixODBC - Could not locate column in row for column

2008-04-17 Thread Lukasz Szybalski
On Thu, Apr 17, 2008 at 2:07 PM, Rick Morrison [EMAIL PROTECTED] wrote: It's in trunk r4518. Take 'er for a spin and let me know how it works out. got an error: e = sqlalchemy.create_engine('mssql://xxx:[EMAIL PROTECTED]:1433/',odbc_options='DRIVER={TDS};TDS_Version=8.0') Traceback (most

[sqlalchemy] Re: mssql, Linux, unixODBC - Could not locate column in row for column

2008-04-17 Thread Lukasz Szybalski
On Thu, Apr 17, 2008 at 2:35 PM, Rick Morrison [EMAIL PROTECTED] wrote: Does it matter what case are the parameters? DRIVER in pyodbc, we used 'driver' in previous connection strings etc... No the parameters are a straight pass-through, that traceback is complaining about the

[sqlalchemy] Re: mssql, Linux, unixODBC - Could not locate column in row for column

2008-04-17 Thread Lukasz Szybalski
On Thu, Apr 17, 2008 at 3:04 PM, Rick Morrison [EMAIL PROTECTED] wrote: It's a two-line change that pops the new keyword out of the config dict just like the others that were added. Mike, can you take a quick look at mssql.py line 804 and see why this might be complaining? I've got to run

[sqlalchemy] Re: sqlalchemy migration/schema creation

2008-04-16 Thread Lukasz Szybalski
On Wed, Apr 16, 2008 at 1:03 AM, [EMAIL PROTECTED] wrote: a separate feature - no. but it's not much to do it. here my attempt at this. try copyall or copydata+autoload from here: http://dbcook.svn.sourceforge.net/viewvc/dbcook/trunk/dbcook/misc/metadata/ svn co

[sqlalchemy] sqlalchemy migration/schema creation

2008-04-15 Thread Lukasz Szybalski
Hello, Is there maybe a feature in sqlalchemy that would allow me to autoload table from one database, and move it over to another database? 1. I would like to print data structure from autoload table. (then copy and paste it into new file and use it to create new table)(without typing every

[sqlalchemy] sqlalchemy in virtualenv Instructions

2008-04-14 Thread Lukasz Szybalski
Hello, Below you can find instructions on how to setup sqlalchemy in virtual environment. http://lucasmanual.com/mywiki/TurboGears#head-36fb4094da01b8c28e8bdca803c0f05774eb13b8 Enjoy, Lucas -- Automotive Recall Database. Cars, Trucks, etc. http://www.lucasmanual.com/recall/ Install Broadcom

  1   2   >