13.07.2015 Views

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

628 Temporary Table Support <strong>for</strong> Netezza 4 Chapter 22Netezza::SQLPrimaryKeys returns a list of all columns that compose the primary key that matches thespecified table. A primary key can be composed of one or more columns. If you donot specify any table name, this special query fails.Netezza::SQLSpecialColumns returns a list of the optimal set of columns that uniquely identify a row in thespecified table.Netezza::SQLStatistics returns a list of the statistics <strong>for</strong> the specified table name, with options ofSQL_INDEX_ALL and SQL_ENSURE set in the SQLStatistics API call. If you donot specify any table name argument, this special query fails.Netezza::SQLGetTypeIn<strong>for</strong>eturns in<strong>for</strong>mation about the data types that the Netezza Per<strong>for</strong>mance Serversupports.Temporary Table Support <strong>for</strong> NetezzaGeneral In<strong>for</strong>mationSee the section on the temporary table support in <strong>SAS</strong>/<strong>ACCESS</strong> <strong>for</strong> <strong>Relational</strong><strong>Databases</strong>: <strong>Reference</strong> <strong>for</strong> general in<strong>for</strong>mation about this feature.Establishing a Temporary TableTo make full use of temporary tables, the CONNECTION=GLOBAL connectionoption is necessary. This option lets you use a single connection across <strong>SAS</strong> DATA stepsand <strong>SAS</strong> procedure boundaries. This connection can also be shared between LIBNAMEstatements and the SQL pass-through facility. Because a temporary table exists onlywithin a single connection, you need to be able to share this single connection among allsteps that reference the temporary table. The temporary table cannot be referencedfrom any other connection.You can currently use only a PROC SQL statement to create a temporary table. Touse both the SQL pass-through facility and librefs to reference a temporary table, youmust specify a LIBNAME statement be<strong>for</strong>e the PROC SQL step so that globalconnection persists across <strong>SAS</strong> steps and even across multiple PROC SQL steps. Hereis an example:proc sql;connect to netezza (server=nps1 database=testuser=myuser password=mypwd connection=global);execute (create temporary table temptab1 as select * from permtable ) by netezza;quit;At this point, you can refer to the temporary table by using either the Temp libref orthe CONNECTION=GLOBAL option with a PROC SQL step.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!