| Copyright | (c) 2013-2021 Brendan Hay |
|---|---|
| License | Mozilla Public License, v. 2.0. |
| Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
| Stability | auto-generated |
| Portability | non-portable (GHC extensions) |
| Safe Haskell | None |
Amazonka.RedshiftData.ExecuteStatement
Description
Runs an SQL statement, which can be data manipulation language (DML) or data definition language (DDL). This statement must be a single SQL statement. Depending on the authorization method, use one of the following combinations of request parameters:
- Secrets Manager - specify the Amazon Resource Name (ARN) of the secret, the database name, and the cluster identifier that matches the cluster in the secret.
- Temporary credentials - specify the cluster identifier, the database
name, and the database user name. Permission to call the
redshift:GetClusterCredentialsoperation is required to use this method.
Synopsis
- data ExecuteStatement = ExecuteStatement' {}
- newExecuteStatement :: Text -> Text -> Text -> ExecuteStatement
- executeStatement_dbUser :: Lens' ExecuteStatement (Maybe Text)
- executeStatement_statementName :: Lens' ExecuteStatement (Maybe Text)
- executeStatement_parameters :: Lens' ExecuteStatement (Maybe (NonEmpty SqlParameter))
- executeStatement_secretArn :: Lens' ExecuteStatement (Maybe Text)
- executeStatement_withEvent :: Lens' ExecuteStatement (Maybe Bool)
- executeStatement_clusterIdentifier :: Lens' ExecuteStatement Text
- executeStatement_database :: Lens' ExecuteStatement Text
- executeStatement_sql :: Lens' ExecuteStatement Text
- data ExecuteStatementResponse = ExecuteStatementResponse' {}
- newExecuteStatementResponse :: Int -> ExecuteStatementResponse
- executeStatementResponse_dbUser :: Lens' ExecuteStatementResponse (Maybe Text)
- executeStatementResponse_database :: Lens' ExecuteStatementResponse (Maybe Text)
- executeStatementResponse_createdAt :: Lens' ExecuteStatementResponse (Maybe UTCTime)
- executeStatementResponse_clusterIdentifier :: Lens' ExecuteStatementResponse (Maybe Text)
- executeStatementResponse_id :: Lens' ExecuteStatementResponse (Maybe Text)
- executeStatementResponse_secretArn :: Lens' ExecuteStatementResponse (Maybe Text)
- executeStatementResponse_httpStatus :: Lens' ExecuteStatementResponse Int
Creating a Request
data ExecuteStatement Source #
See: newExecuteStatement smart constructor.
Constructors
| ExecuteStatement' | |
Fields
| |
Instances
Arguments
| :: Text | |
| -> Text | |
| -> Text | |
| -> ExecuteStatement |
Create a value of ExecuteStatement with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:dbUser:ExecuteStatement', executeStatement_dbUser - The database user name. This parameter is required when authenticating
using temporary credentials.
$sel:statementName:ExecuteStatement', executeStatement_statementName - The name of the SQL statement. You can name the SQL statement when you
create it to identify the query.
$sel:parameters:ExecuteStatement', executeStatement_parameters - The parameters for the SQL statement.
$sel:secretArn:ExecuteStatement', executeStatement_secretArn - The name or ARN of the secret that enables access to the database. This
parameter is required when authenticating using Secrets Manager.
$sel:withEvent:ExecuteStatement', executeStatement_withEvent - A value that indicates whether to send an event to the Amazon
EventBridge event bus after the SQL statement runs.
$sel:clusterIdentifier:ExecuteStatement', executeStatement_clusterIdentifier - The cluster identifier. This parameter is required when authenticating
using either Secrets Manager or temporary credentials.
$sel:database:ExecuteStatement', executeStatement_database - The name of the database. This parameter is required when authenticating
using either Secrets Manager or temporary credentials.
$sel:sql:ExecuteStatement', executeStatement_sql - The SQL statement text to run.
Request Lenses
executeStatement_dbUser :: Lens' ExecuteStatement (Maybe Text) Source #
The database user name. This parameter is required when authenticating using temporary credentials.
executeStatement_statementName :: Lens' ExecuteStatement (Maybe Text) Source #
The name of the SQL statement. You can name the SQL statement when you create it to identify the query.
executeStatement_parameters :: Lens' ExecuteStatement (Maybe (NonEmpty SqlParameter)) Source #
The parameters for the SQL statement.
executeStatement_secretArn :: Lens' ExecuteStatement (Maybe Text) Source #
The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using Secrets Manager.
executeStatement_withEvent :: Lens' ExecuteStatement (Maybe Bool) Source #
A value that indicates whether to send an event to the Amazon EventBridge event bus after the SQL statement runs.
executeStatement_clusterIdentifier :: Lens' ExecuteStatement Text Source #
The cluster identifier. This parameter is required when authenticating using either Secrets Manager or temporary credentials.
executeStatement_database :: Lens' ExecuteStatement Text Source #
The name of the database. This parameter is required when authenticating using either Secrets Manager or temporary credentials.
executeStatement_sql :: Lens' ExecuteStatement Text Source #
The SQL statement text to run.
Destructuring the Response
data ExecuteStatementResponse Source #
See: newExecuteStatementResponse smart constructor.
Constructors
| ExecuteStatementResponse' | |
Fields
| |
Instances
newExecuteStatementResponse Source #
Create a value of ExecuteStatementResponse with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:dbUser:ExecuteStatement', executeStatementResponse_dbUser - The database user name.
$sel:database:ExecuteStatement', executeStatementResponse_database - The name of the database.
$sel:createdAt:ExecuteStatementResponse', executeStatementResponse_createdAt - The date and time (UTC) the statement was created.
$sel:clusterIdentifier:ExecuteStatement', executeStatementResponse_clusterIdentifier - The cluster identifier.
$sel:id:ExecuteStatementResponse', executeStatementResponse_id - The identifier of the SQL statement whose results are to be fetched.
This value is a universally unique identifier (UUID) generated by Amazon
Redshift Data API.
$sel:secretArn:ExecuteStatement', executeStatementResponse_secretArn - The name or ARN of the secret that enables access to the database.
$sel:httpStatus:ExecuteStatementResponse', executeStatementResponse_httpStatus - The response's http status code.
Response Lenses
executeStatementResponse_dbUser :: Lens' ExecuteStatementResponse (Maybe Text) Source #
The database user name.
executeStatementResponse_database :: Lens' ExecuteStatementResponse (Maybe Text) Source #
The name of the database.
executeStatementResponse_createdAt :: Lens' ExecuteStatementResponse (Maybe UTCTime) Source #
The date and time (UTC) the statement was created.
executeStatementResponse_clusterIdentifier :: Lens' ExecuteStatementResponse (Maybe Text) Source #
The cluster identifier.
executeStatementResponse_id :: Lens' ExecuteStatementResponse (Maybe Text) Source #
The identifier of the SQL statement whose results are to be fetched. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API.
executeStatementResponse_secretArn :: Lens' ExecuteStatementResponse (Maybe Text) Source #
The name or ARN of the secret that enables access to the database.
executeStatementResponse_httpStatus :: Lens' ExecuteStatementResponse Int Source #
The response's http status code.