Choose Language Hide Translation Bar
Highlighted
jan_solo
Community Trekker

Delete a script from a datatable

Hi everyone,

 

I'm currently writing a script that pulls data from a DB.  I add several scripts to the datatable (not in a column, but in the script box, frame top left of the datatable).

JMP adds standard some of the scripts.  One of them is 'Save To DB'.  This script needs to get deleted in the script I'm writing.

 

I can't have the users run this script accidently.  In the past we did 1 DB-update and it completely destroyed the structure of our DB (meaning other programs that connect to th DB stopped working).  Therefore leaving it in is actually a big production risk (and it will happen frequently).

 

I can add scripts with

dt << New Script( ... );

however,

dt << Delete Script( 'MyScript' );

doesn't work.

 

Can anyone help me with this please?

Thanks!!!

0 Kudos
2 ACCEPTED SOLUTIONS

Accepted Solutions

Re: Delete a script from a datatable

Unfortunately these objects were originally known as table properties and now we call them table scripts. The message protocol to the data table is a bit confusing as a result.

See Help > Scripting Index > Objects > Data Table. Select Delete Table Property in the second list for more information. This message is the one that you are looking for.

Learn it once, use it forever!

View solution in original post

pmroz
Super User

Re: Delete a script from a datatable

Here's some code that deletes two table variables and one property:

current_dataset << Delete Table Variable("JSL");
current_dataset << Delete Table Variable("SQL");
current_dataset << Delete Table Property("Source");

In addition you can hide the ODBC connection string with a preference.  In JSL you can do this:

pref(ODBC Hide Connection String(1));

View solution in original post

2 REPLIES 2

Re: Delete a script from a datatable

Unfortunately these objects were originally known as table properties and now we call them table scripts. The message protocol to the data table is a bit confusing as a result.

See Help > Scripting Index > Objects > Data Table. Select Delete Table Property in the second list for more information. This message is the one that you are looking for.

Learn it once, use it forever!

View solution in original post

pmroz
Super User

Re: Delete a script from a datatable

Here's some code that deletes two table variables and one property:

current_dataset << Delete Table Variable("JSL");
current_dataset << Delete Table Variable("SQL");
current_dataset << Delete Table Property("Source");

In addition you can hide the ODBC connection string with a preference.  In JSL you can do this:

pref(ODBC Hide Connection String(1));

View solution in original post