# This is an automatically generated code sample.
# To make this code sample work in your Oracle Cloud tenancy,
# please replace the values for any parameters whose current values do not fit
# your use case (such as resource IDs, strings containing ‘EXAMPLE’ or ‘unique_id’, and
# boolean, number, and enum parameters with values not fitting your use case).

import oci
from datetime import datetime

# Create a default config using DEFAULT profile in default location
# Refer to
# https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File
# for more info
config = oci.config.from_file()


# Initialize service client with default config file
database_tools_runtime_client = oci.database_tools_runtime.DatabaseToolsRuntimeClient(
    config)


# Send the request to service, some parameters are not required, see API
# doc for more info
execute_sql_database_tools_connection_response = database_tools_runtime_client.execute_sql_database_tools_connection(
    database_tools_connection_id="ocid1.test.oc1..<unique_ID>EXAMPLE-databaseToolsConnectionId-Value",
    execute_sql_database_tools_connection_details=oci.database_tools_runtime.models.ExecuteSqlDatabaseToolsConnectionAsynchronousDetails(
        type="ASYNCHRONOUS",
        input=oci.database_tools_runtime.models.ExecuteSqlAsynchronousInputInlineDetails(
            type="INLINE",
            content=oci.database_tools_runtime.models.ExecuteSqlInputStandardDetails(
                type="STANDARD",
                statement_text="EXAMPLE-statementText-Value",
                limit=4841,
                offset=779,
                binds=[
                    oci.database_tools_runtime.models.ExecuteSqlBind(
                        data_type="EXAMPLE-dataType-Value",
                        name="EXAMPLE-name-Value",
                        index=942,
                        mode="INOUT",
                        values=["EXAMPLE-values-Value"],
                        results=["EXAMPLE-results-Value"],
                        plsql_table_type_details=oci.database_tools_runtime.models.ExecuteSqlBindPlsqlTable(
                            type_name="EXAMPLE-typeName-Value",
                            type_subname="EXAMPLE-typeSubname-Value",
                            type_components=[
                                oci.database_tools_runtime.models.ExecuteSqlBindTypeComponent(
                                    data_type="EXAMPLE-dataType-Value")]))],
                response_format=oci.database_tools_runtime.models.ExecuteSqlResponseFormat(
                    result_set_meta_data=True,
                    statement_information=True,
                    statement_text=True,
                    binds=True,
                    result=True,
                    response=True),
                properties="EXAMPLE-properties-Value")),
        output=oci.database_tools_runtime.models.ExecuteSqlOutputObjectStorageDetails(
            type="OBJECT_STORAGE",
            object=oci.database_tools_runtime.models.ExecuteSqlObjectStorageLocation(
                namespace="EXAMPLE-namespace-Value",
                bucket_name="EXAMPLE-bucketName-Value",
                object_name="EXAMPLE-objectName-Value"),
            result_disposition_templates=[
                oci.database_tools_runtime.models.ExecuteSqlOutputResultDispositionTemplate(
                    statement_type="JDBC",
                    object_template=oci.database_tools_runtime.models.ExecuteSqlOutputDispositionObjectStorageDetails(
                        type="OBJECT_STORAGE",
                        namespace="EXAMPLE-namespace-Value",
                        bucket_name="EXAMPLE-bucketName-Value",
                        object_name="EXAMPLE-objectName-Value",
                        content_type="EXAMPLE-contentType-Value",
                        content_disposition="EXAMPLE-contentDisposition-Value",
                        content_encoding="EXAMPLE-contentEncoding-Value",
                        cache_control="EXAMPLE-cacheControl-Value",
                        content_language="EXAMPLE-contentLanguage-Value",
                        opc_meta={
                            'EXAMPLE_KEY_tza5e': 'EXAMPLE_VALUE_cL2sina554BinBe9bEMB'},
                        opc_sse_customer_algorithm="EXAMPLE-opcSseCustomerAlgorithm-Value",
                        opc_sse_customer_key="EXAMPLE-opcSseCustomerKey-Value",
                        opc_sse_customer_key_sha256="EXAMPLE-opcSseCustomerKeySha256-Value",
                        opc_sse_kms_key_id="ocid1.test.oc1..<unique_ID>EXAMPLE-opcSseKmsKeyId-Value",
                        storage_tier="ARCHIVE"))],
            time_of_deletion=datetime.strptime(
                "2046-08-02T21:19:46.277Z",
                "%Y-%m-%dT%H:%M:%S.%fZ")),
        timeout_in_seconds=9776),
    opc_request_id="CMJH5X8LLRPKVBZKWIF6<unique_ID>",
    if_match="EXAMPLE-ifMatch-Value")

# Get the data from response
print(execute_sql_database_tools_connection_response.data)