# 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).

from datetime import datetime
import oci

# 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.ExecuteSqlInputStandardDetails(
            type="STANDARD",
            statement_text="EXAMPLE-statementText-Value",
            limit=9022,
            offset=379,
            binds=[
                oci.database_tools_runtime.models.ExecuteSqlBind(
                    data_type="EXAMPLE-dataType-Value",
                    name="EXAMPLE-name-Value",
                    index=627,
                    mode="OUT",
                    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=False,
                statement_information=False,
                statement_text=False,
                binds=False,
                result=False,
                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="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_yIwjO': 'EXAMPLE_VALUE_zYBZGRYPNgsHqlgzXHug'},
                        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(
                "2035-06-10T05:30:16.514Z",
                "%Y-%m-%dT%H:%M:%S.%fZ"))),
    opc_request_id="FYRH7EHZQKJICD1GETLT<unique_ID>",
    if_match="EXAMPLE-ifMatch-Value")

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