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,

asked 15 Sep '14, 05:29

vdcey's gravatar image

vdcey
654222838
accept rate: 33%

1

In addition to what Volker said...

What version of MobiLink server are you running? There have been changes to the supporting tables, so any suggestions about "what's safe to purge and what must be protected if you don't want all your syncs to fail" depend on the version.

Also, what software are you using for the consolidated database?

Before purging anything, however, get your house in order; i.e., test you script creation process on an empty database to make sure that (a) it creates everything you need and (b) doesn't leave anything unnecessary behind when you run it multiple times. IMO all the scripts should be maintained in text files just like any other critical piece of source code (which they are)... and they should be written to be re-runnable without issue.

(15 Sep '14, 07:53) Breck Carter
Replies hidden
1

FWIW, a look at the MobiLink setup script for the according consolidated database (in folder %SQLANYxx%\MobiLink\Setup) may help to get to know the implementation of the ML system procedures. That way you may see if you are missing something...

(15 Sep '14, 09:49) Volker Barth

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.

permanent link

answered 15 Sep '14, 06:28

Volker%20Barth's gravatar image

Volker Barth
30.3k300452659
accept rate: 32%

edited 15 Sep '14, 06:53

1

[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]

(15 Sep '14, 08:13) Breck Carter
1

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...

(17 Sep '14, 03:22) vdcey
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×290

question asked: 15 Sep '14, 05:29

question was seen: 509 times

last updated: 17 Sep '14, 03:22