3

Touchless Deployment – How to extract your SQL objects without connecting to Dat...

 11 months ago
source link: https://blogs.sap.com/2023/06/06/touchless-deployment-how-to-extract-your-sql-objects-without-connecting-to-database/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
June 6, 2023 2 minute read

Touchless Deployment – How to extract your SQL objects without connecting to Database ?

Dear All,

In this blog, you will come to know how to extract your SQL Objects without connecting to your live database but through Touchless Deployment. This will help you, Comp Developer, SQL Admins .. etc to validate your SQL Script which is deployed in EXT Schema..

(This operation is not supported in SAP Commissions running on Oracle tenants.)

SQL Objects which you can download –  PROCEDURE/LIBRARY/FUNCTION/TRIGGER.

If you’ve ever used Touchless Deployment to extract SQL objects, you know how convenient and easy it can be. With a few simple steps, you can quickly retrieve objects from your databases, saving yourself a ton of time and hassle.

111575-api-testing-2.gif

Extracting these objects can reduce the amount of development time needed, as well as simplify the process of updating the stored objects in the database.


Understanding of Touchless Deployment Flow

UML Diagram to represent each steps of execution for Touchless Deployment

2023-06-06_18-04-19.png

Let’s see through an example how to extract your SQL Objects.

Follow the below each steps which are the basics of how to extract SQL objects from SAP Commissions Database EXT Schema.

Step 1 : Execute the sample Stored Procedure

CREATE TABLE "YOGA"
(
  "DATETIME" DATETIME
);


CREATE OR REPLACE PROCEDURE "EXT"."MY_STORED_PROCEDURE1" ()
LANGUAGE SQLSCRIPT
SQL SECURITY INVOKER
AS
BEGIN
	insert into yoga
	SELECT CURRENT_TIMESTAMP FROM DUMMY;
commit;
END;


CALL "EXT"."MY_STORED_PROCEDURE1"();

Step 2 : You can use Touchless Deployment to deploy above Stored Procedure by following blogs

https://blogs.sap.com/2022/06/27/touchless-deployment-working-session/

Step 3 : Verify if your Stored Procedure is displayed in your Schema Explorer
( This will not apply for Production environment – you can find it through Step 2 – when JobId is successful)

2023-06-06_18-16-37.png

Step 4

you can execute the TD_Client Shell Script with below provided syntax. Refer SAP Help Doc to download TD_Client

you must be in bin path to get this work.

TDClient.sh -o codeDownload -type PROCEDURE -object MY_STORED_PROCEDURE1

codeDownload:

parameter will execute the request sent and gets the Job to download the custom code for type PROCEDURE/LIBRARY/FUNCTION/TRIGGER.

The code will be downloaded in the directory pointed by environment variable TD_LOGDIRECTORY.

2023-06-06_16-41-48.png

Through Postman

Method : POST
URL : https://<tenantId>.callidusondemand.com/TrueComp-SaaS/services/rest/touchlessdeployment/downloadCustomCode?OBJECTTYPE=PROCEDURE&OBJECTNAME=MY_STORED_PROCEDURE1
Authorization : Basic username:password
2023-06-06_18-08-10.png

Step 5

Download the SQL Object only if 200ok is shown. Click Save to Response file and download the zip file. Extract the Zip file and you can see SQL Object.

2023-06-06_18-10-17.png

Final End Result

In Addition to all above, extracting SQL objects can help you to better organize and debug code within the database, allowing developers and administrators to quickly correct any issues that may arise.

Finally, extracting objects can help ensure that changes do not unintentionally affect existing functionality.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK