Ticket #7628: 7628_cmarshal.diff
File 7628_cmarshal.diff, 952 bytes (added by , 16 years ago) |
---|
-
django/db/backends/oracle/base.py
40 40 tr_name = get_trigger_name(table) 41 41 tbl_name = self.quote_name(table) 42 42 col_name = self.quote_name(column) 43 sequence_sql = 'CREATE SEQUENCE %s;' % sq_name 43 sequence_sql = """ 44 DECLARE 45 i INTEGER; 46 BEGIN 47 SELECT COUNT(*) INTO i FROM USER_CATALOG 48 WHERE TABLE_NAME = '%(sq_name)s' AND TABLE_TYPE = 'SEQUENCE'; 49 IF i = 0 THEN 50 EXECUTE IMMEDIATE 'CREATE SEQUENCE %(sq_name)s'; 51 END IF; 52 END; 53 /""" % locals() 44 54 trigger_sql = """ 45 55 CREATE OR REPLACE TRIGGER %(tr_name)s 46 56 BEFORE INSERT ON %(tbl_name)s