ODBC Driver for Amazon S3

Build 26.0.9770

CopyObject

Copies an object from a source bucket to a destination bucket, preserving data and metadata unless otherwise specified.

Stored Procedure-Specific Information

This procedure performs a server-side copy, so the object data never passes through the driver. If you omit ObjectDestination, the source key is reused in the destination bucket. To apply conditional checks based on ETags: supply ETagObjectSource to check the source object (fails with 412 Precondition Failed if the source's current ETag does not match), or ETagObjectDestination to check the destination object (fails with 412 Precondition Failed if the destination's current ETag does not match). You can supply both to enforce conditions on both objects. Note: the ETag input has been renamed to ETagObjectDestination for clarity. ETag values are sent to S3 as-is and should be supplied exactly as S3 reports them, including surrounding double quotes if present.

The following example copies an object to another bucket:

EXECUTE CopyObject
     @BucketSource='SourceBucket',
     @ObjectSource='ObjectName',
     @BucketDestination='DestinationBucket',
     @ObjectDestination='CopiedObjectName'

Input

Name Type Required Description
BucketSource String True The name of the source S3 bucket that contains the object to be copied.
ObjectSource String True The key (name) of the source object within the source bucket to be copied.
BucketDestination String True The name of the destination S3 bucket where the object is stored after the copy operation.
ObjectDestination String False The key (name) of the new object in the destination bucket. If not specified, the original object name is retained.
ETagObjectSource String False An optional entity tag for the source object; when supplied the copy is performed only if the source object's current ETag matches this value. If the values do not match, the request fails with a 412 Precondition Failed error. The value is sent as-is and should be supplied exactly as S3 reports it, including surrounding double quotes if present.
ETagObjectDestination String False An optional entity tag for the destination object; when supplied the copy is performed only if the destination object's current ETag matches this value. If the values do not match, the request fails with a 412 Precondition Failed error. The value is sent as-is and should be supplied exactly as S3 reports it, including surrounding double quotes if present.

Result Set Columns

Name Type Description
Status String Indicates the result of the copy operation, such as success or failure.

Copyright (c) 2026 CData Software, Inc. - All rights reserved.
Build 26.0.9770