GENERAL STARSQL HINTS
StarSQL 1.02
4/17/95

USE OF THE SQL CATALOG QUALIFIER

The SQL Catalog Qualifier specified in a data source affects only where 
the StarSQL driver looks for catalog information (that is, where to look 
for SYSTABLE when you request a list of available tables).  It does not 
affect other SQL statements such as SELECT if the table name is not 
explicitly qualified (that is, "SELECT * FROM table" is used instead of 
"SELECT * FROM collection.table"); in this case (on the AS/400), the 
name of the user is used in place of collection (that is, SELECT * FROM 
userid.table). This affects custom SQL statements (that is, those you 
enter manually in an "Execute SQL"-type dialog box) or user-created 
applications; most commercial applications such as MS Query use fully 
qualified table names when preparing a query statement.

USE OF THE READ-ONLY CHECKBOX:

* StarSQL needs to bind SQL packages for the first connection or a 
connection at a new isolation level other than the default. Using the 
Read-Only checkbox on a data source in this situation results in the 
error message "Change request not valid for read-only application 
server."

* Connecting to DB2 V2R3 and V3R1 with Read-Only checked for the StarSQL 
data source results in the error:
        "Database server does not support read-only connection."


CREATING COLLECTIONS ON THE AS/400

You can use the IBM licensed program SQL/400 to create an SQL collection 
on your AS/400 by logging on to the AS/400 with a terminal session, 
running the interactive SQL utility STRSQL, and issuing the command 
"CREATE COLLECTION <name>".

Alternatively, you can use StarSQL to create an SQL collection even if 
there are no SQL collections for StarSQL to bind packages to. Use the 
following procedure:

1. Specify an existing AS/400 library for the SQL Package Collection 
field and for the SQL Catalog Qualifier in the StarSQL Data Source setup 
dialog box. Any library should work -- it does not need to be an SQL 
collection, but you must have authority to create objects in the 
library. You can use the library QTEMP.

2. Using ODBCTest (or another interactive SQL tool on the PC), connect 
to the AS/400 with your datasource; StarSQL packages are created and 
bound in the library you specified in step 1.

Note that the application must be able to ignore the warnings it 
receives about "object QTEMP.SYSTABLES not found"; some applications, 
such as Microsoft Query, treat these warnings as an error and do not 
allow you to progress further. 

To use Microsoft Access to execute the SQL statement, see "Creating 
Pass-Through Queries to Send Commands to SQL Databases" in Chapter 12 
"Advanced Queries" of the Microsoft Access User's Guide. (Hint: To view 
the query property sheet mentioned in step 5, choose "Properties" from 
the View menu).

3. Execute the SQL statement "CREATE COLLECTION <name>" using your 
StarSQL data source. This takes a while to execute. On smaller AS/400 
models, the CREATE COLLECTION statement may take more than five minutes 
to complete.

4. Change the values of the SQL Package Collection and SQL Catalog 
Qualifier fields to the collection you just created. The next time you 
connect, new packages are bound into the SQL collection.

5. You can delete the packages in the old library by connecting with the 
SQL Package Collection field set to the new library (or set to the 
default value of your user ID if you used your user ID for the SQL 
collection name), preparing, and executing this SQL statement, "DROP 
PACKAGE <library>.<package-name>". If you use the default isolation 
level, two packages are created, "SWRC0000" and "SWCATPKG". If you used 
the library QTEMP, the files automatically disappear when the job 
completes.

