 FROM ((MeasurementGroupMeasurement JOIN MeasurementGroup ON (MeasurementGroupMeasurement.MeasurementGroupID = MeasurementGroup.ID)) JOIN Measurement ON (MeasurementGroupMeasurement.SignalID = Measurement.SignalID));
 
 CREATE FUNCTION NEW_GUID RETURN NCHAR AS
-    guid NVARCHAR2(36);
+    guid VARCHAR2(36);
 BEGIN
     SELECT SYS_GUID() INTO guid FROM dual;
     

/

CREATE TRIGGER Device_InsertDefault BEFORE INSERT ON Device FOR EACH ROW BEGIN
    SELECT COALESCE(:NEW.UniqueID, NEW_GUID()) INTO :NEW.UniqueID FROM dual;
    SELECT USER INTO :NEW.CreatedBy FROM dual;
    SELECT SYSDATE INTO :NEW.CreatedOn FROM dual;
    SELECT USER INTO :NEW.UpdatedBy FROM dual;

CREATE TABLE UserAccount (
    ID VARCHAR2(36) NOT NULL,
    Name VARCHAR2(200) NOT NULL,
    Password VARCHAR2(200) DEFAULT NULL,
    FirstName VARCHAR2(200) DEFAULT NULL,
    LastName VARCHAR2(200) DEFAULT NULL,
    DefaultNodeID VARCHAR2(36) NOT NULL,
    Phone VARCHAR2(200) DEFAULT NULL,
    Email VARCHAR2(200) DEFAULT NULL,
    LockedOut NUMBER DEFAULT 0 NOT NULL,
    UseADAuthentication NUMBER DEFAULT 1 NOT NULL,
    ChangePasswordOn DATE DEFAULT NULL,
    CreatedOn DATE NOT NULL,
    CreatedBy VARCHAR2(200) NOT NULL,
    UpdatedOn DATE NOT NULL,
