Loading data from IBM Cloud Object Storage
Using Console
You can load data from IBM Cloud Object Storage (COS) into IBM® Db2® as a Service by using the Console.
BLUUSERS cannot load data from the console.
Create the necessary credentials on the COS bucket to allow Console to access the data
- Access the COS Bucket on the IBMCloud Dashboard by clicking on the name
Create Credentials on the COS bucket so Db2 Console can access the data.
- Select
Service Credentials - Click on
New Credentials - Enter
Namefor the Service Credential - Select the appropriate role
- Ensure
Include HMAC Credentialis enabled
Get the Access key and Secret access key from the Credentials
- Expand the Credential
- Note down the
access_key_idandsecret_access_key
Open the Db2 Console to the load data page
The steps to access the Load Data page in Db2 SaaS vary depending on the console you are using. If you are using the legacy console, follow the steps outlined below. If you are using the Genius Hub–enabled console, refer to Loading data for the correct steps.
- Click on
Dataon the left menu - Click on
Load Dataon the top tab - Click on
Cloud Object Storage - Pick the
COS Authentication Endpointthat matches your bucket - Enter the
access_key_idfrom above forAccess key - Enter the
secret_access_keyfrom above forSecret access key - Click on
Browse Filesto select the file you want to load from
External Tables
You can load data from IBM Cloud Object Storage (COS) into IBM® Db2® as a Service by using the built-in External Tables functionality.
Here's an example SQL statement that inserts COS data into a IBM Db2 Warehouse SaaS table by using External Tables:
INSERT INTO <table-name> SELECT * FROM EXTERNAL '<mys3file.txt>' USING
(CCSID 1208 s3('s3-api.us-geo.objectstorage.softlayer.net',
'<S3-access-key-ID>',
'<S3-secret-access-key>',
'<my_bucket>'
)
)