that's the issue. we grep for "SELECT"-like statements in order to
determine if we can close the cursor immediately. I think adding EXEC
to the ms_is_select would fix this. As far as RPC vs. SQL batch
that's determined by the DBAPI - we call cursor.execute() as opposed
to callproc(), if thats significant.
>I am using unixodbc-2.2.11 as packaged by Ubuntu 7.10 (gutsy) with
>
>
That sounds very promising, I have been meaning to have a go at this for
a while.
Can you do me a favor and run the unit tests using your current setup?
Run alltests.py and append &text_as_varchar=1 to the dburi (a few mssql
tests rely on this). Save the stdout and stderr and send them to me.
This would really help us gauge how much work on unix support is needed.
For comparison, a run on windows with pyodbc has about 40 test failures.
Paul
I think we should also add a flag to text() which allows this too,
along the lines of "returns_results=True".
is the EXEC the only way to call an SP in MS-SQL ? no SELECT
<procname> ?
There was some talk of trying to auto-detect resultsets with cursor
inspection. My recollection from poking at it was that results were
promising on most db-apis, but server-side cursors remained to be
tested. If that can't be 100% reliable then we would definitely need a
hinting flag.
True, as long as the call is the first statement in the batch;
otherwise, you need the exec.
>
> and I believe they can also be called from within a subquery:
>
> select * from (procedure_foo)
No, but mssql has the concept of "table-valued user defined function",
so you could have something like
select * from dbo.foo(@var)
-- think of it as a "parameterized view".
I agree that something like the "returns_results" hint might be a good
way to go.
--
Don Dwiggins
Advanced Publishing Technology
It's not that fancy: just checking for the cursor.description attribute.
There needs to be some work done in this area anyhow. I noticed that
the MySQLdb db-api crashes if a stored procedure returns multiple result
sets and nextset() isn't called for all of them... so we'd want to be
able to detect a pending resultset in any case. And support procedures
returning multiple resultsets in general.
you can do that as select(["*"]).select_from(func.procedure.foo()) .