Hi Patrick, Am Dienstag, 8. November 2011 um 13:42 schrieb Patrick van Kleef:
> Hi Norman, > > > thanks for your reply. I am using Mac OS X 10.7.2 (Darwin macbook- > > pro.local 11.2.0 Darwin Kernel Version 11.2.0: Tue Aug 9 20:54:00 > > PDT 2011; root:xnu-1699.24.8~1/RELEASE_X86_64 x86_64) with stock PHP > > 5.3.6 built against iODBC. I have attached the odbc trace log. The > > query in question seems to start at line 26287. > > > > > > > I think the problem is the fact that by default PHP-ODBC uses a cursor > and virtuoso fails to detect that your query is a SPARUL query that > might not lent itself to a cursor model. > > When you are using the SPARQL_EVAL stored procedure, Virtuoso lowers > the cursor model automatically which is why this work. > > Could you edit your php.ini and find the [ODBC] section and set: > > [ODBC] > odbc.default_cursortype = 0 > thanks, that works for the query. However, now a different (totally unrelated) query does not work anymore. It fails with "[iODBC][Driver Manager]Invalid cursor state, SQL state 24000 in SQLGetData". I have again attached the ODBC log, the query starts at line 3770. I think might be able to dynamically set the cursor type via odbc_setoption but I would then need to check for an invalid cursor before calling odbc_result but after calling odbc_exec. Do you think this is possible? Regards, Norman > > and test again. > > I will be checking the code to see exactly what is going on and make a > patch when possible, but cursor_type 0 (forward only) or using the > SPARQL_EVAL method should be a good workaround for the moment. > > > Patrick > --- > OpenLink Software >
odbc-trace.log.tar.gz
Description: Binary data