cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
%3CLINGO-SUB%20id%3D%22lingo-sub-42823%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E4%BB%8E%E6%95%B0%E6%8D%AE%E8%A1%A8%E4%B8%AD%E5%88%A0%E9%99%A4%E8%84%9A%E6%9C%AC%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-42823%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E5%A4%A7%E5%AE%B6%E5%A5%BD%EF%BC%8C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%E6%88%91%E7%9B%AE%E5%89%8D%E6%AD%A3%E5%9C%A8%E7%BC%96%E5%86%99%E4%B8%80%E4%B8%AA%E4%BB%8E%E6%95%B0%E6%8D%AE%E5%BA%93%E4%B8%AD%E6%8F%90%E5%8F%96%E6%95%B0%E6%8D%AE%E7%9A%84%E8%84%9A%E6%9C%AC%E3%80%82%E6%88%91%E5%B0%86%E5%A4%9A%E4%B8%AA%E8%84%9A%E6%9C%AC%E6%B7%BB%E5%8A%A0%E5%88%B0%E6%95%B0%E6%8D%AE%E8%A1%A8%E4%B8%AD%EF%BC%88%E4%B8%8D%E6%98%AF%E5%9C%A8%E5%88%97%E4%B8%AD%EF%BC%8C%E8%80%8C%E6%98%AF%E5%9C%A8%E6%95%B0%E6%8D%AE%E8%A1%A8%E5%B7%A6%E4%B8%8A%E8%A7%92%E6%A1%86%E6%9E%B6%E7%9A%84%E8%84%9A%E6%9C%AC%E6%A1%86%E4%B8%AD%EF%BC%89%E3%80%82%3C%2FP%3E%3CP%3EJMP%20%E6%B7%BB%E5%8A%A0%E4%BA%86%E4%B8%80%E4%BA%9B%E6%A0%87%E5%87%86%E8%84%9A%E6%9C%AC%E3%80%82%E5%85%B6%E4%B8%AD%E4%B9%8B%E4%B8%80%E6%98%AF%E2%80%9C%E4%BF%9D%E5%AD%98%E5%88%B0%E6%95%B0%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2FP%3E%3CP%3E%E6%88%91%E5%8F%AF%E4%BB%A5%E6%B7%BB%E5%8A%A0%E8%84%9A%E6%9C%AC%3C%2FP%3E%3CP%3Edt%20%26lt%3B%26lt%3B%20%E6%96%B0%E8%84%9A%E6%9C%AC(%20...%20)%3B%3C%2FP%3E%3CP%3E%E7%84%B6%E8%80%8C%EF%BC%8C%3C%2FP%3E%3CP%3Edt%20%26lt%3B%26lt%3B%20%E5%88%A0%E9%99%A4%E8%84%9A%E6%9C%AC(%20'MyScript'%20)%3B%3C%2FP%3E%3CP%3E%E4%B8%8D%E8%B5%B7%E4%BD%9C%E7%94%A8%E3%80%82%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%E6%9C%89%E4%BA%BA%E5%8F%AF%E4%BB%A5%E5%B8%AE%E6%88%91%E8%A7%A3%E5%86%B3%E8%BF%99%E4%B8%AA%E9%97%AE%E9%A2%98%E5%90%97%EF%BC%9F%3C%2FP%3E%3CP%3E%E8%B0%A2%E8%B0%A2%EF%BC%81%EF%BC%81%EF%BC%81%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-246332%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E4%BB%8E%E6%95%B0%E6%8D%AE%E8%A1%A8%E4%B8%AD%E5%88%A0%E9%99%A4%E8%84%9A%E6%9C%AC%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-246332%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%E6%88%91%E7%9F%A5%E9%81%93%E8%BF%99%E5%B7%B2%E7%BB%8F%E6%99%9A%E4%BA%86...%E4%BD%86%E4%BB%85%E4%BE%9B%E5%8F%82%E8%80%83%E3%80%82%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%2F%2FTo%20get%20all%20the%20names%20of%20the%20scripts%20in%20a%20data%20table%0AlstScripts%20%3D%20dt%20%26lt%3B%26lt%3B%20Get%20Table%20Script%20Names%3B%0A%0A%2F%2Fdelete%20scripts%20in%20data%20table%0Adt%20%26lt%3B%26lt%3B%20Delete%20Scripts(lstScripts)%3B%26nbsp%3B%20%2F%2F%20delete%20all%20scripts%0Adt%20%26lt%3B%26lt%3B%20Delete%20Scripts(%7B%22Script1%22%2C%20%22Script2%22%7D)%3B%26nbsp%3B%20%26nbsp%3B%2F%2F%20delete%20certain%20scripts%20only%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-42828%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E4%BB%8E%E6%95%B0%E6%8D%AE%E8%A1%A8%E4%B8%AD%E5%88%A0%E9%99%A4%E8%84%9A%E6%9C%AC%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-42828%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E4%B8%8B%E9%9D%A2%E6%98%AF%E4%B8%80%E4%BA%9B%E5%88%A0%E9%99%A4%E4%B8%A4%E4%B8%AA%E8%A1%A8%E5%8F%98%E9%87%8F%E5%92%8C%E4%B8%80%E4%B8%AA%E5%B1%9E%E6%80%A7%E7%9A%84%E4%BB%A3%E7%A0%81%EF%BC%9A%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Ecurrent_dataset%20%26lt%3B%26lt%3B%20Delete%20Table%20Variable(%22JSL%22)%3B%0Acurrent_dataset%20%26lt%3B%26lt%3B%20Delete%20Table%20Variable(%22SQL%22)%3B%0Acurrent_dataset%20%26lt%3B%26lt%3B%20Delete%20Table%20Property(%22Source%22)%3B%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%E6%AD%A4%E5%A4%96%EF%BC%8C%E6%82%A8%E8%BF%98%E5%8F%AF%E4%BB%A5%E9%80%9A%E8%BF%87%E9%A6%96%E9%80%89%E9%A1%B9%E9%9A%90%E8%97%8F%20ODBC%20%E8%BF%9E%E6%8E%A5%E5%AD%97%E7%AC%A6%E4%B8%B2%E3%80%82%20%E5%9C%A8%20JSL%20%E4%B8%AD%E4%BD%A0%E5%8F%AF%E4%BB%A5%E8%BF%99%E6%A0%B7%E5%81%9A%EF%BC%9A%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Epref(ODBC%20Hide%20Connection%20String(1))%3B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-42827%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E4%BB%8E%E6%95%B0%E6%8D%AE%E8%A1%A8%E4%B8%AD%E5%88%A0%E9%99%A4%E8%84%9A%E6%9C%AC%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-42827%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E4%B8%8D%E5%B9%B8%E7%9A%84%E6%98%AF%EF%BC%8C%E8%BF%99%E4%BA%9B%E5%AF%B9%E8%B1%A1%E6%9C%80%E5%88%9D%E8%A2%AB%E7%A7%B0%E4%B8%BA%E8%A1%A8%E5%B1%9E%E6%80%A7%EF%BC%8C%E7%8E%B0%E5%9C%A8%E6%88%91%E4%BB%AC%E5%B0%86%E5%AE%83%E4%BB%AC%E7%A7%B0%E4%B8%BA%E8%A1%A8%E8%84%9A%E6%9C%AC%E3%80%82%20%E5%9B%A0%E6%AD%A4%EF%BC%8C%E6%95%B0%E6%8D%AE%E8%A1%A8%E7%9A%84%E6%B6%88%E6%81%AF%E5%8D%8F%E8%AE%AE%E6%9C%89%E7%82%B9%E6%B7%B7%E4%B9%B1%E3%80%82%3C%2FP%3E%0A%3CP%3E%E7%9C%8B%3CSTRONG%3E%E5%B8%AE%E5%8A%A9%3C%2FSTRONG%3E%26gt%3B%3CSTRONG%3E%E8%84%9A%E6%9C%AC%E7%B4%A2%E5%BC%95%3C%2FSTRONG%3E%26gt%3B%3CSTRONG%3E%E5%AF%B9%E8%B1%A1%3C%2FSTRONG%3E%26gt%3B%3CSTRONG%3E%E6%95%B0%E6%8D%AE%E8%A1%A8%3C%2FSTRONG%3E%E3%80%82%20%E9%80%89%E6%8B%A9%3CSTRONG%3E%E5%88%A0%E9%99%A4%E8%A1%A8%E5%B1%9E%E6%80%A7%3C%2FSTRONG%3E%E5%9C%A8%E7%AC%AC%E4%BA%8C%E4%B8%AA%E5%88%97%E8%A1%A8%E4%B8%AD%E4%BA%86%E8%A7%A3%E6%9B%B4%E5%A4%9A%E4%BF%A1%E6%81%AF%E3%80%82%20%E6%AD%A4%E6%B6%88%E6%81%AF%E5%B0%B1%E6%98%AF%E6%82%A8%E6%AD%A3%E5%9C%A8%E5%AF%BB%E6%89%BE%E7%9A%84%E6%B6%88%E6%81%AF%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
jan_solo
Level III

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

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.

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

3 REPLIES 3

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.

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));
KalaiAce21
Level I

Re: Delete a script from a datatable

 

I know this is late... but just for reference. 

 

//To get all the names of the scripts in a data table
lstScripts = dt << Get Table Script Names;

//delete scripts in data table
dt << Delete Scripts(lstScripts);  // delete all scripts
dt << Delete Scripts({"Script1", "Script2"});   // delete certain scripts only