· 8 years ago · Jan 24, 2018, 10:56 PM
1CREATE OR REPLACE FUNCTION test_update_icd_code()
2 RETURNS void
3AS $$
4
5
6-- Create a test table that references dx_log.
7DROP TABLE IF EXISTS test;
8
9CREATE TABLE nova.test
10(
11 recid serial PRIMARY KEY,
12 dx_log_recid integer NOT NULL,
13 CONSTRAINT test_dx_log_fk FOREIGN KEY (dx_log_recid)
14 REFERENCES dx_log (recid) MATCH SIMPLE
15 ON UPDATE CASCADE
16 ON DELETE RESTRICT
17)
18WITH (
19 OIDS = FALSE
20);
21
22-----------
23
24$$ LANGUAGE 'sql' VOLATILE;