Ok..
So <qualifier> is the database name (from "USE studies;" so it's
"studies")?
I notice "SELECT * FROM DB..studies;" seems to say there's no such table
while "SELECT * FROM studies..studies;" gives a syntax error.
Of course, if "studies..studies" properly references a table then I
cannot image what the syntax error must be.
I copied the error down below..
Warning: odbc_exec(): SQL error: [unixODBC][OpenLink][Virtuoso iODBC
Driver][Virtuoso Server]SQ074: Line 1: syntax error, SQL state 37000 in
SQLExecDirect in /var/www/studies/test.php on line 9
See anything else wrong?
Matthew
-----Original Message-----
From: Kingsley Idehen [mailto:[email protected]]
Sent: Friday, August 06, 2010 9:04 AM
To: Matthew Tedder
Cc: [email protected]
Subject: Re: [Virtuoso-users] In SQL how can I reference my tables?
Matthew Tedder wrote:
>
> So the PHP odbc_connect() method seems to connect, because I get SQL
> errors.
>
> Can anyone tell me how to at least select from these tables.. I
> created them using isql like this:
>
> USE studies;
>
> CREATE TABLE studies ( ...);
>
> But the following variations give SQL errors:
>
> USE studies; SELECT * FROM studies;
>
> SELECT * FROM studies.studies;
>
> SELECT * FROM studies..studies;
>
> SELECT * FROM DB.studies;
>
> SELECT * FROM DB.studies.studies;
>
> To keep working, I made a mirror of these tables in MySQL and so
> that's what I am working with now. I am already past my deadline.
>
> As a last resort I might end up setting up a PHP ARC -based SPARQL
> endpoint and dumping to that, periodically from the tables. But that
> won't scale and has other limitations.
>
> But I kinda feel not so good. I got excited reading about Virtuoso and
> now everyone's looking at me. We're looking at possibly moving a lot
> over to it, including VIVO (researchers and their
> publications-currently using Sesame/Jena), a huge clinical data
> repository, and others.
>
> I feel so close to breaking the egg-shell that can open up a huge new
> world of uses.. but also stressed with a very short timeline.
>
You qualify your SQL Data in Virtuoso using:
<qualifier>.<owner>.<object e.g. Table, View, Procedure> .
A good ODBC abstraction to use an ODBC meta data call do discern
Qualifier Term etc..
Virtuoso:
SELECT * FROM DB..studies
Notice two dots not one.
Kingsley
>
> *Matthew C. Tedder*
>
> *Software Engineer
> Clinical and Translational Research Informatics Program (CTRIP)
> University of Florida
> 1329 SW 16th St. RM 5026
> Gainesville, FL 32608
> 352.265.0111 Ext. 86107 (desk)*
>
> *509-432-5520 (cell)
> UF Campus Mail: Box 100147/ICHP
> USPS Mail: PO Box 100177, Gainesville, FL 32610*
>
> ------------------------------------------------------------------------
>
>
-----------------------------------------------------------------------------
-
> This SF.net email is sponsored by
>
> Make an app they can't live without
> Enter the BlackBerry Developer Challenge
> http://p.sf.net/sfu/RIM-dev2dev
> ------------------------------------------------------------------------
>
> _______________________________________________
> Virtuoso-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/virtuoso-users
>
--
Regards,
Kingsley Idehen
President & CEO
OpenLink Software
Web: http://www.openlinksw.com
Weblog: http://www.openlinksw.com/blog/~kidehen
Twitter/Identi.ca: kidehen