# 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.ExecuteSqlDatabaseToolsConnectionSynchronousDetails(
        type="SYNCHRONOUS",
        input=oci.database_tools_runtime.models.ExecuteSqlInputBatchDetails(
            type="BATCH",
            batch_statement_texts=["EXAMPLE--Value"],
            response_format=oci.database_tools_runtime.models.ExecuteSqlResponseFormat(
                result_set_meta_data=False,
                statement_information=False,
                statement_text=True,
                binds=True,
                result=False,
                response=False),
            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="PLSQL",
                    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_eKNBb': 'EXAMPLE_VALUE_TcykehNDQiroXm2aCk5Y'},
                        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="STANDARD"))],
            time_of_deletion=datetime.strptime(
                "2018-12-07T14:23:08.647Z",
                "%Y-%m-%dT%H:%M:%S.%fZ"))),
    opc_request_id="EHHVVELTCIKG2CXP5MZB<unique_ID>",
    if_match="EXAMPLE-ifMatch-Value")

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