2011-03-21 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* pandoradb.oracle.sql pandoradb.data.oracle.sql: Changed the autoincrement of tconfig_os's pk in order to respect sequence on this field. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4110 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
7a3afcbd81
commit
d1c18b13e2
|
@ -1,3 +1,9 @@
|
||||||
|
2011-03-21 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
|
||||||
|
|
||||||
|
* pandoradb.oracle.sql
|
||||||
|
pandoradb.data.oracle.sql: Changed the autoincrement of tconfig_os's pk
|
||||||
|
in order to respect sequence on this field.
|
||||||
|
|
||||||
2011-03-18 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
|
2011-03-18 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
|
||||||
* pandoradb.oracle.sql
|
* pandoradb.oracle.sql
|
||||||
pandoradb.data.oracle.sql: First version of pandora's DB schema and data for
|
pandoradb.data.oracle.sql: First version of pandora's DB schema and data for
|
||||||
|
|
|
@ -106,6 +106,24 @@ COMMIT;
|
||||||
END;
|
END;
|
||||||
/
|
/
|
||||||
|
|
||||||
|
CREATE SEQUENCE tconfig_os_s INCREMENT BY 1 START WITH 1;
|
||||||
|
|
||||||
|
CREATE OR REPLACE TRIGGER tconfig_os_inc BEFORE INSERT ON tconfig_os REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tconfig_os_s.nextval INTO :NEW.ID_OS FROM dual; END;
|
||||||
|
/
|
||||||
|
|
||||||
|
-- PLSQL for update curr val of sequence
|
||||||
|
BEGIN
|
||||||
|
DECLARE key_max NUMBER := 0;
|
||||||
|
key_currval NUMBER := 0;
|
||||||
|
BEGIN
|
||||||
|
SELECT MAX(ID_OS) INTO key_max FROM tconfig_os;
|
||||||
|
EXECUTE IMMEDIATE 'ALTER SEQUENCE TCONFIG_OS_S INCREMENT BY ' || key_max;
|
||||||
|
SELECT TCONFIG_OS_S.NEXTVAL INTO key_currval FROM dual;
|
||||||
|
EXECUTE IMMEDIATE 'ALTER SEQUENCE TCONFIG_OS_S INCREMENT BY 1';
|
||||||
|
END;
|
||||||
|
END;
|
||||||
|
/
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Dumping data for table "tgrupo"
|
-- Dumping data for table "tgrupo"
|
||||||
--
|
--
|
||||||
|
|
|
@ -463,11 +463,6 @@ CREATE TABLE tconfig_os (
|
||||||
icon_name VARCHAR2(100) default ''
|
icon_name VARCHAR2(100) default ''
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE SEQUENCE tconfig_os_s INCREMENT BY 1 START WITH 1;
|
|
||||||
|
|
||||||
CREATE OR REPLACE TRIGGER tconfig_os_inc BEFORE INSERT ON tconfig_os REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tconfig_os_s.nextval INTO :NEW.ID_OS FROM dual; END;
|
|
||||||
/
|
|
||||||
|
|
||||||
CREATE TABLE tevento (
|
CREATE TABLE tevento (
|
||||||
id_evento NUMBER(19, 0) NOT NULL PRIMARY KEY,
|
id_evento NUMBER(19, 0) NOT NULL PRIMARY KEY,
|
||||||
id_agente NUMBER(10, 0) default 0 NOT NULL,
|
id_agente NUMBER(10, 0) default 0 NOT NULL,
|
||||||
|
|
Loading…
Reference in New Issue