SQL Pass-Through Facility Specifics for Amazon Redshift

Key Information

For general information about this feature, see SQL Pass-Through Facility.

Here are the SQL pass-through facility specifics for the Amazon Redshift interface.

CONNECT Statement Examples for Amazon Redshift

This example connects to Amazon Redshift and then disconnects from it.

proc sql noerrorstop;
   connect to redshift as x1(server=mysrv1 port=5439 
      user=mysur1 password='mypwd1' database=mydb1);
disconnect from x1;
quit;

This next example connects to Amazon Redshift, executes some SQL statements, and then disconnects from Amazon Redshift.

proc sql noerrorstop;
 connect to redshift as x1(server=mysrv1 port=5439 
    user=mysur1 password='mypwd1' database=mydb1);

 execute ( CREATE TABLE t1 ( no int primary key, state varchar(10) ) ) by x1;
 execute ( INSERT INTO t1 values (1, 'USA') ) by x1;
 execute ( INSERT INTO t1 values (2, 'CHN') ) by x1;
 select * from connection to x1 (SELECT * FROM t1 ORDER BY no);

 disconnect from x1;
 quit;
Last updated: February 3, 2026