Reputation: 331
I am going to create a policy update by takeing policy defintion from another table. Let's assume, we have a sampleTable table with the following definition:
.alter table sampleTable policy update @'[{"Source": "sourceTable", "Query": "function()", "IsEnabled": "True", "IsTransactional": false}]';
I would like to use policy for a newTable which were used for sampleTable. I have tried to do something like below:
let definition = (.show table sampleTable policy update | project Policy);
.alter table sampleTable policy update definition ;
I deeply belive, that it is doable, but I don't know the syntax here.
Could you please support me?
Upvotes: 2
Views: 465
Reputation: 25995
a control command must start with a dot (.
): https://stackoverflow.com/a/55387571/7861807
you need to explicitly specify the policy as a string literal. you can't base it on a result of a different query/command.
you can orchestrate this programmatically using the API - run a command to get the policy definition (as a string), then generate the following command using that string, then invoke the generated command.
Upvotes: 1