Create_database #
Overview #
Create a database in Athena.
Method #
CREATE_DATABASE
Import parameters #
This method uses the following import parameters.
-
i_database
Required: Yes.
Database name.
-
i_location
Required: Yes.
Location name (AWS Region).
Export Parameters #
This method use the following export parameters:
-
e_http_status
HTTP Status code. Returns 200 if no errors found.
-
e_response_headers
Returns information about the request in format Name/Value pair values.
-
e_response_content
Returns response information.
Example #
DATA: lo_athena_tables TYPE REF TO /lnkaws/cl_aws_athena_tables,
lo_cx_aws_s3 TYPE REF TO /lnkaws/cx_aws_s3,
lv_http_status TYPE i,
lv_headers TYPE tihttpnvp,
lv_content TYPE string.
TRY.
CREATE OBJECT lo_athena_tables
EXPORTING
i_region = 'eu-west-1'
i_user_name = 'userawsconnector'.
CALL METHOD lo_athena_tables->create_table
EXPORTING
i_table = 'bkpfdemo2'
i_database = 'awsconnector'
i_fields = 'bukrs string , belnr string'
i_bucket = 'd04-test/tables/bkpf/'
IMPORTING
e_http_status = lv_http_status
e_response_headers = lv_headers
e_response_content = lv_content.
CATCH /lnkaws/cx_aws_s3 INTO lo_cx_aws_s3.
RAISE EXCEPTION lo_cx_aws_s3.
ENDTRY.