Skip to content

Instantly share code, notes, and snippets.

@twobiers
Created August 27, 2020 12:21
Show Gist options
  • Save twobiers/9c97ddbdc8ca9163333760f707353200 to your computer and use it in GitHub Desktop.
Save twobiers/9c97ddbdc8ca9163333760f707353200 to your computer and use it in GitHub Desktop.
SQL Oracle DML
-- ------------------------------------
-- DELETE
-- ------------------------------------
DELETE FROM dml_test_table WHERE id = 1;
-- ------------------------------------
-- INSERT
-- ------------------------------------
INSERT INTO dml_test_table (id, col1) VALUES (1, 'hello');
-- ------------------------------------
-- Integritätsprüfung
-- DEFERRED -> Ende Transaktion
-- IMMEDIATE -> Ende DML
-- ------------------------------------
CREATE TABLE transaction_test(
col1 VARCHAR2(20) NOT NULL INITIALLY DEFERRED,
col2 VARCHAR2(20) UNIQUE INITIALLY IMMEDIATE
);
-- ------------------------------------
-- TRANSAKTIONEN
-- ------------------------------------
COMMIT;
ROLLBACK;
-- ------------------------------------
-- UPDATE
-- ------------------------------------
UPDATE dml_test_table SET col1 = 'test' WHERE id = 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment