on 2014 Sep 15 6:29 AM
Hi,
we have a legacy tool that helps us generate a list of "ml_add_table_script" executions, but whenever having changes I get a new list of "ml_add_table_script" executions... and the "script_version" table gets a bit hard to oversee.
It looks like this procedure mostly just fills the tables "ml_script_version", "ml_script", "ml_table_script" ...
I would like to perform a litle clean up.
Would it be okay If i just write my own script to remove contenst from "ml_table_script", "ml_script" and "ml_script_version" .... Or would I still be missing something ? (or maybe there is a better way?)
Thank you,
AFAIK the official way to delete unnecessary scripts is to add them with NULL as script contents, such as
ml_add_table_script('v1', 'Customer', 'upload_insert', NULL);
Immediately accessing the ML system tables may work, too, but it may also bear the risk of having missed something, as you suspect...
If you need to delete more than a few scripts, it certainly is possible to generate the according ml_add_...script statements automatically, e.g. with a cursor loop over the according script entries and then calling the ml system procedure with the appropriate parameters.
In case you are using SQL Anywhere as consolidated database, the FOR statement would be handy IMHO to do so.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
[thread-drift]
Or CALL ml_add_table_script ( 'v1', 'hello_world', 'upload_insert', '' ); for a HANA consolidated. The rules might have changed (they are CONSTANTLY changing for HANA), and I can't remember if NULL throws an error or just gets converted to '', but HANA does not support calling stored procedures with NULLs for scalar input parameters. The synchana.sql script accomodates this fact (and the possibility that NULL will be supported eventually:
if :p_script is not null and :p_script <> '' then
IMO MobiLink should have always have treated '' as a delete request... or maybe not, since SQL Server and Oracle rules for ''-versus-NULL are both different and both wrong 🙂
[/thread-drift]
Hi, I accepted your answer. Also thanks for all the other comments. I'm using oracle as a consolidated database. I guess I'll have to modify the legacy app that generates the ml_add_table_script to also generate a delete script with Null as the last parameter...
User | Count |
---|---|
79 | |
11 | |
10 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.