Hi Sören,

I spend some time today trying to figure out how I can check if there
exists a table with a certain name. For the PHP ODBC module there
exists the function odbc_tables(), which works. However, due to the
problem of the PHP ODBC module with TOP queries I'm now using the
pdo_odbc module, which does not provide a similar function.

We should have a fix for the TOP issue in the next few days.

The problem is that the PHP ODBC module sets the cursor mode to dynamic model which allows full positioning within the resultset. Most drivers actually do not support this cursor model and return a lower cursor model, which PHP then use. However all OpenLink drivers including Virtuoso implement this model. This is quite an overkill for most PHP applications who only read the resultset once.

I am currently in contact with the pdo_odbc module owner. I will discuss with him the current implementation of pdo_odbc and see if we can put some more calls into this implementation. I will also see if we can introduce a setting for the php odbc module so you can set the preferred cursor model before making the connection.

I found the view DB.INFORMATION_SCHEMA.TABLES - but it does not seem
to contain all tables - I see just 10 here. Why are not all tables
visible here?

The INFORMATION_SCHEMA is part of the SQL 200n standard set of views that are defined in each qualifier and describe the objects in that qualifier.

When you perform:

   select * from DB.INFORMATION_SCHEMA.TABLES

you only get the normal tables (non system tables) in the DB schema.

To get the tables in your local "test" schema, just perform:

   use test;                            # set current qualifier to test
   select * from INFORMATION_SCHEMA.TABLES;

or

   select * from test.INFORMATION_SCHEMA.TABLES;


I also found the Virtuoso's sql_tables() function in the docs, but get
an undefined procedure error here???

That function is part of the VDB layer which is currently not part of the VOS release.


Best regards,


Patrick
--
Patrick van Kleef            Email : <vos.ad...@openlinksw.com>
Virtuoso Maintainer          Web   : <http://virtuoso.openlinksw.com>
OpenLink Software

Reply via email to