本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
使用適用於 SAP ABAP 的 SDK 的 Aurora 範例
下列程式碼範例示範如何使用適用於 SAP ABAP 的 AWS SDK 搭配 Aurora 來執行動作和實作常見案例。
Actions 是大型程式的程式碼摘錄,必須在內容中執行。雖然動作會告訴您如何呼叫個別服務函數,但您可以在其相關情境中查看內容中的動作。
每個範例均包含完整原始碼的連結,您可在連結中找到如何設定和執行內容中程式碼的相關指示。
主題
動作
以下程式碼範例顯示如何使用 CreateDBClusterParameterGroup。
- 適用於 SAP ABAP 的開發套件
-
注意
GitHub 上提供更多範例。尋找完整範例,並了解如何在 AWS 程式碼範例儲存庫
中設定和執行。 TRY. DATA(lo_output) = lo_rds->createdbclusterparamgroup( iv_dbclusterparamgroupname = iv_param_group_name iv_dbparametergroupfamily = iv_param_group_family iv_description = iv_description ). oo_result = lo_output->get_dbclusterparametergroup( ). CATCH /aws1/cx_rdsdbparmgralrexfault. " Re-raise exception - parameter group already exists RAISE EXCEPTION TYPE /aws1/cx_rdsdbparmgralrexfault. CATCH /aws1/cx_rdsdbprmgrquotaexcd00. " Re-raise exception - quota exceeded RAISE EXCEPTION TYPE /aws1/cx_rdsdbprmgrquotaexcd00. ENDTRY.-
如需 API 詳細資訊,請參閱《適用於 AWS SAP ABAP 的 SDK API 參考》中的 CreateDBClusterParameterGroup。
-
以下程式碼範例顯示如何使用 DeleteDBClusterParameterGroup。
- 適用於 SAP ABAP 的開發套件
-
注意
GitHub 上提供更多範例。尋找完整範例,並了解如何在 AWS 程式碼範例儲存庫
中設定和執行。 TRY. lo_rds->deletedbclusterparamgroup( iv_dbclusterparamgroupname = iv_param_group_name ). CATCH /aws1/cx_rdsdbprmgrnotfndfault. " Re-raise exception - parameter group not found RAISE EXCEPTION TYPE /aws1/cx_rdsdbprmgrnotfndfault. CATCH /aws1/cx_rdsinvdbprmgrstatef00. " Re-raise exception - invalid state RAISE EXCEPTION TYPE /aws1/cx_rdsinvdbprmgrstatef00. ENDTRY.-
如需 API 詳細資訊,請參閱《適用於 AWS SAP ABAP 的 SDK API 參考》中的 DeleteDBClusterParameterGroup。
-
以下程式碼範例顯示如何使用 DescribeDBClusterParameterGroups。
- 適用於 SAP ABAP 的開發套件
-
注意
GitHub 上提供更多範例。尋找完整範例,並了解如何在 AWS 程式碼範例儲存庫
中設定和執行。 TRY. DATA(lo_output) = lo_rds->describedbclusterparamgroups( iv_dbclusterparamgroupname = iv_param_group_name ). DATA(lt_param_groups) = lo_output->get_dbclusterparametergroups( ). IF lines( lt_param_groups ) > 0. oo_result = lt_param_groups[ 1 ]. ENDIF. CATCH /aws1/cx_rdsdbprmgrnotfndfault. ENDTRY.-
如需 API 詳細資訊,請參閱《適用於 AWS SAP ABAP 的 SDK API 參考》中的 DescribeDBClusterParameterGroups。
-
以下程式碼範例顯示如何使用 DescribeDBClusterParameters。
- 適用於 SAP ABAP 的開發套件
-
注意
GitHub 上提供更多範例。尋找完整範例,並了解如何在 AWS 程式碼範例儲存庫
中設定和執行。 TRY. DATA lv_marker TYPE /aws1/rdsstring VALUE ''. DATA lt_all_parameters TYPE /aws1/cl_rdsparameter=>tt_parameterslist. DO. DATA(lo_output) = lo_rds->describedbclusterparameters( iv_dbclusterparamgroupname = iv_param_group_name iv_source = iv_source iv_marker = lv_marker ). LOOP AT lo_output->get_parameters( ) INTO DATA(lo_param). IF iv_name_prefix IS INITIAL OR lo_param->get_parametername( ) CP |{ iv_name_prefix }*|. APPEND lo_param TO lt_all_parameters. ENDIF. ENDLOOP. lv_marker = lo_output->get_marker( ). IF lv_marker IS INITIAL. EXIT. ENDIF. ENDDO. ot_parameters = lt_all_parameters. CATCH /aws1/cx_rdsdbprmgrnotfndfault. " Re-raise exception - parameter group not found RAISE EXCEPTION TYPE /aws1/cx_rdsdbprmgrnotfndfault. ENDTRY.-
如需 API 詳細資訊,請參閱《適用於 AWS SAP ABAP 的 SDK API 參考》中的 DescribeDBClusterParameters。
-
以下程式碼範例顯示如何使用 DescribeDBEngineVersions。
- 適用於 SAP ABAP 的開發套件
-
注意
GitHub 上提供更多範例。尋找完整範例,並了解如何在 AWS 程式碼範例儲存庫
中設定和執行。 " iv_engine = 'mysql' " iv_dbparametergroupfamily = 'mysql8.0' (optional - filters by parameter group family) TRY. oo_result = lo_rds->describedbengineversions( iv_engine = iv_engine iv_dbparametergroupfamily = iv_dbparametergroupfamily ). DATA(lv_version_count) = lines( oo_result->get_dbengineversions( ) ). MESSAGE |Retrieved { lv_version_count } engine versions.| TYPE 'I'. ENDTRY.-
如需 API 詳細資訊,請參閱《適用於 AWS SAP ABAP 的 SDK API 參考》中的 DescribeDBEngineVersions。
-
以下程式碼範例顯示如何使用 DescribeOrderableDBInstanceOptions。
- 適用於 SAP ABAP 的開發套件
-
注意
GitHub 上提供更多範例。尋找完整範例,並了解如何在 AWS 程式碼範例儲存庫
中設定和執行。 " iv_engine = 'mysql' " iv_engineversion = '8.0.35' TRY. oo_result = lo_rds->descrorderabledbinstoptions( iv_engine = iv_engine iv_engineversion = iv_engineversion ). DATA(lv_option_count) = lines( oo_result->get_orderabledbinstoptions( ) ). MESSAGE |Retrieved { lv_option_count } orderable DB instance options.| TYPE 'I'. ENDTRY.-
如需 API 詳細資訊,請參閱《適用於 AWS SAP ABAP 的 SDK API 參考》中的 DescribeOrderableDBInstanceOptions。
-
以下程式碼範例顯示如何使用 ModifyDBClusterParameterGroup。
- 適用於 SAP ABAP 的開發套件
-
注意
GitHub 上提供更多範例。尋找完整範例,並了解如何在 AWS 程式碼範例儲存庫
中設定和執行。 TRY. oo_result = lo_rds->modifydbclusterparamgroup( iv_dbclusterparamgroupname = iv_param_group_name it_parameters = it_update_parameters ). CATCH /aws1/cx_rdsdbprmgrnotfndfault. " Re-raise exception - parameter group not found RAISE EXCEPTION TYPE /aws1/cx_rdsdbprmgrnotfndfault. CATCH /aws1/cx_rdsinvdbprmgrstatef00. " Re-raise exception - invalid state RAISE EXCEPTION TYPE /aws1/cx_rdsinvdbprmgrstatef00. ENDTRY.-
如需 API 詳細資訊,請參閱《適用於 AWS SAP ABAP 的 SDK API 參考》中的 ModifyDBClusterParameterGroup。
-