ODBC Connection String to Amazon Redshift

3.9k Views Asked by At

Is there a way to specify in a connection string the settings of 'Additional Options' ?

I am trying to create a connection string for accessing Amazon Redshift from SAS with SAS/Access to OleDb installed.

Because I only have access to OleDb I will have to use OleDb provider MSDASQL to connect to ODBC.

libname outhere oledb schema=ProjectXYZ init_string=
"
Provider=msdasql;
Driver={Amazon Redshift (x64)};
Server=blah.blah.blah.redshift.amazonaws.com;
Database=minions;
UID=bigboss;
PWD=boomboom;
Port=5439;
";

This mostly works and SAS Explorer lists all the tables in the database (even the ones not in ProjectXYZ {weird}). Data step can run through the data.

The problem is that when I use ViewTable to look at the data there is an error

NOTE: Table has been opened in browse mode.
ERROR: Open cursor error: ICommand::Execute failed. : [Amazon][RedShift ODBC] (30) Error occurred while trying to execute a que

ViewTable can be made to work by using ODBC Admin to create a UserDSN based on {Amazon Redshift (x64)} with the drivers additional option "Single Row Mode" selected in the Setup dialog box.

I couldn't find any documentation on what the name=value pairs should be to specify the selection of any of these

Additional Options:

  • Single Row Mode
  • Use Declare/Fetch, Cache Size 100
  • Use Multiple Statement
  • Retrieve Entire Result Into Memory I think this is driver default
  • Enable HTTP Proxy Connection
    • Server Port:
    • Proxy Port:
1

There are 1 best solutions below

2
On BEST ANSWER

Here is the most comprehensive list of options I could find: http://docs.aws.amazon.com/redshift/latest/mgmt/configure-odbc-options.html

Here are some of the ODBC options mentioned in the document:

  • SingleRowMode (default 0)
  • UseDeclareFetch (default 0)
  • UseMultipleStatements (default 0)
  • Port (default 5439)

When UseDeclareFetch=0 and SingleRowMode=0, then the driver retrieves the entire query result into memory.