Expand my Community achievements bar.

Get ready! An upgraded Experience League Community experience is coming in January.

Delete Schema via Javascript

Avatar

Level 3

Hi,

 

Is there a special method to delete schemas via javascript?

 

The following generates an error:

xtk.session.Write(<schema _operation="delete" xtkschema="xtk:sourceSchema" _key="@name" id={schemaName} />)

 

The error:

11/20/2025 12:29:20 PM XFR-180000 The file '/usr/local/neolane/nl6/datakit/xtk/eng/schema/sourceSchema.xml' does not exist on the server. Unable to load the document of identifier 'xtk:sourceSchema' and type 'xtk:schema'.

 

Thanks,

Skyler

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

4 Replies

Avatar

Community Advisor

Hi @SkylerQu2 ,

You can use SQL code activity and execute DROP TABLE customTable

or in JS, var sql = "DROP TABLE customTable"; xtk.session.executeQuery(sql);

But by both methods only tables will get deleted, but schema will still remain in the instance.

So, the best practice is instead of deleting using a script, navigate to Administration > Configuration > Data schemas and delete it and update the database structure.

 

Avatar

Level 3

Hi @ParthaSarathy  thank you, yes, we are executing the DROP TABLE sql, but is there any way to remove the schema automatically?

Avatar

Community Advisor

You can only manually delete from Administration > Configuration > Data schemas, thus you can also ensure there is no schema deleted by mistake and also can check if there is any relationship between other schema will get impacted. 

Avatar

Level 1

Hi,

I think xtk:sourceSchema is a typo. Should probably be xtk:srcSchema.

Regards,

Jonas