Quantcast
Channel: SCN : All Content - Data Services and Data Quality
Viewing all articles
Browse latest Browse all 4013

SQL Script in dataservices to loop at SQL result set

$
0
0

Hi,

 

I would like to create a script in data services that can perform the psedo code below. However I have no clue how to make the loop functionality so that I loop at every single record that the select statement returns.

 

Psedo:

SELECT DISTINCT "/BIC/I_CST_FN" FROM "HANA_DB"."ZST0100"

Loop at the result set returned by above statement, for each result record

DELETE FROM "OTHER_DB"."IN_TABLE WHERE FILE_NAME="/BIC/I_CST_FN"

 

So basically in the target HANA_DB I have a table (ZST0100). Based on the distinct filenames listed in ZST0100 I would like to delete records in the IN_TABLE which is located in OTHER_DB.

 

I know I can use this statement to delete: sql('OTHER_DB','DELETE FROM IN_TABLE WHERE FILENAME=abcabcabc'); However I have no idea about how to make the loop, hope you can help.

 

Thanks in advance.

KR

Torben


Viewing all articles
Browse latest Browse all 4013

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>