IBM Cloud Docs
Loading data from Amazon S3

Loading data from Amazon S3

External Tables

You can load data from Amazon S3 into IBM® Db2® Warehouse on Cloud by using the built-in External Tables functionality.

Here’s an example SQL statement that inserts Amazon S3 data into a Db2 Warehouse on Cloud table by using External Tables:

INSERT INTO <table-name> SELECT * FROM EXTERNAL '<mys3file.txt>' USING
  (CCSID 1208 s3('s3.amazonaws.com', 
  '<S3-access-key-ID>',
  '<S3-secret-access-key>', 
  '<my_bucket>'
     )
  )

Db2 LOAD utility

You can also load data from Amazon S3 into Db2 Warehouse on Cloud by using the built-in Db2 LOAD utility.

Here’s an example SQL statement that uses the Db2 LOAD utility to load Amazon S3 data into Db2 Warehouse on Cloud:

CALL SYSPROC.ADMIN_CMD('LOAD FROM "S3::<s3-endpoint-url>::<s3-access-key-ID>::<s3-secret-access-key>:
:<s3-bucket-name>::<path-to-data-file>" OF <filetype> <additional-load-options> INTO <table-name>)

For more information about the Db2 LOAD utility, see: LOAD command.