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.
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.
Follow the below each steps which are the basics of how to extract SQL objects from SAP Commissions Database EXT Schema.
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"();
Function
CREATE FUNCTION EXT.GROUP_AGE (age NVARCHAR(10), level INTEGER)
RETURNS outValue NVARCHAR(50) AS
BEGIN
DECLARE defineValue INTEGER DEFAULT 5;
DECLARE interval INTEGER;
DECLARE rangeFrom INTEGER;
IF (level > 0) THEN
interval := defineValue * power(2, level - 1);
rangeFrom = FLOOR(age / interval) * interval;
outValue := '[' || rangeFrom || '-' || rangeFrom + interval - 1 || ']';
ELSE
outValue := age;
END IF;
END
Trigger
CREATE ROW TABLE TARGET ( A INT);
CREATE ROW TABLE SAMPLE ( A INT);
CREATE TRIGGER TEST_TRIGGER
AFTER INSERT ON TARGET FOR EACH ROW
BEGIN
DECLARE SAMPLE_COUNT INT;
SELECT COUNT(*) INTO SAMPLE_COUNT FROM SAMPLE;
IF :SAMPLE_COUNT = 0
THEN
INSERT INTO SAMPLE VALUES(5);
ELSEIF :SAMPLE_COUNT = 1
THEN
INSERT INTO SAMPLE VALUES(6);
END IF;
END;
https://blogs.sap.com/2022/06/27/touchless-deployment-working-session/
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.
Through Postman
---- Stored Procedure ----
Method : POST
URL : https://<tenantId>.callidusondemand.com/TrueComp-SaaS/services/rest/touchlessdeployment/downloadCustomCode?OBJECTTYPE=PROCEDURE&OBJECTNAME=MY_STORED_PROCEDURE1
Authorization : Basic username:password
----- Function -----
Method : POST
URL : https://<<tenantId>>.callidusondemand.com/TrueComp-SaaS/services/rest/touchlessdeployment/downloadCustomCode?OBJECTTYPE=FUNCTION&OBJECTNAME=GROUP_AGE
Authorization : Basic username:password
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
3 | |
2 | |
2 | |
2 | |
2 | |
2 | |
2 | |
2 | |
1 |