Table Of Contents

Feedback

User Guide

First time using the AWS CLI? See the User Guide for help getting started.

[ aws . rds-data ]

execute-sql

Description

Executes any SQL statement on the target database synchronously

See also: AWS API Documentation

See 'aws help' for descriptions of global parameters.

Synopsis

  execute-sql
--aws-secret-store-arn <value>
[--database <value>]
--db-cluster-or-instance-arn <value>
[--schema <value>]
--sql-statements <value>
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]

Options

--aws-secret-store-arn (string) ARN of the db credentials in AWS Secret Store or the friendly secret name

--database (string) Target DB name

--db-cluster-or-instance-arn (string) ARN of the target db cluster or instance

--schema (string) Target Schema name

--sql-statements (string) SQL statement(s) to be executed. Statements can be chained by using semicolons

--cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, the CLI values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

See 'aws help' for descriptions of global parameters.

Output

sqlStatementResults -> (list)

Results returned by executing the sql statement(s)

(structure)

SQL statement execution result

numberOfRecordsUpdated -> (long)

Number of rows updated.

resultFrame -> (structure)

ResultFrame returned by executing the sql statement

records -> (list)

ResultSet Metadata.

(structure)

Row or Record

values -> (list)

Record

(structure)

Column value

arrayValues -> (list)

Arbitrarily nested arrays

(structure)

Column value

arrayValues -> (list)

Arbitrarily nested arrays

( ... recursive ... )

bigIntValue -> (long)

Long value

bitValue -> (boolean)

Bit value

blobValue -> (blob)

Blob value

doubleValue -> (double)

Double value

intValue -> (integer)

Integer value

isNull -> (boolean)

Is column null

realValue -> (float)

Float value

stringValue -> (string)

String value

structValue -> (structure)

Struct or UDT

attributes -> (list)

Struct or UDT

( ... recursive ... )

bigIntValue -> (long)

Long value

bitValue -> (boolean)

Bit value

blobValue -> (blob)

Blob value

doubleValue -> (double)

Double value

intValue -> (integer)

Integer value

isNull -> (boolean)

Is column null

realValue -> (float)

Float value

stringValue -> (string)

String value

structValue -> (structure)

Struct or UDT

attributes -> (list)

Struct or UDT

(structure)

Column value

arrayValues -> (list)

Arbitrarily nested arrays

( ... recursive ... )

bigIntValue -> (long)

Long value

bitValue -> (boolean)

Bit value

blobValue -> (blob)

Blob value

doubleValue -> (double)

Double value

intValue -> (integer)

Integer value

isNull -> (boolean)

Is column null

realValue -> (float)

Float value

stringValue -> (string)

String value

structValue -> (structure)

Struct or UDT

attributes -> (list)

Struct or UDT

( ... recursive ... )

resultSetMetadata -> (structure)

ResultSet Metadata.

columnCount -> (long)

Number of columns

columnMetadata -> (list)

List of columns and their types

(structure)

Column Metadata

arrayBaseColumnType -> (integer)

Homogenous array base SQL type from java.sql.Types.

isAutoIncrement -> (boolean)

Whether the designated column is automatically numbered

isCaseSensitive -> (boolean)

Whether values in the designated column's case matters

isCurrency -> (boolean)

Whether values in the designated column is a cash value

isSigned -> (boolean)

Whether values in the designated column are signed numbers

label -> (string)

Usually specified by the SQL AS. If not specified, return column name.

name -> (string)

Name of the column.

nullable -> (integer)

Indicates the nullability of values in the designated column. One of columnNoNulls (0), columnNullable (1), columnNullableUnknown (2)

precision -> (integer)

Get the designated column's specified column size.For numeric data, this is the maximum precision. For character data, this is the length in characters. For datetime datatypes, this is the length in characters of the String representation (assuming the maximum allowed precision of the fractional seconds component). For binary data, this is the length in bytes. For the ROWID datatype, this is the length in bytes. 0 is returned for data types where the column size is not applicable.

scale -> (integer)

Designated column's number of digits to right of the decimal point. 0 is returned for data types where the scale is not applicable.

schemaName -> (string)

Designated column's table's schema

tableName -> (string)

Designated column's table name

type -> (integer)

SQL type from java.sql.Types.

typeName -> (string)

Database-specific type name.