ODBC & Cache

230 views
Skip to first unread message

Mack Altman III

unread,
Jul 16, 2013, 2:23:54 PM7/16/13
to intersystems...@googlegroups.com
Currently, I am trying to connect to a Cache Namespace and pull information from a Global. Here's my setup:

I have an OpenVMS Cache installation on an HP Integrity server. We want to have Linux pull information from Cache; however, we're running into some issues.

Currently, we are using iSQL within Linux for the ODBC connection and we run the following line.
cat cachetest.sql | isql -v Cache USER PASS

The contents of cachetest.sql are as follows:
SELECT * FROM Table.Name

When running the line, we reach the following error:
[SQLCODE: <-30>:<Table or View not found>]
[Location: <Prepare>]
[%msg: < Table 'DATABASE.NAME' not found>]
[ISQL]ERROR: Could not SQLPrepare


I want to be able to retrieve the results after getting the account id. What would be the best method for doing this? I would be utilizing PHP; however, I can do anything that is recommended to make this work.
^MACK(101548)="Walgreens^Charleston^SC^29406"
^MACK(185223)="Rite-Aid^Goose Creek^SC^29445"
^MACK(195001)="CVS^Goose Creek^SC^29445"

Terry

unread,
Jul 26, 2013, 1:17:39 PM7/26/13
to intersystems...@googlegroups.com
Hi,

you need to review how data is created/stored in Cache documentation to get a better understanding of the options available
you can't retrieve data directly from a Caché global using an SQL statement.
globals like ^MACK are hierarchical tables that store data in a non-relational format.
globals can be mapped to a table name to allow for SQL access, but this requires someone with Cache experience to do this.
classes/objects such as NAMESPACE.TABLENAME store data in a relational format & you can retrieve data from these via SQL.

Globals are an older data structure that is mainly used in legacy Cache systems.
classes/objects are used in more modern systems that require SQL/.NET/JAVA/etc access.

if you are creating a new database from scratch, use classes/objects to store your data.
if you are accessing an existing database with globals you may need to consider mapping or converting data to classes.

hope this helps!
Reply all
Reply to author
Forward
0 new messages