[sqlalchemy] Mention special meaning of pool_size=0 and recommend NullPool in documentation of pool_size parameters.
I reopened http://www.sqlalchemy.org/trac/ticket/1164, and added a documentation-only patch, after spending some time trying to figure out the same behavior as stumped the original submitter. I hope that's appropriate. -- 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: executing stored procedure which returns rows
select * from (procedure_foo) That would be lovely, but I can find no way to wrap a procedure in a select. If it were possible I could have just rewritten the procedure call as a select and matched the existing regexp. you can do that as select([*]).select_from(func.procedure.foo()) . Thanks, I understand that that will generate SELECT * FROM procedure_foo(); the trouble is that SQL Server does not permit selecting from procedures in that way. Happily, though, I realized I can create a table-valued function that executes the procedure, and I can select from the table-valued function in this 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] Re: executing stored procedure which returns rows
Stored procedures can also be called simply by name, omitting the EXEC: EXEC procedure_foo parms or procedure_foo parms True, but as you suggested it's hardly a burden to type the EXEC. and I believe they can also be called from within a subquery: select * from (procedure_foo) That would be lovely, but I can find no way to wrap a procedure in a select. If it were possible I could have just rewritten the procedure call as a select and matched the existing regexp. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] Re: executing stored procedure which returns rows
I think we should also add a flag to text() which allows this too, along the lines of returns_results=True. +1 on that, it would be useful as a fallback for those oddball situations. Indeed, Microsoft SQL Server interprets myriad bespoke SQL constructs which return results. Perhaps the MSSQLDialect.reflecttable() implementation should use the flag itself rather than special-case the regexp for sp_columns. Or it could just use EXEC presuming it is added to the regexp. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] executing stored procedure which returns rows
I'm using and loving SQLAlchemy 0.4.3dev_r4136 but I am having a problem with (drum roll) a legacy database schema. I'm using pyodbc on Unix. The primary keys in a legacy table are alphanumeric and must be generated by a MSSQL stored procedure which returns a single result row with a single unnamed char(12). How can I execute this procedure with SQLAlchemy? I tried the obvious session.execute(EXEC sp_new_foo_key).fetchone() and variations with text() and select() but I always get this error: class 'pyodbc.ProgrammingError': Attempt to use a closed cursor. The typemap argument to text() looked like it might do what I need, but I don't see how to use it with the unnamed result column, and I'm not sure it would actually result in the correct execution method. I gather this is because the mssql dialect implements returns_rows_text() as a regexp matching just SELECT and sp_columns. SQL Server Profiler shows the statement being executed from SQLAlchemy as an RPC instead of a SQL batch like when I do the EXEC from SQL Server Management Studio. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] Re: executing stored procedure which returns rows
I'm using pyodbc on Unix. blink You are??? This statement jumped out of the message for me. Can you please describe your setup to the list? There is a lot of interest in this configuration. I am using unixodbc-2.2.11 as packaged by Ubuntu 7.10 (gutsy) with locally-installed freetds-0.64 (the tdsodbc Ubuntu package was 0.63 and had issues with SQL Server 2005) and locally-installed pyodbc-2.0.52. I configured the server with tds version = 8.0 in /etc/ freetds/freetds.conf, defined the FreeTDS driver in /etc/odbcinst.ini, and the DSN in /etc/odbc.ini; it works fine once I figured out the URL needs to look like mssql://myuser:mypass@/mydbname?dsn=DSN_FROM_ODBCINI (note the slash after the at symbol). I know the documentation suggests this is not reliable, but I haven't had any problems that I would attribute to pyodbc. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---