Quantcast
Viewing all articles
Browse latest Browse all 2539

disable foreign key constraints temporarily

Hi everybody,

I am trying to implement a db restore function in the HANA Cloud which uses MaxDB.

 

For this, I have a complete xml based db backup which I upload to my HANA Cloud application.

Since I am very (100%) sure that this backup is valid regarding foreign key constraints, I simply

want to execute insert statements one after another.

 

During this process I insert records with foreign ids which haven't been inserted yet, which leads

to SQLExceptions.. (Integrity Errors)

 

some SQL databases have the possibility to disable those constraints checks temporarily with

 

SET foreign_key_checks = 0;

// do the import

SET foreign_key_checks = 1;

 

or

ALTER TABLE foo NOCHECK CONSTRAINT ALL;

// do the import

ALTER TABLE foo CHECK CONSTRAINT ALL;

 

or

ALTER TABLE foo DISABLE KEYS;

 

but none of those statements work.

 

Does anyone know what the MaxDB SQL command for this kind of functionality is?

 

 

Many thanks!


Viewing all articles
Browse latest Browse all 2539

Trending Articles