Chapter Contents

Previous

Next
SAS/ACCESS Software for Relational Databases: Reference

SQL Procedure Pass-Through Facility: CA-OpenIngres Specifics

For details about how to use the PROC SQL statements, see SQL Procedure Pass-Through Facility Statements. The following section describes the DBMS-specific arguments that you use in the CONNECT statement.


Arguments to Connect to CA-OpenIngres

CA-OpenIngres has one database-connection-argument that you can specify in this statement. It can also be used to connect to multiple databases.

CONNECT TO INGRES <AS alias> (DATABASE=<v-node::>database-name</server-type>);

(DATABASE='<v-node::>database-name </server-type>')
is where you specify the name of the CA-OpenIngres database. You must enter a value in this field and enclose the entire option in parentheses.

If you use a remote database, you enter the remote virtual node name. If you use a distributed database, you enter the database server type. If you use a remote distributed database, you enter the remote virtual node name and server type. The arguments for the DATABASE= field are
v-node is the name of the remote virtual node where the database is located. It implies that the network node address and protocol have been defined by the NETU utility that is provided by CA-OpenIngres. For more information on the NETU utility, refer to your CA-OpenIngres/Net user's and administrator's guide.
database-name is the name of the database.
server-type is the type of server that is being accessed at the local or remote site. Valid server types are INGRES for a CA-OpenIngres DBMS server or STAR for the CA-OpenIngres/Star server. (You can replace /STAR with its alias, /D.) If you omit a server type, the default server type, INGRES, for the CA-OpenIngres DBMS is used.

The following example connects to CA-OpenIngres by using the alias ING1 and sends an EXECUTE statement. The distributed database name is TEXTILEDB, and it is located on a virtual node that is named TXTNODE. The alias D is used to specify the STAR server.

proc sql;
   connect to ingres as ing1 
     (database='txtnode::textiledb/d');
   execute (create view whotookorders as
            select ordernum, takenby, 
                   firstname, lastname, phone
               from orders, employees
               where 
                 orders.takenby=employees.empid)
            by ing1;
   execute (grant select on whotookorders 
     to adeleke) by ing1;
   disconnect from ing1;
quit;

The following example connects to the TEXTILEDB database and performs a query, shown in italics, on the CUSTOMERS table:

proc sql;
   connect to ingres (database=textiledb);
   select *
      from connection to ingres
         (select
* from customers
             where
customer like '1%');
   disconnect from ingres;
quit;


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.