text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
--CMS DE-SynPUF 1000 person dataset in OMOP v5.3.1 schema
--SET search_path assigns the SCHEMA for this data, which must be the same at the filename of this file.
--Patient Level Tables
SET search_path to cmsdesynpuf1kpostgres;
CREATE TABLE public.temp();
COPY public.temp FROM PROGRAM 'mkdir /tmp/tempdata/';
COPY public.temp FROM PROGRAM 'aws s3 cp s3://ohdsi-sample-data/cms-cdm/CDM_CARE_SITE.csv.bz2 /tmp/tempdata/';
COPY public.temp FROM PROGRAM 'bzip2 -d /tmp/tempdata/CDM_CARE_SITE.csv.bz2';
COPY CARE_SITE FROM '/tmp/tempdata/CDM_CARE_SITE.csv' WITH DELIMITER ',' CSV HEADER QUOTE E'\b';
COPY public.temp FROM PROGRAM 'rm /tmp/tempdata/CDM_CARE_SITE.csv';
COPY public.temp FROM PROGRAM 'aws s3 cp s3://ohdsi-sample-data/cms-cdm/CDM_CONDITION_OCCURRENCE.csv.bz2 /tmp/tempdata/';
COPY public.temp FROM PROGRAM 'bzip2 -d /tmp/tempdata/CDM_CONDITION_OCCURRENCE.csv.bz2';
COPY CONDITION_OCCURRENCE(CONDITION_OCCURRENCE_ID,PERSON_ID,CONDITION_CONCEPT_ID,CONDITION_START_DATE,CONDITION_START_DATETIME,CONDITION_END_DATE,CONDITION_END_DATETIME,CONDITION_TYPE_CONCEPT_ID,STOP_REASON,PROVIDER_ID,VISIT_OCCURRENCE_ID,CONDITION_SOURCE_VALUE,CONDITION_SOURCE_CONCEPT_ID) FROM '/tmp/tempdata/CDM_CONDITION_OCCURRENCE.csv' WITH DELIMITER ',' CSV HEADER QUOTE E'\b';
COPY public.temp FROM PROGRAM 'rm /tmp/tempdata/CDM_CONDITION_OCCURRENCE.csv';
COPY public.temp FROM PROGRAM 'aws s3 cp s3://ohdsi-sample-data/cms-cdm/CDM_DEATH.csv.bz2 /tmp/tempdata/';
COPY public.temp FROM PROGRAM 'bzip2 -d /tmp/tempdata/CDM_DEATH.csv.bz2';
COPY DEATH FROM '/tmp/tempdata/CDM_DEATH.csv' WITH DELIMITER ',' CSV HEADER QUOTE E'\b';
COPY public.temp FROM PROGRAM 'rm /tmp/tempdata/CDM_DEATH.csv';
COPY public.temp FROM PROGRAM 'aws s3 cp s3://ohdsi-sample-data/cms-cdm/CDM_DRUG_EXPOSURE5.2.2.csv.bz2 /tmp/tempdata/';
COPY public.temp FROM PROGRAM 'bzip2 -d /tmp/tempdata/CDM_DRUG_EXPOSURE5.2.2.csv.bz2';
COPY DRUG_EXPOSURE(DRUG_EXPOSURE_ID,PERSON_ID,DRUG_CONCEPT_ID,DRUG_EXPOSURE_START_DATE,DRUG_EXPOSURE_START_DATETIME,DRUG_EXPOSURE_END_DATE,DRUG_EXPOSURE_END_DATETIME,DRUG_TYPE_CONCEPT_ID,STOP_REASON,REFILLS,QUANTITY,DAYS_SUPPLY,SIG,ROUTE_CONCEPT_ID,LOT_NUMBER,PROVIDER_ID,VISIT_OCCURRENCE_ID,DRUG_SOURCE_VALUE,DRUG_SOURCE_CONCEPT_ID,ROUTE_SOURCE_VALUE,DOSE_UNIT_SOURCE_VALUE) FROM '/tmp/tempdata/CDM_DRUG_EXPOSURE5.2.2.csv.bz2' WITH DELIMITER ',' CSV HEADER QUOTE E'\b';
COPY public.temp FROM PROGRAM 'rm /tmp/tempdata/CDM_DRUG_EXPOSURE5.2.2.csv';
COPY public.temp FROM PROGRAM 'aws s3 cp s3://ohdsi-sample-data/cms-cdm/CDM_DEVICE_EXPOSURE.csv.bz2 /tmp/tempdata/';
COPY public.temp FROM PROGRAM 'bzip2 -d /tmp/tempdata/CDM_DEVICE_EXPOSURE.csv.bz2';
COPY DEVICE_EXPOSURE(DEVICE_EXPOSURE_ID,PERSON_ID,DEVICE_CONCEPT_ID,DEVICE_EXPOSURE_START_DATE,DEVICE_EXPOSURE_START_DATETIME,DEVICE_EXPOSURE_END_DATE,DEVICE_EXPOSURE_END_DATETIME,DEVICE_TYPE_CONCEPT_ID,UNIQUE_DEVICE_ID,QUANTITY,PROVIDER_ID,VISIT_OCCURRENCE_ID,DEVICE_SOURCE_VALUE,DEVICE_SOURCE_CONCEPT_ID) FROM '/tmp/tempdata/CDM_DEVICE_EXPOSURE.csv' WITH DELIMITER ',' CSV HEADER QUOTE E'\b';
COPY public.temp FROM PROGRAM 'rm /tmp/tempdata/CDM_DEVICE_EXPOSURE.csv';
COPY public.temp FROM PROGRAM 'aws s3 cp s3://ohdsi-sample-data/cms-cdm/CDM_LOCATION.csv.bz2 /tmp/tempdata/';
COPY public.temp FROM PROGRAM 'bzip2 -d /tmp/tempdata/CDM_LOCATION.csv.bz2';
COPY LOCATION FROM '/tmp/tempdata/CDM_LOCATION.csv' WITH DELIMITER ',' CSV HEADER QUOTE E'\b';
COPY public.temp FROM PROGRAM 'rm /tmp/tempdata/CDM_LOCATION.csv';
COPY public.temp FROM PROGRAM 'aws s3 cp s3://ohdsi-sample-data/cms-cdm/CDM_MEASUREMENT5.2.2.csv.bz2 /tmp/tempdata/';
COPY public.temp FROM PROGRAM 'bzip2 -d /tmp/tempdata/CDM_MEASUREMENT5.2.2.csv.bz2';
COPY MEASUREMENT FROM '/tmp/tempdata/CDM_MEASUREMENT5.2.2.csv' WITH DELIMITER ',' CSV HEADER QUOTE E'\b';
COPY public.temp FROM PROGRAM 'rm /tmp/tempdata/CDM_MEASUREMENT5.2.2.csv';
COPY public.temp FROM PROGRAM 'aws s3 cp s3://ohdsi-sample-data/cms-cdm/CDM_OBSERVATION5.2.2.csv.bz2 /tmp/tempdata/';
COPY public.temp FROM PROGRAM 'bzip2 -d /tmp/tempdata/CDM_OBSERVATION5.2.2.csv.bz2';
COPY OBSERVATION FROM '/tmp/tempdata/CDM_OBSERVATION5.2.2.csv' WITH DELIMITER ',' CSV HEADER QUOTE E'\b';
COPY public.temp FROM PROGRAM 'rm /tmp/tempdata/CDM_OBSERVATION5.2.2.csv';
COPY public.temp FROM PROGRAM 'aws s3 cp s3://ohdsi-sample-data/cms-cdm/CDM_OBSERVATION_PERIOD5.3.1.csv.bz2 /tmp/tempdata/';
COPY public.temp FROM PROGRAM 'bzip2 -d /tmp/tempdata/CDM_OBSERVATION_PERIOD5.3.1.csv.bz2';
COPY OBSERVATION_PERIOD(OBSERVATION_PERIOD_ID,PERSON_ID,OBSERVATION_PERIOD_START_DATE,OBSERVATION_PERIOD_END_DATE,PERIOD_TYPE_CONCEPT_ID) FROM '/tmp/tempdata/CDM_OBSERVATION_PERIOD5.3.1.csv' WITH DELIMITER ',' CSV HEADER;
COPY public.temp FROM PROGRAM 'rm /tmp/tempdata/CDM_OBSERVATION_PERIOD5.3.1.csv';
COPY public.temp FROM PROGRAM 'aws s3 cp s3://ohdsi-sample-data/cms-cdm/CDM_PERSON.csv.bz2 /tmp/tempdata/';
COPY public.temp FROM PROGRAM 'bzip2 -d /tmp/tempdata/CDM_PERSON.csv.bz2';
COPY PERSON FROM '/tmp/tempdata/CDM_PERSON.csv' WITH DELIMITER ',' CSV HEADER QUOTE E'\b';
COPY public.temp FROM PROGRAM 'rm /tmp/tempdata/CDM_PERSON.csv';
COPY public.temp FROM PROGRAM 'aws s3 cp s3://ohdsi-sample-data/cms-cdm/CDM_PROCEDURE_OCCURRENCE5.3.1.csv.bz2 /tmp/tempdata/';
COPY public.temp FROM PROGRAM 'bzip2 -d /tmp/tempdata/CDM_PROCEDURE_OCCURRENCE5.3.1.csv.bz2';
COPY PROCEDURE_OCCURRENCE(PROCEDURE_OCCURRENCE_ID,PERSON_ID,PROCEDURE_CONCEPT_ID,PROCEDURE_DATE,PROCEDURE_DATETIME,PROCEDURE_TYPE_CONCEPT_ID,MODIFIER_CONCEPT_ID,QUANTITY,PROVIDER_ID,VISIT_OCCURRENCE_ID,VISIT_DETAIL_ID,PROCEDURE_SOURCE_VALUE,PROCEDURE_SOURCE_CONCEPT_ID,MODIFIER_SOURCE_VALUE) FROM '/tmp/tempdata/CDM_PROCEDURE_OCCURRENCE5.3.1.csv' WITH DELIMITER ',' CSV HEADER QUOTE E'\b';
COPY public.temp FROM PROGRAM 'rm /tmp/tempdata/CDM_PROCEDURE_OCCURRENCE5.3.1.csv';
COPY public.temp FROM PROGRAM 'aws s3 cp s3://ohdsi-sample-data/cms-cdm/CDM_PROVIDER.csv.bz2 /tmp/tempdata/';
COPY public.temp FROM PROGRAM 'bzip2 -d /tmp/tempdata/CDM_PROVIDER.csv.bz2';
COPY PROVIDER FROM '/tmp/tempdata/CDM_PROVIDER.csv' WITH DELIMITER ',' CSV HEADER QUOTE E'\b';
COPY public.temp FROM PROGRAM 'rm /tmp/tempdata/CDM_PROVIDER.csv';
COPY public.temp FROM PROGRAM 'aws s3 cp s3://ohdsi-sample-data/cms-cdm/CDM_VISIT_OCCURRENCE.csv.bz2 /tmp/tempdata/';
COPY public.temp FROM PROGRAM 'bzip2 -d /tmp/tempdata/CDM_VISIT_OCCURRENCE.csv.bz2';
COPY VISIT_OCCURRENCE(VISIT_OCCURRENCE_ID,PERSON_ID,VISIT_CONCEPT_ID,VISIT_START_DATE,VISIT_START_DATETIME,VISIT_END_DATE,VISIT_END_DATETIME,VISIT_TYPE_CONCEPT_ID,PROVIDER_ID,CARE_SITE_ID,VISIT_SOURCE_VALUE,VISIT_SOURCE_CONCEPT_ID) FROM '/tmp/tempdata/CDM_VISIT_OCCURRENCE.csv' WITH DELIMITER ',' CSV HEADER QUOTE E'\b';
COPY public.temp FROM PROGRAM 'rm /tmp/tempdata/CDM_VISIT_OCCURRENCE.csv';
COPY public.temp FROM PROGRAM 'aws s3 cp s3://ohdsi-sample-data/cms-cdm/CDM_DRUG_ERA.csv.bz2 /tmp/tempdata/';
COPY public.temp FROM PROGRAM 'bzip2 -d /tmp/tempdata/CDM_DRUG_ERA.csv.bz2';
COPY DRUG_ERA FROM '/tmp/tempdata/CDM_DRUG_ERA.csv' WITH DELIMITER ',' CSV HEADER QUOTE E'\b';
COPY public.temp FROM PROGRAM 'rm /tmp/tempdata/CDM_DRUG_ERA.csv';
COPY public.temp FROM PROGRAM 'aws s3 cp s3://ohdsi-sample-data/cms-cdm/CDM_CONDITION_ERA.csv.bz2 /tmp/tempdata/';
COPY public.temp FROM PROGRAM 'bzip2 -d /tmp/tempdata/CDM_CONDITION_ERA.csv.bz2';
COPY CONDITION_ERA FROM '/tmp/tempdata/CDM_CONDITION_ERA.csv' WITH DELIMITER ',' CSV HEADER QUOTE E'\b';
COPY public.temp FROM PROGRAM 'rm /tmp/tempdata/CDM_CONDITION_ERA.csv';
--Vocabulary Tables
COPY public.temp FROM PROGRAM 'aws s3 cp s3://ohdsi-sample-data/vocab/CONCEPT_ANCESTOR.csv.bz2 /tmp/tempdata/';
COPY public.temp FROM PROGRAM 'bzip2 -d /tmp/tempdata/CONCEPT_ANCESTOR.csv.bz2';
COPY CONCEPT_ANCESTOR FROM '/tmp/tempdata/CONCEPT_ANCESTOR.csv' WITH DELIMITER E'\t' CSV HEADER QUOTE E'\b';
COPY public.temp FROM PROGRAM 'rm /tmp/tempdata/CONCEPT_ANCESTOR.csv';
COPY public.temp FROM PROGRAM 'aws s3 cp s3://ohdsi-sample-data/vocab/CONCEPT_CLASS.csv.bz2 /tmp/tempdata/';
COPY public.temp FROM PROGRAM 'bzip2 -d /tmp/tempdata/CONCEPT_CLASS.csv.bz2';
COPY CONCEPT_CLASS FROM '/tmp/tempdata/CONCEPT_CLASS.csv' WITH DELIMITER E'\t' CSV HEADER QUOTE E'\b';
COPY public.temp FROM PROGRAM 'rm /tmp/tempdata/CONCEPT_CLASS.csv';
COPY public.temp FROM PROGRAM 'aws s3 cp s3://ohdsi-sample-data/vocab/CONCEPT.csv.bz2 /tmp/tempdata/';
COPY public.temp FROM PROGRAM 'bzip2 -d /tmp/tempdata/CONCEPT.csv.bz2';
COPY CONCEPT FROM '/tmp/tempdata/CONCEPT.csv' WITH DELIMITER E'\t' CSV HEADER QUOTE E'\b';
COPY public.temp FROM PROGRAM 'rm /tmp/tempdata/CONCEPT.csv';
COPY public.temp FROM PROGRAM 'aws s3 cp s3://ohdsi-sample-data/vocab/CONCEPT_RELATIONSHIP.csv.bz2 /tmp/tempdata/';
COPY public.temp FROM PROGRAM 'bzip2 -d /tmp/tempdata/CONCEPT_RELATIONSHIP.csv.bz2';
COPY CONCEPT_RELATIONSHIP FROM '/tmp/tempdata/CONCEPT_RELATIONSHIP.csv' WITH DELIMITER E'\t' CSV HEADER QUOTE E'\b';
COPY public.temp FROM PROGRAM 'rm /tmp/tempdata/CONCEPT_RELATIONSHIP.csv';
COPY public.temp FROM PROGRAM 'aws s3 cp s3://ohdsi-sample-data/vocab/CONCEPT_SYNONYM.csv.bz2 /tmp/tempdata/';
COPY public.temp FROM PROGRAM 'bzip2 -d /tmp/tempdata/CONCEPT_SYNONYM.csv.bz2';
COPY CONCEPT_SYNONYM FROM '/tmp/tempdata/CONCEPT_SYNONYM.csv' WITH DELIMITER E'\t' CSV HEADER QUOTE E'\b';
COPY public.temp FROM PROGRAM 'rm /tmp/tempdata/CONCEPT_SYNONYM.csv';
COPY public.temp FROM PROGRAM 'aws s3 cp s3://ohdsi-sample-data/vocab/DOMAIN.csv.bz2 /tmp/tempdata/';
COPY public.temp FROM PROGRAM 'bzip2 -d /tmp/tempdata/DOMAIN.csv.bz2';
COPY DOMAIN FROM '/tmp/tempdata/DOMAIN.csv' WITH DELIMITER E'\t' CSV HEADER QUOTE E'\b';
COPY public.temp FROM PROGRAM 'rm /tmp/tempdata/DOMAIN.csv';
COPY public.temp FROM PROGRAM 'aws s3 cp s3://ohdsi-sample-data/vocab/RELATIONSHIP.csv.bz2 /tmp/tempdata/';
COPY public.temp FROM PROGRAM 'bzip2 -d /tmp/tempdata/RELATIONSHIP.csv.bz2';
COPY RELATIONSHIP FROM '/tmp/tempdata/RELATIONSHIP.csv' WITH DELIMITER E'\t' CSV HEADER QUOTE E'\b';
COPY public.temp FROM PROGRAM 'rm /tmp/tempdata/RELATIONSHIP.csv';
COPY public.temp FROM PROGRAM 'aws s3 cp s3://ohdsi-sample-data/vocab/VOCABULARY.csv.bz2 /tmp/tempdata/';
COPY public.temp FROM PROGRAM 'bzip2 -d /tmp/tempdata/VOCABULARY.csv.bz2';
COPY VOCABULARY FROM '/tmp/tempdata/VOCABULARY.csv' WITH DELIMITER E'\t' CSV HEADER QUOTE E'\b';
COPY public.temp FROM PROGRAM 'rm /tmp/tempdata/VOCABULARY.csv'; | the_stack |
USE tempdb;
GO
IF EXISTS (SELECT 1 FROM sys.schemas WHERE name = 'STIG')
BEGIN
DROP SCHEMA STIG
END
GO
CREATE SCHEMA STIG
GO
/*
Objects defined in this file:
VIEW STIG.database_role_members
Based on the system view sys.database_role_members, this presents the list of
database role memberships using roles' and users' names rather than their id numbers.
Although membership in database roles is hierarchical, this view lists only the direct memberships.
FUNCTION STIG.database_roles_of(@database_principal sysname)
Given the name of a database principal (user or role), this table-valued function returns
a list of all the roles it belongs to, both directly and indirectly.
FUNCTION STIG.members_of_db_role(@database_role sysname)
Given the name of a database role, this table-valued function returns
a list of all the roles and users that belong to it, both directly and indirectly.
VIEW STIG.database_permissions
Based on the system view sys.database_permissions, this provides additional, descriptive material.
The list includes only those permissions explicitly granted (or denied) to a database user or role;
it does not include permissions that are implicit or inherited from a higher-level role.
Securable items that exist but have no explicit permissions assigned are included in the
list, with the columns that describe the grantor and grantee left null.
FUNCTION STIG.database_effective_permissions(@Grantee sysname)
Given the name of a database principal (user or role), this table-valued function
returns information about permissions granted (or denied) to that user or database role,
either directly or inherited from a higher-level role.
VIEW STIG.server_role_members
Based on the system view sys.server_role_members, this presents the list of
server role memberships using roles' and users' names rather than their id numbers.
Although membership in server roles is hierarchical, this view lists only the direct memberships.
FUNCTION STIG.server_roles_of(@server_principal sysname)
Given the name of a server principal (login or role), this table-valued function returns
a list of all the roles it belongs to, both directly and indirectly.
FUNCTION STIG.members_of_server_role(@server_role sysname)
Given the name of a server role, this table-valued function returns
a list of all the roles and logins that belong to it, both directly and indirectly.
VIEW STIG.server_permissions
Based on the system view sys.server_permissions, this provides additional, descriptive material.
The list includes only those permissions explicitly granted (or denied) to a server login or role;
it does not include permissions that are implicit or inherited from a higher-level role.
Securable items that exist but have no explicit permissions assigned are included in the
list, with columns describing the grantor and grantee left null.
FUNCTION STIG.server_effective_permissions(@Grantee sysname)
Given the name of a server principal (login or server role), this table-valued function
returns information about permissions granted (or denied) to that login or role,
either directly or inherited from a higher-level role.
*/
BEGIN TRY DROP VIEW STIG.database_role_members END TRY BEGIN CATCH END CATCH;
GO
CREATE VIEW STIG.database_role_members
-- Based on the system view sys.database_role_members, this presents the list of
-- database role memberships using roles' and users' names rather than their id numbers.
-- Although membership in database roles is hierarchical, this view lists only the direct memberships.
AS SELECT
R.name AS [Role],
M.name AS [Member]
FROM
[<TARGETDB>].sys.database_role_members X
INNER JOIN [<TARGETDB>].sys.database_principals R ON R.principal_id = X.role_principal_id
INNER JOIN [<TARGETDB>].sys.database_principals M ON M.principal_id = X.member_principal_id
;
GO
BEGIN TRY DROP FUNCTION STIG.database_roles_of END TRY BEGIN CATCH END CATCH;
GO
CREATE FUNCTION STIG.database_roles_of(@database_principal sysname)
-- Membership in database roles is hierarchical.
-- Given the name of a database principal (user or role), this table-valued function returns
-- a list of all the roles it belongs to, both directly and indirectly.
RETURNS @T TABLE
(
[Member] sysname,
[Role] sysname,
[via Member] sysname,
[Membership Chain] nvarchar(max)
)
AS BEGIN;
WITH Membership AS
(
SELECT
[Member] AS [Member],
[Role],
[Member] AS [via Member],
CAST([Member] AS varchar(max)) + ' < ' + CAST([Role] AS varchar(max)) AS [Membership Chain]
FROM
STIG.database_role_members
WHERE
[Member] = @database_principal
UNION ALL
SELECT
X.[Member],
R.[Role],
R.[Member] AS [via Member],
X.[Membership Chain] + ' < ' + CAST(R.[Role] AS varchar(max)) AS [Membership Chain]
FROM
Membership X
INNER JOIN STIG.database_role_members R ON X.[Role] = R.[Member]
)
INSERT INTO @T SELECT * FROM Membership;
ExitFunction:
RETURN;
END;
GO
BEGIN TRY DROP FUNCTION STIG.members_of_db_role END TRY BEGIN CATCH END CATCH;
GO
CREATE FUNCTION STIG.members_of_db_role(@database_role sysname)
-- Membership in database roles is hierarchical.
-- Given the name of a database role, this table-valued function returns
-- a list of all the roles and users that belong to it, both directly and indirectly.
RETURNS @T TABLE
(
[Role] sysname,
[Member] sysname,
[via Role] sysname,
[Membership Chain] nvarchar(max)
)
AS BEGIN;
WITH Membership AS
(
SELECT
[Role] AS [Role],
[Member],
[Role] AS [via Role],
CAST([Role] AS varchar(max)) + ' > ' + CAST([Member] AS varchar(max)) AS [Membership Chain]
FROM
STIG.database_role_members
WHERE
[Role] = @database_role
UNION ALL
SELECT
X.[Role] AS [Role],
R.[Member],
R.[Role] AS [via Role],
X.[Membership Chain] + ' > ' + CAST(R.[Member] AS varchar(max)) AS [Membership Chain]
FROM
Membership X
INNER JOIN STIG.database_role_members R ON X.[Member] = R.[Role]
)
INSERT INTO @T SELECT * FROM Membership;
ExitFunction:
RETURN;
END;
GO
BEGIN TRY DROP VIEW STIG.database_permissions END TRY BEGIN CATCH END CATCH;
GO
CREATE VIEW STIG.database_permissions
-- Based on the system view sys.database_permissions, this provides additional, descriptive material.
-- The list includes only those permissions explicitly granted (or denied) to a database user or role;
-- it does not include permissions that are implicit or inherited from a higher-level role.
-- Securable items that exist but have no explicit permissions assigned are included in the
-- list, with the columns that describe the grantor and grantee left null.
AS SELECT DISTINCT
@@SERVERNAME AS [Current Server],
@@SERVICENAME AS [Current Instance],
'<QUOTETARGETDB>' AS [Current DB],
SYSTEM_USER AS [Current Login],
USER AS [Current User],
CASE
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'OBJECT_OR_COLUMN' THEN CASE WHEN DP.minor_id > 0 THEN 'COLUMN' ELSE OB.type_desc END
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NOT NULL THEN DP.class_desc
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND DB.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN 'DATABASE'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND OB.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN 'OBJECT_OR_COLUMN'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND SC.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN 'SCHEMA'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND PR.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN 'DATABASE_PRINCIPAL'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND AY.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN 'ASSEMBLY'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND TP.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN 'TYPE'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND XS.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN 'XML_SCHEMA_COLLECTION'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND MT.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN 'MESSAGE_TYPE'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND VC.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN 'SERVICE_CONTRACT'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND SV.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN 'SERVICE'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND RS.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN 'REMOTE_SERVICE_BINDING'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND RT.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN 'ROUTE'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND FT.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN 'FULLTEXT_CATALOG'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND SK.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN 'SYMMETRIC_KEY'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND AK.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN 'ASYMMETRIC_KEY'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND CT.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN 'CERTIFICATE'
ELSE NULL
END AS [Securable Type or Class],
CASE
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'DATABASE' THEN PS.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'OBJECT_OR_COLUMN' THEN schema_name(OB.schema_id)
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'SCHEMA' THEN P3.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'DATABASE_PRINCIPAL' THEN coalesce(PR.default_schema_name, PE.name)
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'ASSEMBLY' THEN P4.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'TYPE' THEN schema_name(TP.schema_id)
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'XML_SCHEMA_COLLECTION' THEN schema_name(XS.schema_id)
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'MESSAGE_TYPE' THEN P5.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'SERVICE_CONTRACT' THEN P6.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'SERVICE' THEN P7.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'REMOTE_SERVICE_BINDING' THEN P8.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'ROUTE' THEN P9.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'FULLTEXT_CATALOG' THEN PA.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'SYMMETRIC_KEY' THEN PB.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'ASYMMETRIC_KEY' THEN PC.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'CERTIFICATE' THEN PD.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND DB.name IS NOT NULL THEN PS.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND OB.name IS NOT NULL THEN schema_name(OB.schema_id)
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND SC.name IS NOT NULL THEN P3.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND PR.name IS NOT NULL THEN PR.default_schema_name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND AY.name IS NOT NULL THEN P4.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND TP.name IS NOT NULL THEN schema_name(TP.schema_id)
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND XS.name IS NOT NULL THEN schema_name(XS.schema_id)
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND MT.name IS NOT NULL THEN P5.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND VC.name IS NOT NULL THEN P6.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND SV.name IS NOT NULL THEN P7.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND RS.name IS NOT NULL THEN P8.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND RT.name IS NOT NULL THEN P9.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND FT.name IS NOT NULL THEN PA.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND SK.name IS NOT NULL THEN PB.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND AK.name IS NOT NULL THEN PC.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND CT.name IS NOT NULL THEN PD.name COLLATE DATABASE_DEFAULT
ELSE NULL
END AS [Schema/Owner],
CASE
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'DATABASE' THEN DB.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'OBJECT_OR_COLUMN' THEN OB.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'SCHEMA' THEN SC.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'DATABASE_PRINCIPAL' THEN PR.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'ASSEMBLY' THEN AY.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'TYPE' THEN TP.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'XML_SCHEMA_COLLECTION' THEN XS.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'MESSAGE_TYPE' THEN cast(MT.name as sql_variant)
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'SERVICE_CONTRACT' THEN cast(VC.name as sql_variant)
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'SERVICE' THEN cast(SV.name as sql_variant)
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'REMOTE_SERVICE_BINDING' THEN RS.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'ROUTE' THEN RT.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'FULLTEXT_CATALOG' THEN FT.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'SYMMETRIC_KEY' THEN SK.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'ASYMMETRIC_KEY' THEN AK.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'CERTIFICATE' THEN CT.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND DB.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN DB.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND OB.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN OB.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND SC.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN SC.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND PR.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN PR.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND AY.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN AY.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND TP.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN TP.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND XS.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN XS.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND MT.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN cast(MT.name as sql_variant)
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND VC.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN cast(VC.name as sql_variant)
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND SV.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN cast(SV.name as sql_variant)
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND RS.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN RS.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND RT.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN RT.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND FT.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN FT.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND SK.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN SK.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND AK.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN AK.name COLLATE DATABASE_DEFAULT
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND CT.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN CT.name COLLATE DATABASE_DEFAULT
ELSE NULL
END AS [Securable],
CM.name AS [Column],
P1.type_desc AS [Grantee Type],
P1.name AS [Grantee],
DP.permission_name AS [Permission],
DP.state_desc AS [State],
P2.name AS [Grantor],
P2.type_desc AS [Grantor Type],
CASE
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'DATABASE' THEN 'sys.databases'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'OBJECT_OR_COLUMN' THEN 'sys.all_objects'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'SCHEMA' THEN 'sys.schemas'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'DATABASE_PRINCIPAL' THEN 'sys.database_principals'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'ASSEMBLY' THEN 'sys.assemblies'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'TYPE' THEN 'sys.types'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'XML_SCHEMA_COLLECTION' THEN 'sys.xml_schema_collections'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'MESSAGE_TYPE' THEN 'sys.service_message_types'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'SERVICE_CONTRACT' THEN 'sys.database_principals'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'SERVICE' THEN 'sys.services'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'REMOTE_SERVICE_BINDING' THEN 'sys.remote_service_bindings'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'ROUTE' THEN 'sys.routes'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'FULLTEXT_CATALOG' THEN 'sys.database_principals'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'SYMMETRIC_KEY' THEN 'sys.symmetric_keys'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'ASYMMETRIC_KEY' THEN 'sys.asymmetric_keys'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT = 'CERTIFICATE' THEN 'sys.certificates'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND DB.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN 'sys.databases'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND OB.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN 'sys.all_objects'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND SC.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN 'sys.schemas'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND PR.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN 'sys.database_principals'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND AY.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN 'sys.assemblies'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND TP.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN 'sys.types'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND XS.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN 'sys.xml_schema_collections'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND MT.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN 'sys.service_message_types'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND VC.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN 'sys.database_principals'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND SV.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN 'sys.services'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND RS.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN 'sys.remote_service_bindings'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND RT.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN 'sys.routes'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND FT.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN 'sys.database_principals'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND SK.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN 'sys.symmetric_keys'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND AK.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN 'sys.asymmetric_keys'
WHEN DP.class_desc COLLATE DATABASE_DEFAULT IS NULL AND CT.name COLLATE DATABASE_DEFAULT IS NOT NULL THEN 'sys.certificates'
ELSE '<QUOTETARGETDB>.sys.database_permissions'
END AS [Source View]
FROM
[<TARGETDB>].sys.database_permissions DP
LEFT OUTER JOIN [<TARGETDB>].sys.database_principals P1
ON P1.principal_id = DP.grantee_principal_id
LEFT OUTER JOIN [<TARGETDB>].sys.database_principals P2
ON P2.principal_id = DP.grantor_principal_id
FULL OUTER JOIN [<TARGETDB>].sys.databases DB
ON DB.database_id = db_id(db_name(DP.major_id))
AND DP.class_desc = 'DATABASE'
LEFT OUTER JOIN [<TARGETDB>].sys.server_principals PS
ON PS.sid = DB.owner_sid
FULL OUTER JOIN [<TARGETDB>].sys.all_objects OB
ON DP.major_id = OB.[object_id]
AND DP.class_desc = 'OBJECT_OR_COLUMN'
LEFT OUTER JOIN [<TARGETDB>].sys.all_columns CM
ON CM.[object_id] = DP.major_id
AND CM.[column_id] = DP.minor_id
FULL OUTER JOIN [<TARGETDB>].sys.schemas SC
ON DP.major_id = SC.[schema_id]
AND DP.class_desc = 'SCHEMA'
LEFT OUTER JOIN [<TARGETDB>].sys.database_principals P3
ON P3.principal_id = SC.principal_id
FULL OUTER JOIN [<TARGETDB>].sys.database_principals PR
ON DP.major_id = PR.principal_id
AND DP.class_desc = 'DATABASE_PRINCIPAL'
LEFT OUTER JOIN [<TARGETDB>].sys.database_principals PE
ON PE.principal_id = PR.owning_principal_id
FULL OUTER JOIN [<TARGETDB>].sys.assemblies AY
ON DP.major_id = AY.assembly_id
AND DP.class_desc = 'ASSEMBLY'
LEFT OUTER JOIN [<TARGETDB>].sys.database_principals P4
ON P4.principal_id = AY.principal_id
FULL OUTER JOIN [<TARGETDB>].sys.types TP
ON DP.major_id = TP.user_type_id
AND DP.class_desc = 'TYPE'
FULL OUTER JOIN [<TARGETDB>].sys.xml_schema_collections XS
ON DP.major_id = XS.xml_collection_id
AND DP.class_desc = 'XML_SCHEMA_COLLECTION'
FULL OUTER JOIN [<TARGETDB>].sys.service_message_types MT
ON DP.major_id = MT.message_type_id
AND DP.class_desc = 'MESSAGE_TYPE'
LEFT OUTER JOIN [<TARGETDB>].sys.database_principals P5
ON P5.principal_id = MT.principal_id
FULL OUTER JOIN [<TARGETDB>].sys.service_contracts VC
ON DP.major_id = VC.service_contract_id
AND DP.class_desc = 'SERVICE_CONTRACT'
LEFT OUTER JOIN [<TARGETDB>].sys.database_principals P6
ON P6.principal_id = VC.principal_id
FULL OUTER JOIN [<TARGETDB>].sys.services SV
ON DP.major_id = SV.service_id
AND DP.class_desc = 'SERVICE'
LEFT OUTER JOIN [<TARGETDB>].sys.database_principals P7
ON P7.principal_id = SV.principal_id
FULL OUTER JOIN [<TARGETDB>].sys.remote_service_bindings RS
ON DP.major_id = RS.remote_service_binding_id
AND DP.class_desc = 'REMOTE_SERVICE_BINDING'
LEFT OUTER JOIN [<TARGETDB>].sys.database_principals P8
ON P8.principal_id = RS.principal_id
FULL OUTER JOIN [<TARGETDB>].sys.routes RT
ON DP.major_id = RT.route_id
AND DP.class_desc = 'ROUTE'
LEFT OUTER JOIN [<TARGETDB>].sys.database_principals P9
ON P9.principal_id = RT.principal_id
FULL OUTER JOIN [<TARGETDB>].sys.fulltext_catalogs FT
ON DP.major_id = FT.fulltext_catalog_id
AND DP.class_desc = 'FULLTEXT_CATALOG'
LEFT OUTER JOIN [<TARGETDB>].sys.database_principals PA
ON PA.principal_id = FT.principal_id
FULL OUTER JOIN [<TARGETDB>].sys.symmetric_keys SK
ON DP.major_id = SK.symmetric_key_id
AND DP.class_desc = 'SYMMETRIC_KEY'
LEFT OUTER JOIN [<TARGETDB>].sys.database_principals PB
ON PB.principal_id = SK.principal_id
FULL OUTER JOIN [<TARGETDB>].sys.asymmetric_keys AK
ON DP.major_id = AK.asymmetric_key_id
AND DP.class_desc = 'ASYMMETRIC_KEY'
LEFT OUTER JOIN [<TARGETDB>].sys.database_principals PC
ON PC.principal_id = AK.principal_id
FULL OUTER JOIN [<TARGETDB>].sys.certificates CT
ON DP.major_id = CT.certificate_id
AND DP.class_desc = 'CERTIFICATE'
LEFT OUTER JOIN [<TARGETDB>].sys.database_principals PD
ON PD.principal_id = CT.principal_id
;
GO
BEGIN TRY DROP FUNCTION STIG.database_effective_permissions END TRY BEGIN CATCH END CATCH;
GO
CREATE FUNCTION STIG.database_effective_permissions(@Grantee sysname)
-- Given the name of a database principal (user or role), this table-valued function
-- returns information about permissions granted (or denied) to that user or database role,
-- either directly or inherited from a higher-level role.
RETURNS @T TABLE
(
[Current Server] sysname null,
[Current Instance] sysname null,
[Current DB] sysname null,
[Current Login] sysname null,
[Current User] sysname null,
[Securable Type or Class] nvarchar(60) null,
[Schema/Owner] sysname null,
[Securable] sql_variant null,
[Column] sysname null,
[Effective Grantee] sysname null,
[Membership Chain] nvarchar(max) null,
[Direct Grantee] sysname null,
[Direct Grantee Type] nvarchar(60) null,
[Permission] sysname null,
[State] nvarchar(60) null,
[Grantor] sysname null,
[Grantor Type] nvarchar(60) null,
[source view] sysname null
)
AS BEGIN;
WITH Targets AS
(
SELECT [Role] AS [Principal], [Membership Chain], len([Membership Chain]) AS [Membership Chain Length] FROM STIG.database_roles_of(@Grantee)
UNION ALL
SELECT @Grantee AS [Principal], @Grantee AS [Membership Chain], len(@Grantee) AS [Membership Chain Length]
)
INSERT INTO @T
SELECT TOP 100000000
P.[Current Server],
P.[Current Instance],
P.[Current DB],
P.[Current Login],
P.[Current User],
P.[Securable Type or Class],
P.[Schema/Owner],
P.[Securable],
P.[Column],
@Grantee AS [Effective Grantee],
T.[Membership Chain] AS [Membership Chain],
P.[Grantee] AS [Direct Grantee],
P.[Grantee Type] AS [Direct Grantee Type],
P.[Permission],
P.[State],
P.[Grantor],
P.[Grantor Type],
P.[Source View]
FROM
STIG.database_permissions P
INNER JOIN Targets T ON T.[Principal] COLLATE DATABASE_DEFAULT = P.[Grantee] COLLATE DATABASE_DEFAULT
ORDER BY
P.[Securable Type or Class],
P.[Schema/Owner],
P.[Securable],
P.[Column],
T.[Membership Chain Length]
;
UPDATE T
SET [State] = [State] + ' (schema denied)'
FROM @T T
WHERE
T.[State] <> 'DENY'
AND T.[Securable Type or Class] <> 'SCHEMA'
AND 0 <
(
SELECT count(*) FROM @T X
WHERE
X.[Securable Type or Class] = 'SCHEMA'
AND X.[Securable] = T.[Schema/Owner]
AND X.[Permission] = T.[Permission]
AND X.[State] = 'DENY'
)
;
UPDATE T
SET [State] = [State] + ' (denied)'
FROM @T T
WHERE
T.[State] <> 'DENY'
AND 0 <
(
SELECT count(*) FROM @T X
WHERE
X.[Securable Type or Class] = T.[Securable Type or Class]
AND X.[Schema/Owner] = T.[Schema/Owner]
AND X.[Securable] = T.[Securable]
AND (X.[Column] = T.[Column] OR (X.[Column] IS NULL) AND (T.[Column] IS NULL))
AND X.[Permission] = T.[Permission]
AND X.[State] = 'DENY'
)
;
UPDATE T
SET [State] = [State] + ' (column(s) denied)'
FROM @T T
WHERE T.[Securable Type or Class] <> 'COLUMN'
AND 0 <
(
SELECT count(*) FROM @T X
WHERE
X.[Securable Type or Class] = 'COLUMN'
AND X.[Schema/Owner] = T.[Schema/Owner]
AND X.[Securable] = T.[Securable]
AND X.[Permission] = T.[Permission]
AND X.[State] = 'DENY'
)
;
ExitFunction:
RETURN;
END;
GO
BEGIN TRY DROP VIEW STIG.server_role_members END TRY BEGIN CATCH END CATCH;
GO
CREATE VIEW STIG.server_role_members
-- Based on the system view sys.server_role_members, this presents the list of
-- server role memberships using roles' and logins' names rather than their id numbers.
-- Although membership in server roles is hierarchical, this view lists only the direct memberships.
AS SELECT
R.name AS [Role],
M.name AS [Member]
FROM
[<TARGETDB>].sys.server_role_members X
INNER JOIN [<TARGETDB>].sys.server_principals R ON R.principal_id = X.role_principal_id
INNER JOIN [<TARGETDB>].sys.server_principals M ON M.principal_id = X.member_principal_id
;
GO
BEGIN TRY DROP FUNCTION STIG.server_roles_of END TRY BEGIN CATCH END CATCH;
GO
CREATE FUNCTION STIG.server_roles_of(@server_principal sysname)
-- Membership in server roles is hierarchical.
-- Given the name of a server principal (login or role), this table-valued function returns
-- a list of all the roles it belongs to, both directly and indirectly.
RETURNS @T TABLE
(
[Member] sysname,
[Role] sysname,
[via Member] sysname,
[Membership Chain] nvarchar(max)
)
AS BEGIN;
WITH Membership AS
(
SELECT
[Member] AS [Member],
[Role],
[Member] AS [via Member],
CAST([Member] AS varchar(max)) + ' < ' + CAST([Role] AS varchar(max)) AS [Membership Chain]
FROM
STIG.server_role_members
WHERE
[Member] = @server_principal
UNION ALL
SELECT
X.[Member],
R.[Role],
R.[Member] AS [via Member],
X.[Membership Chain] + ' < ' + CAST(R.[Role] AS varchar(max)) AS [Membership Chain]
FROM
Membership X
INNER JOIN STIG.server_role_members R ON X.[Role] = R.[Member]
)
INSERT INTO @T SELECT * FROM Membership;
ExitFunction:
RETURN;
END;
GO
BEGIN TRY DROP FUNCTION STIG.members_of_server_role END TRY BEGIN CATCH END CATCH;
GO
CREATE FUNCTION STIG.members_of_server_role(@server_role sysname)
-- Membership in server roles is hierarchical.
-- Given the name of a server role, this table-valued function returns
-- a list of all the roles and logins that belong to it, both directly and indirectly.
RETURNS @T TABLE
(
[Role] sysname,
[Member] sysname,
[via Role] sysname,
[Membership Chain] nvarchar(max)
)
AS BEGIN;
WITH Membership AS
(
SELECT
[Role] AS [Role],
[Member],
[Role] AS [via Role],
CAST([Role] AS varchar(max)) + ' > ' + CAST([Member] AS varchar(max)) AS [Membership Chain]
FROM
STIG.server_role_members
WHERE
[Role] = @server_role
UNION ALL
SELECT
X.[Role] AS [Role],
R.[Member],
R.[Role] AS [via Role],
X.[Membership Chain] + ' > ' + CAST(R.[Member] AS varchar(max)) AS [Membership Chain]
FROM
Membership X
INNER JOIN STIG.server_role_members R ON X.[Member] = R.[Role]
)
INSERT INTO @T SELECT * FROM Membership;
ExitFunction:
RETURN;
END;
GO
BEGIN TRY DROP VIEW STIG.server_permissions END TRY BEGIN CATCH END CATCH;
GO
CREATE VIEW STIG.server_permissions
-- Based on the system view sys.server_permissions, this provides additional, descriptive material.
-- The list includes only those permissions explicitly granted (or denied) to a server login or role;
-- it does not include permissions that are implicit or inherited from a higher-level role.
-- Securable items that exist but have no explicit permissions assigned are included in the
-- list, with columns describing the grantor and grantee left null.
AS SELECT DISTINCT
@@SERVERNAME AS [Current Server],
@@SERVICENAME AS [Current Instance],
'<QUOTETARGETDB>' AS [Current DB],
SYSTEM_USER AS [Current Login],
USER AS [Current User],
CASE
WHEN SP.class_desc IS NOT NULL THEN
CASE
WHEN SP.class_desc = 'SERVER' AND S.is_linked = 0 THEN 'SERVER'
WHEN SP.class_desc = 'SERVER' AND S.is_linked = 1 THEN 'SERVER (linked)'
ELSE SP.class_desc
END
WHEN E.name IS NOT NULL THEN 'ENDPOINT'
WHEN S.name IS NOT NULL AND S.is_linked = 0 THEN 'SERVER'
WHEN S.name IS NOT NULL AND S.is_linked = 1 THEN 'SERVER (linked)'
WHEN P.name IS NOT NULL THEN 'SERVER_PRINCIPAL'
ELSE '???'
END AS [Securable Class],
CASE
WHEN E.name IS NOT NULL THEN E.name
WHEN S.name IS NOT NULL THEN S.name
WHEN P.name IS NOT NULL THEN P.name
ELSE '???'
END AS [Securable],
P1.name AS [Grantee],
P1.type_desc AS [Grantee Type],
SP.permission_name AS [Permission],
SP.state_desc AS [State],
P2.name AS [Grantor],
P2.type_desc AS [Grantor Type],
CASE
WHEN SP.class_desc = 'SERVER' THEN 'sys.servers'
WHEN SP.class_desc = 'ENDPOINT' THEN 'sys.endpoints'
WHEN SP.class_desc = 'SERVER_PRINCIPAL' THEN 'sys.server_principals'
WHEN SP.class_desc IS NULL AND S.name IS NOT NULL THEN 'sys.servers'
WHEN SP.class_desc IS NULL AND E.name IS NOT NULL THEN 'sys.endpoints'
WHEN SP.class_desc IS NULL AND P.name IS NOT NULL THEN 'sys.server_principals'
ELSE 'sys.server_permissions'
END AS [Source View]
FROM
[<TARGETDB>].sys.server_permissions SP
INNER JOIN [<TARGETDB>].sys.server_principals P1
ON P1.principal_id = SP.grantee_principal_id
INNER JOIN [<TARGETDB>].sys.server_principals P2
ON P2.principal_id = SP.grantor_principal_id
FULL OUTER JOIN sys.servers S
ON SP.class_desc = 'SERVER'
AND S.server_id = SP.major_id
FULL OUTER JOIN [<TARGETDB>].sys.endpoints E
ON SP.class_desc = 'ENDPOINT'
AND E.endpoint_id = SP.major_id
FULL OUTER JOIN [<TARGETDB>].sys.server_principals P
ON SP.class_desc = 'SERVER_PRINCIPAL'
AND P.principal_id = SP.major_id
;
GO
BEGIN TRY DROP FUNCTION STIG.server_effective_permissions END TRY BEGIN CATCH END CATCH;
GO
CREATE FUNCTION STIG.server_effective_permissions(@Grantee sysname)
-- Given the name of a server principal (login or server role), this table-valued function
-- returns information about permissions granted (or denied) to that login or role,
-- either directly or inherited from a higher-level role.
RETURNS @T TABLE
(
[Current Server] sysname null,
[Current Instance] sysname null,
[Current DB] sysname null,
[Current Login] sysname null,
[Current User] sysname null,
[Securable Class] nvarchar(60) null,
[Securable] sql_variant null,
[Effective Grantee] sysname null,
[Membership Chain] nvarchar(max) null,
[Direct Grantee] sysname null,
[Direct Grantee Type] nvarchar(60) null,
[Permission] sysname null,
[State] nvarchar(60) null,
[Grantor] sysname null,
[Grantor Type] nvarchar(60) null,
[source view] sysname null
)
AS BEGIN;
WITH Targets AS
(
SELECT [Role] AS [Principal], [Membership Chain], len([Membership Chain]) AS [Membership Chain Length] FROM STIG.server_roles_of(@Grantee)
UNION ALL
SELECT @Grantee AS [Principal], @Grantee AS [Membership Chain], len(@Grantee) AS [Membership Chain Length]
)
INSERT INTO @T
SELECT TOP 100000000
P.[Current Server],
P.[Current Instance],
P.[Current DB],
P.[Current Login],
P.[Current User],
P.[Securable Class],
P.[Securable],
@Grantee AS [Effective Grantee],
T.[Membership Chain] AS [Membership Chain],
P.[Grantee] AS [Direct Grantee],
P.[Grantee Type] AS [Direct Grantee Type],
P.[Permission],
P.[State],
P.[Grantor],
P.[Grantor Type],
P.[Source View]
FROM
STIG.server_permissions P
INNER JOIN Targets T ON T.[Principal] = P.[Grantee]
ORDER BY
P.[Securable Class],
P.[Securable],
T.[Membership Chain Length]
;
UPDATE T
SET [State] = [State] + ' (denied)'
FROM @T T
WHERE
T.[State] <> 'DENY'
AND 0 <
(
SELECT count(*) FROM @T X
WHERE
X.[Securable Class] = T.[Securable Class]
AND X.[Securable] = T.[Securable]
AND X.[Permission] = T.[Permission]
AND X.[State] = 'DENY'
)
;
ExitFunction:
RETURN;
END;
GO | the_stack |
set current_schema=public;
/* 测试不下推场景下计划显示正确 */
explain (costs false) with recursive rq as
(
select id, name from chinamap where id = 11
union all
select origin.id, rq.name || ' > ' || origin.name
from rq join chinamap origin on origin.pid = rq.id
)
select id, name from rq order by 1;
with recursive rq as
(
select id, name from chinamap where id = 11
union all
select origin.id, rq.name || ' > ' || origin.name
from rq join chinamap origin on origin.pid = rq.id
)
select id, name from rq order by 1;
set explain_perf_mode=pretty;
explain (costs false) with recursive rq as
(
select id, name from chinamap where id = 11
union all
select origin.id, rq.name || ' > ' || origin.name
from rq join chinamap origin on origin.pid = rq.id
)
select id, name from rq order by 1;
with recursive rq as
(
select id, name from chinamap where id = 11
union all
select origin.id, rq.name || ' > ' || origin.name
from rq join chinamap origin on origin.pid = rq.id
)
select id, name from rq order by 1;
explain (costs false)
with recursive rq as
(
select id, name from chinamap2 where id = 11
union all
select origin.id, rq.name || ' > ' || origin.name
from rq join chinamap2 origin on origin.pid = rq.id
)
select id, name from rq order by 1;
with recursive rq as
(
select id, name from chinamap2 where id = 11
union all
select origin.id, rq.name || ' > ' || origin.name
from rq join chinamap2 origin on origin.pid = rq.id
)
select id, name from rq order by 1;
explain (costs false)
with recursive rq as
(
select id, name from chinamap join t1 on id = t1.c2 where id = 11
union all
select origin.id, rq.name || ' > ' || origin.name
from rq join chinamap origin on origin.pid = rq.id
)
select id, name from rq order by 1;
with recursive rq as
(
select id, name from chinamap join t1 on id = t1.c2 where id = 11
union all
select origin.id, rq.name || ' > ' || origin.name
from rq join chinamap origin on origin.pid = rq.id
)
select id, name from rq order by 1;
explain (costs false)
with recursive cte as (
select ID, PID, NAME
from a
where a.NAME = 'm'
union all
select parent.ID, parent.PID, parent.NAME
from cte as child join a as parent
on child.pid=parent.id
)
select * from cte order by ID;
with recursive cte as (
select ID, PID, NAME
from a
where a.NAME = 'm'
union all
select parent.ID, parent.PID, parent.NAME
from cte as child join a as parent
on child.pid=parent.id
)
select * from cte order by ID;
explain (costs false)
with recursive cte as (
select ID,PID,NAME
from a
where a.NAME = 'b'
union all
select child.ID, child.PID, child.NAME
from cte as parent join a as child
on child.pid=parent.id
)
select * from cte order by ID;
with recursive cte as (
select ID,PID,NAME
from a
where a.NAME = 'b'
union all
select child.ID, child.PID, child.NAME
from cte as parent join a as child
on child.pid=parent.id
)
select * from cte order by ID;
explain (costs false)
with recursive cte as (
select
ID,
PID,
NAME,
1 as level
from
a
where
a.NAME = 'm'
union all
select
parent.ID,
parent.PID,
parent.NAME,
child.level+1
from
cte as child
join
a as parent
on
child.pid=parent.id and child.level < 3
)
select * from cte order by ID;
with recursive cte as (
select
ID,
PID,
NAME,
1 as level
from
a
where
a.NAME = 'm'
union all
select
parent.ID,
parent.PID,
parent.NAME,
child.level+1
from
cte as child
join
a as parent
on
child.pid=parent.id and child.level < 3
)
select * from cte order by ID;
-----------
explain (costs false)
with recursive cte as (
select
ID,
PID,
NAME,
1 as level
from
a
where
a.NAME = 'b'
union all
select
child.ID,
child.PID,
child.NAME,
parent.level+1
from
cte as parent
join
a as child
on
child.pid=parent.id and parent.level < 3
)
select * from cte order by ID;
with recursive cte as (
select
ID,
PID,
NAME,
1 as level
from
a
where
a.NAME = 'b'
union all
select
child.ID,
child.PID,
child.NAME,
parent.level+1
from
cte as parent
join
a as child
on
child.pid=parent.id and parent.level < 3
)
select * from cte order by ID;
--------------
explain (costs false)
select
b.NAME
from
b
where
b.ID in
(
with recursive cte as
(
select
ID,
PID,
NAME
from
a
where
a.NAME = 'g'
union all
select
child.ID,
child.PID,
child.NAME
from
cte as parent
join
a as child
on child.pid=parent.id
)
select ID from cte
) order by 1;
select
b.NAME
from
b
where
b.ID in
(
with recursive cte as
(
select
ID,
PID,
NAME
from
a
where
a.NAME = 'g'
union all
select
child.ID,
child.PID,
child.NAME
from
cte as parent
join
a as child
on child.pid=parent.id
)
select ID from cte
) order by 1;
------------
explain (costs false)
WITH RECURSIVE TABLE_COLUMN(T,B,C,D)
AS
(
SELECT area_code,belong_area_code,name,rnk
FROM area
UNION ALL
SELECT area_code,b.T||'|'||a.area_code,b.C||a.name,rnk
FROM area a JOIN TABLE_COLUMN b ON a.belong_area_code=b.T
)
SELECT T,B,C FROM Table_Column
ORDER BY 1,2,3;
WITH RECURSIVE TABLE_COLUMN(T,B,C,D)
AS
(
SELECT area_code,belong_area_code,name,rnk
FROM area
UNION ALL
SELECT area_code,b.T||'|'||a.area_code,b.C||a.name,rnk
FROM area a JOIN TABLE_COLUMN b ON a.belong_area_code=b.T
)
SELECT T,B,C FROM Table_Column
ORDER BY 1,2,3;
/* recursive-cte关联外层 */
explain (costs false) select a.ID,a.Name,
(
with recursive cte as (
select ID, PID, NAME
from b
where b.ID = a.ID
union all
select parent.ID,parent.PID,parent.NAME
from cte as child join b as parent
on child.pid=parent.id
)
select NAME from cte
where cte.ID % 2 = 0
limit 1
) cName
from a
order by 1,2;
select a.ID,a.Name,
(
with recursive cte as (
select ID, PID, NAME
from b
where b.ID = a.ID
union all
select parent.ID,parent.PID,parent.NAME
from cte as child join b as parent
on child.pid=parent.id
)
select NAME from cte
where cte.ID % 2 = 0
limit 1
) cName
from a
order by 1,2;
/*
* 多层stream
* --------------------------------------------------------
* ->RecursiveUnion
* ->Scan
* ->Join
* ->Scan
* ->Streaming <<<
* ->Join
* ->Streaming
* ->Scan
* ->WorkTableScan
* --------------------------------------------------------
*/
explain (costs false) with recursive rq as
(
select id, name from chinamap where id = 11
union all
select origin.id, rq.name || ' > ' || origin.name
from rq join chinamap origin on origin.pid = rq.id, t2
where t2.c2 = rq.id
)
select * from rq order by 1;
with recursive rq as
(
select id, name from chinamap where id = 11
union all
select origin.id, rq.name || ' > ' || origin.name
from rq join chinamap origin on origin.pid = rq.id, t2
where t2.c2 = rq.id
)
select * from rq order by 1;
explain (costs false) select * from chinamap where pid = 11
union
select * from chinamap where id in
(
with recursive rq as
(
select * from chinamap where id = 110
union all
select origin.* from chinamap origin join rq on origin.pid = rq.id
)
select id from rq
) order by id;
select * from chinamap where pid = 11
union
select * from chinamap where id in
(
with recursive rq as
(
select * from chinamap where id = 110
union all
select origin.* from chinamap origin join rq on origin.pid = rq.id
)
select id from rq
) order by id;
explain (costs false) select * from
(
with recursive cte1 as
(
select ID, PID, NAME
from a
where a.NAME = 'm'
union all
select parent.ID, parent.PID, parent.NAME
from cte1 as child join a as parent
on child.pid=parent.id
)select * from cte1
)
union all
(
with recursive cte2 as
(
select ID, PID, NAME
from a
where a.NAME = 'b'
union all
select parent.ID, parent.PID, parent.NAME
from cte2 as child join a as parent
on child.pid=parent.id
) select * from cte2
) order by id;
select * from
(
with recursive cte1 as
(
select ID, PID, NAME
from a
where a.NAME = 'm'
union all
select parent.ID, parent.PID, parent.NAME
from cte1 as child join a as parent
on child.pid=parent.id
)select * from cte1
)
union all
(
with recursive cte2 as
(
select ID, PID, NAME
from a
where a.NAME = 'b'
union all
select parent.ID, parent.PID, parent.NAME
from cte2 as child join a as parent
on child.pid=parent.id
) select * from cte2
) order by id;
/*
* 测试复制表replicate-plan场景
*/
/* a:b H:H */
explain (costs false)
with recursive cte as (
select ID, PID, NAME from a where a.NAME = 'm'
union all
select parent.ID, parent.PID, parent.NAME from cte as child join b as parent on child.pid=parent.id
)
select * from cte order by ID;
with recursive cte as (
select ID, PID, NAME from a where a.NAME = 'm'
union all
select parent.ID, parent.PID, parent.NAME from cte as child join b as parent on child.pid=parent.id
)
select * from cte order by ID;
/* a:b R:H */
explain (costs false)
with recursive cte as (
select ID, PID, NAME from a_rep where a_rep.NAME = 'm'
union all
select parent.ID, parent.PID, parent.NAME from cte as child join b as parent on child.pid=parent.id
)
select * from cte order by ID;
with recursive cte as (
select ID, PID, NAME from a_rep where a_rep.NAME = 'm'
union all
select parent.ID, parent.PID, parent.NAME from cte as child join b as parent on child.pid=parent.id
)
select * from cte order by ID;
/* a:b H:R */
explain (costs false)
with recursive cte as (
select ID, PID, NAME from a where a.NAME = 'm'
union all
select parent.ID, parent.PID, parent.NAME from cte as child join b_rep as parent on child.pid=parent.id
)
select * from cte order by ID;
with recursive cte as (
select ID, PID, NAME from a where a.NAME = 'm'
union all
select parent.ID, parent.PID, parent.NAME from cte as child join b_rep as parent on child.pid=parent.id
)
select * from cte order by ID;
/* a:b R:R */
explain (costs false)
with recursive cte as (
select ID, PID, NAME from a_rep where a_rep.NAME = 'm'
union all
select parent.ID, parent.PID, parent.NAME from cte as child join b_rep as parent on child.pid=parent.id
)
select * from cte order by ID;
with recursive cte as (
select ID, PID, NAME from a_rep where a_rep.NAME = 'm'
union all
select parent.ID, parent.PID, parent.NAME from cte as child join b_rep as parent on child.pid=parent.id
)
select * from cte order by ID;
explain (costs false)
with recursive rq as
(
select a.name address, b.name, a.id,a.pid
from chinamap a,
(
with recursive rq as
(
select pid,id, name, mapid from chinamap3
union all
select rq.pid,origin.id, rq.name || ' > ' || origin.name, origin.mapid
from rq join chinamap3 origin on origin.pid = rq.id
)select * from rq where pid is null
) b
where a.id = b.mapid
union all
select chinamap.name, rq.name, rq.pid, chinamap.pid
from rq ,chinamap
where rq.pid=chinamap.id
)select address,name from rq order by address,name;
with recursive rq as
(
select a.name address, b.name, a.id,a.pid
from chinamap a,
(
with recursive rq as
(
select pid,id, name, mapid from chinamap3
union all
select rq.pid,origin.id, rq.name || ' > ' || origin.name, origin.mapid
from rq join chinamap3 origin on origin.pid = rq.id
)select * from rq where pid is null
) b
where a.id = b.mapid
union all
select chinamap.name, rq.name, rq.pid, chinamap.pid
from rq ,chinamap
where rq.pid=chinamap.id
)select address,name from rq order by address,name;
explain (costs false)
with recursive rq as
(
select a.name address, b.name, a.id,a.pid
from chinamap a,
(
with recursive rq as
(
select pid,id, name, mapid from chinamap4
union all
select rq.pid,origin.id, rq.name || ' > ' || origin.name, origin.mapid
from rq join chinamap4 origin on origin.pid = rq.id
)select * from rq where pid is null
) b
where a.id = b.mapid
union all
select chinamap.name, rq.name, rq.pid, chinamap.pid
from rq ,chinamap
where rq.pid=chinamap.id
)select address,name from rq order by address,name;
with recursive rq as
(
select a.name address, b.name, a.id,a.pid
from chinamap a,
(
with recursive rq as
(
select pid,id, name, mapid from chinamap4
union all
select rq.pid,origin.id, rq.name || ' > ' || origin.name, origin.mapid
from rq join chinamap4 origin on origin.pid = rq.id
)select * from rq where pid is null
) b
where a.id = b.mapid
union all
select chinamap.name, rq.name, rq.pid, chinamap.pid
from rq ,chinamap
where rq.pid=chinamap.id
)select address,name from rq order by address,name;
/* correlated subquery */
explain (costs false)
select a.ID,a.Name,
(
with recursive cte as (
select ID, PID, NAME from b where b.ID = a.ID
union all
select parent.ID,parent.PID,parent.NAME
from cte as child join b as parent on child.pid=parent.id
)
select NAME from cte limit 1
) cName
from
(
select id, name, count(*) as cnt
from a group by id,name
) a order by 1,2;
select a.ID,a.Name,
(
with recursive cte as (
select ID, PID, NAME from b where b.ID = a.ID
union all
select parent.ID,parent.PID,parent.NAME
from cte as child join b as parent on child.pid=parent.id
)
select NAME from cte limit 1
) cName
from
(
select id, name, count(*) as cnt
from a group by id,name
) a order by 1,2;
explain (costs false)
select a.ID,a.Name,
(
with recursive cte as (
select ID, PID, NAME from b where b.ID = a.ID
union all
select parent.ID,parent.PID,parent.NAME
from cte as child join b as parent on child.pid=parent.id
where parent.id = a.id
)
select NAME from cte limit 1
) cName
from
(
select id, name, count(*) as cnt
from a group by id,name
) a order by 1,2;
select a.ID,a.Name,
(
with recursive cte as (
select ID, PID, NAME from b where b.ID = a.ID
union all
select parent.ID,parent.PID,parent.NAME
from cte as child join b as parent on child.pid=parent.id
where parent.id = a.id
)
select NAME from cte limit 1
) cName
from
(
select id, name, count(*) as cnt
from a group by id,name
) a order by 1,2;
/* verify conflict dop lead to unshippable recursive plan */
/* correlated subquery */
explain (costs false)
select a.ID,a.Name,
(
with recursive cte as (
select ID, PID, NAME from b where b.ID = a.ID
union all
select parent.ID,parent.PID,parent.NAME
from cte as child join b as parent on child.pid=parent.id
)
select NAME from cte limit 1
) cName
from
(
select id, name, count(*) as cnt
from a group by id,name
) a order by 1,2;
select a.ID,a.Name,
(
with recursive cte as (
select ID, PID, NAME from b where b.ID = a.ID
union all
select parent.ID,parent.PID,parent.NAME
from cte as child join b as parent on child.pid=parent.id
)
select NAME from cte limit 1
) cName
from
(
select id, name, count(*) as cnt
from a group by id,name
) a order by 1,2;
explain (costs false)
select a.ID,a.Name,
(
with recursive cte as (
select ID, PID, NAME from b where b.ID = a.ID
union all
select parent.ID,parent.PID,parent.NAME
from cte as child join b as parent on child.pid=parent.id
where parent.id = a.id
)
select NAME from cte limit 1
) cName
from
(
select id, name, count(*) as cnt
from a group by id,name
) a order by 1,2;
select a.ID,a.Name,
(
with recursive cte as (
select ID, PID, NAME from b where b.ID = a.ID
union all
select parent.ID,parent.PID,parent.NAME
from cte as child join b as parent on child.pid=parent.id
where parent.id = a.id
)
select NAME from cte limit 1
) cName
from
(
select id, name, count(*) as cnt
from a group by id,name
) a order by 1,2;
explain (costs false)
select a.ID,a.Name,
(
with recursive cte as (
select ID, PID, NAME from b where b.ID = a.ID
union all
select parent.ID,parent.PID,parent.NAME
from cte as child join b as parent on child.pid=parent.id
where parent.id = a.id
)
select NAME from cte limit 1
) cName
from
(
select id, name, count(*) as cnt
from a group by id,name
) a order by 1,2;
select a.ID,a.Name,
(
with recursive cte as (
select ID, PID, NAME from b where b.ID = a.ID
union all
select parent.ID,parent.PID,parent.NAME
from cte as child join b as parent on child.pid=parent.id
where parent.id = a.id
)
select NAME from cte limit 1
) cName
from
(
select id, name, count(*) as cnt
from a group by id,name
) a order by 1,2;
explain (costs false)
with recursive cte as (
select ID, PID, NAME from b where b.ID = 5
union all
select parent.ID,parent.PID,parent.NAME
from cte as child join b as parent on child.pid=parent.id
where parent.id <= 5
),
tmp as (select * from cte)
select cte.NAME from cte join tmp on cte.id = tmp.id
where tmp.id in (select id from tmp) order by 1;
with recursive cte as (
select ID, PID, NAME from b where b.ID = 5
union all
select parent.ID,parent.PID,parent.NAME
from cte as child join b as parent on child.pid=parent.id
where parent.id <= 5
),
tmp as (select * from cte)
select cte.NAME from cte join tmp on cte.id = tmp.id
where tmp.id in (select id from tmp) order by 1;
drop table if exists rec_tb4;
create table rec_tb4 (id int ,parentID int ,name varchar(100)) partition by range(parentID)
(
PARTITION P1 VALUES LESS THAN(2),
PARTITION P2 VALUES LESS THAN(8),
PARTITION P3 VALUES LESS THAN(16),
PARTITION P4 VALUES LESS THAN(MAXVALUE)
);
insert into rec_tb4 values(1,0,'河南省');
insert into rec_tb4 values(2,1,'信阳市');
insert into rec_tb4 values(3,2,'淮滨县');
insert into rec_tb4 values(4,3,'芦集乡');
insert into rec_tb4 values(12,3,'邓湾乡');
insert into rec_tb4 values(13,3,'台头乡');
insert into rec_tb4 values(14,3,'谷堆乡');
insert into rec_tb4 values(8,2,'固始县');
insert into rec_tb4 values(9,8,'李店乡');
insert into rec_tb4 values(10,2,'息县');
insert into rec_tb4 values(11,10,'关店乡');
insert into rec_tb4 values(5,1,'安阳市');
insert into rec_tb4 values(6,5,'滑县');
insert into rec_tb4 values(7,6,'老庙乡');
insert into rec_tb4 values(15,1,'南阳市');
insert into rec_tb4 values(16,15,'方城县');
insert into rec_tb4 values(17,1,'驻马店市');
insert into rec_tb4 values(18,17,'正阳县');
with recursive cte as (select * from rec_tb4 where id<4 union all select h.id,h.parentID,h.name from (with recursive cte as (select * from rec_tb4 where id<4 union all select h.id,h.parentID,h.name from rec_tb4 h inner join cte c on h.id=c.parentID) SELECT id ,parentID,name from cte order by parentID) h inner join cte c on h.id=c.parentID) SELECT id ,parentID,name from cte order by parentID,1,2,3;
explain (costs false)
with recursive cte as (select * from rec_tb4 where id<4 union all select h.id,h.parentID,h.name from (with recursive cte as (select * from rec_tb4 where id<4 union all select h.id,h.parentID,h.name from rec_tb4 h inner join cte c on h.id=c.parentID) SELECT id ,parentID,name from cte order by parentID) h inner join cte c on h.id=c.parentID) SELECT id ,parentID,name from cte order by parentID,1,2,3;
drop table rec_tb4;
drop table if exists test_perf3;
create table test_perf3
(
etl_tx_dt varchar2(8),
area_code varchar2(30) primary key,
area_name varchar2(360),
area_short_name varchar2(360),
local_name varchar2(240),
belong_area_code varchar2(30),
bank_level varchar2(24),
country_code varchar2(15),
part_code varchar2(15),
time_zone varchar2(27),
bank_code varchar2(30),
group_code varchar2(15),
mag_area_status varchar2(3),
mag_area_broad varchar2(3),
mag_area_grade varchar2(9)
)
;
explain (costs false)
with recursive cte1 as
(select area_code, belong_area_code, area_code as chain, 1 as level
from test_perf3
where area_code='100000'
union all
select h.area_code, h.belong_area_code, cast(cte1.chain||'>'||h.area_code as varchar2(30)),cte1.level+1
from cte1
join test_perf3 h
on h.belong_area_code=cte1.area_code and cte1.level <3 and h.area_code not in (select regexp_split_to_table(cte1.chain,'>'))
),
cte2 as (
select area_code, belong_area_code, area_code as chain, 1 as level
from cte1
where area_code='100000'
union all
select h.area_code, h.belong_area_code, cast(cte2.chain||'>'||h.area_code as varchar2(30)),cte2.level+1
from cte2
join cte1 h
on h.belong_area_code=cte2.area_code and cte2.level <3 and h.area_code not in (select regexp_split_to_table(cte2.chain,'>'))
)
select * from cte2;
with recursive cte1 as
(select area_code, belong_area_code, area_code as chain, 1 as level
from test_perf3
where area_code='100000'
union all
select h.area_code, h.belong_area_code, cast(cte1.chain||'>'||h.area_code as varchar2(30)),cte1.level+1
from cte1
join test_perf3 h
on h.belong_area_code=cte1.area_code and cte1.level <3 and h.area_code not in (select regexp_split_to_table(cte1.chain,'>'))
),
cte2 as (
select area_code, belong_area_code, area_code as chain, 1 as level
from cte1
where area_code='100000'
union all
select h.area_code, h.belong_area_code, cast(cte2.chain||'>'||h.area_code as varchar2(30)),cte2.level+1
from cte2
join cte1 h
on h.belong_area_code=cte2.area_code and cte2.level <3 and h.area_code not in (select regexp_split_to_table(cte2.chain,'>'))
)
select * from cte2;
drop table test_perf3;
reset explain_perf_mode;
/*update-delte语句中含有with recursive,且with recursive引用目标表*/
drop table if exists bom_ptbl;
drop table if exists bom_locator;
create table bom_ptbl(
id varchar(3) ,
pid varchar(3) ,
name varchar(10)
) with (orientation=row, compression=no) ;
create table bom_locator(
zone varchar(3)
) with (orientation=row, compression=no) ;
insert into bom_ptbl values('002' , 0 , '浙江省');
insert into bom_ptbl values('001' , 0 , '广东省');
insert into bom_ptbl values('003' , '002' , '衢州市');
insert into bom_ptbl values('004' , '002' , '杭州市') ;
insert into bom_ptbl values('005' , '002' , '湖州市');
insert into bom_ptbl values('006' , '002' , '嘉兴市') ;
insert into bom_ptbl values('007' , '002' , '宁波市');
insert into bom_ptbl values('008' , '002' , '绍兴市') ;
insert into bom_ptbl values('009' , '002' , '台州市');
insert into bom_ptbl values('010' , '002' , '温州市') ;
insert into bom_ptbl values('011' , '002' , '丽水市');
insert into bom_ptbl values('012' , '002' , '金华市') ;
insert into bom_ptbl values('013' , '002' , '舟山市');
insert into bom_ptbl values('014' , '004' , '上城区') ;
insert into bom_ptbl values('015' , '004' , '下城区');
insert into bom_ptbl values('016' , '004' , '拱墅区') ;
insert into bom_ptbl values('017' , '004' , '余杭区') ;
insert into bom_ptbl values('018' , '011' , '金东区') ;
insert into bom_ptbl values('019' , '001' , '广州市') ;
insert into bom_ptbl values('020' , '001' , '深圳市') ;
insert into bom_locator values('002');
insert into bom_locator values('007');
explain (costs off, verbose on) update bom_ptbl set name =
(
with recursive cte as
(
select a.id, a.name, a.pid from bom_ptbl a where a.id = bom_ptbl.id
union all
select b.id, b.name, b.pid from cte,bom_ptbl b where cte.id = b.pid
)
select cte.name from cte left join bom_locator on cte.id = bom_locator.zone
order by cte.id limit 1
) where bom_ptbl.name is not null;
update bom_ptbl set name =
(
with recursive cte as
(
select a.id, a.name, a.pid from bom_ptbl a where a.id = bom_ptbl.id
union all
select b.id, b.name, b.pid from cte,bom_ptbl b where cte.id = b.pid
)
select cte.name from cte left join bom_locator on cte.id = bom_locator.zone
order by cte.id limit 1
) where bom_ptbl.name is not null;
explain (costs off, verbose on) delete bom_ptbl where name =
(
with recursive cte as
(
select a.id, a.name, a.pid from bom_ptbl a where a.id = bom_ptbl.id
union all
select b.id, b.name, b.pid from cte,bom_ptbl b where cte.id = b.pid
)
select cte.name from cte left join bom_locator on cte.id = bom_locator.zone
order by cte.id limit 1
) and bom_ptbl.name is not null;
delete bom_ptbl where name =
(
with recursive cte as
(
select a.id, a.name, a.pid from bom_ptbl a where a.id = bom_ptbl.id
union all
select b.id, b.name, b.pid from cte,bom_ptbl b where cte.id = b.pid
)
select cte.name from cte left join bom_locator on cte.id = bom_locator.zone
order by cte.id limit 1
) and bom_ptbl.name is not null;
insert into bom_ptbl values('002' , 0 , '浙江省');
insert into bom_ptbl values('001' , 0 , '广东省');
insert into bom_ptbl values('003' , '002' , '衢州市');
insert into bom_ptbl values('004' , '002' , '杭州市') ;
insert into bom_ptbl values('005' , '002' , '湖州市');
insert into bom_ptbl values('006' , '002' , '嘉兴市') ;
insert into bom_ptbl values('007' , '002' , '宁波市');
insert into bom_ptbl values('008' , '002' , '绍兴市') ;
insert into bom_ptbl values('009' , '002' , '台州市');
insert into bom_ptbl values('010' , '002' , '温州市') ;
insert into bom_ptbl values('011' , '002' , '丽水市');
insert into bom_ptbl values('012' , '002' , '金华市') ;
insert into bom_ptbl values('013' , '002' , '舟山市');
insert into bom_ptbl values('014' , '004' , '上城区') ;
insert into bom_ptbl values('015' , '004' , '下城区');
insert into bom_ptbl values('016' , '004' , '拱墅区') ;
insert into bom_ptbl values('017' , '004' , '余杭区') ;
insert into bom_ptbl values('018' , '011' , '金东区') ;
insert into bom_ptbl values('019' , '001' , '广州市') ;
insert into bom_ptbl values('020' , '001' , '深圳市') ;
explain (costs off, verbose on) update bom_ptbl set name =
(
with recursive cte as
(
select a.id, a.name, a.pid from bom_ptbl a where a.id = bom_ptbl.id
union all
select b.id, b.name, b.pid from cte,bom_ptbl b where cte.id = b.pid
)
select cte.name from cte left join bom_locator on cte.id = bom_locator.zone
order by cte.id limit 1
) where bom_ptbl.name is not null;
update bom_ptbl set name =
(
with recursive cte as
(
select a.id, a.name, a.pid from bom_ptbl a where a.id = bom_ptbl.id
union all
select b.id, b.name, b.pid from cte,bom_ptbl b where cte.id = b.pid
)
select cte.name from cte left join bom_locator on cte.id = bom_locator.zone
order by cte.id limit 1
) where bom_ptbl.name is not null;
explain (costs off, verbose on) delete bom_ptbl where name =
(
with recursive cte as
(
select a.id, a.name, a.pid from bom_ptbl a where a.id = bom_ptbl.id
union all
select b.id, b.name, b.pid from cte,bom_ptbl b where cte.id = b.pid
)
select cte.name from cte left join bom_locator on cte.id = bom_locator.zone
order by cte.id limit 1
) and bom_ptbl.name is not null;
delete bom_ptbl where name =
(
with recursive cte as
(
select a.id, a.name, a.pid from bom_ptbl a where a.id = bom_ptbl.id
union all
select b.id, b.name, b.pid from cte,bom_ptbl b where cte.id = b.pid
)
select cte.name from cte left join bom_locator on cte.id = bom_locator.zone
order by cte.id limit 1
) and bom_ptbl.name is not null;
drop table if exists bom_ptbl;
drop table if exists bom_locator;
create table bom_ptbl(
id varchar(3) ,
pid varchar(3) ,
name varchar(10)
) with (orientation=column, compression=low) ;
create table bom_locator(
zone varchar(3)
) with (orientation=column, compression=low) ;
insert into bom_ptbl values('002' , 0 , '浙江省');
insert into bom_ptbl values('001' , 0 , '广东省');
insert into bom_ptbl values('003' , '002' , '衢州市');
insert into bom_ptbl values('004' , '002' , '杭州市') ;
insert into bom_ptbl values('005' , '002' , '湖州市');
insert into bom_ptbl values('006' , '002' , '嘉兴市') ;
insert into bom_ptbl values('007' , '002' , '宁波市');
insert into bom_ptbl values('008' , '002' , '绍兴市') ;
insert into bom_ptbl values('009' , '002' , '台州市');
insert into bom_ptbl values('010' , '002' , '温州市') ;
insert into bom_ptbl values('011' , '002' , '丽水市');
insert into bom_ptbl values('012' , '002' , '金华市') ;
insert into bom_ptbl values('013' , '002' , '舟山市');
insert into bom_ptbl values('014' , '004' , '上城区') ;
insert into bom_ptbl values('015' , '004' , '下城区');
insert into bom_ptbl values('016' , '004' , '拱墅区') ;
insert into bom_ptbl values('017' , '004' , '余杭区') ;
insert into bom_ptbl values('018' , '011' , '金东区') ;
insert into bom_ptbl values('019' , '001' , '广州市') ;
insert into bom_ptbl values('020' , '001' , '深圳市') ;
insert into bom_locator values('002');
insert into bom_locator values('007');
explain (costs off, verbose on) update bom_ptbl set name =
(
with recursive cte as
(
select a.id, a.name, a.pid from bom_ptbl a where a.id = bom_ptbl.id
union all
select b.id, b.name, b.pid from cte,bom_ptbl b where cte.id = b.pid
)
select cte.name from cte left join bom_locator on cte.id = bom_locator.zone
order by cte.id limit 1
) where bom_ptbl.name is not null;
update bom_ptbl set name =
(
with recursive cte as
(
select a.id, a.name, a.pid from bom_ptbl a where a.id = bom_ptbl.id
union all
select b.id, b.name, b.pid from cte,bom_ptbl b where cte.id = b.pid
)
select cte.name from cte left join bom_locator on cte.id = bom_locator.zone
order by cte.id limit 1
) where bom_ptbl.name is not null;
explain (costs off, verbose on) delete bom_ptbl where name =
(
with recursive cte as
(
select a.id, a.name, a.pid from bom_ptbl a where a.id = bom_ptbl.id
union all
select b.id, b.name, b.pid from cte,bom_ptbl b where cte.id = b.pid
)
select cte.name from cte left join bom_locator on cte.id = bom_locator.zone
order by cte.id limit 1
) and bom_ptbl.name is not null;
delete bom_ptbl where name =
(
with recursive cte as
(
select a.id, a.name, a.pid from bom_ptbl a where a.id = bom_ptbl.id
union all
select b.id, b.name, b.pid from cte,bom_ptbl b where cte.id = b.pid
)
select cte.name from cte left join bom_locator on cte.id = bom_locator.zone
order by cte.id limit 1
) and bom_ptbl.name is not null;
insert into bom_ptbl values('002' , 0 , '浙江省');
insert into bom_ptbl values('001' , 0 , '广东省');
insert into bom_ptbl values('003' , '002' , '衢州市');
insert into bom_ptbl values('004' , '002' , '杭州市') ;
insert into bom_ptbl values('005' , '002' , '湖州市');
insert into bom_ptbl values('006' , '002' , '嘉兴市') ;
insert into bom_ptbl values('007' , '002' , '宁波市');
insert into bom_ptbl values('008' , '002' , '绍兴市') ;
insert into bom_ptbl values('009' , '002' , '台州市');
insert into bom_ptbl values('010' , '002' , '温州市') ;
insert into bom_ptbl values('011' , '002' , '丽水市');
insert into bom_ptbl values('012' , '002' , '金华市') ;
insert into bom_ptbl values('013' , '002' , '舟山市');
insert into bom_ptbl values('014' , '004' , '上城区') ;
insert into bom_ptbl values('015' , '004' , '下城区');
insert into bom_ptbl values('016' , '004' , '拱墅区') ;
insert into bom_ptbl values('017' , '004' , '余杭区') ;
insert into bom_ptbl values('018' , '011' , '金东区') ;
insert into bom_ptbl values('019' , '001' , '广州市') ;
insert into bom_ptbl values('020' , '001' , '深圳市') ;
explain (costs off, verbose on) update bom_ptbl set name =
(
with recursive cte as
(
select a.id, a.name, a.pid from bom_ptbl a where a.id = bom_ptbl.id
union all
select b.id, b.name, b.pid from cte,bom_ptbl b where cte.id = b.pid
)
select cte.name from cte left join bom_locator on cte.id = bom_locator.zone
order by cte.id limit 1
) where bom_ptbl.name is not null;
update bom_ptbl set name =
(
with recursive cte as
(
select a.id, a.name, a.pid from bom_ptbl a where a.id = bom_ptbl.id
union all
select b.id, b.name, b.pid from cte,bom_ptbl b where cte.id = b.pid
)
select cte.name from cte left join bom_locator on cte.id = bom_locator.zone
order by cte.id limit 1
) where bom_ptbl.name is not null;
explain (costs off, verbose on) delete bom_ptbl where name =
(
with recursive cte as
(
select a.id, a.name, a.pid from bom_ptbl a where a.id = bom_ptbl.id
union all
select b.id, b.name, b.pid from cte,bom_ptbl b where cte.id = b.pid
)
select cte.name from cte left join bom_locator on cte.id = bom_locator.zone
order by cte.id limit 1
) and bom_ptbl.name is not null;
delete bom_ptbl where name =
(
with recursive cte as
(
select a.id, a.name, a.pid from bom_ptbl a where a.id = bom_ptbl.id
union all
select b.id, b.name, b.pid from cte,bom_ptbl b where cte.id = b.pid
)
select cte.name from cte left join bom_locator on cte.id = bom_locator.zone
order by cte.id limit 1
) and bom_ptbl.name is not null;
drop table if exists bom_ptbl;
drop table if exists bom_locator;
reset current_schema; | the_stack |
-- phpMyAdmin SQL Dump
-- version 4.6.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: 2016-10-30 18:27:52
-- 服务器版本: 5.5.53-0ubuntu0.14.04.1
-- PHP Version: 5.5.9-1ubuntu4.20
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `superpanel`
--
CREATE DATABASE IF NOT EXISTS `superpanel` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
USE `superpanel`;
-- --------------------------------------------------------
--
-- 表的结构 `admin`
--
DROP TABLE IF EXISTS `admin`;
CREATE TABLE `admin` (
`uid` int(11) NOT NULL,
`permission` set('user','admin','node','group','invite','ticket','announcement','config') NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- 表的关联 `admin`:
-- `uid`
-- `user` -> `uid`
--
-- --------------------------------------------------------
--
-- 表的结构 `alipay`
--
DROP TABLE IF EXISTS `alipay`;
CREATE TABLE `alipay` (
`out_trade_no` int(11) NOT NULL COMMENT '支付号',
`uid` int(11) NOT NULL,
`money` int(11) NOT NULL COMMENT '付款金额',
`real_money` float NOT NULL COMMENT '真实付款金额',
`notify_id` varchar(32) DEFAULT NULL COMMENT 'spay订单号',
`status` varchar(32) NOT NULL,
`creat_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '时间',
`finish_time` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- 表的关联 `alipay`:
--
-- --------------------------------------------------------
--
-- 表的结构 `announcement`
--
DROP TABLE IF EXISTS `announcement`;
CREATE TABLE `announcement` (
`item` varchar(16) NOT NULL,
`introduction` varchar(64) NOT NULL,
`text` mediumtext
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- 表的关联 `announcement`:
--
--
-- 转存表中的数据 `announcement`
--
INSERT INTO `announcement` (`item`, `introduction`, `text`) VALUES
('common_node', '普通节点公告', '<h4>SSR混淆更改为http_simple 请在客户端更改 协议仍为auth_sha1</h4>\n<h5>请勿在任何地方公开节点任何信息!</h5>\n<p><small>Sharing Node imformation is Inhibited!</small></p>'),
('footer', '底部通知', '(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/(●´ω`●)/'),
('head', '顶部公告', '这里是萌萌哒的顶部公告哦(ฅ´ω`ฅ) '),
('home', '首页公告', '<p> <?php phpinfo(); ?></p>\n<p>A Shadowsocks Provider</p>\n<p><a href="http://ahref.me/" target="_blank">Ahref Group™</a> Present</p>\n<p> </p>\n<p> </p>'),
('index', '首页公告', NULL),
('invite_code', '邀请码页面公告', '<h1 style="text-align: center;">公共邀请码,请自取。</h1>\n<h2 style="text-align: center;"><strong>严禁刷小号!一旦发现,全部删除+黑名单!</strong></h2>\n'),
('special_node', '高级节点公告', 'lalala'),
('TOS', 'TOS', '<h3>隐私</h3>\n<p><{$site_name}></p>\n<ul>\n<li>用户注册时候需要提供邮箱以及密码,并自行保管。邮箱为用户的唯一凭证。</li>\n<li>本站会加密存储用户密码,尽量保证数据安全,但并不保证这些信息的绝对安全。</li>\n</ul>\n<p> </p>\n<h3>使用条款</h3>\n<p> </p>\n<ul>\n<li>禁止使用本站服务进行任何违法恶意活动。</li>\n<li>使用任何节点,需遵循节点所属国家的相关法律以及中国法律。</li>\n<li>禁止滥用本站提供的服务。</li>\n<li>对于免费用户,我们有权在不通知的情况下删除账户。</li>\n<li>任何违法使用条款的用户,我们将会删除违规账户并没收使用本站服务的权利。</li>\n</ul>\n<p> </p>\n<h3>其它</h3>\n<p> </p>\n<ul>\n<li>本站仅限人类及猫注册使用。</li>\n<li>TOS更新时用户需要遵守最新TOS。</li>\n</ul>'),
('user_home', '用户中心公告', '<p> <?php phpinfo(); ?></p>'),
('user_invite', '用户邀请码公告', '<p>用户注册48小时后,才可以生成邀请码。</p>\n<p>邀请码暂时无法购买,请珍惜。</p>\n<p>公共页面不定期发放邀请码,如果用完邀请码可以关注公共邀请。</p>\n<p>邀请码请给认识的需要的人。</p>\n<p>邀请有记录,若被邀请的人违反用户协议,您将会有连带责任。</p>');
-- --------------------------------------------------------
--
-- 表的结构 `config`
--
DROP TABLE IF EXISTS `config`;
CREATE TABLE `config` (
`id` int(11) NOT NULL,
`name` varchar(64) NOT NULL,
`value` mediumtext NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- 表的关联 `config`:
--
--
-- 转存表中的数据 `config`
--
INSERT INTO `config` (`id`, `name`, `value`) VALUES
(1, 'SITE_NAME', 'SuperPanel-demo'),
(2, 'PUBLIC_KEY', 'ABB9559AE54190D0A74AE032D31F728638BE40C7009C93CF6D4E41CDDEC2899ED28E7F98B662BCE2310AD1ADBDC63FEBF8441C9E2595077A4AD88ABA226A4D5A02BD6D5D16AA25B1EE8A6E10F66056961DD2C2CAC864522CDEFB696DC2D6E451F7040C6CFF71F04506D1A9586C70ABAEE02EB16B71D330E5506197C1A586D381077171F9530A55EAAEEC42180397A9F9B2DCF1820E64F59420F208EC2752E155F890415346393E87C78F46C2F2D255E46C7235AF15EBCA2AFF746CA23EF346E9881DA23CA60A03995FFBFA72B8BEC98576A14E473831F1F77C37E83DD8BA6D100902CDC1E56DF972BEC088C03C3799C0C79DC61CA24064FD1E33467F8FFACF61'),
(3, 'SALT', 'superpanel'),
(4, 'REQUIRE_INVITE_CODE', '1'),
(5, 'ENCRYPTION_METHOD', 'sha256'),
(6, 'DEFAULT_MONEY', '0'),
(8, 'DEFAULT_TRANSFER', '1048576'),
(10, 'DEFAULT_INVITE_AMOUNT', '2'),
(11, 'DEFAULT_GROUP', '1'),
(12, 'DEFAULT_EXPIRATION', '86400'),
(13, 'PROMO_CODE', '233'),
(14, 'PROMO_CODE_VALUE', '-10'),
(15, 'PROMO_CODE_REQUIRE', '5'),
(16, 'PORT_BEGIN', '10'),
(17, 'POET_END', '65535'),
(18, 'PORT_RESERVE', '21,22,80'),
(19, 'DEFAULT_METHOD', 'rc4-md5'),
(20, 'DEFAULT_PROTOCOL', 'origin'),
(21, 'DEFAULT_OBFS', 'plain'),
(22, 'IP_MODE', 'taobao'),
(23, 'IPIP_TOKEN', ''),
(24, 'SPAY_ID', ''),
(25, 'SPAY_CODE', ''),
(26, 'SITE_URL', '请修改为你的网站url'),
(27, 'MIN_GIFT_MONEY', '0.1'),
(28, 'MAX_GIFT_MONEY', '1');
-- --------------------------------------------------------
--
-- 表的结构 `exchange_code`
--
DROP TABLE IF EXISTS `exchange_code`;
CREATE TABLE `exchange_code` (
`code` varchar(64) NOT NULL,
`money` float NOT NULL,
`expiration` int(11) NOT NULL,
`uid` int(11) DEFAULT NULL,
`exchange_time` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- 表的关联 `exchange_code`:
--
-- --------------------------------------------------------
--
-- 表的结构 `group`
--
DROP TABLE IF EXISTS `group`;
CREATE TABLE `group` (
`gid` int(11) NOT NULL COMMENT '组序数',
`order` int(11) NOT NULL,
`group_name` varchar(64) NOT NULL,
`node` varchar(1024) NOT NULL COMMENT '属于此组的nid',
`type` enum('traffic','expiration','funding','') NOT NULL COMMENT '该分组的类型',
`group_info` varchar(1024) NOT NULL COMMENT '节点信息',
`style` varchar(16) NOT NULL DEFAULT 'primary' COMMENT '节点颜色',
`config` varchar(1024) NOT NULL COMMENT '配置'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- 表的关联 `group`:
--
-- --------------------------------------------------------
--
-- 表的结构 `invite_code`
--
DROP TABLE IF EXISTS `invite_code`;
CREATE TABLE `invite_code` (
`id` int(11) NOT NULL,
`uid` int(11) NOT NULL,
`code` char(64) NOT NULL,
`money` float NOT NULL DEFAULT '0',
`group` varchar(1024) NOT NULL,
`expiration` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- 表的关联 `invite_code`:
-- `uid`
-- `user` -> `uid`
--
-- --------------------------------------------------------
--
-- 表的结构 `ip`
--
DROP TABLE IF EXISTS `ip`;
CREATE TABLE `ip` (
`id` int(11) NOT NULL,
`uid` int(11) NOT NULL,
`ip` varchar(64) NOT NULL COMMENT '预留对ipv6的支持',
`location` varchar(64) NOT NULL,
`operation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '操作发生时间',
`operation` varchar(64) NOT NULL COMMENT '操作'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- 表的关联 `ip`:
-- `uid`
-- `user` -> `uid`
--
-- --------------------------------------------------------
--
-- 表的结构 `message`
--
DROP TABLE IF EXISTS `message`;
CREATE TABLE `message` (
`uid` int(11) NOT NULL,
`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`title` varchar(256) NOT NULL,
`message` mediumtext NOT NULL,
`unread` tinyint(1) NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- 表的关联 `message`:
--
-- --------------------------------------------------------
--
-- 表的结构 `node`
--
DROP TABLE IF EXISTS `node`;
CREATE TABLE `node` (
`nid` int(11) NOT NULL,
`node_name` varchar(64) NOT NULL COMMENT '名称',
`address` varchar(64) NOT NULL COMMENT '地址',
`node_info` mediumtext NOT NULL COMMENT '介绍',
`status` tinyint(1) NOT NULL COMMENT '状态',
`visible` tinyint(1) NOT NULL COMMENT '是否可见'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- 表的关联 `node`:
--
-- --------------------------------------------------------
--
-- 表的结构 `node_info`
--
DROP TABLE IF EXISTS `node_info`;
CREATE TABLE `node_info` (
`id` int(11) NOT NULL,
`nid` int(11) NOT NULL COMMENT '节点id',
`load` varchar(32) NOT NULL,
`cpu` varchar(8) NOT NULL,
`upload` int(11) NOT NULL COMMENT '上传',
`download` int(11) NOT NULL COMMENT '下载',
`time` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- 表的关联 `node_info`:
--
-- --------------------------------------------------------
--
-- 表的结构 `node_online_log`
--
DROP TABLE IF EXISTS `node_online_log`;
CREATE TABLE `node_online_log` (
`id` int(11) NOT NULL,
`nid` int(11) NOT NULL,
`users` int(11) NOT NULL,
`time` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- 表的关联 `node_online_log`:
--
-- --------------------------------------------------------
--
-- 表的结构 `purchase_log`
--
DROP TABLE IF EXISTS `purchase_log`;
CREATE TABLE `purchase_log` (
`uid` mediumint(9) NOT NULL,
`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`item_title` varchar(64) NOT NULL,
`spent` float NOT NULL,
`balance` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- 表的关联 `purchase_log`:
--
-- --------------------------------------------------------
--
-- 表的结构 `salt`
--
DROP TABLE IF EXISTS `salt`;
CREATE TABLE `salt` (
`uid` int(11) NOT NULL,
`salt` char(128) NOT NULL,
`google2factor` char(16) NOT NULL COMMENT 'google2步验证密钥'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- 表的关联 `salt`:
-- `uid`
-- `user` -> `uid`
--
-- --------------------------------------------------------
--
-- 表的结构 `shop_item`
--
DROP TABLE IF EXISTS `shop_item`;
CREATE TABLE `shop_item` (
`iid` int(11) NOT NULL COMMENT 'item id',
`title` varchar(64) NOT NULL COMMENT '项目名',
`introduction` mediumtext NOT NULL COMMENT '项目介绍',
`prices` float NOT NULL COMMENT '价格',
`amount` varchar(6) NOT NULL DEFAULT 'INF',
`commands` mediumtext NOT NULL COMMENT '命令'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- 表的关联 `shop_item`:
--
-- --------------------------------------------------------
--
-- 表的结构 `ticket`
--
DROP TABLE IF EXISTS `ticket`;
CREATE TABLE `ticket` (
`tid` int(11) NOT NULL,
`uid` int(11) NOT NULL,
`username` varchar(32) NOT NULL,
`title` varchar(64) NOT NULL,
`message` mediumtext NOT NULL,
`status` enum('updated','replied','closed') NOT NULL DEFAULT 'updated',
`open_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- 表的关联 `ticket`:
-- `uid`
-- `user` -> `uid`
--
-- --------------------------------------------------------
--
-- 表的结构 `ticket_reply`
--
DROP TABLE IF EXISTS `ticket_reply`;
CREATE TABLE `ticket_reply` (
`tid` int(11) NOT NULL,
`uid` int(11) NOT NULL,
`message` mediumtext NOT NULL,
`reply_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- 表的关联 `ticket_reply`:
-- `tid`
-- `ticket` -> `tid`
-- `uid`
-- `user` -> `uid`
--
-- --------------------------------------------------------
--
-- 表的结构 `token`
--
DROP TABLE IF EXISTS `token`;
CREATE TABLE `token` (
`tid` int(11) NOT NULL,
`uid` int(11) NOT NULL,
`token` char(32) NOT NULL COMMENT 'md4的token长度',
`expiration` int(11) NOT NULL,
`operation` varchar(32) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- 表的关联 `token`:
--
-- --------------------------------------------------------
--
-- 表的结构 `user`
--
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`uid` int(11) NOT NULL COMMENT '用户id',
`username` varchar(32) CHARACTER SET utf8mb4 NOT NULL COMMENT '用户名',
`email` varchar(32) NOT NULL COMMENT '用户邮箱',
`verified` tinyint(1) NOT NULL DEFAULT '0',
`password` char(128) NOT NULL COMMENT '密码',
`passwd` varchar(16) NOT NULL COMMENT 'ss密码',
`port` smallint(5) UNSIGNED NOT NULL COMMENT '端口,用small int就足够了',
`t` int(11) NOT NULL DEFAULT '0' COMMENT '最后使用时间',
`u` bigint(20) NOT NULL DEFAULT '0' COMMENT '上传流量',
`d` bigint(20) NOT NULL DEFAULT '0' COMMENT '下载流量',
`real_transfer` bigint(20) NOT NULL,
`plan` varchar(26) CHARACTER SET utf8mb4 NOT NULL COMMENT '用户所处的计划',
`enable` tinyint(1) NOT NULL,
`transfer_enable` bigint(20) NOT NULL COMMENT '可用流量',
`method` varchar(50) NOT NULL,
`protocol` varchar(50) NOT NULL,
`obfs` varchar(50) NOT NULL,
`status` enum('deleted','normal') NOT NULL DEFAULT 'normal' COMMENT '用户状态',
`last_check_in_time` int(11) NOT NULL DEFAULT '0' COMMENT '上次签到时间',
`reg_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '注册时间',
`invite_code_amount` int(8) NOT NULL COMMENT '剩余邀请码数量',
`money` float NOT NULL COMMENT '账户余额',
`invited_by` int(11) NOT NULL COMMENT '邀请人,0为系统',
`is_admin` tinyint(1) NOT NULL DEFAULT '0',
`enable_google2factor` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- 表的关联 `user`:
--
-- --------------------------------------------------------
--
-- 表的结构 `user_group`
--
DROP TABLE IF EXISTS `user_group`;
CREATE TABLE `user_group` (
`uid` int(11) NOT NULL,
`group` int(11) NOT NULL,
`expiration` int(11) NOT NULL,
`transfer_enable` bigint(20) UNSIGNED NOT NULL,
`transfer` bigint(20) UNSIGNED NOT NULL,
`real_transfer` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- 表的关联 `user_group`:
-- `uid`
-- `user` -> `uid`
--
-- --------------------------------------------------------
--
-- 表的结构 `user_traffic_log`
--
DROP TABLE IF EXISTS `user_traffic_log`;
CREATE TABLE `user_traffic_log` (
`id` int(11) NOT NULL,
`uid` int(11) NOT NULL,
`nid` int(11) NOT NULL,
`upload` int(11) NOT NULL,
`download` int(11) NOT NULL,
`rate` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- 表的关联 `user_traffic_log`:
--
--
-- Indexes for dumped tables
--
--
-- Indexes for table `admin`
--
ALTER TABLE `admin`
ADD PRIMARY KEY (`uid`);
--
-- Indexes for table `alipay`
--
ALTER TABLE `alipay`
ADD PRIMARY KEY (`out_trade_no`);
--
-- Indexes for table `announcement`
--
ALTER TABLE `announcement`
ADD PRIMARY KEY (`item`),
ADD UNIQUE KEY `item_2` (`item`),
ADD KEY `item` (`item`);
--
-- Indexes for table `config`
--
ALTER TABLE `config`
ADD PRIMARY KEY (`id`),
ADD KEY `name` (`name`);
--
-- Indexes for table `exchange_code`
--
ALTER TABLE `exchange_code`
ADD PRIMARY KEY (`code`),
ADD UNIQUE KEY `code` (`code`);
--
-- Indexes for table `group`
--
ALTER TABLE `group`
ADD PRIMARY KEY (`gid`);
--
-- Indexes for table `invite_code`
--
ALTER TABLE `invite_code`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `code` (`code`),
ADD KEY `uid` (`uid`);
--
-- Indexes for table `ip`
--
ALTER TABLE `ip`
ADD PRIMARY KEY (`id`),
ADD KEY `uid` (`uid`);
--
-- Indexes for table `node`
--
ALTER TABLE `node`
ADD PRIMARY KEY (`nid`),
ADD UNIQUE KEY `uid` (`nid`);
--
-- Indexes for table `salt`
--
ALTER TABLE `salt`
ADD PRIMARY KEY (`uid`);
--
-- Indexes for table `shop_item`
--
ALTER TABLE `shop_item`
ADD UNIQUE KEY `iid` (`iid`);
--
-- Indexes for table `ticket`
--
ALTER TABLE `ticket`
ADD PRIMARY KEY (`tid`),
ADD KEY `uid` (`uid`),
ADD KEY `tid` (`tid`);
--
-- Indexes for table `ticket_reply`
--
ALTER TABLE `ticket_reply`
ADD KEY `uid` (`uid`),
ADD KEY `tid` (`tid`);
--
-- Indexes for table `token`
--
ALTER TABLE `token`
ADD PRIMARY KEY (`tid`);
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`uid`),
ADD UNIQUE KEY `email` (`email`);
--
-- Indexes for table `user_group`
--
ALTER TABLE `user_group`
ADD KEY `uid` (`uid`);
--
-- 在导出的表使用AUTO_INCREMENT
--
--
-- 使用表AUTO_INCREMENT `config`
--
ALTER TABLE `config`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=29;
--
-- 使用表AUTO_INCREMENT `group`
--
ALTER TABLE `group`
MODIFY `gid` int(11) NOT NULL AUTO_INCREMENT COMMENT '组序数', AUTO_INCREMENT=3;
--
-- 使用表AUTO_INCREMENT `invite_code`
--
ALTER TABLE `invite_code`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=131;
--
-- 使用表AUTO_INCREMENT `ip`
--
ALTER TABLE `ip`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=98;
--
-- 使用表AUTO_INCREMENT `node`
--
ALTER TABLE `node`
MODIFY `nid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=36;
--
-- 使用表AUTO_INCREMENT `shop_item`
--
ALTER TABLE `shop_item`
MODIFY `iid` int(11) NOT NULL AUTO_INCREMENT COMMENT 'item id', AUTO_INCREMENT=5;
--
-- 使用表AUTO_INCREMENT `ticket`
--
ALTER TABLE `ticket`
MODIFY `tid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=101;
--
-- 使用表AUTO_INCREMENT `token`
--
ALTER TABLE `token`
MODIFY `tid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=80;
--
-- 使用表AUTO_INCREMENT `user`
--
ALTER TABLE `user`
MODIFY `uid` int(11) NOT NULL AUTO_INCREMENT COMMENT '用户id', AUTO_INCREMENT=85;
--
-- 限制导出的表
--
--
-- 限制表 `admin`
--
ALTER TABLE `admin`
ADD CONSTRAINT `admin_ibfk_1` FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- 限制表 `invite_code`
--
ALTER TABLE `invite_code`
ADD CONSTRAINT `invite_code_ibfk_1` FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- 限制表 `ip`
--
ALTER TABLE `ip`
ADD CONSTRAINT `ip的uid限制` FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- 限制表 `salt`
--
ALTER TABLE `salt`
ADD CONSTRAINT `salt_ibfk_1` FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- 限制表 `ticket`
--
ALTER TABLE `ticket`
ADD CONSTRAINT `对uid的约束` FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- 限制表 `ticket_reply`
--
ALTER TABLE `ticket_reply`
ADD CONSTRAINT `ticket_reply_ibfk_1` FOREIGN KEY (`tid`) REFERENCES `ticket` (`tid`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `ticket_reply_ibfk_2` FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- 限制表 `user_group`
--
ALTER TABLE `user_group`
ADD CONSTRAINT `user_group_ibfk_1` FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON DELETE CASCADE ON UPDATE CASCADE;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; | the_stack |
--
-- Table structure for table `ActionLog`
--
CREATE TABLE `ActionLog` (
`logId` int(11) NOT NULL AUTO_INCREMENT,
`contactId` int(11) NOT NULL,
`paperId` int(11) DEFAULT NULL,
`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`ipaddr` varbinary(32) DEFAULT NULL,
`action` varbinary(4096) NOT NULL,
PRIMARY KEY (`logId`),
KEY `contactId` (`contactId`),
KEY `paperId` (`paperId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `Capability`
--
CREATE TABLE `Capability` (
`capabilityType` int(11) NOT NULL,
`contactId` int(11) NOT NULL,
`paperId` int(11) NOT NULL,
`timeExpires` int(11) NOT NULL,
`salt` varbinary(255) NOT NULL,
`data` varbinary(4096) DEFAULT NULL,
PRIMARY KEY (`salt`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `ContactInfo`
--
CREATE TABLE `ContactInfo` (
`contactId` int(11) NOT NULL AUTO_INCREMENT,
`firstName` varchar(60) NOT NULL DEFAULT '',
`lastName` varchar(60) NOT NULL DEFAULT '',
`unaccentedName` varchar(120) NOT NULL DEFAULT '',
`email` varchar(120) NOT NULL,
`preferredEmail` varchar(120) DEFAULT NULL,
`affiliation` varchar(2048) NOT NULL DEFAULT '',
`voicePhoneNumber` varchar(256) DEFAULT NULL,
`country` varbinary(256) DEFAULT NULL,
`password` varbinary(2048) NOT NULL,
`passwordTime` int(11) NOT NULL DEFAULT '0',
`passwordUseTime` int(11) NOT NULL DEFAULT '0',
`collaborators` varbinary(8192) DEFAULT NULL,
`creationTime` int(11) NOT NULL DEFAULT '0',
`updateTime` int(11) NOT NULL DEFAULT '0',
`lastLogin` int(11) NOT NULL DEFAULT '0',
`defaultWatch` int(11) NOT NULL DEFAULT '2',
`roles` tinyint(1) NOT NULL DEFAULT '0',
`disabled` tinyint(1) NOT NULL DEFAULT '0',
`contactTags` varbinary(4096) DEFAULT NULL,
`data` varbinary(32767) DEFAULT NULL,
PRIMARY KEY (`contactId`),
UNIQUE KEY `rolesContactId` (`roles`,`contactId`),
UNIQUE KEY `email` (`email`),
KEY `fullName` (`lastName`,`firstName`,`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `FilteredDocument`
--
CREATE TABLE `FilteredDocument` (
`inDocId` int(11) NOT NULL,
`filterType` int(11) NOT NULL,
`outDocId` int(11) NOT NULL,
`createdAt` int(11) NOT NULL,
PRIMARY KEY (`inDocId`,`filterType`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `Formula`
--
CREATE TABLE `Formula` (
`formulaId` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(200) NOT NULL,
`heading` varchar(200) NOT NULL DEFAULT '',
`headingTitle` varbinary(4096) NOT NULL,
`expression` varbinary(4096) NOT NULL,
`createdBy` int(11) NOT NULL DEFAULT '0',
`timeModified` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`formulaId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `MailLog`
--
CREATE TABLE `MailLog` (
`mailId` int(11) NOT NULL AUTO_INCREMENT,
`recipients` varbinary(200) NOT NULL,
`q` varbinary(4096) DEFAULT NULL,
`t` varbinary(200) DEFAULT NULL,
`paperIds` blob,
`cc` blob,
`replyto` blob,
`subject` blob,
`emailBody` blob,
`fromNonChair` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`mailId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `Mimetype`
--
CREATE TABLE `Mimetype` (
`mimetypeid` int(11) NOT NULL,
`mimetype` varbinary(200) NOT NULL,
`extension` varbinary(10) DEFAULT NULL,
`description` varbinary(200) DEFAULT NULL,
`inline` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`mimetypeid`),
UNIQUE KEY `mimetype` (`mimetype`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `Paper`
--
CREATE TABLE `Paper` (
`paperId` int(11) NOT NULL AUTO_INCREMENT,
`title` varbinary(256) DEFAULT NULL,
`authorInformation` varbinary(8192) DEFAULT NULL,
`abstract` varbinary(16384) DEFAULT NULL,
`collaborators` varbinary(8192) DEFAULT NULL,
`timeSubmitted` int(11) NOT NULL DEFAULT '0',
`timeWithdrawn` int(11) NOT NULL DEFAULT '0',
`timeFinalSubmitted` int(11) NOT NULL DEFAULT '0',
`timeModified` int(11) NOT NULL DEFAULT '0',
`paperStorageId` int(11) NOT NULL DEFAULT '0',
# `sha1` copied from PaperStorage to reduce joins
`sha1` varbinary(64) NOT NULL DEFAULT '',
`finalPaperStorageId` int(11) NOT NULL DEFAULT '0',
`blind` tinyint(1) NOT NULL DEFAULT '1',
`outcome` tinyint(1) NOT NULL DEFAULT '0',
`leadContactId` int(11) NOT NULL DEFAULT '0',
`shepherdContactId` int(11) NOT NULL DEFAULT '0',
`managerContactId` int(11) NOT NULL DEFAULT '0',
`capVersion` int(1) NOT NULL DEFAULT '0',
# next 3 fields copied from PaperStorage to reduce joins
`size` int(11) NOT NULL DEFAULT '0',
`mimetype` varbinary(80) NOT NULL DEFAULT '',
`timestamp` int(11) NOT NULL DEFAULT '0',
`pdfFormatStatus` int(11) NOT NULL DEFAULT '0',
`withdrawReason` varbinary(1024) DEFAULT NULL,
`paperFormat` tinyint(1) DEFAULT NULL,
PRIMARY KEY (`paperId`),
KEY `timeSubmitted` (`timeSubmitted`),
KEY `leadContactId` (`leadContactId`),
KEY `shepherdContactId` (`shepherdContactId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `PaperComment`
--
CREATE TABLE `PaperComment` (
`paperId` int(11) NOT NULL,
`commentId` int(11) NOT NULL AUTO_INCREMENT,
`contactId` int(11) NOT NULL,
`timeModified` int(11) NOT NULL,
`timeNotified` int(11) NOT NULL DEFAULT '0',
`timeDisplayed` int(11) NOT NULL DEFAULT '0',
`comment` varbinary(32767) DEFAULT NULL,
`commentType` int(11) NOT NULL DEFAULT '0',
`replyTo` int(11) NOT NULL,
`paperStorageId` int(11) NOT NULL DEFAULT '0',
`ordinal` int(11) NOT NULL DEFAULT '0',
`authorOrdinal` int(11) NOT NULL DEFAULT '0',
`commentTags` varbinary(1024) DEFAULT NULL,
`commentRound` int(11) NOT NULL DEFAULT '0',
`commentFormat` tinyint(1) DEFAULT NULL,
`commentOverflow` longblob,
PRIMARY KEY (`paperId`,`commentId`),
UNIQUE KEY `commentId` (`commentId`),
KEY `contactId` (`contactId`),
KEY `timeModifiedContact` (`timeModified`,`contactId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `PaperConflict`
--
CREATE TABLE `PaperConflict` (
`paperId` int(11) NOT NULL,
`contactId` int(11) NOT NULL,
`conflictType` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`contactId`,`paperId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `PaperOption`
--
CREATE TABLE `PaperOption` (
`paperId` int(11) NOT NULL,
`optionId` int(11) NOT NULL,
`value` int(11) NOT NULL DEFAULT '0',
`data` varbinary(32767) DEFAULT NULL,
`dataOverflow` longblob,
PRIMARY KEY (`paperId`,`optionId`,`value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `PaperReview`
--
CREATE TABLE `PaperReview` (
`paperId` int(11) NOT NULL,
`reviewId` int(11) NOT NULL AUTO_INCREMENT,
`contactId` int(11) NOT NULL,
`reviewToken` int(11) NOT NULL DEFAULT '0',
`reviewType` tinyint(1) NOT NULL DEFAULT '0',
`reviewRound` int(1) NOT NULL DEFAULT '0',
`requestedBy` int(11) NOT NULL DEFAULT '0',
`timeRequested` int(11) NOT NULL DEFAULT '0',
`timeRequestNotified` int(11) NOT NULL DEFAULT '0',
`reviewBlind` tinyint(1) NOT NULL DEFAULT '1',
`reviewModified` int(1) DEFAULT NULL,
`reviewAuthorModified` int(1) DEFAULT NULL,
`reviewSubmitted` int(1) DEFAULT NULL,
`reviewNotified` int(1) DEFAULT NULL,
`reviewAuthorNotified` int(11) NOT NULL DEFAULT '0',
`reviewAuthorSeen` int(1) DEFAULT NULL,
`reviewOrdinal` int(1) DEFAULT NULL,
`timeDisplayed` int(11) NOT NULL DEFAULT '0',
`timeApprovalRequested` int(11) NOT NULL DEFAULT '0',
`reviewEditVersion` int(1) NOT NULL DEFAULT '0',
`reviewNeedsSubmit` tinyint(1) NOT NULL DEFAULT '1',
`overAllMerit` tinyint(1) NOT NULL DEFAULT '0',
`reviewerQualification` tinyint(1) NOT NULL DEFAULT '0',
`novelty` tinyint(1) NOT NULL DEFAULT '0',
`technicalMerit` tinyint(1) NOT NULL DEFAULT '0',
`interestToCommunity` tinyint(1) NOT NULL DEFAULT '0',
`longevity` tinyint(1) NOT NULL DEFAULT '0',
`grammar` tinyint(1) NOT NULL DEFAULT '0',
`likelyPresentation` tinyint(1) NOT NULL DEFAULT '0',
`suitableForShort` tinyint(1) NOT NULL DEFAULT '0',
`paperSummary` mediumblob,
`commentsToAuthor` mediumblob,
`commentsToPC` mediumblob,
`commentsToAddress` mediumblob,
`weaknessOfPaper` mediumblob,
`strengthOfPaper` mediumblob,
`potential` tinyint(4) NOT NULL DEFAULT '0',
`fixability` tinyint(4) NOT NULL DEFAULT '0',
`textField7` mediumblob,
`textField8` mediumblob,
`reviewWordCount` int(11) DEFAULT NULL,
`reviewFormat` tinyint(1) DEFAULT NULL,
PRIMARY KEY (`paperId`,`reviewId`),
UNIQUE KEY `reviewId` (`reviewId`),
UNIQUE KEY `contactPaper` (`contactId`,`paperId`),
KEY `paperId` (`paperId`,`reviewOrdinal`),
KEY `reviewSubmittedContact` (`reviewSubmitted`,`contactId`),
KEY `reviewNeedsSubmit` (`reviewNeedsSubmit`),
KEY `reviewType` (`reviewType`),
KEY `reviewRound` (`reviewRound`),
KEY `requestedBy` (`requestedBy`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `PaperReviewPreference`
--
CREATE TABLE `PaperReviewPreference` (
`paperId` int(11) NOT NULL,
`contactId` int(11) NOT NULL,
`preference` int(4) NOT NULL DEFAULT '0',
`expertise` int(4) DEFAULT NULL,
PRIMARY KEY (`paperId`,`contactId`),
UNIQUE KEY `contactPaper` (`contactId`,`paperId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `PaperReviewRefused`
--
CREATE TABLE `PaperReviewRefused` (
`paperId` int(11) NOT NULL,
`contactId` int(11) NOT NULL,
`requestedBy` int(11) NOT NULL,
`reason` varbinary(32767) DEFAULT NULL,
KEY `paperId` (`paperId`),
KEY `contactId` (`contactId`),
KEY `requestedBy` (`requestedBy`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `PaperStorage`
--
CREATE TABLE `PaperStorage` (
`paperId` int(11) NOT NULL,
`paperStorageId` int(11) NOT NULL AUTO_INCREMENT,
`timestamp` int(11) NOT NULL,
`mimetype` varbinary(80) NOT NULL DEFAULT '',
`mimetypeid` int(11) NOT NULL DEFAULT '0',
`paper` longblob,
`compression` tinyint(1) NOT NULL DEFAULT '0',
`sha1` varbinary(64) NOT NULL DEFAULT '',
`documentType` int(3) NOT NULL DEFAULT '0',
`filename` varbinary(255) DEFAULT NULL,
`infoJson` varbinary(32768) DEFAULT NULL,
`size` bigint(11) DEFAULT NULL,
`filterType` int(3) DEFAULT NULL,
`originalStorageId` int(11) DEFAULT NULL,
PRIMARY KEY (`paperId`,`paperStorageId`),
UNIQUE KEY `paperStorageId` (`paperStorageId`),
KEY `byPaper` (`paperId`,`documentType`,`timestamp`,`paperStorageId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `PaperTag`
--
CREATE TABLE `PaperTag` (
`paperId` int(11) NOT NULL,
`tag` varchar(80) NOT NULL, # case-insensitive; see TAG_MAXLEN in init.php
`tagIndex` float NOT NULL DEFAULT '0',
PRIMARY KEY (`paperId`,`tag`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `PaperTagAnno`
--
CREATE TABLE `PaperTagAnno` (
`tag` varchar(80) NOT NULL, # case-insensitive; see TAG_MAXLEN in init.php
`annoId` int(11) NOT NULL,
`tagIndex` float NOT NULL DEFAULT '0',
`heading` varbinary(8192) DEFAULT NULL,
`annoFormat` tinyint(1) DEFAULT NULL,
`infoJson` varbinary(32768) DEFAULT NULL,
PRIMARY KEY (`tag`,`annoId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `PaperTopic`
--
CREATE TABLE `PaperTopic` (
`paperId` int(11) NOT NULL,
`topicId` int(11) NOT NULL,
PRIMARY KEY (`paperId`,`topicId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `PaperWatch`
--
CREATE TABLE `PaperWatch` (
`paperId` int(11) NOT NULL,
`contactId` int(11) NOT NULL,
`watch` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`paperId`,`contactId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `ReviewRating`
--
CREATE TABLE `ReviewRating` (
`paperId` int(11) NOT NULL,
`reviewId` int(11) NOT NULL,
`contactId` int(11) NOT NULL,
`rating` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`paperId`,`reviewId`,`contactId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `ReviewRequest`
--
CREATE TABLE `ReviewRequest` (
`paperId` int(11) NOT NULL,
`name` varchar(120) DEFAULT NULL,
`email` varchar(120) DEFAULT NULL,
`reason` varbinary(32767) DEFAULT NULL,
`requestedBy` int(11) NOT NULL,
`reviewRound` int(1) DEFAULT NULL,
UNIQUE KEY `paperEmail` (`paperId`,`email`),
KEY `paperId` (`paperId`),
KEY `requestedBy` (`requestedBy`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `Settings`
--
CREATE TABLE `Settings` (
`name` varbinary(256) DEFAULT NULL,
`value` int(11) NOT NULL,
`data` varbinary(32767) DEFAULT NULL,
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `TopicArea`
--
CREATE TABLE `TopicArea` (
`topicId` int(11) NOT NULL AUTO_INCREMENT,
`topicName` varchar(200) DEFAULT NULL,
PRIMARY KEY (`topicId`),
KEY `topicName` (`topicName`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `TopicInterest`
--
CREATE TABLE `TopicInterest` (
`contactId` int(11) NOT NULL,
`topicId` int(11) NOT NULL,
`interest` int(1) NOT NULL,
PRIMARY KEY (`contactId`,`topicId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | the_stack |
--1 Revive relationships in order to use them in list item #22
UPDATE concept_relationship
SET invalid_reason = NULL,
valid_end_date = TO_DATE('20991231', 'YYYYMMDD')
WHERE relationship_id IN (
'RxNorm has dose form',
'RxNorm dose form of'
)
AND invalid_reason = 'D';
--2 Truncate all working tables
TRUNCATE TABLE concept_stage;
TRUNCATE TABLE concept_relationship_stage;
TRUNCATE TABLE concept_synonym_stage;
TRUNCATE TABLE pack_content_stage;
TRUNCATE TABLE drug_strength_stage;
--3 Load full list of RxNorm Extension concepts
INSERT INTO concept_stage (
concept_name,
domain_id,
vocabulary_id,
concept_class_id,
standard_concept,
concept_code,
valid_start_date,
valid_end_date,
invalid_reason
)
SELECT concept_name,
domain_id,
vocabulary_id,
concept_class_id,
standard_concept,
concept_code,
valid_start_date,
valid_end_date,
invalid_reason
FROM concept
WHERE vocabulary_id = 'RxNorm Extension';
--4 Load full list of RxNorm Extension relationships
INSERT INTO concept_relationship_stage (
concept_code_1,
concept_code_2,
vocabulary_id_1,
vocabulary_id_2,
relationship_id,
valid_start_date,
valid_end_date,
invalid_reason
)
SELECT c1.concept_code,
c2.concept_code,
c1.vocabulary_id,
c2.vocabulary_id,
r.relationship_id,
r.valid_start_date,
r.valid_end_date,
r.invalid_reason
FROM concept c1,
concept c2,
concept_relationship r
WHERE c1.concept_id = r.concept_id_1
AND c2.concept_id = r.concept_id_2
AND 'RxNorm Extension' IN (
c1.vocabulary_id,
c2.vocabulary_id
);
--5 Load full list of RxNorm Extension drug strength
INSERT INTO drug_strength_stage (
drug_concept_code,
vocabulary_id_1,
ingredient_concept_code,
vocabulary_id_2,
amount_value,
amount_unit_concept_id,
numerator_value,
numerator_unit_concept_id,
denominator_value,
denominator_unit_concept_id,
valid_start_date,
valid_end_date,
invalid_reason
)
SELECT c.concept_code,
c.vocabulary_id,
c2.concept_code,
c2.vocabulary_id,
amount_value,
amount_unit_concept_id,
numerator_value,
numerator_unit_concept_id,
denominator_value,
denominator_unit_concept_id,
ds.valid_start_date,
ds.valid_end_date,
ds.invalid_reason
FROM concept c
JOIN drug_strength ds ON ds.drug_concept_id = c.concept_id
JOIN concept c2 ON ds.ingredient_concept_id = c2.concept_id
WHERE c.vocabulary_id IN (
'RxNorm',
'RxNorm Extension'
);
--6 Load full list of RxNorm Extension pack content
INSERT INTO pack_content_stage (
pack_concept_code,
pack_vocabulary_id,
drug_concept_code,
drug_vocabulary_id,
amount,
box_size
)
SELECT c.concept_code,
c.vocabulary_id,
c2.concept_code,
c2.vocabulary_id,
amount,
box_size
FROM pack_content pc
JOIN concept c ON pc.pack_concept_id = c.concept_id
JOIN concept c2 ON pc.drug_concept_id = c2.concept_id;
--1 Add new temporary vocabulary named Rxfix to the vocabulary table
INSERT INTO concept (
concept_id,
concept_name,
domain_id,
vocabulary_id,
concept_class_id,
standard_concept,
concept_code,
valid_start_date,
valid_end_date,
invalid_reason
)
VALUES (
100,
'Rxfix',
'Drug',
'Vocabulary',
'Vocabulary',
NULL,
'OMOP generated',
TO_DATE('19700101', 'yyyymmdd'),
TO_DATE('20991231', 'yyyymmdd'),
NULL
);
INSERT INTO vocabulary (
vocabulary_id,
vocabulary_name,
vocabulary_concept_id
)
VALUES (
'Rxfix',
'Rxfix',
100
);
--2 Update latest_update field to new date
DO $_$
BEGIN
PERFORM VOCABULARY_PACK.SetLatestUpdate(
pVocabularyName => 'Rxfix',
pVocabularyDate => CURRENT_DATE,
pVocabularyVersion => 'Rxfix '||CURRENT_DATE,
pVocabularyDevSchema => 'DEV_RXE'
);
PERFORM VOCABULARY_PACK.SetLatestUpdate(
pVocabularyName => 'RxNorm Extension',
pVocabularyDate => CURRENT_DATE,
pVocabularyVersion => 'RxNorm Extension '||CURRENT_DATE,
pVocabularyDevSchema => 'DEV_RXE',
pAppendVocabulary => TRUE
);
END $_$;
--3 create input tables
DROP TABLE drug_concept_stage; --temporary!!!!! later we should to move all drops to the end of this script (or cndv?)
DROP TABLE ds_stage;
DROP TABLE internal_relationship_stage;
DROP TABLE pc_stage;
DROP TABLE relationship_to_concept;
--3.1 1st input table: drug_concept_stage
CREATE TABLE drug_concept_stage (
concept_name VARCHAR(255),
vocabulary_id VARCHAR(20),
concept_class_id VARCHAR(20),
standard_concept VARCHAR(1),
concept_code VARCHAR(50),
possible_excipient VARCHAR(1),
domain_id VARCHAR(20),
valid_start_date DATE,
valid_end_date DATE,
invalid_reason VARCHAR(1),
source_concept_class_id VARCHAR(20)
);
--3.2 2nd input table: ds_stage
CREATE TABLE ds_stage (
drug_concept_code VARCHAR(50),
ingredient_concept_code VARCHAR(50),
box_size INT,
amount_value FLOAT,
amount_unit VARCHAR(50),
numerator_value FLOAT,
numerator_unit VARCHAR(50),
denominator_value FLOAT,
denominator_unit VARCHAR(50)
);
--3.3 3rd input table: internal_relationship_stage
CREATE TABLE internal_relationship_stage (
concept_code_1 VARCHAR(50),
concept_code_2 VARCHAR(50)
);
--3.4 4th input table: pc_stage
CREATE TABLE pc_stage (
pack_concept_code VARCHAR(50),
drug_concept_code VARCHAR(50),
amount FLOAT,
box_size INT
);
--3.5 5th input table: relationship_to_concept
CREATE TABLE relationship_to_concept (
concept_code_1 VARCHAR(50),
vocabulary_id_1 VARCHAR(20),
concept_id_2 INT,
precedence INT,
conversion_factor FLOAT
);
--4 Create Concepts
--4.1 Get products
INSERT INTO drug_concept_stage (
concept_name,
vocabulary_id,
concept_class_id,
standard_concept,
concept_code,
possible_excipient,
domain_id,
valid_start_date,
valid_end_date,
invalid_reason,
source_concept_class_id
)
SELECT concept_name,
'Rxfix',
'Drug Product',
NULL,
concept_code,
NULL,
domain_id,
valid_start_date,
valid_end_date,
invalid_reason,
concept_class_id
FROM concept
WHERE
-- all the "Drug" Classes
(
concept_class_id LIKE '%Drug%'
OR concept_class_id LIKE '%Pack%'
OR concept_class_id LIKE '%Box%'
OR concept_class_id LIKE '%Marketed%'
)
AND vocabulary_id = 'RxNorm Extension'
AND invalid_reason IS NULL
UNION ALL
-- Get Dose Forms, Brand Names, Supplier, including RxNorm
SELECT c.concept_name,
'Rxfix',
c.concept_class_id,
NULL,
c.concept_code,
NULL,
c.domain_id,
c.valid_start_date,
c.valid_end_date,
c.invalid_reason,
c.concept_class_id
FROM concept c
--their attributes
WHERE c.concept_class_id IN (
'Dose Form',
'Brand Name',
'Supplier'
)
AND c.vocabulary_id LIKE 'Rx%'
AND c.invalid_reason IS NULL
AND EXISTS (
SELECT 1
FROM concept_relationship cr
JOIN concept c_int ON c_int.concept_id = cr.concept_id_1
-- the same list of the products
AND (
c_int.concept_class_id LIKE '%Drug%'
OR c_int.concept_class_id LIKE '%Pack%'
OR c_int.concept_class_id LIKE '%Box%'
OR c_int.concept_class_id LIKE '%Marketed%'
)
AND c_int.vocabulary_id = 'RxNorm Extension'
WHERE cr.concept_id_2 = c.concept_id
AND cr.invalid_reason IS NULL
);
INSERT INTO drug_concept_stage (
concept_name,
vocabulary_id,
concept_class_id,
standard_concept,
concept_code,
possible_excipient,
domain_id,
valid_start_date,
valid_end_date,
invalid_reason,
source_concept_class_id
)
--Get RxNorm pack components from RxNorm
SELECT c2.concept_name,
'Rxfix',
'Drug Product',
NULL,
c2.concept_code,
NULL,
c2.domain_id,
c2.valid_start_date,
c2.valid_end_date,
c2.invalid_reason,
c2.concept_class_id
FROM pack_content pc
JOIN concept c ON c.concept_id = pc.pack_concept_id
AND c.vocabulary_id = 'RxNorm Extension'
JOIN concept c2 ON c2.concept_id = pc.drug_concept_id
AND c2.vocabulary_id = 'RxNorm'
AND c2.invalid_reason IS NULL
UNION
SELECT c3.concept_name,
'Rxfix',
'Drug Product',
NULL,
c3.concept_code,
NULL,
c3.domain_id,
c3.valid_start_date,
c3.valid_end_date,
c3.invalid_reason,
c3.concept_class_id
FROM pack_content pc
JOIN concept c ON c.concept_id = pc.pack_concept_id
AND c.vocabulary_id = 'RxNorm Extension'
JOIN concept c2 ON c2.concept_id = pc.drug_concept_id
AND c2.vocabulary_id = 'RxNorm'
AND c2.invalid_reason = 'U'
JOIN concept_relationship cr ON cr.concept_id_1 = c2.concept_id
AND relationship_id = 'Concept replaced by'
JOIN concept c3 ON c3.concept_id = concept_id_2
UNION
SELECT c.concept_name,
'Rxfix',
'Drug Product',
NULL,
c.concept_code,
NULL,
c.domain_id,
c.valid_start_date,
c.valid_end_date,
c.invalid_reason,
c.concept_class_id
FROM concept c
JOIN concept_relationship cr ON c.concept_id = cr.concept_id_1
JOIN concept c2 ON c2.concept_id = concept_id_2
AND c2.vocabulary_id = 'RxNorm Extension'
AND c2.concept_class_id LIKE '%Pack%'
WHERE relationship_id = 'Contained in'
AND c.concept_code NOT IN (
SELECT concept_code
FROM drug_concept_stage
);
--4.2 Get upgraded Dose Forms, Brand Names, Supplier
INSERT INTO drug_concept_stage (
concept_name,
vocabulary_id,
concept_class_id,
standard_concept,
concept_code,
possible_excipient,
domain_id,
valid_start_date,
valid_end_date,
invalid_reason,
source_concept_class_id
)
SELECT c.concept_name,
'Rxfix',
c.concept_class_id,
NULL,
c.concept_code,
NULL,
c.domain_id,
c.valid_start_date,
c.valid_end_date,
c.invalid_reason,
c.concept_class_id
FROM concept c
-- add fresh attributes instead of invalid
WHERE EXISTS (
SELECT 1
FROM concept_relationship cr
JOIN concept c_int1 ON c_int1.concept_id = cr.concept_id_1
AND (
c_int1.concept_class_id LIKE '%Drug%'
OR c_int1.concept_class_id LIKE '%Pack%'
OR c_int1.concept_class_id LIKE '%Box%'
OR c_int1.concept_class_id LIKE '%Marketed%'
)
AND c_int1.vocabulary_id = 'RxNorm Extension'
JOIN concept c_int2 ON c_int2.concept_id = cr.concept_id_2
AND c_int2.concept_class_id IN (
'Dose Form',
'Brand Name',
'Supplier'
)
AND c_int2.vocabulary_id LIKE 'Rx%'
AND c_int2.invalid_reason IS NOT NULL
--get last fresh attributes
JOIN (
WITH recursive hierarchy_concepts(ancestor_concept_id, descendant_concept_id, root_ancestor_concept_id, full_path) AS (
SELECT ancestor_concept_id,
descendant_concept_id,
ancestor_concept_id AS root_ancestor_concept_id,
ARRAY [descendant_concept_id] AS full_path
FROM concepts
UNION ALL
SELECT c.ancestor_concept_id,
c.descendant_concept_id,
root_ancestor_concept_id,
hc.full_path || c.descendant_concept_id AS full_path
FROM concepts c
JOIN hierarchy_concepts hc ON hc.descendant_concept_id = c.ancestor_concept_id
WHERE c.descendant_concept_id <> ALL (full_path)
),
concepts AS (
SELECT r.concept_id_1 AS ancestor_concept_id,
r.concept_id_2 AS descendant_concept_id
FROM concept_relationship r
JOIN concept c1 ON c1.concept_id = r.concept_id_1
AND c1.concept_class_id IN (
'Dose Form',
'Brand Name',
'Supplier'
)
AND c1.vocabulary_id LIKE 'Rx%'
JOIN concept c2 ON c2.concept_id = r.concept_id_2
AND c2.concept_class_id IN (
'Dose Form',
'Brand Name',
'Supplier'
)
AND c2.vocabulary_id LIKE 'Rx%'
WHERE r.relationship_id = 'Concept replaced by'
AND r.invalid_reason IS NULL
)
SELECT hc.root_ancestor_concept_id AS root_concept_id_1,
hc.descendant_concept_id AS concept_id_2
FROM hierarchy_concepts hc
WHERE NOT EXISTS (
/*same as oracle's CONNECT_BY_ISLEAF*/
SELECT 1
FROM hierarchy_concepts hc_int
WHERE hc_int.ancestor_concept_id = hc.descendant_concept_id
)
) lf ON lf.root_concept_id_1 = c_int2.concept_id
WHERE lf.concept_id_2 = c.concept_id
AND cr.invalid_reason IS NULL
)
AND NOT EXISTS (
SELECT 1
FROM drug_concept_stage dcs
WHERE dcs.concept_code = c.concept_code
AND dcs.domain_id = c.domain_id
AND dcs.concept_class_id = c.concept_class_id
AND dcs.source_concept_class_id = c.concept_class_id
);
--4.3 Ingredients: Need to check what happens to deprecated
-- Get ingredients from drug_strength
INSERT INTO drug_concept_stage (
concept_name,
vocabulary_id,
concept_class_id,
standard_concept,
concept_code,
possible_excipient,
domain_id,
valid_start_date,
valid_end_date,
invalid_reason,
source_concept_class_id
)
SELECT c.concept_name,
'Rxfix',
'Ingredient',
'S',
c.concept_code,
NULL,
c.domain_id,
c.valid_start_date,
c.valid_end_date,
c.invalid_reason,
'Ingredient'
FROM concept c
WHERE c.invalid_reason IS NULL
AND c.vocabulary_id LIKE 'Rx%'
AND EXISTS (
SELECT 1
FROM drug_strength ds
JOIN concept c_int ON c_int.concept_id = ds.drug_concept_id
AND c_int.vocabulary_id = 'RxNorm Extension'
WHERE ds.ingredient_concept_id = c.concept_id
)
AND NOT EXISTS (
SELECT 1
FROM drug_concept_stage dcs
WHERE dcs.concept_code = c.concept_code
AND dcs.domain_id = c.domain_id
AND dcs.concept_class_id = 'Ingredient'
AND dcs.source_concept_class_id = 'Ingredient'
);
--4.4 Get ingredients from hierarchy
INSERT INTO drug_concept_stage (
concept_name,
vocabulary_id,
concept_class_id,
standard_concept,
concept_code,
possible_excipient,
domain_id,
valid_start_date,
valid_end_date,
invalid_reason,
source_concept_class_id
)
SELECT c.concept_name,
'Rxfix',
'Ingredient',
'S',
c.concept_code,
NULL,
c.domain_id,
c.valid_start_date,
c.valid_end_date,
c.invalid_reason,
'Ingredient'
FROM concept c
WHERE c.concept_class_id = 'Ingredient'
AND c.vocabulary_id LIKE 'Rx%'
--add ingredients from ancestor
AND EXISTS (
SELECT 1
FROM concept_ancestor ca
JOIN concept c_int ON c_int.concept_id = ca.descendant_concept_id
AND c_int.vocabulary_id = 'RxNorm Extension'
WHERE ca.ancestor_concept_id = c.concept_id
)
AND NOT EXISTS (
SELECT 1
FROM drug_concept_stage dcs
WHERE dcs.concept_code = c.concept_code
AND dcs.domain_id = c.domain_id
AND dcs.concept_class_id = 'Ingredient'
AND dcs.source_concept_class_id = 'Ingredient'
);
--4.5 Insert Kentucky grass
INSERT INTO drug_concept_stage (
concept_name,
vocabulary_id,
concept_class_id,
standard_concept,
concept_code,
possible_excipient,
domain_id,
valid_start_date,
valid_end_date,
invalid_reason,
source_concept_class_id
)
SELECT c.concept_name,
'Rxfix',
'Ingredient',
'S',
c.concept_code,
NULL,
c.domain_id,
c.valid_start_date,
c.valid_end_date,
c.invalid_reason,
'Ingredient'
FROM concept c
WHERE c.concept_name IN ('Kentucky bluegrass pollen extract')
AND c.vocabulary_id = 'RxNorm';
--4.6 Get all Units
INSERT INTO drug_concept_stage (
concept_name,
vocabulary_id,
concept_class_id,
standard_concept,
concept_code,
possible_excipient,
domain_id,
valid_start_date,
valid_end_date,
invalid_reason,
source_concept_class_id
)
SELECT c.concept_name,
'Rxfix',
'Unit',
NULL,
c.concept_code,
NULL,
'Drug',
c.valid_start_date,
c.valid_end_date,
NULL,
'Unit'
FROM concept c
WHERE c.concept_id IN (
SELECT ds.units
FROM (
SELECT amount_unit_concept_id AS units,
drug_concept_id
FROM drug_strength
WHERE amount_unit_concept_id IS NOT NULL
UNION
SELECT numerator_unit_concept_id AS units,
drug_concept_id
FROM drug_strength
WHERE numerator_unit_concept_id IS NOT NULL
UNION
SELECT denominator_unit_concept_id AS units,
drug_concept_id
FROM drug_strength
WHERE denominator_unit_concept_id IS NOT NULL
) ds
JOIN concept c_int ON c_int.concept_id = ds.drug_concept_id
AND c_int.vocabulary_id = 'RxNorm Extension'
)
UNION
SELECT c.concept_name,
'Rxfix',
'Unit',
NULL,
c.concept_code,
NULL,
'Drug',
c.valid_start_date,
c.valid_end_date,
NULL,
'Unit'
FROM concept c
WHERE c.concept_id = 45744815;
--4.7 Get a supplier that hadn't been connected to any drug
INSERT INTO drug_concept_stage (
concept_name,
vocabulary_id,
concept_class_id,
standard_concept,
concept_code,
possible_excipient,
domain_id,
valid_start_date,
valid_end_date,
invalid_reason,
source_concept_class_id
)
SELECT c.concept_name,
'Rxfix',
c.concept_class_id,
NULL,
c.concept_code,
NULL,
c.domain_id,
c.valid_start_date,
c.valid_end_date,
c.invalid_reason,
c.concept_class_id
FROM concept c
WHERE c.concept_name = 'Hawgreen Ltd'
AND c.vocabulary_id = 'RxNorm Extension'
AND NOT EXISTS (
SELECT 1
FROM drug_concept_stage dcs
WHERE dcs.concept_code = c.concept_code
AND dcs.domain_id = c.domain_id
AND dcs.concept_class_id = c.concept_class_id
AND dcs.source_concept_class_id = c.concept_class_id
);
--5 Remove all where there is less than total of 0.05 mL
DELETE
FROM drug_concept_stage
WHERE concept_code IN (
SELECT concept_code
FROM concept c
JOIN drug_strength ds ON ds.drug_concept_id = c.concept_id
WHERE c.vocabulary_id = 'RxNorm Extension'
AND c.invalid_reason IS NULL
AND ds.denominator_value < 0.05
AND ds.denominator_unit_concept_id = 8587
);
--6 delete isopropyl as it is not an ingrediend + drugs containing it
DELETE
FROM drug_concept_stage
WHERE concept_code IN (
SELECT c.concept_code
FROM concept_ancestor a
JOIN concept c ON c.concept_id = descendant_concept_id
AND ancestor_concept_id = 43563483
);
DELETE
FROM drug_concept_stage
WHERE concept_code IN (
'OMOP881482',
'OMOP341519',
'OMOP346740',
'OMOP714610',
'721654',
'1021221',
'317004',
'1371041',
'OMOP881524',
'236340'
) --apo-trastumab,gas etc.
OR (
concept_name ilike '%apotheke%'
AND concept_class_id = 'Supplier'
);
/* Remove wrong brand names (need to save for the later clean up)
DELETE
FROM drug_concept_stage
WHERE concept_code IN (
SELECT dcs.concept_code
FROM drug_concept_stage dcs
JOIN concept c ON LOWER(dcs.concept_name) = LOWER(c.concept_name)
AND c.concept_class_id IN (
'ATC 5th',
'ATC 4th',
'ATC 3rd',
'AU Substance',
'AU Qualifier',
'Chemical Structure',
'CPT4 Hierarchy',
'Gemscript',
'Gemscript THIN',
'GPI',
'Ingredient',
'Substance',
'LOINC Hierarchy',
'Main Heading',
'Organism',
'Pharma Preparation'
)
WHERE dcs.concept_class_id = 'Brand Name'
UNION
SELECT concept_code
FROM drug_concept_stage
WHERE concept_class_id = 'Brand Name'
AND concept_name ~ 'Comp\s|Comp$|Praeparatum'
AND NOT concept_name ~ 'Ratioph|Zentiva|Actavis|Teva|Hormosan|Dura|Ass|Provas|Rami|Al |Pharma|Abz|-Q|Peritrast|Beloc|Hexal|Corax|Solgar|Winthrop'
);
*/
--7 filling drug_strength
--just turn drug_strength into ds_stage replacing concept_ids with concept_codes
INSERT INTO ds_stage (
drug_concept_code,
ingredient_concept_code,
box_size,
amount_value,
amount_unit,
numerator_value,
numerator_unit,
denominator_value,
denominator_unit
)
SELECT drug_concept_code,
CASE
WHEN ingredient_concept_code = '314375'
THEN '852834' --ALLERGENIC EXTRACT, GRASS, KENTUCKY BLUE
WHEN ingredient_concept_code = 'OMOP332154'
THEN '748794' --Inert Ingredients
WHEN ingredient_concept_code = '314329'
THEN '1309815' --ALLERGENIC EXTRACT, BIRCH
WHEN ingredient_concept_code = '1428040'
THEN '1406' --STYRAX BENZOIN RESIN
WHEN ingredient_concept_code = '236340'
THEN '644634'
WHEN ingredient_concept_code = '11384'
THEN 'OMOP418532' --Yeasts
ELSE ingredient_concept_code
END,
box_size,
amount_value,
amount_unit,
numerator_value,
numerator_unit,
denominator_value,
denominator_unit
FROM (
SELECT c.concept_code AS drug_concept_code,
c2.concept_code AS ingredient_concept_code,
ds.box_size,
CASE
WHEN c3.concept_code = 'ug'
THEN amount_value / 1000
WHEN c3.concept_code = 'ukat'
THEN amount_value * 1000000
WHEN c3.concept_code = '[CCID_50]'
THEN amount_value * 0.7
WHEN c3.concept_code = '10*9'
THEN amount_value * 1000000000
WHEN c3.concept_code = '10*6'
THEN amount_value * 1000000
ELSE amount_value
END AS amount_value,
CASE
WHEN c3.concept_code = 'ug'
THEN 'mg'
WHEN c3.concept_code = 'ukat'
THEN '[U]'
WHEN c3.concept_code = '[CCID_50]'
THEN '[PFU]'
WHEN c3.concept_code IN (
'10*9',
'10*6'
)
THEN '{bacteria}'
ELSE c3.concept_code
END AS amount_unit,
CASE
WHEN c4.concept_code = 'ug'
THEN ds.numerator_value / 1000
WHEN c4.concept_code = '[CCID_50]'
THEN ds.numerator_value * 0.7
WHEN c4.concept_code = '10*9'
THEN ds.numerator_value * 1000000000
WHEN c4.concept_code = '10*6'
THEN ds.numerator_value * 1000000
ELSE ds.numerator_value
END AS numerator_value,
CASE
WHEN c4.concept_code = 'ug'
THEN 'mg'
WHEN c4.concept_code = '[CCID_50]'
THEN '[PFU]'
WHEN c4.concept_code IN (
'10*9',
'10*6'
)
THEN '{bacteria}'
ELSE c4.concept_code
END AS numerator_unit,
ds.denominator_value,
c5.concept_code AS denominator_unit
FROM concept c
JOIN drug_concept_stage dc ON dc.concept_code = c.concept_code
AND dc.concept_class_id = 'Drug Product'
JOIN drug_strength ds ON ds.drug_concept_id = c.concept_id
AND c.vocabulary_id LIKE 'RxNorm%'
AND c.invalid_reason IS NULL
JOIN concept c2 ON c2.concept_id = ds.ingredient_concept_id
AND (
c2.invalid_reason = 'D'
OR c2.invalid_reason IS NULL
)
LEFT JOIN concept c3 ON c3.concept_id = ds.amount_unit_concept_id
LEFT JOIN concept c4 ON c4.concept_id = ds.numerator_unit_concept_id
LEFT JOIN concept c5 ON c5.concept_id = ds.denominator_unit_concept_id
UNION ALL --add fresh concepts
SELECT c1.concept_code,
lf.concept_code,
ds.box_size,
amount_value,
c3.concept_code,
ds.numerator_value,
c4.concept_code,
ds.denominator_value,
c5.concept_code
FROM concept c1
JOIN drug_strength ds ON c1.concept_id = ds.drug_concept_id
AND c1.vocabulary_id = 'RxNorm Extension'
AND c1.invalid_reason IS NULL
JOIN (
WITH recursive hierarchy_concepts(ancestor_concept_id, descendant_concept_id, root_ancestor_concept_id, full_path, concept_code) AS (
SELECT ancestor_concept_id,
descendant_concept_id,
ancestor_concept_id AS root_ancestor_concept_id,
ARRAY [descendant_concept_id] AS full_path,
concept_code
FROM concepts
UNION ALL
SELECT c.ancestor_concept_id,
c.descendant_concept_id,
root_ancestor_concept_id,
hc.full_path || c.descendant_concept_id AS full_path,
c.concept_code
FROM concepts c
JOIN hierarchy_concepts hc ON hc.descendant_concept_id = c.ancestor_concept_id
WHERE c.descendant_concept_id <> ALL (full_path)
),
concepts AS (
SELECT r.concept_id_1 AS ancestor_concept_id,
r.concept_id_2 AS descendant_concept_id,
c2.concept_code
FROM concept_relationship r
JOIN concept c1 ON c1.concept_id = r.concept_id_1
AND c1.concept_class_id = 'Ingredient'
AND c1.vocabulary_id LIKE 'Rx%'
JOIN concept c2 ON c2.concept_id = r.concept_id_2
AND c2.concept_class_id = 'Ingredient'
AND c2.vocabulary_id LIKE 'Rx%'
WHERE r.relationship_id = 'Concept replaced by'
AND r.invalid_reason IS NULL
)
SELECT hc.root_ancestor_concept_id AS root_concept_id_1,
hc.concept_code
FROM hierarchy_concepts hc
WHERE NOT EXISTS (
/*same as oracle's CONNECT_BY_ISLEAF*/
SELECT 1
FROM hierarchy_concepts hc_int
WHERE hc_int.ancestor_concept_id = hc.descendant_concept_id
)
) lf ON lf.root_concept_id_1 = ds.ingredient_concept_id
LEFT JOIN concept c3 ON c3.concept_id = ds.amount_unit_concept_id
LEFT JOIN concept c4 ON c4.concept_id = ds.numerator_unit_concept_id
LEFT JOIN concept c5 ON c5.concept_id = ds.denominator_unit_concept_id
) AS s0
WHERE ingredient_concept_code != 'OMOP881482';
--8 Manually add absent units in drug_strength (due to source table issues)
UPDATE ds_stage
SET amount_unit = '[U]'
WHERE ingredient_concept_code = '560'
AND drug_concept_code IN (
'OMOP467711',
'OMOP467709',
'OMOP467706',
'OMOP467710',
'OMOP467715',
'OMOP467705',
'OMOP467712',
'OMOP467708',
'OMOP467714',
'OMOP467713'
);
UPDATE ds_stage
SET amount_value = 25,
amount_unit = 'mg',
numerator_value = NULL,
numerator_unit = NULL
WHERE drug_concept_code IN (
'OMOP420731',
'OMOP420834',
'OMOP420835',
'OMOP420833'
)
AND ingredient_concept_code = '2409';
UPDATE ds_stage
SET amount_value = 100,
amount_unit = 'mg',
numerator_value = NULL,
numerator_unit = NULL
WHERE drug_concept_code IN (
'OMOP420832',
'OMOP420835',
'OMOP420834',
'OMOP420833'
)
AND ingredient_concept_code = '1202';
--9 create consolidated denominator unit for drugs that have soluble and solid ingredients
-- in the same drug (if some drug-ingredient row row has amount, another - nominator)
UPDATE ds_stage ds
SET numerator_value = amount_value,
numerator_unit = amount_unit,
amount_unit = NULL,
amount_value = NULL,
denominator_unit = 'mL'
WHERE drug_concept_code IN (
SELECT drug_concept_code
FROM ds_stage a
JOIN ds_stage b USING (drug_concept_code)
WHERE a.amount_value IS NOT NULL
AND b.numerator_value IS NOT NULL
AND b.denominator_unit = 'mL'
)
AND amount_value IS NOT NULL;
UPDATE ds_stage ds
SET numerator_value = amount_value,
numerator_unit = amount_unit,
amount_unit = NULL,
amount_value = NULL,
denominator_unit = 'mg'
WHERE drug_concept_code IN (
SELECT drug_concept_code
FROM ds_stage a
JOIN ds_stage b USING (drug_concept_code)
WHERE a.amount_value IS NOT NULL
AND b.numerator_value IS NOT NULL
AND b.denominator_unit = 'mg'
)
AND amount_value IS NOT NULL;
--10 update different denominator units
UPDATE ds_stage ds
SET denominator_value = d.cx
FROM (
SELECT DISTINCT a.drug_concept_code,
substring(c.concept_name, '^(\d+(\.\d+)?)')::FLOAT AS cx -- choose denominator from the Name
FROM ds_stage a
JOIN ds_stage b ON b.drug_concept_code = a.drug_concept_code
JOIN concept_stage c ON c.concept_code = a.drug_concept_code
AND c.vocabulary_id = 'RxNorm Extension'
WHERE a.denominator_value != b.denominator_value
) d
WHERE d.drug_concept_code = ds.drug_concept_code;
--11 Fix solid forms with denominator
UPDATE ds_stage
SET amount_unit = numerator_unit,
amount_value = numerator_value,
numerator_value = NULL,
numerator_unit = NULL,
denominator_value = NULL,
denominator_unit = NULL
WHERE drug_concept_code IN (
SELECT a.concept_code
FROM concept a
JOIN drug_strength d ON concept_id = drug_concept_id
AND denominator_unit_concept_id IS NOT NULL
AND (
concept_name LIKE '%Tablet%'
OR concept_name LIKE '%Capsule%'
) -- solid forms defined by their forms
AND vocabulary_id = 'RxNorm Extension'
);
--12 Put percent into the numerator, not amount
UPDATE ds_stage
SET numerator_unit = amount_unit,
numerator_value = amount_value,
amount_value = NULL,
amount_unit = NULL
WHERE amount_unit = '%';
--13 Fixes of various ill-defined drugs violating with RxNorm editorial policies
UPDATE ds_stage
SET numerator_value = 25
WHERE drug_concept_code IN (
'OMOP303266',
'OMOP303267',
'OMOP303268'
);
UPDATE ds_stage
SET numerator_value = 1
WHERE drug_concept_code IN (
'OMOP317478',
'OMOP317479',
'OMOP317480'
);
UPDATE ds_stage
SET numerator_value = 10000,
denominator_unit = 'mL'
WHERE INGREDIENT_concept_code = '8536'
AND drug_concept_code IN (
'OMOP420658',
'OMOP420659',
'OMOP420660',
'OMOP420661'
);
--14 Change %/actuat into mg/mL
UPDATE ds_stage
SET numerator_value = numerator_value * 10,
numerator_unit = 'mg',
denominator_value = NULL,
denominator_unit = 'mL'
WHERE denominator_unit = '{actuat}'
AND numerator_unit = '%';
-- Manual fixes with strange % values
UPDATE ds_stage
SET numerator_value = 100,
denominator_value = NULL,
denominator_unit = NULL
WHERE numerator_unit = '%'
AND numerator_value IN (
0.000283,
0.1,
35.3
);
--15 Do all sorts of manual fixes
--15.1 Fentanyl buccal film
-- amount_value instead of numerator_value
UPDATE ds_stage
SET amount_value = numerator_value,
amount_unit = numerator_unit,
denominator_value = NULL,
denominator_unit = NULL,
numerator_unit = NULL,
numerator_value = NULL
WHERE drug_concept_code IN (
SELECT drug_concept_code
FROM ds_stage a
JOIN drug_concept_stage b ON a.drug_concept_code = b.concept_code
WHERE coalesce(a.amount_unit, a.numerator_unit) IN (
'cm',
'mm'
)
OR (
a.denominator_unit IN (
'cm',
'mm'
)
AND (
b.concept_name LIKE '%Buccal Film%'
OR b.concept_name LIKE '%Breakyl Start%'
OR a.numerator_value IN (
0.808,
1.21,
1.62
)
)
)
);
--15.2 Add denominator to trandermal patch
-- manualy defined dosages
UPDATE ds_stage
SET numerator_value = 0.012,
denominator_value = NULL,
denominator_unit = 'h',
amount_unit = NULL,
amount_value = NULL,
numerator_unit = 'mg'
WHERE drug_concept_code IN (
SELECT drug_concept_code
FROM ds_stage a
JOIN drug_concept_stage b ON a.drug_concept_code = b.concept_code
--also found like 0.4*5.25 cm=2.1 mg=0.012/h
WHERE b.concept_name LIKE '%Fentanyl%Transdermal%'
AND a.amount_value IN (
2.55,
2.1,
2.5,
0.4,
1.38
)
);
UPDATE ds_stage
SET numerator_value = 0.025,
denominator_value = NULL,
denominator_unit = 'h',
amount_unit = NULL,
amount_value = NULL,
numerator_unit = 'mg'
WHERE drug_concept_code IN (
SELECT drug_concept_code
FROM ds_stage a
JOIN drug_concept_stage b ON a.drug_concept_code = b.concept_code
WHERE b.concept_name LIKE '%Fentanyl%Transdermal%'
AND a.amount_value IN (
0.275,
2.75,
3.72,
4.2,
5.1,
0.6,
0.319,
0.25,
5,
4.8
)
);
UPDATE ds_stage
SET numerator_value = 0.05,
denominator_value = NULL,
denominator_unit = 'h',
amount_unit = NULL,
amount_value = NULL,
numerator_unit = 'mg'
WHERE drug_concept_code IN (
SELECT drug_concept_code
FROM ds_stage a
JOIN drug_concept_stage b ON a.drug_concept_code = b.concept_code
WHERE b.concept_name LIKE '%Fentanyl%Transdermal%'
AND a.amount_value IN (
5.5,
10.2,
7.5,
8.25,
8.4,
0.875,
9.6,
14.4,
15.5
)
);
UPDATE ds_stage
SET numerator_value = 0.075,
denominator_value = NULL,
denominator_unit = 'h',
amount_unit = NULL,
amount_value = NULL,
numerator_unit = 'mg'
WHERE drug_concept_code IN (
SELECT drug_concept_code
FROM ds_stage a
JOIN drug_concept_stage b ON a.drug_concept_code = b.concept_code
WHERE b.concept_name LIKE '%Fentanyl%Transdermal%'
AND a.amount_value IN (
12.6,
15.3,
12.4,
19.2,
23.1
)
);
UPDATE ds_stage
SET numerator_value = 0.1,
denominator_value = NULL,
denominator_unit = 'h',
amount_unit = NULL,
amount_value = NULL,
numerator_unit = 'mg'
WHERE drug_concept_code IN (
SELECT drug_concept_code
FROM ds_stage a
JOIN drug_concept_stage b ON a.drug_concept_code = b.concept_code
WHERE b.concept_name LIKE '%Fentanyl%Transdermal%'
AND a.amount_value IN (
16.8,
10,
11,
20.4,
16.5
)
);
--15.3 Fentanyl topical
UPDATE ds_stage
SET numerator_value = 0.012,
denominator_value = NULL,
denominator_unit = 'h'
WHERE drug_concept_code IN (
SELECT drug_concept_code
FROM ds_stage a
JOIN drug_concept_stage b ON a.drug_concept_code = b.concept_code
--also found like 0.4*5.25 cm=2.1 mg=0.012/h
WHERE coalesce(a.amount_unit, a.numerator_unit) IN (
'cm',
'mm'
)
OR (
a.denominator_unit IN (
'cm',
'mm'
)
AND b.concept_name LIKE '%Fentanyl%'
AND a.numerator_value IN (
2.55,
2.1,
2.5,
0.4
)
)
);
UPDATE ds_stage
SET numerator_value = 0.025,
denominator_value = NULL,
denominator_unit = 'h'
WHERE drug_concept_code IN (
SELECT drug_concept_code
FROM ds_stage a
JOIN drug_concept_stage b ON a.drug_concept_code = b.concept_code
WHERE coalesce(a.amount_unit, a.numerator_unit) IN (
'cm',
'mm'
)
OR (
a.denominator_unit IN (
'cm',
'mm'
)
AND b.concept_name LIKE '%Fentanyl%'
AND a.numerator_value IN (
0.275,
2.75,
3.72,
4.2,
5.1,
0.6,
0.319,
0.25,
5
)
)
);
UPDATE ds_stage
SET numerator_value = 0.05,
denominator_value = NULL,
denominator_unit = 'h'
WHERE drug_concept_code IN (
SELECT drug_concept_code
FROM ds_stage a
JOIN drug_concept_stage b ON a.drug_concept_code = b.concept_code
WHERE coalesce(a.amount_unit, a.numerator_unit) IN (
'cm',
'mm'
)
OR (
a.denominator_unit IN (
'cm',
'mm'
)
AND b.concept_name LIKE '%Fentanyl%'
AND a.numerator_value IN (
5.5,
10.2,
7.5,
8.25,
8.4,
0.875
)
)
);
UPDATE ds_stage
SET numerator_value = 0.075,
denominator_value = NULL,
denominator_unit = 'h'
WHERE drug_concept_code IN (
SELECT drug_concept_code
FROM ds_stage a
JOIN drug_concept_stage b ON a.drug_concept_code = b.concept_code
WHERE coalesce(a.amount_unit, a.numerator_unit) IN (
'cm',
'mm'
)
OR (
a.denominator_unit IN (
'cm',
'mm'
)
AND b.concept_name LIKE '%Fentanyl%'
AND a.numerator_value IN (
12.6,
15.3
)
)
);
UPDATE ds_stage
SET numerator_value = 0.1,
denominator_value = NULL,
denominator_unit = 'h'
WHERE drug_concept_code IN (
SELECT drug_concept_code
FROM ds_stage a
JOIN drug_concept_stage b ON a.drug_concept_code = b.concept_code
WHERE coalesce(a.amount_unit, a.numerator_unit) IN (
'cm',
'mm'
)
OR (
a.denominator_unit IN (
'cm',
'mm'
)
AND b.concept_name LIKE '%Fentanyl%'
AND a.numerator_value IN (
16.8,
10,
11,
20.4
)
)
);
--15.4 rivastigmine
UPDATE ds_stage
SET numerator_value = 13.3,
denominator_value = 24,
denominator_unit = 'h'
WHERE drug_concept_code IN (
SELECT drug_concept_code
FROM ds_stage a
JOIN drug_concept_stage b ON a.drug_concept_code = b.concept_code
WHERE coalesce(a.amount_unit, a.numerator_unit) IN (
'cm',
'mm'
)
OR (
a.denominator_unit IN (
'cm',
'mm'
)
AND b.concept_name LIKE '%rivastigmine%'
AND a.numerator_value = 27
)
);
UPDATE ds_stage
SET numerator_value = CASE
WHEN denominator_value IS NULL
THEN numerator_value * 24
ELSE numerator_value / denominator_value * 24
END,
denominator_value = 24,
denominator_unit = 'h'
WHERE drug_concept_code IN (
SELECT drug_concept_code
FROM ds_stage a
JOIN drug_concept_stage b ON a.drug_concept_code = b.concept_code
WHERE coalesce(amount_unit, numerator_unit) IN (
'cm',
'mm'
)
OR (
denominator_unit IN (
'cm',
'mm'
)
AND b.concept_name LIKE '%rivastigmine%'
)
);
--15.5 nicotine
UPDATE ds_stage
SET numerator_value = CASE
WHEN denominator_value IS NULL
THEN numerator_value * 16
ELSE numerator_value / denominator_value * 16
END,
denominator_value = 16,
denominator_unit = 'h'
WHERE drug_concept_code IN (
SELECT drug_concept_code
FROM ds_stage a
JOIN drug_concept_stage b ON a.drug_concept_code = b.concept_code
WHERE coalesce(a.amount_unit, a.numerator_unit) IN (
'cm',
'mm'
)
OR (
a.denominator_unit IN (
'cm',
'mm'
)
AND b.concept_name LIKE '%Nicotine%'
AND numerator_value IN (
0.625,
0.938,
1.56,
35.2
)
)
);
UPDATE ds_stage
SET numerator_value = 14,
denominator_value = 24,
denominator_unit = 'h'
WHERE drug_concept_code IN (
SELECT drug_concept_code
FROM ds_stage a
JOIN drug_concept_stage b ON a.drug_concept_code = b.concept_code
WHERE coalesce(a.amount_unit, a.numerator_unit) IN (
'cm',
'mm'
)
OR (
a.denominator_unit IN (
'cm',
'mm'
)
AND b.concept_name LIKE '%Nicotine%'
AND a.numerator_value IN (
5.57,
5.14,
36,
78
)
)
);
--15.6 Povidone-Iodine
UPDATE ds_stage
SET numerator_value = 100,
denominator_value = NULL,
denominator_unit = 'mL'
WHERE drug_concept_code IN (
SELECT drug_concept_code
FROM ds_stage a
JOIN drug_concept_stage b ON a.drug_concept_code = b.concept_code
WHERE coalesce(a.amount_unit, a.numerator_unit) IN (
'cm',
'mm'
)
OR (
a.denominator_unit IN (
'cm',
'mm'
)
AND b.concept_name LIKE '%Povidone-Iodine%'
)
);
UPDATE ds_stage
SET numerator_value = 1.4,
numerator_unit = 'mg',
denominator_value = NULL
WHERE drug_concept_code IN (
SELECT drug_concept_code
FROM ds_stage a
JOIN drug_concept_stage b ON a.drug_concept_code = b.concept_code
WHERE (
(
a.numerator_value IS NOT NULL
AND a.numerator_unit IS NULL
)
OR (
a.denominator_value IS NOT NULL
AND a.denominator_unit IS NULL
)
OR (
a.amount_value IS NOT NULL
AND a.amount_unit IS NULL
)
)
AND b.concept_name LIKE '%Aprotinin 10000 /ML%'
);
--15.7 update wrong dosages in Varicella Virus Vaccine
UPDATE ds_stage
SET numerator_unit = '[U]',
numerator_value = 29800
WHERE drug_concept_code IN (
SELECT drug_concept_code
FROM ds_stage a
JOIN drug_concept_stage ds ON a.drug_concept_code = ds.concept_code
WHERE ds.concept_name LIKE '%Varicella Virus Vaccine Live (Oka-Merck) strain 29800 /ML%'
);
--15.8 update wrong dosages in alpha-amylase
UPDATE ds_stage
SET numerator_unit = '[U]'
WHERE drug_concept_code IN (
SELECT drug_concept_code
FROM ds_stage a
JOIN drug_concept_stage ds ON a.drug_concept_code = ds.concept_code
WHERE (
(
a.numerator_value IS NOT NULL
AND a.numerator_unit IS NULL
)
OR (
a.denominator_value IS NOT NULL
AND a.denominator_unit IS NULL
)
OR (
a.amount_value IS NOT NULL
AND a.amount_unit IS NULL
)
)
AND ds.concept_name LIKE '%alpha-amylase 200 /ML%'
);
--15.9 delete drugs that are missing units. delete drugs from DCS to remove them totally
DELETE
FROM drug_concept_stage
WHERE concept_code IN (
SELECT drug_concept_code
FROM ds_stage
WHERE (
numerator_value IS NOT NULL
AND numerator_unit IS NULL
)
OR (
denominator_value IS NOT NULL
AND denominator_unit IS NULL
)
OR (
amount_value IS NOT NULL
AND amount_unit IS NULL
)
);
--15.10 delete drugs that are missing units
DELETE
FROM ds_stage
WHERE (
numerator_value IS NOT NULL
AND numerator_unit IS NULL
)
OR (
denominator_value IS NOT NULL
AND denominator_unit IS NULL
)
OR (
amount_value IS NOT NULL
AND amount_unit IS NULL
);
--15.11 working on drugs that presented in way of mL/mL
UPDATE ds_stage
SET numerator_unit = 'mg'
WHERE drug_concept_code IN (
SELECT drug_concept_code
FROM ds_stage
JOIN drug_concept_stage ON drug_concept_code = concept_code
AND concept_name LIKE '%Paclitaxel%'
AND numerator_unit = 'mL'
AND denominator_unit = 'mL'
);
UPDATE ds_stage
SET numerator_unit = 'mg',
numerator_value = CASE
WHEN denominator_value IS NOT NULL
THEN denominator_value * 1000
ELSE 1
END
WHERE drug_concept_code IN (
SELECT drug_concept_code
FROM ds_stage
JOIN drug_concept_stage ON drug_concept_code = concept_code
AND concept_name LIKE '%Water%'
AND numerator_unit = 'mL'
AND denominator_unit = 'mL'
);
--15.12 cromolyn Inhalation powder change to 5mg/actuat
UPDATE ds_stage
SET numerator_value = amount_value,
numerator_unit = amount_unit,
denominator_unit = '{actuat}',
amount_value = NULL,
amount_unit = NULL
WHERE drug_concept_code IN (
'OMOP391197',
'OMOP391198',
'OMOP391199'
);
--15.13 update all the gases
UPDATE ds_stage
SET numerator_unit = '%',
numerator_value = '95',
denominator_unit = NULL,
denominator_value = NULL
WHERE drug_concept_code IN (
SELECT concept_code
FROM drug_concept_stage
JOIN ds_stage ON concept_code = drug_concept_code
WHERE concept_name ~ 'Oxygen\s((950 MG/ML)|(0.95 MG/MG)|(950 MG/MG)|(950000 MG/ML)|(950000000 MG/ML))'
)
AND ingredient_concept_code = '7806'
AND numerator_unit != '%';
UPDATE ds_stage
SET numerator_unit = '%',
numerator_value = '5',
denominator_unit = NULL,
denominator_value = NULL
WHERE drug_concept_code IN (
SELECT concept_code
FROM drug_concept_stage
JOIN ds_stage ON concept_code = drug_concept_code
WHERE concept_name ~ 'Carbon Dioxide\s((50 MG/)|(0.05 MG/MG)|(50000 MG/ML)|(50000000 MG/ML))'
)
AND ingredient_concept_code = '2034'
AND numerator_unit != '%';
UPDATE ds_stage
SET numerator_unit = '%',
numerator_value = '50',
denominator_unit = NULL,
denominator_value = NULL
WHERE drug_concept_code IN (
SELECT concept_code
FROM drug_concept_stage
JOIN ds_stage ON concept_code = drug_concept_code
WHERE concept_name ~ '(Nitrous Oxide|Oxygen|Carbon Dioxide)\s((500 MG/.*ML)|(500000000 MG/.*ML)|(270 MG/.*ML)|(500000 MG/ML)|(500 MG/MG)|(0.00025 ML/ML))'
AND numerator_unit != '%'
);
UPDATE ds_stage
SET numerator_unit = '%',
numerator_value = '79',
denominator_unit = NULL,
denominator_value = NULL
WHERE drug_concept_code IN (
SELECT concept_code
FROM drug_concept_stage
JOIN ds_stage ON concept_code = drug_concept_code
WHERE concept_name LIKE '%Helium%79%MG/%'
)
AND ingredient_concept_code = '5140'
AND numerator_unit != '%';
UPDATE ds_stage
SET numerator_unit = '%',
numerator_value = '21',
denominator_unit = NULL,
denominator_value = NULL
WHERE drug_concept_code IN (
SELECT concept_code
FROM drug_concept_stage
JOIN ds_stage ON concept_code = drug_concept_code
WHERE concept_name LIKE '%Oxygen%21%MG/%'
)
AND ingredient_concept_code = '7806'
AND numerator_unit != '%';
UPDATE ds_stage
SET numerator_unit = '%',
numerator_value = CASE
WHEN numerator_unit = 'mg'
AND denominator_unit = 'mL'
THEN numerator_value / coalesce(denominator_value, 1) * 0.1
WHEN numerator_value / coalesce(denominator_value, 1) < 0.09
THEN numerator_value / coalesce(denominator_value, 1) * 1000
ELSE numerator_value / coalesce(denominator_value, 1) * 100
END,
denominator_unit = NULL,
denominator_value = NULL
WHERE drug_concept_code IN (
SELECT concept_code
FROM drug_concept_stage
JOIN ds_stage ON concept_code = drug_concept_code
WHERE concept_name ~ '((Nitrous Oxide)|(Xenon)|(Isoflurane)|(Oxygen)) (\d+\.)?(\d+\s((MG/MG)|(ML/ML)))'
AND numerator_unit != '%'
);
--15.14 aprotinin
UPDATE ds_stage
SET numerator_unit = '[U]'
WHERE ingredient_concept_code = '1056'
AND numerator_unit IS NULL
AND numerator_value IS NOT NULL;
--15.5 zinc and calcium c/ml
UPDATE ds_stage
SET numerator_unit = 'mmol'
WHERE ingredient_concept_code = '1901'
AND numerator_unit = '[hp_C]';
UPDATE ds_stage
SET numerator_unit = 'mg',
numerator_value = numerator_value / 10
WHERE ingredient_concept_code = '39954'
AND numerator_unit = '[hp_C]';
--16 Delete 3 legged dogs
DELETE
FROM ds_stage
WHERE drug_concept_code IN (
WITH a AS (
SELECT drug_concept_id,
COUNT(drug_concept_id) AS cnt1
FROM drug_strength
GROUP BY drug_concept_id
),
b AS (
SELECT descendant_concept_id,
COUNT(descendant_concept_id) AS cnt2
FROM concept_ancestor a
JOIN concept b ON ancestor_concept_id = b.concept_id
AND concept_class_id = 'Ingredient'
AND b.vocabulary_id LIKE 'RxNorm%'
JOIN concept b2 ON descendant_concept_id = b2.concept_id
AND b2.concept_class_id NOT LIKE '%Comp%'
AND b2.concept_name LIKE '% / %'
GROUP BY descendant_concept_id
)
SELECT concept_code
FROM a
JOIN b ON a.drug_concept_id = b.descendant_concept_id
JOIN concept c ON drug_concept_id = concept_id
WHERE cnt1 < cnt2
AND cnt1 = (
SELECT length(c.concept_name) - coalesce(length(replace(c.concept_name, ' / ', '')), 0)
) --emulating regexp_count
AND c.vocabulary_id != 'RxNorm'
);
--17 Remove those with less than 0.05 ml in denominator. Delete those drugs from DCS to remove them totally
DELETE
FROM drug_concept_stage
WHERE concept_code IN (
SELECT drug_concept_code
FROM ds_stage
WHERE denominator_value < 0.05
AND denominator_unit = 'mL'
);
--17.1 Remove those with less than 0.05 ml in denominator
DELETE
FROM ds_stage
WHERE drug_concept_code IN (
SELECT drug_concept_code
FROM ds_stage
WHERE denominator_value < 0.05
AND denominator_unit = 'mL'
);
--18 Fix all the enormous dosages that we can
UPDATE ds_stage
SET numerator_value = '100'
WHERE drug_concept_code IN (
SELECT concept_code
FROM drug_concept_stage
WHERE concept_name LIKE '%Hydrocortisone 140%'
);
UPDATE ds_stage
SET numerator_value = '20'
WHERE drug_concept_code IN (
SELECT concept_code
FROM drug_concept_stage
WHERE concept_name LIKE '%Benzocaine 120 %'
);
UPDATE ds_stage
SET numerator_value = numerator_value / 10
WHERE drug_concept_code IN (
SELECT concept_code
FROM ds_stage a
JOIN drug_concept_stage ds ON a.drug_concept_code = ds.concept_code
WHERE concept_name LIKE '%Albumin Human, USP%'
AND numerator_value / coalesce(denominator_value, 1) > 1000
);
UPDATE ds_stage
SET numerator_value = numerator_value / 1000000
WHERE drug_concept_code IN (
SELECT concept_code
FROM ds_stage a
JOIN drug_concept_stage ds ON a.drug_concept_code = ds.concept_code
WHERE concept_name ~ 'Glucose (100000000|200000000|40000000|50000000)|Gelatin 40000000|Bupivacaine|Fentanyl|sodium citrate|(Glucose 50000000 MG/ML Injectable Solution)|(Glucose 50000000 MG/ML / Potassium Chloride 1500000 MG/ML)|Potassium Cloride (75000000|4500000|30000000|2000000|1500000)|Sodium|Peracetic acid'
AND numerator_value / coalesce(denominator_value, 1) > 10000
);
UPDATE ds_stage
SET numerator_value = numerator_value / 100000
WHERE drug_concept_code IN (
SELECT concept_code
FROM ds_stage a
JOIN drug_concept_stage ds ON a.drug_concept_code = ds.concept_code
WHERE concept_name ~ '(Morphine (1000000|2000000))|Sorbitol|Mannitol'
AND numerator_value / coalesce(denominator_value, 1) > 1000
);
UPDATE ds_stage
SET denominator_unit = 'mL'
WHERE drug_concept_code IN (
SELECT drug_concept_code
FROM ds_stage
JOIN drug_concept_stage ON drug_concept_code = concept_code
WHERE numerator_unit = 'mg'
AND denominator_unit = 'mg'
AND numerator_value / coalesce(denominator_value, 1) > 1
);
--19 Delete drugs with cm in denominator that we weren't able to fix
DELETE
FROM ds_stage
WHERE drug_concept_code IN (
SELECT drug_concept_code
FROM ds_stage a
JOIN drug_concept_stage b ON a.drug_concept_code = b.concept_code
WHERE coalesce(amount_unit, numerator_unit) IN (
'cm',
'mm'
)
OR denominator_unit IN (
'cm',
'mm'
)
);
--20 Delete combination drugs where denominators don't match
DELETE
FROM ds_stage
WHERE (
drug_concept_code,
denominator_value
) IN (
SELECT a.drug_concept_code,
a.denominator_value
FROM ds_stage a
JOIN ds_stage b ON a.drug_concept_code = b.drug_concept_code
AND (
a.denominator_value IS NULL
AND b.denominator_value IS NOT NULL
OR a.denominator_value != b.denominator_value
OR a.denominator_unit != b.denominator_unit
)
JOIN drug_concept_stage ds ON ds.concept_code = a.drug_concept_code
AND a.denominator_value != substring(ds.concept_name, '(\d+(\.\d+)?)')::FLOAT
);
--20.1 move homeopathy to numerator
UPDATE ds_stage
SET numerator_value = amount_value,
numerator_unit = amount_unit,
amount_value = NULL,
amount_unit = NULL
WHERE drug_concept_code IN (
SELECT drug_concept_code
FROM ds_stage
WHERE amount_unit IN (
'[hp_C]',
'[hp_X]'
)
);
--21 Delete impossible dosages. Delete those drugs from DCS to remove them totally
DELETE
FROM drug_concept_stage
WHERE concept_code IN (
SELECT drug_concept_code
FROM ds_stage
WHERE (
(
(
LOWER(numerator_unit) = 'mg'
AND LOWER(denominator_unit) IN (
'ml',
'g'
)
)
OR (
LOWER(numerator_unit) = 'g'
AND LOWER(denominator_unit) = 'l'
)
)
AND numerator_value / coalesce(denominator_value, 1) > 1000
)
OR (
LOWER(numerator_unit) = 'g'
AND LOWER(denominator_unit) = 'ml'
AND numerator_value / coalesce(denominator_value, 1) > 1
)
OR (
LOWER(numerator_unit) = 'mg'
AND LOWER(denominator_unit) = 'mg'
AND numerator_value / coalesce(denominator_value, 1) > 1
)
OR (
(
amount_unit = '%'
AND amount_value > 100
)
OR (
numerator_unit = '%'
AND numerator_value > 100
)
)
OR (
numerator_unit = '%'
AND denominator_unit IS NOT NULL
)
);
--21.1 Delete impossible dosages
DELETE
FROM ds_stage
WHERE drug_concept_code IN (
SELECT drug_concept_code
FROM ds_stage
WHERE (
(
(
LOWER(numerator_unit) = 'mg'
AND LOWER(denominator_unit) IN (
'ml',
'g'
)
)
OR (
LOWER(numerator_unit) = 'g'
AND LOWER(denominator_unit) = 'l'
)
)
AND numerator_value / coalesce(denominator_value, 1) > 1000
)
OR (
LOWER(numerator_unit) = 'g'
AND LOWER(denominator_unit) = 'ml'
AND numerator_value / coalesce(denominator_value, 1) > 1
)
OR (
LOWER(numerator_unit) = 'mg'
AND LOWER(denominator_unit) = 'mg'
AND numerator_value / coalesce(denominator_value, 1) > 1
)
OR (
(
amount_unit = '%'
AND amount_value > 100
)
OR (
numerator_unit = '%'
AND numerator_value > 100
)
)
OR (
numerator_unit = '%'
AND denominator_unit IS NOT NULL
)
);
UPDATE ds_stage
SET amount_unit = NULL
WHERE amount_unit IS NOT NULL
AND amount_value IS NULL;
UPDATE ds_stage
SET numerator_unit = NULL
WHERE numerator_unit IS NOT NULL
AND numerator_value IS NULL;
DELETE
FROM ds_stage
WHERE amount_unit IS NULL
AND numerator_unit IS NULL
AND denominator_unit IS NULL;
TRUNCATE TABLE internal_relationship_stage;
--22 Build internal_relationship_stage
--Drug to form
INSERT INTO internal_relationship_stage
SELECT DISTINCT dc.concept_code,
CASE
WHEN c2.concept_code = 'OMOP881524'
THEN '316975' --Rectal Creame and Rectal Cream
WHEN c2.concept_code = '1021221'
THEN '316999' --Gas and Gas for Inhalation
ELSE c2.concept_code
END AS concept_code_2
FROM drug_concept_stage dc
JOIN concept c ON c.concept_code = dc.concept_code
AND c.vocabulary_id LIKE 'RxNorm%'
AND dc.concept_class_id = 'Drug Product'
JOIN concept_relationship cr ON cr.concept_id_1 = c.concept_id
AND cr.relationship_id = 'RxNorm has dose form'
AND cr.invalid_reason IS NULL
JOIN concept c2 ON c2.concept_id = cr.concept_id_2
AND c2.concept_class_id = 'Dose Form'
AND c2.vocabulary_id LIKE 'Rx%'
AND c2.invalid_reason IS NULL;
--where c.concept_name ~ c2.concept_name --Problem with Transdermal patch/system
--Drug to BN
CREATE INDEX idx_irs_cc ON internal_relationship_stage (
concept_code_1,
concept_code_2
);
ANALYZE internal_relationship_stage;
INSERT INTO internal_relationship_stage
SELECT DISTINCT dc.concept_code,
c2.concept_code
FROM drug_concept_stage dc
JOIN concept c ON c.concept_code = dc.concept_code
AND c.vocabulary_id LIKE 'RxNorm%'
JOIN concept_relationship cr ON cr.concept_id_1 = c.concept_id
AND cr.relationship_id = 'Has brand name'
AND cr.invalid_reason IS NULL
JOIN concept c2 ON concept_id_2 = c2.concept_id
AND c2.concept_class_id = 'Brand Name'
AND c2.vocabulary_id LIKE 'Rx%'
AND c.concept_name ILIKE '%' || c2.concept_name || '%'
AND c2.invalid_reason IS NULL
WHERE dc.concept_class_id = 'Drug Product'
AND (
dc.source_concept_class_id NOT LIKE '%Pack%'
OR (
dc.source_concept_class_id = 'Marketed Product'
AND dc.concept_name NOT LIKE '%Pack%'
)
)
AND NOT EXISTS (
SELECT 1
FROM internal_relationship_stage irs_int
WHERE irs_int.concept_code_1 = dc.concept_code
AND irs_int.concept_code_2 = c2.concept_code
);
ANALYZE internal_relationship_stage;
--Packs to BN
INSERT INTO internal_relationship_stage
SELECT DISTINCT l.concept_code_1,
l.concept_code_2
FROM (
WITH t AS (
SELECT dc.concept_code AS concept_code_1,
c2.concept_code AS concept_code_2,
c2.concept_name AS concept_name_2,
c.concept_name AS concept_name_1
FROM drug_concept_stage dc
JOIN concept c ON c.concept_code = dc.concept_code
AND c.vocabulary_id = 'RxNorm Extension'
AND dc.concept_class_id = 'Drug Product'
AND dc.concept_name LIKE '%Pack%[%]%'
JOIN concept_relationship cr ON c.concept_id = concept_id_1
AND cr.relationship_id = 'Has brand name'
AND cr.invalid_reason IS NULL
JOIN concept c2 ON concept_id_2 = c2.concept_id
AND c2.concept_class_id = 'Brand Name'
AND c2.vocabulary_id LIKE 'Rx%'
AND c2.invalid_reason IS NULL
)
SELECT concept_code_1,
concept_code_2
FROM t
WHERE concept_name_2 = REGEXP_REPLACE(concept_name_1, '.* Pack .*\[(.*)\]', '\1')
) l
WHERE NOT EXISTS (
SELECT 1
FROM internal_relationship_stage irs_int
WHERE irs_int.concept_code_1 = l.concept_code_1
AND irs_int.concept_code_2 = l.concept_code_2
);
--drug to ingredient
INSERT INTO internal_relationship_stage
SELECT DISTINCT ds.drug_concept_code,
ds.ingredient_concept_code
FROM ds_stage ds
WHERE NOT EXISTS (
SELECT 1
FROM internal_relationship_stage irs_int
WHERE irs_int.concept_code_1 = ds.drug_concept_code
AND irs_int.concept_code_2 = ds.ingredient_concept_code
);
ANALYZE internal_relationship_stage;
--Drug Form to ingredient
CREATE INDEX idx_dcs_cc ON drug_concept_stage (concept_code);
ANALYZE drug_concept_stage;
INSERT INTO internal_relationship_stage
SELECT DISTINCT c.concept_code,
CASE
WHEN c2.concept_code = '11384'
THEN 'OMOP418532' --Yeasts
ELSE c2.concept_code
END
FROM concept c
JOIN drug_concept_stage dc ON dc.concept_code = c.concept_code
AND c.vocabulary_id LIKE 'RxNorm%'
AND c.invalid_reason IS NULL
JOIN concept_relationship cr ON cr.concept_id_1 = c.concept_id
AND cr.relationship_id = 'RxNorm has ing'
AND cr.invalid_reason IS NULL
JOIN concept c2 ON c2.concept_id = cr.concept_id_2
AND c2.concept_class_id = 'Ingredient'
AND c2.invalid_reason IS NULL
WHERE c.concept_class_id IN (
'Clinical Drug Form',
'Branded Drug Form'
)
AND NOT EXISTS (
SELECT 1
FROM internal_relationship_stage irs_int
JOIN drug_concept_stage dcs ON dcs.concept_code = irs_int.concept_code_2
WHERE irs_int.concept_code_1 = c.concept_code
AND dcs.concept_class_id = 'Ingredient'
)
AND c2.concept_code NOT IN (
'1371041',
'OMOP881482'
);
INSERT INTO internal_relationship_stage (
concept_code_1,
concept_code_2
)
SELECT DISTINCT dc.concept_code,
CASE
WHEN ds.ingredient_concept_code = '11384'
THEN 'OMOP418532'
ELSE ds.ingredient_concept_code
END
FROM concept c
JOIN drug_concept_stage dc ON dc.concept_code = c.concept_code
AND c.vocabulary_id LIKE 'RxNorm%'
AND c.invalid_reason IS NULL
AND c.concept_class_id IN (
'Clinical Drug Form',
'Branded Drug Form'
)
JOIN concept_relationship cr ON concept_id_1 = c.concept_id
AND cr.invalid_reason IS NULL
JOIN concept c2 ON c2.concept_id = concept_id_2
AND c.vocabulary_id LIKE 'RxNorm%'
AND c2.invalid_reason IS NULL
JOIN ds_stage ds ON c2.concept_code = drug_concept_code
WHERE NOT EXISTS (
SELECT 1
FROM internal_relationship_stage irs_int
JOIN drug_concept_stage dcs ON dcs.concept_code = irs_int.concept_code_2
WHERE irs_int.concept_code_1 = dc.concept_code
AND dcs.concept_class_id = 'Ingredient'
)
AND ds.ingredient_concept_code NOT IN (
'1371041',
'OMOP881482'
);
ANALYZE internal_relationship_stage;
--add all kinds of missing ingredients
DROP TABLE IF EXISTS ing_temp;
CREATE TABLE ing_temp AS
SELECT DISTINCT c.concept_code AS concept_code_1,
c.concept_name AS concept_name_1,
c.concept_class_id AS cci1,
cr2.relationship_id,
c2.concept_code,
c2.concept_name,
c2.concept_class_id
FROM concept c
JOIN drug_concept_stage dc ON dc.concept_code = c.concept_code
AND c.vocabulary_id LIKE 'RxNorm%'
AND c.invalid_reason IS NULL
AND dc.concept_class_id = 'Drug Product'
AND dc.source_concept_class_id NOT LIKE '%Pack%'
AND dc.concept_name NOT LIKE '%Pack%'
JOIN concept_relationship cr ON cr.concept_id_1 = c.concept_id
AND cr.invalid_reason IS NULL
JOIN concept_relationship cr2 ON cr2.concept_id_1 = cr.concept_id_2
AND cr2.invalid_reason IS NULL
AND cr2.relationship_id IN (
'Brand name of',
'RxNorm has ing'
)
JOIN concept c2 ON c2.concept_id = cr2.concept_id_2
AND c2.concept_class_id = 'Ingredient'
AND c2.invalid_reason IS NULL
WHERE NOT EXISTS (
SELECT 1
FROM internal_relationship_stage irs_int
JOIN drug_concept_stage dcs ON dcs.concept_code = irs_int.concept_code_2
WHERE irs_int.concept_code_1 = c.concept_code
AND dcs.concept_class_id = 'Ingredient'
)
AND c.concept_name ilike '%' || c2.concept_name || '%'
AND c2.concept_code NOT IN (
'1371041',
'OMOP881482'
);
--ing_temp_2
DROP TABLE IF EXISTS ing_temp_2;
CREATE TABLE ing_temp_2 AS
SELECT c.concept_code_1,
c.concept_code
FROM (
SELECT concept_code_1,
concept_code
--Aspirin / Aspirin / Caffeine Oral Tablet [Mipyrin]
FROM ing_temp
WHERE concept_code_1 IN (
SELECT i.concept_code_1
FROM ing_temp i
JOIN (
SELECT COUNT(concept_code) OVER (PARTITION BY concept_code_1) AS cnt,
concept_code_1
FROM (
SELECT DISTINCT concept_code_1,
concept_name_1,
concept_code,
concept_name
FROM ing_temp
) AS s0
ORDER BY concept_code
) a ON i.concept_code_1 = a.concept_code_1
AND (
SELECT length(concept_name_1) - coalesce(length(replace(concept_name_1, ' / ', '')), 0)
) + 1 != a.cnt
AND (
concept_name_1 LIKE '%...%'
OR REGEXP_REPLACE(substring(concept_name_1, '( / \w+(\s\w+)?)'), ' / ', '', 'g') iLIKE '%' || concept_name || '%'
AND substring(concept_name_1, '(\w+(\s\w+)?)') iLIKE '%' || concept_name || '%'
)
)
UNION
SELECT i.concept_code_1,
concept_code
FROM ing_temp i
JOIN (
SELECT COUNT(concept_code) OVER (PARTITION BY concept_code_1) AS cnt,
concept_code_1
FROM (
SELECT DISTINCT concept_code_1,
concept_name_1,
concept_code,
concept_name
FROM ing_temp
) AS s1
ORDER BY concept_code
) a ON i.concept_code_1 = a.concept_code_1
WHERE (
SELECT length(concept_name_1) - coalesce(length(replace(concept_name_1, ' / ', '')), 0)
) + 1 = a.cnt
) c
WHERE NOT EXISTS (
SELECT 1
FROM internal_relationship_stage irs_int
JOIN drug_concept_stage dcs ON dcs.concept_code = irs_int.concept_code_2
WHERE irs_int.concept_code_1 = c.concept_code_1
AND dcs.concept_class_id = 'Ingredient'
);
INSERT INTO internal_relationship_stage (
concept_code_1,
concept_code_2
)
SELECT concept_code_1,
concept_code
FROM ing_temp_2;
INSERT INTO internal_relationship_stage (
concept_code_1,
concept_code_2
)
SELECT DISTINCT dc.concept_code,
CASE
WHEN c2.concept_code = '11384'
THEN 'OMOP418532'
ELSE c2.concept_code
END
FROM drug_concept_stage dc
JOIN concept c ON dc.concept_code = c.concept_code
AND c.vocabulary_id LIKE 'RxNorm%'
AND c.invalid_reason IS NULL
AND dc.concept_class_id = 'Drug Product'
AND dc.source_concept_class_id NOT LIKE '%Pack%'
AND dc.concept_name NOT LIKE '%Pack%'
JOIN concept_ancestor ca ON descendant_concept_id = c.concept_id
JOIN concept c2 ON ancestor_concept_id = c2.concept_id
AND c2.concept_class_id = 'Ingredient'
WHERE NOT EXISTS (
SELECT 1
FROM internal_relationship_stage irs_int
JOIN drug_concept_stage dcs ON dcs.concept_code = irs_int.concept_code_2
WHERE irs_int.concept_code_1 = dc.concept_code
AND dcs.concept_class_id = 'Ingredient'
)
AND c.concept_name iLIKE '%' || c2.concept_name || '%'
AND c2.concept_code NOT IN (
'1371041',
'OMOP881482'
);
--Drug to supplier
INSERT INTO internal_relationship_stage
SELECT DISTINCT dc.concept_code,
c2.concept_code
FROM drug_concept_stage dc
JOIN concept c ON c.concept_code = dc.concept_code
AND c.vocabulary_id = 'RxNorm Extension'
JOIN concept_relationship cr ON cr.concept_id_1 = c.concept_id
AND cr.invalid_reason IS NULL
JOIN concept c2 ON concept_id_2 = c2.concept_id
AND c2.concept_class_id = 'Supplier'
AND c2.vocabulary_id LIKE 'Rx%'
AND c2.invalid_reason IS NULL
WHERE dc.concept_class_id = 'Drug Product'
AND NOT EXISTS (
SELECT 1
FROM internal_relationship_stage irs_int
WHERE irs_int.concept_code_1 = dc.concept_code
AND irs_int.concept_code_2 = c2.concept_code
);
ANALYZE internal_relationship_stage;
--insert relationships to those packs that do not have Pack's BN
INSERT INTO internal_relationship_stage
SELECT DISTINCT c.concept_code,
c3.concept_code
FROM concept c
LEFT JOIN concept_relationship cr ON cr.concept_id_1 = c.concept_id
AND cr.relationship_id = 'Has brand name'
AND cr.invalid_reason IS NULL
LEFT JOIN concept c2 ON c2.concept_id = cr.concept_id_2
AND c2.concept_class_id = 'Brand Name'
-- take it from name
LEFT JOIN concept c3 ON c3.concept_name = REGEXP_REPLACE(c.concept_name, '.* Pack .*\[(.*)\]', '\1')
AND c3.vocabulary_id LIKE 'RxNorm%'
AND c3.concept_class_id = 'Brand Name'
AND c3.invalid_reason IS NULL
WHERE c.vocabulary_id = 'RxNorm Extension'
AND c.concept_class_id LIKE '%Branded%Pack%'
AND c2.concept_id IS NULL
AND NOT EXISTS (
SELECT 1
FROM internal_relationship_stage irs_int
WHERE irs_int.concept_code_1 = c.concept_code
AND irs_int.concept_code_2 = c3.concept_code
);
--add fresh concepts
INSERT INTO internal_relationship_stage
/*
we need DISTINCT because some concepts theoretically might have one replacement concept
e.g.
A some_relatonship_1 B
A some_relatonship_2 C
but B and C have 'Concept replaced by' on D
result: two rows A - D
*/
SELECT DISTINCT c1.concept_code,
lf.concept_code
FROM concept c1
JOIN concept_relationship cr ON c1.concept_id = cr.concept_id_1
AND c1.vocabulary_id = 'RxNorm Extension'
AND c1.invalid_reason IS NULL
AND cr.relationship_id NOT IN (
'Concept replaced by',
'Concept replaces'
)
JOIN (
WITH recursive hierarchy_concepts(ancestor_concept_id, descendant_concept_id, root_ancestor_concept_id, full_path, concept_code) AS (
SELECT ancestor_concept_id,
descendant_concept_id,
ancestor_concept_id AS root_ancestor_concept_id,
ARRAY [descendant_concept_id] AS full_path,
concept_code
FROM concepts
UNION ALL
SELECT c.ancestor_concept_id,
c.descendant_concept_id,
root_ancestor_concept_id,
hc.full_path || c.descendant_concept_id AS full_path,
c.concept_code
FROM concepts c
JOIN hierarchy_concepts hc ON hc.descendant_concept_id = c.ancestor_concept_id
WHERE c.descendant_concept_id <> ALL (full_path)
),
concepts AS (
SELECT r.concept_id_1 AS ancestor_concept_id,
r.concept_id_2 AS descendant_concept_id,
c2.concept_code
FROM concept_relationship r
JOIN concept c1 ON c1.concept_id = r.concept_id_1
AND c1.concept_class_id IN (
'Dose Form',
'Brand Name',
'Supplier',
'Ingredient'
)
AND c1.vocabulary_id LIKE 'Rx%'
JOIN concept c2 ON c2.concept_id = r.concept_id_2
AND c2.concept_class_id IN (
'Dose Form',
'Brand Name',
'Supplier',
'Ingredient'
)
AND c2.vocabulary_id LIKE 'Rx%'
WHERE r.relationship_id = 'Concept replaced by'
AND r.invalid_reason IS NULL
)
SELECT hc.root_ancestor_concept_id AS root_concept_id_1,
hc.descendant_concept_id AS concept_id_2,
hc.concept_code
FROM hierarchy_concepts hc
WHERE NOT EXISTS (
/*same as oracle's CONNECT_BY_ISLEAF*/
SELECT 1
FROM hierarchy_concepts hc_int
WHERE hc_int.ancestor_concept_id = hc.descendant_concept_id
)
) lf ON lf.root_concept_id_1 = cr.concept_id_2
WHERE c1.concept_code <> lf.concept_code --we don't want duplicates like A - A (A 'Mapped from' B, but B have 'Concept replaced by' A -> so we have A - A in IRS)
AND NOT EXISTS (
SELECT 1
FROM internal_relationship_stage irs_int
WHERE irs_int.concept_code_1 = c1.concept_code
AND irs_int.concept_code_2 = lf.concept_code
);
--23.1 Add all the attributes which relationships are missing in basic tables (separate query to speed up)
INSERT INTO internal_relationship_stage
--missing bn
WITH t AS (
SELECT DISTINCT dc.concept_code,
c.concept_name
FROM drug_concept_stage dc
JOIN concept c ON c.concept_code = dc.concept_code
AND c.vocabulary_id = 'RxNorm Extension'
WHERE dc.concept_class_id = 'Drug Product'
AND dc.concept_name LIKE '%Pack%[%]%'
)
SELECT DISTINCT t.concept_code,
dc2.concept_code
FROM t
JOIN concept dc2 ON dc2.concept_name = REGEXP_REPLACE(t.concept_name, '.* Pack .*\[(.*)\]', '\1')
AND dc2.concept_class_id = 'Brand Name'
AND dc2.vocabulary_id LIKE 'Rx%'
AND dc2.invalid_reason IS NULL
--WHERE t.concept_code NOT IN (SELECT concept_code_1 FROM internal_relationship_stage irs_int JOIN drug_concept_stage dcs_int ON dcs_int.concept_code=irs_int.concept_code_2 AND dcs_int.concept_class_id = 'Brand Name' );
WHERE NOT EXISTS (
SELECT 1
FROM internal_relationship_stage irs_int
WHERE irs_int.concept_code_1 = t.concept_code
AND irs_int.concept_code_2 = dc2.concept_code
);
INSERT INTO internal_relationship_stage
--missing bn
WITH t AS (
SELECT DISTINCT dc.concept_code,
c.concept_name
FROM drug_concept_stage dc
JOIN concept c ON c.concept_code = dc.concept_code
AND c.vocabulary_id = 'RxNorm Extension'
WHERE dc.concept_class_id = 'Drug Product'
AND dc.concept_name LIKE '%Pack%[%]%'
)
SELECT DISTINCT t.concept_code,
dc2.concept_code
FROM t
JOIN concept dc2 ON dc2.concept_name = substring(t.concept_name, '.*\[(.*)\]')
AND dc2.concept_class_id = 'Brand Name'
AND dc2.vocabulary_id LIKE 'Rx%'
AND dc2.invalid_reason IS NULL
--WHERE t.concept_code NOT IN (SELECT concept_code_1 FROM internal_relationship_stage irs_int JOIN drug_concept_stage dcs_int ON dcs_int.concept_code=irs_int.concept_code_2 AND dcs_int.concept_class_id = 'Brand Name' );
WHERE NOT EXISTS (
SELECT 1
FROM internal_relationship_stage irs_int
WHERE irs_int.concept_code_1 = t.concept_code
AND irs_int.concept_code_2 = dc2.concept_code
);
INSERT INTO drug_concept_stage (
concept_name,
domain_id,
vocabulary_id,
source_concept_class_id,
concept_class_id,
standard_concept,
concept_code,
valid_start_date,
valid_end_date,
invalid_reason
)
SELECT DISTINCT concept_name,
domain_id,
'Rxfix',
concept_class_id,
concept_class_id,
standard_concept,
concept_code,
valid_start_date,
valid_end_date,
invalid_reason
FROM internal_relationship_stage a
JOIN concept c ON c.concept_code = concept_code_2
AND c.vocabulary_id LIKE 'Rx%'
WHERE concept_code_2 NOT IN (
SELECT concept_code
FROM drug_concept_stage
)
AND concept_code_2 NOT IN (
'721654',
'317004',
'OMOP881524'
) --unneccesary DF
;
--24.1 Add missing suppliers
CREATE INDEX idx_dcs_cn ON drug_concept_stage USING GIN (concept_name devv5.gin_trgm_ops);
ANALYZE drug_concept_stage;
INSERT INTO internal_relationship_stage
SELECT DISTINCT dc.concept_code,
dc2.concept_code
FROM drug_concept_stage dc
JOIN drug_concept_stage dc2 ON dc.concept_name iLIKE '% ' || dc2.concept_name
AND dc2.concept_class_id = 'Supplier'
WHERE dc.source_concept_class_id = 'Marketed Product'
AND NOT EXISTS (
SELECT 1
FROM internal_relationship_stage irs_int
WHERE irs_int.concept_code_1 = dc.concept_code
AND irs_int.concept_code_2 = dc2.concept_code
);
--24.2 Fix suppliers like Baxter and Baxter ltd
DELETE
FROM internal_relationship_stage
WHERE (
concept_code_1,
concept_code_2
) IN (
SELECT b2.concept_code_1,
b2.concept_code_2
FROM (
SELECT concept_code_1
FROM internal_relationship_stage a
JOIN drug_concept_stage b ON concept_code = concept_code_2
WHERE b.concept_class_id = 'Supplier'
GROUP BY concept_code_1,
b.concept_class_id
HAVING COUNT(*) > 1
) a
JOIN internal_relationship_stage b ON b.concept_code_1 = a.concept_code_1
JOIN internal_relationship_stage b2 ON b2.concept_code_1 = b.concept_code_1
AND b.concept_code_2 != b2.concept_code_2
JOIN drug_concept_stage c ON c.concept_code = b.concept_code_2
AND c.concept_class_id = 'Supplier'
JOIN drug_concept_stage c2 ON c2.concept_code = b2.concept_code_2
AND c2.concept_class_id = 'Supplier'
WHERE LENGTH(c.concept_name) < LENGTH(c2.concept_name)
);
--24.3 Cromolyn Inhalation powder
INSERT INTO internal_relationship_stage (concept_code_1,concept_code_2) VALUES ('OMOP391197','317000');
INSERT INTO internal_relationship_stage (concept_code_1,concept_code_2) VALUES ('OMOP391198','317000');
INSERT INTO internal_relationship_stage (concept_code_1,concept_code_2) VALUES ('OMOP391199','317000');
INSERT INTO internal_relationship_stage (concept_code_1,concept_code_2) VALUES ('OMOP391019','317000');
INSERT INTO internal_relationship_stage (concept_code_1,concept_code_2) VALUES ('OMOP391020','317000');
--24.4 Manually add missing ingredients
INSERT INTO internal_relationship_stage (concept_code_1,concept_code_2) VALUES ('OMOP418619','10582');
INSERT INTO internal_relationship_stage (concept_code_1,concept_code_2) VALUES ('OMOP420104','7994');
INSERT INTO internal_relationship_stage (concept_code_1,concept_code_2) VALUES ('OMOP417742','6313');
INSERT INTO internal_relationship_stage (concept_code_1,concept_code_2) VALUES ('OMOP417551','5666');
INSERT INTO internal_relationship_stage (concept_code_1,concept_code_2) VALUES ('OMOP412170','4141');
INSERT INTO internal_relationship_stage (concept_code_1,concept_code_2) VALUES ('OMOP421199','105695');
INSERT INTO internal_relationship_stage (concept_code_1,concept_code_2) VALUES ('OMOP421200','105695');
INSERT INTO internal_relationship_stage (concept_code_1,concept_code_2) VALUES ('OMOP421053','854930');
INSERT INTO internal_relationship_stage (concept_code_1,concept_code_2) VALUES ('OMOP299955','5333');
INSERT INTO internal_relationship_stage (concept_code_1,concept_code_2) VALUES ('OMOP419715','3616');
--25 delete multiple relationships to attributes
--25.1 define concept_1, concept_2 pairs need to be deleted
DELETE
FROM internal_relationship_stage
WHERE (
concept_code_1,
concept_code_2
) IN (
SELECT concept_code_1,
concept_code_2
FROM internal_relationship_stage a
JOIN drug_concept_stage b ON a.concept_code_2 = b.concept_code
AND b.concept_class_id IN ('Supplier')
JOIN drug_concept_stage c ON c.concept_code = a.concept_code_1
WHERE a.concept_code_1 IN (
SELECT a_int.concept_code_1
FROM internal_relationship_stage a_int
JOIN drug_concept_stage b ON b.concept_code = a_int.concept_code_2
WHERE b.concept_class_id IN ('Supplier')
GROUP BY a_int.concept_code_1,
b.concept_class_id
HAVING COUNT(*) > 1
)
--Attribute is not a part of a name
AND (
c.concept_name NOT ILIKE '%' || b.concept_name || '%'
OR substring(c.concept_name, 'Pack\s.*') NOT LIKE '%' || b.concept_name || '%'
)
);
DELETE
FROM internal_relationship_stage
WHERE (
concept_code_1,
concept_code_2
) IN (
SELECT concept_code_1,
concept_code_2
FROM internal_relationship_stage a
JOIN drug_concept_stage b ON a.concept_code_2 = b.concept_code
AND b.concept_class_id IN ('Dose Form')
JOIN drug_concept_stage c ON c.concept_code = a.concept_code_1
WHERE a.concept_code_1 IN (
SELECT a_int.concept_code_1
FROM internal_relationship_stage a_int
JOIN drug_concept_stage b ON b.concept_code = a_int.concept_code_2
WHERE b.concept_class_id IN ('Dose Form')
GROUP BY a_int.concept_code_1,
b.concept_class_id
HAVING COUNT(*) > 1
)
--Attribute is not a part of a name
AND (
c.concept_name NOT iLIKE '%' || b.concept_name || '%'
OR substring(c.concept_name, 'Pack\s.*') NOT LIKE '%' || b.concept_name || '%'
)
);
DELETE
FROM internal_relationship_stage
WHERE (
concept_code_1,
concept_code_2
) IN (
SELECT concept_code_1,
concept_code_2
FROM internal_relationship_stage a
JOIN drug_concept_stage b ON a.concept_code_2 = b.concept_code
AND b.concept_class_id IN ('Brand Name')
JOIN drug_concept_stage c ON c.concept_code = a.concept_code_1
WHERE a.concept_code_1 IN (
SELECT a_int.concept_code_1
FROM internal_relationship_stage a_int
JOIN drug_concept_stage b ON b.concept_code = a_int.concept_code_2
WHERE b.concept_class_id IN ('Brand Name')
GROUP BY a_int.concept_code_1,
b.concept_class_id
HAVING COUNT(*) > 1
)
--Attribute is not a part of a name
AND (
c.concept_name NOT iLIKE '%' || b.concept_name || '%'
OR substring(c.concept_name, 'Pack\s.*') NOT LIKE '%' || b.concept_name || '%'
)
);
--25.2 delete 2 brand names that don't fit the rule as the brand name of the pack looks like the brand name of component (e.g. [Risedronate] and [Risedronate EC])
DELETE
FROM internal_relationship_stage
WHERE concept_code_1 IN (
'OMOP572812',
'OMOP573077',
'OMOP573035',
'OMOP573066',
'OMOP573376'
)
AND concept_code_2 IN (
'OMOP571371',
'OMOP569970'
);
--the same logic but manually
DELETE
FROM internal_relationship_stage
WHERE concept_code_1 = 'OMOP339638'
AND concept_code_2 = 'OMOP332839';
DELETE
FROM internal_relationship_stage
WHERE concept_code_1 = 'OMOP339724'
AND concept_code_2 = 'OMOP332839';
DELETE
FROM internal_relationship_stage
WHERE concept_code_1 = 'OMOP339776'
AND concept_code_2 = 'OMOP334564';
DELETE
FROM internal_relationship_stage
WHERE concept_code_1 = 'OMOP339838'
AND concept_code_2 = 'OMOP336023';
DELETE
FROM internal_relationship_stage
WHERE concept_code_1 = 'OMOP339891'
AND concept_code_2 = '220105';
DELETE
FROM internal_relationship_stage
WHERE concept_code_1 = 'OMOP340161'
AND concept_code_2 = 'OMOP336023';
--25.3 delete precise ingredients
DELETE
FROM internal_relationship_stage
WHERE concept_code_2 IN (
'236340',
'1371041',
'721654',
'317004',
'OMOP881524'
);--unnecessary DF
--25.4 add missing relationship to dose form
INSERT INTO internal_relationship_stage (
concept_code_1,
concept_code_2
)
SELECT dc.concept_code,
CASE
WHEN dc.concept_name LIKE '%Prefilled Syringe%'
THEN '721656'
WHEN dc.concept_name LIKE '%Injection%'
THEN '1649574'
WHEN dc.concept_name LIKE '%Injectable Solution%'
OR dc.concept_name LIKE '%Solution for injection%'
THEN '316949'
WHEN dc.concept_name LIKE '%Topical Solution%'
THEN '316986'
WHEN dc.concept_name LIKE '%Liquid%'
THEN '19082170'
WHEN dc.concept_name LIKE '%Powder%'
THEN '346289'
ELSE NULL
END
FROM drug_concept_stage dc
WHERE dc.concept_class_id = 'Drug Product'
AND dc.source_concept_class_id NOT LIKE '%Comp%'
AND dc.concept_name NOT LIKE '% Pack %'
AND dc.source_concept_class_id NOT LIKE '%Pack%'
AND dc.concept_code NOT IN (
SELECT concept_code_1
FROM internal_relationship_stage
JOIN drug_concept_stage ON concept_code_2 = concept_code
AND concept_class_id = 'Dose Form'
);
--need to check ing_temp_1
DELETE
FROM internal_relationship_stage i
WHERE EXISTS (
SELECT 1
FROM internal_relationship_stage i_int
WHERE coalesce(i_int.concept_code_1, '-1') = coalesce(i.concept_code_1, '-1')
AND coalesce(i_int.concept_code_2, '-1') = coalesce(i.concept_code_2, '-1')
AND i_int.ctid > i.ctid
);
DELETE
FROM drug_concept_stage
WHERE concept_class_id = 'Drug Product'
AND concept_name NOT LIKE '%Pack%'
AND concept_code NOT IN (
SELECT concept_code_1
FROM internal_relationship_stage
JOIN drug_concept_stage ON concept_code_2 = concept_code
AND concept_class_id = 'Ingredient'
);
--26 just take it from the pack_content
INSERT INTO pc_stage (
pack_concept_code,
drug_concept_code,
amount,
box_size
)
SELECT c.concept_code,
c2.concept_code,
pc.amount,
pc.box_size
FROM pack_content pc
JOIN concept c ON c.concept_id = pc.pack_concept_id
AND c.vocabulary_id = 'RxNorm Extension'
JOIN concept c2 ON c2.concept_id = pc.drug_concept_id;
--26.1 fix 2 equal components manualy
DELETE FROM pc_stage WHERE
( pack_concept_code = 'OMOP339574' AND drug_concept_code = '197659' AND amount = 12)
OR ( pack_concept_code = 'OMOP339579' AND drug_concept_code = '311704' AND amount IS NULL)
OR ( pack_concept_code = 'OMOP339579' AND drug_concept_code = '317128' AND amount IS NULL)
OR ( pack_concept_code = 'OMOP339728' AND drug_concept_code = '1363273'AND amount = 7)
OR ( pack_concept_code = 'OMOP339876' AND drug_concept_code = '864686' AND amount IS NULL)
OR ( pack_concept_code = 'OMOP339876' AND drug_concept_code = '1117531' AND amount IS NULL)
OR ( pack_concept_code = 'OMOP339900' AND drug_concept_code = '392651' AND amount IS NULL)
OR ( pack_concept_code = 'OMOP339900' AND drug_concept_code = '197662' AND amount IS NULL)
OR ( pack_concept_code = 'OMOP339913' AND drug_concept_code = '199797' AND amount IS NULL)
OR ( pack_concept_code = 'OMOP339913' AND drug_concept_code = '199796' AND amount IS NULL)
OR ( pack_concept_code = 'OMOP340051' AND drug_concept_code = '1363273' AND amount = 7)
OR ( pack_concept_code = 'OMOP340128' AND drug_concept_code = '197659' AND amount = 12)
OR ( pack_concept_code = 'OMOP339633' AND drug_concept_code = '310463' AND amount = 5)
OR ( pack_concept_code = 'OMOP339814' AND drug_concept_code = '310463' AND amount = 5)
OR ( pack_concept_code = 'OMOP339886' AND drug_concept_code = '312309' AND amount = 6)
OR ( pack_concept_code = 'OMOP339886' AND drug_concept_code = '312308' AND amount = 109)
OR ( pack_concept_code = 'OMOP339895' AND drug_concept_code = '312309' AND amount = 6)
OR ( pack_concept_code = 'OMOP339895' AND drug_concept_code = '312308' AND amount = 109);
UPDATE pc_stage
SET amount = 12
WHERE pack_concept_code = 'OMOP339633'
AND drug_concept_code = '310463'
AND amount = 7;
UPDATE pc_stage
SET amount = 12
WHERE pack_concept_code = 'OMOP339814'
AND drug_concept_code = '310463'
AND amount = 7;
--27 insert missing packs (only those that have => 2 components) - take them from the source tables
--27.1 AMT
INSERT INTO pc_stage (
pack_concept_code,
drug_concept_code,
amount,
box_size
)
SELECT DISTINCT ac.concept_code,
ac2.concept_code,
pcs.amount,
pcs.box_size
FROM dev_amt.pc_stage pcs
JOIN concept c ON c.concept_code = pcs.pack_concept_code
AND c.vocabulary_id = 'AMT'
AND c.invalid_reason IS NULL
JOIN concept_relationship cr ON cr.concept_id_1 = c.concept_id
AND cr.relationship_id = 'Maps to'
AND cr.invalid_reason IS NULL
JOIN concept ac ON ac.concept_id = cr.concept_id_2
AND ac.vocabulary_id = 'RxNorm Extension'
AND ac.invalid_reason IS NULL
JOIN concept c2 ON c2.concept_code = pcs.drug_concept_code
AND c2.vocabulary_id = 'AMT'
AND c2.invalid_reason IS NULL
JOIN concept_relationship cr2 ON cr2.concept_id_1 = c2.concept_id
AND cr2.relationship_id = 'Maps to'
AND cr2.invalid_reason IS NULL
JOIN concept ac2 ON ac2.concept_id = cr2.concept_id_2
AND ac2.vocabulary_id LIKE 'RxNorm%'
AND ac2.invalid_reason IS NULL
WHERE c.concept_id NOT IN (
SELECT pack_concept_id
FROM pack_content
)
AND c.concept_id IN (
SELECT c.concept_id
FROM dev_amt.pc_stage pcs
JOIN concept c ON c.concept_code = pcs.pack_concept_code
AND c.vocabulary_id = 'AMT'
AND c.invalid_reason IS NULL
JOIN concept_relationship cr ON cr.concept_id_1 = c.concept_id
AND cr.relationship_id = 'Maps to'
AND cr.invalid_reason IS NULL
JOIN concept ac ON ac.concept_id = cr.concept_id_2
AND ac.vocabulary_id = 'RxNorm Extension'
AND ac.invalid_reason IS NULL
JOIN concept c2 ON c2.concept_code = pcs.drug_concept_code
AND c2.vocabulary_id = 'AMT'
AND c2.invalid_reason IS NULL
JOIN concept_relationship cr2 ON cr2.concept_id_1 = c2.concept_id
AND cr2.relationship_id = 'Maps to'
AND cr2.invalid_reason IS NULL
JOIN concept ac2 ON ac2.concept_id = cr2.concept_id_2
AND ac2.vocabulary_id LIKE 'RxNorm%'
WHERE c.concept_id NOT IN (
SELECT pack_concept_id
FROM pack_content
)
GROUP BY c.concept_id
HAVING COUNT(c.concept_id) > 1
)
AND ac.concept_code NOT IN (
SELECT pack_concept_code
FROM pc_stage
);
--27.2 AMIS
INSERT INTO pc_stage (
pack_concept_code,
drug_concept_code,
amount,
box_size
)
SELECT DISTINCT ac.concept_code,
ac2.concept_code,
pcs.amount,
pcs.box_size
FROM dev_amis.pc_stage pcs
JOIN concept c ON c.concept_code = pcs.pack_concept_code
AND c.vocabulary_id = 'AMIS'
AND c.invalid_reason IS NULL
JOIN concept_relationship cr ON cr.concept_id_1 = c.concept_id
AND cr.relationship_id = 'Maps to'
AND cr.invalid_reason IS NULL
JOIN concept ac ON ac.concept_id = cr.concept_id_2
AND ac.vocabulary_id = 'RxNorm Extension'
AND ac.invalid_reason IS NULL
JOIN concept c2 ON c2.concept_code = pcs.drug_concept_code
AND c2.vocabulary_id = 'AMIS'
AND c2.invalid_reason IS NULL
JOIN concept_relationship cr2 ON cr2.concept_id_1 = c2.concept_id
AND cr2.relationship_id = 'Maps to'
AND cr2.invalid_reason IS NULL
JOIN concept ac2 ON ac2.concept_id = cr2.concept_id_2
AND ac2.vocabulary_id LIKE 'RxNorm%'
AND ac2.invalid_reason IS NULL
WHERE c.concept_id NOT IN (
SELECT pack_concept_id
FROM pack_content
)
AND c.concept_id IN (
SELECT c.concept_id
FROM dev_amis.pc_stage pcs
JOIN concept c ON c.concept_code = pcs.pack_concept_code
AND c.vocabulary_id = 'AMIS'
AND c.invalid_reason IS NULL
JOIN concept_relationship cr ON cr.concept_id_1 = c.concept_id
AND cr.relationship_id = 'Maps to'
AND cr.invalid_reason IS NULL
JOIN concept ac ON ac.concept_id = cr.concept_id_2
AND ac.vocabulary_id = 'RxNorm Extension'
AND ac.invalid_reason IS NULL
JOIN concept c2 ON c2.concept_code = pcs.drug_concept_code
AND c2.vocabulary_id = 'AMIS'
JOIN concept_relationship cr2 ON cr2.concept_id_1 = c2.concept_id
AND cr2.relationship_id = 'Maps to'
AND cr2.invalid_reason IS NULL
JOIN concept ac2 ON ac2.concept_id = cr2.concept_id_2
AND ac2.vocabulary_id LIKE 'RxNorm%'
WHERE c.concept_id NOT IN (
SELECT pack_concept_id
FROM pack_content
)
GROUP BY c.concept_id
HAVING COUNT(c.concept_id) > 1
)
AND ac.concept_code NOT IN (
SELECT pack_concept_code
FROM pc_stage
);
--27.3 BDPM
INSERT INTO pc_stage (
pack_concept_code,
drug_concept_code,
amount,
box_size
)
SELECT DISTINCT ac.concept_code,
ac2.concept_code,
pcs.amount,
pcs.box_size
FROM dev_bdpm.pc_stage pcs
JOIN concept c ON c.concept_code = pcs.pack_concept_code
AND c.vocabulary_id = 'BDPM'
AND c.invalid_reason IS NULL
JOIN concept_relationship cr ON cr.concept_id_1 = c.concept_id
AND cr.relationship_id = 'Maps to'
AND cr.invalid_reason IS NULL
JOIN concept ac ON ac.concept_id = cr.concept_id_2
AND ac.vocabulary_id = 'RxNorm Extension'
AND ac.invalid_reason IS NULL
JOIN concept c2 ON c2.concept_code = pcs.drug_concept_code
AND c2.vocabulary_id = 'BDPM'
AND c2.invalid_reason IS NULL
JOIN concept_relationship cr2 ON cr2.concept_id_1 = c2.concept_id
AND cr2.relationship_id = 'Maps to'
AND cr2.invalid_reason IS NULL
JOIN concept ac2 ON ac2.concept_id = cr2.concept_id_2
AND ac2.vocabulary_id LIKE 'RxNorm%'
AND ac2.invalid_reason IS NULL
WHERE c.concept_id NOT IN (
SELECT pack_concept_id
FROM pack_content
)
AND c.concept_id IN (
SELECT c.concept_id
FROM dev_bdpm.pc_stage pcs
JOIN concept c ON c.concept_code = pcs.pack_concept_code
AND c.vocabulary_id = 'BDPM'
AND c.invalid_reason IS NULL
JOIN concept_relationship cr ON cr.concept_id_1 = c.concept_id
AND cr.relationship_id = 'Maps to'
AND cr.invalid_reason IS NULL
JOIN concept ac ON ac.concept_id = cr.concept_id_2
AND ac.vocabulary_id = 'RxNorm Extension'
AND ac.invalid_reason IS NULL
JOIN concept c2 ON c2.concept_code = pcs.drug_concept_code
AND c2.vocabulary_id = 'BDPM'
JOIN concept_relationship cr2 ON cr2.concept_id_1 = c2.concept_id
AND cr2.relationship_id = 'Maps to'
AND cr2.invalid_reason IS NULL
JOIN concept ac2 ON ac2.concept_id = cr2.concept_id_2
AND ac2.vocabulary_id LIKE 'RxNorm%'
WHERE c.concept_id NOT IN (
SELECT pack_concept_id
FROM pack_content
)
GROUP BY c.concept_id
HAVING COUNT(c.concept_id) > 1
)
AND ac.concept_code NOT IN (
SELECT pack_concept_code
FROM pc_stage
);
--27.4 dm+d
INSERT INTO pc_stage (
pack_concept_code,
drug_concept_code,
amount,
box_size
)
SELECT DISTINCT ac.concept_code,
ac2.concept_code,
pcs.amount,
pcs.box_size
FROM dev_dmd.pc_stage pcs
JOIN concept c ON c.concept_code = pcs.pack_concept_code
AND c.vocabulary_id = 'dm+d'
AND c.invalid_reason IS NULL
JOIN concept_relationship cr ON cr.concept_id_1 = c.concept_id
AND cr.relationship_id = 'Maps to'
AND cr.invalid_reason IS NULL
JOIN concept ac ON ac.concept_id = cr.concept_id_2
AND ac.vocabulary_id = 'RxNorm Extension'
AND ac.invalid_reason IS NULL
JOIN concept c2 ON c2.concept_code = pcs.drug_concept_code
AND c2.vocabulary_id = 'dm+d'
AND c2.invalid_reason IS NULL
JOIN concept_relationship cr2 ON cr2.concept_id_1 = c2.concept_id
AND cr2.relationship_id = 'Maps to'
AND cr2.invalid_reason IS NULL
JOIN concept ac2 ON ac2.concept_id = cr2.concept_id_2
AND ac2.vocabulary_id LIKE 'RxNorm%'
AND ac2.invalid_reason IS NULL
WHERE c.concept_id NOT IN (
SELECT pack_concept_id
FROM pack_content
)
AND c.concept_id IN (
SELECT c.concept_id
FROM dev_dmd.pc_stage pcs
JOIN concept c ON c.concept_code = pcs.pack_concept_code
AND c.vocabulary_id = 'dm+d'
AND c.invalid_reason IS NULL
JOIN concept_relationship cr ON cr.concept_id_1 = c.concept_id
AND cr.relationship_id = 'Maps to'
AND cr.invalid_reason IS NULL
JOIN concept ac ON ac.concept_id = cr.concept_id_2
AND ac.vocabulary_id = 'RxNorm Extension'
AND ac.invalid_reason IS NULL
JOIN concept c2 ON c2.concept_code = pcs.drug_concept_code
AND c2.vocabulary_id = 'dm+d'
JOIN concept_relationship cr2 ON cr2.concept_id_1 = c2.concept_id
AND cr2.relationship_id = 'Maps to'
AND cr2.invalid_reason IS NULL
JOIN concept ac2 ON ac2.concept_id = cr2.concept_id_2
AND ac2.vocabulary_id LIKE 'RxNorm%'
WHERE c.concept_id NOT IN (
SELECT pack_concept_id
FROM pack_content
)
GROUP BY c.concept_id
HAVING COUNT(c.concept_id) > 1
)
AND ac.concept_code NOT IN (
SELECT pack_concept_code
FROM pc_stage
);
--28 fix inert ingredients in contraceptive packs
UPDATE pc_stage
SET amount = 7
WHERE (
pack_concept_code,
drug_concept_code
) IN (
SELECT p.pack_concept_code,
p.drug_concept_code
FROM pc_stage p
JOIN drug_concept_stage d ON d.concept_code = p.drug_concept_code
AND concept_name LIKE '%Inert%'
AND p.amount = 21
JOIN pc_stage p2 ON p.pack_concept_code = p2.pack_concept_code
AND p.drug_concept_code != p2.drug_concept_code
AND p.amount = 21
);
--29 update Inert Ingredients / Inert Ingredients 1 MG Oral Tablet to Inert Ingredient Oral Tablet
UPDATE pc_stage
SET drug_concept_code = '748796'
WHERE drug_concept_code = 'OMOP285209';
--30 fixing existing packs in order to remove duplicates
DELETE
FROM pc_stage
WHERE pack_concept_code = 'OMOP420950'
AND drug_concept_code = '310463'
AND amount = 5;
DELETE
FROM pc_stage
WHERE pack_concept_code = 'OMOP420969'
AND drug_concept_code = '310463'
AND amount = 7;
DELETE
FROM pc_stage
WHERE pack_concept_code = 'OMOP420978'
AND drug_concept_code = '392651'
AND amount IS NULL;
DELETE
FROM pc_stage
WHERE pack_concept_code = 'OMOP420978'
AND drug_concept_code = '197662'
AND amount IS NULL;
DELETE
FROM pc_stage
WHERE pack_concept_code = 'OMOP902613'
AND drug_concept_code = 'OMOP918399'
AND amount = 7;
UPDATE pc_stage
SET amount = 12
WHERE pack_concept_code = 'OMOP420950'
AND drug_concept_code = '310463'
AND amount = 7;
UPDATE pc_stage
SET amount = 12
WHERE pack_concept_code = 'OMOP420969'
AND drug_concept_code = '310463'
AND amount = 5;
UPDATE pc_stage
SET amount = 12
WHERE pack_concept_code = 'OMOP902613'
AND drug_concept_code = 'OMOP918399'
AND amount = 5;
DELETE
FROM pc_stage
WHERE pack_concept_code = 'OMOP902009'
AND drug_concept_code = 'OMOP706163'
AND amount = 28;
UPDATE pc_stage
SET amount = 31
WHERE pack_concept_code = 'OMOP902009'
AND drug_concept_code = 'OMOP706163'
AND amount = 3;
--31.1 Create links to self
INSERT INTO relationship_to_concept (
concept_code_1,
vocabulary_id_1,
concept_id_2,
precedence
)
SELECT a.concept_code,
a.vocabulary_id,
b.concept_id,
1
FROM drug_concept_stage a
JOIN concept b ON b.concept_code = a.concept_code
AND b.vocabulary_id IN (
'RxNorm',
'RxNorm Extension'
)
WHERE a.concept_class_id IN (
'Dose Form',
'Brand Name',
'Supplier',
'Ingredient'
);
--31.2 insert relationship to units
INSERT INTO relationship_to_concept (
concept_code_1,
vocabulary_id_1,
concept_id_2,
precedence,
conversion_factor
)
SELECT a.concept_code,
a.vocabulary_id,
b.concept_id,
1,
1
FROM drug_concept_stage a
JOIN concept b ON b.concept_code = a.concept_code
AND b.vocabulary_id = 'UCUM'
WHERE a.concept_class_id = 'Unit';
--31.3 insert additional mapping that doesn't exist in concept
INSERT INTO relationship_to_concept (
concept_code_1,
vocabulary_id_1,
concept_id_2,
precedence,
conversion_factor
)
VALUES (
'mL',
'Rxfix',
8576,
2,
1000
);
INSERT INTO relationship_to_concept (
concept_code_1,
vocabulary_id_1,
concept_id_2,
precedence,
conversion_factor
)
VALUES (
'mg',
'Rxfix',
8587,
2,
0.001
);
INSERT INTO relationship_to_concept (
concept_code_1,
vocabulary_id_1,
concept_id_2,
precedence,
conversion_factor
)
VALUES (
'[U]',
'Rxfix',
8718,
2,
1
);
INSERT INTO relationship_to_concept (
concept_code_1,
vocabulary_id_1,
concept_id_2,
precedence,
conversion_factor
)
VALUES (
'[iU]',
'Rxfix',
8510,
2,
1
);
--31.4 transform micrograms into milligrams
UPDATE relationship_to_concept
SET concept_id_2 = 8576,
conversion_factor = 0.001
WHERE concept_code_1 = 'ug'
AND concept_id_2 = 9655;
--32 Before Build_RxE
INSERT INTO vocabulary (
vocabulary_id,
vocabulary_name,
vocabulary_concept_id
)
VALUES (
'RxO',
'RxO',
0
);
UPDATE concept
SET vocabulary_id = 'RxO'
WHERE vocabulary_id = 'RxNorm Extension';
UPDATE concept_relationship
SET invalid_reason = 'D',
valid_end_date = CURRENT_DATE - 1
WHERE concept_id_1 IN (
SELECT concept_id_1
FROM concept_relationship
JOIN concept ON concept_id_1 = concept_id
AND vocabulary_id = 'RxO'
)
OR concept_id_2 IN (
SELECT concept_id_2
FROM concept_relationship
JOIN concept ON concept_id_2 = concept_id
AND vocabulary_id = 'RxO'
);
DROP INDEX idx_irs_cc;
DROP INDEX idx_dcs_cc;
DROP INDEX idx_dcs_cn; | the_stack |
-----------------------------------------------------------------------
-- Oracle Machine Learning for SQL (OML4SQL) 20c
--
-- Classification - Decision Tree Algorithm - dmdtdemo.sql
--
-- Copyright (c) 2020 Oracle Corporation and/or its affilitiates.
--
-- The Universal Permissive License (UPL), Version 1.0
--
-- https://oss.oracle.com/licenses/upl/
-----------------------------------------------------------------------
SET serveroutput ON
SET trimspool ON
SET pages 10000
SET linesize 420
SET echo ON
SET long 2000000000
-----------------------------------------------------------------------
-- SAMPLE PROBLEM
-----------------------------------------------------------------------
-- Given demographic data about a set of customers, predict the
-- customer response to an affinity card program using a classifier
-- based on Decision Trees algorithm.
-----------------------------------------------------------------------
-- SET UP AND ANALYZE THE DATA
-----------------------------------------------------------------------
-- The data for this sample is composed from base tables in SH Schema
-- (See Sample Schema Documentation) and presented through these views:
-- mining_data_build_parallel_v (build data)
-- mining_data_test_parallel_v (test data)
-- mining_data_apply_parallel_v (apply data)
-- (See dmsh.sql for view definitions).
-----------
-- ANALYSIS
-----------
-- These are the factors to consider for data analysis in decision trees:
--
-- 1. Missing Value Treatment for Predictors
--
-- See dmsvcdem.sql for a definition of missing values, and the
-- steps to be taken for missing value imputation.
--
-- Decision Tree implementation in ODM handles missing predictor
-- values (by penalizing predictors which have missing values)
-- and missing target values (by simply discarding records with
-- missing target values).
--
-- 2. Outlier Treatment for Predictors for Build data
--
-- See dmsvcdem.sql for a discussion on outlier treatment.
-- For ODM decision trees, outlier treatment is not really necessary.
--
-- 3. Binning high cardinality data
-- No data preparation for the types we accept is necessary - even
-- for high cardinality predictors. Preprocessing to reduce the
-- cardinality (e.g., binning) can improve the performance of the build.
--
-----------------------------------------------------------------------
-- BUILD THE MODEL
-----------------------------------------------------------------------
-- Cleanup old model with same name for repeat runs
BEGIN DBMS_DATA_MINING.DROP_MODEL('DT_SH_Clas_sample');
EXCEPTION WHEN OTHERS THEN NULL; END;
/
--------------------------------
-- PREPARE BUILD (TRAINING) DATA
--
-- The decision tree algorithm is very capable of handling data which
-- has not been specially prepared. For this example, no data preparation
-- will be performed.
--
-------------------
-- SPECIFY SETTINGS
--
-- Cleanup old settings table objects for repeat runs
BEGIN EXECUTE IMMEDIATE 'DROP TABLE dt_sh_sample_settings';
EXCEPTION WHEN OTHERS THEN NULL; END;
/
BEGIN EXECUTE IMMEDIATE 'DROP TABLE dt_sh_sample_cost';
EXCEPTION WHEN OTHERS THEN NULL; END;
/
--------------------------
-- CREATE A SETTINGS TABLE
--
-- The default classification algorithm is Naive Bayes. In order to override
-- this, create and populate a settings table to be used as input for
-- CREATE_MODEL.
--
set echo off
CREATE TABLE dt_sh_sample_settings (
setting_name VARCHAR2(30),
setting_value VARCHAR2(4000));
set echo on
-- CREATE AND POPULATE A COST MATRIX TABLE
--
-- A cost matrix is used to influence the weighting of misclassification
-- during model creation (and scoring).
-- See Oracle Data Mining Concepts Guide for more details.
--
CREATE TABLE dt_sh_sample_cost (
actual_target_value NUMBER,
predicted_target_value NUMBER,
cost NUMBER);
INSERT INTO dt_sh_sample_cost VALUES (0,0,0);
INSERT INTO dt_sh_sample_cost VALUES (0,1,1);
INSERT INTO dt_sh_sample_cost VALUES (1,0,8);
INSERT INTO dt_sh_sample_cost VALUES (1,1,0);
BEGIN
-- Populate settings table
INSERT INTO dt_sh_sample_settings VALUES
(dbms_data_mining.algo_name, dbms_data_mining.algo_decision_tree);
INSERT INTO dt_sh_sample_settings VALUES
(dbms_data_mining.clas_cost_table_name, 'dt_sh_sample_cost');
-- Examples of other possible settings are:
--(dbms_data_mining.tree_impurity_metric, 'TREE_IMPURITY_ENTROPY')
--(dbms_data_mining.tree_term_max_depth, 5)
--(dbms_data_mining.tree_term_minrec_split, 5)
--(dbms_data_mining.tree_term_minpct_split, 2)
--(dbms_data_mining.tree_term_minrec_node, 5)
--(dbms_data_mining.tree_term_minpct_node, 0.05)
END;
/
---------------------
-- CREATE A NEW MODEL
--
-- Build a DT model
BEGIN
DBMS_DATA_MINING.CREATE_MODEL(
model_name => 'DT_SH_Clas_sample',
mining_function => dbms_data_mining.classification,
data_table_name => 'mining_data_build_parallel_v',
case_id_column_name => 'cust_id',
target_column_name => 'affinity_card',
settings_table_name => 'dt_sh_sample_settings');
END;
/
-------------------------
-- DISPLAY MODEL SETTINGS
--
column setting_name format a30
column setting_value format a30
SELECT setting_name, setting_value
FROM user_mining_model_settings
WHERE model_name = 'DT_SH_CLAS_SAMPLE'
ORDER BY setting_name;
--------------------------
-- DISPLAY MODEL SIGNATURE
--
column attribute_name format a40
column attribute_type format a20
SELECT attribute_name, attribute_type
FROM user_mining_model_attributes
WHERE model_name = 'DT_SH_CLAS_SAMPLE'
ORDER BY attribute_name;
------------------------
-- DISPLAY MODEL DETAILS
-- NOTE: The """ characters in this XML output are owing to
-- SQL*Plus behavior. Cut and paste this XML into a file,
-- and open the file in a browser to see correctly formatted XML.
--
column dt_details format a320
SELECT
dbms_data_mining.get_model_details_xml('DT_SH_Clas_sample')
AS DT_DETAILS
FROM dual;
--------------------------
-- DISPLAY MODEL VIEWS
--
-- Get a list of model views
col view_name format a30
col view_type format a50
SELECT view_name, view_type FROM user_mining_model_views
WHERE model_name='DT_SH_CLAS_SAMPLE'
ORDER BY view_name;
column ATTRIBUTE_NAME format a12
column VAL format a12
column split_type format a12
column OPERATOR format a12
-- Information about the splits in the hierarchy
SELECT * FROM (
select parent, split_type, node, attribute_name, operator, split.val
from DM$VPDT_SH_CLAS_sample a,
XMLTABLE( '/Element' passing a.value
columns
val varchar2(20) path '.') split
order by 1,2,3,4,5,6)
WHERE ROWNUM < 20;
-- Information about node statistics
select node, node_support, predicted_target_value, target_value,
target_support
from DM$VIDT_SH_CLAS_SAMPLE order by 1,2,3,4,5;
-- Information about the nodes in the decision tree
SELECT * FROM (
select node, node_support, predicted_target_value, parent,
attribute_name, operator, split.val
from DM$VODT_SH_CLAS_SAMPLE a,
XMLTABLE( '/Element' passing a.value
columns
val varchar2(20) path '.') split
order by 1,2,3,4,5,6,7)
WHERE ROWNUM < 20;
-----------------------------------------------------------------------
-- TEST THE MODEL
-----------------------------------------------------------------------
--------------------
-- PREPARE TEST DATA
--
-- If the data for model creation has been prepared, then the data used
-- for testing the model must be prepared to the same scale in order to
-- obtain meaningful results.
-- In this case, no data preparation is necessary since model creation
-- was performed on the raw (unprepared) input.
--
------------------------------------
-- COMPUTE METRICS TO TEST THE MODEL
--
-- Other demo programs demonstrate how to use the PL/SQL API to
-- compute a number of metrics, including lift and ROC. This demo
-- only computes a confusion matrix and accuracy, but it does so
-- using the SQL data mining functions.
--
-- In this example, we experiment with using the cost matrix
-- that was provided to the create routine. In this example, the
-- cost matrix reduces the problematic misclassifications, but also
-- negatively impacts the overall model accuracy.
-- DISPLAY CONFUSION MATRIX WITHOUT APPLYING COST MATRIX
--
SELECT affinity_card AS actual_target_value,
PREDICTION(DT_SH_Clas_sample USING *) AS predicted_target_value,
COUNT(*) AS value
FROM mining_data_test_parallel_v
GROUP BY affinity_card, PREDICTION(DT_SH_Clas_sample USING *)
ORDER BY 1,2;
-- DISPLAY CONFUSION MATRIX APPLYING THE COST MATRIX
--
SELECT affinity_card AS actual_target_value,
PREDICTION(DT_SH_Clas_sample COST MODEL USING *)
AS predicted_target_value,
COUNT(*) AS value
FROM mining_data_test_parallel_v
GROUP BY affinity_card, PREDICTION(DT_SH_Clas_sample COST MODEL USING *)
ORDER BY 1,2;
-- DISPLAY ACCURACY WITHOUT APPLYING COST MATRIX
--
SELECT ROUND(SUM(correct)/COUNT(*),4) AS accuracy
FROM (SELECT DECODE(affinity_card,
PREDICTION(DT_SH_Clas_sample USING *), 1, 0) AS correct
FROM mining_data_test_parallel_v);
-- DISPLAY ACCURACY APPLYING THE COST MATRIX
--
SELECT ROUND(SUM(correct)/COUNT(*),4) AS accuracy
FROM (SELECT DECODE(affinity_card,
PREDICTION(DT_SH_Clas_sample COST MODEL USING *),
1, 0) AS correct
FROM mining_data_test_parallel_v);
-----------------------------------------------------------------------
-- APPLY THE MODEL
-----------------------------------------------------------------------
------------------
-- BUSINESS CASE 1
-- Find the 10 customers who live in Italy that are least expensive
-- to be convinced to use an affinity card.
--
SELECT cust_id FROM
(SELECT cust_id,
rank() over (order by PREDICTION_COST(DT_SH_Clas_sample,
1 COST MODEL USING *) ASC, cust_id) rnk
FROM mining_data_apply_parallel_v
WHERE country_name = 'Italy')
where rnk <= 10
order by rnk;
------------------
-- BUSINESS CASE 2
-- Find the average age of customers who are likely to use an
-- affinity card.
-- Include the build-time cost matrix in the prediction.
-- Only take into account CUST_MARITAL_STATUS, EDUCATION, and
-- HOUSEHOLD_SIZE as predictors.
-- Break out the results by gender.
--
column cust_gender format a12
SELECT cust_gender, COUNT(*) AS cnt, ROUND(AVG(age)) AS avg_age
FROM mining_data_apply_parallel_v
WHERE PREDICTION(dt_sh_clas_sample COST MODEL
USING cust_marital_status, education, household_size) = 1
GROUP BY cust_gender
ORDER BY cust_gender;
------------------
-- BUSINESS CASE 3
-- List ten customers (ordered by their id) along with likelihood and cost
-- to use or reject the affinity card (Note: while this example has a
-- binary target, such a query is useful in multi-class classification -
-- Low, Med, High for example).
--
column prediction format 9;
column probability format 9.999999999
column cost format 9.999999999
SELECT T.cust_id, S.prediction, S.probability, S.cost
FROM (SELECT cust_id,
PREDICTION_SET(dt_sh_clas_sample COST MODEL USING *) pset
FROM mining_data_apply_parallel_v
WHERE cust_id < 100011) T,
TABLE(T.pset) S
ORDER BY cust_id, S.prediction;
------------------
-- BUSINESS CASE 4
-- Find the segmentation (resulting tree node and rule) for customers who
-- work in Tech support and are under 25.
--
set long 20000
set line 300
set pagesize 100
column education format a30;
SELECT cust_id, education,
PREDICTION_DETAILS(dt_sh_clas_sample USING *) prediction_details
FROM mining_data_apply_parallel_v
WHERE occupation = 'TechSup' AND age < 25
ORDER BY cust_id; | the_stack |
CREATE SEQUENCE JQM_PK START WITH 1 INCREMENT BY 1;
/* Table used for tracking schema updates and version */
CREATE MEMORY TABLE __T__VERSION
(
ID INTEGER NOT NULL,
COMPONENT VARCHAR(20) NOT NULL,
VERSION_D1 INTEGER NOT NULL,
VERSION_D2 INTEGER DEFAULT 0 NOT NULL,
VERSION_D3 INTEGER DEFAULT 0 NOT NULL,
COMPAT_D1 INTEGER,
COMPAT_D2 INTEGER,
COMPAT_D3 INTEGER,
INSTALL_DATE TIMESTAMP NOT NULL,
NOTES VARCHAR(100),
CONSTRAINT PK_VERSION PRIMARY KEY(ID)
);
/* Deployment infra */
CREATE MEMORY TABLE __T__NODE
(
ID INTEGER NOT NULL,
NAME VARCHAR(100) NOT NULL,
DNS VARCHAR(255) NOT NULL,
PORT INTEGER NOT NULL,
ENABLED BOOLEAN,
STOP BOOLEAN NOT NULL,
JMX_REGISTRY_PORT INTEGER,
JMX_SERVER_PORT INTEGER,
LAST_SEEN_ALIVE TIMESTAMP NULL,
LOAD_API_ADMIN BOOLEAN,
LOAD_API_CLIENT BOOLEAN,
LOAD_API_SIMPLE BOOLEAN,
ROOT_LOG_LEVEL VARCHAR(10),
REPO_JOB_DEF VARCHAR(1024) NOT NULL,
REPO_DELIVERABLE VARCHAR(1024) NOT NULL,
REPO_TMP VARCHAR(1024),
CONSTRAINT PK_NODE PRIMARY KEY(ID),
CONSTRAINT UK_NODE_1 UNIQUE(NAME)
);
CREATE MEMORY TABLE __T__QUEUE
(
ID INTEGER NOT NULL,
DEFAULT_QUEUE BOOLEAN,
DESCRIPTION VARCHAR(1000) NOT NULL,
NAME VARCHAR(50) NOT NULL,
TIME_TO_LIVE INTEGER NULL,
CONSTRAINT PK_QUEUE PRIMARY KEY(ID),
CONSTRAINT UK_QUEUE_1 UNIQUE(NAME)
);
CREATE MEMORY TABLE __T__QUEUE_NODE_MAPPING
(
ID INTEGER NOT NULL,
ENABLED BOOLEAN,
LAST_MODIFIED TIMESTAMP NULL,
MAX_THREAD INTEGER NOT NULL,
POLLING_INTERVAL INTEGER NOT NULL,
NODE INTEGER NOT NULL,
QUEUE INTEGER NOT NULL,
CONSTRAINT PK_QUEUE_NODE_MAPPING PRIMARY KEY(ID),
CONSTRAINT UK_QUEUE_NODE_MAPPING_1 UNIQUE(QUEUE, NODE),
CONSTRAINT FK_QUEUE_NODE_MAPPING_1 FOREIGN KEY(NODE) REFERENCES __T__NODE(ID),
CONSTRAINT FK_QUEUE_NODE_MAPPING_2 FOREIGN KEY(QUEUE) REFERENCES __T__QUEUE(ID)
);
CREATE INDEX IDX_FK_QUEUE_NODE_MAPPING_1 ON __T__QUEUE_NODE_MAPPING(NODE);
CREATE INDEX IDX_FK_QUEUE_NODE_MAPPING_2 ON __T__QUEUE_NODE_MAPPING(QUEUE);
/* Execution context */
CREATE MEMORY TABLE __T__CL
(
ID INTEGER NOT NULL,
NAME VARCHAR(100) NOT NULL,
CHILD_FIRST BOOLEAN NOT NULL,
HIDDEN_CLASSES VARCHAR(1024),
TRACING BOOLEAN NOT NULL,
PERSISTENT BOOLEAN NOT NULL,
ALLOWED_RUNNERS VARCHAR(1024),
CONSTRAINT PK_CL PRIMARY KEY(ID),
CONSTRAINT UK_CL_1 UNIQUE(NAME)
);
CREATE MEMORY TABLE __T__CL_HANDLER
(
ID INTEGER NOT NULL,
EVENT_TYPE VARCHAR(100) NOT NULL,
CLASS_NAME VARCHAR(1024),
CL INTEGER NOT NULL,
CONSTRAINT PK_CL_HANDLER PRIMARY KEY(ID),
CONSTRAINT FK_CL_HANDLER_1 FOREIGN KEY(CL) REFERENCES __T__CL(ID)
);
CREATE INDEX IDX_FK_CL_HANDLER_1 ON __T__CL_HANDLER(CL);
CREATE MEMORY TABLE __T__CL_HANDLER_PARAMETER
(
ID INTEGER NOT NULL,
KEYNAME VARCHAR(50) NOT NULL,
VALUE VARCHAR(1000) NOT NULL,
CL_HANDLER INTEGER NOT NULL,
CONSTRAINT PK_CL_HANDLER_PARAMETER PRIMARY KEY(ID),
CONSTRAINT FK_CL_HANDLER_PARAMETER_1 FOREIGN KEY(CL_HANDLER) REFERENCES __T__CL_HANDLER(ID)
);
CREATE INDEX IDX_FK_CL_HANDLER_PARAMETER_1 ON __T__CL_HANDLER_PARAMETER(CL_HANDLER);
/* Job definition */
CREATE MEMORY TABLE __T__JOB_DEFINITION
(
ID INTEGER NOT NULL,
JD_KEY VARCHAR(100) NOT NULL,
DESCRIPTION VARCHAR(1024),
HIGHLANDER BOOLEAN NOT NULL,
PRIORITY INTEGER NULL,
QUEUE INTEGER NOT NULL,
ENABLED BOOLEAN NOT NULL,
RESTARTABLE BOOLEAN,
PATH VARCHAR(1024),
PATH_TYPE VARCHAR(255),
CLASS_NAME VARCHAR(100) NOT NULL,
EXTERNAL BOOLEAN NOT NULL,
JAVA_OPTS VARCHAR(1024),
CL INTEGER NULL,
ALERT_AFTER_SECONDS INTEGER,
APPLICATION VARCHAR(50),
KEYWORD1 VARCHAR(50),
KEYWORD2 VARCHAR(50),
KEYWORD3 VARCHAR(50),
MODULE VARCHAR(50),
CONSTRAINT PK_JOB_DEFINITION PRIMARY KEY(ID),
CONSTRAINT UK_JOB_DEFINITION_1 UNIQUE(JD_KEY),
CONSTRAINT FK_JOBDEF_1 FOREIGN KEY(QUEUE) REFERENCES __T__QUEUE(ID),
CONSTRAINT FK_JOBDEF_2 FOREIGN KEY(CL) REFERENCES __T__CL(ID)
);
CREATE INDEX IDX_FK_JOBDEF_1 ON __T__JOB_DEFINITION(QUEUE);
CREATE INDEX IDX_FK_JOBDEF_2 ON __T__JOB_DEFINITION(CL);
CREATE MEMORY TABLE __T__JOB_DEFINITION_PARAMETER
(
ID INTEGER NOT NULL,
KEYNAME VARCHAR(50) NOT NULL,
VALUE VARCHAR(1000) NOT NULL,
JOBDEF INTEGER,
CONSTRAINT PK_JOB_DEFINITION_PARAMETER PRIMARY KEY(ID),
CONSTRAINT FK_JOB_DEFINITION_PARAMETER_1 FOREIGN KEY(JOBDEF) REFERENCES __T__JOB_DEFINITION(ID)
);
CREATE INDEX IDX_FK_JOB_DEFINITION_PRM_1 ON __T__JOB_DEFINITION_PARAMETER(JOBDEF);
CREATE MEMORY TABLE __T__JOB_SCHEDULE
(
ID INTEGER NOT NULL,
CRON_EXPRESSION VARCHAR(254) NOT NULL,
JOBDEF INTEGER NOT NULL,
QUEUE INTEGER NULL,
PRIORITY INTEGER NULL,
LAST_UPDATED TIMESTAMP NOT NULL,
CONSTRAINT PK_JOB_SCHEDULE PRIMARY KEY(ID),
CONSTRAINT FK_JOB_SCHEDULE_1 FOREIGN KEY(JOBDEF) REFERENCES __T__JOB_DEFINITION(ID),
CONSTRAINT FK_JOB_SCHEDULE_2 FOREIGN KEY(QUEUE) REFERENCES __T__QUEUE(ID)
);
CREATE INDEX IDX_FK_JOB_SCHEDULE_1 ON __T__JOB_SCHEDULE(JOBDEF);
CREATE INDEX IDX_FK_JOB_SCHEDULE_2 ON __T__JOB_SCHEDULE(QUEUE);
CREATE INDEX IDX_JOB_SCHEDULE_1 ON __T__JOB_SCHEDULE(LAST_UPDATED);
CREATE MEMORY TABLE __T__JOB_SCHEDULE_PARAMETER
(
ID INTEGER NOT NULL,
KEYNAME VARCHAR(50) NOT NULL,
VALUE VARCHAR(1000) NOT NULL,
JOB_SCHEDULE INTEGER NOT NULL,
CONSTRAINT PK_JOB_SCHEDULE_PARAMETER PRIMARY KEY(ID),
CONSTRAINT FK_JOB_SCHEDULE_PARAMETER_1 FOREIGN KEY(JOB_SCHEDULE) REFERENCES __T__JOB_SCHEDULE(ID),
CONSTRAINT UK_JOB_SCHEDULER_PARAMETER_1 UNIQUE(KEYNAME, JOB_SCHEDULE)
);
CREATE INDEX IDX_FK_JOB_SCHEDULE_PRM_1 ON __T__JOB_SCHEDULE_PARAMETER(JOB_SCHEDULE);
/* Execution and history */
CREATE MEMORY TABLE __T__JOB_INSTANCE
(
ID INTEGER NOT NULL,
PARENT INTEGER,
DATE_ENQUEUE TIMESTAMP NOT NULL,
DATE_ATTRIBUTION TIMESTAMP NULL,
DATE_START TIMESTAMP NULL,
DATE_NOT_BEFORE TIMESTAMP NULL,
INTERNAL_POSITION REAL NOT NULL,
PRIORITY INTEGER NOT NULL,
STATUS VARCHAR(20) NOT NULL,
INSTRUCTION VARCHAR(20) NOT NULL,
HIGHLANDER BOOLEAN,
FROM_SCHEDULE BOOLEAN,
EMAIL VARCHAR(255),
APPLICATION VARCHAR(50),
KEYWORD1 VARCHAR(50),
KEYWORD2 VARCHAR(50),
KEYWORD3 VARCHAR(50),
MODULE VARCHAR(50),
SESSION_KEY VARCHAR(255),
USERNAME VARCHAR(50),
PROGRESS INTEGER,
JOBDEF INTEGER NOT NULL,
NODE INTEGER,
QUEUE INTEGER NOT NULL,
CONSTRAINT PK_JOB_INSTANCE PRIMARY KEY(ID),
CONSTRAINT FK_JOB_INSTANCE_1 FOREIGN KEY(JOBDEF) REFERENCES __T__JOB_DEFINITION(ID),
CONSTRAINT FK_JOB_INSTANCE_2 FOREIGN KEY(NODE) REFERENCES __T__NODE(ID),
CONSTRAINT FK_JOB_INSTANCE_3 FOREIGN KEY(QUEUE) REFERENCES __T__QUEUE(ID)
);
CREATE INDEX IDX_JOB_INSTANCE_1 ON __T__JOB_INSTANCE(QUEUE, STATUS);
CREATE INDEX IDX_JOB_INSTANCE_2 ON __T__JOB_INSTANCE(JOBDEF, STATUS);
CREATE INDEX IDX_JOB_INSTANCE_3 ON __T__JOB_INSTANCE(JOBDEF);
CREATE INDEX IDX_JOB_INSTANCE_4 ON __T__JOB_INSTANCE(NODE);
CREATE INDEX IDX_JOB_INSTANCE_5 ON __T__JOB_INSTANCE(QUEUE);
CREATE MEMORY TABLE __T__HISTORY
(
ID INTEGER NOT NULL, /* Not IDENTITY OR SEQUENCE!*/
PARENT INTEGER,
HIGHLANDER BOOLEAN,
FROM_SCHEDULE BOOLEAN,
PROGRESS INTEGER,
RETURN_CODE INTEGER,
PRIORITY INTEGER NULL,
STATUS VARCHAR(20) NOT NULL,
DATE_ENQUEUE TIMESTAMP NOT NULL,
DATE_ATTRIBUTION TIMESTAMP NULL,
DATE_START TIMESTAMP NULL,
DATE_END TIMESTAMP NULL,
EMAIL VARCHAR(255),
SESSION_KEY VARCHAR(255),
USERNAME VARCHAR(255),
INSTANCE_APPLICATION VARCHAR(50),
INSTANCE_KEYWORD1 VARCHAR(50),
INSTANCE_KEYWORD2 VARCHAR(50),
INSTANCE_KEYWORD3 VARCHAR(50),
INSTANCE_MODULE VARCHAR(50),
JD_APPLICATION VARCHAR(50),
JD_KEYWORD1 VARCHAR(50),
JD_KEYWORD2 VARCHAR(50),
JD_KEYWORD3 VARCHAR(50),
JD_MODULE VARCHAR(50),
JD_KEY VARCHAR(100) NOT NULL,
NODE_NAME VARCHAR(100),
QUEUE_NAME VARCHAR(50) NOT NULL,
JOBDEF INTEGER,
NODE INTEGER,
QUEUE INTEGER,
CONSTRAINT PK_HISTORY PRIMARY KEY(ID),
CONSTRAINT FK_HISTORY_1 FOREIGN KEY(JOBDEF) REFERENCES __T__JOB_DEFINITION(ID) ON DELETE SET NULL,
CONSTRAINT FK_HISTORY_2 FOREIGN KEY(NODE) REFERENCES __T__NODE(ID) ON DELETE SET NULL,
CONSTRAINT FK_HISTORY_3 FOREIGN KEY(QUEUE) REFERENCES __T__QUEUE(ID) ON DELETE SET NULL
);
CREATE INDEX IDX_FK_HISTORY_1 ON __T__HISTORY(JOBDEF);
CREATE INDEX IDX_FK_HISTORY_2 ON __T__HISTORY(NODE);
CREATE INDEX IDX_FK_HISTORY_3 ON __T__HISTORY(QUEUE);
CREATE MEMORY TABLE __T__DELIVERABLE
(
ID INTEGER NOT NULL,
FILE_FAMILY VARCHAR(100),
PATH VARCHAR(1024),
JOB_INSTANCE INTEGER NOT NULL, /* Not an FK, as this is used by both Hostory and JobDef */
ORIGINAL_FILE_NAME VARCHAR(1024),
RANDOM_ID VARCHAR(200) NOT NULL,
CONSTRAINT PK_DELIVERABLE PRIMARY KEY(ID),
CONSTRAINT UK_DELIVERABLE UNIQUE(RANDOM_ID)
);
CREATE INDEX IDX_FK_DELIVERABLE_1 ON __T__DELIVERABLE(JOB_INSTANCE);
CREATE MEMORY TABLE __T__JOB_INSTANCE_PARAMETER
(
ID INTEGER NOT NULL,
JOB_INSTANCE INTEGER, /* Not an FK, as this is used by both Hostory and JobDef */
KEYNAME VARCHAR(50) NOT NULL,
VALUE VARCHAR(1000) NOT NULL,
CONSTRAINT PK_JOB_INSTANCE_PARAMETER PRIMARY KEY(ID)
);
CREATE INDEX IDX_FK_JIP_1 ON __T__JOB_INSTANCE_PARAMETER(JOB_INSTANCE);
CREATE MEMORY TABLE __T__MESSAGE
(
ID INTEGER NOT NULL,
JOB_INSTANCE INTEGER NOT NULL,
TEXT_MESSAGE VARCHAR(1000) NOT NULL,
CONSTRAINT PK_MESSAGE PRIMARY KEY(ID)
);
CREATE INDEX IDX_FK_MESSAGE_1 ON __T__MESSAGE(JOB_INSTANCE);
/* JNDI registry */
CREATE MEMORY TABLE __T__JNDI_OBJECT_RESOURCE
(
ID INTEGER NOT NULL,
AUTH VARCHAR(20),
DESCRIPTION VARCHAR(250),
FACTORY VARCHAR(100) NOT NULL,
LAST_MODIFIED TIMESTAMP NULL,
NAME VARCHAR(100) NOT NULL,
SINGLETON BOOLEAN,
TEMPLATE VARCHAR(50),
TYPE VARCHAR(100) NOT NULL,
CONSTRAINT PK_JNDI_OBJECT_RESOURCE PRIMARY KEY(ID),
CONSTRAINT UK_JNDI_OBJECT_RESOURCE UNIQUE(NAME)
);
CREATE MEMORY TABLE __T__JNDI_OR_PARAMETER
(
ID INTEGER NOT NULL,
KEYNAME VARCHAR(50) NOT NULL,
LAST_MODIFIED TIMESTAMP NULL,
VALUE VARCHAR(250) NULL,
JNDI_OR INTEGER NOT NULL,
CONSTRAINT PK_JNDI_OR_PARAMETER PRIMARY KEY(ID),
CONSTRAINT UK_JNDI_OR_PARAMETER_1 UNIQUE(KEYNAME, JNDI_OR),
CONSTRAINT FK_JNDI_OR_PARAMETER_1 FOREIGN KEY(JNDI_OR) REFERENCES __T__JNDI_OBJECT_RESOURCE(ID) ON DELETE CASCADE
);
CREATE INDEX IDX_FK_JNDI_OR_PARAMETER_1 ON __T__JNDI_OR_PARAMETER(JNDI_OR);
/* Security */
CREATE MEMORY TABLE __T__PKI
(
ID INTEGER NOT NULL,
PEM_CERT VARCHAR(4000) NOT NULL,
PEM_PK VARCHAR(4000) NOT NULL,
PRETTY_NAME VARCHAR(100) NOT NULL,
CONSTRAINT PK_PKI PRIMARY KEY(ID),
CONSTRAINT UK_PKI_1 UNIQUE(PRETTY_NAME)
);
CREATE MEMORY TABLE __T__RROLE
(
ID INTEGER NOT NULL,
DESCRIPTION VARCHAR(254) NOT NULL,
NAME VARCHAR(100) NOT NULL,
CONSTRAINT PK_RROLE PRIMARY KEY(ID),
CONSTRAINT UK_RROLE_1 UNIQUE(NAME)
);
CREATE MEMORY TABLE __T__RPERMISSION
(
ID INTEGER NOT NULL,
NAME VARCHAR(254) NOT NULL,
ROLE INTEGER NOT NULL,
CONSTRAINT PK_RPERMISSION PRIMARY KEY(ID),
CONSTRAINT FK_RPERMISSION_1 FOREIGN KEY(ROLE) REFERENCES __T__RROLE(ID) ON DELETE CASCADE
);
CREATE INDEX IDX_FK_RPERMISSION_1 ON __T__RPERMISSION(ROLE);
CREATE MEMORY TABLE __T__RUSER
(
ID INTEGER NOT NULL,
CREATION_DATE TIMESTAMP NOT NULL,
EMAIL VARCHAR(254),
EXPIRATION_DATE TIMESTAMP NULL,
FREETEXT VARCHAR(254),
HASHSALT VARCHAR(254),
INTERNAL BOOLEAN,
LAST_MODIFIED TIMESTAMP NOT NULL,
LOCKED BOOLEAN NOT NULL,
LOGIN VARCHAR(100) NOT NULL,
PASSWORD VARCHAR(254),
CONSTRAINT PK_RUSER PRIMARY KEY(ID),
CONSTRAINT UK_RUSER_1 UNIQUE(LOGIN)
);
CREATE MEMORY TABLE __T__RROLE_RUSER
(
ID INTEGER NOT NULL, /* not actually needed, but simplifies things Java-side */
ROLE INTEGER NOT NULL,
ACCOUNT INTEGER NOT NULL, /* USER is a reserved keyword */
CONSTRAINT PK_RROLE_RUSER PRIMARY KEY(ID),
CONSTRAINT UK_RROLE_RUSER_1 UNIQUE(ROLE, ACCOUNT),
CONSTRAINT FK_RROLE_RUSER_1 FOREIGN KEY(ROLE) REFERENCES __T__RROLE(ID) ON DELETE CASCADE,
CONSTRAINT FK_RROLE_RUSER_2 FOREIGN KEY(ACCOUNT) REFERENCES __T__RUSER(ID) ON DELETE CASCADE
);
CREATE INDEX IDX_FK_RROLE_RUSER_1 ON __T__RROLE_RUSER(ROLE);
CREATE INDEX IDX_FK_RROLE_RUSER_2 ON __T__RROLE_RUSER(ACCOUNT);
/* Misc */
CREATE MEMORY TABLE __T__GLOBAL_PARAMETER
(
ID INTEGER NOT NULL,
KEYNAME VARCHAR(50) NOT NULL,
LAST_MODIFIED TIMESTAMP NOT NULL,
VALUE VARCHAR(1000) NOT NULL,
CONSTRAINT PK_GLOBAL_PARAMETER PRIMARY KEY(ID),
CONSTRAINT UK_GLOBAL_PARAMETER_1 UNIQUE(KEYNAME)
);
CREATE MEMORY TABLE __T__WITNESS
(
ID INTEGER NOT NULL,
KEYNAME VARCHAR(20) NOT NULL,
NODE INTEGER NULL,
LATEST_CONTACT TIMESTAMP NULL,
CONSTRAINT PK_WITNESS PRIMARY KEY(ID),
CONSTRAINT UK_WITNESS_1 UNIQUE(KEYNAME)
); | the_stack |
-- table naming convention has changed
alter table dictionary rename to mh_dictionary;
alter table host_registration rename to mh_host_registration;
alter table job rename to mh_job;
alter table job_arguments rename to mh_job_argument;
alter table matterhorn_role rename to mh_matterhorn_role;
alter table scheduled_event rename to mh_scheduled_event;
alter table series rename to mh_series;
alter table service_registration rename to mh_service_registration;
alter table matterhorn_user rename to mh_matterhorn_user;
alter table capture_agent_role rename to mh_capture_agent_role;
alter table capture_agent_state rename to mh_capture_agent_state;
alter table annotation rename to mh_annotation;
alter table job_context rename to mh_job_context;
alter table upload rename to mh_upload;
alter table user_action rename to mh_user_action;
alter table oaipmh_harvesting rename to mh_oaipmh_harvesting;
-- new tables for Episode Serivice
-- taken from the DDL script for 1.4
-- Organization Tables
CREATE TABLE "mh_organization" (
"id" character varying(128) NOT NULL,
"anonymous_role" character varying(255),
"name" character varying(255),
"admin_role" character varying(255),
PRIMARY KEY ("id")
);
CREATE TABLE "mh_organization_node" (
"organization" character varying(128) NOT NULL,
"port" integer,
"name" character varying(255),
PRIMARY KEY ("organization", "port", "name"),
CONSTRAINT "FK_mh_organization_node_organization" FOREIGN KEY ("organization") REFERENCES "mh_organization" ("id")
);
CREATE INDEX "IX_mh_organization_node_pk" ON "mh_organization_node" ("organization");
CREATE INDEX "IX_mh_organization_node_name" ON "mh_organization_node" ("name");
CREATE INDEX "IX_mh_organization_node_port" ON "mh_organization_node" ("port");
CREATE TABLE "mh_episode_episode" (
"id" character varying(128) NOT NULL,
"version" bigint NOT NULL,
"organization" character varying(128),
"deletion_date" timestamp,
"access_control" text,
"mediapackage_xml" text,
"modification_date" timestamp,
PRIMARY KEY ("id", "version", "organization"),
CONSTRAINT "FK_mh_episode_episode_organization" FOREIGN KEY ("organization") REFERENCES "mh_organization" ("id")
);
CREATE INDEX "IX_mh_episode_episode_mediapackage" ON "mh_episode_episode" ("id");
CREATE INDEX "IX_mh_episode_episode_version" ON "mh_episode_episode" ("version");
CREATE TABLE "mh_episode_asset" (
"id" bigint NOT NULL,
"mediapackageelement" character varying(128) NOT NULL,
"mediapackage" character varying(128) NOT NULL,
"organization" character varying(128) NOT NULL,
"checksum" character varying(255) NOT NULL,
"uri" character varying(255) NOT NULL,
"version" bigint NOT NULL,
PRIMARY KEY ("id"),
CONSTRAINT "UNQ_mh_episode_asset_0" UNIQUE ("organization", "mediapackage", "mediapackageelement", "version"),
CONSTRAINT "FK_mh_episode_asset_organization" FOREIGN KEY ("organization") REFERENCES "mh_organization" ("id")
);
CREATE INDEX "IX_mh_episode_asset_mediapackage" ON "mh_episode_asset" ("mediapackage");
CREATE INDEX "IX_mh_episode_asset_checksum" ON "mh_episode_asset" ("checksum");
CREATE INDEX "IX_mh_episode_asset_uri" ON "mh_episode_asset" ("uri");
CREATE TABLE "mh_episode_version_claim" (
"mediapackage" character varying(128) NOT NULL,
"last_claimed" bigint NOT NULL,
PRIMARY KEY ("mediapackage")
);
CREATE INDEX "IX_mh_episode_version_claim_mediapackage" ON "mh_episode_version_claim" ("mediapackage");
CREATE INDEX "IX_mh_episode_version_claim_last_claimed" ON "mh_episode_version_claim" ("last_claimed");
-- how to handle user & role? May be in & in 1.4 ddl but not in 1.3 ddl now mh_user and mh_role
CREATE TABLE IF NOT EXISTS "mh_user" (
"username" character varying(128) NOT NULL,
"organization" character varying(128) NOT NULL,
"password" text,
PRIMARY KEY ("username", "organization")
);
CREATE TABLE IF NOT EXISTS "mh_role" (
"username" character varying(128) NOT NULL,
"organization" character varying(128) NOT NULL,
"role" text
);
CREATE INDEX "IX_mh_role_pk" ON "mh_role" ("username", "organization");
-- MH-8647
CREATE TABLE "mh_search" (
"id" character varying(128) NOT NULL,
"organization" character varying(128),
"deletion_date" timestamp,
"access_control" text,
"mediapackage_xml" text,
"modification_date" timestamp,
PRIMARY KEY ("id"),
CONSTRAINT "FK_mh_search_organization" FOREIGN KEY ("organization") REFERENCES "mh_organization" ("id")
);
-- MH-8648 UCB Features
ALTER TABLE "mh_annotation" ADD COLUMN "private" boolean DEFAULT FALSE;
ALTER TABLE "mh_host_registration" ADD COLUMN "active" boolean DEFAULT TRUE;
ALTER TABLE "mh_service_registration" ADD COLUMN "active" boolean DEFAULT TRUE;
ALTER TABLE "mh_service_registration" ADD COLUMN "service_state" integer NOT NULL;
ALTER TABLE "mh_service_registration" ADD COLUMN "state_changed" timestamp;
ALTER TABLE "mh_service_registration" ADD COLUMN "warning_state_trigger" bigint;
ALTER TABLE "mh_service_registration" ADD COLUMN "error_state_trigger" bigint;
ALTER TABLE "mh_service_registration" ADD COLUMN "online_from" timestamp;
CREATE INDEX IX_mh_organization_node_pk ON mh_organization_node (organization);
CREATE INDEX IX_mh_organization_node_name ON mh_organization_node (name);
CREATE INDEX IX_mh_organization_node_port ON mh_organization_node (port);
CREATE TABLE mh_organization_property (
organization VARCHAR(128) NOT NULL,
name VARCHAR(255),
value VARCHAR(255),
PRIMARY KEY (organization, name),
CONSTRAINT FK_mh_organization_property_organization FOREIGN KEY (organization) REFERENCES mh_organization (id)
);
CREATE INDEX IX_mh_organization_property_pk ON mh_organization_property (organization);
-- rename fields
ALTER TABLE "mh_annotation" RENAME COLUMN "mediapackage_id" TO "mediapackage";
ALTER TABLE "mh_annotation" RENAME COLUMN "session_id" TO "session";
ALTER TABLE "mh_annotation" RENAME COLUMN "user_id" TO "user";
ALTER TABLE "mh_annotation" RENAME COLUMN "annotation_type" TO "type";
ALTER TABLE "mh_annotation" RENAME COLUMN "annotation_value" TO "value";
-- ALTER TABLE "mh_annotation" RENAME COLUMN "private_annotation" TO "private";
ALTER TABLE "mh_job" RENAME COLUMN "parent_id" TO "parent";
ALTER TABLE "mh_job" RENAME COLUMN "root_id" TO "root";
ALTER TABLE "mh_job" RENAME COLUMN "is_dispatchable" TO "dispatchable";
ALTER TABLE "mh_job_argument" RENAME COLUMN "list_index" TO "argument_index";
ALTER TABLE "mh_job_context" RENAME COLUMN "root_job" TO "id";
ALTER TABLE "mh_job_context" RENAME COLUMN "key_entry" TO "name";
ALTER TABLE "mh_scheduled_event" RENAME COLUMN "event_id" TO "id";
ALTER TABLE "mh_series" RENAME COLUMN "series_id" TO "id";
ALTER TABLE "mh_series" RENAME COLUMN "organization_id" TO "organization";
ALTER TABLE "mh_user_action" RENAME COLUMN "mediapackage_id" TO "mediapackage";
ALTER TABLE "mh_user_action" RENAME COLUMN "session_id" TO "session";
ALTER TABLE "mh_user_action" RENAME COLUMN "user_id" TO "user";
ALTER TABLE "mh_user_action" RENAME COLUMN "is_playing" TO "playing";
-- add primary keys
ALTER TABLE "mh_capture_agent_role" ADD PRIMARY KEY ("id", "organization", "role");
-- add constraints
ALTER TABLE "mh_capture_agent_role" ADD CONSTRAINT "FK_mh_capture_agent_role_organization" FOREIGN KEY ("organization") REFERENCES "mh_organization" ("id");
ALTER TABLE "mh_capture_agent_state" ADD CONSTRAINT "FK_mh_capture_agent_state_organization" FOREIGN KEY ("organization") REFERENCES "mh_organization" ("id");
ALTER TABLE "mh_host_registration" ADD CONSTRAINT "UNQ_mh_host_registration_0" UNIQUE ("host");
ALTER TABLE "mh_service_registration" ADD CONSTRAINT "FK_service_registration_host_registration" FOREIGN KEY ("host_registration") REFERENCES "mh_host_registration" ("id");
ALTER TABLE "mh_job" ADD CONSTRAINT "FK_mh_job_creator_service" FOREIGN KEY ("creator_service") REFERENCES "mh_service_registration" ("id");
ALTER TABLE "mh_job" ADD CONSTRAINT "FK_mh_job_processor_service" FOREIGN KEY ("processor_service") REFERENCES "mh_service_registration" ("id");
ALTER TABLE "mh_job" ADD CONSTRAINT "FK_mh_job_parent" FOREIGN KEY ("parent") REFERENCES "mh_job" ("id");
ALTER TABLE "mh_job" ADD CONSTRAINT "FK_mh_job_root" FOREIGN KEY ("root") REFERENCES "mh_job" ("id");
ALTER TABLE "mh_job" ADD CONSTRAINT "FK_mh_job_organization" FOREIGN KEY ("organization") REFERENCES "mh_organization" ("id");
ALTER TABLE "mh_job_argument" ADD CONSTRAINT "FK_mh_job_argument_id" FOREIGN KEY ("id") REFERENCES "mh_job" ("id");
ALTER TABLE "mh_job_context" ADD CONSTRAINT "FK_mh_job_context_id" FOREIGN KEY ("id") REFERENCES "mh_job" ("id");
ALTER TABLE "mh_user" ADD CONSTRAINT "FK_mh_user_organization" FOREIGN KEY ("organization") REFERENCES "mh_organization" ("id");
ALTER TABLE "mh_role" ADD CONSTRAINT "FK_mh_role_username" FOREIGN KEY ("username", "organization") REFERENCES "mh_user" ("username", "organization");
ALTER TABLE "mh_role" ADD CONSTRAINT "FK_mh_role_organization" FOREIGN KEY ("organization") REFERENCES "mh_organization" ("id");
ALTER TABLE "mh_series" ADD CONSTRAINT "FK_mh_series_organization" FOREIGN KEY ("organization") REFERENCES "mh_organization" ("id");
-- add indices
CREATE INDEX "IX_mh_annotation_created" ON "mh_annotation" ("created");
CREATE INDEX "IX_mh_annotation_inpoint" ON "mh_annotation" ("inpoint");
CREATE INDEX "IX_mh_annotation_outpoint" ON "mh_annotation" ("outpoint");
CREATE INDEX "IX_mh_annotation_mediapackage" ON "mh_annotation" ("mediapackage");
CREATE INDEX "IX_mh_annotation_private" ON "mh_annotation" ("private");
CREATE INDEX "IX_mh_annotation_user" ON "mh_annotation" ("user");
CREATE INDEX "IX_mh_annotation_session" ON "mh_annotation" ("session");
CREATE INDEX "IX_mh_annotation_type" ON "mh_annotation" ("type");
CREATE INDEX "IX_mh_capture_agent_role" ON "mh_capture_agent_role" ("id", "organization");
CREATE INDEX "IX_mh_dictionary_weight" ON "mh_dictionary" ("weight");
CREATE INDEX "IX_mh_host_registration_online" ON "mh_host_registration" ("online");
CREATE INDEX "IX_mh_host_registration_active" ON "mh_host_registration" ("active");
CREATE INDEX "IX_mh_service_registration_service_type" ON "mh_service_registration" ("service_type");
CREATE INDEX "IX_mh_service_registration_service_state" ON "mh_service_registration" ("service_state");
CREATE INDEX "IX_mh_service_registration_active" ON "mh_service_registration" ("active");
CREATE INDEX "IX_mh_service_registration_host_registration" ON "mh_service_registration" ("host_registration");
CREATE INDEX "IX_mh_job_parent" ON "mh_job" ("parent");
CREATE INDEX "IX_mh_job_root" ON "mh_job" ("root");
CREATE INDEX "IX_mh_job_creator_service" ON "mh_job" ("creator_service");
CREATE INDEX "IX_mh_job_processor_service" ON "mh_job" ("processor_service");
CREATE INDEX "IX_mh_job_status" ON "mh_job" ("status");
CREATE INDEX "IX_mh_job_date_created" ON "mh_job" ("date_created");
CREATE INDEX "IX_mh_job_date_completed" ON "mh_job" ("date_completed");
CREATE INDEX "IX_mh_job_dispatchable" ON "mh_job" ("dispatchable");
CREATE INDEX "IX_mh_job_operation" ON "mh_job" ("operation");
CREATE INDEX "IX_mh_job_argument_id" ON "mh_job_argument" ("id");
CREATE INDEX "IX_mh_job_context_id" ON "mh_job_context" ("id");
CREATE INDEX "IX_mh_user_action_created" ON "mh_user_action" ("created");
CREATE INDEX "IX_mh_user_action_inpoint" ON "mh_user_action" ("inpoint");
CREATE INDEX "IX_mh_user_action_outpoint" ON "mh_user_action" ("outpoint");
CREATE INDEX "IX_mh_user_action_mediapackage" ON "mh_user_action" ("mediapackage");
CREATE INDEX "IX_mh_user_action_user" ON "mh_user_action" ("user");
CREATE INDEX "IX_mh_user_action_session" ON "mh_user_action" ("session");
CREATE INDEX "IX_mh_user_action_type" ON "mh_user_action" ("type"); | the_stack |
--: ----------------------------------------------------------------------------
--: Copyright (C) 2017 Verizon. All Rights Reserved.
--:
--: Licensed under the Apache License, Version 2.0 (the "License");
--: you may not use this file except in compliance with the License.
--: You may obtain a copy of the License at
--:
--: http://www.apache.org/licenses/LICENSE-2.0
--:
--: Unless required by applicable law or agreed to in writing, software
--: distributed under the License is distributed on an "AS IS" BASIS,
--: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--: See the License for the specific language governing permissions and
--: limitations under the License.
--:
--: ----------------------------------------------------------------------------
CREATE SEQUENCE PUBLIC.SYSTEM_SEQUENCE_C4953F67_DF00_4DE9_B7B8_9EF750F3F0E2 START WITH 1 BELONGS_TO_TABLE;
CREATE SEQUENCE PUBLIC.SYSTEM_SEQUENCE_CFF927A0_B332_4847_B09F_F893CDDC632F START WITH 0 BELONGS_TO_TABLE;
CREATE SEQUENCE PUBLIC.SYSTEM_SEQUENCE_B3287B6B_8976_4D6F_BCD0_998C90EA65A2 START WITH 0 BELONGS_TO_TABLE;
CREATE SEQUENCE PUBLIC.SYSTEM_SEQUENCE_8D9BAA7A_6D0A_47E6_9351_5297B94040E4 START WITH 0 BELONGS_TO_TABLE;
CREATE SEQUENCE PUBLIC.SYSTEM_SEQUENCE_15FD08D0_DDC1_4ECB_8FB3_38AB48CE23B4 START WITH 0 BELONGS_TO_TABLE;
CREATE SEQUENCE PUBLIC.SYSTEM_SEQUENCE_74CA8882_CA83_4DDE_8076_3C5418BEF8DB START WITH 0 BELONGS_TO_TABLE;
CREATE SEQUENCE PUBLIC.SYSTEM_SEQUENCE_82B3DAB6_30D4_4A6C_BBC7_19B0AB1B0B2D START WITH 0 BELONGS_TO_TABLE;
CREATE SEQUENCE PUBLIC.SYSTEM_SEQUENCE_83948908_3625_409D_B8DA_0CAA2190994C START WITH 0 BELONGS_TO_TABLE;
CREATE SEQUENCE PUBLIC.SYSTEM_SEQUENCE_058F9373_F2CF_4FBD_A3C7_292A3061A95A START WITH 1 BELONGS_TO_TABLE;
CREATE SEQUENCE PUBLIC.SYSTEM_SEQUENCE_4D9E1F50_01EB_4E0D_BF67_F8377FEEBF85 START WITH 0 BELONGS_TO_TABLE;
CREATE SEQUENCE PUBLIC.SYSTEM_SEQUENCE_F0EA93F1_AB0B_4262_B55A_A61B178FCF7F START WITH 0 BELONGS_TO_TABLE;
CREATE SEQUENCE PUBLIC.SYSTEM_SEQUENCE_FA7B84B5_2965_4327_8CDE_8A27CAD12458 START WITH 0 BELONGS_TO_TABLE;
CREATE SEQUENCE PUBLIC.SYSTEM_SEQUENCE_37BBCB01_F6C9_48A1_963B_FDA8724B2CB1 START WITH 0 BELONGS_TO_TABLE;
CREATE SEQUENCE PUBLIC.SYSTEM_SEQUENCE_AD03FD8F_2979_46F8_B967_A03942036851 START WITH 0 BELONGS_TO_TABLE;
CREATE SEQUENCE PUBLIC.SYSTEM_SEQUENCE_6D6D8253_D983_45BF_B007_F99A26BC6689 START WITH 0 BELONGS_TO_TABLE;
CREATE CACHED TABLE PUBLIC."repositories"(
"id" BIGINT NOT NULL,
"slug" VARCHAR(250) NOT NULL,
"hook_id" BIGINT DEFAULT NULL,
"hook_is_active" BOOLEAN DEFAULT FALSE,
"description" VARCHAR(255) DEFAULT NULL,
"is_deleted" BOOLEAN NOT NULL DEFAULT FALSE
);
ALTER TABLE PUBLIC."repositories" ADD CONSTRAINT PUBLIC."repository_pk" PRIMARY KEY("id");
-- 1 +/- SELECT COUNT(*) FROM PUBLIC."repositories";
INSERT INTO PUBLIC."repositories"("id", "slug", "hook_id", "hook_is_active", "description") VALUES
(-1, 'manual', NULL, FALSE, 'manually deployed');
CREATE CACHED TABLE PUBLIC."loadbalancers"(
"id" BIGINT DEFAULT (NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_B3287B6B_8976_4D6F_BCD0_998C90EA65A2) NOT NULL NULL_TO_DEFAULT SEQUENCE PUBLIC.SYSTEM_SEQUENCE_B3287B6B_8976_4D6F_BCD0_998C90EA65A2,
"name" VARCHAR(100) NOT NULL,
"major_version" SMALLINT NOT NULL,
"repository_id" BIGINT NOT NULL
);
ALTER TABLE PUBLIC."loadbalancers" ADD CONSTRAINT PUBLIC.CONSTRAINT_E PRIMARY KEY("id");
-- 0 +/- SELECT COUNT(*) FROM PUBLIC."loadbalancers";
CREATE CACHED TABLE PUBLIC."traffic_shifts"(
"id" BIGINT DEFAULT (NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_82B3DAB6_30D4_4A6C_BBC7_19B0AB1B0B2D) NOT NULL NULL_TO_DEFAULT SEQUENCE PUBLIC.SYSTEM_SEQUENCE_82B3DAB6_30D4_4A6C_BBC7_19B0AB1B0B2D,
"policy" VARCHAR(15) NOT NULL,
"duration" LONG NOT NULL,
"to_deployment" INTEGER NOT NULL,
"namespace_id" INTEGER NOT NULL
);
ALTER TABLE PUBLIC."traffic_shifts" ADD CONSTRAINT PUBLIC.CONSTRAINT_89 PRIMARY KEY("id");
-- 0 +/- SELECT COUNT(*) FROM PUBLIC."traffic_shifts";
CREATE CACHED TABLE PUBLIC."user_repositories"(
"id" BIGINT DEFAULT (NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_F0EA93F1_AB0B_4262_B55A_A61B178FCF7F) NOT NULL NULL_TO_DEFAULT SEQUENCE PUBLIC.SYSTEM_SEQUENCE_F0EA93F1_AB0B_4262_B55A_A61B178FCF7F,
"repository_id" BIGINT NOT NULL,
"login" VARCHAR(100) NOT NULL,
"access" VARCHAR(10) NOT NULL
);
ALTER TABLE PUBLIC."user_repositories" ADD CONSTRAINT PUBLIC.CONSTRAINT_3 PRIMARY KEY("id");
-- 0 +/- SELECT COUNT(*) FROM PUBLIC."user_repositories";
CREATE CACHED TABLE PUBLIC."unit_dependencies"(
"from_unit" INTEGER NOT NULL,
"to_service" VARCHAR(64),
"to_version" VARCHAR(24)
);
-- 0 +/- SELECT COUNT(*) FROM PUBLIC."unit_dependencies";
CREATE CACHED TABLE PUBLIC."releases"(
"repository_id" BIGINT NOT NULL,
"version" VARCHAR(24) NOT NULL,
"release_id" VARCHAR(25) DEFAULT NULL,
"release_url" VARCHAR(200) DEFAULT NULL,
"release_html_url" VARCHAR(200) DEFAULT NULL,
"timestamp" BIGINT NOT NULL,
"guid" VARCHAR(32) DEFAULT LEFT(CONVERT(SECURE_RAND(64),VARCHAR(32)), 12) NOT NULL
);
ALTER TABLE PUBLIC."releases" ADD CONSTRAINT PUBLIC."repository_version_pk" PRIMARY KEY("repository_id", "version");
-- 0 +/- SELECT COUNT(*) FROM PUBLIC."releases";
CREATE INDEX PUBLIC."releases_guid_idx" ON PUBLIC."releases"("guid");
CREATE CACHED TABLE PUBLIC."service_ports"(
"unit" INTEGER NOT NULL,
"port" INTEGER NOT NULL,
"ref" VARCHAR(64) NOT NULL,
"protocol" VARCHAR(17) NOT NULL
);
ALTER TABLE PUBLIC."service_ports" ADD CONSTRAINT PUBLIC."service_port_pk" PRIMARY KEY("unit", "ref");
-- 0 +/- SELECT COUNT(*) FROM PUBLIC."service_ports";
CREATE CACHED TABLE PUBLIC."traffic_shift_start"(
"id" BIGINT DEFAULT (NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_6D6D8253_D983_45BF_B007_F99A26BC6689) NOT NULL NULL_TO_DEFAULT SEQUENCE PUBLIC.SYSTEM_SEQUENCE_6D6D8253_D983_45BF_B007_F99A26BC6689,
"traffic_shift_id" LONG NOT NULL,
"start_time" LONG NOT NULL,
"from_deployment" INTEGER NOT NULL
);
ALTER TABLE PUBLIC."traffic_shift_start" ADD CONSTRAINT PUBLIC.CONSTRAINT_A PRIMARY KEY("id");
-- 0 +/- SELECT COUNT(*) FROM PUBLIC."traffic_shift_start";
CREATE CACHED TABLE PUBLIC."deployments"(
"id" BIGINT DEFAULT (NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_FA7B84B5_2965_4327_8CDE_8A27CAD12458) NOT NULL NULL_TO_DEFAULT SEQUENCE PUBLIC.SYSTEM_SEQUENCE_FA7B84B5_2965_4327_8CDE_8A27CAD12458,
"unit_id" INTEGER NOT NULL,
"hash" VARCHAR(20) NOT NULL,
"namespace_id" INTEGER NOT NULL,
"deploy_time" BIGINT NOT NULL,
"workflow" VARCHAR(16) NOT NULL,
"guid" VARCHAR(32) DEFAULT LEFT(CONVERT(SECURE_RAND(64),VARCHAR(32)), 12) NOT NULL,
"plan" VARCHAR(64),
"expiration_policy" VARCHAR(30) NOT NULL
);
ALTER TABLE PUBLIC."deployments" ADD CONSTRAINT PUBLIC.CONSTRAINT_F PRIMARY KEY("id");
-- 0 +/- SELECT COUNT(*) FROM PUBLIC."deployments";
CREATE INDEX PUBLIC."deployments_guid_idx" ON PUBLIC."deployments"("guid");
CREATE CACHED TABLE PUBLIC."audit_log"(
"id" BIGINT DEFAULT (NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_15FD08D0_DDC1_4ECB_8FB3_38AB48CE23B4) NOT NULL NULL_TO_DEFAULT SEQUENCE PUBLIC.SYSTEM_SEQUENCE_15FD08D0_DDC1_4ECB_8FB3_38AB48CE23B4,
"release_id" BIGINT,
"event" CLOB(4096) NOT NULL,
"category" VARCHAR(24) NOT NULL,
"action" VARCHAR(24) NOT NULL,
"timestamp" BIGINT NOT NULL,
"login" VARCHAR(100) NOT NULL
);
ALTER TABLE PUBLIC."audit_log" ADD CONSTRAINT PUBLIC.CONSTRAINT_B8 PRIMARY KEY("id");
-- 0 +/- SELECT COUNT(*) FROM PUBLIC."audit_log";
CREATE CACHED TABLE PUBLIC."deployment_expiration"(
"id" BIGINT DEFAULT (NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_CFF927A0_B332_4847_B09F_F893CDDC632F) NOT NULL NULL_TO_DEFAULT SEQUENCE PUBLIC.SYSTEM_SEQUENCE_CFF927A0_B332_4847_B09F_F893CDDC632F,
"deployment_id" BIGINT NOT NULL,
"expiration" BIGINT NOT NULL
);
ALTER TABLE PUBLIC."deployment_expiration" ADD CONSTRAINT PUBLIC.CONSTRAINT_34 PRIMARY KEY("id");
-- 0 +/- SELECT COUNT(*) FROM PUBLIC."deployment_expiration";
CREATE CACHED TABLE PUBLIC."deployment_statuses"(
"deployment_id" INTEGER NOT NULL,
"state" VARCHAR(25) NOT NULL,
"status_msg" TEXT,
"id" BIGINT DEFAULT (NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_C4953F67_DF00_4DE9_B7B8_9EF750F3F0E2) NOT NULL NULL_TO_DEFAULT SEQUENCE PUBLIC.SYSTEM_SEQUENCE_C4953F67_DF00_4DE9_B7B8_9EF750F3F0E2,
"status_time" BIGINT NOT NULL
);
ALTER TABLE PUBLIC."deployment_statuses" ADD CONSTRAINT PUBLIC.CONSTRAINT_C PRIMARY KEY("id");
-- 0 +/- SELECT COUNT(*) FROM PUBLIC."deployment_statuses";
CREATE CACHED TABLE PUBLIC."datacenters"(
"name" VARCHAR(25) NOT NULL,
"registry_location" VARCHAR(255),
"consul_location" VARCHAR(255),
"mesos_location" VARCHAR(255),
"marathon_location" VARCHAR(255),
"chronos_location" VARCHAR(255),
"guid" VARCHAR(32) DEFAULT LEFT(CONVERT(SECURE_RAND(64),VARCHAR(32)), 12) NOT NULL
);
ALTER TABLE PUBLIC."datacenters" ADD CONSTRAINT PUBLIC."datacenters_pk" PRIMARY KEY("name");
-- 1 +/- SELECT COUNT(*) FROM PUBLIC."datacenters";
CREATE INDEX PUBLIC."datacenters_guid_idx" ON PUBLIC."datacenters"("guid");
CREATE CACHED TABLE PUBLIC."namespaces"(
"id" BIGINT DEFAULT (NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_058F9373_F2CF_4FBD_A3C7_292A3061A95A) NOT NULL NULL_TO_DEFAULT SEQUENCE PUBLIC.SYSTEM_SEQUENCE_058F9373_F2CF_4FBD_A3C7_292A3061A95A,
"datacenter" VARCHAR(25) NOT NULL,
"name" VARCHAR(64) NOT NULL,
"guid" VARCHAR(32) DEFAULT LEFT(CONVERT(SECURE_RAND(64),VARCHAR(32)), 12) NOT NULL
);
ALTER TABLE PUBLIC."namespaces" ADD CONSTRAINT PUBLIC.CONSTRAINT_9C PRIMARY KEY("id");
-- 1 +/- SELECT COUNT(*) FROM PUBLIC."namespaces";
CREATE INDEX PUBLIC."namespaces_guid_idx" ON PUBLIC."namespaces"("guid");
CREATE CACHED TABLE PUBLIC."loadbalancer_deployments"(
"id" BIGINT DEFAULT (NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_83948908_3625_409D_B8DA_0CAA2190994C) NOT NULL NULL_TO_DEFAULT SEQUENCE PUBLIC.SYSTEM_SEQUENCE_83948908_3625_409D_B8DA_0CAA2190994C,
"hash" VARCHAR(10) NOT NULL,
"loadbalancer_id" BIGINT NOT NULL,
"namespace_id" BIGINT NOT NULL,
"deploy_time" LONG NOT NULL,
"guid" VARCHAR(32) DEFAULT LEFT(CONVERT(SECURE_RAND(64),VARCHAR(32)), 12) NOT NULL,
"address" VARCHAR(80) NOT NULL
);
ALTER TABLE PUBLIC."loadbalancer_deployments" ADD CONSTRAINT PUBLIC.CONSTRAINT_5 PRIMARY KEY("id");
-- 0 +/- SELECT COUNT(*) FROM PUBLIC."loadbalancer_deployments";
CREATE INDEX PUBLIC."loadbalancer_deployments_idx" ON PUBLIC."loadbalancer_deployments"("guid");
CREATE CACHED TABLE PUBLIC."unit_resources"(
"id" BIGINT DEFAULT (NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_4D9E1F50_01EB_4E0D_BF67_F8377FEEBF85) NOT NULL NULL_TO_DEFAULT SEQUENCE PUBLIC.SYSTEM_SEQUENCE_4D9E1F50_01EB_4E0D_BF67_F8377FEEBF85,
"unit_id" BIGINT NOT NULL,
"name" VARCHAR(100) NOT NULL
);
ALTER TABLE PUBLIC."unit_resources" ADD CONSTRAINT PUBLIC.CONSTRAINT_8 PRIMARY KEY("id");
-- 0 +/- SELECT COUNT(*) FROM PUBLIC."unit_resources";
CREATE CACHED TABLE PUBLIC."traffic_shift_reverse"(
"id" BIGINT DEFAULT (NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_8D9BAA7A_6D0A_47E6_9351_5297B94040E4) NOT NULL NULL_TO_DEFAULT SEQUENCE PUBLIC.SYSTEM_SEQUENCE_8D9BAA7A_6D0A_47E6_9351_5297B94040E4,
"traffic_shift_id" LONG NOT NULL,
"reverse_time" LONG NOT NULL
);
ALTER TABLE PUBLIC."traffic_shift_reverse" ADD CONSTRAINT PUBLIC.CONSTRAINT_FD PRIMARY KEY("id");
-- 0 +/- SELECT COUNT(*) FROM PUBLIC."traffic_shift_reverse";
CREATE CACHED TABLE PUBLIC."deployment_resources"(
"id" BIGINT DEFAULT (NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_74CA8882_CA83_4DDE_8076_3C5418BEF8DB) NOT NULL NULL_TO_DEFAULT SEQUENCE PUBLIC.SYSTEM_SEQUENCE_74CA8882_CA83_4DDE_8076_3C5418BEF8DB,
"deployment_id" BIGINT NOT NULL,
"name" VARCHAR(100) NOT NULL,
"uri" VARCHAR(256) NOT NULL
);
ALTER TABLE PUBLIC."deployment_resources" ADD CONSTRAINT PUBLIC.CONSTRAINT_2 PRIMARY KEY("id");
-- 0 +/- SELECT COUNT(*) FROM PUBLIC."deployment_resources";
CREATE CACHED TABLE PUBLIC."units"(
"id" BIGINT DEFAULT (NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_37BBCB01_F6C9_48A1_963B_FDA8724B2CB1) NOT NULL NULL_TO_DEFAULT SEQUENCE PUBLIC.SYSTEM_SEQUENCE_37BBCB01_F6C9_48A1_963B_FDA8724B2CB1,
"repository_id" VARCHAR(200) NOT NULL,
"version" VARCHAR(24) NOT NULL,
"name" VARCHAR(64) NOT NULL,
"description" TEXT NOT NULL,
"guid" VARCHAR(32) DEFAULT LEFT(CONVERT(SECURE_RAND(64),VARCHAR(32)), 12) NOT NULL
);
ALTER TABLE PUBLIC."units" ADD CONSTRAINT PUBLIC.CONSTRAINT_6 PRIMARY KEY("id");
-- 0 +/- SELECT COUNT(*) FROM PUBLIC."units";
CREATE INDEX PUBLIC."units_guid_idx" ON PUBLIC."units"("guid");
CREATE CACHED TABLE PUBLIC."loadbalancer_routes"(
"id" BIGINT DEFAULT (NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_AD03FD8F_2979_46F8_B967_A03942036851) NOT NULL NULL_TO_DEFAULT SEQUENCE PUBLIC.SYSTEM_SEQUENCE_AD03FD8F_2979_46F8_B967_A03942036851,
"loadbalancer_id" BIGINT NOT NULL,
"port" INTEGER NOT NULL,
"port_reference" VARCHAR(64) NOT NULL,
"protocol" VARCHAR(17) NOT NULL,
"to_unit_name" VARCHAR(64) NOT NULL,
"to_port_reference" VARCHAR(64) NOT NULL
);
ALTER TABLE PUBLIC."loadbalancer_routes" ADD CONSTRAINT PUBLIC.CONSTRAINT_CF PRIMARY KEY("id");
-- 0 +/- SELECT COUNT(*) FROM PUBLIC."loadbalancer_routes";
ALTER TABLE PUBLIC."units" ADD CONSTRAINT PUBLIC."unit_name_version_uniqueness" UNIQUE("name", "version");
ALTER TABLE PUBLIC."traffic_shift_start" ADD CONSTRAINT PUBLIC."traffic_shift_start_traffic_id_unique" UNIQUE("traffic_shift_id");
ALTER TABLE PUBLIC."traffic_shift_reverse" ADD CONSTRAINT PUBLIC."traffi_shift_reverse_traffic_id_unique" UNIQUE("traffic_shift_id");
ALTER TABLE PUBLIC."loadbalancers" ADD CONSTRAINT PUBLIC."lb_name_major_version_uniqueness" UNIQUE("name", "major_version");
ALTER TABLE PUBLIC."unit_dependencies" ADD CONSTRAINT PUBLIC."unique_unit_dependencies" UNIQUE("from_unit", "to_service", "to_version");
ALTER TABLE PUBLIC."loadbalancers" ADD CONSTRAINT PUBLIC."loadbalancers_have_repository" FOREIGN KEY("repository_id") REFERENCES PUBLIC."repositories"("id") NOCHECK;
ALTER TABLE PUBLIC."units" ADD CONSTRAINT PUBLIC."repository_version_fk" FOREIGN KEY("repository_id", "version") REFERENCES PUBLIC."releases"("repository_id", "version") ON DELETE CASCADE NOCHECK;
ALTER TABLE PUBLIC."unit_dependencies" ADD CONSTRAINT PUBLIC."unit_dependency_fk" FOREIGN KEY("from_unit") REFERENCES PUBLIC."units"("id") ON DELETE CASCADE NOCHECK;
ALTER TABLE PUBLIC."user_repositories" ADD CONSTRAINT PUBLIC."user_has_repositories" FOREIGN KEY("repository_id") REFERENCES PUBLIC."repositories"("id") NOCHECK;
ALTER TABLE PUBLIC."traffic_shifts" ADD CONSTRAINT PUBLIC."traffic_shift_namespace_fk" FOREIGN KEY("namespace_id") REFERENCES PUBLIC."namespaces"("id") NOCHECK;
ALTER TABLE PUBLIC."traffic_shift_start" ADD CONSTRAINT PUBLIC."traffic_shift_start_traffic_shift_fk" FOREIGN KEY("traffic_shift_id") REFERENCES PUBLIC."traffic_shifts"("id") NOCHECK;
ALTER TABLE PUBLIC."loadbalancer_deployments" ADD CONSTRAINT PUBLIC."loadbalancer_deployments_loadbalancers_fk" FOREIGN KEY("loadbalancer_id") REFERENCES PUBLIC."loadbalancers"("id") NOCHECK;
ALTER TABLE PUBLIC."loadbalancer_routes" ADD CONSTRAINT PUBLIC."loadbalancer_routes_loadbalancers_fk" FOREIGN KEY("loadbalancer_id") REFERENCES PUBLIC."loadbalancers"("id") NOCHECK;
ALTER TABLE PUBLIC."loadbalancer_deployments" ADD CONSTRAINT PUBLIC."loadbalancer_deployments_namespaces_fk" FOREIGN KEY("namespace_id") REFERENCES PUBLIC."namespaces"("id") NOCHECK;
ALTER TABLE PUBLIC."unit_resources" ADD CONSTRAINT PUBLIC."unit_resources_have_unit" FOREIGN KEY("unit_id") REFERENCES PUBLIC."units"("id") NOCHECK;
ALTER TABLE PUBLIC."namespaces" ADD CONSTRAINT PUBLIC."datacenter_fk" FOREIGN KEY("datacenter") REFERENCES PUBLIC."datacenters"("name") ON DELETE CASCADE NOCHECK;
ALTER TABLE PUBLIC."traffic_shifts" ADD CONSTRAINT PUBLIC."traffic_shift_to_deployment_fk" FOREIGN KEY("to_deployment") REFERENCES PUBLIC."deployments"("id") NOCHECK;
ALTER TABLE PUBLIC."deployments" ADD CONSTRAINT PUBLIC."deployment_namespace_fk" FOREIGN KEY("namespace_id") REFERENCES PUBLIC."namespaces"("id") NOCHECK;
ALTER TABLE PUBLIC."service_ports" ADD CONSTRAINT PUBLIC."service_units_fk" FOREIGN KEY("unit") REFERENCES PUBLIC."units"("id") ON DELETE CASCADE NOCHECK;
ALTER TABLE PUBLIC."releases" ADD CONSTRAINT PUBLIC."repository_fk" FOREIGN KEY("repository_id") REFERENCES PUBLIC."repositories"("id") ON DELETE CASCADE NOCHECK;
ALTER TABLE PUBLIC."traffic_shift_start" ADD CONSTRAINT PUBLIC."traffic_shift_start_from_deployment_fk" FOREIGN KEY("from_deployment") REFERENCES PUBLIC."deployments"("id") NOCHECK;
ALTER TABLE PUBLIC."deployment_expiration" ADD CONSTRAINT PUBLIC."deployment_id_fk" FOREIGN KEY("deployment_id") REFERENCES PUBLIC."deployments"("id") ON DELETE CASCADE NOCHECK;
ALTER TABLE PUBLIC."deployment_statuses" ADD CONSTRAINT PUBLIC."deployment_fk" FOREIGN KEY("deployment_id") REFERENCES PUBLIC."deployments"("id") ON DELETE CASCADE NOCHECK;
ALTER TABLE PUBLIC."deployments" ADD CONSTRAINT PUBLIC."units_fk" FOREIGN KEY("unit_id") REFERENCES PUBLIC."units"("id") ON DELETE CASCADE NOCHECK;
ALTER TABLE PUBLIC."traffic_shift_reverse" ADD CONSTRAINT PUBLIC."traffic_shift_reverse_traffic_shift_fk" FOREIGN KEY("traffic_shift_id") REFERENCES PUBLIC."traffic_shifts"("id") NOCHECK;
ALTER TABLE PUBLIC."deployment_resources" ADD CONSTRAINT PUBLIC."deployment_resources_have_deployment" FOREIGN KEY("deployment_id") REFERENCES PUBLIC."deployments"("id") NOCHECK; | the_stack |
--
-- Table structure for table actor
--
--DROP TABLE actor;
CREATE TABLE actor (
actor_id numeric NOT NULL ,
first_name VARCHAR(45) NOT NULL,
last_name VARCHAR(45) NOT NULL,
last_update TIMESTAMP NOT NULL,
PRIMARY KEY (actor_id)
)
;
CREATE INDEX idx_actor_last_name ON actor(last_name)
;
CREATE TRIGGER actor_trigger_ai AFTER INSERT ON actor
BEGIN
UPDATE actor SET last_update = DATETIME('NOW') WHERE rowid = new.rowid;
END
;
CREATE TRIGGER actor_trigger_au AFTER UPDATE ON actor
BEGIN
UPDATE actor SET last_update = DATETIME('NOW') WHERE rowid = new.rowid;
END
;
--
-- Table structure for table country
--
CREATE TABLE country (
country_id SMALLINT NOT NULL,
country VARCHAR(50) NOT NULL,
last_update TIMESTAMP,
PRIMARY KEY (country_id)
)
;
CREATE TRIGGER country_trigger_ai AFTER INSERT ON country
BEGIN
UPDATE country SET last_update = DATETIME('NOW') WHERE rowid = new.rowid;
END
;
CREATE TRIGGER country_trigger_au AFTER UPDATE ON country
BEGIN
UPDATE country SET last_update = DATETIME('NOW') WHERE rowid = new.rowid;
END
;
--
-- Table structure for table city
--
CREATE TABLE city (
city_id int NOT NULL,
city VARCHAR(50) NOT NULL,
country_id SMALLINT NOT NULL,
last_update TIMESTAMP NOT NULL,
PRIMARY KEY (city_id),
CONSTRAINT fk_city_country FOREIGN KEY (country_id) REFERENCES country (country_id) ON DELETE NO ACTION ON UPDATE CASCADE
)
;
CREATE INDEX idx_fk_country_id ON city(country_id)
;
CREATE TRIGGER city_trigger_ai AFTER INSERT ON city
BEGIN
UPDATE city SET last_update = DATETIME('NOW') WHERE rowid = new.rowid;
END
;
CREATE TRIGGER city_trigger_au AFTER UPDATE ON city
BEGIN
UPDATE city SET last_update = DATETIME('NOW') WHERE rowid = new.rowid;
END
;
--
-- Table structure for table address
--
CREATE TABLE address (
address_id int NOT NULL,
address VARCHAR(50) NOT NULL,
address2 VARCHAR(50) DEFAULT NULL,
district VARCHAR(20) NOT NULL,
city_id INT NOT NULL,
postal_code VARCHAR(10) DEFAULT NULL,
phone VARCHAR(20) NOT NULL,
last_update TIMESTAMP NOT NULL,
PRIMARY KEY (address_id),
CONSTRAINT fk_address_city FOREIGN KEY (city_id) REFERENCES city (city_id) ON DELETE NO ACTION ON UPDATE CASCADE
)
;
CREATE INDEX idx_fk_city_id ON address(city_id)
;
CREATE TRIGGER address_trigger_ai AFTER INSERT ON address
BEGIN
UPDATE address SET last_update = DATETIME('NOW') WHERE rowid = new.rowid;
END
;
CREATE TRIGGER address_trigger_au AFTER UPDATE ON address
BEGIN
UPDATE address SET last_update = DATETIME('NOW') WHERE rowid = new.rowid;
END
;
--
-- Table structure for table language
--
CREATE TABLE language (
language_id SMALLINT NOT NULL ,
name CHAR(20) NOT NULL,
last_update TIMESTAMP NOT NULL,
PRIMARY KEY (language_id)
)
;
CREATE TRIGGER language_trigger_ai AFTER INSERT ON language
BEGIN
UPDATE language SET last_update = DATETIME('NOW') WHERE rowid = new.rowid;
END
;
CREATE TRIGGER language_trigger_au AFTER UPDATE ON language
BEGIN
UPDATE language SET last_update = DATETIME('NOW') WHERE rowid = new.rowid;
END
;
--
-- Table structure for table category
--
CREATE TABLE category (
category_id SMALLINT NOT NULL,
name VARCHAR(25) NOT NULL,
last_update TIMESTAMP NOT NULL,
PRIMARY KEY (category_id)
);
CREATE TRIGGER category_trigger_ai AFTER INSERT ON category
BEGIN
UPDATE category SET last_update = DATETIME('NOW') WHERE rowid = new.rowid;
END
;
CREATE TRIGGER category_trigger_au AFTER UPDATE ON category
BEGIN
UPDATE category SET last_update = DATETIME('NOW') WHERE rowid = new.rowid;
END
;
--
-- Table structure for table customer
--
CREATE TABLE customer (
customer_id INT NOT NULL,
store_id INT NOT NULL,
first_name VARCHAR(45) NOT NULL,
last_name VARCHAR(45) NOT NULL,
email VARCHAR(50) DEFAULT NULL,
address_id INT NOT NULL,
active CHAR(1) DEFAULT 'Y' NOT NULL,
create_date TIMESTAMP NOT NULL,
last_update TIMESTAMP NOT NULL,
PRIMARY KEY (customer_id),
CONSTRAINT fk_customer_store FOREIGN KEY (store_id) REFERENCES store (store_id) ON DELETE NO ACTION ON UPDATE CASCADE,
CONSTRAINT fk_customer_address FOREIGN KEY (address_id) REFERENCES address (address_id) ON DELETE NO ACTION ON UPDATE CASCADE
)
;
CREATE INDEX idx_customer_fk_store_id ON customer(store_id)
;
CREATE INDEX idx_customer_fk_address_id ON customer(address_id)
;
CREATE INDEX idx_customer_last_name ON customer(last_name)
;
CREATE TRIGGER customer_trigger_ai AFTER INSERT ON customer
BEGIN
UPDATE customer SET last_update = DATETIME('NOW') WHERE rowid = new.rowid;
END
;
CREATE TRIGGER customer_trigger_au AFTER UPDATE ON customer
BEGIN
UPDATE customer SET last_update = DATETIME('NOW') WHERE rowid = new.rowid;
END
;
--
-- Table structure for table film
--
CREATE TABLE film (
film_id int NOT NULL,
title VARCHAR(255) NOT NULL,
description BLOB SUB_TYPE TEXT DEFAULT NULL,
release_year VARCHAR(4) DEFAULT NULL,
language_id SMALLINT NOT NULL,
original_language_id SMALLINT DEFAULT NULL,
rental_duration SMALLINT DEFAULT 3 NOT NULL,
rental_rate DECIMAL(4,2) DEFAULT 4.99 NOT NULL,
length SMALLINT DEFAULT NULL,
replacement_cost DECIMAL(5,2) DEFAULT 19.99 NOT NULL,
rating VARCHAR(10) DEFAULT 'G',
special_features VARCHAR(100) DEFAULT NULL,
last_update TIMESTAMP NOT NULL,
PRIMARY KEY (film_id),
CONSTRAINT CHECK_special_features CHECK(special_features is null or
special_features like '%Trailers%' or
special_features like '%Commentaries%' or
special_features like '%Deleted Scenes%' or
special_features like '%Behind the Scenes%'),
CONSTRAINT CHECK_special_rating CHECK(rating in ('G','PG','PG-13','R','NC-17')),
CONSTRAINT fk_film_language FOREIGN KEY (language_id) REFERENCES language (language_id) ,
CONSTRAINT fk_film_language_original FOREIGN KEY (original_language_id) REFERENCES language (language_id)
)
;
CREATE INDEX idx_fk_language_id ON film(language_id)
;
CREATE INDEX idx_fk_original_language_id ON film(original_language_id)
;
CREATE TRIGGER film_trigger_ai AFTER INSERT ON film
BEGIN
UPDATE film SET last_update = DATETIME('NOW') WHERE rowid = new.rowid;
END
;
CREATE TRIGGER film_trigger_au AFTER UPDATE ON film
BEGIN
UPDATE film SET last_update = DATETIME('NOW') WHERE rowid = new.rowid;
END
;
--
-- Table structure for table film_actor
--
CREATE TABLE film_actor (
actor_id INT NOT NULL,
film_id INT NOT NULL,
last_update TIMESTAMP NOT NULL,
PRIMARY KEY (actor_id,film_id),
CONSTRAINT fk_film_actor_actor FOREIGN KEY (actor_id) REFERENCES actor (actor_id) ON DELETE NO ACTION ON UPDATE CASCADE,
CONSTRAINT fk_film_actor_film FOREIGN KEY (film_id) REFERENCES film (film_id) ON DELETE NO ACTION ON UPDATE CASCADE
)
;
CREATE INDEX idx_fk_film_actor_film ON film_actor(film_id)
;
CREATE INDEX idx_fk_film_actor_actor ON film_actor(actor_id)
;
CREATE TRIGGER film_actor_trigger_ai AFTER INSERT ON film_actor
BEGIN
UPDATE film_actor SET last_update = DATETIME('NOW') WHERE rowid = new.rowid;
END
;
CREATE TRIGGER film_actor_trigger_au AFTER UPDATE ON film_actor
BEGIN
UPDATE film_actor SET last_update = DATETIME('NOW') WHERE rowid = new.rowid;
END
;
--
-- Table structure for table film_category
--
CREATE TABLE film_category (
film_id INT NOT NULL,
category_id SMALLINT NOT NULL,
last_update TIMESTAMP NOT NULL,
PRIMARY KEY (film_id, category_id),
CONSTRAINT fk_film_category_film FOREIGN KEY (film_id) REFERENCES film (film_id) ON DELETE NO ACTION ON UPDATE CASCADE,
CONSTRAINT fk_film_category_category FOREIGN KEY (category_id) REFERENCES category (category_id) ON DELETE NO ACTION ON UPDATE CASCADE
)
;
CREATE INDEX idx_fk_film_category_film ON film_category(film_id)
;
CREATE INDEX idx_fk_film_category_category ON film_category(category_id)
;
CREATE TRIGGER film_category_trigger_ai AFTER INSERT ON film_category
BEGIN
UPDATE film_category SET last_update = DATETIME('NOW') WHERE rowid = new.rowid;
END
;
CREATE TRIGGER film_category_trigger_au AFTER UPDATE ON film_category
BEGIN
UPDATE film_category SET last_update = DATETIME('NOW') WHERE rowid = new.rowid;
END
;
--
-- Table structure for table film_text
--
CREATE TABLE film_text (
film_id SMALLINT NOT NULL,
title VARCHAR(255) NOT NULL,
description BLOB SUB_TYPE TEXT,
PRIMARY KEY (film_id)
)
;
--
-- Table structure for table inventory
--
CREATE TABLE inventory (
inventory_id INT NOT NULL,
film_id INT NOT NULL,
store_id INT NOT NULL,
last_update TIMESTAMP NOT NULL,
PRIMARY KEY (inventory_id),
CONSTRAINT fk_inventory_store FOREIGN KEY (store_id) REFERENCES store (store_id) ON DELETE NO ACTION ON UPDATE CASCADE,
CONSTRAINT fk_inventory_film FOREIGN KEY (film_id) REFERENCES film (film_id) ON DELETE NO ACTION ON UPDATE CASCADE
)
;
CREATE INDEX idx_fk_film_id ON inventory(film_id)
;
CREATE INDEX idx_fk_film_id_store_id ON inventory(store_id,film_id)
;
CREATE TRIGGER inventory_trigger_ai AFTER INSERT ON inventory
BEGIN
UPDATE inventory SET last_update = DATETIME('NOW') WHERE rowid = new.rowid;
END
;
CREATE TRIGGER inventory_trigger_au AFTER UPDATE ON inventory
BEGIN
UPDATE inventory SET last_update = DATETIME('NOW') WHERE rowid = new.rowid;
END
;
--
-- Table structure for table staff
--
CREATE TABLE staff (
staff_id SMALLINT NOT NULL,
first_name VARCHAR(45) NOT NULL,
last_name VARCHAR(45) NOT NULL,
address_id INT NOT NULL,
picture BLOB DEFAULT NULL,
email VARCHAR(50) DEFAULT NULL,
store_id INT NOT NULL,
active SMALLINT DEFAULT 1 NOT NULL,
username VARCHAR(16) NOT NULL,
password VARCHAR(40) DEFAULT NULL,
last_update TIMESTAMP NOT NULL,
PRIMARY KEY (staff_id),
CONSTRAINT fk_staff_store FOREIGN KEY (store_id) REFERENCES store (store_id) ON DELETE NO ACTION ON UPDATE CASCADE,
CONSTRAINT fk_staff_address FOREIGN KEY (address_id) REFERENCES address (address_id) ON DELETE NO ACTION ON UPDATE CASCADE
)
;
CREATE INDEX idx_fk_staff_store_id ON staff(store_id)
;
CREATE INDEX idx_fk_staff_address_id ON staff(address_id)
;
CREATE TRIGGER staff_trigger_ai AFTER INSERT ON staff
BEGIN
UPDATE staff SET last_update = DATETIME('NOW') WHERE rowid = new.rowid;
END
;
CREATE TRIGGER staff_trigger_au AFTER UPDATE ON staff
BEGIN
UPDATE staff SET last_update = DATETIME('NOW') WHERE rowid = new.rowid;
END
;
--
-- Table structure for table store
--
CREATE TABLE store (
store_id INT NOT NULL,
manager_staff_id SMALLINT NOT NULL,
address_id INT NOT NULL,
last_update TIMESTAMP NOT NULL,
PRIMARY KEY (store_id),
CONSTRAINT fk_store_staff FOREIGN KEY (manager_staff_id) REFERENCES staff (staff_id) ,
CONSTRAINT fk_store_address FOREIGN KEY (address_id) REFERENCES address (address_id)
)
;
CREATE INDEX idx_store_fk_manager_staff_id ON store(manager_staff_id)
;
CREATE INDEX idx_fk_store_address ON store(address_id)
;
CREATE TRIGGER store_trigger_ai AFTER INSERT ON store
BEGIN
UPDATE store SET last_update = DATETIME('NOW') WHERE rowid = new.rowid;
END
;
CREATE TRIGGER store_trigger_au AFTER UPDATE ON store
BEGIN
UPDATE store SET last_update = DATETIME('NOW') WHERE rowid = new.rowid;
END
;
--
-- Table structure for table payment
--
CREATE TABLE payment (
payment_id int NOT NULL,
customer_id INT NOT NULL,
staff_id SMALLINT NOT NULL,
rental_id INT DEFAULT NULL,
amount DECIMAL(5,2) NOT NULL,
payment_date TIMESTAMP NOT NULL,
last_update TIMESTAMP NOT NULL,
PRIMARY KEY (payment_id),
CONSTRAINT fk_payment_rental FOREIGN KEY (rental_id) REFERENCES rental (rental_id) ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT fk_payment_customer FOREIGN KEY (customer_id) REFERENCES customer (customer_id) ,
CONSTRAINT fk_payment_staff FOREIGN KEY (staff_id) REFERENCES staff (staff_id)
)
;
CREATE INDEX idx_fk_staff_id ON payment(staff_id)
;
CREATE INDEX idx_fk_customer_id ON payment(customer_id)
;
CREATE TRIGGER payment_trigger_ai AFTER INSERT ON payment
BEGIN
UPDATE payment SET last_update = DATETIME('NOW') WHERE rowid = new.rowid;
END
;
CREATE TRIGGER payment_trigger_au AFTER UPDATE ON payment
BEGIN
UPDATE payment SET last_update = DATETIME('NOW') WHERE rowid = new.rowid;
END
;
CREATE TABLE rental (
rental_id INT NOT NULL,
rental_date TIMESTAMP NOT NULL,
inventory_id INT NOT NULL,
customer_id INT NOT NULL,
return_date TIMESTAMP DEFAULT NULL,
staff_id SMALLINT NOT NULL,
last_update TIMESTAMP NOT NULL,
PRIMARY KEY (rental_id),
CONSTRAINT fk_rental_staff FOREIGN KEY (staff_id) REFERENCES staff (staff_id) ,
CONSTRAINT fk_rental_inventory FOREIGN KEY (inventory_id) REFERENCES inventory (inventory_id) ,
CONSTRAINT fk_rental_customer FOREIGN KEY (customer_id) REFERENCES customer (customer_id)
)
;
CREATE INDEX idx_rental_fk_inventory_id ON rental(inventory_id)
;
CREATE INDEX idx_rental_fk_customer_id ON rental(customer_id)
;
CREATE INDEX idx_rental_fk_staff_id ON rental(staff_id)
;
CREATE UNIQUE INDEX idx_rental_uq ON rental (rental_date,inventory_id,customer_id)
;
CREATE TRIGGER rental_trigger_ai AFTER INSERT ON rental
BEGIN
UPDATE rental SET last_update = DATETIME('NOW') WHERE rowid = new.rowid;
END
;
CREATE TRIGGER rental_trigger_au AFTER UPDATE ON rental
BEGIN
UPDATE rental SET last_update = DATETIME('NOW') WHERE rowid = new.rowid;
END
;
--
-- View structure for view customer_list
--
CREATE VIEW customer_list
AS
SELECT cu.customer_id AS ID,
cu.first_name||' '||cu.last_name AS name,
a.address AS address,
a.postal_code AS zip_code,
a.phone AS phone,
city.city AS city,
country.country AS country,
case when cu.active=1 then 'active' else '' end AS notes,
cu.store_id AS SID
FROM customer AS cu JOIN address AS a ON cu.address_id = a.address_id JOIN city ON a.city_id = city.city_id
JOIN country ON city.country_id = country.country_id
;
--
-- View structure for view film_list
--
CREATE VIEW film_list
AS
SELECT film.film_id AS FID,
film.title AS title,
film.description AS description,
category.name AS category,
film.rental_rate AS price,
film.length AS length,
film.rating AS rating,
actor.first_name||' '||actor.last_name AS actors
FROM category LEFT JOIN film_category ON category.category_id = film_category.category_id LEFT JOIN film ON film_category.film_id = film.film_id
JOIN film_actor ON film.film_id = film_actor.film_id
JOIN actor ON film_actor.actor_id = actor.actor_id
;
--
-- View structure for view staff_list
--
CREATE VIEW staff_list
AS
SELECT s.staff_id AS ID,
s.first_name||' '||s.last_name AS name,
a.address AS address,
a.postal_code AS zip_code,
a.phone AS phone,
city.city AS city,
country.country AS country,
s.store_id AS SID
FROM staff AS s JOIN address AS a ON s.address_id = a.address_id JOIN city ON a.city_id = city.city_id
JOIN country ON city.country_id = country.country_id
;
--
-- View structure for view sales_by_store
--
CREATE VIEW sales_by_store
AS
SELECT
s.store_id
,c.city||','||cy.country AS store
,m.first_name||' '||m.last_name AS manager
,SUM(p.amount) AS total_sales
FROM payment AS p
INNER JOIN rental AS r ON p.rental_id = r.rental_id
INNER JOIN inventory AS i ON r.inventory_id = i.inventory_id
INNER JOIN store AS s ON i.store_id = s.store_id
INNER JOIN address AS a ON s.address_id = a.address_id
INNER JOIN city AS c ON a.city_id = c.city_id
INNER JOIN country AS cy ON c.country_id = cy.country_id
INNER JOIN staff AS m ON s.manager_staff_id = m.staff_id
GROUP BY
s.store_id
, c.city||','||cy.country
, m.first_name||' '||m.last_name
;
--
-- View structure for view sales_by_film_category
--
-- Note that total sales will add up to >100% because
-- some titles belong to more than 1 category
--
CREATE VIEW sales_by_film_category
AS
SELECT
c.name AS category
, SUM(p.amount) AS total_sales
FROM payment AS p
INNER JOIN rental AS r ON p.rental_id = r.rental_id
INNER JOIN inventory AS i ON r.inventory_id = i.inventory_id
INNER JOIN film AS f ON i.film_id = f.film_id
INNER JOIN film_category AS fc ON f.film_id = fc.film_id
INNER JOIN category AS c ON fc.category_id = c.category_id
GROUP BY c.name
;
--
-- View structure for view actor_info
--
/*
CREATE VIEW actor_info
AS
SELECT
a.actor_id,
a.first_name,
a.last_name,
GROUP_CONCAT(DISTINCT CONCAT(c.name, ': ',
(SELECT GROUP_CONCAT(f.title ORDER BY f.title SEPARATOR ', ')
FROM sakila.film f
INNER JOIN sakila.film_category fc
ON f.film_id = fc.film_id
INNER JOIN sakila.film_actor fa
ON f.film_id = fa.film_id
WHERE fc.category_id = c.category_id
AND fa.actor_id = a.actor_id
)
)
ORDER BY c.name SEPARATOR '; ')
AS film_info
FROM sakila.actor a
LEFT JOIN sakila.film_actor fa
ON a.actor_id = fa.actor_id
LEFT JOIN sakila.film_category fc
ON fa.film_id = fc.film_id
LEFT JOIN sakila.category c
ON fc.category_id = c.category_id
GROUP BY a.actor_id, a.first_name, a.last_name;
*/
-- TO DO PROCEDURES
-- TO DO TRIGGERS | the_stack |
--
-- extension update file from 1.3 to 1.4
--
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION pgautofailover" to load this file. \quit
DROP FUNCTION IF EXISTS pgautofailover.register_node(text,text,int,name,int,
pgautofailover.replication_state,text, int, bool);
DROP FUNCTION IF EXISTS pgautofailover.node_active(text,text,int,int,int,
pgautofailover.replication_state,bool,pg_lsn,text);
DROP FUNCTION IF EXISTS pgautofailover.get_other_nodes
(text,integer,pgautofailover.replication_state);
DROP FUNCTION IF EXISTS pgautofailover.current_state(text);
DROP FUNCTION IF EXISTS pgautofailover.current_state(text, int);
ALTER TYPE pgautofailover.replication_state RENAME TO old_replication_state;
CREATE TYPE pgautofailover.replication_state
AS ENUM
(
'unknown',
'init',
'single',
'wait_primary',
'primary',
'draining',
'demote_timeout',
'demoted',
'catchingup',
'secondary',
'prepare_promotion',
'stop_replication',
'wait_standby',
'maintenance',
'join_primary',
'apply_settings',
'prepare_maintenance',
'wait_maintenance',
'report_lsn',
'fast_forward',
'join_secondary'
);
-- Note the double cast here, first to text and only then to the new enums
ALTER TABLE pgautofailover.node
ALTER COLUMN goalstate DROP NOT NULL,
ALTER COLUMN goalstate DROP DEFAULT,
ALTER COLUMN goalstate
TYPE pgautofailover.replication_state
USING goalstate::text::pgautofailover.replication_state,
ALTER COLUMN goalstate SET DEFAULT 'init',
ALTER COLUMN goalstate SET NOT NULL,
ALTER COLUMN reportedstate
TYPE pgautofailover.replication_state
USING reportedstate::text::pgautofailover.replication_state;
ALTER TABLE pgautofailover.event
ALTER COLUMN goalstate
TYPE pgautofailover.replication_state
USING goalstate::text::pgautofailover.replication_state,
ALTER COLUMN reportedstate
TYPE pgautofailover.replication_state
USING reportedstate::text::pgautofailover.replication_state;
DROP TYPE pgautofailover.old_replication_state;
ALTER TABLE pgautofailover.formation
ALTER COLUMN number_sync_standbys
SET DEFAULT 0;
--
-- The default used to be 1, now it's zero. Change it for people who left
-- the default (everybody, most certainly, because this used to have no
-- impact).
--
UPDATE pgautofailover.formation
SET number_sync_standbys = 0
WHERE number_sync_standbys = 1;
ALTER TABLE pgautofailover.formation
ADD CHECK (kind IN ('pgsql', 'citus'));
ALTER TABLE pgautofailover.node
RENAME TO node_upgrade_old;
CREATE TABLE pgautofailover.node
(
formationid text not null default 'default',
nodeid bigint not null DEFAULT nextval('pgautofailover.node_nodeid_seq'::regclass),
groupid int not null,
nodename text not null,
nodehost text not null,
nodeport int not null,
sysidentifier bigint,
goalstate pgautofailover.replication_state not null default 'init',
reportedstate pgautofailover.replication_state not null,
reportedpgisrunning bool default true,
reportedrepstate text default 'async',
reporttime timestamptz not null default now(),
reportedlsn pg_lsn not null default '0/0',
walreporttime timestamptz not null default now(),
health integer not null default -1,
healthchecktime timestamptz not null default now(),
statechangetime timestamptz not null default now(),
candidatepriority int not null default 100,
replicationquorum bool not null default true,
-- node names must be unique in a given formation
UNIQUE (formationid, nodename),
-- any nodehost:port can only be a unique node in the system
UNIQUE (nodehost, nodeport),
--
-- The EXCLUDE constraint only allows the same sysidentifier for all the
-- nodes in the same group. The system_identifier is a property that is
-- kept when implementing streaming replication and should be unique per
-- Postgres instance in all other cases.
--
-- We allow the sysidentifier column to be NULL when registering a new
-- primary server from scratch, because we have not done pg_ctl initdb
-- at the time we call the register_node() function.
--
CONSTRAINT system_identifier_is_null_at_init_only
CHECK ( ( sysidentifier IS NULL
AND reportedstate in ('init', 'wait_standby', 'catchingup') )
OR sysidentifier IS NOT NULL),
CONSTRAINT same_system_identifier_within_group
EXCLUDE USING gist(formationid with =,
groupid with =,
sysidentifier with <>)
DEFERRABLE INITIALLY DEFERRED,
PRIMARY KEY (nodeid),
FOREIGN KEY (formationid) REFERENCES pgautofailover.formation(formationid)
)
-- we expect few rows and lots of UPDATE, let's benefit from HOT
WITH (fillfactor = 25);
ALTER SEQUENCE pgautofailover.node_nodeid_seq OWNED BY pgautofailover.node.nodeid;
INSERT INTO pgautofailover.node
(
formationid, nodeid, groupid, nodename, nodehost, nodeport, sysidentifier,
goalstate, reportedstate, reportedpgisrunning, reportedrepstate,
reporttime, reportedlsn, walreporttime,
health, healthchecktime, statechangetime,
candidatepriority, replicationquorum
)
SELECT formationid, nodeid, groupid,
format('node_%s', nodeid) as nodename,
nodename as nodehost, nodeport, 0 as sysidentifier,
goalstate, reportedstate, reportedpgisrunning, reportedrepstate,
reporttime, reportedlsn, walreporttime,
health, healthchecktime, statechangetime,
candidatepriority, replicationquorum
FROM pgautofailover.node_upgrade_old;
ALTER TABLE pgautofailover.event
RENAME TO event_upgrade_old;
CREATE TABLE pgautofailover.event
(
eventid bigint not null DEFAULT nextval('pgautofailover.event_eventid_seq'::regclass),
eventtime timestamptz not null default now(),
formationid text not null,
nodeid bigint not null,
groupid int not null,
nodename text not null,
nodehost text not null,
nodeport integer not null,
reportedstate pgautofailover.replication_state not null,
goalstate pgautofailover.replication_state not null,
reportedrepstate text,
reportedlsn pg_lsn not null default '0/0',
candidatepriority int,
replicationquorum bool,
description text,
PRIMARY KEY (eventid)
);
ALTER SEQUENCE pgautofailover.event_eventid_seq
OWNED BY pgautofailover.event.eventid;
INSERT INTO pgautofailover.event
(
eventid, eventtime, formationid, nodeid, groupid,
nodename, nodehost, nodeport,
reportedstate, goalstate, reportedrepstate, description
)
SELECT eventid, eventtime, event.formationid, event.nodeid, event.groupid,
node.nodename, node.nodehost, event.nodeport,
event.reportedstate, event.goalstate, event.reportedrepstate,
event.description
FROM pgautofailover.event_upgrade_old as event
JOIN pgautofailover.node USING(nodeid);
GRANT SELECT ON ALL TABLES IN SCHEMA pgautofailover TO autoctl_node;
CREATE FUNCTION pgautofailover.set_node_system_identifier
(
IN node_id bigint,
IN node_sysidentifier bigint,
OUT node_id bigint,
OUT node_name text,
OUT node_host text,
OUT node_port int
)
RETURNS record LANGUAGE SQL STRICT SECURITY DEFINER
AS $$
update pgautofailover.node
set sysidentifier = node_sysidentifier
where nodeid = set_node_system_identifier.node_id
returning nodeid, nodename, nodehost, nodeport;
$$;
grant execute on function pgautofailover.set_node_system_identifier(bigint,bigint)
to autoctl_node;
CREATE FUNCTION pgautofailover.set_group_system_identifier
(
IN group_id bigint,
IN node_sysidentifier bigint,
OUT node_id bigint,
OUT node_name text,
OUT node_host text,
OUT node_port int
)
RETURNS setof record LANGUAGE SQL STRICT SECURITY DEFINER
AS $$
update pgautofailover.node
set sysidentifier = node_sysidentifier
where groupid = set_group_system_identifier.group_id
and sysidentifier = 0
returning nodeid, nodename, nodehost, nodeport;
$$;
grant execute on function pgautofailover.set_group_system_identifier(bigint,bigint)
to autoctl_node;
DROP FUNCTION pgautofailover.set_node_nodename(bigint,text);
CREATE FUNCTION pgautofailover.update_node_metadata
(
IN node_id bigint,
IN node_name text,
IN node_host text,
IN node_port int
)
RETURNS boolean LANGUAGE C SECURITY DEFINER
AS 'MODULE_PATHNAME', $$update_node_metadata$$;
grant execute on function pgautofailover.update_node_metadata(bigint,text,text,int)
to autoctl_node;
CREATE FUNCTION pgautofailover.register_node
(
IN formation_id text,
IN node_host text,
IN node_port int,
IN dbname name,
IN node_name text default '',
IN sysidentifier bigint default 0,
IN desired_group_id int default -1,
IN initial_group_role pgautofailover.replication_state default 'init',
IN node_kind text default 'standalone',
IN candidate_priority int default 100,
IN replication_quorum bool default true,
OUT assigned_node_id int,
OUT assigned_group_id int,
OUT assigned_group_state pgautofailover.replication_state,
OUT assigned_candidate_priority int,
OUT assigned_replication_quorum bool,
OUT assigned_node_name text
)
RETURNS record LANGUAGE C STRICT SECURITY DEFINER
AS 'MODULE_PATHNAME', $$register_node$$;
grant execute on function
pgautofailover.register_node(text,text,int,name,text,bigint,int,pgautofailover.replication_state,text, int, bool)
to autoctl_node;
CREATE FUNCTION pgautofailover.node_active
(
IN formation_id text,
IN node_id int,
IN group_id int,
IN current_group_role pgautofailover.replication_state default 'init',
IN current_pg_is_running bool default true,
IN current_lsn pg_lsn default '0/0',
IN current_rep_state text default '',
OUT assigned_node_id int,
OUT assigned_group_id int,
OUT assigned_group_state pgautofailover.replication_state,
OUT assigned_candidate_priority int,
OUT assigned_replication_quorum bool
)
RETURNS record LANGUAGE C STRICT SECURITY DEFINER
AS 'MODULE_PATHNAME', $$node_active$$;
grant execute on function
pgautofailover.node_active(text,int,int,
pgautofailover.replication_state,bool,pg_lsn,text)
to autoctl_node;
DROP FUNCTION pgautofailover.get_nodes(text, int);
CREATE FUNCTION pgautofailover.get_nodes
(
IN formation_id text default 'default',
IN group_id int default NULL,
OUT node_id int,
OUT node_name text,
OUT node_host text,
OUT node_port int,
OUT node_lsn pg_lsn,
OUT node_is_primary bool
)
RETURNS SETOF record LANGUAGE C
AS 'MODULE_PATHNAME', $$get_nodes$$;
comment on function pgautofailover.get_nodes(text,int)
is 'get all the nodes in a group';
grant execute on function pgautofailover.get_nodes(text,int)
to autoctl_node;
DROP FUNCTION pgautofailover.get_primary(text, int);
CREATE FUNCTION pgautofailover.get_primary
(
IN formation_id text default 'default',
IN group_id int default 0,
OUT primary_node_id int,
OUT primary_name text,
OUT primary_host text,
OUT primary_port int
)
RETURNS record LANGUAGE C STRICT SECURITY DEFINER
AS 'MODULE_PATHNAME', $$get_primary$$;
comment on function pgautofailover.get_primary(text,int)
is 'get the writable node for a group';
grant execute on function pgautofailover.get_primary(text,int)
to autoctl_node;
DROP FUNCTION IF EXISTS pgautofailover.get_other_nodes (text,integer);
CREATE FUNCTION pgautofailover.get_other_nodes
(
IN nodeid int,
OUT node_id int,
OUT node_name text,
OUT node_host text,
OUT node_port int,
OUT node_lsn pg_lsn,
OUT node_is_primary bool
)
RETURNS SETOF record LANGUAGE C STRICT
AS 'MODULE_PATHNAME', $$get_other_nodes$$;
comment on function pgautofailover.get_other_nodes(int)
is 'get the other nodes in a group';
grant execute on function pgautofailover.get_other_nodes(int)
to autoctl_node;
CREATE FUNCTION pgautofailover.get_other_nodes
(
IN nodeid int,
IN current_state pgautofailover.replication_state,
OUT node_id int,
OUT node_name text,
OUT node_host text,
OUT node_port int,
OUT node_lsn pg_lsn,
OUT node_is_primary bool
)
RETURNS SETOF record LANGUAGE C STRICT
AS 'MODULE_PATHNAME', $$get_other_nodes$$;
comment on function pgautofailover.get_other_nodes
(int,pgautofailover.replication_state)
is 'get the other nodes in a group, filtering on current_state';
grant execute on function pgautofailover.get_other_nodes
(int,pgautofailover.replication_state)
to autoctl_node;
DROP FUNCTION pgautofailover.get_coordinator(text);
CREATE FUNCTION pgautofailover.get_coordinator
(
IN formation_id text default 'default',
OUT node_host text,
OUT node_port int
)
RETURNS SETOF record LANGUAGE SQL STRICT
AS $$
select nodehost, nodeport
from pgautofailover.node
join pgautofailover.formation using(formationid)
where formationid = formation_id
and groupid = 0
and goalstate in ('single', 'wait_primary', 'primary')
and reportedstate in ('single', 'wait_primary', 'primary');
$$;
grant execute on function pgautofailover.get_coordinator(text)
to autoctl_node;
CREATE FUNCTION pgautofailover.get_most_advanced_standby
(
IN formationid text default 'default',
IN groupid int default 0,
OUT node_id bigint,
OUT node_name text,
OUT node_host text,
OUT node_port int,
OUT node_lsn pg_lsn,
OUT node_is_primary bool
)
RETURNS SETOF record LANGUAGE SQL STRICT
AS $$
select nodeid, nodename, nodehost, nodeport, reportedlsn, false
from pgautofailover.node
where formationid = $1
and groupid = $2
and reportedstate = 'report_lsn'
order by reportedlsn desc, health desc
limit 1;
$$;
grant execute on function pgautofailover.get_most_advanced_standby(text,int)
to autoctl_node;
DROP FUNCTION IF EXISTS pgautofailover.remove_node(text, int);
CREATE FUNCTION pgautofailover.remove_node
(
node_id int
)
RETURNS bool LANGUAGE C STRICT SECURITY DEFINER
AS 'MODULE_PATHNAME', $$remove_node_by_nodeid$$;
comment on function pgautofailover.remove_node(int)
is 'remove a node from the monitor';
grant execute on function pgautofailover.remove_node(int)
to autoctl_node;
CREATE FUNCTION pgautofailover.remove_node
(
node_host text,
node_port int default 5432
)
RETURNS bool LANGUAGE C STRICT SECURITY DEFINER
AS 'MODULE_PATHNAME', $$remove_node_by_host$$;
comment on function pgautofailover.remove_node(text,int)
is 'remove a node from the monitor';
grant execute on function pgautofailover.remove_node(text,int)
to autoctl_node;
CREATE FUNCTION pgautofailover.perform_promotion
(
formation_id text,
node_name text
)
RETURNS bool LANGUAGE C STRICT SECURITY DEFINER
AS 'MODULE_PATHNAME', $$perform_promotion$$;
comment on function pgautofailover.perform_promotion(text,text)
is 'manually failover from the primary to the given node';
grant execute on function pgautofailover.perform_promotion(text,text)
to autoctl_node;
DROP FUNCTION pgautofailover.start_maintenance(text, int);
DROP FUNCTION pgautofailover.stop_maintenance(text, int);
CREATE FUNCTION pgautofailover.start_maintenance(node_id int)
RETURNS bool LANGUAGE C STRICT SECURITY DEFINER
AS 'MODULE_PATHNAME', $$start_maintenance$$;
comment on function pgautofailover.start_maintenance(int)
is 'set a node in maintenance state';
grant execute on function pgautofailover.start_maintenance(int)
to autoctl_node;
CREATE FUNCTION pgautofailover.stop_maintenance(node_id int)
RETURNS bool LANGUAGE C STRICT SECURITY DEFINER
AS 'MODULE_PATHNAME', $$stop_maintenance$$;
comment on function pgautofailover.stop_maintenance(int)
is 'set a node out of maintenance state';
grant execute on function pgautofailover.stop_maintenance(int)
to autoctl_node;
DROP FUNCTION pgautofailover.last_events(int);
DROP FUNCTION pgautofailover.last_events(text,int);
DROP FUNCTION pgautofailover.last_events(text,int,int);
CREATE FUNCTION pgautofailover.last_events
(
count int default 10
)
RETURNS SETOF pgautofailover.event LANGUAGE SQL STRICT
AS $$
with last_events as
(
select eventid, eventtime, formationid,
nodeid, groupid, nodename, nodehost, nodeport,
reportedstate, goalstate,
reportedrepstate, reportedlsn,
candidatepriority, replicationquorum, description
from pgautofailover.event
order by eventid desc
limit count
)
select * from last_events order by eventtime, eventid;
$$;
comment on function pgautofailover.last_events(int)
is 'retrieve last COUNT events';
CREATE FUNCTION pgautofailover.last_events
(
formation_id text default 'default',
count int default 10
)
RETURNS SETOF pgautofailover.event LANGUAGE SQL STRICT
AS $$
with last_events as
(
select eventid, eventtime, formationid,
nodeid, groupid, nodename, nodehost, nodeport,
reportedstate, goalstate,
reportedrepstate, reportedlsn,
candidatepriority, replicationquorum, description
from pgautofailover.event
where formationid = formation_id
order by eventid desc
limit count
)
select * from last_events order by eventtime, eventid;
$$;
comment on function pgautofailover.last_events(text,int)
is 'retrieve last COUNT events for given formation';
CREATE FUNCTION pgautofailover.last_events
(
formation_id text,
group_id int,
count int default 10
)
RETURNS SETOF pgautofailover.event LANGUAGE SQL STRICT
AS $$
with last_events as
(
select eventid, eventtime, formationid,
nodeid, groupid, nodename, nodehost, nodeport,
reportedstate, goalstate,
reportedrepstate, reportedlsn,
candidatepriority, replicationquorum, description
from pgautofailover.event
where formationid = formation_id
and groupid = group_id
order by eventid desc
limit count
)
select * from last_events order by eventtime, eventid;
$$;
comment on function pgautofailover.last_events(text,int,int)
is 'retrieve last COUNT events for given formation and group';
CREATE FUNCTION pgautofailover.current_state
(
IN formation_id text default 'default',
OUT formation_kind text,
OUT nodename text,
OUT nodehost text,
OUT nodeport int,
OUT group_id int,
OUT node_id bigint,
OUT current_group_state pgautofailover.replication_state,
OUT assigned_group_state pgautofailover.replication_state,
OUT candidate_priority int,
OUT replication_quorum bool,
OUT reported_lsn pg_lsn,
OUT health integer
)
RETURNS SETOF record LANGUAGE SQL STRICT
AS $$
select kind, nodename, nodehost, nodeport, groupid, nodeid,
reportedstate, goalstate,
candidatepriority, replicationquorum,
reportedlsn, health
from pgautofailover.node
join pgautofailover.formation using(formationid)
where formationid = formation_id
order by groupid, nodeid;
$$;
comment on function pgautofailover.current_state(text)
is 'get the current state of both nodes of a formation';
CREATE FUNCTION pgautofailover.current_state
(
IN formation_id text,
IN group_id int,
OUT formation_kind text,
OUT nodename text,
OUT nodehost text,
OUT nodeport int,
OUT group_id int,
OUT node_id bigint,
OUT current_group_state pgautofailover.replication_state,
OUT assigned_group_state pgautofailover.replication_state,
OUT candidate_priority int,
OUT replication_quorum bool,
OUT reported_lsn pg_lsn,
OUT health integer
)
RETURNS SETOF record LANGUAGE SQL STRICT
AS $$
select kind, nodename, nodehost, nodeport, groupid, nodeid,
reportedstate, goalstate,
candidatepriority, replicationquorum,
reportedlsn, health
from pgautofailover.node
join pgautofailover.formation using(formationid)
where formationid = formation_id
and groupid = group_id
order by groupid, nodeid;
$$;
comment on function pgautofailover.current_state(text, int)
is 'get the current state of both nodes of a group in a formation';
CREATE OR REPLACE FUNCTION pgautofailover.formation_uri
(
IN formation_id text DEFAULT 'default',
IN sslmode text DEFAULT 'prefer',
IN sslrootcert text DEFAULT '',
IN sslcrl text DEFAULT ''
)
RETURNS text LANGUAGE SQL STRICT
AS $$
select case
when string_agg(format('%s:%s', nodehost, nodeport),',') is not null
then format(
'postgres://%s/%s?target_session_attrs=read-write&sslmode=%s%s%s',
string_agg(format('%s:%s', nodehost, nodeport),','),
-- as we join formation on node we get the same dbname for all
-- entries, pick one.
min(dbname),
min(sslmode),
CASE WHEN min(sslrootcert) = ''
THEN ''
ELSE '&sslrootcert=' || sslrootcert
END,
CASE WHEN min(sslcrl) = ''
THEN ''
ELSE '&sslcrl=' || sslcrl
END
)
end as uri
from pgautofailover.node as node
join pgautofailover.formation using(formationid)
where formationid = formation_id
and groupid = 0;
$$;
DROP FUNCTION pgautofailover.set_node_candidate_priority(int,text,int,int);
CREATE FUNCTION pgautofailover.set_node_candidate_priority
(
IN formation_id text,
IN node_name text,
IN candidate_priority int
)
RETURNS bool LANGUAGE C STRICT SECURITY DEFINER
AS 'MODULE_PATHNAME', $$set_node_candidate_priority$$;
comment on function pgautofailover.set_node_candidate_priority(text, text, int)
is 'sets the candidate priority value for a node. Expects a priority value between 0 and 100. 0 if the node is not a candidate to be promoted to be primary.';
grant execute on function
pgautofailover.set_node_candidate_priority(text, text, int)
to autoctl_node;
DROP FUNCTION pgautofailover.set_node_replication_quorum(int,text,int,bool);
CREATE FUNCTION pgautofailover.set_node_replication_quorum
(
IN formation_id text,
IN node_name text,
IN replication_quorum bool
)
RETURNS bool LANGUAGE C STRICT SECURITY DEFINER
AS 'MODULE_PATHNAME', $$set_node_replication_quorum$$;
comment on function pgautofailover.set_node_replication_quorum(text, text, bool)
is 'sets the replication quorum value for a node. true if the node participates in write quorum';
grant execute on function
pgautofailover.set_node_replication_quorum(text, text, bool)
to autoctl_node;
CREATE FUNCTION pgautofailover.formation_settings
(
IN formation_id text default 'default',
OUT context text,
OUT group_id int,
OUT node_id bigint,
OUT nodename text,
OUT setting text,
OUT value text
)
RETURNS SETOF record LANGUAGE SQL STRICT
AS $$
with groups(formationid, groupid) as
(
select formationid, groupid
from pgautofailover.node
where formationid = formation_id
group by formationid, groupid
)
-- context: formation, number_sync_standbys
select 'formation' as context,
NULL as group_id, NULL as node_id, formationid as nodename,
'number_sync_standbys' as setting,
cast(number_sync_standbys as text) as value
from pgautofailover.formation
where formationid = formation_id
union all
-- context: primary, one entry per group in the formation
select 'primary', groups.groupid, nodes.node_id, nodes.node_name,
'synchronous_standby_names',
format('''%s''',
pgautofailover.synchronous_standby_names(formationid, groupid))
from groups, pgautofailover.get_nodes(formationid, groupid) as nodes
where node_is_primary
union all
(
-- context: node, one entry per node in the formation
select 'node', node.groupid, node.nodeid, node.nodename,
'replication quorum', cast(node.replicationquorum as text)
from pgautofailover.node as node
where node.formationid = formation_id
order by nodeid
)
union all
(
select 'node', node.groupid, node.nodeid, node.nodename,
'candidate priority', cast(node.candidatepriority as text)
from pgautofailover.node as node
where node.formationid = formation_id
order by nodeid
)
$$;
comment on function pgautofailover.formation_settings(text)
is 'get the current replication settings a formation';
drop function pgautofailover.adjust_number_sync_standbys() cascade;
DROP TABLE pgautofailover.node_upgrade_old;
DROP TABLE pgautofailover.event_upgrade_old; | the_stack |
IF NOT EXISTS (SELECT * FROM sys.schemas WHERE name = N'wwi')
EXEC('CREATE SCHEMA [wwi]')
GO
IF NOT EXISTS (SELECT * FROM sys.schemas WHERE name = N'wwi')
EXEC('CREATE SCHEMA [wwi]')
GO
IF NOT EXISTS (SELECT * FROM sys.schemas WHERE name = N'temp')
EXEC('CREATE SCHEMA [temp]')
GO
IF NOT EXISTS (SELECT * FROM sys.schemas WHERE name = N'wwi')
EXEC('CREATE SCHEMA [wwi]')
GO
IF NOT EXISTS (SELECT * FROM sys.schemas WHERE name = N'view')
EXEC('CREATE SCHEMA [view]')
GO
IF NOT EXISTS (SELECT * FROM sys.schemas WHERE name = N'expired')
EXEC('CREATE SCHEMA [expired]')
GO
-- DIMENSIONAL MODEL TABLES
IF(OBJECT_ID('wwi.Order')) IS NOT NULL DROP TABLE [wwi].[Order]
CREATE TABLE [wwi].[Order]
(
[OrderLineID] BIGINT NULL,
[OrderID] BIGINT NULL,
[WarehouseStockItemsKey] INT NULL,
[Description] NVARCHAR(300) NULL,
[PackageTypeID] BIGINT NULL,
[Quantity] BIGINT NULL,
[UnitPrice] DECIMAL(18,4) NULL,
[TaxRate] DECIMAL(18,4) NULL,
[PickedQuantity] BIGINT NULL,
[PickingCompletedWhenKey] INT NULL,
[LastEditedBy] BIGINT NULL,
[LastEditedWhen] DATETIME NULL,
[CustomerID] BIGINT NULL,
[SalespersonPersonID] BIGINT NULL,
[PickedByPersonID] BIGINT NULL,
[ContactPersonID] BIGINT NULL,
[BackorderOrderID] BIGINT NULL,
[OrderDateKey] INT NULL,
[ExpectedDeliveryDateKey] INT NULL,
[CustomerPurchaseOrderNumber] NVARCHAR(300) NULL,
[IsUndersupplyBackordered] BIT NULL,
[Comments] NVARCHAR(300) NULL,
[DeliveryInstructions] NVARCHAR(300) NULL,
[InternalComments] NVARCHAR(300) NULL,
[SalesOrdersPickingCompletedWhenKey] INT NULL,
[SalesOrdersLastEditedBy] BIGINT NULL,
[SalesOrdersLastEditedWhen] DATETIME NULL
)
WITH
(
CLUSTERED COLUMNSTORE INDEX,
DISTRIBUTION = ROUND_ROBIN
)
IF(OBJECT_ID('wwi.Customer')) IS NOT NULL DROP TABLE [wwi].[Customer]
CREATE TABLE [wwi].[Customer]
(
[CustomerKeyPK] INT NOT NULL IDENTITY (1,1),
[CustomerID] BIGINT NULL,
[CustomerName] NVARCHAR(300) NULL,
[BillToCustomerID] BIGINT NULL,
[CustomerCategoryID] BIGINT NULL,
[BuyingGroupID] BIGINT NULL,
[PrimaryContactPersonID] BIGINT NULL,
[AlternateContactPersonID] BIGINT NULL,
[DeliveryMethodID] BIGINT NULL,
[DeliveryCityID] BIGINT NULL,
[PostalCityID] BIGINT NULL,
[CreditLimit] DECIMAL(18,4) NULL,
[AccountOpenedDate] DATETIME NULL,
[StandardDiscountPercentage] DECIMAL(18,4) NULL,
[IsStatementSent] BIT NULL,
[IsOnCreditHold] BIT NULL,
[PaymentDays] BIGINT NULL,
[PhoneNumber] NVARCHAR(300) NULL,
[FaxNumber] NVARCHAR(300) NULL,
[DeliveryRun] NVARCHAR(300) NULL,
[RunPosition] NVARCHAR(300) NULL,
[WebsiteURL] NVARCHAR(300) NULL,
[DeliveryAddressLine1] NVARCHAR(300) NULL,
[DeliveryAddressLine2] NVARCHAR(300) NULL,
[DeliveryPostalCode] NVARCHAR(300) NULL,
[DeliveryLocation] NVARCHAR(300) NULL,
[PostalAddressLine1] NVARCHAR(300) NULL,
[PostalAddressLine2] NVARCHAR(300) NULL,
[PostalPostalCode] NVARCHAR(300) NULL,
[LastEditedBy] BIGINT NULL,
[ValidFrom] DATETIME NULL,
[ValidTo] DATETIME NULL,
[CustomerCategoryName] NVARCHAR(300) NULL,
[SalesCustomerCategoriesLastEditedBy] BIGINT NULL,
[SalesCustomerCategoriesValidFrom] DATETIME NULL,
[SalesCustomerCategoriesValidTo] DATETIME NULL,
[BuyingGroupName] NVARCHAR(300) NULL,
[SalesBuyingGroupsLastEditedBy] BIGINT NULL,
[SalesBuyingGroupsValidFrom] DATETIME NULL,
[SalesBuyingGroupsValidTo] DATETIME NULL
)
WITH
(
CLUSTERED COLUMNSTORE INDEX,
DISTRIBUTION = ROUND_ROBIN
)
IF(OBJECT_ID('wwi.StockItem')) IS NOT NULL DROP TABLE [wwi].[StockItem]
CREATE TABLE [wwi].[StockItem]
(
[StockItemKeyPK] INT NOT NULL IDENTITY (1,1),
[StockItemID] BIGINT NULL,
[StockItemName] NVARCHAR(300) NULL,
[SupplierID] BIGINT NULL,
[ColorID] BIGINT NULL,
[UnitPackageID] BIGINT NULL,
[OuterPackageID] BIGINT NULL,
[Brand] NVARCHAR(300) NULL,
[Size] NVARCHAR(300) NULL,
[LeadTimeDays] BIGINT NULL,
[QuantityPerOuter] BIGINT NULL,
[IsChillerStock] BIT NULL,
[Barcode] NVARCHAR(300) NULL,
[TaxRate] DECIMAL(18,4) NULL,
[UnitPrice] DECIMAL(18,4) NULL,
[RecommendedRetailPrice] DECIMAL(18,4) NULL,
[TypicalWeightPerUnit] DECIMAL(18,4) NULL,
[MarketingComments] NVARCHAR(300) NULL,
[InternalComments] NVARCHAR(300) NULL,
[CustomFields] NVARCHAR(300) NULL,
[Tags] NVARCHAR(300) NULL,
[SearchDetails] NVARCHAR(300) NULL,
[LastEditedBy] BIGINT NULL,
[ValidFrom] DATETIME NULL,
[ColorName] NVARCHAR(300) NULL,
[ColorsLastEditedBy] BIGINT NULL,
[ColorsValidFrom] DATETIME NULL,
[PackageTypeName] NVARCHAR(300) NULL,
[UnitPackageTypeLastEditedBy] BIGINT NULL,
[UnitPackageTypeValidFrom] DATETIME NULL,
[OuterPackageTypePackageTypeName] NVARCHAR(300) NULL,
[OuterPackageTypeLastEditedBy] BIGINT NULL,
[OuterPackageTypeValidFrom] DATETIME NULL
)
WITH
(
CLUSTERED COLUMNSTORE INDEX,
DISTRIBUTION = ROUND_ROBIN
)
--Calendar Date Dimension
--Variables for start and end date
DECLARE
@num_start INT = 20000101
, @num_end INT = 20301231
;
IF(OBJECT_ID('tempdb..#Nums')) IS NOT NULL DROP TABLE #Nums
CREATE TABLE #Nums
WITH (DISTRIBUTION = ROUND_ROBIN)
AS
WITH L0 AS(SELECT 1 AS c UNION ALL SELECT 1)
, L1 AS(SELECT 1 AS c FROM L0 AS A, L0 AS B)
, L2 AS(SELECT 1 AS c FROM L1 AS A, L1 AS B)
, L3 AS(SELECT 1 AS c FROM L2 AS A, L2 AS B)
, L4 AS(SELECT 1 AS c FROM L3 AS A, L3 AS B)
, L5 AS(SELECT 1 AS c FROM L4 AS A, L4 AS B)
, Nums AS(SELECT ROW_NUMBER() OVER(ORDER BY c) AS n FROM L5)
SELECT
CAST(n AS BIGINT) AS num
, CAST(n AS CHAR(8)) AS num_string
FROM Nums
WHERE n BETWEEN @num_Start AND @num_End
OPTION(LABEL = 'fn_nums : #nums create')
;
GO
IF(OBJECT_ID('dimCalendarDate')) IS NOT NULL DROP TABLE[dimCalendarDate]
CREATE TABLE[dimCalendarDate]
WITH (DISTRIBUTION = ROUND_ROBIN
, CLUSTERED COLUMNSTORE INDEX
, PARTITION(CalendarDateID RANGE RIGHT FOR VALUES())
)
AS
SELECT
ISNULL(num, 0) AS CalendarDateID
, CONVERT(varchar(10), CAST(num_string AS DATE), 101) AS CalendarDateUSmdy
, CONVERT(varchar(10), CAST(num_string AS DATE), 103) AS CalendarDateUKdmy
, DATEPART(Year, num_string) AS CalendarYear
, DATEPART(Quarter, num_string) AS CalendarQuarter
, DATEPART(Month, num_string) AS CalendarMonth
, DATEPART(DayOfYear, num_string) AS CalendarDayOfYear
, DATEPART(Day, num_string) AS CalendarDay
, DATEPART(Week, num_string) AS CalendarWeek
, DATEPART(WeekDay, num_string) AS CalendarDayOfWeek
, DATEPART(ISO_Week, num_string) AS ISOWeekNmbr
FROM #Nums
WHERE ISDATE(num) = 1
;
GO
-- TRANSFORM CODE
-- wwi::SalesOrderLines
-- TRANSFORM VIEW
IF(OBJECT_ID('dbo.tv_SalesOrderLines')) IS NOT NULL DROP VIEW [dbo].[tv_SalesOrderLines]
GO
CREATE VIEW [dbo].[tv_SalesOrderLines]
AS
SELECT
[SalesOrderLines].[OrderLineID],
[SalesOrderLines].[OrderID],
[SalesOrderLines].[StockItemID],
[SalesOrderLines].[Description],
[SalesOrderLines].[PackageTypeID],
[SalesOrderLines].[Quantity],
[SalesOrderLines].[UnitPrice],
[SalesOrderLines].[TaxRate],
[SalesOrderLines].[PickedQuantity],
[SalesOrderLines].[PickingCompletedWhen],
[SalesOrderLines].[LastEditedBy],
[SalesOrderLines].[LastEditedWhen],
[SalesOrders].[CustomerID],
[SalesOrders].[SalespersonPersonID],
[SalesOrders].[PickedByPersonID],
[SalesOrders].[ContactPersonID],
[SalesOrders].[BackorderOrderID],
[SalesOrders].[OrderDate],
[SalesOrders].[ExpectedDeliveryDate],
[SalesOrders].[CustomerPurchaseOrderNumber],
[SalesOrders].[IsUndersupplyBackordered],
[SalesOrders].[Comments],
[SalesOrders].[DeliveryInstructions],
[SalesOrders].[InternalComments],
[SalesOrders].[PickingCompletedWhen] AS [SalesOrdersPickingCompletedWhen],
[SalesOrders].[LastEditedBy] AS [SalesOrdersLastEditedBy],
[SalesOrders].[LastEditedWhen] AS [SalesOrdersLastEditedWhen]
FROM [dbo].[SalesOrderLines] AS [SalesOrderLines]
LEFT OUTER JOIN [dbo].[SalesOrders] AS [SalesOrders] ON [SalesOrderLines].[OrderID] = [SalesOrders].[OrderID]
GO
-- TRANSFORM TABLE
IF(OBJECT_ID('dbo.tt_SalesOrderLines')) IS NOT NULL DROP TABLE [dbo].[tt_SalesOrderLines]
CREATE TABLE [dbo].[tt_SalesOrderLines]
WITH (DISTRIBUTION = ROUND_ROBIN)
AS
SELECT
[OrderLineID],
[OrderID],
[StockItemID],
[Description],
[PackageTypeID],
[Quantity],
[UnitPrice],
[TaxRate],
[PickedQuantity],
[PickingCompletedWhen],
[LastEditedBy],
[LastEditedWhen],
[CustomerID],
[SalespersonPersonID],
[PickedByPersonID],
[ContactPersonID],
[BackorderOrderID],
[OrderDate],
[ExpectedDeliveryDate],
[CustomerPurchaseOrderNumber],
[IsUndersupplyBackordered],
[Comments],
[DeliveryInstructions],
[InternalComments],
[SalesOrdersPickingCompletedWhen],
[SalesOrdersLastEditedBy],
[SalesOrdersLastEditedWhen]
FROM [dbo].[tv_SalesOrderLines] AS [SalesOrderLines]
GO
-- TRANSFORM TABLE VIEW
IF(OBJECT_ID('dbo.ttv_SalesOrderLines')) IS NOT NULL DROP VIEW [dbo].[ttv_SalesOrderLines]
GO
CREATE VIEW [dbo].[ttv_SalesOrderLines]
AS
SELECT
[TransformTable].[OrderLineID],
[TransformTable].[OrderID],
[TransformTable].[Description],
[TransformTable].[PackageTypeID],
[TransformTable].[Quantity],
[TransformTable].[UnitPrice],
[TransformTable].[TaxRate],
[TransformTable].[PickedQuantity],
[PickingCompletedWhenKey] = cast(replace(cast(CONVERT(date, [TransformTable].[PickingCompletedWhen]) as varchar(25)),'-','') as int),
[TransformTable].[LastEditedBy],
[TransformTable].[LastEditedWhen],
[TransformTable].[CustomerID],
[TransformTable].[SalespersonPersonID],
[TransformTable].[PickedByPersonID],
[TransformTable].[ContactPersonID],
[TransformTable].[BackorderOrderID],
[OrderDateKey] = cast(replace(cast(CONVERT(date, [TransformTable].[OrderDate]) as varchar(25)),'-','') as int),
[ExpectedDeliveryDateKey] = cast(replace(cast(CONVERT(date, [TransformTable].[ExpectedDeliveryDate]) as varchar(25)),'-','') as int),
[TransformTable].[CustomerPurchaseOrderNumber],
[TransformTable].[IsUndersupplyBackordered],
[TransformTable].[Comments],
[TransformTable].[DeliveryInstructions],
[TransformTable].[InternalComments],
[SalesOrdersPickingCompletedWhenKey] = cast(replace(cast(CONVERT(date, [TransformTable].[SalesOrdersPickingCompletedWhen]) as varchar(25)),'-','') as int),
[TransformTable].[SalesOrdersLastEditedBy],
[TransformTable].[SalesOrdersLastEditedWhen],
[StockItem].[StockItemKeyPK] AS [WarehouseStockItemsKey]
FROM [dbo].[tt_SalesOrderLines] AS [TransformTable]
INNER JOIN [wwi].[StockItem] AS [StockItem] ON [StockItem].[StockItemID] = [TransformTable].[StockItemID]
GO
-- TRANSFORM PROCEDURE
IF(OBJECT_ID('dbo.usp_transform_Order')) IS NOT NULL DROP PROCEDURE [dbo].[usp_transform_Order]
GO
-- wwi.Order Upsert In Place
CREATE PROCEDURE [dbo].[usp_transform_Order]
AS
BEGIN
-- Create materialized transform table from the transform view.
IF(OBJECT_ID('dbo.tt_SalesOrderLines')) IS NOT NULL DROP TABLE [dbo].[tt_SalesOrderLines]
CREATE TABLE [dbo].[tt_SalesOrderLines]
WITH (DISTRIBUTION = ROUND_ROBIN)
AS
SELECT
[OrderLineID],
[OrderID],
[StockItemID],
[Description],
[PackageTypeID],
[Quantity],
[UnitPrice],
[TaxRate],
[PickedQuantity],
[PickingCompletedWhen],
[LastEditedBy],
[LastEditedWhen],
[CustomerID],
[SalespersonPersonID],
[PickedByPersonID],
[ContactPersonID],
[BackorderOrderID],
[OrderDate],
[ExpectedDeliveryDate],
[CustomerPurchaseOrderNumber],
[IsUndersupplyBackordered],
[Comments],
[DeliveryInstructions],
[InternalComments],
[SalesOrdersPickingCompletedWhen],
[SalesOrdersLastEditedBy],
[SalesOrdersLastEditedWhen]
FROM [dbo].[tv_SalesOrderLines] AS [SalesOrderLines]
-- Insert new rows into the target table from the transform table view, which substitutes surrogate keys and date keys.
INSERT INTO [wwi].[Order]
(
[OrderLineID],
[OrderID],
[Description],
[PackageTypeID],
[Quantity],
[UnitPrice],
[TaxRate],
[PickedQuantity],
[PickingCompletedWhenKey],
[LastEditedBy],
[LastEditedWhen],
[CustomerID],
[SalespersonPersonID],
[PickedByPersonID],
[ContactPersonID],
[BackorderOrderID],
[OrderDateKey],
[ExpectedDeliveryDateKey],
[CustomerPurchaseOrderNumber],
[IsUndersupplyBackordered],
[Comments],
[DeliveryInstructions],
[InternalComments],
[SalesOrdersPickingCompletedWhenKey],
[SalesOrdersLastEditedBy],
[SalesOrdersLastEditedWhen],
[WarehouseStockItemsKey]
)
SELECT
[TransformTableView].[OrderLineID],
[TransformTableView].[OrderID],
[TransformTableView].[Description],
[TransformTableView].[PackageTypeID],
[TransformTableView].[Quantity],
[TransformTableView].[UnitPrice],
[TransformTableView].[TaxRate],
[TransformTableView].[PickedQuantity],
[TransformTableView].[PickingCompletedWhenKey],
[TransformTableView].[LastEditedBy],
[TransformTableView].[LastEditedWhen],
[TransformTableView].[CustomerID],
[TransformTableView].[SalespersonPersonID],
[TransformTableView].[PickedByPersonID],
[TransformTableView].[ContactPersonID],
[TransformTableView].[BackorderOrderID],
[TransformTableView].[OrderDateKey],
[TransformTableView].[ExpectedDeliveryDateKey],
[TransformTableView].[CustomerPurchaseOrderNumber],
[TransformTableView].[IsUndersupplyBackordered],
[TransformTableView].[Comments],
[TransformTableView].[DeliveryInstructions],
[TransformTableView].[InternalComments],
[TransformTableView].[SalesOrdersPickingCompletedWhenKey],
[TransformTableView].[SalesOrdersLastEditedBy],
[TransformTableView].[SalesOrdersLastEditedWhen],
[TransformTableView].[WarehouseStockItemsKey]
FROM [dbo].[ttv_SalesOrderLines] AS [TransformTableView]
WHERE NOT EXISTS
(SELECT 1 FROM [wwi].[Order] AS [Order]
WHERE [TransformTableView].[OrderLineID] = [Order].[OrderLineID])
-- Update modified rows in the transform table view to the target table.
UPDATE [wwi].[Order]
SET
[OrderLineID] = [TransformTableView].[OrderLineID],
[OrderID] = [TransformTableView].[OrderID],
[Description] = [TransformTableView].[Description],
[PackageTypeID] = [TransformTableView].[PackageTypeID],
[Quantity] = [TransformTableView].[Quantity],
[UnitPrice] = [TransformTableView].[UnitPrice],
[TaxRate] = [TransformTableView].[TaxRate],
[PickedQuantity] = [TransformTableView].[PickedQuantity],
[PickingCompletedWhenKey] = [TransformTableView].[PickingCompletedWhenKey],
[LastEditedBy] = [TransformTableView].[LastEditedBy],
[LastEditedWhen] = [TransformTableView].[LastEditedWhen],
[CustomerID] = [TransformTableView].[CustomerID],
[SalespersonPersonID] = [TransformTableView].[SalespersonPersonID],
[PickedByPersonID] = [TransformTableView].[PickedByPersonID],
[ContactPersonID] = [TransformTableView].[ContactPersonID],
[BackorderOrderID] = [TransformTableView].[BackorderOrderID],
[OrderDateKey] = [TransformTableView].[OrderDateKey],
[ExpectedDeliveryDateKey] = [TransformTableView].[ExpectedDeliveryDateKey],
[CustomerPurchaseOrderNumber] = [TransformTableView].[CustomerPurchaseOrderNumber],
[IsUndersupplyBackordered] = [TransformTableView].[IsUndersupplyBackordered],
[Comments] = [TransformTableView].[Comments],
[DeliveryInstructions] = [TransformTableView].[DeliveryInstructions],
[InternalComments] = [TransformTableView].[InternalComments],
[SalesOrdersPickingCompletedWhenKey] = [TransformTableView].[SalesOrdersPickingCompletedWhenKey],
[SalesOrdersLastEditedBy] = [TransformTableView].[SalesOrdersLastEditedBy],
[SalesOrdersLastEditedWhen] = [TransformTableView].[SalesOrdersLastEditedWhen],
[WarehouseStockItemsKey] = [TransformTableView].[WarehouseStockItemsKey]
FROM [dbo].[ttv_SalesOrderLines] AS [TransformTableView]
WHERE
[Order].[OrderLineID] = [TransformTableView].[OrderLineID]
AND
([Order].[LastEditedWhen] != [TransformTableView].[LastEditedWhen]
OR [Order].[SalesOrdersLastEditedWhen] != [TransformTableView].[SalesOrdersLastEditedWhen])
END
GO
-- wwi::SalesCustomers
-- TRANSFORM VIEW
IF(OBJECT_ID('dbo.tv_SalesCustomers')) IS NOT NULL DROP VIEW [dbo].[tv_SalesCustomers]
GO
CREATE VIEW [dbo].[tv_SalesCustomers]
AS
SELECT
[SalesCustomers].[CustomerID],
[SalesCustomers].[CustomerName],
[SalesCustomers].[BillToCustomerID],
[SalesCustomers].[CustomerCategoryID],
[SalesCustomers].[BuyingGroupID],
[SalesCustomers].[PrimaryContactPersonID],
[SalesCustomers].[AlternateContactPersonID],
[SalesCustomers].[DeliveryMethodID],
[SalesCustomers].[DeliveryCityID],
[SalesCustomers].[PostalCityID],
[SalesCustomers].[CreditLimit],
[SalesCustomers].[AccountOpenedDate],
[SalesCustomers].[StandardDiscountPercentage],
[SalesCustomers].[IsStatementSent],
[SalesCustomers].[IsOnCreditHold],
[SalesCustomers].[PaymentDays],
[SalesCustomers].[PhoneNumber],
[SalesCustomers].[FaxNumber],
[SalesCustomers].[DeliveryRun],
[SalesCustomers].[RunPosition],
[SalesCustomers].[WebsiteURL],
[SalesCustomers].[DeliveryAddressLine1],
[SalesCustomers].[DeliveryAddressLine2],
[SalesCustomers].[DeliveryPostalCode],
[SalesCustomers].[DeliveryLocation],
[SalesCustomers].[PostalAddressLine1],
[SalesCustomers].[PostalAddressLine2],
[SalesCustomers].[PostalPostalCode],
[SalesCustomers].[LastEditedBy],
[SalesCustomers].[ValidFrom],
[SalesCustomers].[ValidTo],
[SalesCustomerCategories].[CustomerCategoryName],
[SalesCustomerCategories].[LastEditedBy] AS [SalesCustomerCategoriesLastEditedBy],
[SalesCustomerCategories].[ValidFrom] AS [SalesCustomerCategoriesValidFrom],
[SalesCustomerCategories].[ValidTo] AS [SalesCustomerCategoriesValidTo],
[SalesBuyingGroups].[BuyingGroupName],
[SalesBuyingGroups].[LastEditedBy] AS [SalesBuyingGroupsLastEditedBy],
[SalesBuyingGroups].[ValidFrom] AS [SalesBuyingGroupsValidFrom],
[SalesBuyingGroups].[ValidTo] AS [SalesBuyingGroupsValidTo]
FROM [dbo].[SalesCustomers] AS [SalesCustomers]
LEFT OUTER JOIN [dbo].[SalesCustomerCategories] AS [SalesCustomerCategories] ON [SalesCustomers].[CustomerCategoryID] = [SalesCustomerCategories].[CustomerCategoryID]
LEFT OUTER JOIN [dbo].[SalesBuyingGroups] AS [SalesBuyingGroups] ON [SalesCustomers].[BuyingGroupID] = [SalesBuyingGroups].[BuyingGroupID]
GO
-- TRANSFORM TABLE
IF(OBJECT_ID('dbo.tt_SalesCustomers')) IS NOT NULL DROP TABLE [dbo].[tt_SalesCustomers]
CREATE TABLE [dbo].[tt_SalesCustomers]
WITH (DISTRIBUTION = ROUND_ROBIN)
AS
SELECT
[CustomerID],
[CustomerName],
[BillToCustomerID],
[CustomerCategoryID],
[BuyingGroupID],
[PrimaryContactPersonID],
[AlternateContactPersonID],
[DeliveryMethodID],
[DeliveryCityID],
[PostalCityID],
[CreditLimit],
[AccountOpenedDate],
[StandardDiscountPercentage],
[IsStatementSent],
[IsOnCreditHold],
[PaymentDays],
[PhoneNumber],
[FaxNumber],
[DeliveryRun],
[RunPosition],
[WebsiteURL],
[DeliveryAddressLine1],
[DeliveryAddressLine2],
[DeliveryPostalCode],
[DeliveryLocation],
[PostalAddressLine1],
[PostalAddressLine2],
[PostalPostalCode],
[LastEditedBy],
[ValidFrom],
[ValidTo],
[CustomerCategoryName],
[SalesCustomerCategoriesLastEditedBy],
[SalesCustomerCategoriesValidFrom],
[SalesCustomerCategoriesValidTo],
[BuyingGroupName],
[SalesBuyingGroupsLastEditedBy],
[SalesBuyingGroupsValidFrom],
[SalesBuyingGroupsValidTo]
FROM [dbo].[tv_SalesCustomers] AS [SalesCustomers]
GO
-- TRANSFORM PROCEDURE
IF(OBJECT_ID('dbo.usp_transform_Customer')) IS NOT NULL DROP PROCEDURE [dbo].[usp_transform_Customer]
GO
-- wwi.Customer Upsert Via Temp Table
CREATE PROCEDURE [dbo].[usp_transform_Customer]
AS
BEGIN
-- Use CTAS to create transform table with staged data from the transform view.
IF(OBJECT_ID('dbo.tt_SalesCustomers')) IS NOT NULL DROP TABLE [dbo].[tt_SalesCustomers]
CREATE TABLE [dbo].[tt_SalesCustomers]
WITH (DISTRIBUTION = ROUND_ROBIN)
AS
SELECT
[CustomerID],
[CustomerName],
[BillToCustomerID],
[CustomerCategoryID],
[BuyingGroupID],
[PrimaryContactPersonID],
[AlternateContactPersonID],
[DeliveryMethodID],
[DeliveryCityID],
[PostalCityID],
[CreditLimit],
[AccountOpenedDate],
[StandardDiscountPercentage],
[IsStatementSent],
[IsOnCreditHold],
[PaymentDays],
[PhoneNumber],
[FaxNumber],
[DeliveryRun],
[RunPosition],
[WebsiteURL],
[DeliveryAddressLine1],
[DeliveryAddressLine2],
[DeliveryPostalCode],
[DeliveryLocation],
[PostalAddressLine1],
[PostalAddressLine2],
[PostalPostalCode],
[LastEditedBy],
[ValidFrom],
[ValidTo],
[CustomerCategoryName],
[SalesCustomerCategoriesLastEditedBy],
[SalesCustomerCategoriesValidFrom],
[SalesCustomerCategoriesValidTo],
[BuyingGroupName],
[SalesBuyingGroupsLastEditedBy],
[SalesBuyingGroupsValidFrom],
[SalesBuyingGroupsValidTo]
FROM [dbo].[tv_SalesCustomers] AS [SalesCustomers]
-- Use CTAS to create temporary table to merge existing and new/updated rows
IF(OBJECT_ID('temp.Customer_temp')) IS NOT NULL DROP TABLE [temp].[Customer_temp]
CREATE TABLE [temp].[Customer_temp]
WITH (DISTRIBUTION = ROUND_ROBIN)
AS
-- Get rows from target table not present or unchanged in the transform table
SELECT
[CustomerKeyPK],
[CustomerID],
[CustomerName],
[BillToCustomerID],
[CustomerCategoryID],
[BuyingGroupID],
[PrimaryContactPersonID],
[AlternateContactPersonID],
[DeliveryMethodID],
[DeliveryCityID],
[PostalCityID],
[CreditLimit],
[AccountOpenedDate],
[StandardDiscountPercentage],
[IsStatementSent],
[IsOnCreditHold],
[PaymentDays],
[PhoneNumber],
[FaxNumber],
[DeliveryRun],
[RunPosition],
[WebsiteURL],
[DeliveryAddressLine1],
[DeliveryAddressLine2],
[DeliveryPostalCode],
[DeliveryLocation],
[PostalAddressLine1],
[PostalAddressLine2],
[PostalPostalCode],
[LastEditedBy],
[ValidFrom],
[ValidTo],
[CustomerCategoryName],
[SalesCustomerCategoriesLastEditedBy],
[SalesCustomerCategoriesValidFrom],
[SalesCustomerCategoriesValidTo],
[BuyingGroupName],
[SalesBuyingGroupsLastEditedBy],
[SalesBuyingGroupsValidFrom],
[SalesBuyingGroupsValidTo]
FROM [wwi].[Customer] AS [Customer]
WHERE
NOT EXISTS -- not in staging
(SELECT 1 FROM [dbo].[tt_SalesCustomers] AS [TransformTable]
WHERE [Customer].[CustomerID] = [TransformTable].[CustomerID])
OR
EXISTS -- in staging but not changed
(SELECT 1 FROM [dbo].[tt_SalesCustomers] AS [TransformTable]
WHERE [Customer].[CustomerID] = [TransformTable].[CustomerID]
AND ([Customer].[ValidFrom] = [TransformTable].[ValidFrom]
AND [Customer].[SalesCustomerCategoriesValidFrom] = [TransformTable].[SalesCustomerCategoriesValidFrom]
AND [Customer].[SalesBuyingGroupsValidFrom] = [TransformTable].[SalesBuyingGroupsValidFrom]))
SET IDENTITY_INSERT [temp].[Customer_temp] ON
-- Insert modified rows
INSERT INTO [temp].[Customer_temp]
(
[CustomerKeyPK],
[CustomerID],
[CustomerName],
[BillToCustomerID],
[CustomerCategoryID],
[BuyingGroupID],
[PrimaryContactPersonID],
[AlternateContactPersonID],
[DeliveryMethodID],
[DeliveryCityID],
[PostalCityID],
[CreditLimit],
[AccountOpenedDate],
[StandardDiscountPercentage],
[IsStatementSent],
[IsOnCreditHold],
[PaymentDays],
[PhoneNumber],
[FaxNumber],
[DeliveryRun],
[RunPosition],
[WebsiteURL],
[DeliveryAddressLine1],
[DeliveryAddressLine2],
[DeliveryPostalCode],
[DeliveryLocation],
[PostalAddressLine1],
[PostalAddressLine2],
[PostalPostalCode],
[LastEditedBy],
[ValidFrom],
[ValidTo],
[CustomerCategoryName],
[SalesCustomerCategoriesLastEditedBy],
[SalesCustomerCategoriesValidFrom],
[SalesCustomerCategoriesValidTo],
[BuyingGroupName],
[SalesBuyingGroupsLastEditedBy],
[SalesBuyingGroupsValidFrom],
[SalesBuyingGroupsValidTo]
)
SELECT
[Customer].[CustomerKeyPK],
[TransformTable].[CustomerID],
[TransformTable].[CustomerName],
[TransformTable].[BillToCustomerID],
[TransformTable].[CustomerCategoryID],
[TransformTable].[BuyingGroupID],
[TransformTable].[PrimaryContactPersonID],
[TransformTable].[AlternateContactPersonID],
[TransformTable].[DeliveryMethodID],
[TransformTable].[DeliveryCityID],
[TransformTable].[PostalCityID],
[TransformTable].[CreditLimit],
[TransformTable].[AccountOpenedDate],
[TransformTable].[StandardDiscountPercentage],
[TransformTable].[IsStatementSent],
[TransformTable].[IsOnCreditHold],
[TransformTable].[PaymentDays],
[TransformTable].[PhoneNumber],
[TransformTable].[FaxNumber],
[TransformTable].[DeliveryRun],
[TransformTable].[RunPosition],
[TransformTable].[WebsiteURL],
[TransformTable].[DeliveryAddressLine1],
[TransformTable].[DeliveryAddressLine2],
[TransformTable].[DeliveryPostalCode],
[TransformTable].[DeliveryLocation],
[TransformTable].[PostalAddressLine1],
[TransformTable].[PostalAddressLine2],
[TransformTable].[PostalPostalCode],
[TransformTable].[LastEditedBy],
[TransformTable].[ValidFrom],
[TransformTable].[ValidTo],
[TransformTable].[CustomerCategoryName],
[TransformTable].[SalesCustomerCategoriesLastEditedBy],
[TransformTable].[SalesCustomerCategoriesValidFrom],
[TransformTable].[SalesCustomerCategoriesValidTo],
[TransformTable].[BuyingGroupName],
[TransformTable].[SalesBuyingGroupsLastEditedBy],
[TransformTable].[SalesBuyingGroupsValidFrom],
[TransformTable].[SalesBuyingGroupsValidTo]
FROM [dbo].[tt_SalesCustomers] AS [TransformTable]
INNER JOIN [wwi].[Customer] AS [Customer] ON [Customer].[CustomerID] = [TransformTable].[CustomerID]
WHERE ([Customer].[ValidFrom] != [TransformTable].[ValidFrom]
OR [Customer].[SalesCustomerCategoriesValidFrom] != [TransformTable].[SalesCustomerCategoriesValidFrom]
OR [Customer].[SalesBuyingGroupsValidFrom] != [TransformTable].[SalesBuyingGroupsValidFrom])
SET IDENTITY_INSERT [temp].[Customer_temp] OFF
-- insert the new rows from the staging transform table
INSERT INTO [temp].[Customer_temp]
SELECT DISTINCT
[CustomerID],
[CustomerName],
[BillToCustomerID],
[CustomerCategoryID],
[BuyingGroupID],
[PrimaryContactPersonID],
[AlternateContactPersonID],
[DeliveryMethodID],
[DeliveryCityID],
[PostalCityID],
[CreditLimit],
[AccountOpenedDate],
[StandardDiscountPercentage],
[IsStatementSent],
[IsOnCreditHold],
[PaymentDays],
[PhoneNumber],
[FaxNumber],
[DeliveryRun],
[RunPosition],
[WebsiteURL],
[DeliveryAddressLine1],
[DeliveryAddressLine2],
[DeliveryPostalCode],
[DeliveryLocation],
[PostalAddressLine1],
[PostalAddressLine2],
[PostalPostalCode],
[LastEditedBy],
[ValidFrom],
[ValidTo],
[CustomerCategoryName],
[SalesCustomerCategoriesLastEditedBy],
[SalesCustomerCategoriesValidFrom],
[SalesCustomerCategoriesValidTo],
[BuyingGroupName],
[SalesBuyingGroupsLastEditedBy],
[SalesBuyingGroupsValidFrom],
[SalesBuyingGroupsValidTo]
FROM [dbo].[tt_SalesCustomers] AS [TransformTable]
WHERE NOT EXISTS
(SELECT 1 FROM [wwi].[Customer] AS [Customer]
WHERE [Customer].[CustomerID] = [TransformTable].[CustomerID])
-- Delete the old dimension table if it exists (from a prior transform).
IF OBJECT_ID('expired.Customer_old') IS NOT NULL DROP TABLE [expired].[Customer_old]
-- Rename the current dimension to old and the temporary table to current.
RENAME OBJECT [wwi].[Customer] TO [Customer_old]
ALTER SCHEMA [expired] TRANSFER [wwi].[Customer_old]
RENAME OBJECT [temp].[Customer_temp] TO [Customer]
ALTER SCHEMA [wwi] TRANSFER [temp].[Customer]
END
GO
-- wwi::WarehouseStockItems
-- TRANSFORM VIEW
IF(OBJECT_ID('dbo.tv_WarehouseStockItems')) IS NOT NULL DROP VIEW [dbo].[tv_WarehouseStockItems]
GO
CREATE VIEW [dbo].[tv_WarehouseStockItems]
AS
SELECT
[WarehouseStockItems].[StockItemID],
[WarehouseStockItems].[StockItemName],
[WarehouseStockItems].[SupplierID],
[WarehouseStockItems].[ColorID],
[WarehouseStockItems].[UnitPackageID],
[WarehouseStockItems].[OuterPackageID],
[WarehouseStockItems].[Brand],
[WarehouseStockItems].[Size],
[WarehouseStockItems].[LeadTimeDays],
[WarehouseStockItems].[QuantityPerOuter],
[WarehouseStockItems].[IsChillerStock],
[WarehouseStockItems].[Barcode],
[WarehouseStockItems].[TaxRate],
[WarehouseStockItems].[UnitPrice],
[WarehouseStockItems].[RecommendedRetailPrice],
[WarehouseStockItems].[TypicalWeightPerUnit],
[WarehouseStockItems].[MarketingComments],
[WarehouseStockItems].[InternalComments],
[WarehouseStockItems].[CustomFields],
[WarehouseStockItems].[Tags],
[WarehouseStockItems].[SearchDetails],
[WarehouseStockItems].[LastEditedBy],
[WarehouseStockItems].[ValidFrom],
[Colors].[ColorName],
[Colors].[LastEditedBy] AS [ColorsLastEditedBy],
[Colors].[ValidFrom] AS [ColorsValidFrom],
[UnitPackageType].[PackageTypeName],
[UnitPackageType].[LastEditedBy] AS [UnitPackageTypeLastEditedBy],
[UnitPackageType].[ValidFrom] AS [UnitPackageTypeValidFrom],
[OuterPackageType].[PackageTypeName] AS [OuterPackageTypePackageTypeName],
[OuterPackageType].[LastEditedBy] AS [OuterPackageTypeLastEditedBy],
[OuterPackageType].[ValidFrom] AS [OuterPackageTypeValidFrom]
FROM [dbo].[WarehouseStockItems] AS [WarehouseStockItems]
LEFT OUTER JOIN [dbo].[WarehouseColors] AS [Colors] ON [WarehouseStockItems].[ColorID] = [Colors].[ColorID]
LEFT OUTER JOIN [dbo].[WarehousePackageTypes] AS [UnitPackageType] ON [WarehouseStockItems].[UnitPackageID] = [UnitPackageType].[PackageTypeID]
LEFT OUTER JOIN [dbo].[WarehousePackageTypes] AS [OuterPackageType] ON [WarehouseStockItems].[OuterPackageID] = [OuterPackageType].[PackageTypeID]
GO
-- TRANSFORM TABLE
IF(OBJECT_ID('dbo.tt_WarehouseStockItems')) IS NOT NULL DROP TABLE [dbo].[tt_WarehouseStockItems]
CREATE TABLE [dbo].[tt_WarehouseStockItems]
WITH (DISTRIBUTION = ROUND_ROBIN)
AS
SELECT
[StockItemID],
[StockItemName],
[SupplierID],
[ColorID],
[UnitPackageID],
[OuterPackageID],
[Brand],
[Size],
[LeadTimeDays],
[QuantityPerOuter],
[IsChillerStock],
[Barcode],
[TaxRate],
[UnitPrice],
[RecommendedRetailPrice],
[TypicalWeightPerUnit],
[MarketingComments],
[InternalComments],
[CustomFields],
[Tags],
[SearchDetails],
[LastEditedBy],
[ValidFrom],
[ColorName],
[ColorsLastEditedBy],
[ColorsValidFrom],
[PackageTypeName],
[UnitPackageTypeLastEditedBy],
[UnitPackageTypeValidFrom],
[OuterPackageTypePackageTypeName],
[OuterPackageTypeLastEditedBy],
[OuterPackageTypeValidFrom]
FROM [dbo].[tv_WarehouseStockItems] AS [WarehouseStockItems]
GO
-- TRANSFORM PROCEDURE
IF(OBJECT_ID('dbo.usp_transform_StockItem')) IS NOT NULL DROP PROCEDURE [dbo].[usp_transform_StockItem]
GO
-- wwi.StockItem Upsert Via Temp Table
CREATE PROCEDURE [dbo].[usp_transform_StockItem]
AS
BEGIN
-- Use CTAS to create transform table with staged data from the transform view.
IF(OBJECT_ID('dbo.tt_WarehouseStockItems')) IS NOT NULL DROP TABLE [dbo].[tt_WarehouseStockItems]
CREATE TABLE [dbo].[tt_WarehouseStockItems]
WITH (DISTRIBUTION = ROUND_ROBIN)
AS
SELECT
[StockItemID],
[StockItemName],
[SupplierID],
[ColorID],
[UnitPackageID],
[OuterPackageID],
[Brand],
[Size],
[LeadTimeDays],
[QuantityPerOuter],
[IsChillerStock],
[Barcode],
[TaxRate],
[UnitPrice],
[RecommendedRetailPrice],
[TypicalWeightPerUnit],
[MarketingComments],
[InternalComments],
[CustomFields],
[Tags],
[SearchDetails],
[LastEditedBy],
[ValidFrom],
[ColorName],
[ColorsLastEditedBy],
[ColorsValidFrom],
[PackageTypeName],
[UnitPackageTypeLastEditedBy],
[UnitPackageTypeValidFrom],
[OuterPackageTypePackageTypeName],
[OuterPackageTypeLastEditedBy],
[OuterPackageTypeValidFrom]
FROM [dbo].[tv_WarehouseStockItems] AS [WarehouseStockItems]
-- Use CTAS to create temporary table to merge existing and new/updated rows
IF(OBJECT_ID('temp.StockItem_temp')) IS NOT NULL DROP TABLE [temp].[StockItem_temp]
CREATE TABLE [temp].[StockItem_temp]
WITH (DISTRIBUTION = ROUND_ROBIN)
AS
-- Get rows from target table not present or unchanged in the transform table
SELECT
[StockItemKeyPK],
[StockItemID],
[StockItemName],
[SupplierID],
[ColorID],
[UnitPackageID],
[OuterPackageID],
[Brand],
[Size],
[LeadTimeDays],
[QuantityPerOuter],
[IsChillerStock],
[Barcode],
[TaxRate],
[UnitPrice],
[RecommendedRetailPrice],
[TypicalWeightPerUnit],
[MarketingComments],
[InternalComments],
[CustomFields],
[Tags],
[SearchDetails],
[LastEditedBy],
[ValidFrom],
[ColorName],
[ColorsLastEditedBy],
[ColorsValidFrom],
[PackageTypeName],
[UnitPackageTypeLastEditedBy],
[UnitPackageTypeValidFrom],
[OuterPackageTypePackageTypeName],
[OuterPackageTypeLastEditedBy],
[OuterPackageTypeValidFrom]
FROM [wwi].[StockItem] AS [StockItem]
WHERE
NOT EXISTS -- not in staging
(SELECT 1 FROM [dbo].[tt_WarehouseStockItems] AS [TransformTable]
WHERE [StockItem].[StockItemID] = [TransformTable].[StockItemID])
OR
EXISTS -- in staging but not changed
(SELECT 1 FROM [dbo].[tt_WarehouseStockItems] AS [TransformTable]
WHERE [StockItem].[StockItemID] = [TransformTable].[StockItemID]
AND ([StockItem].[ValidFrom] = [TransformTable].[ValidFrom]
AND [StockItem].[ColorsValidFrom] = [TransformTable].[ColorsValidFrom]
AND [StockItem].[UnitPackageTypeValidFrom] = [TransformTable].[UnitPackageTypeValidFrom]
AND [StockItem].[OuterPackageTypeValidFrom] = [TransformTable].[OuterPackageTypeValidFrom]))
SET IDENTITY_INSERT [temp].[StockItem_temp] ON
-- Insert modified rows
INSERT INTO [temp].[StockItem_temp]
(
[StockItemKeyPK],
[StockItemID],
[StockItemName],
[SupplierID],
[ColorID],
[UnitPackageID],
[OuterPackageID],
[Brand],
[Size],
[LeadTimeDays],
[QuantityPerOuter],
[IsChillerStock],
[Barcode],
[TaxRate],
[UnitPrice],
[RecommendedRetailPrice],
[TypicalWeightPerUnit],
[MarketingComments],
[InternalComments],
[CustomFields],
[Tags],
[SearchDetails],
[LastEditedBy],
[ValidFrom],
[ColorName],
[ColorsLastEditedBy],
[ColorsValidFrom],
[PackageTypeName],
[UnitPackageTypeLastEditedBy],
[UnitPackageTypeValidFrom],
[OuterPackageTypePackageTypeName],
[OuterPackageTypeLastEditedBy],
[OuterPackageTypeValidFrom]
)
SELECT
[StockItem].[StockItemKeyPK],
[TransformTable].[StockItemID],
[TransformTable].[StockItemName],
[TransformTable].[SupplierID],
[TransformTable].[ColorID],
[TransformTable].[UnitPackageID],
[TransformTable].[OuterPackageID],
[TransformTable].[Brand],
[TransformTable].[Size],
[TransformTable].[LeadTimeDays],
[TransformTable].[QuantityPerOuter],
[TransformTable].[IsChillerStock],
[TransformTable].[Barcode],
[TransformTable].[TaxRate],
[TransformTable].[UnitPrice],
[TransformTable].[RecommendedRetailPrice],
[TransformTable].[TypicalWeightPerUnit],
[TransformTable].[MarketingComments],
[TransformTable].[InternalComments],
[TransformTable].[CustomFields],
[TransformTable].[Tags],
[TransformTable].[SearchDetails],
[TransformTable].[LastEditedBy],
[TransformTable].[ValidFrom],
[TransformTable].[ColorName],
[TransformTable].[ColorsLastEditedBy],
[TransformTable].[ColorsValidFrom],
[TransformTable].[PackageTypeName],
[TransformTable].[UnitPackageTypeLastEditedBy],
[TransformTable].[UnitPackageTypeValidFrom],
[TransformTable].[OuterPackageTypePackageTypeName],
[TransformTable].[OuterPackageTypeLastEditedBy],
[TransformTable].[OuterPackageTypeValidFrom]
FROM [dbo].[tt_WarehouseStockItems] AS [TransformTable]
INNER JOIN [wwi].[StockItem] AS [StockItem] ON [StockItem].[StockItemID] = [TransformTable].[StockItemID]
WHERE ([StockItem].[ValidFrom] != [TransformTable].[ValidFrom]
OR [StockItem].[ColorsValidFrom] != [TransformTable].[ColorsValidFrom]
OR [StockItem].[UnitPackageTypeValidFrom] != [TransformTable].[UnitPackageTypeValidFrom]
OR [StockItem].[OuterPackageTypeValidFrom] != [TransformTable].[OuterPackageTypeValidFrom])
SET IDENTITY_INSERT [temp].[StockItem_temp] OFF
-- insert the new rows from the staging transform table
INSERT INTO [temp].[StockItem_temp]
SELECT DISTINCT
[StockItemID],
[StockItemName],
[SupplierID],
[ColorID],
[UnitPackageID],
[OuterPackageID],
[Brand],
[Size],
[LeadTimeDays],
[QuantityPerOuter],
[IsChillerStock],
[Barcode],
[TaxRate],
[UnitPrice],
[RecommendedRetailPrice],
[TypicalWeightPerUnit],
[MarketingComments],
[InternalComments],
[CustomFields],
[Tags],
[SearchDetails],
[LastEditedBy],
[ValidFrom],
[ColorName],
[ColorsLastEditedBy],
[ColorsValidFrom],
[PackageTypeName],
[UnitPackageTypeLastEditedBy],
[UnitPackageTypeValidFrom],
[OuterPackageTypePackageTypeName],
[OuterPackageTypeLastEditedBy],
[OuterPackageTypeValidFrom]
FROM [dbo].[tt_WarehouseStockItems] AS [TransformTable]
WHERE NOT EXISTS
(SELECT 1 FROM [wwi].[StockItem] AS [StockItem]
WHERE [StockItem].[StockItemID] = [TransformTable].[StockItemID])
-- Delete the old dimension table if it exists (from a prior transform).
IF OBJECT_ID('expired.StockItem_old') IS NOT NULL DROP TABLE [expired].[StockItem_old]
-- Rename the current dimension to old and the temporary table to current.
RENAME OBJECT [wwi].[StockItem] TO [StockItem_old]
ALTER SCHEMA [expired] TRANSFER [wwi].[StockItem_old]
RENAME OBJECT [temp].[StockItem_temp] TO [StockItem]
ALTER SCHEMA [wwi] TRANSFER [temp].[StockItem]
END
GO
-- TRANSFORM CONTROLLER
IF(OBJECT_ID('dbo.uspTransformWideWorldImporters-Sales')) IS NOT NULL DROP PROCEDURE [dbo].[uspTransformWideWorldImporters-Sales]
GO
-- WideWorldImporters-Sales model transform controller
CREATE PROCEDURE [dbo].[uspTransformWideWorldImporters-Sales]
AS
BEGIN
-- Transform dimension tables
EXEC [dbo].[usp_transform_Customer]
EXEC [dbo].[usp_transform_StockItem]
-- Transform fact tables
EXEC [dbo].[usp_transform_Order]
END
/*
Transform Controller, transform all dimensional tables from staging tables in correct order
EXEC [dbo].[uspTransformWideWorldImporters-Sales]
Query dimensional model tables mapped from entity model WideWorldImporters-Sales
SELECT TOP 100 * FROM [wwi].[Order]
SELECT TOP 100 * FROM [wwi].[Customer]
SELECT TOP 100 * FROM [wwi].[StockItem]
*/ | the_stack |
drop function if exists ad_user_record_access_updatefrom_bpartnerhierarchy();
create function ad_user_record_access_updatefrom_bpartnerhierarchy()
returns void
language plpgsql
as
$$
declare
v_count numeric;
begin
drop table if exists TMP_RecordsToGrantAccess;
create temporary table TMP_RecordsToGrantAccess
(
ad_table_id numeric not null,
record_id numeric not null,
ad_user_id numeric not null,
access varchar,
comments text,
id numeric not null,
parent_id numeric,
root_id numeric
);
create unique index on TMP_RecordsToGrantAccess (id);
--
-- BPartners
--
with recursive bpartner as (
select c_bpartner_id as root_bpartner_id,
bp.name as root_bpartner_name,
salesrep_id as root_salesRep_ID,
(select u.Name from AD_user u where u.ad_user_id = bp.salesrep_id) as root_salesRep_Name,
c_bpartner_id,
bp.name as BPName,
permissions.access as access,
nextval('ad_user_record_access_seq') as id,
null::numeric as parent_id,
null::numeric as root_id
from c_bpartner bp,
(select 'R' as access
union all
select 'W' as access
) as permissions
where SalesRep_ID is not null
and c_bpartner_salesrep_id is null
--
union all
--
select parent.root_bpartner_id,
parent.root_bpartner_name,
parent.root_salesRep_ID,
parent.root_salesRep_Name,
child.c_bpartner_id,
child.name as BPName,
parent.access as access,
nextval('ad_user_record_access_seq') as id,
parent.id as parent_id,
parent.id as root_id
from bpartner parent
inner join c_bpartner child on child.c_bpartner_salesrep_id = parent.c_bpartner_id
)
insert
into TMP_RecordsToGrantAccess(ad_table_id, record_id, ad_user_id, access, comments, id, parent_id, root_id)
select 291 as ad_table_id,
c_bpartner_id as record_id,
root_salesRep_ID as ad_user_id,
bpartner.access as access,
'BP: ' || BPName || '(Root: ' || root_bpartner_name || ')' as comments,
bpartner.id as id,
bpartner.parent_id as parent_id,
bpartner.root_id as root_id
from bpartner
order by root_bpartner_id;
-- select * from bpartner order by root_bpartner_id
GET DIAGNOSTICS v_count = ROW_COUNT;
raise notice 'Considered % C_BPartner(s)', v_count;
--
-- Set Root_ID
--
update TMP_RecordsToGrantAccess set root_id=id where root_id is null;
GET DIAGNOSTICS v_count = ROW_COUNT;
raise notice 'Set Root_ID for % records', v_count;
--
-- Orders
--
insert
into TMP_RecordsToGrantAccess(ad_table_id, record_id, ad_user_id, access, comments, id, parent_id, root_id)
select 259 as AD_Table_ID,
o.c_order_id as record_id,
a.ad_user_id as ad_user_id,
a.access as access,
'' as comments,
nextval('ad_user_record_access_seq') as id,
a.id as parent_id,
a.root_id as root_id
from TMP_RecordsToGrantAccess a
inner join C_Order o on o.c_bpartner_id = a.record_id
where a.ad_table_id = 291 -- C_BPartner
;
GET DIAGNOSTICS v_count = ROW_COUNT;
raise notice 'Considered % C_Order(s)', v_count;
--
-- Invoices
--
insert
into TMP_RecordsToGrantAccess(ad_table_id, record_id, ad_user_id, access, comments, id, parent_id, root_id)
select 318 as AD_Table_ID,
i.c_invoice_id as record_id,
a.ad_user_id as ad_user_id,
a.access as access,
'' as comments,
nextval('ad_user_record_access_seq') as id,
a.id as parent_id,
a.root_id as root_id
from TMP_RecordsToGrantAccess a
inner join c_invoice i on i.c_bpartner_id = a.record_id
where a.ad_table_id = 291 -- C_BPartner
;
GET DIAGNOSTICS v_count = ROW_COUNT;
raise notice 'Considered % C_Invoice(s)', v_count;
--
-- InOuts
--
insert
into TMP_RecordsToGrantAccess(ad_table_id, record_id, ad_user_id, access, comments, id, parent_id, root_id)
select 319 as AD_Table_ID,
io.m_inout_id as record_id,
a.ad_user_id as ad_user_id,
a.access as access,
'' as comments,
nextval('ad_user_record_access_seq') as id,
a.id as parent_id,
a.root_id as root_id
from TMP_RecordsToGrantAccess a
inner join m_inout io on io.c_bpartner_id = a.record_id
where a.ad_table_id = 291 -- C_BPartner
;
GET DIAGNOSTICS v_count = ROW_COUNT;
raise notice 'Considered % M_InOut(s)', v_count;
--
-- Payments
--
insert
into TMP_RecordsToGrantAccess(ad_table_id, record_id, ad_user_id, access, comments, id, parent_id, root_id)
select 335 as AD_Table_ID,
p.c_payment_id as record_id,
a.ad_user_id as ad_user_id,
a.access as access,
'' as comments,
nextval('ad_user_record_access_seq') as id,
a.id as parent_id,
a.root_id as root_id
from TMP_RecordsToGrantAccess a
inner join c_payment p on p.c_bpartner_id = a.record_id
where a.ad_table_id = 291 -- C_BPartner
;
GET DIAGNOSTICS v_count = ROW_COUNT;
raise notice 'Considered % C_Payment(s)', v_count;
--
-- Requests
--
insert
into TMP_RecordsToGrantAccess(ad_table_id, record_id, ad_user_id, access, comments, id, parent_id, root_id)
select 417 as AD_Table_ID,
r.R_Request_Id as record_id,
a.ad_user_id as ad_user_id,
a.access as access,
'' as comments,
nextval('ad_user_record_access_seq') as id,
a.id as parent_id,
a.root_id as root_id
from TMP_RecordsToGrantAccess a
inner join R_Request r on r.c_bpartner_id = a.record_id
where a.ad_table_id = 291 -- C_BPartner
;
GET DIAGNOSTICS v_count = ROW_COUNT;
raise notice 'Considered % R_Request(s)', v_count;
--
-- Users
-- grant access of the users linked to the partners
insert
into TMP_RecordsToGrantAccess(ad_table_id, record_id, ad_user_id, access, comments, id, parent_id, root_id)
select 114 as AD_Table_ID,
u.AD_User_ID as record_id,
a.ad_user_id as ad_user_id,
a.access as access,
'' as comments,
nextval('ad_user_record_access_seq') as id,
a.id as parent_id,
a.root_id as root_id
from TMP_RecordsToGrantAccess a
inner join AD_User u on u.c_bpartner_id = a.record_id;
GET DIAGNOSTICS v_count = ROW_COUNT;
raise notice 'Considered % AD_User(s)', v_count;
--
-- Check TMP_RecordsToGrantAccess
-- select * from TMP_RecordsToGrantAccess;
--
--
-- Update ad_user_record_access
--
--
-- remove existing access rules
delete from ad_user_record_access where PermissionIssuer = 'AUTO_BP_HIERARCHY';
GET DIAGNOSTICS v_count = ROW_COUNT;
raise notice 'Removed % previous AD_User_Record_Access records', v_count;
--
--
INSERT INTO ad_user_record_access ( --
ad_table_id, --
record_id, --
--
access, --
--
-- ad_usergroup_id, --
ad_user_id, --
PermissionIssuer,
--
-- validfrom, validto --
ad_client_id, --
ad_org_id, --
isactive,
created, createdby, updated, updatedby,
--
ad_user_record_access_id, parent_id, root_id)
select a.ad_table_id as ad_table_id,
a.record_id as record_id,
a.access as access,
a.ad_user_id as ad_user_id,
'AUTO_BP_HIERARCHY' as permissionissuer,
--
1000000 as ad_client_id,
0 as AD_Org_ID,
'Y' as IsActive,
now() as created,
99 as createdby,
now() as updatedby,
99 as updated,
--
a.id as ad_user_record_access_id,
a.parent_id as parent_id,
a.root_id as root_id
from TMP_RecordsToGrantAccess a;
GET DIAGNOSTICS v_count = ROW_COUNT;
raise notice 'Inserted % AD_User_Record_Access records', v_count;
end;
$$;
-- alter function ad_user_record_access_updatefrom_bpartnerhierarchy() owner to metasfresh;
-- Test
/*
select ad_user_record_access_updatefrom_bpartnerhierarchy();
*/ | the_stack |
USE [{DatabaseWhereOQSIsRunning}]
GO
SET ANSI_NULLS ON;
GO
SET QUOTED_IDENTIFIER ON;
GO
SET NOCOUNT ON;
GO
-- Create the OQS Schema
IF NOT EXISTS ( SELECT * FROM [sys].[schemas] AS [S] WHERE [S].[name] = 'oqs' )
BEGIN
EXEC ( 'CREATE SCHEMA oqs' );
END;
GO
CREATE TABLE [oqs].[collection_metadata]
(
[command] nvarchar (2000) NOT NULL, -- The command that should be executed by Service Broker
[collection_interval] bigint NOT NULL, -- The interval for looped processing (in seconds)
[oqs_mode] varchar (11) NOT NULL, -- The mode that OQS should run in. May only be "classic" or "centralized"
[oqs_classic_db] nvarchar (128) NOT NULL, -- The database where OQS resides in classic mode (must be filled when classic mode is chosen, ignored by centralized mode)
[collection_active] bit NOT NULL, -- Should OQS be collecting data or not
[execution_threshold] tinyint NOT NULL, -- The minimum executions of a query plan before we consider it for capture in OQS
[oqs_maximum_size_mb] smallint NOT NULL, -- The maximum size in MB that OQS data store should be (actual size can be slightly larger, but this is the "high water mark" to control data collection)
[data_cleanup_active] bit NOT NULL, -- Should OQS automatically clean up old data
[data_cleanup_threshold] tinyint NOT NULL, -- How many days should OQS keep data for (automated cleanup removes data older than this)
[data_cleanup_throttle] smallint NOT NULL, -- How many rows can be deleted in one pass. This avoids large deletions from trashing the transaction log and blocking OQS tables.
);
GO
-- We want to have defaults and checks for certain settings
ALTER TABLE [oqs].[collection_metadata]
ADD CONSTRAINT [chk_oqs_mode] CHECK ( [oqs_mode] IN ( N'classic', N'centralized' )),
CONSTRAINT [df_collection_interval] DEFAULT ( 60 ) FOR [collection_interval],
CONSTRAINT [df_collection_active] DEFAULT ( 0 ) FOR [collection_active],
CONSTRAINT [df_execution_threshold] DEFAULT ( 2 ) FOR [execution_threshold],
CONSTRAINT [df_oqs_maximum_size_mb] DEFAULT ( 100 ) FOR [oqs_maximum_size_mb],
CONSTRAINT [df_cleanup_active] DEFAULT ( 0 ) FOR [data_cleanup_active],
CONSTRAINT [df_cleanup_threshold] DEFAULT ( 30 ) FOR [data_cleanup_threshold],
CONSTRAINT [df_cleanup_throttle] DEFAULT ( 5000 ) FOR [data_cleanup_throttle];
-- Semi-hidden way of documenting the version of OQS that is installed. The value will be automatically bumped upon a new version build/release
EXEC sys.sp_addextendedproperty @name=N'oqs_version', @value=N'2.3.0' , @level0type=N'SCHEMA',@level0name=N'oqs', @level1type=N'TABLE',@level1name=N'collection_metadata'
GO
-- Default values for initial installation = Logging turned on, run every 60 seconds, collection deactivated, execution_threshold = 2 to skip single-use plans
INSERT INTO [oqs].[collection_metadata] ( [command],
[collection_interval],
[oqs_mode],
[oqs_classic_db],
[collection_active],
[execution_threshold],
[oqs_maximum_size_mb],
[data_cleanup_active],
[data_cleanup_threshold],
[data_cleanup_throttle]
)
VALUES ( N'EXEC [oqs].[gather_statistics] @logmode=1', DEFAULT , '{OQSMode}','{DatabaseWhereOQSIsRunning}',DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT);
GO
CREATE TABLE [oqs].[activity_log]
(
[log_id] [int] IDENTITY (1, 1) NOT NULL,
[log_run_id] [int] NULL,
[log_timestamp] [datetime] NULL,
[log_message] [varchar] (250) NULL,
CONSTRAINT [pk_log_id]
PRIMARY KEY CLUSTERED ( [log_id] ASC )
) ON [PRIMARY];
GO
CREATE TABLE [oqs].[monitored_databases]
(
[database_name] [nvarchar] (128) NOT NULL,
CONSTRAINT [pk_monitored_databases]
PRIMARY KEY CLUSTERED ( [database_name] ASC )
) ON [PRIMARY];
GO
CREATE TABLE [oqs].[intervals]
(
[interval_id] [int] IDENTITY (1, 1) NOT NULL,
[interval_start] [datetime] NULL,
[interval_end] [datetime] NULL,
CONSTRAINT [pk_intervals]
PRIMARY KEY CLUSTERED ( [interval_id] ASC )
) ON [PRIMARY];
GO
CREATE TABLE [oqs].[plan_dbid]
(
[plan_handle] [varbinary] (64) NOT NULL,
[dbid] [int] NOT NULL,
CONSTRAINT [pk_plan_dbid]
PRIMARY KEY CLUSTERED ( [plan_handle] ASC, [dbid] ASC )
) ON [PRIMARY];
GO
CREATE TABLE [oqs].[plans]
(
[plan_id] [int] IDENTITY (1, 1) NOT NULL,
[plan_MD5] [varbinary] (32) NOT NULL,
[plan_handle] [varbinary] (64) NULL,
[plan_firstfound] [datetime] NULL,
[plan_database] [nvarchar] (150) NULL,
[plan_refcounts] [int] NULL,
[plan_usecounts] [int] NULL,
[plan_sizeinbytes] [int] NULL,
[plan_type] [nvarchar] (50) NULL,
[plan_objecttype] [nvarchar] (20) NULL,
[plan_executionplan] [xml] NULL,
[plan_optimization] [varchar] (10) NULL,
[xml_processed] [int] NULL
CONSTRAINT [pk_plans]
PRIMARY KEY CLUSTERED ( [plan_id] ASC )
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY];
GO
ALTER TABLE [oqs].[plans] ADD CONSTRAINT [DF_plans_xml_processed] DEFAULT ((0)) FOR [xml_processed]
GO
CREATE TABLE [oqs].[queries]
(
[query_id] [int] IDENTITY (1, 1) NOT NULL,
[plan_id] [int] NOT NULL,
[query_hash] [binary] (8) NULL,
[query_plan_MD5] [varbinary] (72) NULL,
[query_statement_text] [nvarchar] (MAX) NULL,
[query_statement_start_offset] [int] NULL,
[query_statement_end_offset] [int] NULL,
[query_creation_time] [datetime] NULL,
CONSTRAINT [pk_queries]
PRIMARY KEY CLUSTERED ( [query_id] ASC )
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY];
GO
CREATE UNIQUE NONCLUSTERED INDEX uncl_queries_cleanup ON [oqs].[queries] ([query_id],[plan_id]);
GO
CREATE TABLE [oqs].[excluded_queries]
(
[query_id] int NOT NULL,
CONSTRAINT [pk_excluded_queries_query_id]
PRIMARY KEY CLUSTERED ( [query_id] ASC )
)
GO
CREATE TABLE [oqs].[query_runtime_stats]
(
[query_id] [int] NOT NULL,
[interval_id] [int] NOT NULL,
[creation_time] [datetime] NOT NULL,
[last_execution_time] [datetime] NOT NULL,
[execution_count] [bigint] NOT NULL,
[total_elapsed_time] [bigint] NOT NULL,
[last_elapsed_time] [bigint] NOT NULL,
[min_elapsed_time] [bigint] NOT NULL,
[max_elapsed_time] [bigint] NOT NULL,
[avg_elapsed_time] [bigint] NOT NULL,
[total_rows] [bigint] NOT NULL,
[last_rows] [bigint] NOT NULL,
[min_rows] [bigint] NOT NULL,
[max_rows] [bigint] NOT NULL,
[avg_rows] [bigint] NOT NULL,
[total_worker_time] [bigint] NOT NULL,
[last_worker_time] [bigint] NOT NULL,
[min_worker_time] [bigint] NOT NULL,
[max_worker_time] [bigint] NOT NULL,
[avg_worker_time] [bigint] NOT NULL,
[total_physical_reads] [bigint] NOT NULL,
[last_physical_reads] [bigint] NOT NULL,
[min_physical_reads] [bigint] NOT NULL,
[max_physical_reads] [bigint] NOT NULL,
[avg_physical_reads] [bigint] NOT NULL,
[total_logical_reads] [bigint] NOT NULL,
[last_logical_reads] [bigint] NOT NULL,
[min_logical_reads] [bigint] NOT NULL,
[max_logical_reads] [bigint] NOT NULL,
[avg_logical_reads] [bigint] NOT NULL,
[total_logical_writes] [bigint] NOT NULL,
[last_logical_writes] [bigint] NOT NULL,
[min_logical_writes] [bigint] NOT NULL,
[max_logical_writes] [bigint] NOT NULL,
[avg_logical_writes] [bigint] NOT NULL,
CONSTRAINT [pk_query_runtime_stats]
PRIMARY KEY CLUSTERED ( [query_id] ASC, [interval_id] ASC )
) ON [PRIMARY];
GO
CREATE UNIQUE NONCLUSTERED INDEX uncl_query_runtime_stats_cleanup ON [oqs].[query_runtime_stats] ([query_id],[interval_id]) INCLUDE ([last_execution_time]);
GO
CREATE TABLE [oqs].[wait_stats]
(
[interval_id] [int] NOT NULL,
[wait_type] [nvarchar] (60) NOT NULL,
[waiting_tasks_count] [bigint] NOT NULL,
[wait_time_ms] [bigint] NOT NULL,
[max_wait_time_ms] [bigint] NOT NULL,
[signal_wait_time_ms] [bigint] NOT NULL,
CONSTRAINT [pk_wait_stats]
PRIMARY KEY CLUSTERED ( [interval_id] ASC, [wait_type] ASC )
) ON [PRIMARY];
GO
CREATE TABLE [oqs].[wait_type_filter]
(
[wait_type] nvarchar (60) NOT NULL,
[oqs_default] bit NOT NULL
CONSTRAINT [df_wait_type_filter_oqs_default]
DEFAULT ( 0 ),
CONSTRAINT [pk_wait_type_filter]
PRIMARY KEY CLUSTERED ( [wait_type] )
) ON [PRIMARY];
GO
-- Populate the wait_type_filter table with predefined "benign" waits as defined by Paul Randal (https://www.sqlskills.com/blogs/paul/wait-statistics-or-please-tell-me-where-it-hurts/)
INSERT INTO [oqs].[wait_type_filter] ( [wait_type],
[oqs_default]
)
SELECT N'BROKER_EVENTHANDLER', 1
UNION ALL
SELECT N'BROKER_RECEIVE_WAITFOR', 1
UNION ALL
SELECT N'BROKER_TASK_STOP', 1
UNION ALL
SELECT N'BROKER_TO_FLUSH', 1
UNION ALL
SELECT N'BROKER_TRANSMITTER', 1
UNION ALL
SELECT N'CHECKPOINT_QUEUE', 1
UNION ALL
SELECT N'CHKPT', 1
UNION ALL
SELECT N'CLR_AUTO_EVENT', 1
UNION ALL
SELECT N'CLR_MANUAL_EVENT', 1
UNION ALL
SELECT N'CLR_SEMAPHORE', 1
UNION ALL
SELECT N'DBMIRROR_DBM_EVENT', 1
UNION ALL
SELECT N'DBMIRROR_EVENTS_QUEUE', 1
UNION ALL
SELECT N'DBMIRROR_WORKER_QUEUE', 1
UNION ALL
SELECT N'DBMIRRORING_CMD', 1
UNION ALL
SELECT N'DIRTY_PAGE_POLL', 1
UNION ALL
SELECT N'DISPATCHER_QUEUE_SEMAPHORE', 1
UNION ALL
SELECT N'EXECSYNC', 1
UNION ALL
SELECT N'FSAGENT', 1
UNION ALL
SELECT N'FT_IFTS_SCHEDULER_IDLE_WAIT', 1
UNION ALL
SELECT N'FT_IFTSHC_MUTEX', 1
UNION ALL
SELECT N'HADR_CLUSAPI_CALL', 1
UNION ALL
SELECT N'HADR_FILESTREAM_IOMGR_IOCOMPLETION', 1
UNION ALL
SELECT N'HADR_LOGCAPTURE_WAIT', 1
UNION ALL
SELECT N'HADR_NOTIFICATION_DEQUEUE', 1
UNION ALL
SELECT N'HADR_TIMER_TASK', 1
UNION ALL
SELECT N'HADR_WORK_QUEUE', 1
UNION ALL
SELECT N'KSOURCE_WAKEUP', 1
UNION ALL
SELECT N'LAZYWRITER_SLEEP', 1
UNION ALL
SELECT N'LOGMGR_QUEUE', 1
UNION ALL
SELECT N'MEMORY_ALLOCATION_EXT', 1
UNION ALL
SELECT N'ONDEMAND_TASK_QUEUE', 1
UNION ALL
SELECT N'PREEMPTIVE_XE_GETTARGETSTATE', 1
UNION ALL
SELECT N'PWAIT_ALL_COMPONENTS_INITIALIZED', 1
UNION ALL
SELECT N'PWAIT_DIRECTLOGCONSUMER_GETNEXT', 1
UNION ALL
SELECT N'QDS_PERSIST_TASK_MAIN_LOOP_SLEEP', 1
UNION ALL
SELECT N'QDS_ASYNC_QUEUE', 1
UNION ALL
SELECT N'QDS_CLEANUP_STALE_QUERIES_TASK_MAIN_LOOP_SLEEP', 1
UNION ALL
SELECT N'QDS_SHUTDOWN_QUEUE', 1
UNION ALL
SELECT N'REDO_THREAD_PENDING_WORK', 1
UNION ALL
SELECT N'REQUEST_FOR_DEADLOCK_SEARCH', 1
UNION ALL
SELECT N'RESOURCE_QUEUE', 1
UNION ALL
SELECT N'SERVER_IDLE_CHECK', 1
UNION ALL
SELECT N'SLEEP_BPOOL_FLUSH', 1
UNION ALL
SELECT N'SLEEP_DBSTARTUP', 1
UNION ALL
SELECT N'SLEEP_DCOMSTARTUP', 1
UNION ALL
SELECT N'SLEEP_MASTERDBREADY', 1
UNION ALL
SELECT N'SLEEP_MASTERMDREADY', 1
UNION ALL
SELECT N'SLEEP_MASTERUPGRADED', 1
UNION ALL
SELECT N'SLEEP_MSDBSTARTUP', 1
UNION ALL
SELECT N'SLEEP_SYSTEMTASK', 1
UNION ALL
SELECT N'SLEEP_TASK', 1
UNION ALL
SELECT N'SLEEP_TEMPDBSTARTUP', 1
UNION ALL
SELECT N'SNI_HTTP_ACCEPT', 1
UNION ALL
SELECT N'SP_SERVER_DIAGNOSTICS_SLEEP', 1
UNION ALL
SELECT N'SQLTRACE_BUFFER_FLUSH', 1
UNION ALL
SELECT N'SQLTRACE_INCREMENTAL_FLUSH_SLEEP', 1
UNION ALL
SELECT N'SQLTRACE_WAIT_ENTRIES', 1
UNION ALL
SELECT N'WAIT_FOR_RESULTS', 1
UNION ALL
SELECT N'WAITFOR', 1
UNION ALL
SELECT N'WAITFOR_TASKSHUTDOWN', 1
UNION ALL
SELECT N'WAIT_XTP_RECOVERY', 1
UNION ALL
SELECT N'WAIT_XTP_HOST_WAIT', 1
UNION ALL
SELECT N'WAIT_XTP_OFFLINE_CKPT_NEW_LOG', 1
UNION ALL
SELECT N'WAIT_XTP_CKPT_CLOSE', 1
UNION ALL
SELECT N'XE_DISPATCHER_JOIN', 1
UNION ALL
SELECT N'XE_DISPATCHER_WAIT', 1
UNION ALL
SELECT N'XE_TIMER_EVENT', 1
GO
-- Create the OQS query_stats view as a version specific abstraction of sys.dm_exec_query_stats
DECLARE @MajorVersion tinyint,
@MinorVersion tinyint,
@BuildVersion int,
@Version nvarchar (128),
@ViewDefinition nvarchar (MAX);
SELECT @Version = CAST(SERVERPROPERTY( 'ProductVersion' ) AS nvarchar);
SELECT @MajorVersion = PARSENAME( CONVERT( varchar (32), @Version ), 4 ),
@MinorVersion = PARSENAME( CONVERT( varchar (32), @Version ), 3 ),
@BuildVersion = PARSENAME( CONVERT( varchar (32), @Version ), 2 );
SET @ViewDefinition = 'CREATE VIEW [oqs].[query_stats]
AS
SELECT [sql_handle],
[statement_start_offset],
[statement_end_offset],
[plan_generation_num],
[plan_handle],
[creation_time],
[last_execution_time],
[execution_count],
[total_worker_time],
[last_worker_time],
[min_worker_time],
[max_worker_time],
[total_physical_reads],
[last_physical_reads],
[min_physical_reads],
[max_physical_reads],
[total_logical_writes],
[last_logical_writes],
[min_logical_writes],
[max_logical_writes],
[total_logical_reads],
[last_logical_reads],
[min_logical_reads],
[max_logical_reads],
[total_clr_time],
[last_clr_time],
[min_clr_time],
[max_clr_time],
[total_elapsed_time],
[last_elapsed_time],
[min_elapsed_time],
[max_elapsed_time],' +
CASE WHEN @MajorVersion = 9 THEN 'CAST(NULL as binary (8)) ' ELSE '' END + '[query_hash],' + -- query_hash appears in sql 2008
CASE WHEN @MajorVersion = 9 THEN 'CAST(NULL as binary (8)) ' ELSE '' END + '[query_plan_hash],' + -- query_plan_hash appears in sql 2008
CASE WHEN @MajorVersion = 9 OR ( @MajorVersion = 10 AND @MinorVersion < 50) OR ( @MajorVersion = 10 AND @MinorVersion = 50 AND @BuildVersion < 2500 ) THEN 'CAST(0 as bigint) ' ELSE '' END + '[total_rows],' + -- total_rows appears in sql 2008r2 SP1
CASE WHEN @MajorVersion = 9 OR ( @MajorVersion = 10 AND @MinorVersion < 50) OR ( @MajorVersion = 10 AND @MinorVersion = 50 AND @BuildVersion < 2500 ) THEN 'CAST(0 as bigint) ' ELSE '' END + '[last_rows],' + -- last_rows appears in sql 2008r2 SP1
CASE WHEN @MajorVersion = 9 OR ( @MajorVersion = 10 AND @MinorVersion < 50) OR ( @MajorVersion = 10 AND @MinorVersion = 50 AND @BuildVersion < 2500 ) THEN 'CAST(0 as bigint) ' ELSE '' END + '[min_rows],' + -- min_rows appears in sql 2008r2 SP1
CASE WHEN @MajorVersion = 9 OR ( @MajorVersion = 10 AND @MinorVersion < 50) OR ( @MajorVersion = 10 AND @MinorVersion = 50 AND @BuildVersion < 2500 ) THEN 'CAST(0 as bigint) ' ELSE '' END + '[max_rows],' + -- max_rows appears in sql 2008r2 SP1
CASE WHEN @MajorVersion < 12 THEN 'CAST(NULL as varbinary (64)) ' ELSE '' END + '[statement_sql_handle],' + -- statement_sql_handle appears in sql 2014
CASE WHEN @MajorVersion < 12 THEN 'CAST(NULL as bigint) ' ELSE '' END + '[statement_context_id],' + -- statement_context_id appears in sql 2014
CASE WHEN @MajorVersion < 13 THEN 'CAST(0 as bigint) ' ELSE '' END + '[total_dop],' + -- total_dop appears in sql 2016
CASE WHEN @MajorVersion < 13 THEN 'CAST(0 as bigint) ' ELSE '' END + '[last_dop],' + -- last_dop appears in sql 2016
CASE WHEN @MajorVersion < 13 THEN 'CAST(0 as bigint) ' ELSE '' END + '[min_dop],' + -- min_dop appears in sql 2016
CASE WHEN @MajorVersion < 13 THEN 'CAST(0 as bigint) ' ELSE '' END + '[max_dop],' + -- max_dop appears in sql 2016
CASE WHEN @MajorVersion < 13 THEN 'CAST(0 as bigint) ' ELSE '' END + '[total_grant_kb],' + -- total_grant_kb appears in sql 2016
CASE WHEN @MajorVersion < 13 THEN 'CAST(0 as bigint) ' ELSE '' END + '[last_grant_kb],' + -- last_grant_kb appears in sql 2016
CASE WHEN @MajorVersion < 13 THEN 'CAST(0 as bigint) ' ELSE '' END + '[min_grant_kb],' + -- min_grant_kb appears in sql 2016
CASE WHEN @MajorVersion < 13 THEN 'CAST(0 as bigint) ' ELSE '' END + '[max_grant_kb],' + -- max_grant_kb appears in sql 2016
CASE WHEN @MajorVersion < 13 THEN 'CAST(0 as bigint) ' ELSE '' END + '[total_used_grant_kb],' + -- total_used_grant_kb appears in sql 2016
CASE WHEN @MajorVersion < 13 THEN 'CAST(0 as bigint) ' ELSE '' END + '[last_used_grant_kb],' + -- last_used_grant_kb appears in sql 2016
CASE WHEN @MajorVersion < 13 THEN 'CAST(0 as bigint) ' ELSE '' END + '[min_used_grant_kb],' + -- min_rows appears in sql 2016
CASE WHEN @MajorVersion < 13 THEN 'CAST(0 as bigint) ' ELSE '' END + '[max_used_grant_kb],' + -- max_used_grant_kb appears in sql 2016
CASE WHEN @MajorVersion < 13 THEN 'CAST(0 as bigint) ' ELSE '' END + '[total_ideal_grant_kb],' + -- total_ideal_grant_kb appears in sql 2016
CASE WHEN @MajorVersion < 13 THEN 'CAST(0 as bigint) ' ELSE '' END + '[last_ideal_grant_kb],' + -- last_ideal_grant_kb appears in sql 2016
CASE WHEN @MajorVersion < 13 THEN 'CAST(0 as bigint) ' ELSE '' END + '[min_ideal_grant_kb],' + -- min_ideal_grant_kb appears in sql 2016
CASE WHEN @MajorVersion < 13 THEN 'CAST(0 as bigint) ' ELSE '' END + '[max_ideal_grant_kb],' + -- max_ideal_grant_kb appears in sql 2016
CASE WHEN @MajorVersion < 13 THEN 'CAST(0 as bigint) ' ELSE '' END + '[total_reserved_threads],' + -- total_reserved_threads appears in sql 2016
CASE WHEN @MajorVersion < 13 THEN 'CAST(0 as bigint) ' ELSE '' END + '[last_reserved_threads],' + -- last_reserved_threads appears in sql 2016
CASE WHEN @MajorVersion < 13 THEN 'CAST(0 as bigint) ' ELSE '' END + '[min_reserved_threads],' + -- min_reserved_threads appears in sql 2016
CASE WHEN @MajorVersion < 13 THEN 'CAST(0 as bigint) ' ELSE '' END + '[max_reserved_threads],' + -- max_reserved_threads appears in sql 2016
CASE WHEN @MajorVersion < 13 THEN 'CAST(0 as bigint) ' ELSE '' END + '[total_used_threads],' + -- total_used_threads appears in sql 2016
CASE WHEN @MajorVersion < 13 THEN 'CAST(0 as bigint) ' ELSE '' END + '[last_used_threads],' + -- last_used_threads appears in sql 2016
CASE WHEN @MajorVersion < 13 THEN 'CAST(0 as bigint) ' ELSE '' END + '[min_used_threads],' + -- min_used_threads appears in sql 2016
CASE WHEN @MajorVersion < 13 THEN 'CAST(0 as bigint) ' ELSE '' END + '[max_used_threads]' + -- max_used_threads appears in sql 2016
' FROM [sys].[dm_exec_query_stats];';
EXEC ( @ViewDefinition );
GO
-- Create the OQS Purge OQS Stored Procedure
CREATE PROCEDURE [oqs].[purge_oqs]
AS
BEGIN
SET NOCOUNT ON
TRUNCATE TABLE [oqs].[activity_log];
TRUNCATE TABLE [oqs].[intervals];
TRUNCATE TABLE [oqs].[plan_dbid];
TRUNCATE TABLE [oqs].[plans];
TRUNCATE TABLE [oqs].[queries];
TRUNCATE TABLE [oqs].[query_runtime_stats];
TRUNCATE TABLE [oqs].[wait_stats];
TRUNCATE TABLE [oqs].[excluded_queries];
END
GO
CREATE PROCEDURE oqs.exclude_query_from_dashboard @query_id int
AS
BEGIN
INSERT INTO [oqs].[excluded_queries] ( [query_id] )
VALUES ( @query_id )
END
GO
CREATE PROCEDURE [oqs].[data_cleanup]
@data_cleanup_threshold smallint,
@data_cleanup_throttle smallint
AS
BEGIN
SELECT @data_cleanup_threshold = [CM].[data_cleanup_threshold],
@data_cleanup_throttle = [CM].[data_cleanup_throttle]
FROM [oqs].[collection_metadata] AS [CM];
DELETE TOP ( @data_cleanup_throttle )
FROM [oqs].[activity_log]
WHERE [log_timestamp] < DATEADD( DAY, -@data_cleanup_threshold, GETDATE());
-- We're going to collect query_ids to allow for a controlled deletion in this purge step
-- There are multiple tables to be cleaned up, so we store the deletion candidates in a temp table
IF OBJECT_ID( 'tempdb..#query_id_deletion_candidates' ) IS NOT NULL
DROP TABLE [#query_id_deletion_candidates];
CREATE TABLE [#query_id_deletion_candidates]
(
[query_id] int NOT NULL,
[plan_id] int NOT NULL,
PRIMARY KEY CLUSTERED ( [query_id], [plan_id] )
);
WITH [deletion_candidates] ( [query_id], [last_execution_date] )
AS ( SELECT [QRS].[query_id],
MAX( [QRS].[last_execution_time] ) AS [last_execution_time]
FROM [oqs].[query_runtime_stats] AS [QRS]
GROUP BY [QRS].[query_id]
)
INSERT INTO [#query_id_deletion_candidates] ( [query_id],
[plan_id]
)
SELECT [Q].[query_id],
[Q].[plan_id]
FROM [deletion_candidates] AS [DC]
INNER JOIN [oqs].[queries] AS [Q] ON [Q].[query_id] = [DC].[query_id]
WHERE [DC].[last_execution_date] < DATEADD( DAY, -@data_cleanup_threshold, GETDATE());
;
DELETE TOP ( @data_cleanup_throttle )
[QRS]
FROM [#query_id_deletion_candidates] AS [QIDC]
INNER JOIN [oqs].[query_runtime_stats] AS [QRS] ON [QRS].[query_id] = [QIDC].[query_id];
DELETE TOP ( @data_cleanup_throttle )
[Q]
FROM [#query_id_deletion_candidates] AS [QIDC]
INNER JOIN [oqs].[queries] AS [Q] ON [Q].[plan_id] = [QIDC].[plan_id]
AND [Q].[query_id] = [QIDC].[query_id];
DELETE TOP ( @data_cleanup_throttle )
[P]
FROM [#query_id_deletion_candidates] AS [QIDC]
INNER JOIN [oqs].[plans] AS [P] ON [P].[plan_id] = [QIDC].[plan_id]
WHERE NOT EXISTS ( SELECT * FROM [oqs].[queries] AS [Q] WHERE [P].[plan_id] = [Q].[plan_id] );
DECLARE @interval_id int;
-- For wait_stats we identify deletion candidates by getting the youngest interval within the deletion threshold
SELECT @interval_id = MAX( [I].[interval_id] )
FROM [oqs].[intervals] AS [I]
WHERE [I].[interval_end] < DATEADD( DAY, -@data_cleanup_threshold, GETDATE());
DELETE TOP ( @data_cleanup_throttle )
FROM [oqs].[wait_stats]
WHERE [interval_id] <= @interval_id;
END;
GO
CREATE VIEW oqs.object_catalog
AS
SELECT o.[name] AS [object_name],
o.[object_id] AS [object_id],
o.[type] AS [object_type],
ps.row_count,
( ps.reserved_page_count * 8 ) AS [space_used_kb]
FROM sys.objects o
INNER JOIN sys.schemas s
ON o.[schema_id] = s.[schema_id]
LEFT JOIN sys.dm_db_partition_stats ps ON ps.object_id = o.object_id AND ps.index_id IN (0,1)
WHERE s.[name] = 'oqs';
GO | the_stack |
--********************************************************************/
-- */
-- IBM InfoSphere Replication Server */
-- Version 10 (DB2 V10) for Linux, UNIX AND Windows */
-- */
-- Sample SQL Replication migration script for UNIX AND NT */
-- Licensed Materials - Property of IBM */
-- */
-- (C) Copyright IBM Corp. 2011. All Rights Reserved */
-- */
-- US Government Users Restricted Rights - Use, duplication */
-- or disclosure restricted by GSA ADP Schedule Contract */
-- with IBM Corp. */
-- */
--********************************************************************/
-- Script to migrate SQL Capture control tables from V97 to V10.
--
-- IMPORTANT:
-- * Please refer to the SQL Rep migration doc before attempting this migration.
-- * DB2 V10 has many internal changes and requires a cold start of SQL Capture.
-- There are steps that can be performed to work around a full refresh by SQL Apply.
--
-- Most of the V10 migration is related to increase in the DB2 LSN length
-- from 10 bytes to 16 bytes. Consequently all of the replication synchpoints and
-- LSN columns need to change from CHAR(10) for bit data to VARCHAR(16) for bit data.
--
-- BEFORE UPGRADING to DB2 V10 and SQL Capture program V10:
-- * Ensure that Capture has caught up to the end of the log and that no further
-- DML is run after Capture has been stopped.
--
-- AFTER UPGRADING V10, you are ready to start SQL Capture migration.
--
-- You will do this migration in two parts.
--
-- PART 1:
-- * Migrate the Capture control tables. This includes: alter all the LSN and
-- synchpoint columns to VARCHAR(16) for bit data, add some new columns, and add new tables.
-- * Run Part 1A and Part 1B below.
-- * At this point, Capture will continue to populate LSN and synchpoint columns with
-- 10 byte length values. The new COMPATIBILITY column in IBMSNAP_CAPPARMS is set to '0801'.
--
-- If full refresh of all subscription members is acceptable, then perform the following
-- to start up SQL Replication:
-- * Before any DML occurs, start Capture with STARTMODE=COLD
-- This will deactivate all registrations.
-- * Start SQL Apply. Apply will detect the inactive registrations, insert CAPSTART signals,
-- and perform full refresh.
--
-- If full refresh is not desired, then perform the following
-- to start up SQL Replication and bypass full refresh.
-- * Before starting SQL Capture, go to the SQL Apply control server and
-- change the LOADX_TYPE value of affected subsscription members.
-- * Since Apply control tables can be shared by multiple Apply programs that may be running
-- with different Captures, you need to be selective on which rows in
-- ASN.IBMSNAP_SUBS_MEMBR are updated. To determine this, first run the following
-- select statement:
-- SELECT APPLY_QUAL, SET_NAME, WHOS_ON_FIRST FROM ASN.IBMSNAP_SUBS_SET
-- WHERE SOURCE_SERVER="dbname" AND CAPTURE_SCHEMA="capschema";
-- set dbname to the Capture server that is being migrated to V10
-- set capchema to the Capture schema that is being migrated to V10
-- * Based on above results, run the following update statement:
-- UPDATE ASN.IBMSNAP_SUBS_MEMBR SET LOADX_TYPE=6
-- WHERE APPLY_QUAL=? AND SET_NAME=? AND WHOS_ON_FIRST=?;
-- * Before any DML occurs, start Capture with STARTMODE=COLD
-- This will deactivate all registrations.
-- * Start SQL Apply with LOADXIT=Y option.
-- Apply will detect the inactive registrations, insert CAPSTART signals,
-- and, because LOADX_TYPE=6, no full refresh will be performed.
-- * Notes:
-- - The warning message ASN1051W (The Apply program detected a gap) will be
-- issued by SQL Apply and this can be ignored. LOADX_TYPE=6 setting will
-- resolve the warning.
-- - If needed, set the LOADX_TYPE back to the original value after the
-- subscriptions are successfully activated.
-- - You are not required to start SQL Apply with LOADXIT=Y after migration.
-- - The above steps for SQL Apply are to be run for any level of SQL Apply,
-- whether it is being migrated or not.
--
-- If you are running any pre-V10 Applys, DO NOT RUN PART 2 YET.
--
-- PART 2:
-- * This part for the Capture server is run only when you are ready to
-- also run V10 Apply migration's Part 2 on the all related Apply control servers.
-- This part completes the move to 16 byte values.
-- * Here you run sql to concatenate x'0's to LSN and synchpoint columns
-- and update COMPATIBILITY to '1001'.
-- * Run Part 2A and Part 2B below.
--
--********************************************************************/
--
-- Prior to running this script, customize it to your existing
-- SQL Capture server environment:
-- (1) Locate and change all occurrences of the string !capschema!
-- to the name of the SQL Capture schema applicable to your
-- environment.
-- (2) Locate and change all occurrences of the string !captablespace!
-- to the name of the tablespace where your SQL Capture control tables
-- are created.
-- (3) Run the script to migrate control tables into V10 and complete
-- Part 1 of the Capture migration.
--
--***********************************************************
-- Migrate SQL Capture to V10 Part 1A
--***********************************************************
ALTER TABLE !capschema!.IBMSNAP_CAPPARMS
ADD COLUMN COMPATIBILITY CHAR(4) NOT NULL WITH DEFAULT '1001';
ALTER TABLE !capschema!.IBMSNAP_CAPPARMS
ADD COLUMN LOGRDBUFSZ INTEGER NOT NULL WITH DEFAULT 256;
UPDATE !capschema!.IBMSNAP_CAPPARMS SET ARCH_LEVEL = '1001';
UPDATE !capschema!.IBMSNAP_CAPPARMS SET COMPATIBILITY= '0801';
ALTER TABLE !capschema!.IBMSNAP_CAPMON ALTER COLUMN RESTART_SEQ SET DATA TYPE VARCHAR(16) FOR BIT DATA;
ALTER TABLE !capschema!.IBMSNAP_CAPMON ALTER COLUMN CURRENT_SEQ SET DATA TYPE VARCHAR(16) FOR BIT DATA;
REORG TABLE !capschema!.IBMSNAP_CAPMON;
ALTER TABLE !capschema!.IBMSNAP_PRUNCNTL ALTER COLUMN SYNCHPOINT SET DATA TYPE VARCHAR(16) FOR BIT DATA;
REORG TABLE !capschema!.IBMSNAP_PRUNCNTL;
ALTER TABLE !capschema!.IBMSNAP_PRUNE_SET ALTER COLUMN SYNCHPOINT SET DATA TYPE VARCHAR(16) FOR BIT DATA;
REORG TABLE !capschema!.IBMSNAP_PRUNE_SET;
ALTER TABLE !capschema!.IBMSNAP_REGISTER ALTER COLUMN CD_OLD_SYNCHPOINT SET DATA TYPE VARCHAR(16) FOR BIT DATA;
ALTER TABLE !capschema!.IBMSNAP_REGISTER ALTER COLUMN CD_NEW_SYNCHPOINT SET DATA TYPE VARCHAR(16) FOR BIT DATA;
ALTER TABLE !capschema!.IBMSNAP_REGISTER ALTER COLUMN CCD_OLD_SYNCHPOINT SET DATA TYPE VARCHAR(16) FOR BIT DATA;
REORG TABLE !capschema!.IBMSNAP_REGISTER;
ALTER TABLE !capschema!.IBMSNAP_REGISTER ALTER COLUMN SYNCHPOINT SET DATA TYPE VARCHAR(16) FOR BIT DATA;
REORG TABLE !capschema!.IBMSNAP_REGISTER;
ALTER TABLE !capschema!.IBMSNAP_RESTART ALTER COLUMN MAX_COMMITSEQ SET DATA TYPE VARCHAR(16) FOR BIT DATA;
ALTER TABLE !capschema!.IBMSNAP_RESTART ALTER COLUMN MIN_INFLIGHTSEQ SET DATA TYPE VARCHAR(16) FOR BIT DATA;
ALTER TABLE !capschema!.IBMSNAP_RESTART ALTER COLUMN CAPTURE_FIRST_SEQ SET DATA TYPE VARCHAR(16) FOR BIT DATA;
REORG TABLE !capschema!.IBMSNAP_RESTART;
ALTER TABLE !capschema!.IBMSNAP_SIGNAL DATA CAPTURE NONE;
ALTER TABLE !capschema!.IBMSNAP_SIGNAL ALTER COLUMN SIGNAL_LSN SET DATA TYPE VARCHAR(16) FOR BIT DATA;
ALTER TABLE !capschema!.IBMSNAP_SIGNAL DATA CAPTURE CHANGES;
REORG TABLE !capschema!.IBMSNAP_SIGNAL;
ALTER TABLE !capschema!.IBMSNAP_UOW ALTER COLUMN IBMSNAP_COMMITSEQ SET DATA TYPE VARCHAR(16) FOR BIT DATA;
REORG TABLE !capschema!.IBMSNAP_UOW;
ALTER TABLE !capschema!.IBMQREP_IGNTRANTRC ALTER COLUMN COMMITLSN SET DATA TYPE VARCHAR(16) FOR BIT DATA;
REORG TABLE !capschema!.IBMQREP_IGNTRANTRC;
-- CAPMON:
ALTER TABLE !capschema!.IBMSNAP_CAPMON
ADD COLUMN RESTART_MAXCMTSEQ VARCHAR(16) FOR BIT DATA;
ALTER TABLE !capschema!.IBMSNAP_CAPMON
ADD COLUMN LOGREAD_API_TIME INTEGER;
ALTER TABLE !capschema!.IBMSNAP_CAPMON
ADD COLUMN NUM_LOGREAD_CALLS INTEGER;
------------------------------------------------------------------
-- New version tables
-- Tables names start with IBMQREP, not IBMSNAP as it is common
-- to both QRep and SQL Rep.
------------------------------------------------------------------
CREATE TABLE !capschema!.IBMQREP_COLVERSION
( LSN CHAR(16) FOR BIT DATA NOT NULL,
TABLEID1 SMALLINT NOT NULL,
TABLEID2 SMALLINT NOT NULL,
POSITION SMALLINT NOT NULL,
NAME VARCHAR(128) NOT NULL,
TYPE SMALLINT NOT NULL,
LENGTH INTEGER NOT NULL,
NULLS CHAR(1) NOT NULL,
DEFAULT VARCHAR(1536),
CODEPAGE INTEGER,
SCALE INTEGER
) IN !captablespace!;
CREATE UNIQUE INDEX !capschema!.IBMQREP_COLVERSIOX
ON !capschema!.IBMQREP_COLVERSION(
LSN, TABLEID1, TABLEID2, POSITION);
CREATE INDEX !capschema!.IBMQREP_COLVERSIOX1 ON
!capschema!.IBMQREP_COLVERSION
( TABLEID1 ASC, TABLEID2 ASC);
CREATE INDEX !capschema!.IBMQREP_PART_HISTIDX1 ON
!capschema!.IBMQREP_PART_HIST
( TABSCHEMA, TABNAME, LSN);
CREATE TABLE !capschema!.IBMQREP_TABVERSION
( LSN CHAR(16) FOR BIT DATA NOT NULL,
TABLEID1 SMALLINT NOT NULL,
TABLEID2 SMALLINT NOT NULL,
VERSION INTEGER NOT NULL,
SOURCE_OWNER VARCHAR(128) NOT NULL,
SOURCE_NAME VARCHAR(128) NOT NULL
) IN !captablespace!;
CREATE UNIQUE INDEX !capschema!.IBMQREP_TABVERSIOX
ON !capschema!.IBMQREP_TABVERSION(
LSN, TABLEID1, TABLEID2, VERSION);
CREATE INDEX !capschema!.IBMQREP_TABVERSIOX1 ON
!capschema!.IBMQREP_TABVERSION
( TABLEID1 ASC, TABLEID2 ASC);
CREATE INDEX !capschema!.IBMQREP_TABVERSIOX2 ON
!capschema!.IBMQREP_TABVERSION
( SOURCE_OWNER ASC, SOURCE_NAME ASC);
--***********************************************************
-- Migrate SQL Capture to V10 Part 1B
--***********************************************************
-- Uncomment this section and run sql to migrate the CD tables
--
-- To migrate the CD tables do one of the following (ONLY ONE a or b)
--
-- a.Run the following sql statement
--
-- select CD_OWNER, CD_TABLE from !capschema!.IBMSNAP_REGISTER
-- and for each CD table returned in this query run the following
-- sql statement to migrate the CD table
--
-- ALTER TABLE !CD_OWNER!.!CD_TABLE! ALTER COLUMN IBMSNAP_COMMITSEQ SET DATA TYPE VARCHAR(16) FOR BIT DATA;
-- ALTER TABLE !CD_OWNER!.!CD_TABLE! ALTER COLUMN IBMSNAP_INTENTSEQ SET DATA TYPE VARCHAR(16) FOR BIT DATA;
-- REORG TABLE !CD_OWNER!.!CD_TABLE!;
--
--
-- b. Run the following sql to auto generate the sql statements to migrate all the CD tables
-- select 'ALTER TABLE ' || CD_OWNER || '.' || CD_TABLE || ' ALTER COLUMN IBMSNAP_COMMITSEQ
-- SET DATA TYPE VARCHAR(16) FOR BIT DATA ALTER COLUMN IBMSNAP_INTENTSEQ SET DATA TYPE VARCHAR(16) FOR BIT DATA;'
-- || CHR(10) || 'REORG TABLE ' || CD_OWNER || '.' || CD_TABLE || ';' FROM
-- !capschema!.IBMSNAP_REGISTER WHERE SOURCE_STRUCTURE IN ('1','7');
--
-- Please note:
-- After migration Part 1A and Part 1B have been run, when you start the capture server
-- the first time, you need to start it with startmode=cold
-- Refer to overview of PART 1 for bypassing full refresh from SQL Apply.
--***********************************************************
-- Migrate SQL Capture to V10 Part 2A
--***********************************************************
--
-- Uncomment this section and run this section only after you have migrated
-- all of your Apply programs and the Apply control tables and are ready to migrate the
-- V10 completely.
--
-- To migrate the CD tables do one of the following (ONLY ONE a or b)
--
-- a.Run the following sql statement
--
-- select CD_OWNER, CD_TABLE from !capschema!.IBMSNAP_REGISTER
-- and for each CD table returned in this query run the following
-- sql statement to migrate the CD table
--
-- UPDATE !CD_OWNER!.!CD_TABLE! SET IBMSNAP_COMMITSEQ=CONCAT(x'000000000000', IBMSNAP_COMMITSEQ);
-- UPDATE !CD_OWNER!.!CD_TABLE! SET IBMSNAP_INTENTSEQ=CONCAT(x'000000000000', IBMSNAP_INTENTSEQ);
--
--
-- b. Run the following sql to auto generate the sql statements to migrate all the CD tables
-- select 'UPDATE ' || CD_OWNER || '.' ||
-- CD_TABLE || ' SET IBMSNAP_COMMITSEQ = CONCAT(x''000000000000'', IBMSNAP_COMMITSEQ);'|| CHR(10) || 'UPDATE ' ||
-- CD_OWNER || '.' || CD_TABLE || ' SET IBMSNAP_INTENTSEQ = CONCAT(x''000000000000'', IBMSNAP_INTENTSEQ);' FROM
-- !capschema!.IBMSNAP_REGISTER WHERE SOURCE_STRUCTURE IN ('1','7');
--
--***********************************************************
-- Migrate SQL Capture to V10 Part 2B
--***********************************************************
--
-- Even though the IBMSNAP_CAPMON, IBMSNAP_SIGNAL, IBMSNAP_IGNTRANTRC tables have only historical
-- data, we concat x'000000000000' so that select stmts with ORDER BY clause will return the rows in the
-- correct order.
--
-- UPDATE !capschema!.IBMSNAP_CAPMON SET RESTART_SEQ=CONCAT(x'000000000000', RESTART_SEQ);
-- UPDATE !capschema!.IBMSNAP_CAPMON SET CURRENT_SEQ=CONCAT(x'000000000000', CURRENT_SEQ);
-- UPDATE !capschema!.IBMSNAP_PRUNCNTL SET SYNCHPOINT=CONCAT(x'000000000000', SYNCHPOINT);
-- UPDATE !capschema!.IBMSNAP_PRUNE_SET SET SYNCHPOINT=CONCAT(x'000000000000', SYNCHPOINT);
-- UPDATE !capschema!.IBMSNAP_REGISTER SET CD_OLD_SYNCHPOINT=CONCAT(x'000000000000', CD_OLD_SYNCHPOINT);
-- UPDATE !capschema!.IBMSNAP_REGISTER SET CD_NEW_SYNCHPOINT=CONCAT(x'000000000000', CD_NEW_SYNCHPOINT);
-- UPDATE !capschema!.IBMSNAP_REGISTER SET CCD_OLD_SYNCHPOINT=CONCAT(x'000000000000', CCD_OLD_SYNCHPOINT);
-- UPDATE !capschema!.IBMSNAP_REGISTER SET SYNCHPOINT=CONCAT(x'000000000000', SYNCHPOINT);
-- UPDATE !capschema!.IBMSNAP_SIGNAL SET SIGNAL_LSN=CONCAT(x'000000000000', SIGNAL_LSN);
-- UPDATE !capschema!.IBMSNAP_UOW SET IBMSNAP_COMMITSEQ=CONCAT(x'000000000000', IBMSNAP_COMMITSEQ);
-- UPDATE !capschema!.IBMQREP_IGNTRANTRC SET COMMITLSN=CONCAT(x'000000000000', COMMITLSN);
-- UPDATE !capschema!.IBMSNAP_CAPPARMS SET COMPATIBILITY= '1001';
-- End of V10 | the_stack |
-- PREPARE
SET client_min_messages TO WARNING;
SET work_mem TO '1MB';
DROP GRAPH IF EXISTS shortestpath CASCADE;
CREATE OR REPLACE FUNCTION ids(vertex[]) RETURNS int[] AS $$
DECLARE
v vertex;
vids int[];
BEGIN
IF $1 IS NULL THEN
RETURN ARRAY[]::int[];
END IF;
FOREACH v IN ARRAY $1 LOOP
vids = array_append(vids, (v->>'id')::int);
END LOOP;
RETURN vids;
END;
$$ LANGUAGE plpgsql;
create graph shortestpath;
create vlabel vp;
create vlabel vc inherits ( vp );
create vlabel o;
create vlabel s;
create vlabel c;
create vlabel l;
create vlabel r;
create elabel ep;
create elabel ec inherits ( ep );
create elabel e;
-- Neo4j
-- create index on :o ( id );
-- create index on :s ( id );
-- create index on :c ( id );
-- create index on :l ( id );
-- create index on :r ( id );
-- create index on :e ( id );
create property index on o ( id );
create property index on s ( id );
create property index on c ( id );
create property index on l ( id );
create property index on r ( id );
create property index on e ( id );
-- Inherit
create (:vc{id:1})-[:ec]->(:vc{id:2});
-- Orphan
create (:o{id:1})
create (:o{id:2})
create (:o{id:3})
create (:o{id:4})
create (:o{id:5})
create (:o{id:6})
create (:o{id:7})
create (:o{id:8})
create (:o{id:9});
-- Unforked
create (:s{id:1})
create (:s{id:2})
create (:s{id:3})
create (:s{id:4})
create (:s{id:5})
create (:s{id:6})
create (:s{id:7})
create (:s{id:8})
create (:s{id:9})
create (:s{id:10})
create (:s{id:11})
create (:s{id:12})
create (:s{id:13})
create (:s{id:14})
create (:s{id:15})
create (:s{id:16})
create (:s{id:17})
create (:s{id:18})
create (:s{id:19});
match (s1:s), (s2:s{id:s1.id+1})
create (s1)-[:e{id:'s:'+s1.id+'->s:'+s2.id}]->(s2);
-- No Labels
match shortestpath( (a)-[b]->(c) ) return a.id as a, c.id as c order by a, c;
match p = shortestpath( (a)-[b]->(c) ) return ids(nodes(p)) as p, a.id as a, c.id as c order by a, c;
match allshortestpaths( (a)-[b]->(c) ) return a.id as a, c.id as c order by a, c;
match p = allshortestpaths( (a)-[b]->(c) ) return ids(nodes(p)) as p, a.id as a, c.id as c order by a, c;
-- Cycle
match (o:o)
create (:c{id:10+o.id})
create (:c{id:20+o.id})
create (:c{id:30+o.id})
create (:c{id:40+o.id})
create (:c{id:50+o.id})
create (:c{id:60+o.id})
create (:c{id:70+o.id})
create (:c{id:80+o.id})
create (:c{id:90+o.id});
match (c1:c), (c2:c)
where c1.id >= 11 and c1.id <= 19 and c2.id >= 11 and c2.id <= 19
create (c1)-[:e{id:'c:'+c1.id+'->c:'+c2.id}]->(c2);
match (c1:c), (c2:c)
where c1.id >= 21 and c1.id <= 29 and c2.id >= 21 and c2.id <= 29
create (c1)-[:e{id:'c:'+c1.id+'->c:'+c2.id}]->(c2);
match (c1:c), (c2:c)
where c1.id >= 31 and c1.id <= 39 and c2.id >= 31 and c2.id <= 39 and c1.id <> c2.id
create (c1)-[:e{id:'c:'+c1.id+'->c:'+c2.id}]->(c2);
match (c1:c), (c2:c)
where c1.id >= 41 and c1.id <= 49 and c2.id >= 41 and c2.id <= 49 and c1.id <> c2.id
create (c1)-[:e{id:'c:'+c1.id+'->c:'+c2.id}]->(c2);
match (c1:c), (c2:c)
where c1.id >= 51 and c1.id <= 59 and c2.id >= 51 and c2.id <= 59 and c1.id <> c2.id
create (c1)-[:e{id:'c:'+c1.id+'->c:'+c2.id}]->(c2);
match (c1:c), (c2:c)
where c1.id >= 61 and c1.id <= 69 and c2.id >= 61 and c2.id <= 69 and c1.id <> c2.id
create (c1)-[:e{id:'c:'+c1.id+'->c:'+c2.id}]->(c2);
match (c1:c), (c2:c)
where c1.id >= 71 and c1.id <= 79 and c2.id >= 71 and c2.id <= 79 and c1.id <> c2.id
create (c1)-[:e{id:'c:'+c1.id+'->c:'+c2.id}]->(c2);
match (c1:c), (c2:c)
where c1.id >= 81 and c1.id <= 89 and c2.id >= 81 and c2.id <= 89 and c1.id <> c2.id
create (c1)-[:e{id:'c:'+c1.id+'->c:'+c2.id}]->(c2);
match (c1:c), (c2:c)
where c1.id >= 91 and c1.id <= 99 and c2.id >= 91 and c2.id <= 99 and c1.id <> c2.id
create (c1)-[:e{id:'c:'+c1.id+'->c:'+c2.id}]->(c2);
match (c1:c{id:59}), (c2:c{id:69})
create (c1)-[:e{id:'c:'+c1.id+'->c'+c2.id}]->(c2)
create (c2)-[:e{id:'c:'+c2.id+'->c'+c1.id}]->(c1);
match (c1:c{id:79}), (c2:c{id:89}), (c3:c{id:99})
create (c1)-[:e{id:'c:'+c1.id+'->c'+c2.id}]->(c2)
create (c2)-[:e{id:'c:'+c2.id+'->c'+c3.id}]->(c3)
create (c3)-[:e{id:'c:'+c3.id+'->c'+c1.id}]->(c1);
-- Spread
match (o:o) create (:l{id:o.id});
match (n:l) where n.id >= 1 and n.id <= 9
create (n)-[:e{id:'l:'+n.id+'->l:'+(n.id*10+1)}]->(:l{id:n.id*10+1})
create (n)-[:e{id:'l:'+n.id+'->l:'+(n.id*10+2)}]->(:l{id:n.id*10+2})
create (n)-[:e{id:'l:'+n.id+'->l:'+(n.id*10+3)}]->(:l{id:n.id*10+3})
create (n)-[:e{id:'l:'+n.id+'->l:'+(n.id*10+4)}]->(:l{id:n.id*10+4})
create (n)-[:e{id:'l:'+n.id+'->l:'+(n.id*10+5)}]->(:l{id:n.id*10+5})
create (n)-[:e{id:'l:'+n.id+'->l:'+(n.id*10+6)}]->(:l{id:n.id*10+6})
create (n)-[:e{id:'l:'+n.id+'->l:'+(n.id*10+7)}]->(:l{id:n.id*10+7})
create (n)-[:e{id:'l:'+n.id+'->l:'+(n.id*10+8)}]->(:l{id:n.id*10+8})
create (n)-[:e{id:'l:'+n.id+'->l:'+(n.id*10+9)}]->(:l{id:n.id*10+9});
match (n:l) where n.id >= 11 and n.id <= 99
create (n)-[:e{id:'l:'+n.id+'->l:'+(n.id*10+1)}]->(:l{id:n.id*10+1})
create (n)-[:e{id:'l:'+n.id+'->l:'+(n.id*10+2)}]->(:l{id:n.id*10+2})
create (n)-[:e{id:'l:'+n.id+'->l:'+(n.id*10+3)}]->(:l{id:n.id*10+3})
create (n)-[:e{id:'l:'+n.id+'->l:'+(n.id*10+4)}]->(:l{id:n.id*10+4})
create (n)-[:e{id:'l:'+n.id+'->l:'+(n.id*10+5)}]->(:l{id:n.id*10+5})
create (n)-[:e{id:'l:'+n.id+'->l:'+(n.id*10+6)}]->(:l{id:n.id*10+6})
create (n)-[:e{id:'l:'+n.id+'->l:'+(n.id*10+7)}]->(:l{id:n.id*10+7})
create (n)-[:e{id:'l:'+n.id+'->l:'+(n.id*10+8)}]->(:l{id:n.id*10+8})
create (n)-[:e{id:'l:'+n.id+'->l:'+(n.id*10+9)}]->(:l{id:n.id*10+9});
match (n:l) where n.id >= 111 and n.id <= 999
create (n)-[:e{id:'l:'+n.id+'->l:'+(n.id*10+1)}]->(:l{id:n.id*10+1})
create (n)-[:e{id:'l:'+n.id+'->l:'+(n.id*10+2)}]->(:l{id:n.id*10+2})
create (n)-[:e{id:'l:'+n.id+'->l:'+(n.id*10+3)}]->(:l{id:n.id*10+3})
create (n)-[:e{id:'l:'+n.id+'->l:'+(n.id*10+4)}]->(:l{id:n.id*10+4})
create (n)-[:e{id:'l:'+n.id+'->l:'+(n.id*10+5)}]->(:l{id:n.id*10+5})
create (n)-[:e{id:'l:'+n.id+'->l:'+(n.id*10+6)}]->(:l{id:n.id*10+6})
create (n)-[:e{id:'l:'+n.id+'->l:'+(n.id*10+7)}]->(:l{id:n.id*10+7})
create (n)-[:e{id:'l:'+n.id+'->l:'+(n.id*10+8)}]->(:l{id:n.id*10+8})
create (n)-[:e{id:'l:'+n.id+'->l:'+(n.id*10+9)}]->(:l{id:n.id*10+9});
match (n:l) where n.id >= 1111 and n.id <= 9999
create (n)-[:e{id:'l:'+n.id+'->l:'+(n.id*10+1)}]->(:l{id:n.id*10+1})
create (n)-[:e{id:'l:'+n.id+'->l:'+(n.id*10+2)}]->(:l{id:n.id*10+2})
create (n)-[:e{id:'l:'+n.id+'->l:'+(n.id*10+3)}]->(:l{id:n.id*10+3})
create (n)-[:e{id:'l:'+n.id+'->l:'+(n.id*10+4)}]->(:l{id:n.id*10+4})
create (n)-[:e{id:'l:'+n.id+'->l:'+(n.id*10+5)}]->(:l{id:n.id*10+5})
create (n)-[:e{id:'l:'+n.id+'->l:'+(n.id*10+6)}]->(:l{id:n.id*10+6})
create (n)-[:e{id:'l:'+n.id+'->l:'+(n.id*10+7)}]->(:l{id:n.id*10+7})
create (n)-[:e{id:'l:'+n.id+'->l:'+(n.id*10+8)}]->(:l{id:n.id*10+8})
create (n)-[:e{id:'l:'+n.id+'->l:'+(n.id*10+9)}]->(:l{id:n.id*10+9});
-- Convergence
match (o:o) create (:r{id:o.id});
match (n:r) where n.id >= 1 and n.id <= 9
create (:r{id:n.id*10+1})-[:e{id:'r:'+(n.id*10+1)+'->r:'+n.id}]->(n)
create (:r{id:n.id*10+2})-[:e{id:'r:'+(n.id*10+2)+'->r:'+n.id}]->(n)
create (:r{id:n.id*10+3})-[:e{id:'r:'+(n.id*10+3)+'->r:'+n.id}]->(n)
create (:r{id:n.id*10+4})-[:e{id:'r:'+(n.id*10+4)+'->r:'+n.id}]->(n)
create (:r{id:n.id*10+5})-[:e{id:'r:'+(n.id*10+5)+'->r:'+n.id}]->(n)
create (:r{id:n.id*10+6})-[:e{id:'r:'+(n.id*10+6)+'->r:'+n.id}]->(n)
create (:r{id:n.id*10+7})-[:e{id:'r:'+(n.id*10+7)+'->r:'+n.id}]->(n)
create (:r{id:n.id*10+8})-[:e{id:'r:'+(n.id*10+8)+'->r:'+n.id}]->(n)
create (:r{id:n.id*10+9})-[:e{id:'r:'+(n.id*10+9)+'->r:'+n.id}]->(n);
match (n:r) where n.id >= 11 and n.id <= 99
create (:r{id:n.id*10+1})-[:e{id:'r:'+(n.id*10+1)+'->r:'+n.id}]->(n)
create (:r{id:n.id*10+2})-[:e{id:'r:'+(n.id*10+2)+'->r:'+n.id}]->(n)
create (:r{id:n.id*10+3})-[:e{id:'r:'+(n.id*10+3)+'->r:'+n.id}]->(n)
create (:r{id:n.id*10+4})-[:e{id:'r:'+(n.id*10+4)+'->r:'+n.id}]->(n)
create (:r{id:n.id*10+5})-[:e{id:'r:'+(n.id*10+5)+'->r:'+n.id}]->(n)
create (:r{id:n.id*10+6})-[:e{id:'r:'+(n.id*10+6)+'->r:'+n.id}]->(n)
create (:r{id:n.id*10+7})-[:e{id:'r:'+(n.id*10+7)+'->r:'+n.id}]->(n)
create (:r{id:n.id*10+8})-[:e{id:'r:'+(n.id*10+8)+'->r:'+n.id}]->(n)
create (:r{id:n.id*10+9})-[:e{id:'r:'+(n.id*10+9)+'->r:'+n.id}]->(n);
match (n:r) where n.id >= 111 and n.id <= 999
create (:r{id:n.id*10+1})-[:e{id:'r:'+(n.id*10+1)+'->r:'+n.id}]->(n)
create (:r{id:n.id*10+2})-[:e{id:'r:'+(n.id*10+2)+'->r:'+n.id}]->(n)
create (:r{id:n.id*10+3})-[:e{id:'r:'+(n.id*10+3)+'->r:'+n.id}]->(n)
create (:r{id:n.id*10+4})-[:e{id:'r:'+(n.id*10+4)+'->r:'+n.id}]->(n)
create (:r{id:n.id*10+5})-[:e{id:'r:'+(n.id*10+5)+'->r:'+n.id}]->(n)
create (:r{id:n.id*10+6})-[:e{id:'r:'+(n.id*10+6)+'->r:'+n.id}]->(n)
create (:r{id:n.id*10+7})-[:e{id:'r:'+(n.id*10+7)+'->r:'+n.id}]->(n)
create (:r{id:n.id*10+8})-[:e{id:'r:'+(n.id*10+8)+'->r:'+n.id}]->(n)
create (:r{id:n.id*10+9})-[:e{id:'r:'+(n.id*10+9)+'->r:'+n.id}]->(n);
match (n:r) where n.id >= 1111 and n.id <= 9999
create (:r{id:n.id*10+1})-[:e{id:'r:'+(n.id*10+1)+'->r:'+n.id}]->(n)
create (:r{id:n.id*10+2})-[:e{id:'r:'+(n.id*10+2)+'->r:'+n.id}]->(n)
create (:r{id:n.id*10+3})-[:e{id:'r:'+(n.id*10+3)+'->r:'+n.id}]->(n)
create (:r{id:n.id*10+4})-[:e{id:'r:'+(n.id*10+4)+'->r:'+n.id}]->(n)
create (:r{id:n.id*10+5})-[:e{id:'r:'+(n.id*10+5)+'->r:'+n.id}]->(n)
create (:r{id:n.id*10+6})-[:e{id:'r:'+(n.id*10+6)+'->r:'+n.id}]->(n)
create (:r{id:n.id*10+7})-[:e{id:'r:'+(n.id*10+7)+'->r:'+n.id}]->(n)
create (:r{id:n.id*10+8})-[:e{id:'r:'+(n.id*10+8)+'->r:'+n.id}]->(n)
create (:r{id:n.id*10+9})-[:e{id:'r:'+(n.id*10+9)+'->r:'+n.id}]->(n);
-- Vibration
match (l:l), (r:r{id:l.id}) where l.id = 1 and l.id <= 1
create(l)-[:e{id:'l:'+l.id+'->r:'+r.id}]->(r);
match (l:l), (r:r{id:l.id}) where l.id >= 22 and l.id <= 28
create(l)-[:e{id:'l:'+l.id+'->r:'+r.id}]->(r);
match (l:l), (r:r{id:l.id}) where l.id >= 321 and l.id <= 389
create(l)-[:e{id:'l:'+l.id+'->r:'+r.id}]->(r);
match (l:l), (r:r{id:l.id}) where l.id >= 4211 and l.id <= 4899
create(l)-[:e{id:'l:'+l.id+'->r:'+r.id}]->(r);
match (l:l), (r:r{id:l.id}) where l.id >= 52111 and l.id <= 58999
create(l)-[:e{id:'l:'+l.id+'->r:'+r.id}]->(r);
match (l:l), (r:r{id:l.id}) where l.id = 6
create(r)-[:e{id:'r:'+l.id+'->l:'+r.id}]->(l);
match (l:l), (r:r{id:l.id}) where l.id >= 81111 and l.id <= 89999
create(l)-[:e{id:'l:'+l.id+'->r:'+r.id}]->(r);
match (r:r{id:8}), (l:l{id:9})
create(r)-[:e{id:'r:'+r.id+'->l:'+l.id}]->(l);
match (l:l), (r:r{id:l.id}) where l.id >= 91111 and l.id <= 99999
create(l)-[:e{id:'l:'+l.id+'->r:'+r.id}]->(r);
-- VACUUM
vacuum full analyze shortestpath.vp;
vacuum full analyze shortestpath.vc;
vacuum full analyze shortestpath.o;
vacuum full analyze shortestpath.s;
vacuum full analyze shortestpath.c;
vacuum full analyze shortestpath.l;
vacuum full analyze shortestpath.r;
vacuum full analyze shortestpath.ep;
vacuum full analyze shortestpath.ec;
vacuum full analyze shortestpath.e;
-- Orphan
match p = shortestpath( (o1:o)-[:e*0..]->(o2:o) ) where o1.id = 1 and o2.id = 1 return p;
match p = shortestpath( (o1:o)-[:e*1..]->(o2:o) ) where o1.id = 1 and o2.id = 1 return p;
match p = shortestpath( (o1:o)-[:e*0..]->(o2:o) ) where o1.id = 1 and o2.id = 2 return p;
match p = shortestpath( (o1:o)-[:e*1..]->(o2:o) ) where o1.id = 1 and o2.id = 2 return p;
match p = allshortestpaths( (o1:o)-[:e*0..]->(o2:o) ) where o1.id = 1 and o2.id = 1 return p;
match p = allshortestpaths( (o1:o)-[:e*1..]->(o2:o) ) where o1.id = 1 and o2.id = 1 return p;
match p = allshortestpaths( (o1:o)-[:e*0..]->(o2:o) ) where o1.id = 1 and o2.id = 2 return p;
match p = allshortestpaths( (o1:o)-[:e*1..]->(o2:o) ) where o1.id = 1 and o2.id = 2 return p;
match p = shortestpath( (o1:o)<-[:e*0..]-(o2:o) ) where o1.id = 1 and o2.id = 1 return p;
match p = shortestpath( (o1:o)<-[:e*1..]-(o2:o) ) where o1.id = 1 and o2.id = 1 return p;
match p = shortestpath( (o1:o)<-[:e*0..]-(o2:o) ) where o1.id = 1 and o2.id = 2 return p;
match p = shortestpath( (o1:o)<-[:e*1..]-(o2:o) ) where o1.id = 1 and o2.id = 2 return p;
match p = allshortestpaths( (o1:o)<-[:e*0..]-(o2:o) ) where o1.id = 1 and o2.id = 1 return p;
match p = allshortestpaths( (o1:o)<-[:e*1..]-(o2:o) ) where o1.id = 1 and o2.id = 1 return p;
match p = allshortestpaths( (o1:o)<-[:e*0..]-(o2:o) ) where o1.id = 1 and o2.id = 2 return p;
match p = allshortestpaths( (o1:o)<-[:e*1..]-(o2:o) ) where o1.id = 1 and o2.id = 2 return p;
match p = shortestpath( (o1:o)-[:e*0..]-(o2:o) ) where o1.id = 1 and o2.id = 1 return p;
match p = shortestpath( (o1:o)-[:e*1..]-(o2:o) ) where o1.id = 1 and o2.id = 1 return p;
match p = shortestpath( (o1:o)-[:e*0..]-(o2:o) ) where o1.id = 1 and o2.id = 2 return p;
match p = shortestpath( (o1:o)-[:e*1..]-(o2:o) ) where o1.id = 1 and o2.id = 2 return p;
match p = allshortestpaths( (o1:o)-[:e*0..]-(o2:o) ) where o1.id = 1 and o2.id = 1 return p;
match p = allshortestpaths( (o1:o)-[:e*1..]-(o2:o) ) where o1.id = 1 and o2.id = 1 return p;
match p = allshortestpaths( (o1:o)-[:e*0..]-(o2:o) ) where o1.id = 1 and o2.id = 2 return p;
match p = allshortestpaths( (o1:o)-[:e*1..]-(o2:o) ) where o1.id = 1 and o2.id = 2 return p;
match p = shortestpath( (o1:o)<-[:e*0..]->(o2:o) ) where o1.id = 1 and o2.id = 1 return p;
match p = shortestpath( (o1:o)<-[:e*1..]->(o2:o) ) where o1.id = 1 and o2.id = 1 return p;
match p = shortestpath( (o1:o)<-[:e*0..]->(o2:o) ) where o1.id = 1 and o2.id = 2 return p;
match p = shortestpath( (o1:o)<-[:e*1..]->(o2:o) ) where o1.id = 1 and o2.id = 2 return p;
match p = allshortestpaths( (o1:o)<-[:e*0..]->(o2:o) ) where o1.id = 1 and o2.id = 1 return p;
match p = allshortestpaths( (o1:o)<-[:e*1..]->(o2:o) ) where o1.id = 1 and o2.id = 1 return p;
match p = allshortestpaths( (o1:o)<-[:e*0..]->(o2:o) ) where o1.id = 1 and o2.id = 2 return p;
match p = allshortestpaths( (o1:o)<-[:e*1..]->(o2:o) ) where o1.id = 1 and o2.id = 2 return p;
match (o1:o), (o2:o) where o1.id >= 1 and o1.id <= 2 and o2.id >= 1 and o2.id <= 2 return o1.id as o1id, o2.id as o2id, shortestpath((o1)-[:e]->(o2)) order by o1id, o2id;
match (o1:o), (o2:o) where o1.id >= 1 and o1.id <= 2 and o2.id >= 1 and o2.id <= 2 return o1.id as o1id, o2.id as o2id, shortestpath((o1)-[:e*]->(o2)) order by o1id, o2id;
match (o1:o), (o2:o) where o1.id >= 1 and o1.id <= 2 and o2.id >= 1 and o2.id <= 2 return o1.id as o1id, o2.id as o2id, shortestpath((o1)-[:e*0..]->(o2)) order by o1id, o2id;
match (o1:o), (o2:o) where o1.id >= 1 and o1.id <= 2 and o2.id >= 1 and o2.id <= 2 return o1.id as o1id, o2.id as o2id, allshortestpaths((o1)-[:e]->(o2)) order by o1id, o2id;
match (o1:o), (o2:o) where o1.id >= 1 and o1.id <= 2 and o2.id >= 1 and o2.id <= 2 return o1.id as o1id, o2.id as o2id, allshortestpaths((o1)-[:e*]->(o2)) order by o1id, o2id;
match (o1:o), (o2:o) where o1.id >= 1 and o1.id <= 2 and o2.id >= 1 and o2.id <= 2 return o1.id as o1id, o2.id as o2id, allshortestpaths((o1)-[:e*0..]->(o2)) order by o1id, o2id;
-- Unforked
match (s1:s), (s2:s) return s1.id as s1id, s2.id as s2id, ids(nodes(shortestpath((s1)-[:e]->(s2)))) order by s1id, s2id;
match (s1:s), (s2:s) return s1.id as s1id, s2.id as s2id, ids(nodes(shortestpath((s1)-[:e*0..]->(s2)))) order by s1id, s2id;
match (s1:s), (s2:s) return s1.id as s1id, s2.id as s2id, ids(nodes(shortestpath((s1)-[:e*]->(s2)))) order by s1id, s2id;
match (s1:s), (s2:s) return s1.id as s1id, s2.id as s2id, ids(nodes(shortestpath((s1)-[:e*..2]->(s2)))) order by s1id, s2id;
match (s1:s), (s2:s) return s1.id as s1id, s2.id as s2id, ids(nodes(shortestpath((s1)<-[:e]-(s2)))) order by s1id, s2id;
match (s1:s), (s2:s) return s1.id as s1id, s2.id as s2id, ids(nodes(shortestpath((s1)<-[:e*0..]-(s2)))) order by s1id, s2id;
match (s1:s), (s2:s) return s1.id as s1id, s2.id as s2id, ids(nodes(shortestpath((s1)<-[:e*]-(s2)))) order by s1id, s2id;
match (s1:s), (s2:s) return s1.id as s1id, s2.id as s2id, ids(nodes(shortestpath((s1)<-[:e*..2]-(s2)))) order by s1id, s2id;
match (s1:s), (s2:s) return s1.id as s1id, s2.id as s2id, allshortestpaths((s1)-[:e]-(s2)) order by s1id, s2id;
match (s1:s), (s2:s) return s1.id as s1id, s2.id as s2id, allshortestpaths((s1)-[:e*0..]-(s2)) order by s1id, s2id;
match (s1:s), (s2:s) return s1.id as s1id, s2.id as s2id, allshortestpaths((s1)-[:e*]-(s2)) order by s1id, s2id;
match (s1:s), (s2:s) return s1.id as s1id, s2.id as s2id, allshortestpaths((s1)-[:e*..2]-(s2)) order by s1id, s2id;
match (s1:s), (s2:s) return s1.id as s1id, s2.id as s2id, ids(nodes(shortestpath((s1)-[:e*0..0]->(s2)))) order by s1id, s2id;
match (s1:s), (s2:s) return s1.id as s1id, s2.id as s2id, ids(nodes(shortestpath((s1)-[:e*..1]->(s2)))) order by s1id, s2id;
match (s1:s), (s2:s) return s1.id as s1id, s2.id as s2id, ids(nodes(shortestpath((s1)-[:e*..2]->(s2)))) order by s1id, s2id;
match (s1:s), (s2:s) return s1.id as s1id, s2.id as s2id, ids(nodes(shortestpath((s1)-[:e*..3]->(s2)))) order by s1id, s2id;
match (s1:s), (s2:s) return s1.id as s1id, s2.id as s2id, ids(nodes(shortestpath((s1)-[:e*..4]->(s2)))) order by s1id, s2id;
match (s1:s), (s2:s) return s1.id as s1id, s2.id as s2id, ids(nodes(shortestpath((s1)-[:e*..5]->(s2)))) order by s1id, s2id;
match (s1:s), (s2:s) return s1.id as s1id, s2.id as s2id, ids(nodes(shortestpath((s1)-[:e*..6]->(s2)))) order by s1id, s2id;
match (s1:s), (s2:s) return s1.id as s1id, s2.id as s2id, ids(nodes(shortestpath((s1)-[:e*..7]->(s2)))) order by s1id, s2id;
match (s1:s), (s2:s) return s1.id as s1id, s2.id as s2id, ids(nodes(shortestpath((s1)-[:e*..8]->(s2)))) order by s1id, s2id;
match (s1:s), (s2:s) return s1.id as s1id, s2.id as s2id, ids(nodes(shortestpath((s1)-[:e*..9]->(s2)))) order by s1id, s2id;
match (s1:s), (s2:s) return s1.id as s1id, s2.id as s2id, ids(nodes(shortestpath((s1)-[:e*..10]->(s2)))) order by s1id, s2id;
match (s1:s), (s2:s) return s1.id as s1id, s2.id as s2id, ids(nodes(shortestpath((s1)-[:e*..11]->(s2)))) order by s1id, s2id;
match (s1:s), (s2:s) return s1.id as s1id, s2.id as s2id, ids(nodes(shortestpath((s1)-[:e*..12]->(s2)))) order by s1id, s2id;
match (s1:s), (s2:s) return s1.id as s1id, s2.id as s2id, ids(nodes(shortestpath((s1)-[:e*..13]->(s2)))) order by s1id, s2id;
match (s1:s), (s2:s) return s1.id as s1id, s2.id as s2id, ids(nodes(shortestpath((s1)-[:e*..14]->(s2)))) order by s1id, s2id;
match (s1:s), (s2:s) return s1.id as s1id, s2.id as s2id, ids(nodes(shortestpath((s1)-[:e*..15]->(s2)))) order by s1id, s2id;
match (s1:s), (s2:s) return s1.id as s1id, s2.id as s2id, ids(nodes(shortestpath((s1)-[:e*..16]->(s2)))) order by s1id, s2id;
match (s1:s), (s2:s) return s1.id as s1id, s2.id as s2id, ids(nodes(shortestpath((s1)-[:e*..17]->(s2)))) order by s1id, s2id;
match (s1:s), (s2:s) return s1.id as s1id, s2.id as s2id, ids(nodes(shortestpath((s1)-[:e*..18]->(s2)))) order by s1id, s2id;
match (s1:s), (s2:s) return s1.id as s1id, s2.id as s2id, ids(nodes(shortestpath((s1)-[:e*..19]->(s2)))) order by s1id, s2id;
match (s1:s), (s2:s) return s1.id as s1id, s2.id as s2id, ids(nodes(shortestpath((s1)-[:e*..20]->(s2)))) order by s1id, s2id;
-- Cycle
match (c1:c), (c2:c) where c1.id >= 11 and c1.id <= 19 and c2.id >= 11 and c2.id <= 19 return c1.id as c1id, c2.id as c2id, allshortestpaths((c1)-[:e*]->(c2)) order by c1id, c2id;
match (c1:c), (c2:c) where c1.id >= 11 and c1.id <= 19 and c2.id >= 21 and c2.id <= 29 return c1.id as c1id, c2.id as c2id, allshortestpaths((c1)-[:e*]->(c2)) order by c1id, c2id;
match (c1:c), (c2:c) where c1.id >= 31 and c1.id <= 39 and c2.id >= 31 and c2.id <= 39 return c1.id as c1id, c2.id as c2id, allshortestpaths((c1)-[:e*]->(c2)) order by c1id, c2id;
match (c1:c), (c2:c) where c1.id >= 31 and c1.id <= 39 and c2.id >= 41 and c2.id <= 49 return c1.id as c1id, c2.id as c2id, allshortestpaths((c1)-[:e*]->(c2)) order by c1id, c2id;
match (c1:c), (c2:c) where c1.id >= 11 and c1.id <= 19 and c2.id >= 11 and c2.id <= 19 return c1.id as c1id, c2.id as c2id, allshortestpaths((c1)<-[:e*]-(c2)) order by c1id, c2id;
match (c1:c), (c2:c) where c1.id >= 11 and c1.id <= 19 and c2.id >= 21 and c2.id <= 29 return c1.id as c1id, c2.id as c2id, allshortestpaths((c1)<-[:e*]-(c2)) order by c1id, c2id;
match (c1:c), (c2:c) where c1.id >= 31 and c1.id <= 39 and c2.id >= 31 and c2.id <= 39 return c1.id as c1id, c2.id as c2id, allshortestpaths((c1)<-[:e*]-(c2)) order by c1id, c2id;
match (c1:c), (c2:c) where c1.id >= 31 and c1.id <= 39 and c2.id >= 41 and c2.id <= 49 return c1.id as c1id, c2.id as c2id, allshortestpaths((c1)<-[:e*]-(c2)) order by c1id, c2id;
match (c1:c), (c2:c) where c1.id >= 11 and c1.id <= 19 and c2.id >= 11 and c2.id <= 19 return c1.id as c1id, c2.id as c2id, allshortestpaths((c1)-[:e*]-(c2)) order by c1id, c2id;
match (c1:c), (c2:c) where c1.id >= 11 and c1.id <= 19 and c2.id >= 21 and c2.id <= 29 return c1.id as c1id, c2.id as c2id, allshortestpaths((c1)-[:e*]-(c2)) order by c1id, c2id;
match (c1:c), (c2:c) where c1.id >= 31 and c1.id <= 39 and c2.id >= 31 and c2.id <= 39 return c1.id as c1id, c2.id as c2id, allshortestpaths((c1)-[:e*]-(c2)) order by c1id, c2id;
match (c1:c), (c2:c) where c1.id >= 31 and c1.id <= 39 and c2.id >= 41 and c2.id <= 49 return c1.id as c1id, c2.id as c2id, allshortestpaths((c1)-[:e*]-(c2)) order by c1id, c2id;
match (c1:c), (c2:c) where c1.id >= 51 and c1.id <= 59 and c2.id >= 61 and c2.id <= 69 return c1.id as c1id, c2.id as c2id, allshortestpaths((c1)-[:e*]->(c2)) order by c1id, c2id;
match (c1:c), (c2:c) where c1.id >= 71 and c1.id <= 79 and c2.id >= 81 and c2.id <= 99 return c1.id as c1id, c2.id as c2id, allshortestpaths((c1)-[:e*]->(c2)) order by c1id, c2id;
match (c1:c), (c2:c) where c1.id >= 51 and c1.id <= 59 and c2.id >= 61 and c2.id <= 69 return c1.id as c1id, c2.id as c2id, allshortestpaths((c1)<-[:e*]-(c2)) order by c1id, c2id;
match (c1:c), (c2:c) where c1.id >= 71 and c1.id <= 79 and c2.id >= 81 and c2.id <= 99 return c1.id as c1id, c2.id as c2id, allshortestpaths((c1)<-[:e*]-(c2)) order by c1id, c2id;
match (c1:c), (c2:c) where c1.id >= 51 and c1.id <= 59 and c2.id >= 61 and c2.id <= 69 return c1.id as c1id, c2.id as c2id, allshortestpaths((c1)-[:e*]-(c2)) order by c1id, c2id;
match (c1:c), (c2:c) where c1.id >= 71 and c1.id <= 79 and c2.id >= 81 and c2.id <= 99 return c1.id as c1id, c2.id as c2id, allshortestpaths((c1)-[:e*]-(c2)) order by c1id, c2id;
-- Spread
match (l1:l), (l2:l) where l1.id = 1 and l2.id = 11111 return l1.id as l1id, l2.id as l2id, allshortestpaths((l1)-[:e*]->(l2)) order by l1id, l2id;
match (l1:l), (l2:l) where l1.id = 1 and l2.id = 11111 return l1.id as l1id, l2.id as l2id, allshortestpaths((l1)<-[:e*]-(l2)) order by l1id, l2id;
match (l1:l), (l2:l) where l1.id = 1 and l2.id = 11111 return l1.id as l1id, l2.id as l2id, allshortestpaths((l1)-[:e*]-(l2)) order by l1id, l2id;
match (l1:l), (l2:l) where l1.id = 1 and l2.id = 11111 return l1.id as l1id, l2.id as l2id, allshortestpaths((l2)<-[:e*]-(l1)) order by l1id, l2id;
match (l1:l), (l2:l) where l1.id = 1 and l2.id = 11111 return l1.id as l1id, l2.id as l2id, allshortestpaths((l2)-[:e*]->(l1)) order by l1id, l2id;
match (l1:l), (l2:l) where l1.id = 1 and l2.id = 11111 return l1.id as l1id, l2.id as l2id, allshortestpaths((l2)-[:e*]-(l1)) order by l1id, l2id;
-- Convergence
match (r1:r), (r2:r) where r1.id = 1 and r2.id = 11111 return r1.id as r1id, r2.id as r2id, allshortestpaths((r1)-[:e*]->(r2)) order by r1id, r2id;
match (r1:r), (r2:r) where r1.id = 1 and r2.id = 11111 return r1.id as r1id, r2.id as r2id, allshortestpaths((r1)<-[:e*]-(r2)) order by r1id, r2id;
match (r1:r), (r2:r) where r1.id = 1 and r2.id = 11111 return r1.id as r1id, r2.id as r2id, allshortestpaths((r1)-[:e*]-(r2)) order by r1id, r2id;
match (r1:r), (r2:r) where r1.id = 1 and r2.id = 11111 return r1.id as r1id, r2.id as r2id, allshortestpaths((r2)<-[:e*]-(r1)) order by r1id, r2id;
match (r1:r), (r2:r) where r1.id = 1 and r2.id = 11111 return r1.id as r1id, r2.id as r2id, allshortestpaths((r2)-[:e*]->(r1)) order by r1id, r2id;
match (r1:r), (r2:r) where r1.id = 1 and r2.id = 11111 return r1.id as r1id, r2.id as r2id, allshortestpaths((r2)-[:e*]-(r1)) order by r1id, r2id;
-- Vibration
match p = allshortestpaths( (l1:l)-[:e*]->(r2:r) ) where l1.id = 8 and r2.id = 8 return l1.id as l1id, r2.id as r2id, count(p) order by l1id, r2id;
match p = allshortestpaths( (l1:l)<-[:e*]-(r2:r) ) where l1.id = 8 and r2.id = 8 return l1.id as l1id, r2.id as r2id, count(p) order by l1id, r2id;
match p = allshortestpaths( (l1:l)-[:e*]-(r2:r) ) where l1.id = 8 and r2.id = 8 return l1.id as l1id, r2.id as r2id, count(p) order by l1id, r2id;
match p = allshortestpaths( (r1:l)-[:e*]->(l2:r) ) where r1.id = 88888 and l2.id = 99999 return r1.id as r1id, l2.id as l2id, count(p) order by r1id, l2id;
match p = allshortestpaths( (r1:l)<-[:e*]-(l2:r) ) where r1.id = 88888 and l2.id = 99999 return r1.id as r1id, l2.id as l2id, count(p) order by r1id, l2id;
match p = allshortestpaths( (r1:l)-[:e*]-(l2:r) ) where r1.id = 88888 and l2.id = 99999 return r1.id as r1id, l2.id as l2id, count(p) order by r1id, l2id;
match p = allshortestpaths( (l1:l)-[:e*]->(r2:r) ) where l1.id = 888 and r2.id = 999 return l1.id as l1id, r2.id as r2id, count(p) order by l1id, r2id;
match p = allshortestpaths( (l1:l)<-[:e*]-(r2:r) ) where l1.id = 888 and r2.id = 999 return l1.id as l1id, r2.id as r2id, count(p) order by l1id, r2id;
match p = allshortestpaths( (l1:l)-[:e*]-(r2:r) ) where l1.id = 888 and r2.id = 999 return l1.id as l1id, r2.id as r2id, count(p) order by l1id, r2id;
-- Filter
match p = shortestpath( (:o)-[:e]->(:o) ) return p;
match p = shortestpath( (o1:o)-[:e]->(o2:o) ) return o1, o2, p;
match p = shortestpath( (o1:o)-[:e]->(o2:o) ) where o1.id = 1 return o1, o2, p;
match p = shortestpath( (o1:o)-[:e]->(o2:o) ) where o2.id = 1 return o1, o2, p;
match (o1:o{id:1}), (o2:o{id:1}) match p = shortestpath( (o1)-[:e]->(o2) ) return o1, o2, p;
match (o1:o), (o2:o) match p = shortestpath( (o1)-[:e]->(o2) ) where o1.id = 1 and o2.id = 1 return o1, o2, p;
-- Inherit
match p = shortestpath( (p1:vp)-[:ep]->(p2:vp) ) return p1, p2, p;
match p = shortestpath( (p1:vp only)-[:ep only]->(p2:vp only) ) return p1, p2, p;
match p = shortestpath( (p1:vc only)-[:ec only]->(p2:vc only) ) return p1, p2, p;
match p = shortestpath( (p1:vp only)-[:ep]->(p2:vp only) ) return p1, p2, p;
match p = shortestpath( (p1:vc only)-[:ep]->(p2:vc only) ) return p1, p2, p;
match p = shortestpath( (p1:vp)-[:ep only]->(p2:vp) ) return p1, p2, p;
match p = shortestpath( (p1:vp)-[:ec only]->(p2:vp) ) return p1, p2, p;
-- Property Constraint
match p = shortestpath( (s1:s{id:1})-[:e]->(s2:s{id:2}) ) return p;
match (s1:s), (s2:s) match p = shortestpath( (s1{id:1})-[:e]->(s2{id:2}) ) return p;
-- Edge Reference
match p = shortestpath( (s1:s{id:1})-[e:e*]->(s2:s{id:19}) ) return ids(nodes(p)) as p, e;
-- No Path Variable
match shortestpath( (s1:s{id:1})-[:e*]->(s2:s{id:19}) ) return s1.id, s2.id;
match shortestpath( (s1:s{id:1})-[e:e*]->(s2:s{id:19}) ) return s1.id, s2.id, e;
-- Failure
match p = shortestpath( (:o) ) return p;
match p = shortestpath( ()-[:e]->() ) return p;
match p = shortestpath( (:o)-[:e]->(:o)-[:e]->(:o) ) return p;
match p = shortestpath( (:o{id:1})-[:e]->(:o{id:1}) ) return p;
match p = shortestpath( (o1:o)-[:e{id:1}]->(o1:o) ) return p;
match p = shortestpath( (:o)-[r:e]->(:o) ) return p;
match (o1:o{id:1}), (o2:o{id:1}) match p = shortestpath( (o1)-[:e*-1]->(o2) ) return p;
match (o1:o{id:1}), (o2:o{id:1}) match p = shortestpath( (o1)-[:e*-1..]->(o2) ) return p;
match (o1:o{id:1}), (o2:o{id:1}) match p = shortestpath( (o1)-[:e*2..]->(o2) ) return p;
match (o1:o{id:1}), (o2:o{id:1}) match p = shortestpath( (o1)-[:e*..0]->(o2) ) return p;
match (o1:o{id:1}), (o2:o{id:1}) match p = shortestpath( (o1)-[:e*..-1]->(o2) ) return p;
match (o1:o{id:1}), (o2:o{id:1}) return shortestpath( (o1{id:1})-[:e]->(o2{id:1}) );
match (o1:o{id:1})-[e:e]->(o2:o{id:1}) match p = shortestpath( (o1)-[e:e*]->(o2) ) return p;
match (o1:o{id:1}), (o2:o{id:1}) return shortestpath( (o1)-[e:e*]->(o2) );
-- Plan
SET enable_bitmapscan to off;
SET enable_material to off;
explain ( analyze false, verbose true, costs false, buffers false, timing false )
match p = shortestpath( (o1:o)-[:e]->(o2:o) ) where o1.id = 1 and o2.id = 1 return p;
explain ( analyze false, verbose true, costs false, buffers false, timing false )
match p = allshortestpaths( (o1:o)-[:e*0..]->(o2:o) ) where o1.id = 1 and o1.id = 1 return p;
explain ( analyze false, verbose true, costs false, buffers false, timing false )
match (o1:o{id:1}), (o2:o{id:1}) match p = shortestpath( (o1)-[:e]->(o2) ) return o1, o2, p;
explain ( analyze false, verbose true, costs false, buffers false, timing false )
match (o1:o), (o2:o) match p = shortestpath( (o1)-[:e]->(o2) ) where o1.id = 1 and o2.id = 1 return o1, o2, p;
explain ( analyze false, verbose true, costs false, buffers false, timing false )
match p = shortestpath( (o1:o)<-[:e*0..]->(o2:o) ) where o1.id = 1 and o1.id = 1 return p;
explain ( analyze false, verbose true, costs false, buffers false, timing false )
match p = shortestpath( (o1:o)<-[:e*1..]->(o2:o) ) where o1.id = 1 and o1.id = 1 return p;
explain ( analyze false, verbose true, costs false, buffers false, timing false )
match p = shortestpath( (o1:o)<-[:e*0..1]->(o2:o) ) where o1.id = 1 and o1.id = 1 return p;
explain ( analyze false, verbose true, costs false, buffers false, timing false )
match p = shortestpath( (o1:o)<-[:e*1..2]->(o2:o) ) where o1.id = 1 and o1.id = 1 return p;
explain ( analyze false, verbose true, costs false, buffers false, timing false )
match (s1:s), (s2:s) return s1.id as s1id, s2.id as s2id, ids(nodes(shortestpath((s1)-[:e]->(s2)))) order by s1id, s2id;
explain ( analyze false, verbose true, costs false, buffers false, timing false )
match (c1:c), (c2:c) where c1.id >= 11 and c1.id <= 19 and c2.id >= 11 and c2.id <= 19 return c1.id as c1id, c2.id as c2id, allshortestpaths((c1)-[:e*]->(c2)) order by c1id, c2id;
explain ( analyze false, verbose true, costs false, buffers false, timing false )
match (l1:l), (l2:l) where l1.id = 1 and l2.id = 111111 return l1.id as l1id, l2.id as l2id, allshortestpaths((l1)-[:e*]->(l2)) order by l1id, l2id;
-- DESTROY
DROP FUNCTION ids(vertex[]);
DROP GRAPH IF EXISTS shortestpath CASCADE; | the_stack |
-- 2021-01-11T11:50:05.772Z
-- URL zum Konzept
UPDATE AD_Message_Trl SET MsgText='Benutzerkonto ist gesperrt.',Updated=TO_TIMESTAMP('2021-01-11 13:50:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='fr_CH' AND AD_Message_ID=540115
;
-- 2021-01-11T11:54:21.687Z
-- URL zum Konzept
UPDATE AD_Message_Trl SET MsgText='Benutzerkonto ist gesperrt.',Updated=TO_TIMESTAMP('2021-01-11 13:54:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_CH' AND AD_Message_ID=540115
;
-- 2021-01-11T11:54:36.863Z
-- URL zum Konzept
UPDATE AD_Message_Trl SET MsgText='Benutzerkonto ist gesperrt.',Updated=TO_TIMESTAMP('2021-01-11 13:54:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Message_ID=540115
;
-- 2021-01-11T12:00:42.725Z
-- URL zum Konzept
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,545021,0,TO_TIMESTAMP('2021-01-11 14:00:42','YYYY-MM-DD HH24:MI:SS'),100,'U','Y','No roles','E',TO_TIMESTAMP('2021-01-11 14:00:42','YYYY-MM-DD HH24:MI:SS'),100,'NoRoles')
;
-- 2021-01-11T12:00:42.767Z
-- URL zum Konzept
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Message t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y') AND t.AD_Message_ID=545021 AND NOT EXISTS (SELECT 1 FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
;
-- 2021-01-11T12:01:12.045Z
-- URL zum Konzept
UPDATE AD_Message_Trl SET IsTranslated='Y', MsgText='Keine Rollen.',Updated=TO_TIMESTAMP('2021-01-11 14:01:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Message_ID=545021
;
-- 2021-01-11T12:07:24.266Z
-- URL zum Konzept
UPDATE AD_Message_Trl SET MsgText='Dem Benutzer ist keine Rolle zugeordnet.',Updated=TO_TIMESTAMP('2021-01-11 14:07:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Message_ID=545021
;
-- 2021-01-11T12:07:37.149Z
-- URL zum Konzept
UPDATE AD_Message_Trl SET IsTranslated='Y', MsgText='User account has no assigned role.',Updated=TO_TIMESTAMP('2021-01-11 14:07:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_US' AND AD_Message_ID=545021
;
-- 2021-01-11T12:07:50.527Z
-- URL zum Konzept
UPDATE AD_Message_Trl SET IsTranslated='Y', MsgText='User account has no assigned role.',Updated=TO_TIMESTAMP('2021-01-11 14:07:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='nl_NL' AND AD_Message_ID=545021
;
-- 2021-01-11T12:08:13.128Z
-- URL zum Konzept
UPDATE AD_Message_Trl SET MsgText='User account has no assigned role.',Updated=TO_TIMESTAMP('2021-01-11 14:08:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_CH' AND AD_Message_ID=545021
;
-- 2021-01-11T12:09:55.177Z
-- URL zum Konzept
UPDATE AD_Message_Trl SET MsgText='Der Benutzerzugang ist gesperrt.',Updated=TO_TIMESTAMP('2021-01-11 14:09:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_CH' AND AD_Message_ID=540115
;
-- 2021-01-11T12:10:05.885Z
-- URL zum Konzept
UPDATE AD_Message_Trl SET MsgText='Der Benutzerzugang ist gesperrt.',Updated=TO_TIMESTAMP('2021-01-11 14:10:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Message_ID=540115
;
-- 2021-01-11T12:11:16.497Z
-- URL zum Konzept
UPDATE AD_Message_Trl SET MsgText='Nutzer oder Passwort ist nicht korrekt.',Updated=TO_TIMESTAMP('2021-01-11 14:11:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Message_ID=540131
;
-- 2021-01-11T12:11:21.175Z
-- URL zum Konzept
UPDATE AD_Message_Trl SET MsgText='Nutzer oder Passwort ist nicht korrekt.',Updated=TO_TIMESTAMP('2021-01-11 14:11:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='nl_NL' AND AD_Message_ID=540131
;
-- 2021-01-11T12:11:25.720Z
-- URL zum Konzept
UPDATE AD_Message_Trl SET MsgText='Nutzer oder Passwort ist nicht korrekt.',Updated=TO_TIMESTAMP('2021-01-11 14:11:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_US' AND AD_Message_ID=540131
;
-- 2021-01-11T12:11:30.430Z
-- URL zum Konzept
UPDATE AD_Message_Trl SET MsgText='Nutzer oder Passwort ist nicht korrekt.',Updated=TO_TIMESTAMP('2021-01-11 14:11:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_CH' AND AD_Message_ID=540131
;
-- 2021-01-11T13:55:00.472Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET IsTranslated='Y', MsgText='Something went wrong. The problem has been saved (system problem {0}) so that the metasfresh team can address it.',Updated=TO_TIMESTAMP('2021-01-11 15:55:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_US' AND AD_Message_ID=545020
;
-- 2021-01-11T13:55:17.111Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2021-01-11 15:55:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Message_ID=545020
;
-- 2021-01-11T15:08:14.180Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message SET MsgText='Dem Benutzer ist keine Rolle zugeordnet.',Updated=TO_TIMESTAMP('2021-01-11 17:08:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=545021
;
-- 2021-01-11T12:11:34.349Z
-- URL zum Konzept
UPDATE AD_Message_Trl SET MsgText='Nutzer oder Passwort ist nicht korrekt.',Updated=TO_TIMESTAMP('2021-01-11 14:11:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_GB' AND AD_Message_ID=540131
;
-- 2021-01-11T12:11:38.402Z
-- URL zum Konzept
UPDATE AD_Message_Trl SET MsgText='Nutzer oder Passwort ist nicht korrekt.',Updated=TO_TIMESTAMP('2021-01-11 14:11:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='it_CH' AND AD_Message_ID=540131
;
-- 2021-01-11T12:11:43.300Z
-- URL zum Konzept
UPDATE AD_Message_Trl SET MsgText='Nutzer oder Passwort ist nicht korrekt.',Updated=TO_TIMESTAMP('2021-01-11 14:11:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='fr_CH' AND AD_Message_ID=540131
;
-- 2021-01-11T12:13:13.022Z
-- URL zum Konzept
UPDATE AD_Message SET MsgText='Der Code zum Zurücksetzen Ihres Passworts ist nicht mehr gültig.',Updated=TO_TIMESTAMP('2021-01-11 14:13:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=53109
;
-- 2021-01-11T12:13:19.352Z
-- URL zum Konzept
UPDATE AD_Message_Trl SET MsgText='Der Code zum Zurücksetzen Ihres Passworts ist nicht mehr gültig.',Updated=TO_TIMESTAMP('2021-01-11 14:13:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Message_ID=53109
;
-- 2021-01-11T12:13:22.750Z
-- URL zum Konzept
UPDATE AD_Message_Trl SET MsgText='Der Code zum Zurücksetzen Ihres Passworts ist nicht mehr gültig.',Updated=TO_TIMESTAMP('2021-01-11 14:13:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='nl_NL' AND AD_Message_ID=53109
;
-- 2021-01-11T12:13:25.693Z
-- URL zum Konzept
UPDATE AD_Message_Trl SET MsgText='Der Code zum Zurücksetzen Ihres Passworts ist nicht mehr gültig.',Updated=TO_TIMESTAMP('2021-01-11 14:13:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_US' AND AD_Message_ID=53109
;
-- 2021-01-11T12:13:28.363Z
-- URL zum Konzept
UPDATE AD_Message_Trl SET MsgText='Der Code zum Zurücksetzen Ihres Passworts ist nicht mehr gültig.',Updated=TO_TIMESTAMP('2021-01-11 14:13:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_CH' AND AD_Message_ID=53109
;
-- 2021-01-11T12:13:31.270Z
-- URL zum Konzept
UPDATE AD_Message_Trl SET MsgText='Der Code zum Zurücksetzen Ihres Passworts ist nicht mehr gültig.',Updated=TO_TIMESTAMP('2021-01-11 14:13:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_GB' AND AD_Message_ID=53109
;
-- 2021-01-11T12:13:34.001Z
-- URL zum Konzept
UPDATE AD_Message_Trl SET MsgText='Der Code zum Zurücksetzen Ihres Passworts ist nicht mehr gültig.',Updated=TO_TIMESTAMP('2021-01-11 14:13:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='it_CH' AND AD_Message_ID=53109
;
-- 2021-01-11T12:13:38.212Z
-- URL zum Konzept
UPDATE AD_Message_Trl SET MsgText='Der Code zum Zurücksetzen Ihres Passworts ist nicht mehr gültig.',Updated=TO_TIMESTAMP('2021-01-11 14:13:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='fr_CH' AND AD_Message_ID=53109
;
-- 2021-01-11T13:55:00.472Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET IsTranslated='Y', MsgText='Something went wrong. The problem has been saved (system problem {0}) so that the metasfresh team can address it.',Updated=TO_TIMESTAMP('2021-01-11 15:55:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_US' AND AD_Message_ID=545020
;
-- 2021-01-11T13:55:17.111Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2021-01-11 15:55:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Message_ID=545020
;
-- 2021-01-12T07:25:07.628Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET MsgText='Username or email address invalid.',Updated=TO_TIMESTAMP('2021-01-12 09:25:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_US' AND AD_Message_ID=53110
;
-- 2021-01-12T07:25:23.354Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET MsgText='Username or email address invalid.',Updated=TO_TIMESTAMP('2021-01-12 09:25:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_GB' AND AD_Message_ID=53110
;
-- 2021-01-12T07:32:19.129Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2021-01-12 09:32:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_GB' AND AD_Message_ID=53110
;
-- 2021-01-12T07:32:23.938Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2021-01-12 09:32:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_US' AND AD_Message_ID=53110
;
-- 2021-01-12T07:39:06.676Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET MsgText='User or password is incorrect.',Updated=TO_TIMESTAMP('2021-01-12 09:39:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_US' AND AD_Message_ID=540131
;
-- 2021-01-12T07:39:14.967Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET MsgText='User or password is incorrect.',Updated=TO_TIMESTAMP('2021-01-12 09:39:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_GB' AND AD_Message_ID=540131
;
-- 2021-01-12T07:54:33.901Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2021-01-12 09:54:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_US' AND AD_Message_ID=540131
;
-- 2021-01-12T07:57:32.390Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET MsgText='User account is locked.',Updated=TO_TIMESTAMP('2021-01-12 09:57:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_US' AND AD_Message_ID=540115
;
-- 2021-01-12T07:57:36.590Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET MsgText='User account is locked.',Updated=TO_TIMESTAMP('2021-01-12 09:57:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='nl_NL' AND AD_Message_ID=540115
;
-- 2021-01-12T07:57:42.568Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2021-01-12 09:57:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Message_ID=540115
;
-- 2021-01-12T07:57:47.611Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2021-01-12 09:57:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_US' AND AD_Message_ID=540115
;
-- 2021-01-12T07:57:54.824Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET IsTranslated='Y', MsgText='User account is locked.',Updated=TO_TIMESTAMP('2021-01-12 09:57:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_GB' AND AD_Message_ID=540115
;
-- 2021-01-12T07:58:05.500Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET MsgText='User account is locked.',Updated=TO_TIMESTAMP('2021-01-12 09:58:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='it_CH' AND AD_Message_ID=540115
;
-- 2021-01-12T07:58:32.718Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message SET MsgText='Nutzer oder Passwort ist nicht korrekt.',Updated=TO_TIMESTAMP('2021-01-12 09:58:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=540131
;
-- 2021-01-12T07:58:41.345Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2021-01-12 09:58:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Message_ID=540131
;
-- 2021-01-12T08:00:55.918Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET MsgText='The code to reset your password is no longer valid.',Updated=TO_TIMESTAMP('2021-01-12 10:00:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_US' AND AD_Message_ID=53109
;
-- 2021-01-12T08:01:06.386Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2021-01-12 10:01:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Message_ID=53109
;
-- 2021-01-12T08:02:22.226Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2021-01-12 10:02:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Message_ID=53110
; | the_stack |
\set HIVE_SERVER `echo \'"$HIVE_SERVER"\'`
\set HIVE_CLIENT_TYPE `echo \'"$CLIENT_TYPE"\'`
\set HIVE_PORT `echo \'"$HIVE_PORT"\'`
\set HIVE_USER `echo \'"$HIVE_USER"\'`
\set HIVE_PASSWORD `echo \'"$HIVE_PASSWORD"\'`
\set AUTH_TYPE `echo \'"$AUTH_TYPE"\'`
\c contrib_regression
CREATE EXTENSION IF NOT EXISTS hdfs_fdw;
CREATE SERVER hdfs_server FOREIGN DATA WRAPPER hdfs_fdw
OPTIONS(host :HIVE_SERVER, port :HIVE_PORT, client_type :HIVE_CLIENT_TYPE, auth_type :AUTH_TYPE);
CREATE USER MAPPING FOR public SERVER hdfs_server
OPTIONS (username :HIVE_USER, password :HIVE_PASSWORD);
CREATE FOREIGN TABLE dept (
deptno INTEGER,
dname VARCHAR(14),
loc VARCHAR(13)
)
SERVER hdfs_server OPTIONS (dbname 'fdw_db', table_name 'dept');
CREATE FOREIGN TABLE emp (
empno INTEGER,
ename VARCHAR(10),
job VARCHAR(9),
mgr INTEGER,
hiredate pg_catalog.DATE,
sal INTEGER,
comm INTEGER,
deptno INTEGER
)
SERVER hdfs_server OPTIONS (dbname 'fdw_db', table_name 'emp');
-- Execute the query and the parameterized
-- WHERE clause will be pushed as shown here.
EXPLAIN (COSTS FALSE,VERBOSE TRUE) SELECT empno, ename, ea.deptno FROM emp ea
WHERE sal = (SELECT MAX(sal) FROM emp eb
WHERE eb.deptno = ea.deptno)
ORDER BY 1, 2, 3;
SELECT empno, ename, sal, deptno FROM emp e
WHERE sal > (SELECT AVG(sal) FROM emp
WHERE emp.deptno = e.deptno)
ORDER BY 1, 2, 3, 4;
EXPLAIN (COSTS FALSE,VERBOSE TRUE) SELECT empno, ename, sal, deptno FROM emp e
WHERE sal > (SELECT AVG(sal) FROM emp
WHERE emp.deptno = e.deptno)
ORDER BY 1, 2, 3, 4;
DROP FOREIGN TABLE emp;
-- Datatype verification with parameterized WHERE Clause.
-- INT2OID --> smallint
CREATE FOREIGN TABLE emp (
empno INTEGER,
ename VARCHAR(10),
job VARCHAR(9),
mgr INTEGER,
hiredate pg_catalog.DATE,
sal smallint,
comm INTEGER,
deptno INTEGER
)
SERVER hdfs_server OPTIONS (dbname 'fdw_db', table_name 'emp');
EXPLAIN (COSTS FALSE, VERBOSE TRUE) SELECT empno, ename, sal as "salary", deptno
FROM emp e
WHERE sal IN
(SELECT AVG(sal) FROM emp WHERE emp.sal = e.sal)
ORDER BY 1, 2, 3, 4;
EXPLAIN (COSTS FALSE, VERBOSE TRUE) SELECT empno, ename, sal as "salary", deptno
FROM emp e
WHERE sal NOT IN
(SELECT AVG(sal) FROM emp WHERE emp.sal = e.sal)
ORDER BY 1, 2, 3, 4;
EXPLAIN (COSTS FALSE, VERBOSE TRUE) SELECT empno, ename, sal as "salary", deptno
FROM emp e
WHERE sal >
(SELECT AVG(sal) FROM emp WHERE emp.sal = e.sal)
ORDER BY 1, 2, 3, 4;
DROP FOREIGN TABLE emp;
-- INT8OID --> bigint
CREATE FOREIGN TABLE emp (
empno INTEGER,
ename VARCHAR(10),
job VARCHAR(9),
mgr INTEGER,
hiredate pg_catalog.DATE,
sal bigint,
comm INTEGER,
deptno INTEGER
)
SERVER hdfs_server OPTIONS (dbname 'fdw_db', table_name 'emp');
EXPLAIN (COSTS FALSE, VERBOSE TRUE) SELECT empno, ename, sal as "salary", deptno
FROM emp e
WHERE sal IN
(SELECT AVG(sal) FROM emp WHERE emp.sal = e.sal)
ORDER BY 1, 2, 3, 4;
EXPLAIN (COSTS FALSE, VERBOSE TRUE) SELECT empno, ename, sal as "salary", deptno
FROM emp e
WHERE sal NOT IN
(SELECT AVG(sal) FROM emp WHERE emp.sal = e.sal)
ORDER BY 1, 2, 3, 4;
EXPLAIN (COSTS FALSE, VERBOSE TRUE) SELECT empno, ename, sal as "salary", deptno
FROM emp e
WHERE sal >
(SELECT AVG(sal) FROM emp WHERE emp.sal = e.sal)
ORDER BY 1, 2, 3, 4;
DROP FOREIGN TABLE emp;
-- FLOAT4OID --> real
CREATE FOREIGN TABLE emp (
empno INTEGER,
ename VARCHAR(10),
job VARCHAR(9),
mgr INTEGER,
hiredate pg_catalog.DATE,
sal real,
comm INTEGER,
deptno INTEGER
)
SERVER hdfs_server OPTIONS (dbname 'fdw_db', table_name 'emp');
EXPLAIN (COSTS FALSE, VERBOSE TRUE) SELECT empno, ename, sal as "salary", deptno
FROM emp e
WHERE sal IN
(SELECT AVG(sal) FROM emp WHERE emp.sal = e.sal)
ORDER BY 1, 2, 3, 4;
EXPLAIN (COSTS FALSE, VERBOSE TRUE) SELECT empno, ename, sal as "salary", deptno
FROM emp e
WHERE sal NOT IN
(SELECT AVG(sal) FROM emp WHERE emp.sal = e.sal)
ORDER BY 1, 2, 3, 4;
EXPLAIN (COSTS FALSE, VERBOSE TRUE) SELECT empno, ename, sal as "salary", deptno
FROM emp e
WHERE sal >
(SELECT AVG(sal) FROM emp WHERE emp.sal = e.sal)
ORDER BY 1, 2, 3, 4;
DROP FOREIGN TABLE emp;
-- FLOAT8OID --> double precision
CREATE FOREIGN TABLE emp (
empno INTEGER,
ename VARCHAR(10),
job VARCHAR(9),
mgr INTEGER,
hiredate pg_catalog.DATE,
sal double precision,
comm INTEGER,
deptno INTEGER
)
SERVER hdfs_server OPTIONS (dbname 'fdw_db', table_name 'emp');
EXPLAIN (COSTS FALSE,VERBOSE TRUE) SELECT empno, ename, sal as "salary", deptno
FROM emp e
WHERE sal IN
(SELECT AVG(sal) FROM emp WHERE emp.sal = e.sal)
ORDER BY 1, 2, 3, 4;
EXPLAIN (COSTS FALSE,VERBOSE TRUE) SELECT empno, ename, sal as "salary", deptno
FROM emp e
WHERE sal NOT IN
(SELECT AVG(sal) FROM emp WHERE emp.sal = e.sal)
ORDER BY 1, 2, 3, 4;
EXPLAIN (COSTS FALSE,VERBOSE TRUE) SELECT empno, ename, sal as "salary", deptno
FROM emp e
WHERE sal >
(SELECT AVG(sal) FROM emp WHERE emp.sal = e.sal)
ORDER BY 1, 2, 3, 4;
DROP FOREIGN TABLE emp;
-- VARCHAROID --> VARCHAR
CREATE FOREIGN TABLE emp (
empno INTEGER,
ename VARCHAR(10),
job VARCHAR(9),
mgr INTEGER,
hiredate pg_catalog.DATE,
sal VARCHAR(10),
comm INTEGER,
deptno VARCHAR(10)
)
SERVER hdfs_server OPTIONS (dbname 'fdw_db', table_name 'emp');
EXPLAIN (COSTS FALSE,VERBOSE TRUE) SELECT empno, ename, sal, deptno
FROM emp e
WHERE ename IN
(SELECT ename FROM emp WHERE emp.ename = e.ename)
ORDER BY 1, 2, 3, 4;
EXPLAIN (COSTS FALSE,VERBOSE TRUE) SELECT empno, ename, sal, deptno
FROM emp e
WHERE ename NOT IN
(SELECT ename FROM emp WHERE emp.ename = e.ename)
ORDER BY 1, 2, 3, 4;
DROP FOREIGN TABLE emp;
-- DATEOID --> DATE
CREATE FOREIGN TABLE emp (
empno INTEGER,
ename VARCHAR(10),
job VARCHAR(9),
mgr INTEGER,
hiredate pg_catalog.DATE,
sal VARCHAR(10),
comm INTEGER,
deptno INTEGER
)
SERVER hdfs_server OPTIONS (dbname 'fdw_db', table_name 'emp');
EXPLAIN (COSTS FALSE,VERBOSE TRUE) SELECT comm
FROM emp e
WHERE hiredate IN
(SELECT hiredate FROM emp WHERE emp.hiredate = e.hiredate)
ORDER BY comm;
EXPLAIN (COSTS FALSE,VERBOSE TRUE) SELECT comm
FROM emp e
WHERE hiredate NOT IN
(SELECT hiredate FROM emp WHERE emp.hiredate = e.hiredate)
ORDER BY comm;
DROP FOREIGN TABLE emp;
-- TIMESTAMPOID --> TIMESTAMP
CREATE FOREIGN TABLE emp (
empno INTEGER,
ename VARCHAR(10),
job VARCHAR(9),
mgr INTEGER,
hiredate pg_catalog.TIMESTAMP,
sal VARCHAR(10),
comm INTEGER,
deptno INTEGER
)
SERVER hdfs_server OPTIONS (dbname 'fdw_db', table_name 'emp2');
EXPLAIN (COSTS FALSE,VERBOSE TRUE) SELECT empno, ename, sal, deptno
FROM emp e
WHERE hiredate IN
(SELECT hiredate FROM emp WHERE emp.hiredate = e.hiredate)
ORDER BY 1, 2, 3, 4;
EXPLAIN (COSTS FALSE,VERBOSE TRUE) SELECT empno, ename, sal, deptno
FROM emp e
WHERE hiredate IN
(SELECT hiredate FROM emp WHERE emp.hiredate = e.hiredate)
ORDER BY 1, 2, 3, 4;
DROP FOREIGN TABLE emp;
-- TEXTOID --> TEXT
CREATE FOREIGN TABLE emp (
empno INTEGER,
ename VARCHAR(10),
job VARCHAR(9),
mgr INTEGER,
hiredate pg_catalog.DATE,
sal TEXT,
comm INTEGER,
deptno INTEGER
)
SERVER hdfs_server OPTIONS (dbname 'fdw_db', table_name 'emp');
EXPLAIN (COSTS FALSE,VERBOSE TRUE) SELECT empno, ename, sal, deptno
FROM emp e
WHERE sal IN
(SELECT sal FROM emp WHERE emp.sal = e.sal)
ORDER BY 1, 2, 3, 4;
EXPLAIN (COSTS FALSE,VERBOSE TRUE) SELECT empno, ename, sal, deptno
FROM emp e
WHERE sal NOT IN
(SELECT sal FROM emp WHERE emp.sal = e.sal)
ORDER BY 1, 2, 3, 4;
DROP FOREIGN TABLE emp;
-- BOOLOID --> BOOLEAN ************
CREATE FOREIGN TABLE bool_test (
bol1 BOOLEAN,
bol2 INT
)
SERVER hdfs_server OPTIONS (dbname 'fdw_db', table_name 'bool_test');
EXPLAIN (COSTS FALSE,VERBOSE TRUE) SELECT bol1, bol2
FROM bool_test b
WHERE bol1 IN
(SELECT bol1 FROM bool_test WHERE bool_test.bol1 = b.bol1)
ORDER BY 1, 2;
EXPLAIN (COSTS FALSE,VERBOSE TRUE) SELECT bol1, bol2
FROM bool_test b
WHERE bol1 IN
(SELECT bol1 FROM bool_test WHERE bool_test.bol1 = b.bol1)
ORDER BY 1, 2;
DROP FOREIGN TABLE bool_test;
-- JSONOID --> json
CREATE FOREIGN TABLE json_test (
bol1 json,
bol2 INTEGER
)
SERVER hdfs_server OPTIONS (dbname 'fdw_db', table_name 'bool_test');
-- Error will be displayed as JSON Not supported.
SELECT bol1 FROM json_test;
DROP FOREIGN TABLE json_test;
-- TIMEOID --> TIME
CREATE FOREIGN TABLE time_test (
col1 TIME
)
SERVER hdfs_server OPTIONS (dbname 'fdw_db', table_name 'var_date');
-- Plan will show column being pushed down
EXPLAIN (COSTS FALSE,VERBOSE TRUE) SELECT col1
FROM time_test b
WHERE col1 NOT IN (SELECT col1 FROM time_test WHERE time_test.col1 = b.col1)
ORDER BY col1;
-- Error will be displayed as TIME is not handled by JDBC Driver.
SELECT col1 FROM time_test b
WHERE col1 NOT IN (SELECT col1 FROM time_test WHERE time_test.col1 = b.col1)
ORDER BY col1;
DROP FOREIGN TABLE time_test;
-- NAMEOID --> NAME
CREATE FOREIGN TABLE name_test (
col1 NAME
)
SERVER hdfs_server OPTIONS (dbname 'fdw_db', table_name 'var_date');
-- Data will be returned and column will be pushed.
EXPLAIN (COSTS FALSE,VERBOSE TRUE) SELECT col1
FROM name_test b
WHERE col1 NOT IN
(SELECT col1 FROM name_test WHERE name_test.col1 = b.col1)
ORDER BY col1;
EXPLAIN (COSTS FALSE,VERBOSE TRUE) SELECT col1
FROM name_test b
WHERE col1 IN
(SELECT col1 FROM name_test WHERE name_test.col1 = b.col1)
ORDER BY col1;
DROP FOREIGN TABLE name_test;
-- BITOID --> BIT
CREATE FOREIGN TABLE bit_test (
col1 bit
)
SERVER hdfs_server OPTIONS (dbname 'fdw_db', table_name 'var_date');
-- Data will be returned and column will be pushed.
EXPLAIN (COSTS FALSE,VERBOSE TRUE) SELECT col1
FROM bit_test b
WHERE col1 NOT IN
(SELECT col1 FROM bit_test WHERE bit_test.col1 = b.col1)
ORDER BY col1;
EXPLAIN (COSTS FALSE,VERBOSE TRUE) SELECT col1
FROM bit_test b
WHERE col1 IN
(SELECT col1 FROM bit_test WHERE bit_test.col1 = b.col1)
ORDER BY col1;
DROP FOREIGN TABLE bit_test;
-- Verify that correct data is displayed.
CREATE FOREIGN TABLE emp (
empno INTEGER,
ename VARCHAR(10),
job VARCHAR(9),
mgr INTEGER,
hiredate pg_catalog.DATE,
sal VARCHAR(10),
comm INTEGER,
deptno INTEGER
)
SERVER hdfs_server OPTIONS (dbname 'fdw_db', table_name 'emp');
SELECT empno, ename, sal, deptno
FROM emp e
WHERE hiredate IN
(SELECT hiredate FROM emp WHERE emp.deptno < e.deptno OR emp.deptno > e.deptno)
ORDER BY 1, 2, 3, 4;
SELECT empno, ename, sal, deptno
FROM emp e
WHERE hiredate IN
(SELECT hiredate FROM emp WHERE emp.empno < e.empno OR emp.deptno > e.deptno)
ORDER BY 1, 2, 3, 4;
DROP FOREIGN TABLE emp;
DROP FOREIGN TABLE dept;
DROP USER MAPPING FOR public SERVER hdfs_server;
DROP SERVER hdfs_server;
DROP EXTENSION hdfs_fdw; | the_stack |
SET @sStorageEngine = (SELECT `value` FROM `sys_options` WHERE `name` = 'sys_storage_default');
-- TABLE: PROFILES
CREATE TABLE IF NOT EXISTS `bx_groups_data` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`author` int(10) unsigned NOT NULL,
`added` int(11) NOT NULL,
`changed` int(11) NOT NULL,
`picture` int(11) NOT NULL,
`cover` int(11) NOT NULL,
`group_name` varchar(255) NOT NULL,
`group_cat` int(11) NOT NULL,
`group_desc` text NOT NULL,
`views` int(11) NOT NULL default '0',
`rate` float NOT NULL default '0',
`votes` int(11) NOT NULL default '0',
`favorites` int(11) NOT NULL default '0',
`comments` int(11) NOT NULL default '0',
`reports` int(11) NOT NULL default '0',
`featured` int(11) NOT NULL default '0',
`join_confirmation` tinyint(4) NOT NULL DEFAULT '1',
`allow_view_to` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
FULLTEXT KEY `search_fields` (`group_name`, `group_desc`)
);
-- TABLE: STORAGES & TRANSCODERS
CREATE TABLE `bx_groups_pics` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`profile_id` int(10) unsigned NOT NULL,
`remote_id` varchar(128) NOT NULL,
`path` varchar(255) NOT NULL,
`file_name` varchar(255) NOT NULL,
`mime_type` varchar(128) NOT NULL,
`ext` varchar(32) NOT NULL,
`size` int(11) NOT NULL,
`added` int(11) NOT NULL,
`modified` int(11) NOT NULL,
`private` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `remote_id` (`remote_id`)
);
CREATE TABLE `bx_groups_pics_resized` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`profile_id` int(10) unsigned NOT NULL,
`remote_id` varchar(128) NOT NULL,
`path` varchar(255) NOT NULL,
`file_name` varchar(255) NOT NULL,
`mime_type` varchar(128) NOT NULL,
`ext` varchar(32) NOT NULL,
`size` int(11) NOT NULL,
`added` int(11) NOT NULL,
`modified` int(11) NOT NULL,
`private` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `remote_id` (`remote_id`)
);
-- TABLE: comments
CREATE TABLE IF NOT EXISTS `bx_groups_cmts` (
`cmt_id` int(11) NOT NULL AUTO_INCREMENT,
`cmt_parent_id` int(11) NOT NULL DEFAULT '0',
`cmt_vparent_id` int(11) NOT NULL DEFAULT '0',
`cmt_object_id` int(11) NOT NULL DEFAULT '0',
`cmt_author_id` int(10) unsigned NOT NULL DEFAULT '0',
`cmt_level` int(11) NOT NULL DEFAULT '0',
`cmt_text` text NOT NULL,
`cmt_mood` tinyint(4) NOT NULL DEFAULT '0',
`cmt_rate` int(11) NOT NULL DEFAULT '0',
`cmt_rate_count` int(11) NOT NULL DEFAULT '0',
`cmt_time` int(11) unsigned NOT NULL DEFAULT '0',
`cmt_replies` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`cmt_id`),
KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
FULLTEXT KEY `search_fields` (`cmt_text`)
);
-- TABLE: VIEWS
CREATE TABLE `bx_groups_views_track` (
`object_id` int(11) NOT NULL default '0',
`viewer_id` int(11) NOT NULL default '0',
`viewer_nip` int(11) unsigned NOT NULL default '0',
`date` int(11) NOT NULL default '0',
KEY `id` (`object_id`,`viewer_id`,`viewer_nip`)
);
-- TABLE: VOTES
CREATE TABLE IF NOT EXISTS `bx_groups_votes` (
`object_id` int(11) NOT NULL default '0',
`count` int(11) NOT NULL default '0',
`sum` int(11) NOT NULL default '0',
UNIQUE KEY `object_id` (`object_id`)
);
CREATE TABLE IF NOT EXISTS `bx_groups_votes_track` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`object_id` int(11) NOT NULL default '0',
`author_id` int(11) NOT NULL default '0',
`author_nip` int(11) unsigned NOT NULL default '0',
`value` tinyint(4) NOT NULL default '0',
`date` int(11) NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `vote` (`object_id`, `author_nip`)
);
-- TABLE: REPORTS
CREATE TABLE IF NOT EXISTS `bx_groups_reports` (
`object_id` int(11) NOT NULL default '0',
`count` int(11) NOT NULL default '0',
UNIQUE KEY `object_id` (`object_id`)
);
CREATE TABLE IF NOT EXISTS `bx_groups_reports_track` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`object_id` int(11) NOT NULL default '0',
`author_id` int(11) NOT NULL default '0',
`author_nip` int(11) unsigned NOT NULL default '0',
`type` varchar(32) NOT NULL default '',
`text` text NOT NULL default '',
`date` int(11) NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `report` (`object_id`, `author_nip`)
);
-- TABLE: metas
CREATE TABLE `bx_groups_meta_keywords` (
`object_id` int(10) unsigned NOT NULL,
`keyword` varchar(255) NOT NULL,
KEY `object_id` (`object_id`),
KEY `keyword` (`keyword`)
);
CREATE TABLE `bx_groups_meta_mentions` (
`object_id` int(10) unsigned NOT NULL,
`profile_id` int(10) unsigned NOT NULL,
KEY `object_id` (`object_id`),
KEY `profile_id` (`profile_id`)
);
-- TABLE: fans
CREATE TABLE IF NOT EXISTS `bx_groups_fans` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`initiator` int(11) NOT NULL,
`content` int(11) NOT NULL,
`mutual` tinyint(4) NOT NULL,
`added` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `initiator` (`initiator`,`content`),
KEY `content` (`content`)
);
-- TABLE: admins
CREATE TABLE IF NOT EXISTS `bx_groups_admins` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`group_profile_id` int(10) unsigned NOT NULL,
`fan_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `admin` (`group_profile_id`,`fan_id`)
);
-- TABLE: favorites
CREATE TABLE `bx_groups_favorites_track` (
`object_id` int(11) NOT NULL default '0',
`author_id` int(11) NOT NULL default '0',
`date` int(11) NOT NULL default '0',
KEY `id` (`object_id`,`author_id`)
);
-- STORAGES & TRANSCODERS
INSERT INTO `sys_objects_storage` (`object`, `engine`, `params`, `token_life`, `cache_control`, `levels`, `table_files`, `ext_mode`, `ext_allow`, `ext_deny`, `quota_size`, `current_size`, `quota_number`, `current_number`, `max_file_size`, `ts`) VALUES
('bx_groups_pics', @sStorageEngine, '', 360, 2592000, 3, 'bx_groups_pics', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0),
('bx_groups_pics_resized', @sStorageEngine, '', 360, 2592000, 3, 'bx_groups_pics_resized', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0);
INSERT INTO `sys_objects_transcoder` (`object`, `storage_object`, `source_type`, `source_params`, `private`, `atime_tracking`, `atime_pruning`, `ts`) VALUES
('bx_groups_icon', 'bx_groups_pics_resized', 'Storage', 'a:1:{s:6:"object";s:14:"bx_groups_pics";}', 'no', '1', '2592000', '0'),
('bx_groups_thumb', 'bx_groups_pics_resized', 'Storage', 'a:1:{s:6:"object";s:14:"bx_groups_pics";}', 'no', '1', '2592000', '0'),
('bx_groups_avatar', 'bx_groups_pics_resized', 'Storage', 'a:1:{s:6:"object";s:14:"bx_groups_pics";}', 'no', '1', '2592000', '0'),
('bx_groups_picture', 'bx_groups_pics_resized', 'Storage', 'a:1:{s:6:"object";s:14:"bx_groups_pics";}', 'no', '1', '2592000', '0'),
('bx_groups_cover', 'bx_groups_pics_resized', 'Storage', 'a:1:{s:6:"object";s:14:"bx_groups_pics";}', 'no', '1', '2592000', '0'),
('bx_groups_cover_thumb', 'bx_groups_pics_resized', 'Storage', 'a:1:{s:6:"object";s:14:"bx_groups_pics";}', 'no', '1', '2592000', '0'),
('bx_groups_gallery', 'bx_groups_pics_resized', 'Storage', 'a:1:{s:6:"object";s:14:"bx_groups_pics";}', 'no', '1', '2592000', '0');
INSERT INTO `sys_transcoder_filters` (`transcoder_object`, `filter`, `filter_params`, `order`) VALUES
('bx_groups_icon', 'Resize', 'a:3:{s:1:"w";s:2:"32";s:1:"h";s:2:"32";s:13:"square_resize";s:1:"1";}', '0'),
('bx_groups_thumb', 'Resize', 'a:3:{s:1:"w";s:2:"48";s:1:"h";s:2:"48";s:13:"square_resize";s:1:"1";}', '0'),
('bx_groups_avatar', 'Resize', 'a:3:{s:1:"w";s:2:"96";s:1:"h";s:2:"96";s:13:"square_resize";s:1:"1";}', '0'),
('bx_groups_picture', 'Resize', 'a:3:{s:1:"w";s:4:"1024";s:1:"h";s:4:"1024";s:13:"square_resize";s:1:"0";}', '0'),
('bx_groups_cover', 'Resize', 'a:1:{s:1:"w";s:4:"2000";}', '0'),
('bx_groups_cover_thumb', 'Resize', 'a:3:{s:1:"w";s:2:"48";s:1:"h";s:2:"48";s:13:"square_resize";s:1:"1";}', '0'),
('bx_groups_gallery', 'Resize', 'a:1:{s:1:"w";s:3:"500";}', '0');
-- FORMS
INSERT INTO `sys_objects_form`(`object`, `module`, `title`, `action`, `form_attrs`, `table`, `key`, `uri`, `uri_title`, `submit_name`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
('bx_group', 'bx_groups', '_bx_groups_form_profile', '', 'a:1:{s:7:\"enctype\";s:19:\"multipart/form-data\";}', 'bx_groups_data', 'id', '', '', 'do_submit', '', 0, 1, 'BxGroupsFormEntry', 'modules/boonex/groups/classes/BxGroupsFormEntry.php');
INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`, `title`) VALUES
('bx_group', 'bx_group_add', 'bx_groups', 0, '_bx_groups_form_profile_display_add'),
('bx_group', 'bx_group_delete', 'bx_groups', 0, '_bx_groups_form_profile_display_delete'),
('bx_group', 'bx_group_edit', 'bx_groups', 0, '_bx_groups_form_profile_display_edit'),
('bx_group', 'bx_group_edit_cover', 'bx_groups', 0, '_bx_groups_form_profile_display_edit_cover'),
('bx_group', 'bx_group_view', 'bx_groups', 1, '_bx_groups_form_profile_display_view'),
('bx_group', 'bx_group_view_full', 'bx_groups', 1, '_bx_groups_form_profile_display_view_full'),
('bx_group', 'bx_group_invite', 'bx_groups', 0, '_bx_groups_form_profile_display_invite');
INSERT INTO `sys_form_inputs`(`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES
('bx_group', 'bx_groups', 'allow_view_to', 3, '', 0, 'custom', '_bx_groups_form_profile_input_sys_allow_view_to', '_bx_groups_form_profile_input_allow_view_to', '_bx_groups_form_profile_input_allow_view_to_desc', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
('bx_group', 'bx_groups', 'delete_confirm', 1, '', 0, 'checkbox', '_bx_groups_form_profile_input_sys_delete_confirm', '_bx_groups_form_profile_input_delete_confirm', '_bx_groups_form_profile_input_delete_confirm_info', 1, 0, 0, '', '', '', 'avail', '', '_bx_groups_form_profile_input_delete_confirm_error', '', '', 1, 0),
('bx_group', 'bx_groups', 'do_submit', '_sys_form_account_input_submit', '', 0, 'submit', '_bx_groups_form_profile_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
('bx_group', 'bx_groups', 'group_desc', '', '', 0, 'textarea', '_bx_groups_form_profile_input_sys_group_desc', '_bx_groups_form_profile_input_group_desc', '', 0, 0, 2, '', '', '', '', '', '', 'XssHtml', '', 1, 1),
('bx_group', 'bx_groups', 'group_cat', '', '#!bx_groups_cats', 0, 'select', '_bx_groups_form_profile_input_sys_group_cat', '_bx_groups_form_profile_input_group_cat', '', 1, 0, 0, '', '', '', 'avail', '', '_bx_groups_form_profile_input_group_cat_err', 'Xss', '', 1, 1),
('bx_group', 'bx_groups', 'group_name', '', '', 0, 'text', '_bx_groups_form_profile_input_sys_group_name', '_bx_groups_form_profile_input_group_name', '', 1, 0, 0, '', '', '', 'avail', '', '_bx_groups_form_profile_input_group_name_err', 'Xss', '', 1, 0),
('bx_group', 'bx_groups', 'initial_members', '', '', 0, 'custom', '_bx_groups_form_profile_input_sys_initial_members', '_bx_groups_form_profile_input_initial_members', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 1),
('bx_group', 'bx_groups', 'join_confirmation', 1, '', 1, 'switcher', '_bx_groups_form_profile_input_sys_join_confirm', '_bx_groups_form_profile_input_join_confirm', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0),
('bx_group', 'bx_groups', 'cover', 'a:1:{i:0;s:20:"bx_groups_cover_crop";}', 'a:1:{s:20:"bx_groups_cover_crop";s:24:"_sys_uploader_crop_title";}', 0, 'files', '_bx_groups_form_profile_input_sys_cover', '_bx_groups_form_profile_input_cover', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
('bx_group', 'bx_groups', 'picture', 'a:1:{i:0;s:22:"bx_groups_picture_crop";}', 'a:1:{s:22:"bx_groups_picture_crop";s:24:"_sys_uploader_crop_title";}', 0, 'files', '_bx_groups_form_profile_input_sys_picture', '_bx_groups_form_profile_input_picture', '', 0, 0, 0, '', '', '', '', '', '_bx_groups_form_profile_input_picture_err', '', '', 1, 0);
INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
('bx_group_add', 'delete_confirm', 2147483647, 0, 3),
('bx_group_add', 'cover', 2147483647, 0, 4),
('bx_group_add', 'initial_members', 2147483647, 1, 5),
('bx_group_add', 'picture', 2147483647, 1, 6),
('bx_group_add', 'group_name', 2147483647, 1, 7),
('bx_group_add', 'group_cat', 2147483647, 1, 8),
('bx_group_add', 'group_desc', 2147483647, 1, 9),
('bx_group_add', 'join_confirmation', 2147483647, 1, 10),
('bx_group_add', 'allow_view_to', 2147483647, 1, 11),
('bx_group_add', 'do_submit', 2147483647, 1, 12),
('bx_group_invite', 'initial_members', 2147483647, 1, 1),
('bx_group_invite', 'do_submit', 2147483647, 1, 2),
('bx_group_delete', 'delete_confirm', 2147483647, 1, 0),
('bx_group_delete', 'cover', 2147483647, 0, 0),
('bx_group_delete', 'picture', 2147483647, 0, 0),
('bx_group_delete', 'do_submit', 2147483647, 1, 1),
('bx_group_delete', 'group_name', 2147483647, 0, 2),
('bx_group_delete', 'group_cat', 2147483647, 0, 3),
('bx_group_edit', 'delete_confirm', 2147483647, 0, 2),
('bx_group_edit', 'cover', 2147483647, 0, 3),
('bx_group_edit', 'picture', 2147483647, 1, 5),
('bx_group_edit', 'group_name', 2147483647, 1, 6),
('bx_group_edit', 'group_cat', 2147483647, 1, 7),
('bx_group_edit', 'group_desc', 2147483647, 1, 8),
('bx_group_edit', 'join_confirmation', 2147483647, 1, 9),
('bx_group_edit', 'allow_view_to', 2147483647, 1, 10),
('bx_group_edit', 'do_submit', 2147483647, 1, 11),
('bx_group_edit_cover', 'join_confirmation', 2147483647, 0, 0),
('bx_group_edit_cover', 'group_desc', 2147483647, 0, 0),
('bx_group_edit_cover', 'delete_confirm', 2147483647, 0, 1),
('bx_group_edit_cover', 'group_name', 2147483647, 0, 2),
('bx_group_edit_cover', 'picture', 2147483647, 0, 3),
('bx_group_edit_cover', 'group_cat', 2147483647, 0, 5),
('bx_group_edit_cover', 'cover', 2147483647, 1, 7),
('bx_group_edit_cover', 'do_submit', 2147483647, 1, 8),
('bx_group_view', 'delete_confirm', 2147483647, 0, 3),
('bx_group_view', 'picture', 2147483647, 0, 4),
('bx_group_view', 'cover', 2147483647, 0, 5),
('bx_group_view', 'do_submit', 2147483647, 0, 6),
('bx_group_view', 'group_name', 2147483647, 1, 7),
('bx_group_view', 'group_cat', 2147483647, 1, 8),
('bx_group_view', 'group_desc', 2147483647, 0, 9),
('bx_group_view_full', 'group_name', 2147483647, 1, 1),
('bx_group_view_full', 'group_cat', 2147483647, 1, 2),
('bx_group_view_full', 'group_desc', 2147483647, 1, 3);
-- PRE-VALUES
INSERT INTO `sys_form_pre_lists`(`key`, `title`, `module`, `use_for_sets`) VALUES
('bx_groups_cats', '_bx_groups_pre_lists_cats', 'bx_groups', '0');
INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `Order`, `LKey`, `LKey2`) VALUES
('bx_groups_cats', '', 0, '_sys_please_select', ''),
('bx_groups_cats', '1', 1, '_bx_groups_cat_General', ''),
('bx_groups_cats', '2', 2, '_bx_groups_cat_Business', ''),
('bx_groups_cats', '3', 3, '_bx_groups_cat_Interests', ''),
('bx_groups_cats', '4', 4, '_bx_groups_cat_Causes', ''),
('bx_groups_cats', '5', 5, '_bx_groups_cat_Fun', ''),
('bx_groups_cats', '6', 6, '_bx_groups_cat_Uncategorised', '');
-- CONTENT INFO
INSERT INTO `sys_objects_content_info` (`name`, `title`, `alert_unit`, `alert_action_add`, `alert_action_update`, `alert_action_delete`, `class_name`, `class_file`) VALUES
('bx_groups', '_bx_groups', 'bx_groups', 'added', 'edited', 'deleted', '', ''),
('bx_groups_cmts', '_bx_groups_cmts', 'bx_groups', 'commentPost', 'commentUpdated', 'commentRemoved', 'BxDolContentInfoCmts', '');
INSERT INTO `sys_content_info_grids` (`object`, `grid_object`, `grid_field_id`, `condition`, `selection`) VALUES
('bx_groups', 'bx_groups_administration', 'td`.`id', '', ''),
('bx_groups', 'bx_groups_common', 'td`.`id', '', '');
-- SEARCH EXTENDED
INSERT INTO `sys_objects_search_extended` (`object`, `object_content_info`, `module`, `title`, `active`, `class_name`, `class_file`) VALUES
('bx_groups', 'bx_groups', 'bx_groups', '_bx_groups_search_extended', 1, '', ''),
('bx_groups_cmts', 'bx_groups_cmts', 'bx_groups', '_bx_groups_search_extended_cmts', 1, 'BxTemplSearchExtendedCmts', '');
-- STUDIO PAGE & WIDGET
INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
(3, 'bx_groups', '_bx_groups', '_bx_groups', 'bx_groups@modules/boonex/groups/|std-icon.svg');
SET @iPageId = LAST_INSERT_ID();
SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
INSERT INTO `sys_std_widgets` (`page_id`, `module`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
(@iPageId, 'bx_groups', '{url_studio}module.php?name=bx_groups', '', 'bx_groups@modules/boonex/groups/|std-icon.svg', '_bx_groups', '', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_actions";s:6:"params";a:0:{}s:5:"class";s:18:"TemplStudioModules";}');
INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
(@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1)); | the_stack |
-----------------------------------------
-- Tables Used in this Section
-----------------------------------------
@@&&fc_table_loader. 'OCI360_USAGECOSTS_TAGGED_DAILY'
@@&&fc_table_loader. 'OCI360_USAGECOSTS'
@@&&fc_table_loader. 'OCI360_SERV_RESOURCES'
@@&&fc_table_loader. 'OCI360_ACCOUNTDETAILS'
-----------------------------------------
--- Get some Billing info before starting
@@&&fc_def_empty_var. oci360_billing_currency
@@&&fc_def_empty_var. oci360_billing_date_from
@@&&fc_def_empty_var. oci360_billing_date_to
@@&&fc_def_empty_var. oci360_billing_period
COL oci360_billing_currency NEW_V oci360_billing_currency NOPRI
SELECT distinct CURRENCY oci360_billing_currency
from OCI360_USAGECOSTS_TAGGED_DAILY;
COL oci360_billing_currency CLEAR
COL oci360_billing_date_from NEW_V oci360_billing_date_from NOPRI
COL oci360_billing_date_to NEW_V oci360_billing_date_to NOPRI
COL oci360_billing_period NEW_V oci360_billing_period NOPRI
SELECT TO_CHAR(min(TO_TIMESTAMP(ENDTIMEUTC,'&&oci360_tzcolformat.')),'YYYY-MM-DD') oci360_billing_date_from,
TO_CHAR(max(TO_TIMESTAMP(ENDTIMEUTC,'&&oci360_tzcolformat.')),'YYYY-MM-DD') oci360_billing_date_to,
EXTRACT(DAY FROM (max(TO_TIMESTAMP(ENDTIMEUTC,'&&oci360_tzcolformat.')) - min(TO_TIMESTAMP(ENDTIMEUTC,'&&oci360_tzcolformat.')))) oci360_billing_period
from OCI360_USAGECOSTS_TAGGED_DAILY;
COL oci360_billing_date_from CLEAR
COL oci360_billing_date_to CLEAR
COL oci360_billing_period CLEAR
DEF oci360_billing_between = ', between &&oci360_billing_date_from. and &&oci360_billing_date_to.'
-----------------------------------------
VAR sql_text_backup CLOB
BEGIN
:sql_text_backup := q'{
WITH t1 AS (
SELECT SUM(COSTS$COMPUTEDAMOUNT) COMPUTEDAMOUNT,
TO_TIMESTAMP(ENDTIMEUTC,'&&oci360_tzcolformat.') ENDTIMEUTC
FROM @main_table@
WHERE @filter_predicate@
GROUP BY TO_TIMESTAMP(ENDTIMEUTC,'&&oci360_tzcolformat.')
),
trange as (
select trunc(min(TO_TIMESTAMP(ENDTIMEUTC,'&&oci360_tzcolformat.')),'HH24') min,
trunc(max(TO_TIMESTAMP(ENDTIMEUTC,'&&oci360_tzcolformat.')),'HH24') max
FROM @main_table@
),
tcycle_account AS (
SELECT /*+ materialize */
TO_TIMESTAMP(PURCHASE$PURCHASEDRESOURCES$STARTDATE,'&&oci360_tzcolformat.') STARTDATE,
TO_TIMESTAMP(PURCHASE$PURCHASEDRESOURCES$ENDDATE,'&&oci360_tzcolformat.') ENDDATE
FROM OCI360_ACCOUNTDETAILS, trange
WHERE PURCHASE$ID is not null
AND PURCHASE$PURCHASEDRESOURCES$NAME = 'CLOUD_CREDIT_AMOUNT'
ORDER BY STARTDATE
),
tcycle_gaps AS (
SELECT CAST(ADD_MONTHS(LAST_START,ROWNUM) AS TIMESTAMP) STARTDATE,
CAST(ADD_MONTHS(LAST_END,ROWNUM) AS TIMESTAMP) ENDDATE
FROM (SELECT MAX(STARTDATE) LAST_START, MAX(ENDDATE) LAST_END, CEIL(MONTHS_BETWEEN(TRANGE.MAX,MAX(ENDDATE))) NUMMON FROM TCYCLE_ACCOUNT, TRANGE GROUP BY TRANGE.MAX)
WHERE NUMMON > 0
CONNECT BY LEVEL <= NUMMON),
tcycle AS (
SELECT STARTDATE, ENDDATE FROM TCYCLE_ACCOUNT
UNION ALL
SELECT STARTDATE, ENDDATE
FROM TCYCLE_GAPS
),
alldays as ( -- Will generate all days between Min and Max Start Time
SELECT trunc(trange.min,'DD') + (rownum - 1) vdate,
rownum seq
FROM trange
WHERE trange.min + (rownum - 1) <= trange.max - 1 -- Skip last entry as may be incomplete.
CONNECT BY LEVEL <= (trange.max - trange.min) + 1
)
select seq snap_id,
TO_CHAR(vdate, 'YYYY-MM-DD HH24:MI') begin_time,
TO_CHAR(vdate+1, 'YYYY-MM-DD HH24:MI') end_time,
TO_CHAR(NVL(CEIL(SUM(COMPUTEDAMOUNT)*100)/100,0),'99999990D00') line1,
0 dummy_02,
0 dummy_03,
0 dummy_04,
0 dummy_05,
0 dummy_06,
0 dummy_07,
0 dummy_08,
0 dummy_09,
0 dummy_10,
0 dummy_11,
0 dummy_12,
0 dummy_13,
0 dummy_14,
0 dummy_15
from t1, tcycle, alldays
WHERE vdate between tcycle.STARTDATE AND tcycle.ENDDATE -- For each hour frame I get the billing period range
AND t1.ENDTIMEUTC(+) >= tcycle.STARTDATE AND t1.ENDTIMEUTC(+) < vdate+1 -- The Billing end time must be inside the range until the computed hour
group by seq, vdate
order by seq
}';
END;
/
-----------------------------------------
@@&&oci360_list_subsec_start.
@@&&fc_def_output_file. oci360_loop_section 'oci360_5e_tag_section.sql'
@@&&fc_spool_start.
SPO &&oci360_loop_section.
SELECT 'DEF title = ''Tag: ' || TAG || '''' || CHR(10) ||
'DEF title_suffix = ''&&oci360_billing_between.''' || CHR(10) ||
'DEF main_table = ''OCI360_USAGECOSTS_TAGGED_DAILY''' || CHR(10) ||
'DEF vaxis = ''Cost (&&oci360_billing_currency.)''' || CHR(10) ||
'EXEC :sql_text := REPLACE(:sql_text_backup, ''@main_table@'', q''[OCI360_USAGECOSTS_TAGGED_DAILY]'');' || CHR(10) ||
'EXEC :sql_text := REPLACE(:sql_text, ''@filter_predicate@'', q''[TAG = ''' || TAG || ''']'');' || CHR(10) ||
'DEF tit_01 = ''Total Cost until this Day''' || CHR(10) ||
'DEF chartype = ''AreaChart''' || CHR(10) ||
'DEF skip_lch = ''''' || CHR(10) ||
'@@&&9a_pre_one.'
FROM ( SELECT DISTINCT t1.TAG
FROM OCI360_USAGECOSTS_TAGGED_DAILY t1
WHERE EXISTS (SELECT 1 FROM OCI360_USAGECOSTS_TAGGED_DAILY t3 WHERE t3.TAG = t1.TAG HAVING SUM(COSTS$COMPUTEDAMOUNT) > 0)
AND t1.TAG not like 'ORCL:%'
ORDER BY t1.TAG);
SPO OFF
@@&&fc_spool_end.
@@&&oci360_loop_section.
@@&&fc_zip_driver_files. &&oci360_loop_section.
UNDEF oci360_loop_section
DEF title = 'Custom Tags - Total Costs'
@@&&oci360_list_subsec_stop.
-----------------------------------------
@@&&oci360_list_subsec_start.
@@&&fc_def_output_file. oci360_loop_section 'oci360_5e_comp_section.sql'
@@&&fc_spool_start.
SPO &&oci360_loop_section.
SELECT 'DEF title = ''Compartment: ' || TAG || '''' || CHR(10) ||
'DEF title_suffix = ''&&oci360_billing_between.''' || CHR(10) ||
'DEF main_table = ''OCI360_USAGECOSTS_TAGGED_DAILY''' || CHR(10) ||
'DEF vaxis = ''Cost (&&oci360_billing_currency.)''' || CHR(10) ||
'EXEC :sql_text := REPLACE(:sql_text_backup, ''@main_table@'', q''[OCI360_USAGECOSTS_TAGGED_DAILY]'');' || CHR(10) ||
'EXEC :sql_text := REPLACE(:sql_text, ''@filter_predicate@'', q''[TAG = ''' || TAG || ''']'');' || CHR(10) ||
'DEF tit_01 = ''Total Cost until this Day''' || CHR(10) ||
'DEF chartype = ''AreaChart''' || CHR(10) ||
'DEF skip_lch = ''''' || CHR(10) ||
'@@&&9a_pre_one.'
FROM ( SELECT DISTINCT t1.TAG
FROM OCI360_USAGECOSTS_TAGGED_DAILY t1
WHERE EXISTS (SELECT 1 FROM OCI360_USAGECOSTS_TAGGED_DAILY t3 WHERE t3.TAG = t1.TAG HAVING SUM(COSTS$COMPUTEDAMOUNT) > 0)
AND t1.TAG like 'ORCL:OCICompartmentPath=%'
ORDER BY t1.TAG);
SPO OFF
@@&&fc_spool_end.
@@&&oci360_loop_section.
@@&&fc_zip_driver_files. &&oci360_loop_section.
UNDEF oci360_loop_section
DEF title = 'Compartments - Total Costs'
@@&&oci360_list_subsec_stop.
-----------------------------------------
@@&&oci360_list_subsec_start.
@@&&fc_def_output_file. oci360_loop_section 'oci360_5e_srvgrp_section.sql'
@@&&fc_spool_start.
SPO &&oci360_loop_section.
SELECT 'DEF title = ''Service Group: ' || TAG || '''' || CHR(10) ||
'DEF title_suffix = ''&&oci360_billing_between.''' || CHR(10) ||
'DEF main_table = ''OCI360_USAGECOSTS_TAGGED_DAILY''' || CHR(10) ||
'DEF vaxis = ''Cost (&&oci360_billing_currency.)''' || CHR(10) ||
'EXEC :sql_text := REPLACE(:sql_text_backup, ''@main_table@'', q''[OCI360_USAGECOSTS_TAGGED_DAILY]'');' || CHR(10) ||
'EXEC :sql_text := REPLACE(:sql_text, ''@filter_predicate@'', q''[TAG = ''' || TAG || ''']'');' || CHR(10) ||
'DEF tit_01 = ''Total Cost until this Day''' || CHR(10) ||
'DEF chartype = ''AreaChart''' || CHR(10) ||
'DEF skip_lch = ''''' || CHR(10) ||
'@@&&9a_pre_one.'
FROM ( SELECT DISTINCT t1.TAG
FROM OCI360_USAGECOSTS_TAGGED_DAILY t1
WHERE EXISTS (SELECT 1 FROM OCI360_USAGECOSTS_TAGGED_DAILY t3 WHERE t3.TAG = t1.TAG HAVING SUM(COSTS$COMPUTEDAMOUNT) > 0)
AND t1.TAG like 'ORCL:OCIService=%'
ORDER BY t1.TAG);
SPO OFF
@@&&fc_spool_end.
@@&&oci360_loop_section.
@@&&fc_zip_driver_files. &&oci360_loop_section.
UNDEF oci360_loop_section
DEF title = 'Service Groups - Total Costs'
@@&&oci360_list_subsec_stop.
-----------------------------------------
@@&&oci360_list_subsec_start.
@@&&fc_def_output_file. oci360_loop_section 'oci360_5e_srv_section.sql'
@@&&fc_spool_start.
SPO &&oci360_loop_section.
SELECT 'DEF title = ''Service Name: ' || SERVICENAME || '''' || CHR(10) ||
'DEF title_suffix = ''&&oci360_billing_between.''' || CHR(10) ||
'DEF main_table = ''OCI360_USAGECOSTS''' || CHR(10) ||
'DEF vaxis = ''Cost (&&oci360_billing_currency.)''' || CHR(10) ||
'EXEC :sql_text := REPLACE(:sql_text_backup, ''@main_table@'', q''[OCI360_USAGECOSTS]'');' || CHR(10) ||
'EXEC :sql_text := REPLACE(:sql_text, ''@filter_predicate@'', q''[SERVICENAME = ''' || SERVICENAME || ''']'');' || CHR(10) ||
'DEF tit_01 = ''Total Cost until this Day''' || CHR(10) ||
'DEF chartype = ''AreaChart''' || CHR(10) ||
'DEF skip_lch = ''''' || CHR(10) ||
'@@&&9a_pre_one.'
FROM ( SELECT DISTINCT t1.SERVICENAME
FROM OCI360_USAGECOSTS t1
WHERE EXISTS (SELECT 1 FROM OCI360_USAGECOSTS t3 WHERE t3.SERVICENAME = t1.SERVICENAME HAVING SUM(COSTS$COMPUTEDAMOUNT) > 0)
ORDER BY t1.SERVICENAME);
SPO OFF
@@&&fc_spool_end.
@@&&oci360_loop_section.
@@&&fc_zip_driver_files. &&oci360_loop_section.
UNDEF oci360_loop_section
DEF title = 'Services - Total Costs'
@@&&oci360_list_subsec_stop.
-----------------------------------------
@@&&oci360_list_subsec_start.
@@&&fc_def_output_file. oci360_loop_section 'oci360_5e_rsr_section.sql'
@@&&fc_spool_start.
SPO &&oci360_loop_section.
SELECT 'DEF title = ''Resource: ' || NVL(DISPLAYNAME,RESOURCENAME) || '''' || CHR(10) ||
'DEF title_suffix = ''&&oci360_billing_between.''' || CHR(10) ||
'DEF main_table = ''OCI360_USAGECOSTS''' || CHR(10) ||
'DEF vaxis = ''Cost (&&oci360_billing_currency.)''' || CHR(10) ||
'EXEC :sql_text := REPLACE(:sql_text_backup, ''@main_table@'', q''[OCI360_USAGECOSTS]'');' || CHR(10) ||
'EXEC :sql_text := REPLACE(:sql_text, ''@filter_predicate@'', q''[RESOURCENAME = ''' || RESOURCENAME || ''']'');' || CHR(10) ||
'DEF tit_01 = ''Total Cost until this Day''' || CHR(10) ||
'DEF chartype = ''AreaChart''' || CHR(10) ||
'DEF skip_lch = ''''' || CHR(10) ||
'@@&&9a_pre_one.'
FROM ( SELECT DISTINCT t1.RESOURCENAME, t2.DISPLAYNAME
FROM OCI360_USAGECOSTS t1, OCI360_SERV_RESOURCES t2
WHERE t1.RESOURCENAME = t2.NAME
AND EXISTS (SELECT 1 FROM OCI360_USAGECOSTS t3 WHERE t3.RESOURCENAME = t1.RESOURCENAME HAVING SUM(COSTS$COMPUTEDAMOUNT) > 0)
ORDER BY t1.RESOURCENAME);
SPO OFF
@@&&fc_spool_end.
@@&&oci360_loop_section.
@@&&fc_zip_driver_files. &&oci360_loop_section.
UNDEF oci360_loop_section
DEF title = 'Resources - Total Costs'
@@&&oci360_list_subsec_stop.
-----------------------------------------
DEF title = 'Total per cycle'
DEF title_suffix = '&&oci360_billing_between.'
DEF main_table = 'OCI360_USAGECOSTS'
DEF vaxis = 'Cost (&&oci360_billing_currency.)'
EXEC :sql_text := REPLACE(:sql_text_backup, '@main_table@', q'[OCI360_USAGECOSTS]');
EXEC :sql_text := REPLACE(:sql_text, '@filter_predicate@', q'[1 = 1]');
DEF tit_01 = 'Total Cost until this Day'
DEF chartype = 'AreaChart'
DEF skip_lch = ''
@@&&9a_pre_one.
-----------------------------------------
UNDEF oci360_billing_currency oci360_billing_date_from oci360_billing_date_to oci360_billing_period
UNDEF oci360_billing_between | the_stack |
-- 2017-06-10T03:24:29.169
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process (AccessLevel,AD_Client_ID,AD_Org_ID,AD_Process_ID,AllowProcessReRun,Classname,CopyFromProcess,Created,CreatedBy,EntityType,IsActive,IsApplySecuritySettings,IsBetaFunctionality,IsDirectPrint,IsOneInstanceOnly,IsReport,IsServerProcess,IsUseBPartnerLanguage,LockWaitTimeout,Name,RefreshAllAfterExecution,ShowHelp,Type,Updated,UpdatedBy,Value) VALUES ('7',0,0,540798,'N','org.adempiere.user.process.AD_User_ChangeMyPassword','N',TO_TIMESTAMP('2017-06-10 03:24:29','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N','N','N','N','N','N','Y',0,'Change my password','N','Y','Java',TO_TIMESTAMP('2017-06-10 03:24:29','YYYY-MM-DD HH24:MI:SS'),100,'AD_User_ChangeMyPassword')
;
-- 2017-06-10T03:24:29.178
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Trl (AD_Language,AD_Process_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_ID=540798 AND NOT EXISTS (SELECT * FROM AD_Process_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_ID=t.AD_Process_ID)
;
-- 2017-06-10T03:25:08.869
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,2571,0,540798,541184,10,'OldPassword',TO_TIMESTAMP('2017-06-10 03:25:08','YYYY-MM-DD HH24:MI:SS'),100,'Das alte Passwort wird benötigt, wenn Sie kein Systemadministrator sind.','D',0,'Y','N','Y','N','Y','N','Altes Passwort',10,TO_TIMESTAMP('2017-06-10 03:25:08','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-06-10T03:25:08.877
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=541184 AND NOT EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 2017-06-10T03:25:35.335
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,2570,0,540798,541185,10,'NewPassword',TO_TIMESTAMP('2017-06-10 03:25:35','YYYY-MM-DD HH24:MI:SS'),100,'Geben Sie das neue Passwort ein - keine Änderung wenn leer!','U',0,'Y','N','Y','N','Y','N','Neues Passwort',20,TO_TIMESTAMP('2017-06-10 03:25:35','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-06-10T03:25:35.342
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=541185 AND NOT EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 2017-06-10T03:25:39.858
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET EntityType='D',Updated=TO_TIMESTAMP('2017-06-10 03:25:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541185
;
-- 2017-06-10T03:26:21.515
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,543364,0,'NewPasswordRetype',TO_TIMESTAMP('2017-06-10 03:26:21','YYYY-MM-DD HH24:MI:SS'),100,'','D','Y','Neues Passwort (retype)','Neues Passwort (retype)',TO_TIMESTAMP('2017-06-10 03:26:21','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-06-10T03:26:21.525
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=543364 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 2017-06-10T03:27:20.241
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-06-10 03:27:20','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='New Password (retype)',PrintName='New Password (retype)' WHERE AD_Element_ID=543364 AND AD_Language='en_US'
;
-- 2017-06-10T03:27:24.388
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(543364,'en_US')
;
-- 2017-06-10T03:28:21.671
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,543364,0,540798,541186,10,'NewPasswordRetype',TO_TIMESTAMP('2017-06-10 03:28:21','YYYY-MM-DD HH24:MI:SS'),100,'D',0,'Y','N','Y','N','Y','N','Neues Passwort (retype)',30,TO_TIMESTAMP('2017-06-10 03:28:21','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-06-10T03:28:21.675
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=541186 AND NOT EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 2017-06-10T03:28:58.823
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Table_Process (AD_Client_ID,AD_Org_ID,AD_Process_ID,AD_Table_ID,Created,CreatedBy,EntityType,IsActive,Updated,UpdatedBy,WEBUI_QuickAction,WEBUI_QuickAction_Default) VALUES (0,0,540798,114,TO_TIMESTAMP('2017-06-10 03:28:58','YYYY-MM-DD HH24:MI:SS'),100,'D','Y',TO_TIMESTAMP('2017-06-10 03:28:58','YYYY-MM-DD HH24:MI:SS'),100,'N','N')
;
-- 2017-06-10T03:48:51.771
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,544334,0,TO_TIMESTAMP('2017-06-10 03:48:51','YYYY-MM-DD HH24:MI:SS'),0,'U','Y','NewPasswordNoMatch','I',TO_TIMESTAMP('2017-06-10 03:48:51','YYYY-MM-DD HH24:MI:SS'),0,'NewPasswordNoMatch')
;
-- 2017-06-10T03:48:51.795
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=544334 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
;
-- 2017-06-10T03:51:47.554
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message SET EntityType='D', MsgText='New password and retyped password not match', MsgType='E',Updated=TO_TIMESTAMP('2017-06-10 03:51:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=544334
;
-- 2017-06-10T03:51:47.560
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET IsTranslated='N' WHERE AD_Message_ID=544334
;
-- 2017-06-10T03:52:01.684
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-06-10 03:52:01','YYYY-MM-DD HH24:MI:SS'),MsgText='New password and retyped password not match' WHERE AD_Message_ID=544334 AND AD_Language='de_CH'
;
-- 2017-06-10T03:52:04.819
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-06-10 03:52:04','YYYY-MM-DD HH24:MI:SS'),MsgText='New password and retyped password not match' WHERE AD_Message_ID=544334 AND AD_Language='en_US'
;
-- 2017-06-10T03:52:09.666
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-06-10 03:52:09','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Message_ID=544334 AND AD_Language='en_US'
;
-- 2017-06-10T03:52:13.535
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-06-10 03:52:13','YYYY-MM-DD HH24:MI:SS'),MsgText='New password and retyped password not match' WHERE AD_Message_ID=544334 AND AD_Language='nl_NL'
;
-- 2017-06-10T12:23:35.700
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process SET Name='Mein Passwort ändern',Updated=TO_TIMESTAMP('2017-06-10 12:23:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=540798
;
-- 2017-06-10T12:23:35.718
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Trl SET IsTranslated='N' WHERE AD_Process_ID=540798
;
-- 2017-06-10T12:23:41.148
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-06-10 12:23:41','YYYY-MM-DD HH24:MI:SS'),Name='Mein Passwort ändern' WHERE AD_Process_ID=540798 AND AD_Language='de_CH'
;
-- 2017-06-10T12:23:53.173
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-06-10 12:23:53','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Process_ID=540798 AND AD_Language='de_CH'
; | the_stack |
-- for each managed table, this will contain an entry specifying when the table was added to pg_recall and the amount of time outdated log entries are kept
CREATE TABLE _config (
tblid REGCLASS NOT NULL PRIMARY KEY,
ts TIMESTAMPTZ NOT NULL DEFAULT NOW(),
log_interval INTERVAL,
last_cleanup TIMESTAMPTZ,
pkey_cols name[] NOT NULL,
tpl_table REGCLASS NOT NULL,
log_table REGCLASS NOT NULL
);
-- define it as config table (to include its data in pg_dump)
SELECT pg_catalog.pg_extension_config_dump('_config', '');
--
-- helper functions (and views)
--
CREATE VIEW @extschema@._tablemapping AS
SELECT t.oid AS id, n.nspname AS schema, t.relname AS name
FROM pg_class t INNER JOIN pg_namespace n ON (t.relnamespace = n.oid);
--
-- installer function
--
CREATE FUNCTION enable(tbl REGCLASS, logInterval INTERVAL, tgtSchema NAME) RETURNS VOID AS $$
DECLARE
pkeyCols NAME[];
overlapPkeys TEXT[]; -- list of pkey checks (in the form of 'colName WITH =') to be used in the EXCLUDE constraint of the log table
cols TEXT[];
k NAME;
tblSchema NAME; tblName NAME;
prefix NAME;
tplTable REGCLASS;
logTable REGCLASS;
BEGIN
-- get the schema and local table name for tbl (and construct tplTable and logTable from them)
SELECT schema, name INTO tblSchema, tblName FROM @extschema@._tablemapping WHERE id = tbl;
IF tblSchema = 'public' OR tblSchema = tgtSchema THEN
prefix := tblName;
ELSE
prefix := tblSchema||'__'||tblName;
END IF;
-- fetch the table's primary key columns (source: https://wiki.postgresql.org/wiki/Retrieve_primary_key_columns )
SELECT ARRAY(
SELECT a.attname INTO pkeyCols FROM pg_index i JOIN pg_attribute a ON (a.attrelid = i.indrelid AND a.attnum = ANY(i.indkey))
WHERE i.indrelid = tbl AND i.indisprimary
);
IF COALESCE(array_ndims(pkeyCols), 0) < 1 THEN
RAISE EXCEPTION 'You need a primary key on your table if you want to use pg_recall (table: %)!', tbl;
END IF;
-- update existing entry if exists (and return in that case)
UPDATE @extschema@._config SET log_interval = logInterval, pkey_cols = pkeyCols, last_cleanup = NULL WHERE tblid = tbl;
IF FOUND THEN
RAISE NOTICE '@extschema@.enable(%, %) called on an already managed table. Updating log_interval and pkey_cols, clearing last_cleanup', tbl, logInterval;
RETURN;
END IF;
-- init overlapPkeys
FOREACH k IN ARRAY pkeyCols
LOOP
overlapPkeys = array_append(overlapPkeys, format('%I WITH =', k));
END LOOP;
-- create the _tpl table (without constraints)
EXECUTE format('CREATE TABLE %I.%I (LIKE %s)', tgtSchema, prefix||'_tpl', tbl);
tplTable := format('%I.%I', tgtSchema, prefix||'_tpl');
-- create the _log table
EXECUTE format('CREATE TABLE %I.%I (
_log_time TSTZRANGE NOT NULL DEFAULT tstzrange(now(), NULL),
EXCLUDE USING gist (%s, _log_time WITH &&),
CHECK (NOT isempty(_log_time))
) INHERITS (%s)',
tgtSchema, prefix||'_log',
array_to_string(overlapPkeys, ', '),
tplTable
);
logTable := format('%I.%I', tgtSchema, prefix||'_log');
-- make the _tpl table the parent of the data table
EXECUTE format('ALTER TABLE %s INHERIT %s', tbl, tplTable);
-- set the trigger
EXECUTE format('CREATE TRIGGER trig_recall AFTER INSERT OR UPDATE OR DELETE ON %s
FOR EACH ROW EXECUTE PROCEDURE @extschema@._trigfn()', tbl);
-- add config table entry
INSERT INTO @extschema@._config (tblid, log_interval, pkey_cols, tpl_table, log_table) VALUES (tbl, logInterval, pkeyCols, tplTable, logTable);
-- get list of columns and insert current database state into the log table
SELECT ARRAY(
SELECT format('%I', attname) INTO cols FROM pg_attribute WHERE attrelid = tplTable AND attnum > 0 AND attisdropped = false
);
EXECUTE format('INSERT INTO %s (%s, _log_time) SELECT %s, tstzrange(null,null) FROM %s',
logTable,
array_to_string(cols, ', '),
array_to_string(cols, ', '),
tbl);
END;
$$ LANGUAGE plpgsql;
CREATE FUNCTION enable(tbl REGCLASS, logInterval INTERVAL) RETURNS VOID AS $$
BEGIN
PERFORM @extschema@.enable(tbl, logInterval, '@extschema@');
END;
$$ LANGUAGE plpgsql;
--
-- uninstaller function
--
CREATE FUNCTION disable(tbl REGCLASS) RETURNS VOID AS $$
DECLARE
tplTable REGCLASS;
logTable REGCLASS;
BEGIN
-- remove config table entry (and raise an exception if there was none)
DELETE FROM @extschema@._config WHERE tblid = tbl RETURNING tpl_table, log_table INTO tplTable, logTable;
IF NOT FOUND THEN
RAISE EXCEPTION 'The table "%" is not managed by pg_recall', tbl;
END IF;
-- drop temp view created by @extschema@.at (if it exists)
EXECUTE format('DROP VIEW IF EXISTS %I', tbl||'_past');
-- remove inheritance
EXECUTE format('ALTER TABLE %s NO INHERIT %s', tbl, tplTable);
-- drop extra tables
EXECUTE format('DROP TABLE %s', logTable);
EXECUTE format('DROP TABLE %s', tplTable);
-- delete trigger
EXECUTE format('DROP TRIGGER trig_recall ON %I', tbl);
END;
$$ LANGUAGE plpgsql;
--
-- Trigger function
--
CREATE FUNCTION _trigfn() RETURNS TRIGGER AS $$
DECLARE
tplTable REGCLASS;
logTable REGCLASS;
pkeyCols TEXT[];
pkeyChecks TEXT[]; -- array of 'colName = $1.colName' strings
assignments TEXT[]; -- array of 'colname = $2.colName' strings (for the UPDATE statement)
cols TEXT[]; -- will be filled with escaped column names (in the same order as the vals below)
vals TEXT[]; -- will contain the equivalent of NEW.<colName> for each of the columns in the _tpl table
col TEXT; -- loop variable
rowCount INTEGER;
startTs TIMESTAMPTZ; -- contains the timestamp that marks the end of the old as well as the start of the new log entry; will be now() if possible or clock_timestamp() if newer log entries already exist (see #19)
BEGIN
startTs := now();
if TG_OP = 'UPDATE' AND OLD = NEW THEN
RAISE INFO 'pg_recall: row unchanged, no need to write to log';
RETURN NEW;
END IF;
-- Fetch the table's config
SELECT pkey_cols, tpl_table, log_table INTO pkeyCols, tplTable, logTable FROM @extschema@._config WHERE tblid = TG_RELID;
IF TG_OP IN ('UPDATE', 'DELETE') THEN
-- build WHERE clauses in the form of 'pkeyCol = OLD.pkeyCol' for each of the primary key columns
-- (they will later be joined with ' AND ' inbetween)
FOREACH col IN ARRAY pkeyCols
LOOP
pkeyChecks = array_append(pkeyChecks, format('%I = $1.%I', col, col));
END LOOP;
-- mark old log entries as outdated
EXECUTE format('UPDATE %s SET _log_time = tstzrange(LOWER(_log_time), now()) WHERE %s AND upper_inf(_log_time) AND LOWER(_log_time) < now()',
logTable, array_to_string(pkeyChecks, ' AND ')) USING OLD;
GET DIAGNOSTICS rowCount = ROW_COUNT;
IF rowCount = 0 THEN
-- in rare cases LOWER(_log_time) of existing entries is greater than this transaction's now() (see #19)
-- That's why I've added the less-than check above. If no entries have been updated above, run the same statement again but use clock_timestamp() instead of now()
-- special case: LOWER(_log_time) = now(), which indicates multiple updates within the same transaction. In that case we don't want an update here (hence the > in the above and the < in the below statement)
startTs := clock_timestamp();
EXECUTE format('UPDATE %s SET _log_time = tstzrange(LOWER(_log_time), $2) WHERE %s AND upper_inf(_log_time) AND LOWER(_log_time) > now()',
logTable, array_to_string(pkeyChecks, ' AND ')) USING OLD, startTs;
GET DIAGNOSTICS rowCount = ROW_COUNT;
IF rowCount = 0 THEN
-- ok, false alarm. no need to use clock_timestamp() for this log entry. Revert back to now()
startTs := now();
END IF;
END IF;
END IF;
IF TG_OP IN ('INSERT', 'UPDATE') THEN
-- get all columns of the _tpl table and put them into the cols and vals arrays
-- (source: http://dba.stackexchange.com/a/22420/85760 )
FOR col IN SELECT attname FROM pg_attribute WHERE attrelid = tplTable AND attnum > 0 AND attisdropped = false
LOOP
-- for the INSERT
cols = array_append(cols, format('%I', col));
vals = array_append(vals, format('$1.%I', col));
-- for the UPDATE
assignments = array_append(assignments, format('%I = $2.%I', col, col));
END LOOP;
rowCount := 0;
IF TG_OP = 'UPDATE' THEN
-- We might already have created a log entry for the current transaction. In that case, update the existing one (see #16)
EXECUTE format('UPDATE %s SET %s WHERE %s AND LOWER(_log_time) = now()',
logTable,
array_to_string(assignments, ', '),
array_to_string(pkeyChecks, ' AND ')
) USING OLD, NEW;
GET DIAGNOSTICS rowCount = ROW_COUNT;
END IF;
IF rowCount = 0 THEN
-- create the log entry (as there was nothing to update)
EXECUTE format('INSERT INTO %s (%s, _log_time) VALUES (%s, tstzrange($2,NULL))',
logTable,
array_to_string(cols, ', '),
array_to_string(vals, ', ')
) USING NEW, startTs;
END IF;
END IF;
RETURN new;
END;
$$ LANGUAGE plpgsql;
--
-- Cleanup functions (return the number of deleted rows)
--
CREATE FUNCTION cleanup(tbl REGCLASS) RETURNS INTEGER AS $$
DECLARE
logInterval INTERVAL;
rc INTEGER;
logTable REGCLASS;
BEGIN
-- get the log table and interval (and update last_cleanup while we're at it)
UPDATE @extschema@._config SET last_cleanup = now() WHERE tblId = tbl RETURNING log_interval, log_table INTO logInterval, logTable;
RAISE NOTICE 'recall: Cleaning up table %', tbl;
-- Remove old entries
EXECUTE format('DELETE FROM %s WHERE UPPER(_log_time) < now() - $1', logTable) USING logInterval;
GET DIAGNOSTICS rc = ROW_COUNT;
RETURN rc;
END;
$$ LANGUAGE plpgsql;
-- convenience cleanup function
CREATE FUNCTION cleanup_all() RETURNS VOID AS $$
DECLARE
tbl REGCLASS;
BEGIN
FOR tbl in SELECT tblid FROM @extschema@._config
LOOP
PERFORM @extschema@.cleanup(tbl);
END LOOP;
END;
$$ LANGUAGE plpgsql;
--
-- Query past state
--
CREATE FUNCTION at(tbl REGCLASS, ts TIMESTAMPTZ) RETURNS REGCLASS AS $$
DECLARE
tblName TEXT;
tplTable REGCLASS;
logTable REGCLASS;
viewName NAME;
cols TEXT[]; -- escaped list
BEGIN
-- initialize vars
SELECT tpl_table, log_table INTO tplTable, logTable FROM @extschema@._config WHERE tblid = tbl;
SELECT name INTO tblName FROM @extschema@._tablemapping WHERE id = tbl;
viewName := tblName||'_past';
-- get (escaped) list of columns
SELECT ARRAY(
SELECT format('%I', attname) INTO cols FROM pg_attribute WHERE attrelid = tplTable AND attnum > 0 AND attisdropped = false
);
EXECUTE format('CREATE OR REPLACE TEMPORARY VIEW %I AS SELECT %s FROM %s WHERE _log_time @> %L::timestamptz',
viewName,
array_to_string(cols, ', '),
logTable,
ts
);
return viewName;
END;
$$ LANGUAGE plpgsql; | the_stack |
set enable_global_stats = true;
/*
* This file is used to test the function of ExecVecSetOp
*/
----
--- Create Table and Insert Data
----
create schema vector_setop_engine;
set current_schema=vector_setop_engine;
create table vector_setop_engine.VECTOR_SETOP_TABLE_01
(
col_inta int
,col_intb int
,col_num numeric
,col_char char
,col_varchar varchar
,col_text text
,col_time time
,col_interval interval
) with (orientation = orc) tablespace hdfs_ts distribute by hash(col_inta);
COPY VECTOR_SETOP_TABLE_01(col_inta, col_intb, col_num, col_char, col_varchar, col_text, col_time, col_interval) FROM stdin;
1 2 1.2 T hash_t1 hash_t1 11:18:00 2 day 13:24:56
2 3 2.3 T hash_t1 hash_t1 11:18:00 2 day 13:24:56
1 2 1.2 F t t 11:28:00 2 day 13:25:56
2 3 2.3 F t t 11:28:00 2 day 13:25:56
\.
create table vector_setop_engine.VECTOR_SETOP_TABLE_02
(
col_inta int
,col_intb int
,col_num numeric
,col_char char
,col_varchar varchar
,col_text text
,col_time time
,col_interval interval
) with (orientation = orc) tablespace hdfs_ts distribute by hash(col_inta);
COPY VECTOR_SETOP_TABLE_02(col_inta, col_intb, col_num, col_char, col_varchar, col_text, col_time, col_interval) FROM stdin;
1 2 1.2 T hash_t2 hash_t2 11:18:00 2 day 13:24:56
2 3 2.3 T hash_t2 hash_t2 11:18:00 2 day 13:24:56
3 4 3.4 T hash_t2 hash_t2 11:18:00 2 day 13:24:56
1 2 1.2 F t t 11:28:00 2 day 13:25:56
2 3 2.3 F t t 11:28:00 2 day 13:25:56
3 4 3.4 F t t 11:28:00 2 day 13:25:56
\.
create table vector_setop_engine.VECTOR_SETOP_TABLE_03
(
col_inta int
,col_intb int
,col_num numeric
,col_char char
,col_varchar varchar
,col_text text
,col_time time
,col_interval interval
) with (orientation = orc) tablespace hdfs_ts distribute by hash(col_intb);
COPY VECTOR_SETOP_TABLE_03(col_inta, col_intb, col_num, col_char, col_varchar, col_text, col_time, col_interval) FROM stdin;
1 2 1.2 T hash_t3 hash_t3 11:18:00 2 day 13:24:56
2 3 2.3 T hash_t3 hash_t3 11:18:00 2 day 13:24:56
3 4 3.4 T hash_t3 hash_t3 11:18:00 2 day 13:24:56
4 5 4.5 T hash_t3 hash_t3 11:18:00 2 day 13:24:56
1 2 1.2 F t t 11:28:00 2 day 13:25:56
2 3 2.3 F t t 11:28:00 2 day 13:25:56
3 4 3.4 F t t 11:28:00 2 day 13:25:56
4 5 4.5 F t t 11:28:00 2 day 13:25:56
\.
create table vector_setop_engine.VECTOR_SETOP_TABLE_04
(
col_inta smallint
,col_intb bigint
,col_num numeric
,col_char char
,col_varchar varchar
,col_text text
,col_time time
,col_interval interval
) with (orientation = orc) tablespace hdfs_ts distribute by hash(col_inta);
COPY VECTOR_SETOP_TABLE_04(col_inta, col_intb, col_num, col_char, col_varchar, col_text, col_time, col_interval) FROM stdin;
1 2 1.2 T hash_t4 hash_t4 11:18:00 2 day 13:24:56
2 3 2.3 T hash_t4 hash_t4 11:18:00 2 day 13:24:56
3 4 3.4 T hash_t4 hash_t4 11:18:00 2 day 13:24:56
4 5 4.5 T hash_t4 hash_t4 11:18:00 2 day 13:24:56
5 6 4.5 T hash_t4 hash_t4 11:18:00 2 day 13:24:56
1 2 1.2 F t t 11:28:00 2 day 13:25:56
2 3 2.3 F t t 11:28:00 2 day 13:25:56
3 4 3.4 F t t 11:28:00 2 day 13:25:56
4 5 4.5 F t t 11:28:00 2 day 13:25:56
5 6 4.5 F t t 11:28:00 2 day 13:25:56
\.
analyze vector_setop_table_01;
analyze vector_setop_table_02;
analyze vector_setop_table_03;
analyze vector_setop_table_04;
create view setop_12 as select vector_setop_table_01.col_inta as ta1, vector_setop_table_01.col_intb as tb1, vector_setop_table_02.col_inta as ta2, vector_setop_table_01.col_intb as tb2 from vector_setop_table_01 inner join vector_setop_table_02 on vector_setop_table_01.col_inta = vector_setop_table_02.col_inta;
create view setop_23 as select vector_setop_table_02.col_inta as ta2, vector_setop_table_02.col_intb as tb2, vector_setop_table_03.col_inta as ta3, vector_setop_table_03.col_intb as tb3 from vector_setop_table_02 inner join vector_setop_table_03 on vector_setop_table_02.col_inta = vector_setop_table_03.col_inta;
create view setop_31 as select vector_setop_table_03.col_inta as ta3, vector_setop_table_03.col_intb as tb3, vector_setop_table_01.col_inta as ta1, vector_setop_table_01.col_intb as tb1 from vector_setop_table_03 inner join vector_setop_table_01 on vector_setop_table_03.col_inta = vector_setop_table_01.col_inta;
----
--- test 1: Basic Test: INTERSECT ALL
----
-- hash + hash + same distributeKey + Append executes on all DNs
explain (verbose on, costs off)
select * from vector_setop_table_01 intersect all select * from vector_setop_table_02 order by 1, 2, 3;
select * from vector_setop_table_01 intersect all select * from vector_setop_table_02 order by 1, 2, 3;
select * from vector_setop_table_01 where col_inta = 1 intersect all select * from vector_setop_table_02 where col_intb = 1 order by 1, 2, 3;
select col_num, col_time from vector_setop_table_01 intersect all select col_num, col_time from vector_setop_table_03 order by 1, 2;
select col_inta, col_intb from vector_setop_table_01 where col_inta = 1 intersect all select col_intb, col_inta from vector_setop_table_03 where col_inta = 1 order by 1, 2;
-- hash + hash + same distributeKey + Append executes on special DN
select * from vector_setop_table_01 where col_inta = 1 intersect all select * from vector_setop_table_02 where col_inta = 1 order by 1, 2, 3;
select col_inta, col_intb from vector_setop_table_01 where col_inta = 1 intersect all select col_intb, col_inta from vector_setop_table_03 where col_intb = 1 order by 1, 2;
select col_time, col_interval from vector_setop_table_01 where col_inta = 1 intersect all select col_time, col_interval from vector_setop_table_03 where col_intb = 1 order by 1, 2;
-- hash + hash + different distributeKey + Append executes on all DNs
select * from vector_setop_table_01 intersect all select * from vector_setop_table_03 order by 1, 2, 3;
select col_inta, col_intb from vector_setop_table_01 intersect all select col_intb, col_inta from vector_setop_table_02 order by 1, 2;
-- hash + hash + different distributeKey + Append executes on special DN
select * from vector_setop_table_01 where col_inta = 1 intersect all select * from vector_setop_table_03 where col_intb = 1 order by 1, 2, 3;
select col_inta, col_intb from vector_setop_table_01 where col_inta = 1 intersect all select col_intb, col_inta from vector_setop_table_02 where col_inta = 1 order by 1, 2;
-- hash + hash + type cast
select * from vector_setop_table_01 intersect all select * from vector_setop_table_04 order by 1, 2, 3;
select col_inta, col_intb from vector_setop_table_01 intersect all select col_intb, col_inta from vector_setop_table_04 order by 1, 2;
-- execute on cn + hash
select 1 from pg_auth_members intersect all select col_intb from vector_setop_table_02 order by 1;
-- targetlist dosenot contains distributeKey
select col_inta from vector_setop_table_01 intersect all select col_intb from vector_setop_table_02 order by 1;
select col_intb from vector_setop_table_01 intersect all select col_intb from vector_setop_table_02 order by 1;
select col_interval from vector_setop_table_01 intersect all select col_interval from vector_setop_table_02 order by 1;
select * from setop_12 intersect all select * from setop_23 order by 1, 2, 3;
SELECT 1 AS one intersect all SELECT 1.1::float8 order by 1;
(select * from vector_setop_table_01) minus (select * from vector_setop_table_01);
--Since column table does not support replication, the following tests should be fixed later
-- hash + replication + Append executes on special DN
--select * from vector_setop_table_01 intersect all select * from replication_t1 order by 1, 2, 3;
-- replication + replication
--select * from replication_t1 intersect all select * from replication_t2 order by 1, 2, 3;
----
--- test 2: Basic Test: INTERSECT
----
-- hash + hash + same distributeKey + Append executes on all DNs
select * from vector_setop_table_01 intersect select * from vector_setop_table_02 order by 1, 2, 3;
select col_varchar, col_time from vector_setop_table_01 intersect select col_varchar, col_time from vector_setop_table_03 order by 1, 2;
select * from vector_setop_table_01 where col_inta = 1 intersect select * from vector_setop_table_02 where col_intb = 1 order by 1, 2, 3;
select col_inta, col_intb from vector_setop_table_01 where col_inta = 1 intersect all select col_intb, col_inta from vector_setop_table_03 where col_inta = 1 order by 1, 2;
-- hash + hash + same distributeKey + Append executes on special DN
select * from vector_setop_table_01 where col_inta = 1 intersect select * from vector_setop_table_02 where col_inta = 1 order by 1, 2, 3;
select col_inta, col_intb from vector_setop_table_01 where col_inta = 1 intersect select col_intb, col_inta from vector_setop_table_03 where col_intb = 1 order by 1, 2;
select col_time, col_interval from vector_setop_table_01 where col_inta = 1 intersect select col_time, col_interval from vector_setop_table_03 where col_intb = 1 order by 1, 2;
-- hash + hash + different distributeKey + Append executes on all DNs
select * from vector_setop_table_01 intersect select * from vector_setop_table_03 order by 1, 2, 3;
select col_inta, col_intb from vector_setop_table_01 intersect select col_intb, col_inta from vector_setop_table_02 order by 1, 2;
-- hash + hash + different distributeKey + Append executes on special DN
select * from vector_setop_table_01 where col_inta = 1 intersect select * from vector_setop_table_03 where col_intb = 1 order by 1, 2, 3;
select col_inta, col_intb from vector_setop_table_01 where col_inta = 1 intersect select col_intb, col_inta from vector_setop_table_02 where col_inta = 1 order by 1, 2;
-- hash + hash + type cast
select * from vector_setop_table_01 intersect select * from vector_setop_table_04 order by 1, 2, 3;
select col_inta, col_intb from vector_setop_table_01 intersect select col_intb, col_inta from vector_setop_table_04 order by 1, 2;
-- execute on cn + hash
select 1 from pg_auth_members intersect all select col_intb from vector_setop_table_02 order by 1;
-- targetlist dosenot contains distributeKey
select col_inta from vector_setop_table_01 intersect select col_intb from vector_setop_table_02 order by 1;
select col_intb from vector_setop_table_01 intersect select col_intb from vector_setop_table_02 order by 1;
select col_interval from vector_setop_table_01 intersect select col_interval from vector_setop_table_02 order by 1;
select * from setop_12 intersect select * from setop_23 order by 1, 2, 3;
SELECT 1 AS one intersect SELECT 1.1::float8 order by 1;
--Since column table does not support replication, the following tests should be fixed later
-- hash + replication + Append executes on special DN
--select * from hash_t1 intersect select * from replication_t1 order by 1, 2;
-- replication + replication
--select * from replication_t1 intersect select * from replication_t2 order by 1, 2;
----
--- test 3: Basic Test: EXCEPT ALL
----
select * from vector_setop_table_01 except all select * from vector_setop_table_02 order by 1, 2, 3;
select col_varchar, col_time from vector_setop_table_01 except all select col_varchar, col_time from vector_setop_table_03 order by 1, 2;
select * from vector_setop_table_01 where col_inta = 1 except all select * from vector_setop_table_02 where col_intb = 1 order by 1, 2, 3, 4;
select col_inta, col_intb from vector_setop_table_01 where col_inta = 1 except all select col_intb, col_inta from vector_setop_table_03 where col_inta = 1 order by 1, 2;
-- hash + hash + same distributeKey + Append executes on special DN
select * from vector_setop_table_01 where col_inta = 1 except all select * from vector_setop_table_02 where col_inta = 1 order by 1, 2, 3;
select col_inta, col_intb from vector_setop_table_01 where col_inta = 1 except all select col_intb, col_inta from vector_setop_table_03 where col_intb = 1 order by 1, 2;
select col_time, col_interval from vector_setop_table_01 where col_inta = 1 except all select col_time, col_interval from vector_setop_table_03 where col_intb = 1 order by 1, 2;
-- hash + hash + different distributeKey + Append executes on all DNs
select * from vector_setop_table_01 except all select * from vector_setop_table_03 order by 1, 2, 3;
select col_inta, col_intb from vector_setop_table_01 except all select col_intb, col_inta from vector_setop_table_02 order by 1, 2;
-- hash + hash + different distributeKey + Append executes on special DN
select * from vector_setop_table_01 where col_inta = 1 except all select * from vector_setop_table_03 where col_intb = 1 order by 1, 2, 3, 4;
select col_inta, col_intb from vector_setop_table_01 where col_inta = 1 except all select col_intb, col_inta from vector_setop_table_02 where col_inta = 1 order by 1, 2;
-- hash + hash + type cast
select * from vector_setop_table_01 except all select * from vector_setop_table_04 order by 1, 2, 3;
select col_inta, col_intb from vector_setop_table_01 except all select col_intb, col_inta from vector_setop_table_04 order by 1, 2;
-- execute on cn + hash
select 1 from pg_auth_members except all select col_intb from vector_setop_table_02 order by 1;
-- targetlist dosenot contains distributeKey
select col_inta from vector_setop_table_01 except all select col_intb from vector_setop_table_02 order by 1;
select col_intb from vector_setop_table_01 except all select col_intb from vector_setop_table_02 order by 1;
select col_interval from vector_setop_table_01 except all select col_interval from vector_setop_table_02 order by 1;
select * from setop_12 except all select * from setop_23 order by 1, 2, 3;
SELECT 1 AS one except all SELECT 1.1::float8 order by 1;
--Since column table does not support replication, the following tests should be fixed later
-- hash + replication + Append executes on special DN
--select * from hash_t1 except all select * from replication_t1 order by 1, 2, 3;
-- replication + replication
--select * from replication_t1 except all select * from replication_t2 order by 1, 2, 3;
----
--- test 4: Basic Test: EXCEPT
----
select * from vector_setop_table_01 except select * from vector_setop_table_02 order by 1, 2, 3;
select col_varchar, col_time from vector_setop_table_01 except select col_varchar, col_time from vector_setop_table_03 order by 1, 2;
select * from vector_setop_table_01 where col_inta = 1 except select * from vector_setop_table_02 where col_intb = 1 order by 1, 2, 3, 4;
select col_inta, col_intb from vector_setop_table_01 where col_inta = 1 except all select col_intb, col_inta from vector_setop_table_03 where col_inta = 1 order by 1, 2;
-- hash + hash + same distributeKey + Append executes on special DN
select * from vector_setop_table_01 where col_inta = 1 except all select * from vector_setop_table_02 where col_inta = 1 order by 1, 2, 3;
select col_inta, col_intb from vector_setop_table_01 where col_inta = 1 except select col_intb, col_inta from vector_setop_table_03 where col_intb = 1 order by 1, 2;
select col_time, col_interval from vector_setop_table_01 where col_inta = 1 except select col_time, col_interval from vector_setop_table_03 where col_intb = 1 order by 1, 2;
-- hash + hash + different distributeKey + Append executes on all DNs
select * from vector_setop_table_01 except select * from vector_setop_table_03 order by 1, 2, 3;
select col_inta, col_intb from vector_setop_table_01 except select col_intb, col_inta from vector_setop_table_02 order by 1, 2;
-- hash + hash + different distributeKey + Append executes on special DN
select * from vector_setop_table_01 where col_inta = 1 except all select * from vector_setop_table_03 where col_intb = 1 order by 1, 2, 3, 4;
select col_inta, col_intb from vector_setop_table_01 where col_inta = 1 except all select col_intb, col_inta from vector_setop_table_02 where col_inta = 1 order by 1, 2;
-- hash + hash + type cast
select * from vector_setop_table_01 except select * from vector_setop_table_04 order by 1, 2, 3;
select col_inta, col_intb from vector_setop_table_01 except select col_intb, col_inta from vector_setop_table_04 order by 1, 2;
-- execute on cn + hash
select 1 from pg_auth_members except all select col_intb from vector_setop_table_02 order by 1;
-- targetlist dosenot contains distributeKey
select col_inta from vector_setop_table_01 except select col_intb from vector_setop_table_02 order by 1;
select col_intb from vector_setop_table_01 except select col_intb from vector_setop_table_02 order by 1;
select col_interval from vector_setop_table_01 except select col_interval from vector_setop_table_02 order by 1;
select * from setop_12 except select * from setop_23 order by 1, 2, 3;
SELECT 1 AS one except SELECT 1.1::float8 order by 1;
--Since column table does not support replication, the following tests should be fixed later
-- hash + replication + Append executes on special DN
--select * from hash_t1 except select * from replication_t1 order by 1, 2, 3;
-- replication + replication
--select * from replication_t1 except select * from replication_t2 order by 1, 2, 3;
----
--- test 5: SetOp with RunSort
----
set enable_hashagg=off;
explain (verbose, costs off) select * from vector_setop_table_01 intersect all select * from vector_setop_table_02 order by 1, 2, 3;
select * from vector_setop_table_01 intersect all select * from vector_setop_table_02 order by 1, 2, 3;
explain (verbose, costs off) select * from vector_setop_table_01 intersect select * from vector_setop_table_02 order by 1, 2, 3;
select * from vector_setop_table_01 intersect select * from vector_setop_table_02 order by 1, 2, 3;
explain (verbose, costs off) select * from vector_setop_table_01 except all select * from vector_setop_table_02 order by 1, 2, 3;
select * from vector_setop_table_01 except all select * from vector_setop_table_02 order by 1, 2, 3;
explain (verbose, costs off) select * from vector_setop_table_01 except select * from vector_setop_table_02 order by 1, 2, 3;
select * from vector_setop_table_01 except select * from vector_setop_table_02 order by 1, 2, 3;
explain (verbose, costs off) select col_interval from vector_setop_table_01 intersect select col_interval from vector_setop_table_02 order by 1;
select col_interval from vector_setop_table_01 intersect select col_interval from vector_setop_table_02 order by 1;
explain (verbose, costs off) select 1 from (select * from vector_setop_table_01 union all select * from vector_setop_table_01) order by 1;
select 1 from (select * from vector_setop_table_01 union all select * from vector_setop_table_01) order by 1;
reset enable_hashagg;
-- Setop with size large than 1000
select * from lineitem_mergesort except all select * from lineitem order by 1, 2, 3, 4 limit 5;
----
--- test 6: SetOp With Null Element
----
COPY VECTOR_SETOP_TABLE_01(col_inta, col_intb, col_num, col_char, col_varchar, col_text, col_time, col_interval) FROM stdin;
\N 3 2.3 T hash_t1 hash_t1 \N 2 day 13:24:56
\N \N \N \N \N \N \N \N
\.
select * from vector_setop_table_01 intersect all select * from vector_setop_table_01 order by 1, 2, 3, 4;
----
--- test 7: Test append_merge_exec_nodes of SetOp
----
explain (verbose, costs off) select * from vector_setop_table_01 where col_inta = 2 union all select * from vector_setop_table_03 where col_intb = 5 order by 1, 2, 4;
select * from vector_setop_table_01 where col_inta = 2 union all select * from vector_setop_table_03 where col_intb = 5 order by 1, 2, 4;
----
--- Clean Resources and Tables
----
drop schema vector_setop_engine cascade; | the_stack |
CREATE OR REPLACE FUNCTION dex.insert_dodo(start_ts timestamptz, end_ts timestamptz=now(), start_block numeric=0, end_block numeric=9e18) RETURNS integer
LANGUAGE plpgsql AS $function$
DECLARE r integer;
BEGIN
WITH rows AS (
INSERT INTO dex.trades (
block_time,
token_a_symbol,
token_b_symbol,
token_a_amount,
token_b_amount,
project,
version,
category,
trader_a,
trader_b,
token_a_amount_raw,
token_b_amount_raw,
usd_amount,
token_a_address,
token_b_address,
exchange_contract_address,
tx_hash,
tx_from,
tx_to,
trace_address,
evt_index,
trade_id
)
SELECT
dexs.block_time,
erc20a.symbol AS token_a_symbol,
erc20b.symbol AS token_b_symbol,
token_a_amount_raw / 10 ^ erc20a.decimals AS token_a_amount,
token_b_amount_raw / 10 ^ erc20b.decimals AS token_b_amount,
project,
version,
category,
coalesce(trader_a, tx."from") as trader_a, -- subqueries rely on this COALESCE to avoid redundant joins with the transactions table
trader_b,
token_a_amount_raw,
token_b_amount_raw,
coalesce(
usd_amount,
token_a_amount_raw / 10 ^ pa.decimals * pa.price,
token_b_amount_raw / 10 ^ pb.decimals * pb.price
) as usd_amount,
token_a_address,
token_b_address,
exchange_contract_address,
tx_hash,
tx."from" as tx_from,
tx."to" as tx_to,
trace_address,
evt_index,
row_number() OVER (PARTITION BY project, tx_hash, evt_index, trace_address ORDER BY version, category) AS trade_id
FROM (
-- dodo v1 sell
SELECT
s.evt_block_time AS block_time,
'DODO' AS project,
'1' AS version,
'DEX' AS category,
s.seller AS trader_a,
NULL::bytea AS trader_b,
s."payBase" token_a_amount_raw,
s."receiveQuote" token_b_amount_raw,
NULL::numeric AS usd_amount,
m.base_token_address AS token_a_address,
m.quote_token_address AS token_b_address,
s.contract_address exchange_contract_address,
s.evt_tx_hash AS tx_hash,
NULL::integer[] AS trace_address,
s.evt_index
FROM
dodo."DODO_evt_SellBaseToken" s
LEFT JOIN dodo."view_markets" m on s.contract_address = m.market_contract_address
WHERE s.seller <> '\xa356867fdcea8e71aeaf87805808803806231fdc'
UNION ALL
-- dodo v1 buy
SELECT
b.evt_block_time AS block_time,
'DODO' AS project,
'1' AS version,
'DEX' AS category,
b.buyer AS trader_a,
NULL::bytea AS trader_b,
b."receiveBase" token_a_amount_raw,
b."payQuote" token_b_amount_raw,
NULL::numeric AS usd_amount,
m.base_token_address AS token_a_address,
m.quote_token_address AS token_b_address,
b.contract_address exchange_contract_address,
b.evt_tx_hash AS tx_hash,
NULL::integer[] AS trace_address,
b.evt_index
FROM
dodo."DODO_evt_BuyBaseToken" b
LEFT JOIN dodo."view_markets" m on b.contract_address = m.market_contract_address
WHERE b.buyer <> '\xa356867fdcea8e71aeaf87805808803806231fdc'
UNION ALL
-- dodov1 proxy01
SELECT
evt_block_time AS block_time,
'DODO' AS project,
'1' AS version,
'DEX' AS category,
sender AS trader_a,
NULL::bytea AS trader_b,
"fromAmount" token_a_amount_raw,
"returnAmount" token_b_amount_raw,
NULL::numeric AS usd_amount,
"fromToken" AS token_a_address,
"toToken" AS token_b_address,
contract_address exchange_contract_address,
evt_tx_hash AS tx_hash,
NULL::integer[] AS trace_address,
evt_index
FROM
dodo."DODOV1Proxy01_evt_OrderHistory"
UNION ALL
-- dodov1 proxy04
SELECT
evt_block_time AS block_time,
'DODO' AS project,
'1' AS version,
'DEX' AS category,
sender AS trader_a,
NULL::bytea AS trader_b,
"fromAmount" token_a_amount_raw,
"returnAmount" token_b_amount_raw,
NULL::numeric AS usd_amount,
"fromToken" AS token_a_address,
"toToken" AS token_b_address,
contract_address exchange_contract_address,
evt_tx_hash AS tx_hash,
NULL::integer[] AS trace_address,
evt_index
FROM
dodo."DODOV1Proxy04_evt_OrderHistory"
UNION ALL
-- dodov2 proxy02
SELECT
evt_block_time AS block_time,
'DODO' AS project,
'2' AS version,
'DEX' AS category,
sender AS trader_a,
NULL::bytea AS trader_b,
"fromAmount" token_a_amount_raw,
"returnAmount" token_b_amount_raw,
NULL::numeric AS usd_amount,
"fromToken" AS token_a_address,
"toToken" AS token_b_address,
contract_address exchange_contract_address,
evt_tx_hash AS tx_hash,
NULL::integer[] AS trace_address,
evt_index
FROM
dodo."DODOV2Proxy02_evt_OrderHistory"
UNION ALL
-- dodov2 dvm
SELECT
evt_block_time AS block_time,
'DODO' AS project,
'2' AS version,
'DEX' AS category,
trader AS trader_a,
receiver AS trader_b,
"fromAmount" token_a_amount_raw,
"toAmount" token_b_amount_raw,
NULL::numeric AS usd_amount,
"fromToken" AS token_a_address,
"toToken" AS token_b_address,
contract_address exchange_contract_address,
evt_tx_hash AS tx_hash,
NULL::integer[] AS trace_address,
evt_index
FROM
dodo."DVM_evt_DODOSwap"
WHERE trader <> '\xa356867fdcea8e71aeaf87805808803806231fdc'
UNION ALL
-- dodov2 dpp
SELECT
evt_block_time AS block_time,
'DODO' AS project,
'2' AS version,
'DEX' AS category,
trader AS trader_a,
receiver AS trader_b,
"fromAmount" AS token_a_amount_raw,
"toAmount" AS token_b_amount_raw,
NULL::numeric AS usd_amount,
"fromToken" AS token_a_address,
"toToken" AS token_b_address,
contract_address AS exchange_contract_address,
evt_tx_hash AS tx_hash,
NULL::integer[] AS trace_address,
evt_index
FROM
dodo."DPP_evt_DODOSwap"
WHERE trader <> '\xa356867fdcea8e71aeaf87805808803806231fdc'
UNION ALL
-- dodov2 dsp
SELECT
evt_block_time AS block_time,
'DODO' AS project,
'2' AS version,
'DEX' AS category,
trader AS trader_a,
receiver AS trader_b,
"fromAmount" AS token_a_amount_raw,
"toAmount" AS token_b_amount_raw,
NULL::numeric AS usd_amount,
"fromToken" AS token_a_address,
"toToken" AS token_b_address,
contract_address AS exchange_contract_address,
evt_tx_hash AS tx_hash,
NULL::integer[] AS trace_address,
evt_index
FROM
dodo."DSP_evt_DODOSwap"
WHERE trader <> '\xa356867fdcea8e71aeaf87805808803806231fdc'
) dexs
INNER JOIN ethereum.transactions tx
ON dexs.tx_hash = tx.hash
AND tx.block_time >= start_ts
AND tx.block_time < end_ts
AND tx.block_number >= start_block
AND tx.block_number < end_block
LEFT JOIN erc20.tokens erc20a ON erc20a.contract_address = dexs.token_a_address
LEFT JOIN erc20.tokens erc20b ON erc20b.contract_address = dexs.token_b_address
LEFT JOIN prices.usd pa ON pa.minute = date_trunc('minute', dexs.block_time)
AND pa.contract_address = dexs.token_a_address
AND pa.minute >= start_ts
AND pa.minute < end_ts
LEFT JOIN prices.usd pb ON pb.minute = date_trunc('minute', dexs.block_time)
AND pb.contract_address = dexs.token_b_address
AND pb.minute >= start_ts
AND pb.minute < end_ts
WHERE dexs.block_time >= start_ts
AND dexs.block_time < end_ts
ON CONFLICT DO NOTHING
RETURNING 1
)
SELECT count(*) INTO r from rows;
RETURN r;
END
$function$;
-- fill 2020
SELECT dex.insert_dodo(
'2020-01-01',
'2021-01-01',
(SELECT max(number) FROM ethereum.blocks WHERE time < '2020-01-01'),
(SELECT max(number) FROM ethereum.blocks WHERE time <= '2021-01-01')
)
WHERE NOT EXISTS (
SELECT *
FROM dex.trades
WHERE block_time > '2020-01-01'
AND block_time <= '2021-01-01'
AND project = 'DODO'
);
-- fill 2021
SELECT dex.insert_dodo(
'2021-01-01',
now(),
(SELECT max(number) FROM ethereum.blocks WHERE time < '2021-01-01'),
(SELECT MAX(number) FROM ethereum.blocks where time < now() - interval '20 minutes')
)
WHERE NOT EXISTS (
SELECT *
FROM dex.trades
WHERE block_time > '2021-01-01'
AND block_time <= now() - interval '20 minutes'
AND project = 'DODO'
);
INSERT INTO cron.job (schedule, command)
VALUES ('*/10 * * * *', $$
SELECT dex.insert_dodo(
(SELECT max(block_time) - interval '1 days' FROM dex.trades WHERE project='DODO'),
(SELECT now() - interval '20 minutes'),
(SELECT max(number) FROM ethereum.blocks WHERE time < (SELECT max(block_time) - interval '1 days' FROM dex.trades WHERE project='DODO')),
(SELECT MAX(number) FROM ethereum.blocks where time < now() - interval '20 minutes'));
$$)
ON CONFLICT (command) DO UPDATE SET schedule=EXCLUDED.schedule; | the_stack |
-- Licensed to the Apache Software Foundation(ASF) under one or more
-- contributor license agreements. See the NOTICE file distributed with
-- this work for additional information regarding copyright ownership.
-- The ASF licenses this file to You under the Apache License, Version 2.0
--(the "License"); you may not use this file except in compliance with
-- the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing,software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
create table dbo.x_portal_user(
id bigint IDENTITY NOT NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
added_by_id bigint DEFAULT NULL NULL,
upd_by_id bigint DEFAULT NULL NULL,
first_name varchar(256) DEFAULT NULL NULL,
last_name varchar(256) DEFAULT NULL NULL,
pub_scr_name varchar(2048) DEFAULT NULL NULL,
login_id varchar(767) DEFAULT NULL NULL,
password varchar(512) NOT NULL,
email varchar(512) DEFAULT NULL NULL,
status int DEFAULT 0 NOT NULL,
user_src int DEFAULT 0 NOT NULL,
notes varchar(4000) DEFAULT NULL NULL,
CONSTRAINT x_portal_user_PK_id PRIMARY KEY CLUSTERED(id),
CONSTRAINT x_portal_user_UK_email UNIQUE NONCLUSTERED (email),
CONSTRAINT x_portal_user_UK_login_id UNIQUE NONCLUSTERED (login_id)
)
GO
create table dbo.x_portal_user_role(
id bigint IDENTITY NOT NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
added_by_id bigint DEFAULT NULL NULL,
upd_by_id bigint DEFAULT NULL NULL,
user_id bigint NOT NULL,
user_role varchar(128) DEFAULT NULL NULL,
status int DEFAULT 0 NOT NULL,
CONSTRAINT x_portal_user_role_PK_id PRIMARY KEY CLUSTERED(id)
)
GO
create table dbo.xa_access_audit(
id bigint IDENTITY NOT NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
added_by_id bigint DEFAULT NULL NULL,
upd_by_id bigint DEFAULT NULL NULL,
audit_type int DEFAULT 0 NOT NULL,
access_result int DEFAULT 0 NULL,
access_type varchar(255) DEFAULT NULL NULL,
acl_enforcer varchar(255) DEFAULT NULL NULL,
agent_id varchar(255) DEFAULT NULL NULL,
client_ip varchar(255) DEFAULT NULL NULL,
client_type varchar(255) DEFAULT NULL NULL,
policy_id bigint DEFAULT 0 NULL,
repo_name varchar(255) DEFAULT NULL NULL,
repo_type int DEFAULT 0 NULL,
result_reason varchar(255) DEFAULT NULL NULL,
session_id varchar(255) DEFAULT NULL NULL,
event_time datetime DEFAULT NULL NULL,
request_user varchar(255) DEFAULT NULL NULL,
action varchar(2000) DEFAULT NULL NULL,
request_data varchar(4000) DEFAULT NULL NULL,
resource_path varchar(4000) DEFAULT NULL NULL,
resource_type varchar(255) DEFAULT NULL NULL,
seq_num bigint DEFAULT 0 NULL,
event_count bigint DEFAULT 1 NULL,
event_dur_ms bigint DEFAULT 1 NULL,
CONSTRAINT xa_access_audit_PK_id PRIMARY KEY CLUSTERED(id)
)
GO
create table dbo.x_asset(
id bigint IDENTITY NOT NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
added_by_id bigint DEFAULT NULL NULL,
upd_by_id bigint DEFAULT NULL NULL,
asset_name varchar(1024) NOT NULL,
descr varchar(4000) NOT NULL,
act_status int DEFAULT 0 NOT NULL,
asset_type int DEFAULT 0 NOT NULL,
config text NULL,
sup_native tinyint DEFAULT 0 NOT NULL,
CONSTRAINT x_asset_PK_id PRIMARY KEY CLUSTERED(id)
)
GO
create table dbo.x_auth_sess(
id bigint IDENTITY NOT NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
added_by_id bigint DEFAULT NULL NULL,
upd_by_id bigint DEFAULT NULL NULL,
login_id varchar(767) NOT NULL,
user_id bigint DEFAULT NULL NULL,
ext_sess_id varchar(512) DEFAULT NULL NULL,
auth_time datetime NOT NULL,
auth_status int DEFAULT 0 NOT NULL,
auth_type int DEFAULT 0 NOT NULL,
auth_provider int DEFAULT 0 NOT NULL,
device_type int DEFAULT 0 NOT NULL,
req_ip varchar(48) NOT NULL,
req_ua varchar(1024) DEFAULT NULL NULL,
CONSTRAINT x_auth_sess_PK_id PRIMARY KEY CLUSTERED(id)
)
GO
create table dbo.x_cred_store(
id bigint IDENTITY NOT NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
added_by_id bigint DEFAULT NULL NULL,
upd_by_id bigint DEFAULT NULL NULL,
store_name varchar(1024) NOT NULL,
descr varchar(4000) NOT NULL,
CONSTRAINT x_cred_store_PK_id PRIMARY KEY CLUSTERED(id)
)
GO
create table dbo.x_db_base(
id bigint IDENTITY NOT NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
added_by_id bigint DEFAULT NULL NULL,
upd_by_id bigint DEFAULT NULL NULL,
CONSTRAINT x_db_base_PK_id PRIMARY KEY CLUSTERED(id)
)
GO
create table dbo.x_group(
id bigint IDENTITY NOT NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
added_by_id bigint DEFAULT NULL NULL,
upd_by_id bigint DEFAULT NULL NULL,
group_name varchar(1024) NOT NULL,
descr varchar(4000) NOT NULL,
status int DEFAULT 0 NOT NULL,
group_type int DEFAULT 0 NOT NULL,
cred_store_id bigint DEFAULT NULL NULL,
group_src int DEFAULT 0 NOT NULL,
is_visible int DEFAULT 1 NOT NULL,
CONSTRAINT x_group_PK_id PRIMARY KEY CLUSTERED(id)
)
GO
create table dbo.x_group_groups(
id bigint IDENTITY NOT NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
added_by_id bigint DEFAULT NULL NULL,
upd_by_id bigint DEFAULT NULL NULL,
group_name varchar(1024) NOT NULL,
p_group_id bigint DEFAULT NULL NULL,
group_id bigint DEFAULT NULL NULL,
CONSTRAINT x_group_groups_PK_id PRIMARY KEY CLUSTERED(id)
)
GO
create table dbo.x_user(
id bigint IDENTITY NOT NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
added_by_id bigint DEFAULT NULL NULL,
upd_by_id bigint DEFAULT NULL NULL,
user_name varchar(1024) NOT NULL,
descr varchar(4000) NOT NULL,
status int DEFAULT 0 NOT NULL,
cred_store_id bigint DEFAULT NULL NULL,
is_visible int DEFAULT 1 NOT NULL,
CONSTRAINT x_user_PK_id PRIMARY KEY CLUSTERED(id)
)
GO
create table dbo.x_group_users(
id bigint IDENTITY NOT NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
added_by_id bigint DEFAULT NULL NULL,
upd_by_id bigint DEFAULT NULL NULL,
group_name varchar(1024) NOT NULL,
p_group_id bigint DEFAULT NULL NULL,
user_id bigint DEFAULT NULL NULL,
CONSTRAINT x_group_users_PK_id PRIMARY KEY CLUSTERED(id)
)
GO
create table dbo.x_policy_export_audit(
id bigint IDENTITY NOT NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
added_by_id bigint DEFAULT NULL NULL,
upd_by_id bigint DEFAULT NULL NULL,
client_ip varchar(255) NOT NULL,
agent_id varchar(255) DEFAULT NULL NULL,
req_epoch bigint NOT NULL,
last_updated datetime DEFAULT NULL NULL,
repository_name varchar(1024) DEFAULT NULL NULL,
exported_json text DEFAULT NULL NULL,
http_ret_code int DEFAULT 0 NOT NULL,
CONSTRAINT x_policy_export_audit_PK_id PRIMARY KEY CLUSTERED(id)
)
GO
create table dbo.x_resource(
id bigint IDENTITY NOT NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
added_by_id bigint DEFAULT NULL NULL,
upd_by_id bigint DEFAULT NULL NULL,
res_name varchar(4000) DEFAULT NULL NULL,
descr varchar(4000) DEFAULT NULL NULL,
res_type int DEFAULT 0 NOT NULL,
asset_id bigint NOT NULL,
parent_id bigint DEFAULT NULL NULL,
parent_path varchar(4000) DEFAULT NULL NULL,
is_encrypt int DEFAULT 0 NOT NULL,
is_recursive int DEFAULT 0 NOT NULL,
res_group varchar(1024) DEFAULT NULL NULL,
res_dbs text NULL,
res_tables text NULL,
res_col_fams text NULL,
res_cols text NULL,
res_udfs text NULL,
res_status int DEFAULT 1 NOT NULL,
table_type int DEFAULT 0 NOT NULL,
col_type int DEFAULT 0 NOT NULL,
policy_name varchar(500) DEFAULT NULL NULL,
res_topologies text DEFAULT NULL NULL,
res_services text DEFAULT NULL NULL,
CONSTRAINT x_resource_PK_id PRIMARY KEY CLUSTERED(id)
)
GO
create table dbo.x_trx_log(
id bigint IDENTITY NOT NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
added_by_id bigint DEFAULT NULL NULL,
upd_by_id bigint DEFAULT NULL NULL,
class_type int DEFAULT 0 NOT NULL,
object_id bigint DEFAULT NULL NULL,
parent_object_id bigint DEFAULT NULL NULL,
parent_object_class_type int DEFAULT 0 NOT NULL,
parent_object_name varchar(1024) DEFAULT NULL NULL,
object_name varchar(1024) DEFAULT NULL NULL,
attr_name varchar(255) DEFAULT NULL NULL,
prev_val text DEFAULT NULL NULL,
new_val text DEFAULT NULL NULL,
trx_id varchar(1024)DEFAULT NULL NULL,
action varchar(255) DEFAULT NULL NULL,
sess_id varchar(512) DEFAULT NULL NULL,
req_id varchar(30) DEFAULT NULL NULL,
sess_type varchar(30) DEFAULT NULL NULL,
CONSTRAINT x_trx_log_PK_id PRIMARY KEY CLUSTERED(id)
)
GO
create table dbo.x_perm_map(
id bigint IDENTITY NOT NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
added_by_id bigint DEFAULT NULL NULL,
upd_by_id bigint DEFAULT NULL NULL,
perm_group varchar(1024) DEFAULT NULL NULL,
res_id bigint DEFAULT NULL NULL,
group_id bigint DEFAULT NULL NULL,
user_id bigint DEFAULT NULL NULL,
perm_for int DEFAULT 0 NOT NULL,
perm_type int DEFAULT 0 NOT NULL,
is_recursive int DEFAULT 0 NOT NULL,
is_wild_card tinyint DEFAULT 1 NOT NULL,
grant_revoke tinyint DEFAULT 1 NOT NULL,
ip_address text DEFAULT NULL NULL,
CONSTRAINT x_perm_map_PK_id PRIMARY KEY CLUSTERED(id)
)
GO
create table dbo.x_audit_map(
id bigint IDENTITY NOT NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
added_by_id bigint DEFAULT NULL NULL,
upd_by_id bigint DEFAULT NULL NULL,
res_id bigint DEFAULT NULL NULL,
group_id bigint DEFAULT NULL NULL,
user_id bigint DEFAULT NULL NULL,
audit_type int DEFAULT 0 NOT NULL,
CONSTRAINT x_audit_map_PK_id PRIMARY KEY CLUSTERED(id)
)
GO
CREATE VIEW dbo.vx_trx_log AS select x_trx_log.id AS id,x_trx_log.create_time AS create_time,x_trx_log.update_time AS update_time,x_trx_log.added_by_id AS added_by_id,x_trx_log.upd_by_id AS upd_by_id,x_trx_log.class_type AS class_type,x_trx_log.object_id AS object_id,x_trx_log.parent_object_id AS parent_object_id,x_trx_log.parent_object_class_type AS parent_object_class_type,x_trx_log.attr_name AS attr_name,x_trx_log.parent_object_name AS parent_object_name,x_trx_log.object_name AS object_name,x_trx_log.prev_val AS prev_val,x_trx_log.new_val AS new_val,x_trx_log.trx_id AS trx_id,x_trx_log.action AS action,x_trx_log.sess_id AS sess_id,x_trx_log.req_id AS req_id,x_trx_log.sess_type AS sess_type from x_trx_log where id in(select min(x_trx_log.id) from x_trx_log group by x_trx_log.trx_id)
GO
create table dbo.x_service_def(
id bigint IDENTITY NOT NULL,
guid varchar(1024) DEFAULT NULL NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
added_by_id bigint DEFAULT NULL NULL,
upd_by_id bigint DEFAULT NULL NULL,
version bigint DEFAULT NULL NULL,
name varchar(1024) DEFAULT NULL NULL,
impl_class_name varchar(1024) DEFAULT NULL NULL,
label varchar(1024) DEFAULT NULL NULL,
description varchar(1024) DEFAULT NULL NULL,
rb_key_label varchar(1024) DEFAULT NULL NULL,
rb_key_description varchar(1024) DEFAULT NULL NULL,
is_enabled tinyint DEFAULT 1 NULL,
CONSTRAINT x_service_def_PK_id PRIMARY KEY CLUSTERED(id)
)
GO
create table dbo.x_service (
id bigint IDENTITY NOT NULL,
guid varchar(1024) DEFAULT NULL NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
added_by_id bigint DEFAULT NULL NULL,
upd_by_id bigint DEFAULT NULL NULL,
version bigint DEFAULT NULL NULL,
type bigint DEFAULT NULL NULL,
name varchar(255) DEFAULT NULL NULL,
policy_version bigint DEFAULT NULL NULL,
policy_update_time datetime DEFAULT NULL NULL,
description varchar(1024) DEFAULT NULL NULL,
is_enabled tinyint DEFAULT 0 NOT NULL,
CONSTRAINT x_service_def_PK_id PRIMARY KEY CLUSTERED(id)
)
GO
create table dbo.x_policy (
id bigint IDENTITY NOT NULL,
guid varchar(1024) DEFAULT NULL NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
added_by_id bigint DEFAULT NULL NULL,
upd_by_id bigint DEFAULT NULL NULL,
version bigint DEFAULT NULL NULL,
service bigint DEFAULT NULL NULL,
name varchar(512) DEFAULT NULL NULL,
policy_type int DEFAULT 0 NULL,
description varchar(1024) DEFAULT NULL NULL,
resource_signature varchar(128) DEFAULT NULL NULL,
is_enabled tinyint DEFAULT 0 NOT NULL,
is_audit_enabled tinyint DEFAULT 0 NOT NULL,
CONSTRAINT x_policy_PK_id PRIMARY KEY CLUSTERED(id)
)
GO
create table dbo.x_service_config_def (
id bigint IDENTITY NOT NULL,
guid varchar(1024) DEFAULT NULL NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
added_by_id bigint DEFAULT NULL NULL,
upd_by_id bigint DEFAULT NULL NULL,
def_id bigint NOT NULL,
item_id bigint NOT NULL,
name varchar(1024) DEFAULT NULL NULL,
type varchar(1024) DEFAULT NULL NULL,
sub_type varchar(1024) DEFAULT NULL NULL,
is_mandatory tinyint DEFAULT 0 NOT NULL,
default_value varchar(1024) DEFAULT NULL NULL,
validation_reg_ex varchar(1024) DEFAULT NULL NULL,
validation_message varchar(1024) DEFAULT NULL NULL,
ui_hint varchar(1024) DEFAULT NULL NULL,
label varchar(1024) DEFAULT NULL NULL,
description varchar(1024) DEFAULT NULL NULL,
rb_key_label varchar(1024) DEFAULT NULL NULL,
rb_key_description varchar(1024) DEFAULT NULL NULL,
rb_key_validation_message varchar(1024) DEFAULT NULL NULL,
sort_order tinyint DEFAULT 0 NULL,
CONSTRAINT x_service_config_def_PK_id PRIMARY KEY CLUSTERED(id)
)
GO
create table dbo.x_resource_def (
id bigint IDENTITY NOT NULL,
guid varchar(1024) DEFAULT NULL NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
added_by_id bigint DEFAULT NULL NULL,
upd_by_id bigint DEFAULT NULL NULL,
def_id bigint NOT NULL,
item_id bigint NOT NULL,
name varchar(1024) DEFAULT NULL NULL,
type varchar(1024) DEFAULT NULL NULL,
res_level bigint DEFAULT NULL NULL,
parent bigint DEFAULT NULL NULL,
mandatory tinyint DEFAULT 0 NOT NULL,
look_up_supported tinyint DEFAULT 0 NOT NULL,
recursive_supported tinyint DEFAULT 0 NOT NULL,
excludes_supported tinyint DEFAULT 0 NOT NULL,
matcher varchar(1024) DEFAULT NULL NULL,
matcher_options varchar(1024) DEFAULT NULL NULL,
validation_reg_ex varchar(1024) DEFAULT NULL NULL,
validation_message varchar(1024) DEFAULT NULL NULL,
ui_hint varchar(1024) DEFAULT NULL NULL,
label varchar(1024) DEFAULT NULL NULL,
description varchar(1024) DEFAULT NULL NULL,
rb_key_label varchar(1024) DEFAULT NULL NULL,
rb_key_description varchar(1024) DEFAULT NULL NULL,
rb_key_validation_message varchar(1024) DEFAULT NULL NULL,
sort_order tinyint DEFAULT 0 NULL,
CONSTRAINT x_resource_def_PK_id PRIMARY KEY CLUSTERED(id)
)
GO
create table dbo.x_access_type_def (
id bigint IDENTITY NOT NULL,
guid varchar(1024) DEFAULT NULL NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
added_by_id bigint DEFAULT NULL NULL,
upd_by_id bigint DEFAULT NULL NULL,
def_id bigint NOT NULL,
item_id bigint NOT NULL,
name varchar(1024) DEFAULT NULL NULL,
label varchar(1024) DEFAULT NULL NULL,
rb_key_label varchar(1024) DEFAULT NULL NULL,
sort_order tinyint DEFAULT 0 NULL,
CONSTRAINT x_access_type_def_PK_id PRIMARY KEY CLUSTERED(id)
)
GO
create table dbo.x_access_type_def_grants(
id bigint IDENTITY NOT NULL,
guid varchar(1024) DEFAULT NULL NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
added_by_id bigint DEFAULT NULL NULL,
upd_by_id bigint DEFAULT NULL NULL,
atd_id bigint NOT NULL,
implied_grant varchar(1024) DEFAULT NULL NULL,
CONSTRAINT x_access_type_def_grants_PK_id PRIMARY KEY CLUSTERED(id)
)
GO
create table dbo.x_policy_condition_def (
id bigint IDENTITY NOT NULL,
guid varchar(1024) DEFAULT NULL NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
added_by_id bigint DEFAULT NULL NULL,
upd_by_id bigint DEFAULT NULL NULL,
def_id bigint NOT NULL,
item_id bigint NOT NULL,
name varchar(1024) DEFAULT NULL NULL,
evaluator varchar(1024) DEFAULT NULL NULL,
evaluator_options varchar(1024) DEFAULT NULL NULL,
validation_reg_ex varchar(1024) DEFAULT NULL NULL,
validation_message varchar(1024) DEFAULT NULL NULL,
ui_hint varchar(1024) DEFAULT NULL NULL,
label varchar(1024) DEFAULT NULL NULL,
description varchar(1024) DEFAULT NULL NULL,
rb_key_label varchar(1024) DEFAULT NULL NULL,
rb_key_description varchar(1024) DEFAULT NULL NULL,
rb_key_validation_message varchar(1024) DEFAULT NULL NULL,
sort_order tinyint DEFAULT 0 NULL,
CONSTRAINT x_policy_condition_def_grants_PK_id PRIMARY KEY CLUSTERED(id)
)
GO
create table dbo.x_context_enricher_def(
id bigint IDENTITY NOT NULL,
guid varchar(1024) DEFAULT NULL NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
added_by_id bigint DEFAULT NULL NULL,
upd_by_id bigint DEFAULT NULL NULL,
def_id bigint NOT NULL,
item_id bigint NOT NULL,
name varchar(1024) DEFAULT NULL NULL,
enricher varchar(1024) DEFAULT NULL NULL,
enricher_options varchar(1024) DEFAULT NULL NULL,
sort_order tinyint DEFAULT 0 NULL,
CONSTRAINT x_context_enricher_def_grants_PK_id PRIMARY KEY CLUSTERED(id)
)
GO
create table dbo.x_enum_def (
id bigint IDENTITY NOT NULL,
guid varchar(1024) DEFAULT NULL NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
added_by_id bigint DEFAULT NULL NULL,
upd_by_id bigint DEFAULT NULL NULL,
def_id bigint NOT NULL,
item_id bigint NOT NULL,
name varchar(1024) DEFAULT NULL NULL,
default_index bigint DEFAULT NULL NULL,
CONSTRAINT x_enum_def_grants_PK_id PRIMARY KEY CLUSTERED(id)
)
GO
create table dbo.x_enum_element_def (
id bigint IDENTITY NOT NULL,
guid varchar(1024) DEFAULT NULL NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
added_by_id bigint DEFAULT NULL NULL,
upd_by_id bigint DEFAULT NULL NULL,
enum_def_id bigint NOT NULL,
item_id bigint NOT NULL,
name varchar(1024) DEFAULT NULL NULL,
label varchar(1024) DEFAULT NULL NULL,
rb_key_label varchar(1024) DEFAULT NULL NULL,
sort_order tinyint DEFAULT 0 NULL,
CONSTRAINT x_enum_element_def_PK_id PRIMARY KEY CLUSTERED(id)
)
GO
create table dbo.x_service_config_map (
id bigint IDENTITY NOT NULL,
guid varchar(1024) DEFAULT NULL NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
added_by_id bigint DEFAULT NULL NULL,
upd_by_id bigint DEFAULT NULL NULL,
service bigint NOT NULL,
config_key varchar(1024) DEFAULT NULL NULL,
config_value varchar(4000) DEFAULT NULL NULL,
CONSTRAINT x_service_config_map_PK_id PRIMARY KEY CLUSTERED(id)
)
GO
create table dbo.x_policy_resource (
id bigint IDENTITY NOT NULL,
guid varchar(1024) DEFAULT NULL NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
added_by_id bigint DEFAULT NULL NULL,
upd_by_id bigint DEFAULT NULL NULL,
policy_id bigint NOT NULL,
res_def_id bigint NOT NULL,
is_excludes tinyint DEFAULT 0 NOT NULL,
is_recursive tinyint DEFAULT 0 NOT NULL,
CONSTRAINT x_policy_resource_PK_id PRIMARY KEY CLUSTERED(id)
)
GO
create table dbo.x_policy_resource_map (
id bigint IDENTITY NOT NULL,
guid varchar(1024) DEFAULT NULL NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
added_by_id bigint DEFAULT NULL NULL,
upd_by_id bigint DEFAULT NULL NULL,
resource_id bigint NOT NULL,
value varchar(1024) DEFAULT NULL NULL,
sort_order tinyint DEFAULT 0 NULL,
CONSTRAINT x_policy_resource_map_PK_id PRIMARY KEY CLUSTERED(id)
)
GO
create table dbo.x_policy_item (
id bigint IDENTITY NOT NULL,
guid varchar(1024) DEFAULT NULL NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
added_by_id bigint DEFAULT NULL NULL,
upd_by_id bigint DEFAULT NULL NULL,
policy_id bigint NOT NULL,
delegate_admin tinyint DEFAULT 0 NOT NULL,
sort_order tinyint DEFAULT 0 NULL,
CONSTRAINT x_policy_item_PK_id PRIMARY KEY CLUSTERED(id)
)
GO
create table dbo.x_policy_item_access (
id bigint IDENTITY NOT NULL,
guid varchar(1024) DEFAULT NULL NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
added_by_id bigint DEFAULT NULL NULL,
upd_by_id bigint DEFAULT NULL NULL,
policy_item_id bigint NOT NULL,
type bigint NOT NULL,
is_allowed tinyint DEFAULT 0 NOT NULL,
sort_order tinyint DEFAULT 0 NULL,
CONSTRAINT x_policy_item_access_PK_id PRIMARY KEY CLUSTERED(id)
)
GO
create table dbo.x_policy_item_condition (
id bigint IDENTITY NOT NULL,
guid varchar(1024) DEFAULT NULL NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
added_by_id bigint DEFAULT NULL NULL,
upd_by_id bigint DEFAULT NULL NULL,
policy_item_id bigint NOT NULL,
type bigint NOT NULL,
value varchar(1024) DEFAULT NULL NULL,
sort_order tinyint DEFAULT 0 NULL,
CONSTRAINT x_policy_item_condition_PK_id PRIMARY KEY CLUSTERED(id)
)
GO
create table dbo.x_policy_item_user_perm (
id bigint IDENTITY NOT NULL,
guid varchar(1024) DEFAULT NULL NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
added_by_id bigint DEFAULT NULL NULL,
upd_by_id bigint DEFAULT NULL NULL,
policy_item_id bigint NOT NULL,
user_id bigint DEFAULT NULL NULL,
sort_order tinyint DEFAULT 0 NULL,
CONSTRAINT x_policy_item_user_perm_PK_id PRIMARY KEY CLUSTERED(id)
)
GO
create table dbo.x_policy_item_group_perm (
id bigint IDENTITY NOT NULL,
guid varchar(1024) DEFAULT NULL NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
added_by_id bigint DEFAULT NULL NULL,
upd_by_id bigint DEFAULT NULL NULL,
policy_item_id bigint NOT NULL,
group_id bigint DEFAULT NULL NULL,
sort_order tinyint DEFAULT 0 NULL,
CONSTRAINT x_policy_item_group_perm_PK_id PRIMARY KEY CLUSTERED(id)
)
GO
create table dbo.x_data_hist (
id bigint IDENTITY NOT NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
obj_guid varchar(1024) NOT NULL,
obj_class_type int NOT NULL,
obj_id bigint NOT NULL,
obj_name varchar(1024) NOT NULL,
version bigint DEFAULT NULL NULL,
action varchar(512) NOT NULL,
from_time datetime NOT NULL,
to_time datetime DEFAULT NULL NULL,
content text NOT NULL,
CONSTRAINT x_data_hist_PK_id PRIMARY KEY CLUSTERED(id)
)
GO
create table dbo.x_modules_master (
id bigint IDENTITY NOT NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
added_by_id bigint DEFAULT NULL NULL,
upd_by_id bigint DEFAULT NULL NULL,
module varchar(1024)NOT NULL,
url varchar(1024) DEFAULT NULL NULL,
CONSTRAINT x_modules_master_PK_id PRIMARY KEY CLUSTERED(id)
)
GO
create table dbo.x_user_module_perm (
id bigint IDENTITY NOT NULL,
user_id bigint DEFAULT NULL NULL,
module_id bigint DEFAULT NULL NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
added_by_id bigint DEFAULT NULL NULL,
upd_by_id bigint DEFAULT NULL NULL,
is_allowed int DEFAULT 1 NOT NULL,
CONSTRAINT x_user_module_perm_PK_id PRIMARY KEY CLUSTERED(id)
)
GO
create table dbo.x_group_module_perm (
id bigint IDENTITY NOT NULL,
group_id bigint DEFAULT NULL NULL,
module_id bigint DEFAULT NULL NULL,
create_time datetime DEFAULT NULL NULL,
update_time datetime DEFAULT NULL NULL,
added_by_id bigint DEFAULT NULL NULL,
upd_by_id bigint DEFAULT NULL NULL,
is_allowed int DEFAULT 1 NOT NULL,
CONSTRAINT x_group_module_perm_PK_id PRIMARY KEY CLUSTERED(id)
)
ALTER TABLE dbo.x_asset ADD CONSTRAINT x_asset_FK_added_by_id FOREIGN KEY(added_by_id) REFERENCES dbo.x_portal_user(id)
GO
ALTER TABLE dbo.x_asset ADD CONSTRAINT x_asset_FK_upd_by_id FOREIGN KEY(upd_by_id) REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_audit_map ADD CONSTRAINT x_audit_map_FK_added_by_id FOREIGN KEY(added_by_id) REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_audit_map ADD CONSTRAINT x_audit_map_FK_group_id FOREIGN KEY(group_id) REFERENCES dbo.x_group (id)
GO
ALTER TABLE dbo.x_audit_map ADD CONSTRAINT x_audit_map_FK_res_id FOREIGN KEY(res_id) REFERENCES dbo.x_resource (id)
GO
ALTER TABLE dbo.x_audit_map ADD CONSTRAINT x_audit_map_FK_upd_by_id FOREIGN KEY(upd_by_id) REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_audit_map ADD CONSTRAINT x_audit_map_FK_user_id FOREIGN KEY(user_id) REFERENCES dbo.x_user (id)
GO
ALTER TABLE dbo.x_auth_sess ADD CONSTRAINT x_auth_sess_FK_added_by_id FOREIGN KEY(added_by_id) REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_auth_sess ADD CONSTRAINT x_auth_sess_FK_upd_by_id FOREIGN KEY(upd_by_id) REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_auth_sess ADD CONSTRAINT x_auth_sess_FK_user_id FOREIGN KEY(user_id) REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_cred_store ADD CONSTRAINT x_cred_store_FK_added_by_id FOREIGN KEY(added_by_id) REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_cred_store ADD CONSTRAINT x_cred_store_FK_upd_by_id FOREIGN KEY(upd_by_id) REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_db_base ADD CONSTRAINT x_db_base_FK_added_by_id FOREIGN KEY(added_by_id) REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_db_base ADD CONSTRAINT x_db_base_FK_upd_by_id FOREIGN KEY(upd_by_id) REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_group ADD CONSTRAINT x_group_FK_added_by_id FOREIGN KEY(added_by_id) REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_group ADD CONSTRAINT x_group_FK_cred_store_id FOREIGN KEY(cred_store_id) REFERENCES dbo.x_cred_store (id)
GO
ALTER TABLE dbo.x_group ADD CONSTRAINT x_group_FK_upd_by_id FOREIGN KEY(upd_by_id) REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_group_groups ADD CONSTRAINT x_group_groups_FK_added_by_id FOREIGN KEY(added_by_id) REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_group_groups ADD CONSTRAINT x_group_groups_FK_group_id FOREIGN KEY(group_id) REFERENCES dbo.x_group (id)
GO
ALTER TABLE dbo.x_group_groups ADD CONSTRAINT x_group_groups_FK_p_group_id FOREIGN KEY(p_group_id) REFERENCES dbo.x_group (id)
GO
ALTER TABLE dbo.x_group_users ADD CONSTRAINT x_group_users_FK_added_by_id FOREIGN KEY(added_by_id) REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_group_users ADD CONSTRAINT x_group_users_FK_p_group_id FOREIGN KEY(p_group_id) REFERENCES dbo.x_group (id)
GO
ALTER TABLE dbo.x_group_users ADD CONSTRAINT x_group_users_FK_upd_by_id FOREIGN KEY(upd_by_id) REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_group_users ADD CONSTRAINT x_group_users_FK_user_id FOREIGN KEY(user_id) REFERENCES dbo.x_user (id)
GO
ALTER TABLE dbo.x_perm_map ADD CONSTRAINT x_perm_map_FK_added_by_id FOREIGN KEY(added_by_id) REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_perm_map ADD CONSTRAINT x_perm_map_FK_group_id FOREIGN KEY(group_id) REFERENCES dbo.x_group (id)
GO
ALTER TABLE dbo.x_perm_map ADD CONSTRAINT x_perm_map_FK_res_id FOREIGN KEY(res_id) REFERENCES dbo.x_resource (id)
GO
ALTER TABLE dbo.x_perm_map ADD CONSTRAINT x_perm_map_FK_upd_by_id FOREIGN KEY(upd_by_id) REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_perm_map ADD CONSTRAINT x_perm_map_FK_user_id FOREIGN KEY(user_id) REFERENCES dbo.x_user (id)
GO
ALTER TABLE dbo.x_policy_export_audit ADD CONSTRAINT x_policy_export_audit_FK_added_by_id FOREIGN KEY(added_by_id) REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_policy_export_audit ADD CONSTRAINT x_policy_export_audit_FK_upd_by_id FOREIGN KEY(upd_by_id) REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_portal_user ADD CONSTRAINT x_portal_user_FK_added_by_id FOREIGN KEY(added_by_id) REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_portal_user ADD CONSTRAINT x_portal_user_FK_upd_by_id FOREIGN KEY(upd_by_id) REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_portal_user_role ADD CONSTRAINT x_portal_user_role_FK_added_by_id FOREIGN KEY(added_by_id) REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_portal_user_role ADD CONSTRAINT x_portal_user_role_FK_upd_by_id FOREIGN KEY(upd_by_id) REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_portal_user_role ADD CONSTRAINT x_portal_user_role_FK_user_id FOREIGN KEY(user_id) REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_resource ADD CONSTRAINT x_resource_FK_added_by_id FOREIGN KEY(added_by_id) REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_resource ADD CONSTRAINT x_resource_FK_asset_id FOREIGN KEY(asset_id) REFERENCES dbo.x_asset (id)
GO
ALTER TABLE dbo.x_resource ADD CONSTRAINT x_resource_FK_parent_id FOREIGN KEY(parent_id) REFERENCES dbo.x_resource (id)
GO
ALTER TABLE dbo.x_resource ADD CONSTRAINT x_resource_FK_upd_by_id FOREIGN KEY(upd_by_id) REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_trx_log ADD CONSTRAINT x_trx_log_FK_added_by_id FOREIGN KEY(added_by_id) REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_trx_log ADD CONSTRAINT x_trx_log_FK_upd_by_id FOREIGN KEY(upd_by_id) REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_user ADD CONSTRAINT x_user_FK_added_by_id FOREIGN KEY(added_by_id) REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_user ADD CONSTRAINT x_user_FK_cred_store_id FOREIGN KEY(cred_store_id) REFERENCES dbo.x_cred_store (id)
GO
ALTER TABLE dbo.x_user ADD CONSTRAINT x_user_FK_upd_by_id FOREIGN KEY(upd_by_id) REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_service_def ADD CONSTRAINT x_service_def_FK_added_by_id FOREIGN KEY(added_by_id)REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_service_def ADD CONSTRAINT x_service_def_FK_upd_by_id FOREIGN KEY(upd_by_id)REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_service ADD CONSTRAINT x_service_FK_added_by_id FOREIGN KEY(added_by_id)REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_service ADD CONSTRAINT x_service_FK_upd_by_id FOREIGN KEY(upd_by_id)REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_service ADD CONSTRAINT x_service_FK_type FOREIGN KEY(type)REFERENCES dbo.x_service_def (id)
GO
ALTER TABLE dbo.x_policy ADD CONSTRAINT x_policy_FK_added_by_id FOREIGN KEY(added_by_id)REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_policy ADD CONSTRAINT x_policy_FK_upd_by_id FOREIGN KEY(upd_by_id)REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_policy ADD CONSTRAINT x_policy_FK_service FOREIGN KEY(service)REFERENCES dbo.x_service (id)
GO
ALTER TABLE dbo.x_service_config_def ADD CONSTRAINT x_service_config_def_FK_defid FOREIGN KEY(def_id)REFERENCES dbo.x_service_def (id)
GO
ALTER TABLE dbo.x_service_config_def ADD CONSTRAINT x_service_conf_def_FK_added_by FOREIGN KEY(added_by_id)REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_service_config_def ADD CONSTRAINT x_service_conf_def_FK_upd_by FOREIGN KEY(upd_by_id)REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_resource_def ADD CONSTRAINT x_resource_def_FK_parent FOREIGN KEY(parent)REFERENCES dbo.x_resource_def (id)
GO
ALTER TABLE dbo.x_resource_def ADD CONSTRAINT x_resource_def_FK_defid FOREIGN KEY(def_id)REFERENCES dbo.x_service_def (id)
GO
ALTER TABLE dbo.x_resource_def ADD CONSTRAINT x_resource_def_FK_added_by FOREIGN KEY(added_by_id)REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_resource_def ADD CONSTRAINT x_resource_def_FK_upd_by FOREIGN KEY(upd_by_id)REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_access_type_def ADD CONSTRAINT x_access_type_def_FK_defid FOREIGN KEY(def_id)REFERENCES dbo.x_service_def (id)
GO
ALTER TABLE dbo.x_access_type_def ADD CONSTRAINT x_access_type_def_FK_added_by FOREIGN KEY(added_by_id)REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_access_type_def ADD CONSTRAINT x_access_type_def_FK_upd_by FOREIGN KEY(upd_by_id)REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_access_type_def_grants ADD CONSTRAINT x_atd_grants_FK_atdid FOREIGN KEY(atd_id)REFERENCES dbo.x_access_type_def (id)
GO
ALTER TABLE dbo.x_access_type_def_grants ADD CONSTRAINT x_access_type_def_grants_FK_added_by FOREIGN KEY(added_by_id)REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_access_type_def_grants ADD CONSTRAINT x_access_type_def_grants_FK_upd_by FOREIGN KEY(upd_by_id)REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_policy_condition_def ADD CONSTRAINT x_policy_condition_def_FK_defid FOREIGN KEY(def_id)REFERENCES dbo.x_service_def (id)
GO
ALTER TABLE dbo.x_policy_condition_def ADD CONSTRAINT x_policy_condition_def_FK_added_by FOREIGN KEY(added_by_id)REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_policy_condition_def ADD CONSTRAINT x_policy_condition_def_FK_upd_by FOREIGN KEY(upd_by_id)REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_context_enricher_def ADD CONSTRAINT x_context_enricher_def_FK_defid FOREIGN KEY(def_id)REFERENCES dbo.x_service_def (id)
GO
ALTER TABLE dbo.x_context_enricher_def ADD CONSTRAINT x_context_enricher_def_FK_added_by_id FOREIGN KEY(added_by_id)REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_context_enricher_def ADD CONSTRAINT x_context_enricher_def_FK_upd_by_id FOREIGN KEY(upd_by_id)REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_enum_def ADD CONSTRAINT x_enum_def_FK_defid FOREIGN KEY(def_id)REFERENCES dbo.x_service_def (id)
GO
ALTER TABLE dbo.x_enum_element_def ADD CONSTRAINT x_enum_element_def_FK_defid FOREIGN KEY(enum_def_id)REFERENCES dbo.x_enum_def (id)
GO
ALTER TABLE dbo.x_enum_def ADD CONSTRAINT x_enum_def_FK_added_by FOREIGN KEY(added_by_id)REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_enum_def ADD CONSTRAINT x_enum_def_FK_upd_by FOREIGN KEY(upd_by_id)REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_service_config_map ADD CONSTRAINT x_service_config_map_FK_ FOREIGN KEY(service)REFERENCES dbo.x_service (id)
GO
ALTER TABLE dbo.x_service_config_map ADD CONSTRAINT x_service_config_map_FK_added_by FOREIGN KEY(added_by_id)REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_service_config_map ADD CONSTRAINT x_service_config_map_FK_upd_by FOREIGN KEY(upd_by_id)REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_policy_resource ADD CONSTRAINT x_policy_resource_FK_policy_id FOREIGN KEY(policy_id)REFERENCES dbo.x_policy (id)
GO
ALTER TABLE dbo.x_policy_resource ADD CONSTRAINT x_policy_resource_FK_res_def_id FOREIGN KEY(res_def_id)REFERENCES dbo.x_resource_def (id)
GO
ALTER TABLE dbo.x_policy_resource ADD CONSTRAINT x_policy_resource_FK_added_by FOREIGN KEY(added_by_id)REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_policy_resource ADD CONSTRAINT x_policy_resource_FK_upd_by FOREIGN KEY(upd_by_id)REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_policy_resource_map ADD CONSTRAINT x_policy_resource_map_FK_resource_id FOREIGN KEY(resource_id)REFERENCES dbo.x_policy_resource (id)
GO
ALTER TABLE dbo.x_policy_resource_map ADD CONSTRAINT x_policy_resource_map_FK_added_by FOREIGN KEY(added_by_id)REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_policy_resource_map ADD CONSTRAINT x_policy_resource_map_FK_upd_by FOREIGN KEY(upd_by_id)REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_policy_item ADD CONSTRAINT x_policy_item_FK_policy_id FOREIGN KEY(policy_id)REFERENCES dbo.x_policy (id)
GO
ALTER TABLE dbo.x_policy_item ADD CONSTRAINT x_policy_item_FK_added_by FOREIGN KEY(added_by_id)REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_policy_item ADD CONSTRAINT x_policy_item_FK_upd_by FOREIGN KEY(upd_by_id)REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_policy_item_access ADD CONSTRAINT x_policy_item_access_FK_pi_id FOREIGN KEY(policy_item_id)REFERENCES dbo.x_policy_item (id)
GO
ALTER TABLE dbo.x_policy_item_access ADD CONSTRAINT x_policy_item_access_FK_atd_id FOREIGN KEY(type)REFERENCES dbo.x_access_type_def (id)
GO
ALTER TABLE dbo.x_policy_item_access ADD CONSTRAINT x_policy_item_access_FK_added_by FOREIGN KEY(added_by_id)REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_policy_item_access ADD CONSTRAINT x_policy_item_access_FK_upd_by FOREIGN KEY(upd_by_id)REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_policy_item_condition ADD CONSTRAINT x_policy_item_condition_FK_pi_id FOREIGN KEY(policy_item_id)REFERENCES dbo.x_policy_item (id)
GO
ALTER TABLE dbo.x_policy_item_condition ADD CONSTRAINT x_policy_item_condition_FK_pcd_id FOREIGN KEY(type)REFERENCES dbo.x_policy_condition_def (id)
GO
ALTER TABLE dbo.x_policy_item_condition ADD CONSTRAINT x_policy_item_condition_FK_added_by FOREIGN KEY(added_by_id)REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_policy_item_condition ADD CONSTRAINT x_policy_item_condition_FK_upd_by FOREIGN KEY(upd_by_id)REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_policy_item_user_perm ADD CONSTRAINT x_policy_item_user_perm_FK_pi_id FOREIGN KEY(policy_item_id)REFERENCES dbo.x_policy_item (id)
GO
ALTER TABLE dbo.x_policy_item_user_perm ADD CONSTRAINT x_policy_item_user_perm_FK_user_id FOREIGN KEY(user_id)REFERENCES dbo.x_user (id)
GO
ALTER TABLE dbo.x_policy_item_user_perm ADD CONSTRAINT x_policy_item_user_perm_FK_added_by FOREIGN KEY(added_by_id)REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_policy_item_user_perm ADD CONSTRAINT x_policy_item_user_perm_FK_upd_by FOREIGN KEY(upd_by_id)REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_policy_item_group_perm ADD CONSTRAINT x_policy_item_group_perm_FK_pi_id FOREIGN KEY(policy_item_id)REFERENCES dbo.x_policy_item (id)
GO
ALTER TABLE dbo.x_policy_item_group_perm ADD CONSTRAINT x_policy_item_group_perm_FK_group_id FOREIGN KEY(group_id)REFERENCES dbo.x_group (id)
GO
ALTER TABLE dbo.x_policy_item_group_perm ADD CONSTRAINT x_policy_item_group_perm_FK_added_by FOREIGN KEY(added_by_id)REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_policy_item_group_perm ADD CONSTRAINT x_policy_item_group_perm_FK_upd_by FOREIGN KEY(upd_by_id)REFERENCES dbo.x_portal_user (id)
GO
ALTER TABLE dbo.x_user_module_perm ADD CONSTRAINT x_user_module_perm_FK_moduleid FOREIGN KEY(module_id) REFERENCES dbo.x_modules_master(id)
GO
ALTER TABLE dbo.x_user_module_perm ADD CONSTRAINT x_user_module_perm_FK_userid FOREIGN KEY(user_id) REFERENCES dbo.x_portal_user(id)
GO
ALTER TABLE dbo.x_group_module_perm ADD CONSTRAINT x_grp_module_perm_FK_module_id FOREIGN KEY(module_id) REFERENCES dbo.x_modules_master(id)
GO
ALTER TABLE dbo.x_group_module_perm ADD CONSTRAINT x_grp_module_perm_FK_group_id FOREIGN KEY(group_id) REFERENCES dbo.x_group(id)
GO
CREATE NONCLUSTERED INDEX x_asset_cr_time ON dbo.x_asset(create_time ASC)
GO
CREATE NONCLUSTERED INDEX x_asset_FK_added_by_id ON dbo.x_asset(added_by_id ASC)
GO
CREATE NONCLUSTERED INDEX x_asset_FK_upd_by_id ON dbo.x_asset(upd_by_id ASC)
GO
CREATE NONCLUSTERED INDEX x_asset_up_time ON dbo.x_asset(update_time ASC)
GO
CREATE NONCLUSTERED INDEX x_audit_map_cr_time ON dbo.x_audit_map(create_time ASC)
GO
CREATE NONCLUSTERED INDEX x_audit_map_FK_added_by_id ON dbo.x_audit_map(added_by_id ASC)
GO
CREATE NONCLUSTERED INDEX x_audit_map_FK_group_id ON dbo.x_audit_map(group_id ASC)
GO
CREATE NONCLUSTERED INDEX x_audit_map_FK_res_id ON dbo.x_audit_map(res_id ASC)
GO
CREATE NONCLUSTERED INDEX x_audit_map_FK_upd_by_id ON dbo.x_audit_map(upd_by_id ASC)
GO
CREATE NONCLUSTERED INDEX x_audit_map_FK_user_id ON dbo.x_audit_map(user_id ASC)
GO
CREATE NONCLUSTERED INDEX x_audit_map_up_time ON dbo.x_audit_map(update_time ASC)
GO
CREATE NONCLUSTERED INDEX x_auth_sess_cr_time ON dbo.x_auth_sess(create_time ASC)
GO
CREATE NONCLUSTERED INDEX x_auth_sess_FK_added_by_id ON dbo.x_auth_sess(added_by_id ASC)
GO
CREATE NONCLUSTERED INDEX x_auth_sess_FK_upd_by_id ON dbo.x_auth_sess(upd_by_id ASC)
GO
CREATE NONCLUSTERED INDEX x_auth_sess_FK_user_id ON dbo.x_auth_sess(user_id ASC)
GO
CREATE NONCLUSTERED INDEX x_auth_sess_up_time ON dbo.x_auth_sess(update_time ASC)
GO
CREATE NONCLUSTERED INDEX x_cred_store_cr_time ON dbo.x_cred_store(create_time ASC)
GO
CREATE NONCLUSTERED INDEX x_cred_store_FK_added_by_id ON dbo.x_cred_store(added_by_id ASC)
GO
CREATE NONCLUSTERED INDEX x_cred_store_FK_upd_by_id ON dbo.x_cred_store(upd_by_id ASC)
GO
CREATE NONCLUSTERED INDEX x_cred_store_up_time ON dbo.x_cred_store(update_time ASC)
GO
CREATE NONCLUSTERED INDEX x_db_base_cr_time ON dbo.x_db_base(create_time ASC)
GO
CREATE NONCLUSTERED INDEX x_db_base_FK_added_by_id ON dbo.x_db_base(added_by_id ASC)
GO
CREATE NONCLUSTERED INDEX x_db_base_FK_upd_by_id ON dbo.x_db_base(upd_by_id ASC)
GO
CREATE NONCLUSTERED INDEX x_db_base_up_time ON dbo.x_db_base(update_time ASC)
GO
CREATE NONCLUSTERED INDEX x_group_cr_time ON dbo.x_group(create_time ASC)
GO
CREATE NONCLUSTERED INDEX x_group_FK_added_by_id ON dbo.x_group(added_by_id ASC)
GO
CREATE NONCLUSTERED INDEX x_group_FK_cred_store_id ON dbo.x_group(cred_store_id ASC)
GO
CREATE NONCLUSTERED INDEX x_group_FK_upd_by_id ON dbo.x_group(upd_by_id ASC)
GO
CREATE NONCLUSTERED INDEX x_group_groups_cr_time ON dbo.x_group_groups(create_time ASC)
GO
CREATE NONCLUSTERED INDEX x_group_groups_FK_added_by_id ON dbo.x_group_groups(added_by_id ASC)
GO
CREATE NONCLUSTERED INDEX x_group_groups_FK_group_id ON dbo.x_group_groups(group_id ASC)
GO
CREATE NONCLUSTERED INDEX x_group_groups_FK_p_group_id ON dbo.x_group_groups(p_group_id ASC)
GO
CREATE NONCLUSTERED INDEX x_group_groups_FK_upd_by_id ON dbo.x_group_groups(upd_by_id ASC)
GO
CREATE NONCLUSTERED INDEX x_group_groups_up_time ON dbo.x_group_groups(update_time ASC)
GO
CREATE NONCLUSTERED INDEX x_group_up_time ON dbo.x_group(update_time ASC)
GO
CREATE NONCLUSTERED INDEX x_group_users_cr_time ON dbo.x_group_users(create_time ASC)
GO
CREATE NONCLUSTERED INDEX x_group_users_FK_added_by_id ON dbo.x_group_users(added_by_id ASC)
GO
CREATE NONCLUSTERED INDEX x_group_users_FK_p_group_id ON dbo.x_group_users(p_group_id ASC)
GO
CREATE NONCLUSTERED INDEX x_group_users_FK_upd_by_id ON dbo.x_group_users(upd_by_id ASC)
GO
CREATE NONCLUSTERED INDEX x_group_users_FK_user_id ON dbo.x_group_users(user_id ASC)
GO
CREATE NONCLUSTERED INDEX x_group_users_up_time ON dbo.x_group_users(update_time ASC)
GO
CREATE NONCLUSTERED INDEX x_perm_map_cr_time ON dbo.x_perm_map(create_time ASC)
GO
CREATE NONCLUSTERED INDEX x_perm_map_FK_added_by_id ON dbo.x_perm_map(added_by_id ASC)
GO
CREATE NONCLUSTERED INDEX x_perm_map_FK_group_id ON dbo.x_perm_map(group_id ASC)
GO
CREATE NONCLUSTERED INDEX x_perm_map_FK_res_id ON dbo.x_perm_map(res_id ASC)
GO
CREATE NONCLUSTERED INDEX x_perm_map_FK_upd_by_id ON dbo.x_perm_map(upd_by_id ASC)
GO
CREATE NONCLUSTERED INDEX x_perm_map_FK_user_id ON dbo.x_perm_map(user_id ASC)
GO
CREATE NONCLUSTERED INDEX x_perm_map_up_time ON dbo.x_perm_map(update_time ASC)
GO
CREATE NONCLUSTERED INDEX x_policy_export_audit_cr_time ON dbo.x_policy_export_audit(create_time ASC)
GO
CREATE NONCLUSTERED INDEX x_policy_export_audit_FK_added_by_id ON dbo.x_policy_export_audit(added_by_id ASC)
GO
CREATE NONCLUSTERED INDEX x_policy_export_audit_FK_upd_by_id ON dbo.x_policy_export_audit(upd_by_id ASC)
GO
CREATE NONCLUSTERED INDEX x_policy_export_audit_up_time ON dbo.x_policy_export_audit(update_time ASC)
GO
CREATE NONCLUSTERED INDEX x_portal_user_cr_time ON dbo.x_portal_user(create_time ASC)
GO
CREATE NONCLUSTERED INDEX x_portal_user_email ON dbo.x_portal_user(email ASC)
GO
CREATE NONCLUSTERED INDEX x_portal_user_FK_added_by_id ON dbo.x_portal_user(added_by_id ASC)
GO
CREATE NONCLUSTERED INDEX x_portal_user_FK_upd_by_id ON dbo.x_portal_user(upd_by_id ASC)
GO
CREATE NONCLUSTERED INDEX x_portal_user_name ON dbo.x_portal_user(first_name ASC)
GO
CREATE NONCLUSTERED INDEX x_portal_user_role_cr_time ON dbo.x_portal_user_role(create_time ASC)
GO
CREATE NONCLUSTERED INDEX x_portal_user_role_FK_added_by_id ON dbo.x_portal_user_role(added_by_id ASC)
GO
CREATE NONCLUSTERED INDEX x_portal_user_role_FK_upd_by_id ON dbo.x_portal_user_role(upd_by_id ASC)
GO
CREATE NONCLUSTERED INDEX x_portal_user_role_FK_user_id ON dbo.x_portal_user_role(user_id ASC)
GO
CREATE NONCLUSTERED INDEX x_portal_user_role_up_time ON dbo.x_portal_user_role(update_time ASC)
GO
CREATE NONCLUSTERED INDEX x_portal_user_up_time ON dbo.x_portal_user(update_time ASC)
GO
CREATE NONCLUSTERED INDEX x_resource_cr_time ON dbo.x_resource(create_time ASC)
GO
CREATE NONCLUSTERED INDEX x_resource_FK_added_by_id ON dbo.x_resource(added_by_id ASC)
GO
CREATE NONCLUSTERED INDEX x_resource_FK_asset_id ON dbo.x_resource(asset_id ASC)
GO
CREATE NONCLUSTERED INDEX x_resource_FK_parent_id ON dbo.x_resource(parent_id ASC)
GO
CREATE NONCLUSTERED INDEX x_resource_FK_upd_by_id ON dbo.x_resource(upd_by_id ASC)
GO
CREATE NONCLUSTERED INDEX x_resource_up_time ON dbo.x_resource(update_time ASC)
GO
CREATE NONCLUSTERED INDEX x_trx_log_cr_time ON dbo.x_trx_log(create_time ASC)
GO
CREATE NONCLUSTERED INDEX x_trx_log_FK_added_by_id ON dbo.x_trx_log(added_by_id ASC)
GO
CREATE NONCLUSTERED INDEX x_trx_log_FK_upd_by_id ON dbo.x_trx_log(upd_by_id ASC)
GO
CREATE NONCLUSTERED INDEX x_trx_log_up_time ON dbo.x_trx_log(update_time ASC)
GO
CREATE NONCLUSTERED INDEX x_user_cr_time ON dbo.x_user(create_time ASC)
GO
CREATE NONCLUSTERED INDEX x_user_FK_added_by_id ON dbo.x_user(added_by_id ASC)
GO
CREATE NONCLUSTERED INDEX x_user_FK_cred_store_id ON dbo.x_user(cred_store_id ASC)
GO
CREATE NONCLUSTERED INDEX x_user_FK_upd_by_id ON dbo.x_user(upd_by_id ASC)
GO
CREATE NONCLUSTERED INDEX x_user_up_time ON dbo.x_user(update_time ASC)
GO
CREATE NONCLUSTERED INDEX xa_access_audit_cr_time ON dbo.xa_access_audit(create_time ASC)
GO
CREATE NONCLUSTERED INDEX xa_access_audit_event_time ON dbo.xa_access_audit(event_time ASC)
GO
CREATE NONCLUSTERED INDEX xa_access_audit_added_by_id ON dbo.xa_access_audit(added_by_id ASC)
GO
CREATE NONCLUSTERED INDEX xa_access_audit_upd_by_id ON dbo.xa_access_audit(upd_by_id ASC)
GO
CREATE NONCLUSTERED INDEX xa_access_audit_up_time ON dbo.xa_access_audit(update_time ASC)
GO
CREATE NONCLUSTERED INDEX x_service_def_added_by_id ON dbo.x_service_def(added_by_id ASC)
GO
CREATE NONCLUSTERED INDEX x_service_def_upd_by_id ON dbo.x_service_def(upd_by_id ASC)
GO
CREATE NONCLUSTERED INDEX x_service_def_cr_time ON dbo.x_service_def(create_time ASC)
GO
CREATE NONCLUSTERED INDEX x_service_def_up_time ON dbo.x_service_def(update_time ASC)
GO
CREATE NONCLUSTERED INDEX x_service_added_by_id ON dbo.x_service(added_by_id ASC)
GO
CREATE NONCLUSTERED INDEX x_service_upd_by_id ON dbo.x_service(upd_by_id ASC)
GO
CREATE NONCLUSTERED INDEX x_service_cr_time ON dbo.x_service(create_time ASC)
GO
CREATE NONCLUSTERED INDEX x_service_up_time ON dbo.x_service(update_time ASC)
GO
CREATE NONCLUSTERED INDEX x_service_type ON dbo.x_service(type ASC)
GO
CREATE NONCLUSTERED INDEX x_policy_added_by_id ON dbo.x_policy(added_by_id ASC)
GO
CREATE NONCLUSTERED INDEX x_policy_upd_by_id ON dbo.x_policy(upd_by_id ASC)
GO
CREATE NONCLUSTERED INDEX x_policy_cr_time ON dbo.x_policy(create_time ASC)
GO
CREATE NONCLUSTERED INDEX x_policy_up_time ON dbo.x_policy(update_time ASC)
GO
CREATE NONCLUSTERED INDEX x_policy_service ON dbo.x_policy(service ASC)
GO
CREATE NONCLUSTERED INDEX x_policy_resource_signature ON dbo.x_policy(resource_signature ASC)
GO
CREATE NONCLUSTERED INDEX x_resource_def_parent ON dbo.x_resource_def(parent ASC)
GO
CREATE NONCLUSTERED INDEX x_usr_module_perm_idx_moduleid ON dbo.x_user_module_perm(module_id ASC)
GO
CREATE NONCLUSTERED INDEX x_usr_module_perm_idx_userid ON dbo.x_user_module_perm(user_id ASC)
GO
CREATE NONCLUSTERED INDEX x_grp_module_perm_idx_groupid ON dbo.x_group_module_perm(group_id ASC)
GO
CREATE NONCLUSTERED INDEX x_grp_module_perm_idx_moduleid ON dbo.x_group_module_perm(module_id ASC)
GO
insert into x_portal_user (create_time,update_time,first_name,last_name,pub_scr_name,login_id,password,email,status) values (GETDATE(),GETDATE(),'Admin','','Admin','admin','ceb4f32325eda6142bd65215f4c0f371','',1)
GO
insert into x_portal_user_role (create_time,update_time,user_id,user_role,status) values (GETDATE(),GETDATE(),1,'ROLE_SYS_ADMIN',1)
GO
insert into x_user (create_time,update_time,user_name,status,descr) values (GETDATE(),GETDATE(),'admin',0,'Administrator')
GO
insert into x_group (added_by_id,create_time,descr,group_type,group_name,status,update_time,upd_by_id) values (1,GETDATE(),'public group',0,'public',0,GETDATE(),1)
GO
INSERT INTO x_modules_master(create_time,update_time,added_by_id,upd_by_id,module,url) VALUES(GETDATE(),GETDATE(),1,1,'Resource Based Policies','')
GO
INSERT INTO x_modules_master(create_time,update_time,added_by_id,upd_by_id,module,url) VALUES(GETDATE(),GETDATE(),1,1,'Users/Groups','')
GO
INSERT INTO x_modules_master(create_time,update_time,added_by_id,upd_by_id,module,url) VALUES(GETDATE(),GETDATE(),1,1,'Reports','')
GO
INSERT INTO x_modules_master(create_time,update_time,added_by_id,upd_by_id,module,url) VALUES(GETDATE(),GETDATE(),1,1,'Audit','')
GO
INSERT INTO x_modules_master(create_time,update_time,added_by_id,upd_by_id,module,url) VALUES(GETDATE(),GETDATE(),1,1,'Key Manager','')
GO
insert into x_portal_user (create_time,update_time,first_name,last_name,pub_scr_name,login_id,password,email,status) values (GETDATE(),GETDATE(),'rangerusersync','','rangerusersync','rangerusersync','70b8374d3dfe0325aaa5002a688c7e3b','rangerusersync',1)
GO
insert into x_portal_user_role (create_time,update_time,user_id,user_role,status) values (GETDATE(),GETDATE(),2,'ROLE_SYS_ADMIN',1)
GO
insert into x_user (create_time,update_time,user_name,status,descr) values (GETDATE(),GETDATE(),'rangerusersync',0,'rangerusersync')
GO
insert into x_portal_user (create_time,update_time,first_name,last_name,pub_scr_name,login_id,password,email,status) values (GETDATE(),GETDATE(),'keyadmin','','keyadmin','keyadmin','a05f34d2dce2b4688fa82e82a89ba958','keyadmin',1)
GO
insert into x_portal_user_role (create_time,update_time,user_id,user_role,status) values (GETDATE(),GETDATE(),3,'ROLE_KEY_ADMIN',1)
GO
insert into x_user (create_time,update_time,user_name,status,descr) values (GETDATE(),GETDATE(),'keyadmin',0,'keyadmin')
GO
exit | the_stack |
\set ECHO none
BEGIN;
\i test/pgtap-core.sql
\i sql/semver.sql
SELECT plan(312);
--SELECT * FROM no_plan();
SELECT has_type('semver');
SELECT is( NULL::semver, NULL, 'semvers should be NULLable' );
SELECT lives_ok(
$$ SELECT '$$ || v || $$'::semver $$,
'"' || v || '" is a valid semver'
) FROM unnest(ARRAY[
'1.2.2',
'0.2.2',
'0.0.0',
'0.1.999',
'9999.9999999.823823',
'1.0.0-beta1',
'1.0.0-beta2',
'1.0.0',
'1.0.0-1',
'1.0.0-alpha+d34dm34t',
'1.0.0+d34dm34t',
'20110204.0.0',
'1.0.0-alpha.0a',
'1.0.0+010',
'1.0.0+alpha.010',
'1.0.0-0AEF'
]) AS v;
SELECT throws_ok(
$$ SELECT '$$ || v || $$'::semver $$,
NULL,
'"' || v || '" is not a valid semver'
) FROM unnest(ARRAY[
'1.2',
'1.2.02',
'1.2.2-',
'1.2.3b#5',
'03.3.3',
'v1.2.2',
'1.3b',
'1.4b.0',
'1v',
'1v.2.2v',
'1.2.4b.5',
'1.0.0-alpha.010',
'1.0.0-02799',
'1.1.2+.123',
'1.1.2-.123',
'1.2.3-ñø',
'1.2.3+ñø1'
]) AS v;
-- Test =, <=, and >=.
SELECT collect_tap(ARRAY[
ok(semver_cmp(lv::semver, rv::semver) = 0, 'semver(' || lv || ', ' || rv || ') should = 0'),
ok(lv::semver = rv::semver, 'v' || lv || ' should = v' || rv),
ok(lv::semver <= rv::semver, 'v' || lv || ' should be <= v' || rv),
ok(lv::semver >= rv::semver, 'v' || lv || ' should be >= v' || rv)
]) FROM (VALUES
('1.2.2', '1.2.2'),
('1.2.23', '1.2.23'),
('0.0.0', '0.0.0'),
('999.888.7777', '999.888.7777'),
('0.1.2-beta3', '0.1.2-beta3')
) AS f(lv, rv);
-- Test semver <> semver
SELECT collect_tap(ARRAY[
ok(semver_cmp(lv::semver, rv::semver) <> 0, 'semver(' || lv || ', ' || rv || ') should <> 0'),
ok(lv::semver <> rv::semver, 'v' || lv || ' should not equal v' || rv)
]) FROM (VALUES
('1.2.2', '1.2.3'),
('0.0.1', '1.0.0'),
('1.0.1', '1.1.0'),
('1.1.1', '1.1.0'),
('1.2.3-b', '1.2.3'),
('1.2.3', '1.2.3-b'),
('1.2.3-a', '1.2.3-b'),
('1.2.3-aaaaaaa1', '1.2.3-aaaaaaa2'),
('1.2.3-1.2.3', '1.2.3-1.2.3.4')
) AS f(lv, rv);
-- Test >, >=, <, and <=.
SELECT collect_tap(ARRAY[
ok( semver_cmp(lv::semver, rv::semver) > 0, 'semver(' || lv || ', ' || rv || ') should > 0'),
ok( semver_cmp(rv::semver, lv::semver) < 0, 'semver(' || rv || ', ' || lv || ') should < 0'),
ok(lv::semver > rv::semver, 'v' || lv || ' should be > v' || rv),
ok(lv::semver >= rv::semver, 'v' || lv || ' should be >= v' || rv),
ok(rv::semver < lv::semver, 'v' || rv || ' should be < v' || lv),
ok(rv::semver <= lv::semver, 'v' || rv || ' should be <= v' || lv)
]) FROM (VALUES
('2.2.2', '1.1.1'),
('2.2.2', '2.1.1'),
('2.2.2', '2.2.1'),
('2.2.2-b', '2.2.1'),
('2.2.2', '2.2.2-b'),
('2.2.2-c', '2.2.2-b'),
('2.2.2-rc-2', '2.2.2-RC-1'),
('2.2.2-rc-1', '2.2.2-RC-1'),
('0.9.10', '0.9.9'),
('1.0.1-1.2.3', '1.0.1-0.9.9.9')
) AS f(lv, rv);
-- Test to_semver().
SELECT has_function('to_semver');
SELECT has_function('to_semver', ARRAY['text']);
SELECT function_returns('to_semver', 'semver');
SELECT is(
to_semver(dirty),
clean::semver,
'to_semver(' || dirty || ') should return ' || clean
) FROM (VALUES
('1.2.2', '1.2.2'),
('01.2.2', '1.2.2'),
('1.02.2', '1.2.2'),
('1.2.02', '1.2.2'),
('1.2.02b', '1.2.2-b'),
('1.2.02beta-3 ', '1.2.2-beta-3'),
('1.02.02rc1', '1.2.2-rc1'),
('1.0', '1.0.0'),
('1', '1.0.0'),
('.0.02', '0.0.2'),
('1..02', '1.0.2'),
('1..', '1.0.0'),
('1.1', '1.1.0'),
('1.2.b1', '1.2.0-b1'),
('9.0beta4', '9.0.0-beta4'), -- PostgreSQL format.
('9b', '9.0.0-b'),
('rc1', '0.0.0-rc1'),
('', '0.0.0'),
('..2', '0.0.2'),
('1.2.3 a', '1.2.3-a'),
('..2 b', '0.0.2-b'),
(' 012.2.2', '12.2.2'),
('20110204', '20110204.0.0')
) v(dirty, clean);
SELECT is(
to_semver(clean),
clean::semver,
'to_semver(' || clean || ') should return incoming text'
) FROM (VALUES
('1.0.0-alpha'), -- SV2 9.
('1.0.0-alpha.1'), -- SV2 9.
('1.0.0-0.3.7'), -- SV2 9.
('1.0.0-x.7.z.92'), -- SV2 9.
('1.0.0-alpha+001'), -- SV2 10.
('1.0.0+20130313144700'), -- SV2 10.
('1.0.0-beta+exp.sha.5114f85') -- SV2 10.
) v(clean);
-- to_semver still needs to reject truly bad input
SELECT throws_ok(
$$ SELECT '$$ || v || $$'::semver $$,
NULL,
'"' || v || '" is not a valid semver'
) FROM unnest(ARRAY[
'1.2.0 beta 4',
'1.2.2-',
'1.2.3b#5',
'v1.2.2',
'1.4b.0',
'1v.2.2v',
'1.2.4b.5',
'1.2.3.4',
'1.2.3 4',
'1.2000000000000000.3.4'
]) AS v;
-- Test sort ordering
CREATE TABLE vs (
version semver
);
INSERT INTO vs VALUES ('1.2.0'), ('1.0.0'), ('1.0.0-p0'), ('0.9.9'), ('0.9.10');
SELECT is(max(version), '1.2.0', 'max(semver) should work')
FROM vs;
SELECT is(min(version), '0.9.9', 'min(semver) should work')
FROM vs;
SELECT results_eq(
$$ SELECT version FROM vs ORDER BY version USING < $$,
$$ VALUES ('0.9.9'::semver), ('0.9.10'::semver), ('1.0.0-p0'::semver), ('1.0.0'::semver), ('1.2.0'::semver) $$,
'ORDER BY semver USING < should work'
);
SELECT results_eq(
$$ SELECT version FROM vs ORDER BY version USING > $$,
$$ VALUES ('1.2.0'::semver), ('1.0.0'::semver), ('1.0.0-p0'::semver), ('0.9.10'::semver), ('0.9.9'::semver) $$,
'ORDER BY semver USING > should work'
);
-- Test constructors.
SELECT is( text('1.2.0'::semver), '1.2.0', 'construct to text' );
SELECT is( semver('1.2.0'), '1.2.0'::semver, 'construct from text' );
SELECT is( semver(1.2), '1.2.0'::semver, 'construct from bare number' );
SELECT is( semver(1.2::numeric), '1.2.0'::semver, 'construct from numeric' );
SELECT is( semver(1), '1.0.0'::semver, 'construct from bare integer' );
SELECT is( semver(1::integer), '1.0.0'::semver, 'construct from integer' );
SELECT is( semver(1::bigint), '1.0.0'::semver, 'construct from bigint' );
SELECT is( semver(1::smallint), '1.0.0'::semver, 'construct from smallint' );
SELECT is( semver(1.2::decimal), '1.2.0'::semver, 'construct from decimal' );
SELECT is( semver(1.2::real), '1.2.0'::semver, 'construct from real' );
SELECT is( semver(1.2::double precision), '1.2.0'::semver, 'construct from double' );
SELECT is( semver(1.2::float), '1.2.0'::semver, 'construct from float' );
-- Test casting.
SELECT is( semver('1.2.0'::text), '1.2.0', 'cast to text' );
SELECT is( text('1.2.0')::semver, '1.2.0'::semver, 'cast from text' );
SELECT is( 1::semver, '1.0.0'::semver, 'Cast from bare integer');
SELECT is( 1.2::semver, '1.2.0'::semver, 'Cast from bare number');
SELECT is( 1.2::numeric::semver, '1.2.0'::semver, 'Cast from numeric');
SELECT is( 1::integer::semver, '1.0.0'::semver, 'Cast from integer');
SELECT is( 1::bigint::semver, '1.0.0'::semver, 'Cast from bigint');
SELECT is( 1::smallint::semver, '1.0.0'::semver, 'Cast from smallint');
SELECT is( 1.0::decimal::semver, '1.0.0'::semver, 'Cast from decimal');
SELECT is( 1::decimal::semver, '1.0.0'::semver, 'Cast from decimal');
SELECT is( 1.0::real::semver, '1.0.0'::semver, 'Cast from real');
SELECT is( 1.0::double precision::semver, '1.0.0'::semver, 'Cast from double precision');
SELECT is( 1.0::float::semver, '1.0.0'::semver, 'Cast from float');
-- Test casting some more.
SELECT IS(lv::text, rv, 'Should correctly cast "' || rv || '" to text')
FROM (VALUES
('1.0.0-beta'::semver, '1.0.0-beta'),
('1.0.0-beta1'::semver, '1.0.0-beta1'),
('1.0.0-alpha'::semver, '1.0.0-alpha'),
('1.0.0-alph'::semver, '1.0.0-alph'),
('1.0.0-food'::semver, '1.0.0-food'),
('1.0.0-f111'::semver, '1.0.0-f111'),
('1.0.0-f111asbcdasdfasdfasdfasdfasdfasdffasdfadsf'::semver,
'1.0.0-f111asbcdasdfasdfasdfasdfasdfasdffasdfadsf')
) AS f(lv, rv);
-- SEMV 2.0.0 tests.
SELECT lives_ok(
$$ SELECT '$$ || v || $$'::semver $$,
'"' || v || '" is a valid 2.0.0 semver'
) FROM unnest(ARRAY[
'1.0.0+1',
'1.0.0-1+1',
'1.0.0-1.1+1',
'1.0.0-1.1.1.1.1.1.1.1.1.1.1+1.1.1.1.1.1.1.1',
'1.0.0-1.2',
'1.0.0-1.0.2',
'1.0.0-alpha',
'1.0.0-alpha.1',
'1.0.0-0.3.7',
'1.0.0-x.7.z.92',
'0.2.13+1583426134.07de632'
]) AS v;
SELECT throws_ok(
$$ SELECT '$$ || v || $$'::semver $$,
NULL,
'"' || v || '" is not a valid 2.0.0 semver'
) FROM unnest(ARRAY[
'1.0.0-a..',
'1.0.0-a.1.',
'1.0.0+1_1',
'1.0.0-1....',
'1.0.0-1_2',
'1.0.0-1.02'
]) AS v;
DELETE FROM vs;
INSERT INTO vs VALUES ('0.9.9-a1.1+1234'::semver), ('0.9.9-a1.2.3'::semver), ('0.9.9-a1.2'::semver), ('0.9.9'::semver), ('1.0.0+99'::semver), ('1.0.0-1'::semver);
SELECT results_eq(
$$ SELECT version FROM vs ORDER BY version USING < $$,
$$ VALUES ('0.9.9-a1.1+1234'::semver), ('0.9.9-a1.2'::semver), ('0.9.9-a1.2.3'::semver), ('0.9.9'::semver), ('1.0.0-1'::semver), ('1.0.0+99'::semver) $$,
'ORDER BY semver (2.0.0) USING < should work'
);
SELECT results_eq(
$$ SELECT version FROM vs ORDER BY version USING > $$,
$$ VALUES ('1.0.0+99'::semver), ('1.0.0-1'::semver), ('0.9.9'::semver), ('0.9.9-a1.2.3'::semver), ('0.9.9-a1.2'::semver), ('0.9.9-a1.1+1234'::semver) $$,
'ORDER BY semver (2.0.0) USING > should work'
);
SELECT collect_tap(ARRAY[
ok(semver_cmp(lv::semver, rv::semver) = 0, 'semver(' || lv || ', ' || rv || ') should = 0'),
ok(lv::semver = rv::semver, 'v' || lv || ' should = v' || rv),
ok(lv::semver <= rv::semver, 'v' || lv || ' should be <= v' || rv),
ok(lv::semver >= rv::semver, 'v' || lv || ' should be >= v' || rv)
]) FROM (VALUES
('1.0.0-1+1', '1.0.0-1+5'),
('1.0.0-1.1+1', '1.0.0-1.1+5')
) AS f(lv, rv);
-- Regressions.
SELECT is(
to_semver(lv)::TEXT, rv,
'Should correctly represent "' || lv || '" as "' || rv || '"'
) FROM (VALUES
('0.5.0-release1', '0.5.0-release1'),
('0.5.0release1', '0.5.0-release1'),
('0.5-release1', '0.5.0-release1'),
('0.5release1', '0.5.0-release1'),
('0.5-1', '0.5.0-1'),
('1.2.3-1.02', '1.2.3-1.2')
) AS f(lv, rv);
-- Test is_semver().
SELECT has_function('is_semver');
SELECT has_function('is_semver', ARRAY['text']);
SELECT function_returns('is_semver', 'boolean');
SELECT is(
is_semver(stimulus),
expected,
'is_semver(' || stimulus || ') should return ' || expected::text
) FROM (VALUES
('1.2.2', true),
('0.2.2', true),
('0.0.0', true),
('0.1.999', true),
('9999.9999999.823823', true),
('1.0.0-beta1', true),
('1.0.0-beta2', true),
('1.0.0', true),
('1.0.0-1', true),
('1.0.0-alpha+d34dm34t', true),
('1.0.0+d34dm34t', true),
('20110204.0.0', true),
('1.2', false),
('1.2.02', false),
('1.2.2-', false),
('1.2.3b#5', false),
('03.3.3', false),
('v1.2.2', false),
('1.3b', false),
('1.4b.0', false),
('1v', false),
('1v.2.2v', false),
('1.2.4b.5', false),
('2016.5.18-MYW-600', true),
('1010.5.0+2016-05-27-1832', true),
('0.2.13+1583426134.07de632', true)
) v(stimulus, expected);
-- issue-gh-23
SELECT lives_ok(
$$ SELECT '$$ || v || $$'::semver $$,
'"' || v || '" is a valid semver'
) FROM unnest(ARRAY[
'2.3.0+80'
]) AS v;
SELECT is(
to_semver(dirty),
clean::semver,
'to_semver(' || dirty || ') should return ' || clean
) FROM (VALUES
('2.3.0+80', '2.3.0+80')
) v(dirty, clean);
SELECT is(lv::text, rv, 'Should correctly cast "' || rv || '" to text')
FROM (VALUES
('2.3.0+80'::semver, '2.3.0+80')
) AS f(lv, rv);
SELECT isnt(lv::semver > rv::semver, true, '"' || lv || '" > "' || rv || '" (NOT!)')
FROM (VALUES
('2.3.0+80', '2.3.0+110')
) AS f(lv, rv);
SELECT is(lv::semver > rv::semver, true, '"' || lv || '" > "' || rv || '"')
FROM (VALUES
('2.3.0+80', '2.3.0-alpha+110')
) AS f(lv, rv);
CREATE TABLE vs23 (
version semver
);
INSERT INTO vs23 VALUES ('1.0.0-alpha'), ('1.0.0-alpha.1'), ('1.0.0-alpha.beta'), ('1.0.0-beta'), ('1.0.0-beta.2'), ('1.0.0-beta.11'), ('1.0.0-rc.1'), ('1.0.0');
SELECT results_eq(
$$ SELECT version FROM vs23 ORDER BY version USING < $$,
$$ VALUES ('1.0.0-alpha'::semver), ('1.0.0-alpha.1'::semver), ('1.0.0-alpha.beta'::semver), ('1.0.0-beta'::semver), ('1.0.0-beta.2'::semver), ('1.0.0-beta.11'::semver), ('1.0.0-rc.1'::semver), ('1.0.0'::semver) $$,
'ORDER BY semver USING < should work (section 11)'
);
SELECT results_eq(
$$ SELECT version FROM vs23 ORDER BY version USING > $$,
$$ VALUES ('1.0.0'::semver), ('1.0.0-rc.1'::semver), ('1.0.0-beta.11'::semver), ('1.0.0-beta.2'::semver), ('1.0.0-beta'::semver), ('1.0.0-alpha.beta'::semver), ('1.0.0-alpha.1'::semver), ('1.0.0-alpha'::semver) $$,
'ORDER BY semver USING > should work (section 11)'
);
SELECT is(lv::semver = rv::semver, true, '"' || lv || '" = "' || rv || '"')
FROM (VALUES
('1.0.0', '1.0.0+535')
) AS f(lv, rv);
SELECT isnt(lv::semver < rv::semver, true, '"' || lv || '" < "' || rv || '" (NOT!)')
FROM (VALUES
('1.0.0', '1.0.0+535')
) AS f(lv, rv);
SELECT isnt(lv::semver > rv::semver, true, '"' || lv || '" > "' || rv || '" (NOT!)')
FROM (VALUES
('1.0.0', '1.0.0+535')
) AS f(lv, rv);
-- Test get_semver_major
SELECT has_function('get_semver_major');
SELECT has_function('get_semver_major', 'semver');
SELECT function_returns('get_semver_major', 'integer');
SELECT is(get_semver_major('2.1.0-alpha'::semver), 2, 'major version check');
-- Test get_semver_minor
SELECT has_function('get_semver_minor');
SELECT has_function('get_semver_minor', 'semver');
SELECT function_returns('get_semver_minor', 'integer');
SELECT is(get_semver_minor('2.1.0-alpha'::semver), 1, 'minor version check');
-- Test get_semver_patch
SELECT has_function('get_semver_patch');
SELECT has_function('get_semver_patch', 'semver');
SELECT function_returns('get_semver_patch', 'integer');
SELECT is(get_semver_patch('2.1.0-alpha'::semver), 0, 'patch version check');
-- Test get_semver_prerelease
SELECT has_function('get_semver_prerelease');
SELECT has_function('get_semver_prerelease', 'semver');
SELECT function_returns('get_semver_prerelease', 'text');
SELECT is(get_semver_prerelease('2.1.0-alpha'::semver), 'alpha', 'prerelease label check');
SELECT is(get_semver_prerelease('2.1.0-alpha+build'::semver), 'alpha', 'prerelease label check. must return prerelease only');
SELECT is(get_semver_prerelease('2.1.0+build'::semver), '', 'prerelease label check. must return empty string');
-- Test range type.
SELECT ok(
'1.0.0'::semver <@ '[1.0.0, 2.0.0]'::semverrange,
'1.0.0 should be in range [1.0.0, 2.0.0]'
);
SELECT ok(
NOT '1.0.0'::semver <@ '[1.0.1, 2.0.0]'::semverrange,
'1.0.0 should not be in range [1.0.1, 2.0.0]'
);
SELECT ok(
NOT semverrange('1.0.0', '2.0.0') @> '2.0.0'::semver,
'2.0.0 should not be in range [1.0.1, 2.0.0)'
);
SELECT ok(
semverrange('1.0.0', '2.0.0') @> '1.9999.9999'::semver,
'1.9999.9999 should be in range [1.0.1, 2.0.0)'
);
SELECT ok(
'1000.0.0'::semver <@ '[1.0.0,]'::semverrange,
'1000.0.0 should be in range [1.0.0,)'
);
SELECT bag_eq($$
SELECT version, version <@ ANY(
'{"(1.0.0,1.2.3)", "(1.2.3,1.4.5)", "(1.4.5,2.0.0)"}'::semverrange[]
) AS valid FROM (VALUES
('1.0.0'::semver), ('1.0.1'), ('1.2.3'), ('1.2.4'), ('1.4.4'), ('1.4.5'),
('1.7.0'), ('2.0.0')
) AS v(version)
$$, $$ VALUES
('1.0.0'::semver, false),
('1.0.1', true),
('1.2.3', false),
('1.2.4', true),
('1.4.4', true),
('1.4.5', false),
('1.7.0', true),
('2.0.0', false)
$$, 'Should be able to work with arrays of semverranges');
-- Test formatting (issue-gh-48)
SELECT is(
'1.0.0+1234567890123456789012345'::semver::text,
'1.0.0+1234567890123456789012345',
'Should properly format a 32 character semver'
);
SELECT is(
'1.0.0+12345678901234567890123456'::semver::text,
'1.0.0+12345678901234567890123456',
'Should properly format a 33 character semver'
);
-- issue-gh-46
SELECT is(
'1.0.0-alpha-0'::semver::text, '1.0.0-alpha-0',
'Should propery format a prerelease with a hyphen'
);
-- Make sure hashing works by forcing a hash aggregation. Also confirms
-- that prerelease strings are compared case-sensitively.
SET enable_sort=false;
SELECT bag_eq(
$$
SELECT DISTINCT v FROM (VALUES
('1.2.1'::SEMVER),
('1.2.1-RC1'),
('2.0.0-alph'),
('2.0.0-ALPH'),
('1.2.1'),
('9.20.30-OMG-1.23')
) v(v)
$$, $$
(VALUES
('1.2.1'::SEMVER),
('1.2.1-RC1'),
('2.0.0-alph'),
('2.0.0-ALPH'),
('9.20.30-OMG-1.23')
)
$$,
'Should get distinct values via hash aggregation'
);
SELECT * FROM finish();
ROLLBACK; | the_stack |
-- 2020-03-22T11:31:30.536Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,IsActive,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,570122,598494,0,541942,TO_TIMESTAMP('2020-03-22 12:31:30','YYYY-MM-DD HH24:MI:SS'),100,'Belegdatum desProvisionsauslösers',7,'de.metas.contracts.commission','Y','Y','N','N','N','N','N','Datum',TO_TIMESTAMP('2020-03-22 12:31:30','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2020-03-22T11:31:30.537Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Field_ID=598494 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2020-03-22T11:31:30.539Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(577598)
;
-- 2020-03-22T11:31:30.541Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=598494
;
-- 2020-03-22T11:31:30.542Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(598494)
;
-- 2020-03-22T11:32:08.871Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=50,Updated=TO_TIMESTAMP('2020-03-22 12:32:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561844
;
-- 2020-03-22T11:32:10.924Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=40,Updated=TO_TIMESTAMP('2020-03-22 12:32:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561843
;
-- 2020-03-22T11:32:16.598Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=30,Updated=TO_TIMESTAMP('2020-03-22 12:32:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=566607
;
-- 2020-03-22T11:32:36.359Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,Description,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,598494,0,541942,543528,566611,'F',TO_TIMESTAMP('2020-03-22 12:32:36','YYYY-MM-DD HH24:MI:SS'),100,'Belegdatum desProvisionsauslösers','Y','N','N','Y','N','N','N',0,'CommissionDate',20,0,0,TO_TIMESTAMP('2020-03-22 12:32:36','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2020-03-22T11:33:03.509Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsReadOnly='Y',Updated=TO_TIMESTAMP('2020-03-22 12:33:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=598494
;
-- 2020-03-22T11:33:18.069Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Description='Belegdatum des Provisionsauslösers',Updated=TO_TIMESTAMP('2020-03-22 12:33:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577598 AND AD_Language='de_CH'
;
-- 2020-03-22T11:33:18.070Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577598,'de_CH')
;
-- 2020-03-22T11:33:20.344Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Description='Belegdatum des Provisionsauslösers',Updated=TO_TIMESTAMP('2020-03-22 12:33:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577598 AND AD_Language='de_DE'
;
-- 2020-03-22T11:33:20.345Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577598,'de_DE')
;
-- 2020-03-22T11:33:20.351Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(577598,'de_DE')
;
-- 2020-03-22T11:33:20.352Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='CommissionDate', Name='Datum', Description='Belegdatum des Provisionsauslösers', Help=NULL WHERE AD_Element_ID=577598
;
-- 2020-03-22T11:33:20.353Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='CommissionDate', Name='Datum', Description='Belegdatum des Provisionsauslösers', Help=NULL, AD_Element_ID=577598 WHERE UPPER(ColumnName)='COMMISSIONDATE' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2020-03-22T11:33:20.355Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='CommissionDate', Name='Datum', Description='Belegdatum des Provisionsauslösers', Help=NULL WHERE AD_Element_ID=577598 AND IsCentrallyMaintained='Y'
;
-- 2020-03-22T11:33:20.355Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Datum', Description='Belegdatum des Provisionsauslösers', Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=577598) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 577598)
;
-- 2020-03-22T11:33:20.364Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Datum', Description='Belegdatum des Provisionsauslösers', Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 577598
;
-- 2020-03-22T11:33:20.366Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Datum', Description='Belegdatum des Provisionsauslösers', Help=NULL WHERE AD_Element_ID = 577598
;
-- 2020-03-22T11:33:20.367Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name = 'Datum', Description = 'Belegdatum des Provisionsauslösers', WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 577598
;
-- 2020-03-22T11:43:32.389Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=40,Updated=TO_TIMESTAMP('2020-03-22 12:43:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=570119
;
-- 2020-03-22T11:43:32.393Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=50,Updated=TO_TIMESTAMP('2020-03-22 12:43:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=570122
;
-- 2020-03-22T11:43:32.398Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=60,Updated=TO_TIMESTAMP('2020-03-22 12:43:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=568754
;
-- 2020-03-22T11:43:32.402Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=70,Updated=TO_TIMESTAMP('2020-03-22 12:43:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=568790
;
-- 2020-03-22T11:43:32.405Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=80,Updated=TO_TIMESTAMP('2020-03-22 12:43:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=570118
;
-- 2020-03-22T11:43:32.408Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=90,Updated=TO_TIMESTAMP('2020-03-22 12:43:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=568747
;
-- 2020-03-22T11:43:48.306Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsRangeFilter='Y',Updated=TO_TIMESTAMP('2020-03-22 12:43:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=570122
;
-- 2020-03-22T11:53:45.838Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsIdentifier='Y', SeqNo=1,Updated=TO_TIMESTAMP('2020-03-22 12:53:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=570120
;
-- 2020-03-22T11:54:03.288Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsIdentifier='Y', SeqNo=2,Updated=TO_TIMESTAMP('2020-03-22 12:54:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=570122
;
-- 2020-03-22T11:54:12.990Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsIdentifier='N',Updated=TO_TIMESTAMP('2020-03-22 12:54:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=568754
;
-- 2020-03-22T11:54:14.971Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsIdentifier='N',Updated=TO_TIMESTAMP('2020-03-22 12:54:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=568790
;
-- 2020-03-22T11:54:18.066Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET SeqNo=30,Updated=TO_TIMESTAMP('2020-03-22 12:54:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=568789
;
-- 2020-03-22T11:54:22.292Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET SeqNo=10,Updated=TO_TIMESTAMP('2020-03-22 12:54:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=570120
;
-- 2020-03-22T11:54:25.869Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET SeqNo=20,Updated=TO_TIMESTAMP('2020-03-22 12:54:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=570122
;
-- 2020-03-22T11:55:59.159Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsIdentifier='Y', SeqNo=15,Updated=TO_TIMESTAMP('2020-03-22 12:55:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=569283
;
-- 2020-03-22T11:56:21.856Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsIdentifier='N',Updated=TO_TIMESTAMP('2020-03-22 12:56:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=569268
;
-- 2020-03-22T11:56:22.922Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsIdentifier='N',Updated=TO_TIMESTAMP('2020-03-22 12:56:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=569269
;
-- 2020-03-22T11:56:28.802Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET SeqNo=20,Updated=TO_TIMESTAMP('2020-03-22 12:56:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=569283
;
-- 2020-03-22T11:56:51.585Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsIdentifier='Y', SeqNo=30,Updated=TO_TIMESTAMP('2020-03-22 12:56:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=569270
;
-- 2020-03-22T11:57:42.588Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', IsUpdateable='N', SelectionColumnSeqNo=10,Updated=TO_TIMESTAMP('2020-03-22 12:57:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=569267
;
-- 2020-03-22T11:57:42.591Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=20,Updated=TO_TIMESTAMP('2020-03-22 12:57:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=569268
;
-- 2020-03-22T11:57:42.595Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=30,Updated=TO_TIMESTAMP('2020-03-22 12:57:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=570070
;
-- 2020-03-22T11:57:42.599Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=40,Updated=TO_TIMESTAMP('2020-03-22 12:57:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=569269
;
-- 2020-03-22T11:57:42.603Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=50,Updated=TO_TIMESTAMP('2020-03-22 12:57:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=570069
;
-- 2020-03-22T11:57:42.606Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=60,Updated=TO_TIMESTAMP('2020-03-22 12:57:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=570071
;
-- 2020-03-22T11:57:42.610Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=70,Updated=TO_TIMESTAMP('2020-03-22 12:57:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=569260
;
-- 2020-03-22T11:59:46.278Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=10,Updated=TO_TIMESTAMP('2020-03-22 12:59:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=566611
;
-- 2020-03-22T11:59:46.282Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=20,Updated=TO_TIMESTAMP('2020-03-22 12:59:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561842
;
-- 2020-03-22T11:59:46.285Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2020-03-22 12:59:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=566605
;
-- 2020-03-22T11:59:46.288Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2020-03-22 12:59:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=563730
;
-- 2020-03-22T11:59:46.291Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=50,Updated=TO_TIMESTAMP('2020-03-22 12:59:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=566606
;
-- 2020-03-22T11:59:46.294Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=60,Updated=TO_TIMESTAMP('2020-03-22 12:59:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561843
;
-- 2020-03-22T11:59:46.296Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=70,Updated=TO_TIMESTAMP('2020-03-22 12:59:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561844
;
-- 2020-03-22T11:59:46.299Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=80,Updated=TO_TIMESTAMP('2020-03-22 12:59:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=566607
;
-- 2020-03-22T11:59:46.302Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=90,Updated=TO_TIMESTAMP('2020-03-22 12:59:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561845
;
-- 2020-03-22T11:59:46.304Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=100,Updated=TO_TIMESTAMP('2020-03-22 12:59:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561846
;
-- 2020-03-22T11:59:46.307Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=110,Updated=TO_TIMESTAMP('2020-03-22 12:59:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561847
;
-- 2020-03-22T11:59:46.309Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=120,Updated=TO_TIMESTAMP('2020-03-22 12:59:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=561840
;
CREATE INDEX c_commission_instance_CommissionDate
ON public.c_commission_instance USING btree
(CommissionDate ASC NULLS LAST)
TABLESPACE pg_default;
CREATE INDEX c_commission_instance_C_Commission_Instance_ID
ON public.c_commission_instance USING btree
(C_Commission_Instance_ID ASC NULLS LAST)
TABLESPACE pg_default;
CREATE INDEX c_commission_instance_C_Invoice_ID
ON public.c_commission_instance USING btree
(C_Invoice_ID ASC NULLS LAST)
TABLESPACE pg_default;
CREATE INDEX c_commission_instance_C_InvoiceLine_ID
ON public.c_commission_instance USING btree
(C_InvoiceLine_ID ASC NULLS LAST)
TABLESPACE pg_default;
-- 2020-03-22T12:48:26.236Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process (AccessLevel,AD_Client_ID,AD_Org_ID,AD_Process_ID,AllowProcessReRun,Classname,CopyFromProcess,Created,CreatedBy,Description,EntityType,IsActive,IsApplySecuritySettings,IsBetaFunctionality,IsDirectPrint,IsNotifyUserAfterExecution,IsOneInstanceOnly,IsReport,IsServerProcess,IsTranslateExcelHeaders,IsUseBPartnerLanguage,LockWaitTimeout,Name,RefreshAllAfterExecution,ShowHelp,Type,Updated,UpdatedBy,Value) VALUES ('1',0,0,584672,'N','de.metas.contracts.commission.commissioninstance.process.C_Invoice_CreateOrUpdateCommissionInstance','N',TO_TIMESTAMP('2020-03-22 13:48:26','YYYY-MM-DD HH24:MI:SS'),100,'Erstellt Provisionsvorgang- und Buchauszug-Daten zu allen ausgewählten Rechungen, zu denen zur Zeit solche Daten fehlen.
Der Prozess kann benutzt werden, wenn rückwirkend Provisionsdaten zu bereits bestehenden Rechnungskandidaten erstellt wurden.
Ausgewählte Rechnungen, für die keine Provisionsdaten zu erstellen, sind werden übersprungen.','U','Y','N','N','N','Y','N','N','N','Y','Y',0,'Provisionsdaten aktualisieren','N','Y','Java',TO_TIMESTAMP('2020-03-22 13:48:26','YYYY-MM-DD HH24:MI:SS'),100,'C_Invoice_CreateOrUpdateCommissionInstance')
;
-- 2020-03-22T12:48:26.238Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Trl (AD_Language,AD_Process_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Process_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Process_ID=584672 AND NOT EXISTS (SELECT 1 FROM AD_Process_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_ID=t.AD_Process_ID)
;
-- 2020-03-22T12:48:38.213Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process SET EntityType='de.metas.contracts.commission',Updated=TO_TIMESTAMP('2020-03-22 13:48:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=584672
;
-- 2020-03-22T12:49:10.096Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process SET Description='Erstellt Provisionsvorgang- und Buchauszug-Daten zu allen ausgewählten Rechnungskandidaten, zu denen zur Zeit solche Daten fehlen.
Der Prozess kann benutzt werden, wenn rückwirkend Provisionsdaten zu bereits bestehenden Rechnungskandidaten erstellt wurden.
Ausgewählte Rechnungskandidaten, für die keine Provisionsdaten zu erstellen sind, werden übersprungen.',Updated=TO_TIMESTAMP('2020-03-22 13:49:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=584652
;
-- 2020-03-22T12:49:14.845Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process SET Description='Erstellt Provisionsvorgang- und Buchauszug-Daten zu allen ausgewählten Rechungen, zu denen zur Zeit solche Daten fehlen.
Der Prozess kann benutzt werden, wenn rückwirkend Provisionsdaten zu bereits bestehenden Rechnungskandidaten erstellt wurden.
Ausgewählte Rechnungen, für die keine Provisionsdaten zu erstellen sind, werden übersprungen.',Updated=TO_TIMESTAMP('2020-03-22 13:49:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=584672
;
-- 2020-03-22T12:49:35.386Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Trl SET Description='Erstellt Provisionsvorgang- und Buchauszug-Daten zu allen ausgewählten Rechnungskandidaten, zu denen zur Zeit solche Daten fehlen.
Der Prozess kann benutzt werden, wenn rückwirkend Provisionsdaten zu bereits bestehenden Rechnungskandidaten erstellt wurden.
Ausgewählte Rechnungskandidaten, für die keine Provisionsdaten zu erstellen sind, werden übersprungen.',Updated=TO_TIMESTAMP('2020-03-22 13:49:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_CH' AND AD_Process_ID=584652
;
-- 2020-03-22T12:49:40.290Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Trl SET Description='Erstellt Provisionsvorgang- und Buchauszug-Daten zu allen ausgewählten Rechnungskandidaten, zu denen zur Zeit solche Daten fehlen.
Der Prozess kann benutzt werden, wenn rückwirkend Provisionsdaten zu bereits bestehenden Rechnungskandidaten erstellt wurden.
Ausgewählte Rechnungskandidaten, für die keine Provisionsdaten zu erstellen sind, werden übersprungen.', IsTranslated='Y',Updated=TO_TIMESTAMP('2020-03-22 13:49:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Process_ID=584652
;
-- 2020-03-22T12:50:32.253Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2020-03-22 13:50:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_CH' AND AD_Process_ID=584672
;
-- 2020-03-22T12:53:39.380Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Trl SET Description='Creates commission instance- and deed-data for all selected invoice candidates where such data is missing.', IsTranslated='Y', Name='Update commission data',Updated=TO_TIMESTAMP('2020-03-22 13:53:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_US' AND AD_Process_ID=584672
;
-- 2020-03-22T12:54:42.777Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Table_Process (AD_Client_ID,AD_Org_ID,AD_Process_ID,AD_Table_ID,AD_Table_Process_ID,Created,CreatedBy,EntityType,IsActive,Updated,UpdatedBy,WEBUI_DocumentAction,WEBUI_IncludedTabTopAction,WEBUI_ViewAction,WEBUI_ViewQuickAction,WEBUI_ViewQuickAction_Default) VALUES (0,0,584672,318,540806,TO_TIMESTAMP('2020-03-22 13:54:42','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.contracts.commission','Y',TO_TIMESTAMP('2020-03-22 13:54:42','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N')
;
-- 2020-03-22T14:04:06.504Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=40,Updated=TO_TIMESTAMP('2020-03-22 15:04:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=570067
;
-- 2020-03-22T14:04:06.509Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=50,Updated=TO_TIMESTAMP('2020-03-22 15:04:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=568756
;
-- 2020-03-22T14:10:42.169Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsRangeFilter='Y',Updated=TO_TIMESTAMP('2020-03-22 15:10:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=570123
; | the_stack |
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
-- --------------------------------------------------------
--
-- Table structure for table `admin_menu`
--
CREATE TABLE `admin_menu` (
`id` int(10) UNSIGNED NOT NULL,
`parent_id` int(11) NOT NULL DEFAULT '0',
`is_menu` tinyint(1) NOT NULL DEFAULT '0',
`order` int(11) NOT NULL DEFAULT '0',
`title` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`icon` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`uri` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`permission` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `admin_menu`
--
INSERT INTO `admin_menu` (`id`, `parent_id`, `is_menu`, `order`, `title`, `icon`, `uri`, `permission`, `created_at`, `updated_at`) VALUES
(1, 0, 1, 1, '首页', 'shouye_o', '/auth/main', NULL, NULL, '2021-01-11 06:55:36'),
(2, 0, 1, 10, '系统', 'quanjushezhi_o', 'system', NULL, NULL, '2021-01-11 06:56:10'),
(3, 2, 1, 3, '管理员', 'guanliyuanrenzheng_o', '/admin/users/list', '[1]', NULL, '2021-01-11 06:56:24'),
(4, 2, 1, 4, '角色', 'qunzu_o', '/admin/roles/list', NULL, NULL, '2021-01-11 06:57:51'),
(5, 2, 1, 5, '权限', 'saomafuquan_o', '/admin/permissions/list', NULL, NULL, '2021-01-11 06:56:42'),
(6, 2, 1, 6, '菜单', 'caidan_o', '/admin/menu/list', NULL, NULL, '2021-01-11 06:56:49'),
(7, 2, 1, 7, '操作日志', 'bianji_o', '/admin/logs/list', NULL, NULL, '2021-01-11 06:57:09');
-- --------------------------------------------------------
--
-- Table structure for table `admin_operation_log`
--
CREATE TABLE `admin_operation_log` (
`id` int(10) UNSIGNED NOT NULL,
`user_id` int(11) NOT NULL,
`path` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`method` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
`ip` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`request` json NOT NULL,
`result` json NOT NULL,
`header` json NOT NULL,
`runtime` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `admin_permissions`
--
CREATE TABLE `admin_permissions` (
`id` int(10) UNSIGNED NOT NULL,
`name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`slug` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`path` varchar(1000) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`status` tinyint(1) DEFAULT '1',
`parent_id` int(11) NOT NULL DEFAULT '0',
`order` int(11) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `admin_permissions`
--
INSERT INTO `admin_permissions` (`id`, `name`, `slug`, `path`, `created_at`, `updated_at`, `status`, `parent_id`, `order`) VALUES
(1, '所有权限', '*', '[\"*\"]', NULL, '2020-09-21 04:40:45', 1, 0, 0),
(2, '首页', '0', '[\"GET::\\/auth\\/main\"]', NULL, '2020-09-21 04:40:59', 1, 0, 0),
(3, '登录/退出', '1', '[\"ANY::\\/auth\\/*\"]', NULL, '2020-09-21 04:41:20', 1, 0, 0),
(6, '菜单管理', '0', '[\"GET::\\/admin\\/menu\\/*\"]', '2020-09-08 07:49:27', '2020-09-08 10:49:09', 1, 0, 0),
(8, '添加菜单', 'menu:create', '[\"GET::\\/admin\\/menu\\/create\",\"POST::\\/admin\\/menu\"]', '2020-09-08 10:49:31', '2020-09-21 04:42:07', 1, 6, 0),
(9, '删除菜单', 'menu:delete', '[\"DELETE::\\/admin\\/menu\\/{id}\"]', '2020-09-08 10:50:27', '2020-09-21 04:41:58', 1, 6, 0),
(10, '修改菜单', 'menu:update', '[\"GET::\\/admin\\/menu\\/{id:\\\\d+}\",\"PUT::\\/admin\\/menu\\/{id:\\\\d+}\"]', '2020-09-08 10:50:59', '2020-09-21 04:42:15', 1, 6, 0),
(11, '管理员', 'users', '[\"ANY::\\/admin\\/users\\/*\"]', '2020-09-08 10:53:23', '2020-09-21 04:42:45', 1, 0, 0);
-- --------------------------------------------------------
--
-- Table structure for table `admin_roles`
--
CREATE TABLE `admin_roles` (
`id` int(10) UNSIGNED NOT NULL,
`name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`slug` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `admin_roles`
--
INSERT INTO `admin_roles` (`id`, `name`, `slug`, `created_at`, `updated_at`) VALUES
(1, '超级管理员', 'administrator', '2020-09-03 08:19:02', '2020-09-03 08:19:02');
-- --------------------------------------------------------
--
-- Table structure for table `admin_role_menu`
--
CREATE TABLE `admin_role_menu` (
`role_id` int(11) NOT NULL,
`menu_id` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `admin_role_menu`
--
INSERT INTO `admin_role_menu` (`role_id`, `menu_id`, `created_at`, `updated_at`) VALUES
(1, 2, NULL, NULL),
(1, 8, NULL, NULL),
(1, 4, NULL, NULL),
(1, 1, NULL, NULL),
(2, 3, NULL, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `admin_role_permissions`
--
CREATE TABLE `admin_role_permissions` (
`role_id` int(11) NOT NULL,
`permission_id` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `admin_role_permissions`
--
INSERT INTO `admin_role_permissions` (`role_id`, `permission_id`, `created_at`, `updated_at`) VALUES
(2, 1, NULL, NULL),
(1, 1, NULL, NULL),
(1, 2, NULL, NULL),
(1, 3, NULL, NULL),
(1, 5, NULL, NULL),
(1, 6, NULL, NULL),
(1, 8, NULL, NULL),
(1, 9, NULL, NULL),
(1, 10, NULL, NULL),
(1, 11, NULL, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `admin_role_users`
--
CREATE TABLE `admin_role_users` (
`role_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `admin_role_users`
--
INSERT INTO `admin_role_users` (`role_id`, `user_id`, `created_at`, `updated_at`) VALUES
(1, 1, NULL, NULL),
(1, 4, NULL, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `admin_users`
--
CREATE TABLE `admin_users` (
`id` int(10) UNSIGNED NOT NULL,
`username` varchar(190) COLLATE utf8mb4_unicode_ci NOT NULL,
`password` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`avatar` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `admin_users`
--
INSERT INTO `admin_users` (`id`, `username`, `password`, `name`, `avatar`, `remember_token`, `created_at`, `updated_at`) VALUES
(1, 'admin', '$2y$10$Sw7R0JYnA0DV/7fpo1HMfOR4gU6QiexaY3oFKMJIx6fTJbjl5esXO', '管理员', 'https://gw.alipayobjects.com/zos/antfincdn/XAosXuNZyF/BiazfanxmamNRoxxVxka.png', 'Uh5tXnhDocmTgAApkpyIMMEXsUQCxKUUh9LeULMHYW8alxpv3OtrUDptkfVx', '2020-09-03 08:19:02', '2020-09-21 04:43:25');
-- --------------------------------------------------------
--
-- Table structure for table `admin_user_permissions`
--
CREATE TABLE `admin_user_permissions` (
`user_id` int(11) NOT NULL,
`permission_id` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `admin_user_permissions`
--
INSERT INTO `admin_user_permissions` (`user_id`, `permission_id`, `created_at`, `updated_at`) VALUES
(1, 1, NULL, NULL),
(4, 1, NULL, NULL);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `admin_menu`
--
ALTER TABLE `admin_menu`
ADD PRIMARY KEY (`id`) USING BTREE;
--
-- Indexes for table `admin_operation_log`
--
ALTER TABLE `admin_operation_log`
ADD PRIMARY KEY (`id`) USING BTREE,
ADD KEY `admin_operation_log_user_id_index` (`user_id`);
--
-- Indexes for table `admin_permissions`
--
ALTER TABLE `admin_permissions`
ADD PRIMARY KEY (`id`) USING BTREE,
ADD UNIQUE KEY `admin_permissions_name_unique` (`name`);
--
-- Indexes for table `admin_roles`
--
ALTER TABLE `admin_roles`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `admin_roles_name_unique` (`name`),
ADD UNIQUE KEY `admin_roles_slug_unique` (`slug`);
--
-- Indexes for table `admin_role_menu`
--
ALTER TABLE `admin_role_menu`
ADD KEY `admin_role_menu_role_id_menu_id_index` (`role_id`,`menu_id`);
--
-- Indexes for table `admin_role_permissions`
--
ALTER TABLE `admin_role_permissions`
ADD KEY `admin_role_permissions_role_id_permission_id_index` (`role_id`,`permission_id`);
--
-- Indexes for table `admin_role_users`
--
ALTER TABLE `admin_role_users`
ADD KEY `admin_role_users_role_id_user_id_index` (`role_id`,`user_id`);
--
-- Indexes for table `admin_users`
--
ALTER TABLE `admin_users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `admin_users_username_unique` (`username`);
--
-- Indexes for table `admin_user_permissions`
--
ALTER TABLE `admin_user_permissions`
ADD KEY `admin_user_permissions_user_id_permission_id_index` (`user_id`,`permission_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `admin_menu`
--
ALTER TABLE `admin_menu`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT for table `admin_operation_log`
--
ALTER TABLE `admin_operation_log`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `admin_permissions`
--
ALTER TABLE `admin_permissions`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT for table `admin_roles`
--
ALTER TABLE `admin_roles`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `admin_users`
--
ALTER TABLE `admin_users`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; | the_stack |
;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
/*Table structure for table `bsd_goods_order` */
DROP TABLE IF EXISTS `bsd_goods_order`;
CREATE TABLE `bsd_goods_order` (
`goods_order_id` varchar(30) NOT NULL DEFAULT '' COMMENT '商品订单ID',
`goods_id` varchar(30) NOT NULL DEFAULT '' COMMENT '商品ID',
`goods_name` varchar(64) NOT NULL DEFAULT '' COMMENT '商品名称',
`amount` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '金额(单位分)',
`user_id` varchar(30) NOT NULL DEFAULT '' COMMENT '用户ID',
`status` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT '订单状态,订单生成(0),支付成功(1),处理完成(2),处理失败(-1)',
`pay_order_id` varchar(30) NOT NULL DEFAULT '' COMMENT '支付订单号',
`channel_code` varchar(24) NOT NULL DEFAULT '' COMMENT '渠道编码',
`channel_user_id` varchar(64) NOT NULL DEFAULT '' COMMENT '支付渠道用户ID(微信openID或支付宝账号等第三方支付账号)',
`create_time` datetime NOT NULL COMMENT '创建时间',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`goods_order_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='商品订单表';
/*Table structure for table `bsd_iap_receipt` */
DROP TABLE IF EXISTS `bsd_iap_receipt`;
CREATE TABLE `bsd_iap_receipt` (
`pay_order_id` varchar(30) NOT NULL DEFAULT '' COMMENT '支付订单号',
`mch_id` varchar(30) NOT NULL DEFAULT '' COMMENT '商户ID',
`transaction_id` varchar(24) NOT NULL DEFAULT '' COMMENT 'IAP业务号',
`receipt_data` text NOT NULL COMMENT '凭据内容',
`status` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT '处理状态:0-未处理,1-处理成功,-1-处理失败',
`handle_count` tinyint(3) unsigned NOT NULL DEFAULT 0 COMMENT '处理次数',
`create_time` datetime NOT NULL COMMENT '创建时间',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`pay_order_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='苹果支付凭据表';
/*Table structure for table `bsd_mch_info` */
DROP TABLE IF EXISTS `bsd_mch_info`;
CREATE TABLE `bsd_mch_info` (
`mch_id` varchar(30) NOT NULL DEFAULT '' COMMENT '商户ID',
`name` varchar(30) NOT NULL DEFAULT '' COMMENT '名称',
`type` varchar(24) NOT NULL DEFAULT '' COMMENT '类型',
`req_key` varchar(512) NOT NULL DEFAULT '' COMMENT '请求私钥',
`res_key` varchar(512) NOT NULL DEFAULT '' COMMENT '响应私钥',
`state` tinyint(1) unsigned NOT NULL DEFAULT 1 COMMENT '商户状态,0-停止使用,1-使用中',
`create_time` datetime NOT NULL COMMENT '创建时间',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`mch_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='商户信息表';
/*Table structure for table `bsd_mch_notify` */
DROP TABLE IF EXISTS `bsd_mch_notify`;
CREATE TABLE `bsd_mch_notify` (
`order_id` varchar(24) NOT NULL DEFAULT '' COMMENT '订单ID',
`mch_id` varchar(30) NOT NULL DEFAULT '' COMMENT '商户ID',
`mch_order_no` varchar(30) NOT NULL DEFAULT '' COMMENT '商户订单号',
`order_type` varchar(8) NOT NULL DEFAULT '' COMMENT '订单类型:1-支付,2-转账,3-退款',
`notify_url` varchar(2048) NOT NULL DEFAULT '' COMMENT '通知地址',
`notify_count` tinyint(3) unsigned NOT NULL DEFAULT 0 COMMENT '通知次数',
`result` varchar(2048) NOT NULL DEFAULT '' COMMENT '通知响应结果',
`status` tinyint(1) unsigned NOT NULL DEFAULT 1 COMMENT '通知状态,1-通知中,2-通知成功,3-通知失败',
`last_notify_time` datetime DEFAULT NULL COMMENT '最后一次通知时间',
`create_time` datetime NOT NULL COMMENT '创建时间',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`order_id`),
UNIQUE KEY `mch_id` (`mch_id`,`order_type`,`mch_order_no`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='商户通知表';
/*Table structure for table `bsd_pay_channel` */
DROP TABLE IF EXISTS `bsd_pay_channel`;
CREATE TABLE `bsd_pay_channel` (
`channel_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '渠道ID',
`channel_code` varchar(24) NOT NULL DEFAULT '' COMMENT '渠道编码',
`channel_name` varchar(30) NOT NULL DEFAULT '' COMMENT '渠道名称,如:alipay,wechat',
`channel_mch_id` varchar(32) NOT NULL DEFAULT '' COMMENT '渠道商户ID',
`mch_id` varchar(30) NOT NULL DEFAULT '' COMMENT '商户ID',
`state` tinyint(1) unsigned NOT NULL DEFAULT 1 COMMENT '渠道状态,0-停止使用,1-使用中',
`param` varchar(6148) NOT NULL DEFAULT '' COMMENT '配置参数,json字符串',
`remark` varchar(128) NOT NULL DEFAULT '' COMMENT '备注',
`create_time` datetime NOT NULL COMMENT '创建时间',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`channel_id`),
UNIQUE KEY `mch_id` (`mch_id`,`channel_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='支付渠道表';
/*Table structure for table `bsd_pay_order` */
DROP TABLE IF EXISTS `bsd_pay_order`;
CREATE TABLE `bsd_pay_order` (
`pay_order_id` varchar(30) NOT NULL DEFAULT '' COMMENT '支付订单号',
`mch_id` varchar(30) NOT NULL DEFAULT '' COMMENT '商户ID',
`mch_order_no` varchar(30) NOT NULL DEFAULT '' COMMENT '商户订单号',
`channel_code` varchar(24) NOT NULL DEFAULT '' COMMENT '渠道编码',
`amount` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '支付金额(单位分)',
`currency` varchar(3) NOT NULL DEFAULT 'cny' COMMENT '三位货币代码,人民币:cny',
`status` tinyint(3) NOT NULL DEFAULT 0 COMMENT '支付状态,0-订单生成,1-支付中(目前未使用),2-支付成功,3-业务处理完成',
`client_ip` varchar(32) NOT NULL DEFAULT '' COMMENT '客户端IP',
`device` varchar(64) NOT NULL DEFAULT '' COMMENT '设备',
`subject` varchar(64) NOT NULL DEFAULT '' COMMENT '商品标题',
`body` varchar(256) NOT NULL DEFAULT '' COMMENT '商品描述信息',
`extra` varchar(6148) NOT NULL DEFAULT '' COMMENT '特定渠道发起时额外参数',
`channel_mch_id` varchar(32) NOT NULL DEFAULT '' COMMENT '渠道商户ID',
`channel_order_no` varchar(64) NOT NULL DEFAULT '' COMMENT '渠道订单号',
`err_code` varchar(64) NOT NULL DEFAULT '' COMMENT '渠道支付错误码',
`err_msg` varchar(128) NOT NULL DEFAULT '' COMMENT '渠道支付错误描述',
`param1` varchar(64) NOT NULL DEFAULT '' COMMENT '扩展参数1',
`param2` varchar(64) NOT NULL DEFAULT '' COMMENT '扩展参数2',
`notify_url` varchar(128) NOT NULL DEFAULT '' COMMENT '通知地址',
`notify_count` tinyint(3) unsigned NOT NULL DEFAULT 0 COMMENT '通知次数',
`last_notify_time` datetime DEFAULT NULL COMMENT '最后一次通知时间',
`expire_time` datetime DEFAULT NULL COMMENT '订单失效时间',
`pay_succ_time` datetime DEFAULT NULL COMMENT '订单支付成功时间',
`create_time` datetime NOT NULL COMMENT '创建时间',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`pay_order_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='支付订单表';
/*Table structure for table `bsd_refund_order` */
DROP TABLE IF EXISTS `bsd_refund_order`;
CREATE TABLE `bsd_refund_order` (
`refund_order_id` varchar(30) NOT NULL DEFAULT '' COMMENT '退款订单号',
`pay_order_id` varchar(30) NOT NULL DEFAULT '' COMMENT '支付订单号',
`channel_pay_order_no` varchar(64) NOT NULL DEFAULT '' COMMENT '渠道支付单号',
`mch_id` varchar(30) NOT NULL DEFAULT '' COMMENT '商户ID',
`mch_refund_no` varchar(30) NOT NULL DEFAULT '' COMMENT '商户退款单号',
`channel_code` varchar(24) NOT NULL DEFAULT '' COMMENT '渠道编码',
`pay_amount` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '支付金额(单位分)',
`refund_amount` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '退款金额(单位分)',
`currency` varchar(3) NOT NULL DEFAULT 'cny' COMMENT '三位货币代码,人民币:cny',
`status` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT '退款状态:0-订单生成,1-退款中,2-退款成功,3-退款失败,4-业务处理完成',
`result` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT '退款结果:0-不确认结果,1-等待手动处理,2-确认成功,3-确认失败',
`client_ip` varchar(32) DEFAULT '' COMMENT '客户端IP',
`device` varchar(64) DEFAULT '' COMMENT '设备',
`remark_info` varchar(256) DEFAULT '' COMMENT '备注',
`channel_user` varchar(32) NOT NULL DEFAULT '' COMMENT '渠道用户标识,如微信openId,支付宝账号',
`user_name` varchar(24) NOT NULL DEFAULT '' COMMENT '用户姓名',
`channel_mch_id` varchar(32) NOT NULL DEFAULT '' COMMENT '渠道商户ID',
`channel_order_no` varchar(32) NOT NULL DEFAULT '' COMMENT '渠道订单号',
`channel_err_code` varchar(128) NOT NULL DEFAULT '' COMMENT '渠道错误码',
`channel_err_msg` varchar(128) NOT NULL DEFAULT '' COMMENT '渠道错误描述',
`extra` varchar(6148) NOT NULL DEFAULT '' COMMENT '特定渠道发起时额外参数',
`notify_url` varchar(128) NOT NULL DEFAULT '' COMMENT '通知地址',
`param1` varchar(64) DEFAULT '' COMMENT '扩展参数1',
`param2` varchar(64) DEFAULT '' COMMENT '扩展参数2',
`expire_time` datetime DEFAULT NULL COMMENT '订单失效时间',
`refund_succ_time` datetime DEFAULT NULL COMMENT '订单退款成功时间',
`create_time` datetime NOT NULL COMMENT '创建时间',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`refund_order_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='退款订单表';
/*Table structure for table `bsd_trans_order` */
DROP TABLE IF EXISTS `bsd_trans_order`;
CREATE TABLE `bsd_trans_order` (
`trans_order_id` varchar(30) NOT NULL DEFAULT '' COMMENT '转账订单号',
`mch_id` varchar(30) NOT NULL DEFAULT '' COMMENT '商户ID',
`mch_trans_no` varchar(30) NOT NULL DEFAULT '' COMMENT '商户转账单号',
`channel_code` varchar(24) NOT NULL DEFAULT '' COMMENT '渠道编码',
`amount` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '转账金额(单位分)',
`currency` varchar(3) NOT NULL DEFAULT 'cny' COMMENT '三位货币代码,人民币:cny',
`status` tinyint(3) NOT NULL DEFAULT 0 COMMENT '转账状态:0-订单生成,1-转账中,2-转账成功,3-转账失败,4-业务处理完成',
`result` tinyint(3) NOT NULL DEFAULT 0 COMMENT '转账结果:0-不确认结果,1-等待手动处理,2-确认成功,3-确认失败',
`client_ip` varchar(32) DEFAULT '' COMMENT '客户端IP',
`device` varchar(64) DEFAULT '' COMMENT '设备',
`remark_info` varchar(256) NOT NULL DEFAULT '' COMMENT '备注',
`channel_user` varchar(32) NOT NULL DEFAULT '' COMMENT '渠道用户标识,如微信openId,支付宝账号',
`user_name` varchar(24) NOT NULL DEFAULT '' COMMENT '用户姓名',
`channel_mch_id` varchar(32) NOT NULL DEFAULT '' COMMENT '渠道商户ID',
`channel_order_no` varchar(32) NOT NULL DEFAULT '' COMMENT '渠道订单号',
`channel_err_code` varchar(128) NOT NULL DEFAULT '' COMMENT '渠道错误码',
`channel_err_msg` varchar(128) NOT NULL DEFAULT '' COMMENT '渠道错误描述',
`extra` varchar(512) NOT NULL DEFAULT '' COMMENT '特定渠道发起时额外参数',
`notify_url` varchar(128) NOT NULL DEFAULT '' COMMENT '通知地址',
`param1` varchar(64) DEFAULT '' COMMENT '扩展参数1',
`param2` varchar(64) DEFAULT '' COMMENT '扩展参数2',
`expire_time` datetime DEFAULT NULL COMMENT '订单失效时间',
`trans_succ_time` datetime DEFAULT NULL COMMENT '订单转账成功时间',
`create_time` datetime NOT NULL COMMENT '创建时间',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`trans_order_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='转账订单表';
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; | the_stack |
-- 2021-03-02T11:32:34.413Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,541271,TO_TIMESTAMP('2021-03-02 13:32:34','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N','M_Inventory Products',TO_TIMESTAMP('2021-03-02 13:32:34','YYYY-MM-DD HH24:MI:SS'),100,'L')
;
-- 2021-03-02T11:32:34.424Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y') AND t.AD_Reference_ID=541271 AND NOT EXISTS (SELECT 1 FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID)
;
-- 2021-03-02T11:33:04.522Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541271,542294,TO_TIMESTAMP('2021-03-02 13:33:04','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Only Stocked Products',TO_TIMESTAMP('2021-03-02 13:33:04','YYYY-MM-DD HH24:MI:SS'),100,'S','Only Stocked Products')
;
-- 2021-03-02T11:33:04.524Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y') AND t.AD_Ref_List_ID=542294 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2021-03-02T11:33:33.492Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541271,542295,TO_TIMESTAMP('2021-03-02 13:33:33','YYYY-MM-DD HH24:MI:SS'),100,'U','Y','Only Non-Stocked Products',TO_TIMESTAMP('2021-03-02 13:33:33','YYYY-MM-DD HH24:MI:SS'),100,'N','Only Non-Stocked Products')
;
-- 2021-03-02T11:33:33.494Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y') AND t.AD_Ref_List_ID=542295 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2021-03-02T11:34:01.416Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541271,542296,TO_TIMESTAMP('2021-03-02 13:34:01','YYYY-MM-DD HH24:MI:SS'),100,'U','Y','All products in Warehouse',TO_TIMESTAMP('2021-03-02 13:34:01','YYYY-MM-DD HH24:MI:SS'),100,'A','All products in Warehouse')
;
-- 2021-03-02T11:34:01.418Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y') AND t.AD_Ref_List_ID=542296 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2021-03-02T11:34:38.372Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET AD_Reference_ID=17, AD_Reference_Value_ID=541271,Updated=TO_TIMESTAMP('2021-03-02 13:34:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541892
;
-- 2021-03-02T11:37:36.945Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540935,541942,31,'Warehouse',TO_TIMESTAMP('2021-03-02 13:37:36','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.handlingunits',0,'Y','N','Y','N','N','N','Lager',40,TO_TIMESTAMP('2021-03-02 13:37:36','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2021-03-02T11:37:36.948Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y') AND t.AD_Process_Para_ID=541942 AND NOT EXISTS (SELECT 1 FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 2021-03-02T11:38:19.387Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET DisplayLogic='@OnlyStockedProducts@=A',Updated=TO_TIMESTAMP('2021-03-02 13:38:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541942
;
-- 2021-03-02T11:48:29.800Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='M_Warehouse_ID',Updated=TO_TIMESTAMP('2021-03-02 13:48:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541942
;
-- 2021-03-02T12:07:59.062Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Process_Para_Trl WHERE AD_Process_Para_ID=541942
;
-- 2021-03-02T12:07:59.073Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Process_Para WHERE AD_Process_Para_ID=541942
;
-- 2021-03-02T12:08:19.476Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET DefaultValue='S',Updated=TO_TIMESTAMP('2021-03-02 14:08:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541892
;
-- 2021-03-02T12:08:46.670Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET DefaultValue='',Updated=TO_TIMESTAMP('2021-03-02 14:08:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541892
;
-- 2021-03-03T06:19:34.166Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='StockFilterOption',Updated=TO_TIMESTAMP('2021-03-03 08:19:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541892
;
-- 2021-03-03T06:20:03.917Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='StockFilterOption',Updated=TO_TIMESTAMP('2021-03-03 08:20:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541891
;
-- 2021-03-03T07:04:40.872Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,578623,0,540994,541943,10,'OnlyStockedProducts',TO_TIMESTAMP('2021-03-03 09:04:40','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.handlingunits',0,'Y','N','Y','N','N','N','Nur bestandsgeführte Produkte',40,TO_TIMESTAMP('2021-03-03 09:04:40','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2021-03-03T07:04:40.879Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y') AND t.AD_Process_Para_ID=541943 AND NOT EXISTS (SELECT 1 FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 2021-03-03T07:05:10.428Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Process_Para_Trl WHERE AD_Process_Para_ID=541943
;
-- 2021-03-03T07:05:10.436Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Process_Para WHERE AD_Process_Para_ID=541943
;
-- 2021-03-03T07:05:36.603Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Name='Produkt-Filter',Updated=TO_TIMESTAMP('2021-03-03 09:05:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=578623 AND AD_Language='de_CH'
;
-- 2021-03-03T07:05:36.638Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(578623,'de_CH')
;
-- 2021-03-03T07:05:37.870Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Name='Produkt-Filter',Updated=TO_TIMESTAMP('2021-03-03 09:05:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=578623 AND AD_Language='de_DE'
;
-- 2021-03-03T07:05:37.872Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(578623,'de_DE')
;
-- 2021-03-03T07:05:37.879Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(578623,'de_DE')
;
-- 2021-03-03T07:05:37.882Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='OnlyStockedProducts', Name='Produkt-Filter', Description=NULL, Help=NULL WHERE AD_Element_ID=578623
;
-- 2021-03-03T07:05:37.884Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='OnlyStockedProducts', Name='Produkt-Filter', Description=NULL, Help=NULL, AD_Element_ID=578623 WHERE UPPER(ColumnName)='ONLYSTOCKEDPRODUCTS' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2021-03-03T07:05:37.885Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='OnlyStockedProducts', Name='Produkt-Filter', Description=NULL, Help=NULL WHERE AD_Element_ID=578623 AND IsCentrallyMaintained='Y'
;
-- 2021-03-03T07:05:37.886Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Produkt-Filter', Description=NULL, Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=578623) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 578623)
;
-- 2021-03-03T07:05:37.892Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Nur bestandsgeführte Produkte', Name='Produkt-Filter' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=578623)
;
-- 2021-03-03T07:05:37.894Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Produkt-Filter', Description=NULL, Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 578623
;
-- 2021-03-03T07:05:37.896Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Produkt-Filter', Description=NULL, Help=NULL WHERE AD_Element_ID = 578623
;
-- 2021-03-03T07:05:37.897Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name = 'Produkt-Filter', Description = NULL, WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 578623
;
-- 2021-03-03T07:05:39.411Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET PrintName='Produkt-Filter',Updated=TO_TIMESTAMP('2021-03-03 09:05:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=578623 AND AD_Language='de_CH'
;
-- 2021-03-03T07:05:39.413Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(578623,'de_CH')
;
-- 2021-03-03T07:05:44.108Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET PrintName='Produkt-Filter',Updated=TO_TIMESTAMP('2021-03-03 09:05:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=578623 AND AD_Language='de_DE'
;
-- 2021-03-03T07:05:44.110Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(578623,'de_DE')
;
-- 2021-03-03T07:05:44.118Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(578623,'de_DE')
;
-- 2021-03-03T07:05:44.119Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Produkt-Filter', Name='Produkt-Filter' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=578623)
;
-- 2021-03-03T07:05:47.484Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Name='Product filter', PrintName='Product filter',Updated=TO_TIMESTAMP('2021-03-03 09:05:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=578623 AND AD_Language='en_US'
;
-- 2021-03-03T07:05:47.485Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(578623,'en_US')
;
-- 2021-03-03T07:05:51.047Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Name='Product filter', PrintName='Product filter',Updated=TO_TIMESTAMP('2021-03-03 09:05:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=578623 AND AD_Language='nl_NL'
;
-- 2021-03-03T07:05:51.049Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(578623,'nl_NL')
;
-- 2021-03-03T07:06:19.412Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET AD_Reference_ID=10, DefaultValue='', IsMandatory='Y',Updated=TO_TIMESTAMP('2021-03-03 09:06:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541891
;
-- 2021-03-03T07:09:23.301Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Reference SET Name='M_Inventory Products_Stock_Filter_Options',Updated=TO_TIMESTAMP('2021-03-03 09:09:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=541271
;
-- 2021-03-03T07:39:35.660Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET Name='Alle Produkte',Updated=TO_TIMESTAMP('2021-03-03 09:39:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_CH' AND AD_Ref_List_ID=542296
;
-- 2021-03-03T07:39:37.175Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET Name='Alle Produkte',Updated=TO_TIMESTAMP('2021-03-03 09:39:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='nl_NL' AND AD_Ref_List_ID=542296
;
-- 2021-03-03T07:39:39.855Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET Name='Alle Produkte',Updated=TO_TIMESTAMP('2021-03-03 09:39:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Ref_List_ID=542296
;
-- 2021-03-03T07:39:46.416Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2021-03-03 09:39:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_US' AND AD_Ref_List_ID=542296
;
-- 2021-03-03T07:39:56.450Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List SET EntityType='D',Updated=TO_TIMESTAMP('2021-03-03 09:39:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=542296
;
-- 2021-03-03T07:40:09.099Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List SET EntityType='D',Updated=TO_TIMESTAMP('2021-03-03 09:40:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=542295
;
-- 2021-03-03T07:40:20.152Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET Name='Nur nicht bestandsgeführte Produkte',Updated=TO_TIMESTAMP('2021-03-03 09:40:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_CH' AND AD_Ref_List_ID=542295
;
-- 2021-03-03T07:40:21.375Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET Name='Nur nicht bestandsgeführte Produkte',Updated=TO_TIMESTAMP('2021-03-03 09:40:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='nl_NL' AND AD_Ref_List_ID=542295
;
-- 2021-03-03T07:40:23.157Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET Name='Nur nicht bestandsgeführte Produkte',Updated=TO_TIMESTAMP('2021-03-03 09:40:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Ref_List_ID=542295
;
-- 2021-03-03T07:40:26.959Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2021-03-03 09:40:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_US' AND AD_Ref_List_ID=542295
;
-- 2021-03-03T07:40:51.761Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET Name='Nur bestandsgeführte Produkte',Updated=TO_TIMESTAMP('2021-03-03 09:40:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_CH' AND AD_Ref_List_ID=542294
;
-- 2021-03-03T07:40:53.153Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET Name='Nur bestandsgeführte Produkte',Updated=TO_TIMESTAMP('2021-03-03 09:40:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='nl_NL' AND AD_Ref_List_ID=542294
;
-- 2021-03-03T07:40:54.449Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET Name='Nur bestandsgeführte Produkte',Updated=TO_TIMESTAMP('2021-03-03 09:40:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Ref_List_ID=542294
;
-- 2021-03-03T07:40:56.212Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2021-03-03 09:40:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_US' AND AD_Ref_List_ID=542294
;
-- 2021-03-03T07:42:12.020Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2021-03-03 09:42:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Ref_List_ID=542294
;
-- 2021-03-03T07:42:15.042Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2021-03-03 09:42:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='nl_NL' AND AD_Ref_List_ID=542294
;
-- 2021-03-03T07:42:15.388Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET IsTranslated='N',Updated=TO_TIMESTAMP('2021-03-03 09:42:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Ref_List_ID=542294
;
-- 2021-03-03T07:42:23.330Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET IsTranslated='N',Updated=TO_TIMESTAMP('2021-03-03 09:42:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='nl_NL' AND AD_Ref_List_ID=542294
;
-- 2021-03-03T07:42:27.046Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List SET Name='Nur bestandsgeführte Produkte',Updated=TO_TIMESTAMP('2021-03-03 09:42:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=542294
;
-- 2021-03-03T07:42:46.725Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List SET Name='Alle Produkte',Updated=TO_TIMESTAMP('2021-03-03 09:42:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=542296
;
-- 2021-03-03T07:43:38.549Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List SET Name='Nur nicht bestandsgeführte Produkte',Updated=TO_TIMESTAMP('2021-03-03 09:43:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=542295
;
-- 2021-03-03T07:45:32.471Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='StockFilterOption',Updated=TO_TIMESTAMP('2021-03-03 09:45:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541892
;
-- 2021-03-03T07:46:36.637Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='StockFilterOption',Updated=TO_TIMESTAMP('2021-03-03 09:46:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541891
;
-- 2021-03-03T07:55:00.897Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET AD_Reference_ID=17, AD_Reference_Value_ID=541271,Updated=TO_TIMESTAMP('2021-03-03 09:55:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541891
; | the_stack |
create schema replication_update_and_delete;
set current_schema=replication_update_and_delete;
drop table if exists base_table;
drop table if exists hash_base_table;
create table base_table(a int,b int,c int);
insert into base_table values(1,1,1);
insert into base_table values(2,1,1);
insert into base_table values(2,1,2);
insert into base_table values(2,2,12);
insert into base_table values(3,5,7);
insert into base_table values(3,5,7);
insert into base_table values(1,1,10);
insert into base_table values(2,2,10);
insert into base_table values(3,3,5);
insert into base_table values(3,3,5);
insert into base_table values(4,6,8);
insert into base_table values(4,6,8);
create table hash_base_table(a int,b int,c text,d int);
insert into hash_base_table values(1,1,'gauss',1);
insert into hash_base_table values(2,1,'gauss1',1);
insert into hash_base_table values(2,1,'gauss2',2);
insert into hash_base_table values(2,2,'gauss3',10);
insert into hash_base_table values(3,5,'gauss4',10);
/*-----case1: delete from column_replication_table where...;*/
drop table if exists col_rep_tb1;
create table col_rep_tb1(a int,b int,c int) with(orientation=column) ;
insert into col_rep_tb1 select * from base_table;
delete from col_rep_tb1 where col_rep_tb1.a>1 and col_rep_tb1.c<10;
select count(*) from col_rep_tb1 where col_rep_tb1.a>1 and col_rep_tb1.c<10;
select * from col_rep_tb1 order by a,b,c;
/*-----case2: delete from column_replication_table using hash_table where...;*/
drop table if exists col_rep_tb2;
drop table if exists hash_tb1;
create table col_rep_tb2(a int,b int,c int) with(orientation=column) ;
insert into col_rep_tb2 select * from base_table;
create table hash_tb1(a int,b int,c text,d int);
insert into hash_tb1 select * from hash_base_table;
explain (verbose on,costs off) delete from col_rep_tb2 using hash_tb1 where col_rep_tb2.a=hash_tb1.b and col_rep_tb2.c>2;
explain (ANALYSE on,costs off, timing off) delete from col_rep_tb2 using hash_tb1 where col_rep_tb2.a=hash_tb1.b and col_rep_tb2.c>2;
select * from col_rep_tb2 order by a,b,c;
/*-----case3: delete from column_replication_table where...in;*/
drop table if exists col_rep_tb3;
drop table if exists hash_tb2;
create table col_rep_tb3(a int,b int,c int) with(orientation=column) ;
insert into col_rep_tb3 select * from base_table;
create table hash_tb2(a int,b int,c text,d int);
insert into hash_tb2 select * from hash_base_table;
delete from col_rep_tb3 where a in(select b from hash_tb2);
select count(*) from col_rep_tb3 where a in(select b from hash_tb2);
/*-----case 4: delete from column_replication_table1 using column_replication_table2 where...;*/
drop table if exists col_rep_tb4;
drop table if exists col_rep_tb5;
create table col_rep_tb4(a int,b int,c int) with(orientation=column) ;
insert into col_rep_tb4 values(1,1,1);
insert into col_rep_tb4 values(2,10,1);
insert into col_rep_tb4 values(2,1,2);
insert into col_rep_tb4 values(2,12,12);
insert into col_rep_tb4 values(3,5,7);
create table col_rep_tb5(a int,b int) with(orientation=column) ;
insert into col_rep_tb5 values(1,1);
insert into col_rep_tb5 values(2,1);
insert into col_rep_tb5 values(2,1);
insert into col_rep_tb5 values(2,12);
insert into col_rep_tb5 values(3,10);
insert into col_rep_tb5 values(5,17);
delete from col_rep_tb4 using col_rep_tb5 where col_rep_tb4.b=col_rep_tb5.b and col_rep_tb4.a>1;
select * from col_rep_tb4 order by a,b,c;
/*-----case 5:with...delete;*/
drop table if exists col_rep_tb1_with;
drop table if exists hash_tb_with;
create table col_rep_tb1_with( col1 int, col2 int ,col3 text) with(orientation=column) ;
insert into col_rep_tb1_with values(1,1,'gauss1') ;
insert into col_rep_tb1_with values(1,2,'gauss2') ;
insert into col_rep_tb1_with values(2,1,'gauss3') ;
insert into col_rep_tb1_with values(3,10,'gauss4') ;
insert into col_rep_tb1_with values(10,5,'gauss5') ;
insert into col_rep_tb1_with values(10,20,'gauss6') ;
create table hash_tb_with(a int ,b int);
insert into hash_tb_with values (5,10);
insert into hash_tb_with values (1,1);
insert into hash_tb_with values (20,10);
with tempTable(col1,col2) as (
select a,b from hash_tb_with
)
delete from col_rep_tb1_with using tempTable where col_rep_tb1_with.col1 = tempTable.col2 and col_rep_tb1_with.col2 =tempTable.col1 and col_rep_tb1_with.col1>1;
select * from col_rep_tb1_with order by col1,col2,col3;
/*-----case 6:delete on transction;*/
drop table if exists create_columnar_repl_trans_001;
drop table if exists row_base_table;
create table row_base_table
(c_boolean boolean default true,
c_tinyint tinyint default 100,
c_smallint smallint default 32766,
c_integer integer default 50000,
c_bigint bigint default 1000,
c_numeric numeric(18,2) default 225.2,
c_real real default 223,
c_double_precision double precision default 10,
c_binary_double binary_double default 100,
c_dec dec(5,3) default 3.456,
c_integer_p integer(5,3) default 2.22,
c_char char(20) not null,
c_varchar varchar(20) not null,
c_varchar2 varchar2(10) null,
c_nvarchar2 nvarchar2(10) null,
c_text text null,
c_date date default '2015-01-01' );
insert into row_base_table values(true,default,500,generate_series(1,200),default,default,100,default,default,default,default,'A','today',null,null,null,default);
insert into row_base_table values(false,default,generate_series(-100,100),default,default,default,100,default,default,default,default,'A','today',null,null,null,default);
insert into row_base_table (c_char,c_varchar)values(generate_series(1,200),100);
create table create_columnar_repl_trans_001
(c_boolean boolean default true,
c_tinyint tinyint default 100,
c_smallint smallint default 32766,
c_integer integer default 50000,
c_bigint bigint default 1000,
c_numeric numeric(18,2) default 225.2,
c_real real default 223,
c_double_precision double precision default 10,
c_binary_double binary_double default 100,
c_dec dec(5,3) default 3.456,
c_integer_p integer(5,3) default 2.22,
c_char char(20) not null,
c_varchar varchar(20) not null,
c_varchar2 varchar2(10) null,
c_nvarchar2 nvarchar2(10) null,
c_text text null,
c_date date default '2015-01-01' ) with (orientation=column, compression = high)
;
insert into create_columnar_repl_trans_001 select * from row_base_table;
select count(*) from create_columnar_repl_trans_001;
create index create_index_repl_trans_001 on create_columnar_repl_trans_001(c_date);
start transaction isolation level read committed;
delete from create_columnar_repl_trans_001 where c_integer<10;
rollback;
select count(*) from create_columnar_repl_trans_001;
/*-----case 7:delete on transction2;*/
drop table if exists create_columnar_repl_trans_002;
drop table if exists trans_base_table;
create table trans_base_table
(
a_tinyint tinyint ,
a_smallint smallint not null,
a_numeric numeric(18,2) ,
a_decimal decimal null,
a_real real null,
a_double_precision double precision null,
a_dec dec ,
a_integer integer default 100,
a_char char(5) not null,
a_varchar varchar(15) null,
a_nvarchar2 nvarchar2(10) null,
a_text text null,
a_date date default '2015-07-07',
a_time time without time zone,
a_timetz time with time zone default '2013-01-25 23:41:38.8',
a_smalldatetime smalldatetime,
a_money money not null,
a_interval interval
);
insert into trans_base_table (a_smallint,a_char,a_text,a_money) values(generate_series(1,500),'fkdll','65sdcbas',20);
insert into trans_base_table (a_smallint,a_char,a_text,a_money) values(100,'fkdll','65sdcbas',generate_series(1,400));
create table create_columnar_repl_trans_002
(
a_tinyint tinyint ,
a_smallint smallint not null,
a_numeric numeric(18,2) ,
a_decimal decimal null,
a_real real null,
a_double_precision double precision null,
a_dec dec ,
a_integer integer default 100,
a_char char(5) not null,
a_varchar varchar(15) null,
a_nvarchar2 nvarchar2(10) null,
a_text text null,
a_date date default '2015-07-07',
a_time time without time zone,
a_timetz time with time zone default '2013-01-25 23:41:38.8',
a_smalldatetime smalldatetime,
a_money money not null,
a_interval interval,
partial cluster key(a_smallint)) with (orientation=column, compression = high) ;
create index create_index_repl_trans_002 on create_columnar_repl_trans_002(a_smallint,a_date,a_integer);
insert into create_columnar_repl_trans_002 select * from trans_base_table;
start transaction;
alter table create_columnar_repl_trans_002 add column a_char_01 char(20) default '中国制造';
insert into create_columnar_repl_trans_002 (a_smallint,a_char,a_money,a_char_01) values(generate_series(1,10),'li',21.1,'高斯部');
delete from create_columnar_repl_trans_002 where a_smallint>5 and a_char_01='高斯部';
rollback;
select count(*) from create_columnar_repl_trans_002 where a_smallint>5 and a_char_01='高斯部';
start transaction;
alter table create_columnar_repl_trans_002 add column a_char_01 char(20) default '中国制造';
insert into create_columnar_repl_trans_002 (a_smallint,a_char,a_money,a_char_01) values(generate_series(1,10),'li',21.1,'高斯部');
delete from create_columnar_repl_trans_002 where a_smallint>5 and a_char_01='高斯部';
commit;
select count(*) from create_columnar_repl_trans_002 where a_smallint>5 and a_char_01='高斯部';
/*-----case 8:delete on view;*/
drop table if exists create_columnar_repl_view_001 cascade;
create table create_columnar_repl_view_001
(
a_tinyint tinyint ,
a_smallint smallint not null,
a_numeric numeric(18,2) ,
a_decimal decimal null,
a_real real null,
a_double_precision double precision null,
a_dec dec ,
a_integer integer default 100,
a_char char(5) not null,
a_varchar varchar(15) null,
a_nvarchar2 nvarchar2(10) null,
a_text text null,
a_date date default '2015-07-07',
a_time time without time zone,
a_timetz time with time zone default '2013-01-25 23:41:38.8',
a_smalldatetime smalldatetime,
a_money money not null,
a_interval interval,
partial cluster key(a_smallint)) with (orientation=column, compression = high) ;
create index create_index_repl_view_001 on create_columnar_repl_view_001(a_smallint,a_date,a_integer);
insert into create_columnar_repl_view_001 select * from trans_base_table;
CREATE OR REPLACE VIEW create_columnar_repl_view_001_01 AS SELECT a_smallint,a_char,a_text,a_money FROM create_columnar_repl_view_001;
select count(*) from create_columnar_repl_view_001_01 where a_smallint>400;
alter table create_columnar_repl_view_001 add column a_char_01 char(20) default '中国制造';
insert into create_columnar_repl_view_001 (a_smallint,a_char,a_money,a_char_01) values(generate_series(1,10),'li',21.1,'高斯部');
alter table create_columnar_repl_view_001 modify (a_tinyint bigint) ;
start transaction;
delete from create_columnar_repl_view_001 where a_smallint>5 and a_char_01='高斯部';
commit;
select count(*) from create_columnar_repl_view_001 where a_smallint>5 and a_char_01='高斯部';
/*-----case9: delete from table_name [AS]alias;*/
drop table if exists create_columnar_repl_common_002;
create table create_columnar_repl_common_002
(
a_tinyint tinyint ,
a_smallint smallint not null,
a_numeric numeric(18,2) ,
a_decimal decimal null,
a_real real null,
a_double_precision double precision null,
a_dec dec ,
a_integer integer default 100,
a_char char(5) not null,
a_varchar varchar(15) null,
a_nvarchar2 nvarchar2(10) null,
a_text text null,
a_date date default '2015-07-07',
a_time time without time zone,
a_timetz time with time zone default '2013-01-25 23:41:38.8',
a_smalldatetime smalldatetime,
a_money money not null,
a_interval interval ) with (orientation=column, compression = high) ;
create index replication_common_indexes_010_1 on create_columnar_repl_common_002(a_smallint,a_date,a_integer);
create index replication_common_indexes_010_2 on create_columnar_repl_common_002(a_text);
insert into create_columnar_repl_common_002 select * from trans_base_table;;
delete from create_columnar_repl_common_002 * where a_smallint>5 and a_money=cast(20 as money);
select count(*) from create_columnar_repl_common_002 * where a_smallint>5 and a_money=cast(20 as money);
delete from create_columnar_repl_common_002 as t1 where t1.a_smallint>5 and a_text='65sdcbas';
select count(*) from create_columnar_repl_common_002 as t1 where t1.a_smallint>5 and a_text='65sdcbas';
/*-----case10: delete col_rep_partition_table;*/
drop table if exists create_columnar_repl_partition_table_006;
drop table if exists part_base_table;
create table part_base_table (c_boolean boolean default true,c_tinyint tinyint default 100,c_smallint smallint default 32766,c_integer integer default 50000,c_bigint bigint default 1000,c_numeric numeric(18,2) default 2222.22, c_real real default 333.33,c_double_precision double precision default 100,c_binary_double binary_double default 200,c_dec dec(5,3) default 3.456,c_integer_p integer(5,3) default 2.32766,c_char char(1) not null,c_varchar varchar(10) not null,c_varchar2 varchar2(10) null,c_nvarchar2 nvarchar2(10) null,c_text text null,c_date date default '2000-01-01');
insert into part_base_table values(false,default,generate_series(-100,100),default,default,default,random(),default,default,default,default,'A','today',null,null,null,default);
create table create_columnar_repl_partition_table_006 (c_boolean boolean default true,c_tinyint tinyint default 100,c_smallint smallint default 32766,c_integer integer default 50000,c_bigint bigint default 1000,c_numeric numeric(18,2) default 2222.22, c_real real default 333.33,c_double_precision double precision default 100,c_binary_double binary_double default 200,c_dec dec(5,3) default 3.456,c_integer_p integer(5,3) default 2.32766,c_char char(1) not null,c_varchar varchar(10) not null,c_varchar2 varchar2(10) null,c_nvarchar2 nvarchar2(10) null,c_text text null,c_date date default '2000-01-01') with (orientation=column)
partition by range(c_smallint)
(partition col_rep_partition_table_017_p1 values less than(0),
partition col_rep_partition_table_017_p2 values less than(32767),
partition col_rep_partition_table_017_p3 values less than(maxvalue));
insert into create_columnar_repl_partition_table_006 select * from part_base_table;
create index create_columnar_repl_part_index_01 on create_columnar_repl_partition_table_006(c_smallint,c_date) local;
delete from create_columnar_repl_partition_table_006 where c_smallint<50 and lower(c_char)='a';
select count(0) from create_columnar_repl_partition_table_006 where c_smallint<50 and lower(c_char)='a';
/*-----case11:truncate;*/
drop table if exists create_columnar_repl_common_008;
drop table if exists rep_base_table;
create table rep_base_table
(
a_tinyint tinyint ,
a_numeric numeric(18,2) ,
a_decimal decimal not null,
a_integer integer default 50,
a_varchar varchar(15) null,
a_nvarchar2 nvarchar2(10) null,
a_text text not null,
a_date date ,
a_timestamp timestamp without time zone,
a_timestamptz timestamp with time zone default '2013-02-25 23:41:38.8',
a_smalldatetime smalldatetime,
a_interval interval);
insert into rep_base_table (a_tinyint,a_numeric,a_decimal,a_text) values (generate_series(1,100),653,135.5,'hjsdkad');
insert into rep_base_table (a_tinyint,a_numeric,a_decimal,a_text,a_integer) values (100,65223,122.2,'hjsdkad',generate_series(1,500));
create table create_columnar_repl_common_008
(
a_tinyint tinyint ,
a_numeric numeric(18,2) ,
a_decimal decimal not null,
a_integer integer default 50,
a_varchar varchar(15) null,
a_nvarchar2 nvarchar2(10) null,
a_text text not null,
a_date date ,
a_timestamp timestamp without time zone,
a_timestamptz timestamp with time zone default '2013-02-25 23:41:38.8',
a_smalldatetime smalldatetime,
a_interval interval , partial cluster key(a_date,a_numeric)) with (orientation=column, compression = high) ;
insert into create_columnar_repl_common_008 select * from rep_base_table;
truncate create_columnar_repl_common_008;
select count(*)from create_columnar_repl_common_008;
delete from create_columnar_repl_common_008;
/*-----case12: delete where ...is null;*/
drop table if exists create_columnar_repl_common_009;
create table create_columnar_repl_common_009
(
a_tinyint tinyint ,
a_numeric numeric(18,2) ,
a_decimal decimal not null,
a_integer integer default 50,
a_varchar varchar(15) null,
a_nvarchar2 nvarchar2(10) null,
a_text text not null,
a_date date ,
a_timestamp timestamp without time zone,
a_timestamptz timestamp with time zone default '2013-02-25 23:41:38.8',
a_smalldatetime smalldatetime,
a_interval interval ,partial cluster key(a_date,a_numeric)) with (orientation=column, compression = high) ;
insert into create_columnar_repl_common_009 select * from rep_base_table;
delete from create_columnar_repl_common_009 where a_integer=500 and a_nvarchar2 is null and a_decimal is not null;
select count(*) from create_columnar_repl_common_009 where a_integer=500 and a_nvarchar2 is null and a_interval is not null;
/*-----case13: delete ....returning. */
drop table if exists create_columnar_repl_common_err_001;
create table create_columnar_repl_common_err_001
(
a_tinyint tinyint ,
a_numeric numeric(18,2) ,
a_decimal decimal not null,
a_integer integer default 50,
a_varchar varchar(15) null,
a_nvarchar2 nvarchar2(10) null,
a_text text not null,
a_date date ,
a_timestamp timestamp without time zone,
a_timestamptz timestamp with time zone default '2013-02-25 23:41:38.8',
a_smalldatetime smalldatetime,
a_interval interval , partial cluster key(a_date,a_numeric)) with (orientation=column, compression = high) ;
insert into create_columnar_repl_common_err_001 select * from rep_base_table;
delete from create_columnar_repl_common_err_001 where a_tinyint > 50 returning *;
select count(*) from create_columnar_repl_common_err_001 where a_tinyint > 50 ;
/*-----case13: update;*/
drop table if exists col_rep_tb1_update;
create table col_rep_tb1_update(a int,b int,c int) with(orientation=column) ;
insert into col_rep_tb1_update select * from base_table;
select * from col_rep_tb1_update order by a,b,c;
update col_rep_tb1_update SET a=a*10,b=b*10 WHERE col_rep_tb1_update.c > 5 and col_rep_tb1_update.a=col_rep_tb1_update.b;
select * from col_rep_tb1_update order by a,b,c;
/*-----case14: 不能下推的场景;*/
drop table if exists col_rep_tb_concat;
create table col_rep_tb_concat(a text ,b text,c text ) with(orientation=column) ;
insert into col_rep_tb_concat values('gauss','1','abc');
insert into col_rep_tb_concat values('gauss','1','abc');
insert into col_rep_tb_concat values('gauss','2','abc');
delete from col_rep_tb_concat where a in (select distinct on (b)b from col_rep_tb_concat);
/*-----case15: row_repliction_table has no primary key to support delete;*/
drop table if exists row_rep_tb;
drop table if exists hash_tb3;
create table row_rep_tb(a int,b int,c int) ;
insert into row_rep_tb select * from base_table;
create table hash_tb3(a int,b int,c text,d int);
insert into hash_tb3 select * from hash_base_table;
explain (verbose on,costs off) delete from row_rep_tb using hash_tb3 where row_rep_tb.a=hash_tb3.b and row_rep_tb.c>2;
explain (ANALYSE on,costs off, timing off) delete from row_rep_tb using hash_tb3 where row_rep_tb.a=hash_tb3.b and row_rep_tb.c>2;
select * from row_rep_tb order by a,b,c;
/*-----case16: update:update row_replication_table set ... where...*/
drop table if exists row_rep_tb1_update;
create table row_rep_tb1_update(a int,b int,c int) ;
insert into row_rep_tb1_update select * from base_table;
select * from row_rep_tb1_update order by a,b,c;
update row_rep_tb1_update SET a=a*10,b=b*10 WHERE row_rep_tb1_update.c > 9 and row_rep_tb1_update.a=row_rep_tb1_update.b;
select * from row_rep_tb1_update order by a,b,c;
/*-----case17: update:update row_replication_table set ... from hash_table where ...*/
drop table if exists row_rep_tb2_update;
drop table if exists hash_table01;
create table row_rep_tb2_update(a int,b int,c int) ;
insert into row_rep_tb2_update select * from base_table;
select * from row_rep_tb2_update order by a,b,c;
create table hash_table01 (a int, b int);
insert into hash_table01 values(1,0);
insert into hash_table01 values(3,0);
update row_rep_tb2_update UP SET UP.a=UP.a*10,UP.b=UP.b*10 from hash_table01 WHERE hash_table01.a=UP.a and UP.c<10 ;
select * from row_rep_tb2_update order by a,b,c;
/*-----case18: update:update row_replication_table set ... from replication_table where ... */
drop table if exists row_rep_tb3_update;
drop table if exists row_rep_tb4_update;
create table row_rep_tb3_update(a int,b int,c int) ;
insert into row_rep_tb3_update select * from base_table;
select * from row_rep_tb3_update order by a,b,c;
create table row_rep_tb4_update (a int, b int) with (orientation=column) ;
insert into row_rep_tb4_update values(1,0);
insert into row_rep_tb4_update values(3,0);
update row_rep_tb3_update UP SET UP.a=UP.a*10,UP.b=UP.b*10 from row_rep_tb4_update WHERE row_rep_tb4_update.a=UP.a and UP.c<10 ;
select * from row_rep_tb3_update order by a,b,c;
/*-----case19: 行存复制表没有主键,update不能下推的场景;*/
drop table if exists col_rep_tb_concat1;
create table col_rep_tb_concat1(a text ,b text,c text ,d int) ;
insert into col_rep_tb_concat1 values('gauss1','1','abc',1);
insert into col_rep_tb_concat1 values('gauss2','1','abc',1);
insert into col_rep_tb_concat1 values('gauss3','2','abc',1);
update col_rep_tb_concat1 set d=d*10 where a in (select distinct on (b)b from col_rep_tb_concat);
/*-----case20: 行存复制表有主键的update;*/
drop table if exists col_rep_tb_concat2;
create table col_rep_tb_concat2(a text PRIMARY KEY,b text,c text,d int) ;
insert into col_rep_tb_concat2 values('gauss1','1','abc',1);
insert into col_rep_tb_concat2 values('gauss2','1','abc',1);
insert into col_rep_tb_concat2 values('gauss3','2','abc1',1);
update col_rep_tb_concat2 set d=d*10 where concat(c,b)='abc1';
drop schema replication_update_and_delete CASCADE; | the_stack |
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Section (AD_Client_ID,AD_Org_ID,AD_Tab_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,296,540043,TO_TIMESTAMP('2017-01-30 15:50:40','YYYY-MM-DD HH24:MI:SS'),100,'Y','main',10,TO_TIMESTAMP('2017-01-30 15:50:40','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Column (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,0,540060,540043,TO_TIMESTAMP('2017-01-30 15:50:40','YYYY-MM-DD HH24:MI:SS'),100,'Y',10,TO_TIMESTAMP('2017-01-30 15:50:40','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Column (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,0,540061,540043,TO_TIMESTAMP('2017-01-30 15:50:40','YYYY-MM-DD HH24:MI:SS'),100,'Y',20,TO_TIMESTAMP('2017-01-30 15:50:40','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,UIStyle,Updated,UpdatedBy) VALUES (0,0,540060,540077,TO_TIMESTAMP('2017-01-30 15:50:40','YYYY-MM-DD HH24:MI:SS'),100,'Y','default',10,'primary',TO_TIMESTAMP('2017-01-30 15:50:40','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,3489,0,296,540077,541300,TO_TIMESTAMP('2017-01-30 15:50:40','YYYY-MM-DD HH24:MI:SS'),100,'Belegart oder Verarbeitungsvorgaben','Die Belegart bestimmt den Nummernkreis und die Vorgaben für die Belegverarbeitung.','Y','N','Y','Y','N','Belegart',10,10,0,TO_TIMESTAMP('2017-01-30 15:50:40','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,3477,0,296,540077,541301,TO_TIMESTAMP('2017-01-30 15:50:40','YYYY-MM-DD HH24:MI:SS'),100,'Organisatorische Einheit des Mandanten','Eine Organisation ist ein Bereich ihres Mandanten - z.B. Laden oder Abteilung. Sie können Daten über Organisationen hinweg gemeinsam verwenden.','Y','N','Y','N','N','Sektion',20,0,0,TO_TIMESTAMP('2017-01-30 15:50:40','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,3496,0,296,540077,541302,TO_TIMESTAMP('2017-01-30 15:50:40','YYYY-MM-DD HH24:MI:SS'),100,'Document sequence number of the document','The document number is usually automatically generated by the system and determined by the document type of the document. If the document is not saved, the preliminary number is displayed in "<>".
If the document type of your document has no automatic document sequence defined, the field is empty if you create a new document. This is for documents which usually have an external number (like vendor invoice). If you leave the field empty, the system will generate a document number for you. The document sequence used for this fallback number is defined in the "Maintain Sequence" window with the name "DocumentNo_<TableName>", where TableName is the actual name of the table (e.g. C_Order).','Y','N','Y','Y','N','Beleg Nr.',30,20,0,TO_TIMESTAMP('2017-01-30 15:50:40','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,3502,0,296,540077,541303,TO_TIMESTAMP('2017-01-30 15:50:40','YYYY-MM-DD HH24:MI:SS'),100,'Referenz-Nummer des Kunden','The business partner order reference is the order reference for this specific transaction; Often Purchase Order numbers are given to print on Invoices for easier reference. A standard number can be defined in the Business Partner (Customer) window.','Y','N','Y','N','N','Referenz',40,0,0,TO_TIMESTAMP('2017-01-30 15:50:40','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,3481,0,296,540077,541304,TO_TIMESTAMP('2017-01-30 15:50:40','YYYY-MM-DD HH24:MI:SS'),100,'Datum, an dem eine Produkt in oder aus dem Bestand bewegt wurde','"Bewegungs-Datum" bezeichnet das Datum, zu dem das Produkt in oder aus dem Bestand bewegt wurde Dies ist das Ergebnis einer Auslieferung, eines Wareneingangs oder einer Warenbewqegung.','Y','N','Y','Y','N','Bewegungs-Datum',50,30,0,TO_TIMESTAMP('2017-01-30 15:50:40','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,3493,0,296,540077,541305,TO_TIMESTAMP('2017-01-30 15:50:40','YYYY-MM-DD HH24:MI:SS'),100,'Accounting Date','The Accounting Date indicates the date to be used on the General Ledger account entries generated from this document. It is also used for any currency conversion.','Y','N','Y','Y','N','Buchungsdatum',60,40,0,TO_TIMESTAMP('2017-01-30 15:50:40','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,3490,0,296,540077,541306,TO_TIMESTAMP('2017-01-30 15:50:40','YYYY-MM-DD HH24:MI:SS'),100,'Order','The Order is a control document. The Order is complete when the quantity ordered is the same as the quantity shipped and invoiced. When you cloase an order, unshipped (backordered) quantities are cancelled.','Y','N','Y','Y','N','Bestellung',70,50,0,TO_TIMESTAMP('2017-01-30 15:50:40','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,3475,0,296,540077,541307,TO_TIMESTAMP('2017-01-30 15:50:40','YYYY-MM-DD HH24:MI:SS'),100,'Datum des Auftrags','Bezeichnet das Datum, an dem die Ware bestellt wurde.','Y','N','Y','Y','N','Bestelldatum',80,60,0,TO_TIMESTAMP('2017-01-30 15:50:40','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,3486,0,296,540077,541308,TO_TIMESTAMP('2017-01-30 15:50:40','YYYY-MM-DD HH24:MI:SS'),100,'Bezeichnet einen Geschäftspartner','Ein Geschäftspartner ist jemand, mit dem Sie interagieren. Dies kann Lieferanten, Kunden, Mitarbeiter oder Handelsvertreter umfassen.','Y','N','Y','Y','N','Lieferant',90,70,0,TO_TIMESTAMP('2017-01-30 15:50:40','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementField (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_UI_ElementField_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,3485,0,540057,541308,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100,'Y',10,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementField (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_UI_ElementField_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,3487,0,540058,541308,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100,'Y',20,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,547290,0,296,540077,541309,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Anschrift-Text',100,0,0,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,3501,0,296,540077,541310,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100,'Lager oder Ort für Dienstleistung','Das Lager identifiziert ein einzelnes Lager für Artikel oder einen Standort an dem Dienstleistungen geboten werden.','Y','N','Y','Y','N','Lager',110,80,0,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,553953,0,296,540077,541311,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Ziel-Lager',120,0,0,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,55426,0,296,540077,541312,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100,'Beim Streckengeschäft wird die Ware direkt vom Lieferanten zum Kunden geliefert','Drop Shipments do not cause any Inventory reservations or movements as the Shipment is from the Vendor''s inventory. The Shipment of the Vendor to the Customer must be confirmed.','Y','N','Y','Y','N','Streckengeschäft',130,90,0,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,55427,0,296,540077,541313,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100,'Business Partner to ship to','If empty the business partner will be shipped to.','Y','N','Y','N','N','Lieferempfänger',140,0,0,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementField (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_UI_ElementField_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,55428,0,540059,541313,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100,'Y',10,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementField (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_UI_ElementField_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,55425,0,540060,541313,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100,'Y',20,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,547292,0,296,540077,541314,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Lieferadresse',150,0,0,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,7804,0,296,540077,541315,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100,'Finanzprojekt','Ein Projekt erlaubt, interne oder externe Vorgäng zu verfolgen und zu kontrollieren.','Y','N','Y','N','N','Projekt',160,0,0,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,7802,0,296,540077,541316,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100,'Kostenstelle','Erfassung der zugehörigen Kostenstelle','Y','N','Y','N','N','Kostenstelle',170,0,0,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,7803,0,296,540077,541317,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100,'Marketing Campaign','The Campaign defines a unique marketing program. Projects can be associated with a pre defined Marketing Campaign. You can then report based on a specific Campaign.','Y','N','Y','N','N','Werbemassnahme',180,0,0,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,7805,0,296,540077,541318,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100,'Durchführende oder auslösende Organisation','Die Organisation, die diese Transaktion durchführt oder auslöst (für eine andere Organisation). Die besitzende Organisation muss nicht die durchführende Organisation sein. Dies kann bei zentralisierten Dienstleistungen oder Vorfällen zwischen Organisationen der Fall sein.','Y','N','Y','N','N','Buchende Organisation',190,0,0,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,7801,0,296,540077,541319,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100,'Nutzerdefiniertes Element Nr. 1','Das Nutzerdefinierte Element zeigt die optionalen Elementwerte an, die für diese Kontenkombination definiert sind.','Y','N','Y','N','N','Nutzer 1',200,0,0,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,7800,0,296,540077,541320,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100,'Nutzerdefiniertes Element Nr. 2','Das Nutzerdefinierte Element zeigt die optionalen Elementwerte an, die für diese Kontenkombination definiert sind.','Y','N','Y','N','N','Nutzer 2',210,0,0,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,10347,0,296,540077,541321,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100,'Bestätigung für den Beleg erzeugen','Die erzeugten Bestätigungen müssen verarbeitet (bestätigt) werden, bevor dieser Beleg verarbeitet werden kann.','Y','N','Y','N','N','Bestätigung erzeugen',220,0,0,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,4249,0,296,540077,541322,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100,'Rechnung aus dieser Zugangsbeleg erstellen und verarbeiten. Der Zugangsbeleg sollte vollständig und korrekt sein.','Das Erstellen der Rechnung aus dem Zugangsbeleg erzeugt eine passende Rechnung zu diesem Zugangsbeleg und ordnet sie zu. Sie können die Belegnummer nur setzen, wenn die Rechnungsbelegart gestattet, die Belegnummer manuell zu setzen.','Y','N','Y','N','N','Rechnung aus Zugangsbeleg erstellen',230,0,0,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,3505,0,296,540077,541323,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100,'The current status of the document','The Document Status indicates the status of a document at this time. If you want to change the document status, use the Document Action field','Y','N','Y','Y','N','Belegstatus',240,100,0,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,4248,0,296,540077,541324,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100,'Prozess, der die Position(en) aus einem bestehenden Beleg kopiert','Startet einen Prozess, der die Position(en) zu diesem Belegkopf durch Kopie aus einem bestehenden Beleg anlegt.','Y','N','Y','N','N','Position(en) kopieren von',250,0,0,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,3506,0,296,540077,541325,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100,'Warenein-/ausgang verarbeiten (Bestand aktualisieren)','Verarbeitung des Warenein-/ausgangs erhöht/vermindert den Bestand und markiert Positionen als ein-/ausgeliefert.','Y','N','Y','N','N','Warenein-/ausgang verarbeiten ',260,0,0,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,5146,0,296,540077,541326,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100,'Posting status','The Posted field indicates the status of the Generation of General Ledger Accounting Lines ','Y','N','Y','N','N','Verbucht',270,0,0,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,555478,0,296,540077,541327,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','Y','N','Lieferung/ Wareneingang freigeben',280,110,0,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,553216,0,296,540077,541328,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Beleg soll per EDI übermittelt werden',290,0,0,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,553217,0,296,540077,541329,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','EDI Status Exportieren',300,0,0,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,555714,0,296,540077,541330,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','DESADV',310,0,0,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,553218,0,296,540077,541331,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','EDI Fehlermeldung',320,0,0,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Section (AD_Client_ID,AD_Org_ID,AD_Tab_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,297,540044,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100,'Y','main',10,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Column (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,0,540062,540044,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100,'Y',10,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,UIStyle,Updated,UpdatedBy) VALUES (0,0,540062,540078,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100,'Y','default',10,'primary',TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,6536,0,297,540078,541332,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100,'Instanz des Merkmals-Satzes zum Produkt','The values of the actual Product Attribute Instances. The product level attributes are defined on Product level.','Y','N','N','Y','N','Ausprägung Merkmals-Satz',0,10,0,TO_TIMESTAMP('2017-01-30 15:50:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,3518,0,297,540078,541333,TO_TIMESTAMP('2017-01-30 15:50:42','YYYY-MM-DD HH24:MI:SS'),100,'Einzelne Zeile in dem Dokument','Indicates the unique line for a document. It will also control the display order of the lines within a document.','Y','N','N','Y','N','Zeile Nr.',0,20,0,TO_TIMESTAMP('2017-01-30 15:50:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,3515,0,297,540078,541334,TO_TIMESTAMP('2017-01-30 15:50:42','YYYY-MM-DD HH24:MI:SS'),100,'Produkt, Leistung, Artikel','Bezeichnet eine Einheit, die in dieser Organisation gekauft oder verkauft wird.','Y','N','N','Y','N','Produkt',0,30,0,TO_TIMESTAMP('2017-01-30 15:50:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,10825,0,297,540078,541335,TO_TIMESTAMP('2017-01-30 15:50:42','YYYY-MM-DD HH24:MI:SS'),100,'Die Eingegebene Menge basiert auf der gewählten Mengeneinheit','Die Eingegebene Menge wird in die Basismenge zur Produkt-Mengeneinheit umgewandelt','Y','N','N','Y','N','Menge',0,40,0,TO_TIMESTAMP('2017-01-30 15:50:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,3517,0,297,540078,541336,TO_TIMESTAMP('2017-01-30 15:50:42','YYYY-MM-DD HH24:MI:SS'),100,'Maßeinheit','Eine eindeutige (nicht monetäre) Maßeinheit','Y','N','N','Y','N','Maßeinheit',0,50,0,TO_TIMESTAMP('2017-01-30 15:50:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,554028,0,297,540078,541337,TO_TIMESTAMP('2017-01-30 15:50:42','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','Menge TU',0,60,0,TO_TIMESTAMP('2017-01-30 15:50:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,3510,0,297,540078,541338,TO_TIMESTAMP('2017-01-30 15:50:42','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','Beschreibung',0,70,0,TO_TIMESTAMP('2017-01-30 15:50:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,3521,0,297,540078,541339,TO_TIMESTAMP('2017-01-30 15:50:42','YYYY-MM-DD HH24:MI:SS'),100,'Bestellposition','"Bestellposition" bezeichnet eine einzelne Position in einem Auftrag.','Y','N','N','Y','N','Bestellposition',0,80,0,TO_TIMESTAMP('2017-01-30 15:50:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,3514,0,297,540078,541340,TO_TIMESTAMP('2017-01-30 15:50:42','YYYY-MM-DD HH24:MI:SS'),100,'Lagerort im Lager','"Lagerort" bezeichnet, wo im Lager ein Produkt aufzufinden ist.','Y','N','N','Y','N','Lagerort',0,90,0,TO_TIMESTAMP('2017-01-30 15:50:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,554043,0,297,540078,541341,TO_TIMESTAMP('2017-01-30 15:50:42','YYYY-MM-DD HH24:MI:SS'),100,'Document is in dispute','The document is in dispute. Use Requests to track details.','Y','N','N','Y','N','In Dispute',0,100,0,TO_TIMESTAMP('2017-01-30 15:50:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,554049,0,297,540078,541342,TO_TIMESTAMP('2017-01-30 15:50:42','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','Qualitätsabzug %',0,110,0,TO_TIMESTAMP('2017-01-30 15:50:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,554091,0,297,540078,541343,TO_TIMESTAMP('2017-01-30 15:50:42','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','Qualität-Notiz',0,120,0,TO_TIMESTAMP('2017-01-30 15:50:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,554370,0,297,540078,541344,TO_TIMESTAMP('2017-01-30 15:50:42','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','Unterlieferanten',0,130,0,TO_TIMESTAMP('2017-01-30 15:50:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:51
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET Name='rest', SeqNo=99, UIStyle='',Updated=TO_TIMESTAMP('2017-01-30 15:51:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=540077
;
-- 30.01.2017 15:51
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,UIStyle,Updated,UpdatedBy) VALUES (0,0,540060,540079,TO_TIMESTAMP('2017-01-30 15:51:27','YYYY-MM-DD HH24:MI:SS'),100,'Y','default',10,'primary',TO_TIMESTAMP('2017-01-30 15:51:27','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:53
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,UIStyle,Updated,UpdatedBy) VALUES (0,3486,0,296,540079,541345,TO_TIMESTAMP('2017-01-30 15:53:19','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Lieferant',10,0,0,'primary',TO_TIMESTAMP('2017-01-30 15:53:19','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:54
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540060,540080,TO_TIMESTAMP('2017-01-30 15:54:59','YYYY-MM-DD HH24:MI:SS'),100,'Y','dropship',20,TO_TIMESTAMP('2017-01-30 15:54:59','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,55426,0,296,540080,541346,TO_TIMESTAMP('2017-01-30 15:55:54','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Streckengeschäft',10,0,0,TO_TIMESTAMP('2017-01-30 15:55:54','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:56
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,55427,0,296,540080,541347,TO_TIMESTAMP('2017-01-30 15:56:13','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Lieferempfänger',20,0,0,TO_TIMESTAMP('2017-01-30 15:56:13','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:56
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementField (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_UI_ElementField_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,55425,0,540061,541347,TO_TIMESTAMP('2017-01-30 15:56:30','YYYY-MM-DD HH24:MI:SS'),100,'Y',10,TO_TIMESTAMP('2017-01-30 15:56:30','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:56
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementField (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_UI_ElementField_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,55428,0,540062,541347,TO_TIMESTAMP('2017-01-30 15:56:46','YYYY-MM-DD HH24:MI:SS'),100,'Y',20,TO_TIMESTAMP('2017-01-30 15:56:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:57
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementField (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_UI_ElementField_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,547292,0,540063,541345,TO_TIMESTAMP('2017-01-30 15:57:39','YYYY-MM-DD HH24:MI:SS'),100,'Y',10,TO_TIMESTAMP('2017-01-30 15:57:39','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:57
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementField (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_UI_ElementField_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,3485,0,540064,541345,TO_TIMESTAMP('2017-01-30 15:57:46','YYYY-MM-DD HH24:MI:SS'),100,'Y',20,TO_TIMESTAMP('2017-01-30 15:57:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:57
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_ElementField WHERE AD_UI_ElementField_ID=540057
;
-- 30.01.2017 15:57
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_ElementField WHERE AD_UI_ElementField_ID=540058
;
-- 30.01.2017 15:58
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541308
;
-- 30.01.2017 15:58
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_ElementField WHERE AD_UI_ElementField_ID=540059
;
-- 30.01.2017 15:58
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_ElementField WHERE AD_UI_ElementField_ID=540060
;
-- 30.01.2017 15:58
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541313
;
-- 30.01.2017 15:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540061,540081,TO_TIMESTAMP('2017-01-30 15:59:07','YYYY-MM-DD HH24:MI:SS'),100,'Y','dates',10,TO_TIMESTAMP('2017-01-30 15:59:07','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,3489,0,296,540081,541348,TO_TIMESTAMP('2017-01-30 15:59:27','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Belegart',10,0,0,TO_TIMESTAMP('2017-01-30 15:59:27','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 15:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,3502,0,296,540081,541349,TO_TIMESTAMP('2017-01-30 15:59:39','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Referenz',20,0,0,TO_TIMESTAMP('2017-01-30 15:59:39','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 16:00
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,9235,0,296,540081,541350,TO_TIMESTAMP('2017-01-30 16:00:17','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Eingangsdatum',30,0,0,TO_TIMESTAMP('2017-01-30 16:00:17','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 16:00
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,3481,0,296,540081,541351,TO_TIMESTAMP('2017-01-30 16:00:34','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Bewegungsdatum',40,0,0,TO_TIMESTAMP('2017-01-30 16:00:34','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 16:00
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,3475,0,296,540081,541352,TO_TIMESTAMP('2017-01-30 16:00:50','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Bestelldatum',50,0,0,TO_TIMESTAMP('2017-01-30 16:00:50','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 16:01
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540061,540082,TO_TIMESTAMP('2017-01-30 16:01:07','YYYY-MM-DD HH24:MI:SS'),100,'Y','org',20,TO_TIMESTAMP('2017-01-30 16:01:07','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 16:01
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,3477,0,296,540082,541353,TO_TIMESTAMP('2017-01-30 16:01:21','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Sektion',10,0,0,TO_TIMESTAMP('2017-01-30 16:01:21','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 16:01
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,3501,0,296,540082,541354,TO_TIMESTAMP('2017-01-30 16:01:30','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Lager',20,0,0,TO_TIMESTAMP('2017-01-30 16:01:30','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 16:01
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541301
;
-- 30.01.2017 16:01
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541303
;
-- 30.01.2017 16:01
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541304
;
-- 30.01.2017 16:01
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541307
;
-- 30.01.2017 16:02
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540061,540083,TO_TIMESTAMP('2017-01-30 16:02:33','YYYY-MM-DD HH24:MI:SS'),100,'Y','rest',30,TO_TIMESTAMP('2017-01-30 16:02:33','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 16:03
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,3496,0,296,540083,541355,TO_TIMESTAMP('2017-01-30 16:03:37','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Beleg Nr.',10,0,0,TO_TIMESTAMP('2017-01-30 16:03:37','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 16:03
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,3505,0,296,540083,541356,TO_TIMESTAMP('2017-01-30 16:03:51','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Belegstatus',20,0,0,TO_TIMESTAMP('2017-01-30 16:03:51','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 16:05
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,3506,0,296,540083,541357,TO_TIMESTAMP('2017-01-30 16:05:07','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Wareneingang verarbeiten',30,0,0,TO_TIMESTAMP('2017-01-30 16:05:07','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 30.01.2017 16:06
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-01-30 16:06:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541300
;
-- 30.01.2017 16:06
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541300
;
-- 30.01.2017 16:06
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541302
;
-- 30.01.2017 16:06
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541323
;
-- 30.01.2017 16:06
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-01-30 16:06:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541305
;
-- 30.01.2017 16:06
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-01-30 16:06:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541306
;
-- 30.01.2017 16:06
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-01-30 16:06:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541309
;
-- 30.01.2017 16:06
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-01-30 16:06:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541310
;
-- 30.01.2017 16:06
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-01-30 16:06:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541311
;
-- 30.01.2017 16:06
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-01-30 16:06:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541312
;
-- 30.01.2017 16:06
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-01-30 16:06:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541314
;
-- 30.01.2017 16:06
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-01-30 16:06:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541315
;
-- 30.01.2017 16:06
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-01-30 16:06:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541316
;
-- 30.01.2017 16:06
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-01-30 16:06:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541317
;
-- 30.01.2017 16:06
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-01-30 16:06:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541318
;
-- 30.01.2017 16:06
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-01-30 16:06:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541319
;
-- 30.01.2017 16:06
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-01-30 16:06:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541320
;
-- 30.01.2017 16:06
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-01-30 16:06:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541321
;
-- 30.01.2017 16:06
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-01-30 16:06:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541322
;
-- 30.01.2017 16:06
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-01-30 16:06:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541324
;
-- 30.01.2017 16:06
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-01-30 16:06:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541325
;
-- 30.01.2017 16:06
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-01-30 16:06:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541326
;
-- 30.01.2017 16:06
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-01-30 16:06:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541327
;
-- 30.01.2017 16:06
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-01-30 16:06:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541328
;
-- 30.01.2017 16:06
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-01-30 16:06:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541329
;
-- 30.01.2017 16:06
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-01-30 16:06:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541330
;
-- 30.01.2017 16:06
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-01-30 16:06:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541331
;
-- 30.01.2017 16:09
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-01-30 16:09:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541306
;
-- 30.01.2017 16:09
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-01-30 16:09:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541305
;
-- 30.01.2017 16:09
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-01-30 16:09:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541310
;
-- 30.01.2017 16:09
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-01-30 16:09:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541327
;
-- 30.01.2017 16:09
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-01-30 16:09:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541312
;
-- 30.01.2017 16:09
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=10,Updated=TO_TIMESTAMP('2017-01-30 16:09:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541348
;
-- 30.01.2017 16:09
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=20,Updated=TO_TIMESTAMP('2017-01-30 16:09:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541355
;
-- 30.01.2017 16:09
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2017-01-30 16:09:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541345
;
-- 30.01.2017 16:09
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2017-01-30 16:09:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541352
;
-- 30.01.2017 16:09
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=50,Updated=TO_TIMESTAMP('2017-01-30 16:09:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541350
;
-- 30.01.2017 16:09
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=60,Updated=TO_TIMESTAMP('2017-01-30 16:09:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541351
;
-- 30.01.2017 16:09
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=70,Updated=TO_TIMESTAMP('2017-01-30 16:09:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541346
;
-- 30.01.2017 16:09
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=80,Updated=TO_TIMESTAMP('2017-01-30 16:09:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541354
;
-- 30.01.2017 16:09
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2017-01-30 16:09:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541356
;
-- 30.01.2017 16:09
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2017-01-30 16:09:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541345
;
-- 30.01.2017 16:09
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=50,Updated=TO_TIMESTAMP('2017-01-30 16:09:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541352
;
-- 30.01.2017 16:09
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=60,Updated=TO_TIMESTAMP('2017-01-30 16:09:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541350
;
-- 30.01.2017 16:09
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=70,Updated=TO_TIMESTAMP('2017-01-30 16:09:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541351
;
-- 30.01.2017 16:09
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=80,Updated=TO_TIMESTAMP('2017-01-30 16:09:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541346
;
-- 30.01.2017 16:09
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=90,Updated=TO_TIMESTAMP('2017-01-30 16:09:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541354
;
-- 30.01.2017 16:11
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541310
;
-- 30.01.2017 16:11
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541312
;
-- Jan 30, 2017 6:12 PM
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET DisplayLogic='@IsDropShip@=Y',Updated=TO_TIMESTAMP('2017-01-30 18:12:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=55427
; | the_stack |
PRAGMA foreign_keys = false;
-- ----------------------------
-- Table structure for contacts
-- ----------------------------
DROP TABLE IF EXISTS "contacts";
CREATE TABLE `contacts` (`id` integer not null primary key autoincrement, `name` varchar(255) null, `email` varchar(255) null, `phone` varchar(255) null, `message` text null, `created_by` integer null, `updated_by` integer null, `created_at` datetime null default CURRENT_TIMESTAMP, `updated_at` datetime null default CURRENT_TIMESTAMP);
-- ----------------------------
-- Table structure for core_store
-- ----------------------------
DROP TABLE IF EXISTS "core_store";
CREATE TABLE `core_store` (`id` integer not null primary key autoincrement, `key` varchar(255) null, `value` text null, `type` varchar(255) null, `environment` varchar(255) null, `tag` varchar(255) null);
-- ----------------------------
-- Table structure for generals
-- ----------------------------
DROP TABLE IF EXISTS "generals";
CREATE TABLE `generals` (`id` integer not null primary key autoincrement, `title` varchar(255) null, `subtitle` varchar(255) null, `created_by` integer null, `updated_by` integer null, `created_at` datetime null default CURRENT_TIMESTAMP, `updated_at` datetime null default CURRENT_TIMESTAMP);
-- ----------------------------
-- Table structure for posts
-- ----------------------------
DROP TABLE IF EXISTS "posts";
CREATE TABLE `posts` (`id` integer not null primary key autoincrement, `title` varchar(255) not null, `content` text not null, `is_publish` boolean not null, `created_by` integer null, `updated_by` integer null, `created_at` datetime null default CURRENT_TIMESTAMP, `updated_at` datetime null default CURRENT_TIMESTAMP);
-- ----------------------------
-- Table structure for posts_tags__tags_posts
-- ----------------------------
DROP TABLE IF EXISTS "posts_tags__tags_posts";
CREATE TABLE `posts_tags__tags_posts` (`id` integer not null primary key autoincrement, `tag_id` integer null, `post_id` integer null);
-- ----------------------------
-- Table structure for sqlite_sequence
-- ----------------------------
DROP TABLE IF EXISTS "sqlite_sequence";
CREATE TABLE sqlite_sequence(name,seq);
-- ----------------------------
-- Table structure for strapi_administrator
-- ----------------------------
DROP TABLE IF EXISTS "strapi_administrator";
CREATE TABLE `strapi_administrator` (`id` integer not null primary key autoincrement, `firstname` varchar(255) null, `lastname` varchar(255) null, `username` varchar(255) null, `email` varchar(255) not null, `password` varchar(255) null, `resetPasswordToken` varchar(255) null, `registrationToken` varchar(255) null, `isActive` boolean null, `blocked` boolean null);
-- ----------------------------
-- Table structure for strapi_permission
-- ----------------------------
DROP TABLE IF EXISTS "strapi_permission";
CREATE TABLE `strapi_permission` (`id` integer not null primary key autoincrement, `action` varchar(255) not null, `subject` varchar(255) null, `fields` text null, `conditions` text null, `role` integer null, `created_at` datetime null default CURRENT_TIMESTAMP, `updated_at` datetime null default CURRENT_TIMESTAMP);
-- ----------------------------
-- Table structure for strapi_role
-- ----------------------------
DROP TABLE IF EXISTS "strapi_role";
CREATE TABLE `strapi_role` (`id` integer not null primary key autoincrement, `name` varchar(255) not null, `code` varchar(255) not null, `description` varchar(255) null, `created_at` datetime null default CURRENT_TIMESTAMP, `updated_at` datetime null default CURRENT_TIMESTAMP);
-- ----------------------------
-- Table structure for strapi_users_roles
-- ----------------------------
DROP TABLE IF EXISTS "strapi_users_roles";
CREATE TABLE `strapi_users_roles` (`id` integer not null primary key autoincrement, `user_id` integer null, `role_id` integer null);
-- ----------------------------
-- Table structure for strapi_webhooks
-- ----------------------------
DROP TABLE IF EXISTS "strapi_webhooks";
CREATE TABLE `strapi_webhooks` (`id` integer not null primary key autoincrement, `name` varchar(255) null, `url` text null, `headers` text null, `events` text null, `enabled` boolean null);
-- ----------------------------
-- Table structure for tags
-- ----------------------------
DROP TABLE IF EXISTS "tags";
CREATE TABLE `tags` (`id` integer not null primary key autoincrement, `title` varchar(255) null, `created_by` integer null, `updated_by` integer null, `created_at` datetime null default CURRENT_TIMESTAMP, `updated_at` datetime null default CURRENT_TIMESTAMP);
-- ----------------------------
-- Table structure for upload_file
-- ----------------------------
DROP TABLE IF EXISTS "upload_file";
CREATE TABLE `upload_file` (`id` integer not null primary key autoincrement, `name` varchar(255) not null, `alternativeText` varchar(255) null, `caption` varchar(255) null, `width` integer null, `height` integer null, `formats` text null, `hash` varchar(255) not null, `ext` varchar(255) null, `mime` varchar(255) not null, `size` float not null, `url` varchar(255) not null, `previewUrl` varchar(255) null, `provider` varchar(255) not null, `provider_metadata` text null, `created_by` integer null, `updated_by` integer null, `created_at` datetime null default CURRENT_TIMESTAMP, `updated_at` datetime null default CURRENT_TIMESTAMP);
-- ----------------------------
-- Table structure for upload_file_morph
-- ----------------------------
DROP TABLE IF EXISTS "upload_file_morph";
CREATE TABLE `upload_file_morph` (`id` integer not null primary key autoincrement, `upload_file_id` integer null, `related_id` integer null, `related_type` text null, `field` text null, `order` integer null);
-- ----------------------------
-- Table structure for users-permissions_permission
-- ----------------------------
DROP TABLE IF EXISTS "users-permissions_permission";
CREATE TABLE `users-permissions_permission` (`id` integer not null primary key autoincrement, `type` varchar(255) not null, `controller` varchar(255) not null, `action` varchar(255) not null, `enabled` boolean not null, `policy` varchar(255) null, `role` integer null, `created_by` integer null, `updated_by` integer null);
-- ----------------------------
-- Table structure for users-permissions_role
-- ----------------------------
DROP TABLE IF EXISTS "users-permissions_role";
CREATE TABLE `users-permissions_role` (`id` integer not null primary key autoincrement, `name` varchar(255) not null, `description` varchar(255) null, `type` varchar(255) null, `created_by` integer null, `updated_by` integer null);
-- ----------------------------
-- Table structure for users-permissions_user
-- ----------------------------
DROP TABLE IF EXISTS "users-permissions_user";
CREATE TABLE `users-permissions_user` (`id` integer not null primary key autoincrement, `username` varchar(255) not null, `email` varchar(255) not null, `provider` varchar(255) null, `password` varchar(255) null, `resetPasswordToken` varchar(255) null, `confirmed` boolean null, `blocked` boolean null, `role` integer null, `created_by` integer null, `updated_by` integer null, `created_at` datetime null default CURRENT_TIMESTAMP, `updated_at` datetime null default CURRENT_TIMESTAMP);
-- ----------------------------
-- Auto increment value for contacts
-- ----------------------------
UPDATE "main"."sqlite_sequence" SET seq = 3 WHERE name = 'contacts';
-- ----------------------------
-- Auto increment value for core_store
-- ----------------------------
UPDATE "main"."sqlite_sequence" SET seq = 33 WHERE name = 'core_store';
-- ----------------------------
-- Auto increment value for generals
-- ----------------------------
UPDATE "main"."sqlite_sequence" SET seq = 1 WHERE name = 'generals';
-- ----------------------------
-- Auto increment value for posts
-- ----------------------------
UPDATE "main"."sqlite_sequence" SET seq = 10 WHERE name = 'posts';
-- ----------------------------
-- Auto increment value for posts_tags__tags_posts
-- ----------------------------
UPDATE "main"."sqlite_sequence" SET seq = 11 WHERE name = 'posts_tags__tags_posts';
-- ----------------------------
-- Auto increment value for strapi_administrator
-- ----------------------------
UPDATE "main"."sqlite_sequence" SET seq = 1 WHERE name = 'strapi_administrator';
-- ----------------------------
-- Indexes structure for table strapi_administrator
-- ----------------------------
CREATE UNIQUE INDEX "main"."strapi_administrator_email_unique"
ON "strapi_administrator" (
"email" ASC
);
-- ----------------------------
-- Auto increment value for strapi_permission
-- ----------------------------
UPDATE "main"."sqlite_sequence" SET seq = 76 WHERE name = 'strapi_permission';
-- ----------------------------
-- Auto increment value for strapi_role
-- ----------------------------
UPDATE "main"."sqlite_sequence" SET seq = 3 WHERE name = 'strapi_role';
-- ----------------------------
-- Indexes structure for table strapi_role
-- ----------------------------
CREATE UNIQUE INDEX "main"."strapi_role_code_unique"
ON "strapi_role" (
"code" ASC
);
CREATE UNIQUE INDEX "main"."strapi_role_name_unique"
ON "strapi_role" (
"name" ASC
);
-- ----------------------------
-- Auto increment value for strapi_users_roles
-- ----------------------------
UPDATE "main"."sqlite_sequence" SET seq = 1 WHERE name = 'strapi_users_roles';
-- ----------------------------
-- Auto increment value for tags
-- ----------------------------
UPDATE "main"."sqlite_sequence" SET seq = 4 WHERE name = 'tags';
-- ----------------------------
-- Auto increment value for upload_file
-- ----------------------------
UPDATE "main"."sqlite_sequence" SET seq = 3 WHERE name = 'upload_file';
-- ----------------------------
-- Auto increment value for upload_file_morph
-- ----------------------------
UPDATE "main"."sqlite_sequence" SET seq = 15 WHERE name = 'upload_file_morph';
-- ----------------------------
-- Auto increment value for users-permissions_permission
-- ----------------------------
UPDATE "main"."sqlite_sequence" SET seq = 208 WHERE name = 'users-permissions_permission';
-- ----------------------------
-- Auto increment value for users-permissions_role
-- ----------------------------
UPDATE "main"."sqlite_sequence" SET seq = 2 WHERE name = 'users-permissions_role';
-- ----------------------------
-- Indexes structure for table users-permissions_role
-- ----------------------------
CREATE UNIQUE INDEX "main"."users-permissions_role_type_unique"
ON "users-permissions_role" (
"type" ASC
);
-- ----------------------------
-- Auto increment value for users-permissions_user
-- ----------------------------
UPDATE "main"."sqlite_sequence" SET seq = 2 WHERE name = 'users-permissions_user';
-- ----------------------------
-- Indexes structure for table users-permissions_user
-- ----------------------------
CREATE UNIQUE INDEX "main"."users-permissions_user_username_unique"
ON "users-permissions_user" (
"username" ASC
);
PRAGMA foreign_keys = true; | the_stack |
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';
-- -----------------------------------------------------
-- Schema dbo
-- -----------------------------------------------------
DROP SCHEMA IF EXISTS `dbo` ;
-- -----------------------------------------------------
-- Schema dbo
-- -----------------------------------------------------
CREATE SCHEMA IF NOT EXISTS `dbo` DEFAULT CHARACTER SET utf8 ;
USE `dbo` ;
-- -----------------------------------------------------
-- Table `Sex`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `Sex` ;
CREATE TABLE IF NOT EXISTS `Sex` (
`Id` INT NOT NULL,
`Name` VARCHAR(128) NOT NULL,
PRIMARY KEY (`Id`))
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `Customers`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `Customers` ;
CREATE TABLE IF NOT EXISTS `Customers` (
`Address` VARCHAR(256) NULL,
`Country` CHAR(2) NOT NULL,
`Id` INT NOT NULL,
`Name` VARCHAR(128) NOT NULL,
`Sex` INT NULL,
PRIMARY KEY (`Country`, `Id`),
INDEX `FK_Customers_Sex_idx` (`Sex` ASC) VISIBLE,
CONSTRAINT `FK_Customers_Sex`
FOREIGN KEY (`Sex`)
REFERENCES `Sex` (`Id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `OrderStatus`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `OrderStatus` ;
CREATE TABLE IF NOT EXISTS `OrderStatus` (
`Id` INT NOT NULL,
`Name` VARCHAR(128) NOT NULL,
PRIMARY KEY (`Id`))
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `Orders`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `Orders` ;
CREATE TABLE IF NOT EXISTS `Orders` (
`AltCustomerCountry` CHAR(2) NULL,
`AltCustomerId` INT NULL,
`CustomerCountry` CHAR(2) NOT NULL,
`CustomerId` INT NOT NULL,
`Date` TIMESTAMP NULL,
`Dummy` INT NULL,
`Id` INT NOT NULL AUTO_INCREMENT,
`Name` VARCHAR(256) NOT NULL,
`Status` INT NOT NULL,
PRIMARY KEY (`Id`),
INDEX `FK_Orders_AltCustomers_idx` (`AltCustomerCountry` ASC, `AltCustomerId` ASC) VISIBLE,
INDEX `FK_Orders_Customers_idx` (`CustomerCountry` ASC, `CustomerId` ASC) VISIBLE,
INDEX `FK_Orders_OrderStatus_idx` (`Status` ASC) VISIBLE,
CONSTRAINT `FK_Orders_AltCustomers`
FOREIGN KEY (`AltCustomerCountry` , `AltCustomerId`)
REFERENCES `Customers` (`Country` , `Id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `FK_Orders_Customers`
FOREIGN KEY (`CustomerCountry` , `CustomerId`)
REFERENCES `Customers` (`Country` , `Id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `FK_Orders_OrderStatus`
FOREIGN KEY (`Status`)
REFERENCES `OrderStatus` (`Id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `OrderItems`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `OrderItems` ;
CREATE TABLE IF NOT EXISTS `OrderItems` (
`Count` INT NULL,
`Id` INT NOT NULL AUTO_INCREMENT,
`OrderId` INT NOT NULL,
`Price` DECIMAL(18,2) NULL,
`Product` VARCHAR(256) NOT NULL,
PRIMARY KEY (`Id`),
INDEX `FK_OrderItem_Order_idx` (`OrderId` ASC) VISIBLE,
CONSTRAINT `FK_OrderItem_Order`
FOREIGN KEY (`OrderId`)
REFERENCES `Orders` (`Id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `ShippingAddresses`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `ShippingAddresses` ;
CREATE TABLE IF NOT EXISTS `ShippingAddresses` (
`OrderId` INT NOT NULL,
`Id` INT NOT NULL,
`Address` VARCHAR(256) NOT NULL,
PRIMARY KEY (`OrderId`, `Id`),
CONSTRAINT `FK_ShippingAddresses_Order`
FOREIGN KEY (`OrderId`)
REFERENCES `Orders` (`Id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `CustomerShippingAddress`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `CustomerShippingAddress` ;
CREATE TABLE IF NOT EXISTS `CustomerShippingAddress` (
`CustomerCountry` CHAR(2) NOT NULL,
`CustomerId` INT NOT NULL,
`ShippingAddressOrderId` INT NOT NULL,
`ShippingAddressId` INT NOT NULL,
PRIMARY KEY (`CustomerCountry`, `CustomerId`, `ShippingAddressOrderId`, `ShippingAddressId`),
INDEX `FK_CustomerShippingAddress_ShippingAddresses_idx` (`ShippingAddressOrderId` ASC, `ShippingAddressId` ASC) VISIBLE,
CONSTRAINT `FK_CustomerShippingAddress_Customers`
FOREIGN KEY (`CustomerCountry` , `CustomerId`)
REFERENCES `Customers` (`Country` , `Id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `FK_CustomerShippingAddress_ShippingAddresses`
FOREIGN KEY (`ShippingAddressOrderId` , `ShippingAddressId`)
REFERENCES `ShippingAddresses` (`OrderId` , `Id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `Categories`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `Categories` ;
CREATE TABLE IF NOT EXISTS `Categories` (
`Id` INT NOT NULL AUTO_INCREMENT,
`Name` VARCHAR(128) NOT NULL,
`ParentId` INT NULL,
`DateTime` DATETIME NULL,
PRIMARY KEY (`Id`),
INDEX `FK_Categories_Categories_idx` (`ParentId` ASC) VISIBLE,
CONSTRAINT `FK_Categories_Categories`
FOREIGN KEY (`ParentId`)
REFERENCES `Categories` (`Id`)
ON DELETE CASCADE
ON UPDATE NO ACTION)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `ManyColumns`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `ManyColumns` ;
CREATE TABLE IF NOT EXISTS `ManyColumns` (
`Column01` INT NOT NULL,
`Column02` INT NOT NULL,
`Column03` INT NOT NULL,
`Column04` INT NOT NULL,
`Column05` INT NOT NULL,
`Column06` INT NOT NULL,
`Column07` INT NOT NULL,
`Column08` INT NOT NULL,
`Column09` INT NOT NULL,
`Column10` INT NOT NULL,
`Column11` INT NOT NULL,
`Column12` INT NOT NULL,
`Column13` INT NOT NULL,
`Column14` INT NOT NULL,
`Column15` INT NOT NULL,
`Column16` INT NOT NULL,
`Column17` INT NOT NULL,
`Column18` INT NOT NULL,
`Column19` INT NOT NULL,
`Column20` INT NOT NULL,
`Column21` INT NOT NULL,
`Column22` INT NOT NULL,
`Column23` INT NOT NULL,
`Column24` INT NOT NULL,
`Column25` INT NOT NULL,
`Column26` INT NOT NULL,
`Column27` INT NOT NULL,
`Column28` INT NOT NULL,
`Column29` INT NOT NULL,
`Column30` INT NOT NULL,
PRIMARY KEY (`Column01`))
ENGINE = InnoDB;
USE `dbo` ;
-- -----------------------------------------------------
-- Placeholder table for view `OrderItemsView`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `OrderItemsView` (`Name` INT, `Product` INT);
-- -----------------------------------------------------
-- procedure ResetDb
-- -----------------------------------------------------
USE `dbo`;
DROP procedure IF EXISTS `ResetDb`;
DELIMITER $$
USE `dbo`$$
create procedure ResetDb ()
begin
delete from CustomerShippingAddress;
delete from ShippingAddresses;
delete from OrderItems;
delete from Orders;
delete from Customers;
delete from Categories;
alter table OrderItems auto_increment = 0;
alter table Orders auto_increment = 0;
alter table Categories auto_increment = 0;
end$$
DELIMITER ;
-- -----------------------------------------------------
-- procedure ResetManyColumns
-- -----------------------------------------------------
USE `dbo`;
DROP procedure IF EXISTS `ResetManyColumns`;
DELIMITER $$
USE `dbo`$$
create procedure ResetManyColumns ()
begin
delete from ManyColumns;
end$$
DELIMITER ;
-- -----------------------------------------------------
-- procedure GetOrders
-- -----------------------------------------------------
USE `dbo`;
DROP procedure IF EXISTS `GetOrders`;
DELIMITER $$
USE `dbo`$$
create procedure GetOrders (id int, name varchar(256), status int)
begin
if id is null and name is null and status is null then
select * from Orders;
elseif not id is null then
select * from Orders o where o.Id = id;
elseif not name is null then
select * from Orders o where o.Name like concat('%', name, '%');
elseif not status is null then
select * from Orders o where o.Status = status;
end if;
end$$
DELIMITER ;
-- -----------------------------------------------------
-- procedure TableFunction
-- -----------------------------------------------------
USE `dbo`;
DROP procedure IF EXISTS `TableFunction`;
DELIMITER $$
USE `dbo`$$
create procedure TableFunction ()
begin
select * from Orders;
end$$
DELIMITER ;
-- -----------------------------------------------------
-- procedure TableFunctionWithParameters
-- -----------------------------------------------------
USE `dbo`;
DROP procedure IF EXISTS `TableFunctionWithParameters`;
DELIMITER $$
USE `dbo`$$
create procedure TableFunctionWithParameters (id int, name varchar(256), status int)
begin
select * from Orders o where o.Id = id or o.Name like concat('%', name, '%') or o.Status = status;
end$$
DELIMITER ;
-- -----------------------------------------------------
-- function ScalarFunction
-- -----------------------------------------------------
USE `dbo`;
DROP function IF EXISTS `ScalarFunction`;
DELIMITER $$
USE `dbo`$$
create function ScalarFunction () returns integer
reads sql data deterministic
begin
declare zcount int;
select count(*) into zcount from Orders;
return zcount;
end$$
DELIMITER ;
-- -----------------------------------------------------
-- View `OrderItemsView`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `OrderItemsView`;
DROP VIEW IF EXISTS `OrderItemsView` ;
USE `dbo`;
create OR REPLACE view OrderItemsView as
select o.Name, i.Product from Orders o inner join OrderItems i on o.Id = i.OrderId;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
-- -----------------------------------------------------
-- Data for table `Sex`
-- -----------------------------------------------------
START TRANSACTION;
USE `dbo`;
INSERT INTO `Sex` (`Id`, `Name`) VALUES (0, 'Male');
INSERT INTO `Sex` (`Id`, `Name`) VALUES (1, 'Female');
COMMIT;
-- -----------------------------------------------------
-- Data for table `OrderStatus`
-- -----------------------------------------------------
START TRANSACTION;
USE `dbo`;
INSERT INTO `OrderStatus` (`Id`, `Name`) VALUES (0, 'Unknown');
INSERT INTO `OrderStatus` (`Id`, `Name`) VALUES (1, 'Processing');
INSERT INTO `OrderStatus` (`Id`, `Name`) VALUES (2, 'Shipped');
INSERT INTO `OrderStatus` (`Id`, `Name`) VALUES (3, 'Delivering');
INSERT INTO `OrderStatus` (`Id`, `Name`) VALUES (4, 'Cancelled');
COMMIT; | the_stack |
/* japanese charsets: SJIS, MS932, APPLE_JAPANESE */
/* ======================================================================= */
/* 0x00A2 --> 0x8191 - APPLE_JAPANESE, but I think, this extension is better than the replacment char */
/* 0x00A3 --> 0x8192 - APPLE_JAPANESE, but I think, this extension is better than the replacment char */
/* 0x00A5 --> 0x005C - APPLE_JAPANESE, but I think, this extension is better than the replacment char */
/* 0x00AC --> 0x81CA - APPLE_JAPANESE/SJIS, but I think, this extension is better than the replacment char */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_00[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, /* 0x00 */
0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, /* 0x00 */
0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, /* 0x10 */
0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, /* 0x10 */
0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, /* 0x20 */
0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, /* 0x20 */
0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, /* 0x30 */
0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, /* 0x30 */
0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, /* 0x40 */
0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, /* 0x40 */
0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, /* 0x50 */
0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, /* 0x50 */
0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, /* 0x60 */
0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, /* 0x60 */
0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, /* 0x70 */
0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0x8191, 0x8192, 0, 0x005C, 0, 0x8198, /* 0xA0 */
0x814E, 0, 0, 0, 0x81CA, 0, 0, 0, /* 0xA0 */
0x818B, 0x817D, 0, 0, 0x814C, 0, 0x81F7, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0x817E, /* 0xD0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xE0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xE0 */
0, 0, 0, 0, 0, 0, 0, 0x8180 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_APPLEJAPANESE_00[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, /* 0x00 */
0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, /* 0x00 */
0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, /* 0x10 */
0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, /* 0x10 */
0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, /* 0x20 */
0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, /* 0x20 */
0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, /* 0x30 */
0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, /* 0x30 */
0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, /* 0x40 */
0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, /* 0x40 */
0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, /* 0x50 */
0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, /* 0x50 */
0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, /* 0x60 */
0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, /* 0x60 */
0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, /* 0x70 */
0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0x00A0, 0, 0x8191, 0x8192, 0, 0x005C, 0, 0x8198, /* 0xA0 */
0x814E, 0x00FD, 0, 0, 0x81CA, 0, 0, 0, /* 0xA0 */
0x818B, 0x817D, 0, 0, 0x814C, 0, 0x81F7, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0x817E, /* 0xD0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xE0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xE0 */
0, 0, 0, 0, 0, 0, 0, 0x8180 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_03[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x839F, 0x83A0, 0x83A1, 0x83A2, 0x83A3, 0x83A4, 0x83A5, /* 0x90 */
0x83A6, 0x83A7, 0x83A8, 0x83A9, 0x83AA, 0x83AB, 0x83AC, 0x83AD, /* 0x90 */
0x83AE, 0x83AF, 0, 0x83B0, 0x83B1, 0x83B2, 0x83B3, 0x83B4, /* 0xA0 */
0x83B5, 0x83B6, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0x83BF, 0x83C0, 0x83C1, 0x83C2, 0x83C3, 0x83C4, 0x83C5, /* 0xB0 */
0x83C6, 0x83C7, 0x83C8, 0x83C9, 0x83CA, 0x83CB, 0x83CC, 0x83CD, /* 0xB0 */
0x83CE, 0x83CF, 0, 0x83D0, 0x83D1, 0x83D2, 0x83D3, 0x83D4, /* 0xC0 */
0x83D5, 0x83D6 /* 0xC0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_04[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8446, 0, 0, 0, 0, 0, 0, /* 0x00 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 */
0x8440, 0x8441, 0x8442, 0x8443, 0x8444, 0x8445, 0x8447, 0x8448, /* 0x10 */
0x8449, 0x844A, 0x844B, 0x844C, 0x844D, 0x844E, 0x844F, 0x8450, /* 0x10 */
0x8451, 0x8452, 0x8453, 0x8454, 0x8455, 0x8456, 0x8457, 0x8458, /* 0x20 */
0x8459, 0x845A, 0x845B, 0x845C, 0x845D, 0x845E, 0x845F, 0x8460, /* 0x20 */
0x8470, 0x8471, 0x8472, 0x8473, 0x8474, 0x8475, 0x8477, 0x8478, /* 0x30 */
0x8479, 0x847A, 0x847B, 0x847C, 0x847D, 0x847E, 0x8480, 0x8481, /* 0x30 */
0x8482, 0x8483, 0x8484, 0x8485, 0x8486, 0x8487, 0x8488, 0x8489, /* 0x40 */
0x848A, 0x848B, 0x848C, 0x848D, 0x848E, 0x848F, 0x8490, 0x8491, /* 0x40 */
0, 0x8476 /* 0x50 */
};
/* ----------------------------------------------------------------------- */
/* 0x2014 --> 0x815C - APPLE_JAPANESE/SJIS, but I think, this extension is better than the replacment char */
/* 0x2015 --> 0x815C - MS932, but I think, this extension is better than the replacment char */
/* 0x2016 --> 0x8161 - APPLE_JAPANESE/SJIS, but I think, this extension is better than the replacment char */
/* 0x2026 --> 0x8163 - APPLE_JAPANESE is normally 0x00FF (HORIZONTAL ELLIPSIS), because in the APPLE import table 0x8183 is this 0x22EF (MIDLINE HORIZONTAL ELLIPSIS) */
/* but we import this code as 0x2026 */
/* 0x203E --> 0x8150 - APPLE_JAPANESE, but I think, this extension is better than the replacment char */
/* in SJIS this is 0x7E, but we import 0x7E as 0x7E, so this would be the better way */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_20[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x815D, 0, 0, 0, 0x815C, 0x815C, 0x8161, 0, /* 0x10 */
0x8165, 0x8166, 0, 0, 0x8167, 0x8168, 0, 0, /* 0x10 */
0x81F5, 0x81F6, 0, 0, 0, 0x8164, 0x8163, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0x81F1, 0, 0x818C, 0x818D, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0x81A6, 0, 0, 0x8150 /* 0x30 */
};
/* ----------------------------------------------------------------------- */
/* In this table we have some MS932 extensions, but we use this table also for SJIS, for better MS compatibility */
static sal_uInt16 const aImplUniToDBCSTab_MS932_21[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x818E, 0, 0, 0, 0, /* 0x00 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 */
0, 0, 0, 0, 0, 0, 0x8782, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */
0, 0x8784, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0x81F0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0x8754, 0x8755, 0x8756, 0x8757, 0x8758, 0x8759, 0x875A, 0x875B, /* 0x60 */
0x875C, 0x875D, 0, 0, 0, 0, 0, 0, /* 0x60 */
0xFA40, 0xFA41, 0xFA42, 0xFa43, 0xFA44, 0xFA45, 0xFA46, 0xFA47, /* 0x70 */
0xFA48, 0xFA49, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0x81A9, 0x81AA, 0x81A8, 0x81AB, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0x81CB, 0, 0x81CC /* 0xD0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_APPLEJAPANESE_21[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x818E, 0, 0, 0, 0, /* 0x00 */
0, 0x8656, 0, 0, 0, 0, 0, 0, /* 0x00 */
0, 0, 0, 0x8650, 0, 0, 0x869B, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */
0, 0x869D, 0x00FE, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0x81F0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0x859F, 0x85A0, 0x85A1, 0x85A2, 0x85A3, 0x85A4, 0x85A5, 0x85A6, /* 0x60 */
0x85A7, 0x85A8, 0x85A9, 0x85AA, 0, 0, 0, 0, /* 0x60 */
0x85B3, 0x85B4, 0x85B5, 0x85B6, 0x85B7, 0x85B8, 0x85B9, 0x85BA, /* 0x70 */
0x85BB, 0x85BC, 0x85BD, 0x85BE, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0x81A9, 0x81AA, 0x81A8, 0x81AB, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0x86CC, 0x86CD, 0x86CB, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0x81CB, 0, 0x81CC, 0, 0, 0, /* 0xD0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0, 0, 0, 0, 0, 0x86D0, 0x86D1, /* 0xE0 */
0x86CF, 0x86D2 /* 0xE0 */
};
/* ----------------------------------------------------------------------- */
/* In this table we have some MS932 extensions, but we use this table also for SJIS, for better MS compatibility */
/* 0x2210 --> 0x817C - come from SJIS */
static sal_uInt16 const aImplUniToDBCSTab_MS932_22[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x81CD, 0, 0x81DD, 0x81CE, 0, 0, 0, 0x81DE, /* 0x00 */
0x81B8, 0, 0, 0x81B9, 0, 0, 0, 0, /* 0x00 */
0, 0x8794, 0x817C, 0, 0, 0, 0, 0, /* 0x10 */
0, 0, 0x81E3, 0, 0, 0x81E5, 0x8187, 0x8798, /* 0x10 */
0x81DA, 0, 0, 0, 0, 0x8161, 0, 0x81C8, /* 0x20 */
0x81C9, 0x81BF, 0x81BE, 0x81E7, 0x81E8, 0, 0x8793, 0, /* 0x20 */
0, 0, 0, 0, 0x8188, 0x81E6, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0x81E4, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0x81E0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0x8182, 0x81DF, 0, 0, 0, 0, 0x8185, 0x8186, /* 0x60 */
0, 0, 0x81E1, 0x81E2, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0x81BC, 0x81BD, 0, 0, 0x81BA, 0x81BB, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0x81DB, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0x8799 /* 0xB0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_APPLEJAPANESE_22[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x81CD, 0, 0x81DD, 0x81CE, 0, 0, 0, 0x81DE, /* 0x00 */
0x81B8, 0, 0, 0x81B9, 0, 0, 0, 0, /* 0x00 */
0, 0, 0x817C, 0, 0, 0, 0, 0, /* 0x10 */
0, 0, 0x81E3, 0, 0, 0x81E5, 0x8187, 0x8841, /* 0x10 */
0x81DA, 0, 0, 0, 0, 0, 0, 0x81C8, /* 0x20 */
0x81C9, 0x81BF, 0x81BE, 0x81E7, 0x81E8, 0, 0x8840, 0, /* 0x20 */
0, 0, 0, 0, 0x8188, 0x81E6, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0x81E4, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0x81E0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0x8182, 0x81DF, 0, 0, 0, 0, 0x8185, 0x8186, /* 0x60 */
0, 0, 0x81E1, 0x81E2, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0x81BC, 0x81BD, 0, 0, 0x81BA, 0x81BB, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0x81DB, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0x8842, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xE0 */
0, 0, 0, 0, 0, 0, 0, 0x8163 /* 0xE0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_23[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x81DC /* 0x10 */
/* 0x10 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_MS932_24[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8740, 0x8741, 0x8742, 0x8743, 0x8744, 0x8745, 0x8746, 0x8747, /* 0x60 */
0x8748, 0x8749, 0x874A, 0x874B, 0x874C, 0x874D, 0x874E, 0x874F, /* 0x60 */
0x8750, 0x8751, 0x8752, 0x8753 /* 0x70 */
/* 0x70 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_APPLEJAPANESE_24[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8540, 0x8541, 0x8542, 0x8543, 0x8544, 0x8545, 0x8546, 0x8547, /* 0x60 */
0x8548, 0x8549, 0x854A, 0x854B, 0x854C, 0x854D, 0x854E, 0x854F, /* 0x60 */
0x8550, 0x8551, 0x8552, 0x8553, 0x855E, 0x855F, 0x8560, 0x8561, /* 0x70 */
0x8562, 0x8563, 0x8564, 0x8565, 0x8566, 0x8567, 0x8568, 0x8569, /* 0x70 */
0x856A, 0x856B, 0x856C, 0x856D, 0x856E, 0x856F, 0x8570, 0x8571, /* 0x80 */
0x8592, 0x8593, 0x8594, 0x8595, 0x8596, 0x8597, 0x8598, 0x8599, /* 0x80 */
0x859A, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0x85DB, 0x85DC, 0x85DD, 0x85DE, /* 0x90 */
0x85DF, 0x85E0, 0x85E1, 0x85E2, 0x85E3, 0x85E4, 0x85E5, 0x85E6, /* 0xA0 */
0x85E7, 0x85E8, 0x85E9, 0x85EA, 0x85EB, 0x85EC, 0x85ED, 0x85EE, /* 0xA0 */
0x85EF, 0x85F0, 0x85F1, 0x85F2, 0x85F3, 0x85F4 /* 0xB0 */
/* 0xB0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_25[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x849F, 0x84AA, 0x84A0, 0x84AB, 0, 0, 0, 0, /* 0x00 */
0, 0, 0, 0, 0x84A1, 0, 0, 0x84AC, /* 0x00 */
0x84A2, 0, 0, 0x84AD, 0x84A4, 0, 0, 0x84AF, /* 0x10 */
0x84A3, 0, 0, 0x84AE, 0x84A5, 0x84BA, 0, 0, /* 0x10 */
0x84B5, 0, 0, 0x84B0, 0x84A7, 0x84BC, 0, 0, /* 0x20 */
0x84B7, 0, 0, 0x84B2, 0x84A6, 0, 0, 0x84B6, /* 0x20 */
0x84BB, 0, 0, 0x84B1, 0x84A8, 0, 0, 0x84B8, /* 0x30 */
0x84BD, 0, 0, 0x84B3, 0x84A9, 0, 0, 0x84B9, /* 0x30 */
0, 0, 0x84BE, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0x84B4, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0x81A1, 0x81A0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0x81A3, 0x81A2, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0x81A5, 0x81A4, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0x819F, 0x819E, /* 0xC0 */
0, 0, 0, 0x819B, 0, 0, 0x819D, 0x819C, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xE0 */
0, 0, 0, 0, 0, 0, 0, 0x81FC /* 0xE0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_26[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x819A, 0x8199, 0, /* 0x00 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0x818A, 0, 0x8189, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0x81F4, 0, 0, 0x81F3, 0, 0x81F2 /* 0x60 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_APPLEJAPANESE_26[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x819A, 0x8199, 0, /* 0x00 */
0, 0, 0, 0, 0, 0, 0x86B4, 0, /* 0x00 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */
0, 0, 0, 0, 0x86C8, 0x86C9, 0x86C7, 0x86CA, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0x818A, 0, 0x8189, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0x86A3, 0x86A1, 0x86A2, 0x86A4, 0x869F, 0x86A5, 0x86A6, 0x86A0, /* 0x60 */
0, 0, 0x81F4, 0, 0, 0x81F3, 0, 0x81F2 /* 0x60 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_APPLEJAPANESE_27[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x857C, 0x857D, /* 0x70 */
0x857E, 0x8580, 0x8581, 0x8582, 0x8583, 0x8584, 0x8585 /* 0x70 */
};
/* ----------------------------------------------------------------------- */
/* 0x3014 --> 0x8160 - come from SJIS */
/* 0x301D --> 0x8780 - MS932, but I think, this extension is better than the replacment char */
/* 0x301F --> 0x8781 - MS932, but I think, this extension is better than the replacment char */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_30[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8140, 0x8141, 0x8142, 0x8156, 0, 0x8158, 0x8159, 0x815A, /* 0x00 */
0x8171, 0x8172, 0x8173, 0x8174, 0x8175, 0x8176, 0x8177, 0x8178, /* 0x00 */
0x8179, 0x817A, 0x81A7, 0x81AC, 0x816B, 0x816C, 0, 0, /* 0x10 */
0, 0, 0, 0, 0x8160, 0x8780, 0, 0x8781, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0x829F, 0x82A0, 0x82A1, 0x82A2, 0x82A3, 0x82A4, 0x82A5, /* 0x40 */
0x82A6, 0x82A7, 0x82A8, 0x82A9, 0x82AA, 0x82AB, 0x82AC, 0x82AD, /* 0x40 */
0x82AE, 0x82AF, 0x82B0, 0x82B1, 0x82B2, 0x82B3, 0x82B4, 0x82B5, /* 0x50 */
0x82B6, 0x82B7, 0x82B8, 0x82B9, 0x82BA, 0x82BB, 0x82BC, 0x82BD, /* 0x50 */
0x82BE, 0x82BF, 0x82C0, 0x82C1, 0x82C2, 0x82C3, 0x82C4, 0x82C5, /* 0x60 */
0x82C6, 0x82C7, 0x82C8, 0x82C9, 0x82CA, 0x82CB, 0x82CC, 0x82CD, /* 0x60 */
0x82CE, 0x82CF, 0x82D0, 0x82D1, 0x82D2, 0x82D3, 0x82D4, 0x82D5, /* 0x70 */
0x82D6, 0x82D7, 0x82D8, 0x82D9, 0x82DA, 0x82DB, 0x82DC, 0x82DD, /* 0x70 */
0x82DE, 0x82DF, 0x82E0, 0x82E1, 0x82E2, 0x82E3, 0x82E4, 0x82E5, /* 0x80 */
0x82E6, 0x82E7, 0x82E8, 0x82E9, 0x82EA, 0x82EB, 0x82EC, 0x82ED, /* 0x80 */
0x82EE, 0x82EF, 0x82F0, 0x82F1, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0x814A, 0x814B, 0x8154, 0x8155, 0, /* 0x90 */
0, 0x8340, 0x8341, 0x8342, 0x8343, 0x8344, 0x8345, 0x8346, /* 0xA0 */
0x8347, 0x8348, 0x8349, 0x834A, 0x834B, 0x834C, 0x834D, 0x834E, /* 0xA0 */
0x834F, 0x8350, 0x8351, 0x8352, 0x8353, 0x8354, 0x8355, 0x8356, /* 0xB0 */
0x8357, 0x8358, 0x8359, 0x835A, 0x835B, 0x835C, 0x835D, 0x835E, /* 0xB0 */
0x835F, 0x8360, 0x8361, 0x8362, 0x8363, 0x8364, 0x8365, 0x8366, /* 0xC0 */
0x8367, 0x8368, 0x8369, 0x836A, 0x836B, 0x836C, 0x836D, 0x836E, /* 0xC0 */
0x836F, 0x8370, 0x8371, 0x8372, 0x8373, 0x8374, 0x8375, 0x8376, /* 0xD0 */
0x8377, 0x8378, 0x8379, 0x837A, 0x837B, 0x837C, 0x837D, 0x837E, /* 0xD0 */
0x8380, 0x8381, 0x8382, 0x8383, 0x8384, 0x8385, 0x8386, 0x8387, /* 0xE0 */
0x8388, 0x8389, 0x838A, 0x838B, 0x838C, 0x838D, 0x838E, 0x838F, /* 0xE0 */
0x8390, 0x8391, 0x8392, 0x8393, 0x8394, 0x8395, 0x8396, 0, /* 0xF0 */
0, 0, 0, 0x8145, 0x815B, 0x8152, 0x8153 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_APPLEJAPANESE_30[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8140, 0x8141, 0x8142, 0x8156, 0x86B5, 0x8158, 0x8159, 0x815A, /* 0x00 */
0x8171, 0x8172, 0x8173, 0x8174, 0x8175, 0x8176, 0x8177, 0x8178, /* 0x00 */
0x8179, 0x817A, 0x81A7, 0x81AC, 0x816B, 0x816C, 0, 0, /* 0x10 */
0, 0, 0, 0, 0x8160, 0x8854, 0, 0x8855, /* 0x10 */
0x86B3, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0x829F, 0x82A0, 0x82A1, 0x82A2, 0x82A3, 0x82A4, 0x82A5, /* 0x40 */
0x82A6, 0x82A7, 0x82A8, 0x82A9, 0x82AA, 0x82AB, 0x82AC, 0x82AD, /* 0x40 */
0x82AE, 0x82AF, 0x82B0, 0x82B1, 0x82B2, 0x82B3, 0x82B4, 0x82B5, /* 0x50 */
0x82B6, 0x82B7, 0x82B8, 0x82B9, 0x82BA, 0x82BB, 0x82BC, 0x82BD, /* 0x50 */
0x82BE, 0x82BF, 0x82C0, 0x82C1, 0x82C2, 0x82C3, 0x82C4, 0x82C5, /* 0x60 */
0x82C6, 0x82C7, 0x82C8, 0x82C9, 0x82CA, 0x82CB, 0x82CC, 0x82CD, /* 0x60 */
0x82CE, 0x82CF, 0x82D0, 0x82D1, 0x82D2, 0x82D3, 0x82D4, 0x82D5, /* 0x70 */
0x82D6, 0x82D7, 0x82D8, 0x82D9, 0x82DA, 0x82DB, 0x82DC, 0x82DD, /* 0x70 */
0x82DE, 0x82DF, 0x82E0, 0x82E1, 0x82E2, 0x82E3, 0x82E4, 0x82E5, /* 0x80 */
0x82E6, 0x82E7, 0x82E8, 0x82E9, 0x82EA, 0x82EB, 0x82EC, 0x82ED, /* 0x80 */
0x82EE, 0x82EF, 0x82F0, 0x82F1, 0x8868, 0, 0, 0, /* 0x90 */
0, 0, 0, 0x814A, 0x814B, 0x8154, 0x8155, 0, /* 0x90 */
0, 0x8340, 0x8341, 0x8342, 0x8343, 0x8344, 0x8345, 0x8346, /* 0xA0 */
0x8347, 0x8348, 0x8349, 0x834A, 0x834B, 0x834C, 0x834D, 0x834E, /* 0xA0 */
0x834F, 0x8350, 0x8351, 0x8352, 0x8353, 0x8354, 0x8355, 0x8356, /* 0xB0 */
0x8357, 0x8358, 0x8359, 0x835A, 0x835B, 0x835C, 0x835D, 0x835E, /* 0xB0 */
0x835F, 0x8360, 0x8361, 0x8362, 0x8363, 0x8364, 0x8365, 0x8366, /* 0xC0 */
0x8367, 0x8368, 0x8369, 0x836A, 0x836B, 0x836C, 0x836D, 0x836E, /* 0xC0 */
0x836F, 0x8370, 0x8371, 0x8372, 0x8373, 0x8374, 0x8375, 0x8376, /* 0xD0 */
0x8377, 0x8378, 0x8379, 0x837A, 0x837B, 0x837C, 0x837D, 0x837E, /* 0xD0 */
0x8380, 0x8381, 0x8382, 0x8383, 0x8384, 0x8385, 0x8386, 0x8387, /* 0xE0 */
0x8388, 0x8389, 0x838A, 0x838B, 0x838C, 0x838D, 0x838E, 0x838F, /* 0xE0 */
0x8390, 0x8391, 0x8392, 0x8393, 0x8394, 0x8395, 0x8396, 0x886A, /* 0xF0 */
0x886B, 0x886C, 0x886D, 0x8145, 0x815B, 0x8152, 0x8153 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_MS932_32[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x878A, 0x878B, 0, 0, 0, 0, 0, /* 0x30 */
0, 0x878C, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0x8785, 0x8786, 0x8787, 0x8788, /* 0xA0 */
0x8789 /* 0xA0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_APPLEJAPANESE_32[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
/* 0x20 */
0x8741, 0x8742, 0x8743, 0x8744, 0x8745, 0x8746, /* 0x20 */
0x8740, 0x874D, 0x8750, 0x8753, 0x874F, 0x8754, 0x8752, 0x8748, /* 0x30 */
0x8758, 0x874B, 0x874C, 0x8751, 0x8755, 0x8756, 0x874E, 0x8757, /* 0x30 */
0x8747, 0, 0x8749, 0x874A, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0x8799, 0, /* 0x90 */
0x879B, 0x879E, 0, 0, 0, 0x879A, 0x879C, 0, /* 0x90 */
0, 0, 0, 0, 0x8793, 0x8794, 0x8795, 0x8796, /* 0xA0 */
0x8797, 0x8798 /* 0xA0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_MS932_33[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8765, 0, 0, 0, 0, /* 0x00 */
0, 0, 0, 0, 0, 0x8769, 0, 0, /* 0x00 */
0, 0, 0, 0, 0x8760, 0, 0, 0, /* 0x10 */
0x8763, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */
0, 0, 0x8761, 0x876B, 0, 0, 0x876A, 0x8764, /* 0x20 */
0, 0, 0, 0x876C, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0x8766, 0, /* 0x30 */
0, 0, 0, 0x876E, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0x875F, 0x876D, 0, 0, 0x8762, 0, 0, /* 0x40 */
0, 0x8767, 0, 0, 0, 0, 0, 0x8768, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0x877E, 0x878F, 0x878E, 0x878D, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0x8772, 0x8773, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0x876F, 0x8770, 0x8771, 0, /* 0x90 */
0, 0x8775, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0x8774, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0x8783 /* 0xC0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_APPLEJAPANESE_33[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x87BD, 0, 0, 0x87A7, 0, 0x87A4, 0, 0, /* 0x00 */
0, 0, 0, 0, 0, 0x87B0, 0, 0, /* 0x00 */
0, 0, 0, 0, 0x87A2, 0x87AA, 0x87A3, 0, /* 0x10 */
0x87A9, 0, 0, 0, 0, 0, 0x87BE, 0, /* 0x10 */
0, 0, 0x87A0, 0x87B2, 0, 0, 0x87B3, 0x87AB, /* 0x20 */
0, 0, 0x87BF, 0x87B5, 0, 0, 0, 0, /* 0x20 */
0, 0x87C0, 0, 0x87A5, 0, 0, 0x87A8, 0, /* 0x30 */
0, 0x87AE, 0, 0x87B4, 0, 0, 0, 0, /* 0x30 */
0, 0, 0x87B1, 0, 0, 0, 0, 0x87C1, /* 0x40 */
0, 0x879F, 0x87AD, 0, 0, 0x87A1, 0x87A6, 0, /* 0x40 */
0, 0x87AC, 0, 0, 0, 0, 0, 0x87AF, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0x87E8, 0x87E7, 0x87E6, 0x87E5, 0x87FA, /* 0x70 */
0, 0, 0, 0, 0, 0x865A, 0x865B, 0x865C, /* 0x80 */
0, 0, 0, 0, 0, 0, 0x864A, 0x864C, /* 0x80 */
0x8659, 0, 0, 0, 0, 0, 0x864E, 0x864F, /* 0x90 */
0x8651, 0, 0, 0, 0x8640, 0x8642, 0x8648, 0x8641, /* 0x90 */
0x8643, 0x8646, 0x8649, 0, 0x8644, 0x8647, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0x8655, 0x8654, 0x8653, 0x8652, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0x864D, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0x8658, 0, 0x869C, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0x8657 /* 0xD0 */
/* 0xD0 */
};
/* ----------------------------------------------------------------------- */
/* Table _4E to _9F includes the 360 IBM Kanji's we export to all */
/* formats (SJIS/APPLE_JAPANESE) for better compatibility. These */
/* characters are also imported from us in all formats. So this */
/* extension should give better results than the export to the */
/* replacement character. */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_4E[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x88EA, 0x929A, 0, 0x8EB5, 0, 0, 0, 0x969C, /* 0x00 */
0x8FE4, 0x8E4F, 0x8FE3, 0x89BA, 0, 0x9573, 0x975E, 0, /* 0x00 */
0x98A0, 0x894E, 0, 0, 0x8A8E, 0x98A1, 0x90A2, 0x99C0, /* 0x10 */
0x8B75, 0x95B8, 0, 0, 0, 0, 0x8FE5, 0, /* 0x10 */
0, 0x97BC, 0, 0, 0, 0, 0x95C0, 0, /* 0x20 */
0xFA68, 0, 0x98A2, 0, 0, 0x9286, 0, 0, /* 0x20 */
0, 0x98A3, 0x8BF8, 0, 0, 0, 0x98A4, 0, /* 0x30 */
0x8ADB, 0x924F, 0, 0x8EE5, 0x98A5, 0, 0, 0x98A6, /* 0x30 */
0, 0, 0x98A7, 0x9454, 0, 0x8B76, 0, 0, /* 0x40 */
0, 0, 0, 0x9456, 0, 0x93E1, 0x8CC1, 0x9652, /* 0x40 */
0, 0, 0, 0, 0, 0xE568, 0x98A8, 0x8FE6, /* 0x50 */
0x98A9, 0x89B3, 0, 0, 0, 0x8BE3, 0x8CEE, 0x96E7, /* 0x50 */
0, 0, 0x9BA4, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0x9790, 0, 0x93FB, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0x8AA3, 0, /* 0x70 */
0x8B54, 0, 0x98AA, 0, 0, 0x98AB, 0x97B9, 0, /* 0x80 */
0x975C, 0x9188, 0x98AD, 0x8E96, 0x93F1, 0, 0x98B0, 0, /* 0x80 */
0, 0x895D, 0x8CDD, 0, 0x8CDC, 0x88E4, 0, 0, /* 0x90 */
0x986A, 0x9869, 0, 0x8DB1, 0x889F, 0, 0x98B1, 0x98B2, /* 0x90 */
0x98B3, 0x9653, 0x98B4, 0, 0x8CF0, 0x88E5, 0x9692, 0, /* 0xA0 */
0x8B9C, 0, 0, 0x8B9D, 0x8B9E, 0x92E0, 0x97BA, 0, /* 0xA0 */
0x98B5, 0, 0, 0x98B6, 0, 0, 0x98B7, 0, /* 0xB0 */
0, 0, 0x906C, 0, 0, 0, 0, 0, /* 0xB0 */
0x8F59, 0x906D, 0x98BC, 0, 0x98BA, 0, 0x98BB, 0x8B77, /* 0xC0 */
0, 0, 0x8DA1, 0x89EE, 0, 0x98B9, 0x98B8, 0x95A7, /* 0xC0 */
0, 0, 0, 0, 0x8E65, 0x8E64, 0x91BC, 0x98BD, /* 0xD0 */
0x9574, 0x90E5, 0, 0, 0, 0x8157, 0x98BE, 0x98C0, /* 0xD0 */
0, 0xFA69, 0, 0x91E3, 0x97DF, 0x88C8, 0, 0, /* 0xE0 */
0, 0, 0, 0, 0, 0x98BF, 0x89BC, 0, /* 0xE0 */
0x8BC2, 0, 0x9287, 0, 0, 0, 0x8C8F, 0x98C1, /* 0xF0 */
0, 0, 0, 0x9443, 0xFA6A /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_4F[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xFA6B, 0x8AE9, 0, 0xFA6C, 0, 0, 0, 0, /* 0x00 */
0, 0x98C2, 0x88C9, 0, 0, 0x8CDE, 0x8AEA, 0x959A, /* 0x00 */
0x94B0, 0x8B78, 0, 0, 0, 0, 0, 0, /* 0x10 */
0, 0, 0x89EF, 0, 0x98E5, 0x9360, 0, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0x948C, /* 0x20 */
0x98C4, 0, 0, 0, 0x94BA, 0, 0x97E0, 0, /* 0x30 */
0x904C, 0xFA6D, 0x8E66, 0, 0x8E97, 0x89BE, 0, 0, /* 0x30 */
0, 0, 0, 0x92CF, 0, 0, 0x9241, 0x98C8, /* 0x40 */
0, 0, 0, 0, 0, 0x88CA, 0x92E1, 0x8F5A, /* 0x40 */
0x8DB2, 0x9743, 0, 0x91CC, 0, 0x89BD, 0xFA6E, 0x98C7, /* 0x50 */
0, 0x975D, 0x98C3, 0x98C5, 0x8DEC, 0x98C6, 0x9B43, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0x98CE, 0, 0, 0, 0, 0, 0x98D1, /* 0x60 */
0x98CF, 0, 0, 0x89C0, 0, 0x95B9, 0x98C9, 0, /* 0x70 */
0, 0, 0, 0x98CD, 0x8CF1, 0, 0, 0x8E67, /* 0x70 */
0, 0, 0, 0x8AA4, 0, 0, 0x98D2, 0, /* 0x80 */
0x98CA, 0, 0xFA70, 0x97E1, 0, 0x8E98, 0, 0x98CB, /* 0x80 */
0, 0x98D0, 0xFA71, 0, 0xFA72, 0, 0x98D3, 0, /* 0x90 */
0x98CC, 0, 0xFA6F, 0x8B9F, 0, 0x88CB, 0, 0, /* 0x90 */
0x8BA0, 0x89BF, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0x9B44, 0, 0x9699, 0x958E, 0x8CF2, /* 0xA0 */
0, 0, 0, 0, 0, 0x904E, 0x97B5, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0x95D6, /* 0xB0 */
0, 0, 0x8C57, 0x91A3, 0x89E2, 0, 0, 0, /* 0xC0 */
0, 0xFA61, 0x8F72, 0, 0, 0xFA73, 0x98D7, 0, /* 0xC0 */
0x98DC, 0x98DA, 0, 0, 0x98D5, 0, 0, 0x91AD, /* 0xD0 */
0x98D8, 0, 0x98DB, 0x98D9, 0, 0x95DB, 0, 0x98D6, /* 0xD0 */
0, 0x904D, 0, 0x9693, 0x98DD, 0x98DE, 0, 0, /* 0xE0 */
0, 0, 0, 0, 0, 0, 0x8F43, 0x98EB, /* 0xE0 */
0, 0, 0, 0x946F, 0, 0x9555, 0x98E6, 0, /* 0xF0 */
0x95EE, 0, 0x89B4, 0, 0, 0, 0x98EA, 0xFA76 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_50[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x98E4, 0x98ED, 0, /* 0x00 */
0, 0x9171, 0, 0x8CC2, 0, 0x947B, 0, 0xE0C5, /* 0x00 */
0, 0x98EC, 0x937C, 0, 0x98E1, 0, 0x8CF4, 0, /* 0x10 */
0, 0x8CF3, 0x98DF, 0, 0, 0, 0xFA77, 0x8ED8, /* 0x10 */
0, 0x98E7, 0xFA75, 0x95ED, 0x926C, 0x98E3, 0x8C91, 0, /* 0x20 */
0x98E0, 0x98E8, 0x98E2, 0x97CF, 0x98E9, 0x9860, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0x8BE4, 0, /* 0x30 */
0, 0x8C90, 0, 0, 0, 0, 0, 0, /* 0x30 */
0xFA74, 0, 0xFA7A, 0x98EE, 0, 0, 0xFA78, 0x98EF, /* 0x40 */
0x98F3, 0x88CC, 0, 0, 0, 0, 0, 0x95CE, /* 0x40 */
0x98F2, 0, 0, 0, 0, 0x98F1, 0x98F5, 0, /* 0x50 */
0, 0, 0x98F4, 0, 0x92E2, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0x8C92, 0, 0, /* 0x60 */
0, 0, 0, 0, 0x98F6, 0, 0, 0, /* 0x60 */
0xFA79, 0, 0x8EC3, 0, 0x91A4, 0x92E3, 0x8BF4, 0, /* 0x70 */
0x98F7, 0, 0, 0, 0, 0x8B55, 0, 0, /* 0x70 */
0x98F8, 0, 0, 0, 0, 0x98FA, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0x9654, 0, 0, /* 0x80 */
0, 0x8C86, 0, 0, 0xFA7B, 0, 0, 0, /* 0x90 */
0x8E50, 0x94F5, 0x98F9, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0x8DC3, 0x9762, 0, 0, /* 0xA0 */
0, 0, 0x98FC, 0x9942, 0x98FB, 0x8DC2, 0, 0x8F9D, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0x8C58, 0, /* 0xB0 */
0, 0, 0x9943, 0, 0, 0x8BCD, 0, 0, /* 0xC0 */
0, 0x9940, 0x9941, 0, 0, 0x93AD, 0, 0x919C, /* 0xC0 */
0, 0x8BA1, 0, 0, 0, 0x966C, 0x9944, 0, /* 0xD0 */
0xFA7D, 0, 0x97BB, 0, 0, 0, 0x9945, 0, /* 0xD0 */
0, 0, 0, 0x9948, 0, 0x9946, 0, 0x916D, /* 0xE0 */
0, 0, 0, 0, 0, 0x9947, 0x9949, 0, /* 0xE0 */
0, 0, 0, 0, 0xFA7C, 0x994B, 0, 0, /* 0xF0 */
0, 0x994A, 0, 0x95C6 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_51[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8B56, 0x994D, 0x994E, 0, 0x89AD, 0, 0, 0, /* 0x00 */
0, 0x994C, 0, 0, 0, 0, 0, 0, /* 0x00 */
0, 0, 0x8EF2, 0, 0x9951, 0x9950, 0x994F, 0, /* 0x10 */
0x98D4, 0, 0x9952, 0, 0, 0, 0, 0x8F9E, /* 0x10 */
0, 0x9953, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0x9744, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0x96D7, 0, 0, 0, 0, 0x9955, /* 0x30 */
0, 0, 0x9954, 0x9957, 0x9956, 0, 0, 0x9958, /* 0x30 */
0x9959, 0x88F2, 0, 0x8CB3, 0x8C5A, 0x8F5B, 0x929B, 0x8BA2, /* 0x40 */
0x90E6, 0x8CF5, 0xFA7E, 0x8D8E, 0x995B, 0x96C6, 0x9365, 0, /* 0x40 */
0x8E99, 0, 0x995A, 0, 0x995C, 0, 0, 0, /* 0x50 */
0, 0, 0x937D, 0, 0x8A95, 0, 0, 0, /* 0x50 */
0, 0, 0x995D, 0, 0xFA80, 0x93FC, 0, 0, /* 0x60 */
0x9153, 0x995F, 0x9960, 0x94AA, 0x8CF6, 0x985A, 0x9961, 0, /* 0x60 */
0, 0x8BA4, 0, 0, 0, 0x95BA, 0x91B4, 0x8BEF, /* 0x70 */
0x9354, 0, 0, 0, 0x8C93, 0, 0, 0, /* 0x70 */
0x9962, 0, 0x9963, 0, 0, 0x93E0, 0x897E, 0, /* 0x80 */
0, 0x9966, 0x8DFB, 0, 0x9965, 0x8DC4, 0, 0x9967, /* 0x80 */
0xE3EC, 0x9968, 0x9660, 0x9969, 0, 0x996A, 0x996B, 0x8FE7, /* 0x90 */
0, 0x8ECA, 0, 0, 0, 0xFA81, 0, 0, /* 0x90 */
0x8AA5, 0, 0x996E, 0, 0x996C, 0x96BB, 0x996D, 0, /* 0xA0 */
0x9579, 0x996F, 0x9970, 0x9971, 0x937E, 0, 0, 0, /* 0xA0 */
0x9975, 0x9973, 0x9974, 0x9972, 0x8DE1, 0x9976, 0x96E8, 0x97E2, /* 0xB0 */
0, 0, 0, 0, 0, 0x9977, 0xFA82, 0, /* 0xB0 */
0, 0, 0, 0, 0x90A6, 0x9978, 0x8F79, 0, /* 0xC0 */
0, 0x9979, 0, 0x929C, 0x97BD, 0x9380, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0x99C3, 0, /* 0xD0 */
0, 0, 0, 0x997A, 0xEAA3, 0x8BC3, 0, 0, /* 0xD0 */
0x997B, 0x967D, 0, 0, 0, 0, 0x8F88, 0x91FA, /* 0xE0 */
0, 0x997D, 0x93E2, 0, 0xFA83, 0x997E, 0, 0, /* 0xE0 */
0x9980, 0x8A4D, 0, 0, 0, 0x9981, 0x8BA5, 0, /* 0xF0 */
0x93CA, 0x899A, 0x8F6F, 0, 0, 0x949F, 0x9982 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_52[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x9381, 0, 0, 0x906E, 0x9983, 0, 0x95AA, 0x90D8, /* 0x00 */
0x8AA0, 0, 0x8AA7, 0x9984, 0, 0, 0x9986, 0, /* 0x00 */
0, 0x8C59, 0, 0, 0x9985, 0xFA84, 0, 0x97F1, /* 0x10 */
0, 0, 0, 0, 0, 0x8F89, 0, 0, /* 0x10 */
0, 0, 0, 0, 0x94BB, 0x95CA, 0, 0x9987, /* 0x20 */
0, 0x9798, 0x9988, 0, 0, 0, 0x9989, 0, /* 0x20 */
0x939E, 0, 0, 0x998A, 0, 0, 0x90A7, 0x8DFC, /* 0x30 */
0x8C94, 0x998B, 0x8E68, 0x8D8F, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0x92E4, 0x998D, 0, 0, 0x91A5, /* 0x40 */
0, 0, 0x8DED, 0x998E, 0x998F, 0x914F, 0, 0x998C, /* 0x40 */
0, 0, 0, 0, 0x9991, 0, 0x9655, 0, /* 0x50 */
0, 0, 0, 0x8D84, 0, 0, 0x9990, 0, /* 0x50 */
0, 0, 0, 0x8C95, 0x8DDC, 0x948D, 0, 0, /* 0x60 */
0, 0x9994, 0x9992, 0, 0, 0, 0, 0x959B, /* 0x60 */
0x8FE8, 0x999B, 0x8A84, 0x9995, 0x9993, 0x916E, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0x9997, 0, 0x9996, /* 0x70 */
0, 0, 0, 0x8A63, 0, 0, 0, 0x8C80, /* 0x80 */
0x999C, 0x97AB, 0, 0, 0, 0x9998, 0, 0, /* 0x80 */
0, 0x999D, 0x999A, 0, 0x9999, 0, 0, 0, /* 0x90 */
0, 0, 0, 0x97CD, 0xFA85, 0, 0, 0x8CF7, /* 0x90 */
0x89C1, 0, 0, 0x97F2, 0, 0, 0xFA86, 0, /* 0xA0 */
0, 0x8F95, 0x9377, 0x8D85, 0x99A0, 0x99A1, 0, 0xFB77, /* 0xA0 */
0, 0x97E3, 0, 0, 0x984A, 0x99A3, 0, 0, /* 0xB0 */
0, 0x8CF8, 0, 0, 0x99A2, 0, 0x8A4E, 0, /* 0xB0 */
0xFA87, 0x99A4, 0, 0x9675, 0, 0x92BA, 0, 0x9745, /* 0xC0 */
0, 0x95D7, 0, 0, 0, 0x99A5, 0, 0, /* 0xC0 */
0, 0, 0xE8D3, 0, 0, 0x93AE, 0, 0x99A6, /* 0xD0 */
0x8AA8, 0x96B1, 0, 0xFA88, 0, 0x8F9F, 0x99A7, 0x95E5, /* 0xD0 */
0x99AB, 0, 0x90A8, 0x99A8, 0x8BCE, 0, 0x99A9, 0x8AA9, /* 0xE0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xE0 */
0, 0, 0x8C4D, 0x99AC, 0, 0x99AD, 0, 0, /* 0xF0 */
0x99AE, 0x99AF, 0x8ED9, 0, 0, 0, 0x8CF9, 0x96DC /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_53[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xFA89, 0x96E6, 0x93F5, 0, 0, 0x95EF, 0x99B0, 0xFA8A, /* 0x00 */
0x99B1, 0, 0, 0, 0, 0x99B3, 0, 0x99B5, /* 0x00 */
0x99B4, 0, 0, 0, 0, 0x99B6, 0x89BB, 0x966B, /* 0x10 */
0, 0x8DFA, 0x99B7, 0, 0, 0x9178, 0, 0, /* 0x10 */
0x8FA0, 0x8BA7, 0, 0x99B8, 0xFA8B, 0, 0, 0, /* 0x20 */
0, 0, 0x94D9, 0, 0, 0, 0, 0x99B9, /* 0x20 */
0, 0x99BA, 0, 0x99BB, 0, 0, 0, 0, /* 0x30 */
0x99BC, 0x9543, 0x8BE6, 0x88E3, 0, 0, 0, 0x93BD, /* 0x30 */
0x99BD, 0x8F5C, 0, 0x90E7, 0, 0x99BF, 0x99BE, 0x8FA1, /* 0x40 */
0x8CDF, 0x99C1, 0x94BC, 0, 0, 0x99C2, 0, 0, /* 0x40 */
0, 0x94DA, 0x91B2, 0x91EC, 0x8BA6, 0, 0, 0x93EC, /* 0x50 */
0x9250, 0, 0x948E, 0, 0x966D, 0, 0x99C4, 0, /* 0x50 */
0x90E8, 0, 0, 0, 0, 0, 0x8C54, 0, /* 0x60 */
0, 0x99C5, 0, 0, 0, 0, 0x99C6, 0x894B, /* 0x60 */
0x88F3, 0x8AEB, 0xFA8C, 0x91A6, 0x8B70, 0x9791, 0, 0x99C9, /* 0x70 */
0x89B5, 0, 0, 0x99C8, 0, 0, 0, 0x8BA8, /* 0x70 */
0, 0, 0x99CA, 0, 0x96EF, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0xFA8D, 0, 0, 0x99CB, 0, /* 0x90 */
0x97D0, 0, 0x8CFA, 0, 0, 0, 0, 0x8CB4, /* 0x90 */
0x99CC, 0, 0, 0, 0, 0x99CE, 0x99CD, 0, /* 0xA0 */
0x907E, 0x8958, 0, 0, 0, 0x897D, 0x99CF, 0, /* 0xA0 */
0x99D0, 0, 0xFA8E, 0x8CB5, 0, 0, 0x99D1, 0, /* 0xB0 */
0, 0, 0, 0x8B8E, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0x8E51, 0x99D2, 0, 0, 0, 0, /* 0xC0 */
0x9694, 0x8DB3, 0x8B79, 0x9746, 0x916F, 0x94BD, 0x8EFB, 0, /* 0xC0 */
0, 0, 0, 0, 0x8F66, 0, 0x8EE6, 0x8EF3, /* 0xD0 */
0, 0x8F96, 0, 0x94BE, 0, 0xFA8F, 0, 0x99D5, /* 0xD0 */
0, 0x8962, 0x9170, 0x8CFB, 0x8CC3, 0x8BE5, 0, 0, /* 0xE0 */
0x99D9, 0x9240, 0x91FC, 0x8BA9, 0x8FA2, 0x99DA, 0x99D8, 0x89C2, /* 0xE0 */
0x91E4, 0x8EB6, 0x8E6A, 0x8945, 0, 0, 0x8A90, 0x8D86, /* 0xF0 */
0x8E69, 0, 0x99DB /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_54[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x99DC, 0, 0x8B68, 0x8A65, 0, 0, 0, /* 0x00 */
0x8D87, 0x8B67, 0x92DD, 0x8944, 0x93AF, 0x96BC, 0x8D40, 0x9799, /* 0x00 */
0x9366, 0x8CFC, 0, 0, 0, 0, 0, 0, /* 0x10 */
0, 0, 0, 0x8C4E, 0, 0x99E5, 0, 0x8BE1, /* 0x10 */
0x9669, 0, 0, 0, 0, 0, 0x94DB, 0, /* 0x20 */
0, 0x99E4, 0, 0x8ADC, 0x99DF, 0x99E0, 0x99E2, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0x99E3, 0, /* 0x30 */
0x8B7A, 0x9081, 0, 0x95AB, 0x99E1, 0x99DD, 0x8CE1, 0, /* 0x30 */
0x99DE, 0, 0x9843, 0, 0, 0, 0x95F0, 0, /* 0x40 */
0x92E6, 0x8CE0, 0x8D90, 0, 0, 0, 0x99E6, 0, /* 0x40 */
0, 0x93DB, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0x99EA, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0x8EFC, 0, 0x8EF4, 0, 0, 0, 0, 0, /* 0x60 */
0x99ED, 0x99EB, 0, 0x96A1, 0, 0x99E8, 0x99F1, 0x99EC, /* 0x70 */
0, 0, 0, 0x99EF, 0x8CC4, 0x96BD, 0, 0, /* 0x70 */
0x99F0, 0, 0, 0, 0x99F2, 0, 0x99F4, 0, /* 0x80 */
0, 0, 0xFA92, 0x8DEE, 0x9861, 0, 0x99E9, 0x99E7, /* 0x80 */
0x99F3, 0, 0x99EE, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0xFA91, 0, 0, 0, /* 0x90 */
0, 0, 0x99F6, 0, 0x9A42, 0x99F8, 0, 0, /* 0xA0 */
0x99FC, 0xFA93, 0, 0x9A40, 0x99F9, 0, 0, 0x9A5D, /* 0xA0 */
0, 0, 0x8DE7, 0x8A50, 0, 0, 0, 0, /* 0xB0 */
0x99F7, 0, 0, 0, 0x9A44, 0x88F4, 0x9A43, 0, /* 0xB0 */
0x88A3, 0x9569, 0x9A41, 0, 0x99FA, 0, 0, 0x99F5, /* 0xC0 */
0x99FB, 0x8DC6, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0x9A45, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0x88F5, 0x9A4E, 0, 0, 0x9A46, 0x9A47, 0, /* 0xE0 */
0x8FA3, 0x9689, 0, 0, 0, 0x9A4C, 0x9A4B, 0, /* 0xE0 */
0, 0, 0x934E, 0, 0, 0, 0, 0, /* 0xF0 */
0, 0, 0x9A4D, 0, 0, 0x9A4A, 0, 0xFA94 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_55[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8953, 0, 0x8DB4, 0x904F, /* 0x00 */
0, 0, 0, 0, 0, 0, 0, 0x9A48, /* 0x00 */
0x9382, 0, 0, 0, 0x9A49, 0, 0x88A0, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0x9A53, 0x9742, /* 0x20 */
0, 0x8FA5, 0, 0x9A59, 0, 0, 0, 0, /* 0x30 */
0x9A58, 0x9A4F, 0, 0, 0, 0, 0x91C1, 0, /* 0x30 */
0x9A50, 0, 0, 0, 0x91ED, 0x9A55, 0x8FA4, 0, /* 0x40 */
0, 0, 0, 0, 0x9A52, 0, 0, 0x96E2, /* 0x40 */
0, 0, 0, 0x8C5B, 0, 0, 0x9A56, 0x9A57, /* 0x50 */
0, 0, 0, 0, 0x9A54, 0x9A5A, 0, 0, /* 0x50 */
0, 0, 0, 0x9A51, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0x9A60, 0x9A65, 0, 0x9A61, 0, /* 0x70 */
0x9A5C, 0, 0, 0x9A66, 0x9150, 0, 0xFA95, 0x9A68, /* 0x80 */
0, 0x8D41, 0x9A5E, 0x929D, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0x9A62, 0x9A5B, 0x8AAB, 0, 0x8AEC, 0x8A85, 0x9A63, 0x9A5F, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0x8C96, /* 0xA0 */
0x9A69, 0x9A67, 0x9172, 0x8B69, 0x8BAA, 0, 0x9A64, 0, /* 0xA0 */
0x8BF2, 0, 0, 0, 0, 0, 0x8963, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0x9A6D, 0x9A6B, 0, 0x9AA5, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0x9A70, 0, 0, 0, /* 0xD0 */
0, 0, 0x9A6A, 0, 0x9A6E, 0, 0, 0x9A6C, /* 0xD0 */
0, 0, 0, 0x8E6B, 0x9A6F, 0, 0, 0, /* 0xE0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xE0 */
0, 0, 0, 0, 0, 0, 0, 0x9A72, /* 0xF0 */
0, 0x9A77, 0, 0, 0, 0x9A75, 0x9A74 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_56[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x9251, 0, /* 0x00 */
0, 0x89C3, 0, 0, 0, 0, 0, 0, /* 0x00 */
0, 0, 0, 0, 0x9A71, 0, 0x9A73, 0x8FA6, /* 0x10 */
0x8952, 0, 0, 0x9A76, 0, 0, 0, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0x89DC, 0, 0, 0, 0, 0, 0x9A82, /* 0x20 */
0, 0x8FFA, 0x9A7D, 0, 0x9A7B, 0, 0x9A7C, 0, /* 0x30 */
0x9A7E, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0x895C, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0x9158, 0, 0x9A78, 0, /* 0x40 */
0x9A79, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0x8A9A, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0x9A81, 0, 0, 0, /* 0x60 */
0x8AED, 0, 0x9A84, 0x9A80, 0x9A83, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0x95AC, 0, 0, 0, /* 0x70 */
0x93D3, 0, 0x94B6, 0, 0, 0, 0, 0, /* 0x70 */
0x9A86, 0, 0, 0, 0, 0, 0x9A85, 0x8A64, /* 0x80 */
0, 0, 0x9A87, 0, 0, 0, 0, 0x9A8A, /* 0x80 */
0, 0, 0, 0, 0x9A89, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0x9A88, 0, 0x9458, 0, 0, 0x9A8B, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0x9A8C, 0, /* 0xA0 */
0, 0, 0, 0, 0x9A8E, 0, 0x9A8D, 0, /* 0xB0 */
0, 0, 0, 0, 0x9A90, 0, 0, 0, /* 0xB0 */
0x9A93, 0x9A91, 0x9A8F, 0x9A92, 0, 0, 0, 0, /* 0xC0 */
0x9A94, 0, 0, 0, 0, 0, 0x9A95, 0, /* 0xC0 */
0, 0x9A96, 0, 0x9A97, 0, 0, 0, 0x9A98, /* 0xD0 */
0x9964, 0, 0x8EFA, 0x8E6C, 0, 0, 0x89F1, 0, /* 0xD0 */
0x88F6, 0, 0, 0x9263, 0, 0, 0, 0, /* 0xE0 */
0, 0, 0, 0, 0, 0, 0x9A99, 0, /* 0xE0 */
0x8DA2, 0, 0x88CD, 0x907D, 0, 0, 0, 0, /* 0xF0 */
0, 0x9A9A, 0x8CC5, 0, 0, 0x8D91, 0, 0x9A9C /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_57[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x9A9B, 0, 0, 0x95DE, 0x9A9D, 0, 0, 0, /* 0x00 */
0x9A9F, 0x9A9E, 0, 0x9AA0, 0, 0x9AA1, 0, 0x8C97, /* 0x00 */
0, 0, 0x8980, 0x9AA2, 0, 0, 0x9AA4, 0, /* 0x10 */
0x9AA3, 0, 0, 0, 0x9AA6, 0, 0, 0x9379, /* 0x10 */
0, 0, 0, 0, 0, 0, 0x9AA7, 0x88B3, /* 0x20 */
0x8DDD, 0, 0, 0, 0, 0x8C5C, 0, 0, /* 0x20 */
0x926E, 0, 0, 0, 0, 0, 0, 0x9AA8, /* 0x30 */
0x9AA9, 0, 0, 0x9AAB, 0, 0, 0, 0, /* 0x30 */
0x9AAC, 0, 0x8DE2, 0, 0, 0, 0, 0x8BCF, /* 0x40 */
0, 0, 0x9656, 0, 0, 0, 0x9AAA, 0x9AAD, /* 0x40 */
0x8DBF, 0x8D42, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0xFA96, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0x9AB1, 0, 0, 0x8DA3, 0xFA97, 0x9252, 0, /* 0x60 */
0, 0x9AAE, 0x92D8, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0x9AB2, /* 0x70 */
0, 0, 0x9082, 0, 0, 0, 0, 0, /* 0x80 */
0x9AB0, 0x9AB3, 0, 0x8C5E, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0x9AB4, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0x9AB5, 0, 0x8D43, 0x8A5F, 0x9AB7, 0, 0, 0, /* 0xA0 */
0, 0, 0x9AB8, 0, 0xFA98, 0, 0, 0, /* 0xA0 */
0x9AB9, 0, 0, 0x9AB6, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0x9AAF, 0, 0, 0x9ABA, 0, 0, 0x9ABB, 0xFA9A, /* 0xC0 */
0xFA99, 0, 0, 0x9684, 0, 0, 0x8FE9, 0, /* 0xC0 */
0, 0, 0x9ABD, 0x9ABE, 0x9ABC, 0, 0x9AC0, 0, /* 0xD0 */
0, 0, 0, 0, 0x9457, 0, 0, 0x88E6, /* 0xD0 */
0x9575, 0, 0, 0x9AC1, 0, 0, 0, 0, /* 0xE0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xE0 */
0, 0, 0, 0, 0x8FFB, 0, 0, 0x8EB7, /* 0xF0 */
0, 0x947C, 0x8AEE, 0, 0x8DE9 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_58[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x9678, 0, 0x93B0, 0, 0, 0x8C98, 0x91CD, 0, /* 0x00 */
0, 0, 0x9ABF, 0x9AC2, 0, 0, 0, 0, /* 0x00 */
0, 0, 0, 0, 0, 0x91C2, 0, 0, /* 0x10 */
0, 0x9AC3, 0, 0, 0, 0x9AC4, 0, 0, /* 0x10 */
0, 0x9AC6, 0, 0, 0x92E7, 0, 0, 0, /* 0x20 */
0, 0, 0x8AAC, 0, 0, 0, 0, 0xEA9F, /* 0x20 */
0x8981, 0x95F1, 0, 0, 0x8FEA, 0x9367, 0, 0, /* 0x30 */
0, 0, 0x8DE4, 0, 0, 0x9ACC, 0, 0, /* 0x30 */
0x95BB, 0x97DB, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0x89F2, 0x9AC8, 0, 0, 0, 0, /* 0x40 */
0, 0x9159, 0x9ACB, 0, 0x9383, 0, 0, 0x9368, /* 0x50 */
0x9384, 0x94B7, 0x92CB, 0, 0, 0, 0x8DC7, 0, /* 0x50 */
0, 0, 0x9AC7, 0, 0, 0, 0, 0, /* 0x60 */
0, 0x8996, 0, 0x9355, 0, 0, 0, 0, /* 0x60 */
0x9AC9, 0, 0x9AC5, 0, 0, 0x906F, 0, 0, /* 0x70 */
0, 0x9ACD, 0, 0, 0, 0, 0x8F6D, 0, /* 0x70 */
0, 0, 0, 0x8BAB, 0, 0x9ACE, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0x95E6, 0, 0, 0, 0x919D, /* 0x90 */
0, 0, 0, 0, 0x92C4, 0, 0xFA9D, 0x9AD0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0x966E, 0, 0, 0x9AD1, 0, 0, 0x9AD6, 0, /* 0xA0 */
0, 0, 0xFA9E, 0x95AD, 0, 0, 0, 0, /* 0xB0 */
0x9AD5, 0x9ACF, 0x9AD2, 0x9AD4, 0, 0, 0x8DA4, 0, /* 0xB0 */
0, 0x95C7, 0, 0, 0, 0x9AD7, 0, 0x9264, /* 0xC0 */
0, 0, 0x89F3, 0, 0x8FEB, 0, 0, 0, /* 0xC0 */
0, 0x9AD9, 0, 0x9AD8, 0, 0x8D88, 0, 0x9ADA, /* 0xD0 */
0x9ADC, 0x9ADB, 0, 0, 0x9ADE, 0, 0x9AD3, 0x9AE0, /* 0xD0 */
0, 0, 0, 0, 0x9ADF, 0x9ADD, 0, 0, /* 0xE0 */
0, 0, 0, 0x8E6D, 0x9070, 0, 0x9173, 0x9AE1, /* 0xE0 */
0x90BA, 0x88EB, 0x9484, 0, 0, 0, 0, 0x92D9, /* 0xF0 */
0, 0x9AE3, 0x9AE2, 0x9AE4, 0x9AE5, 0x9AE6 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_59[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x9AE7, 0, 0, 0, 0, 0, /* 0x00 */
0, 0x95CF, 0x9AE8, 0xFA9F, 0, 0, 0, 0x89C4, /* 0x00 */
0x9AE9, 0, 0, 0, 0, 0x975B, 0x8A4F, 0, /* 0x10 */
0x99C7, 0x8F67, 0x91BD, 0x9AEA, 0x96E9, 0, 0, 0, /* 0x10 */
0, 0, 0x96B2, 0, 0, 0x9AEC, 0, 0x91E5, /* 0x20 */
0, 0x9356, 0x91BE, 0x9576, 0x9AED, 0x9AEE, 0x899B, 0, /* 0x20 */
0, 0x8EB8, 0x9AEF, 0, 0, 0, 0, 0x88CE, /* 0x30 */
0x9AF0, 0, 0, 0, 0, 0, 0x9AF1, 0, /* 0x30 */
0, 0, 0, 0, 0x8982, 0, 0, 0x8AEF, /* 0x40 */
0x93DE, 0x95F2, 0, 0, 0, 0, 0x9AF5, 0x9174, /* 0x40 */
0x9AF4, 0x8C5F, 0, 0xFAA0, 0x967A, 0x9AF3, 0, 0x9385, /* 0x50 */
0x9AF7, 0, 0x9AF6, 0xFAA1, 0, 0xFAA2, 0, 0, /* 0x50 */
0x9AF9, 0, 0x9AF8, 0xFAA3, 0, 0x899C, 0, 0x9AFA, /* 0x60 */
0x8FA7, 0x9AFC, 0x9244, 0, 0x9AFB, 0, 0x95B1, 0, /* 0x60 */
0, 0, 0, 0x8F97, 0x937A, 0, 0, 0, /* 0x70 */
0x9B40, 0, 0, 0, 0, 0x8D44, 0, 0, /* 0x70 */
0, 0x9B41, 0x9440, 0x94DC, 0x96CF, 0, 0, 0, /* 0x80 */
0, 0, 0x9444, 0, 0, 0x9B4A, 0, 0, /* 0x80 */
0, 0, 0, 0x8B57, 0, 0, 0x9764, 0, /* 0x90 */
0, 0x96AD, 0, 0x9BAA, 0, 0x9B42, 0, 0, /* 0x90 */
0, 0, 0, 0x9B45, 0xFAA4, 0x91C3, 0, 0, /* 0xA0 */
0x9657, 0, 0, 0, 0x9369, 0, 0, 0, /* 0xA0 */
0, 0, 0x9B46, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0x9685, 0xFAA5, 0x8DC8, 0, 0, 0x8FA8, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0x9B47, 0, /* 0xC0 */
0, 0x8E6F, 0, 0x8E6E, 0, 0, 0, 0, /* 0xC0 */
0x88B7, 0x8CC6, 0, 0x90A9, 0x88CF, 0, 0, 0, /* 0xD0 */
0, 0x9B4B, 0x9B4C, 0, 0x9B49, 0, 0, 0, /* 0xD0 */
0, 0, 0, 0, 0, 0x8957, 0x8AAD, 0, /* 0xE0 */
0x9B48, 0, 0x96C3, 0x9550, 0, 0, 0, 0, /* 0xE0 */
0, 0, 0, 0, 0, 0, 0x88A6, 0, /* 0xF0 */
0, 0, 0, 0x88F7, 0, 0, 0, 0x8E70 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_5A[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x88D0, 0, 0x88A1, 0, 0, 0, 0, /* 0x00 */
0, 0x9B51, 0, 0, 0, 0, 0, 0, /* 0x00 */
0, 0x9B4F, 0, 0, 0, 0, 0, 0, /* 0x10 */
0x96BA, 0, 0x9B52, 0, 0x9B50, 0, 0, 0x9B4E, /* 0x10 */
0x9050, 0, 0, 0, 0, 0x9B4D, 0, 0, /* 0x20 */
0, 0x95D8, 0, 0, 0, 0, 0, 0x8CE2, /* 0x20 */
0, 0, 0, 0, 0, 0x9B56, 0x9B57, 0, /* 0x30 */
0, 0, 0, 0, 0x8FA9, 0, 0, 0, /* 0x30 */
0x9B53, 0x984B, 0, 0, 0, 0, 0x946B, 0, /* 0x40 */
0, 0x9B55, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0x8DA5, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0x9B58, 0, 0, 0, 0x9577, 0, /* 0x60 */
0, 0, 0x9B59, 0, 0x9B54, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0x96B9, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0x947D, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0x9B5A, 0x9551, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0x9B5B, 0x9B5F, 0x9B5C, 0, /* 0xB0 */
0, 0x89C5, 0x9B5E, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0x8EB9, 0, 0x9B5D, 0x8C99, 0, 0, 0, /* 0xC0 */
0x9B6B, 0, 0, 0, 0, 0, 0x9B64, 0x9B61, /* 0xD0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0x9284, 0, 0x9B60, 0, 0, 0x9B62, 0, /* 0xE0 */
0, 0x9B63, 0, 0, 0, 0, 0, 0, /* 0xE0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xF0 */
0, 0, 0x9B65, 0x9B66 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_5B[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
/* 0x00 */
0x8AF0, 0, 0x9B68, 0x9B67, 0, 0, 0, /* 0x00 */
0, 0, 0, 0, 0, 0, 0x9B69, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */
0, 0, 0x8FEC, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0x9B6C, 0, 0x92DA, 0, 0, 0, /* 0x20 */
0x8964, 0, 0x9B6A, 0, 0, 0, 0x9B6D, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0x9B6E, 0, /* 0x30 */
0x9B71, 0, 0, 0x9B6F, 0, 0x9B70, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0x8E71, 0x9B72, 0, 0, 0x8D45, 0x9B73, 0xFAA6, 0x8E9A, /* 0x50 */
0x91B6, 0, 0x9B74, 0x9B75, 0x8E79, 0x8D46, 0, 0x96D0, /* 0x50 */
0, 0, 0, 0x8B47, 0x8CC7, 0x9B76, 0x8A77, 0, /* 0x60 */
0, 0x9B77, 0, 0x91B7, 0, 0, 0, 0, /* 0x60 */
0x9B78, 0x9BA1, 0, 0x9B79, 0, 0x9B7A, 0, 0, /* 0x70 */
0x9B7B, 0, 0x9B7D, 0, 0, 0, 0, 0, /* 0x70 */
0x9B7E, 0, 0, 0x9B80, 0, 0x91EE, 0, 0x8946, /* 0x80 */
0x8EE7, 0x88C0, 0, 0x9176, 0x8AAE, 0x8EB3, 0, 0x8D47, /* 0x80 */
0, 0, 0, 0, 0, 0x9386, 0, 0x8F40, /* 0x90 */
0x8AAF, 0x9288, 0x92E8, 0x88B6, 0x8B58, 0x95F3, 0, 0x8EC0, /* 0x90 */
0, 0, 0x8B71, 0x90E9, 0x8EBA, 0x9747, 0x9B81, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0x8B7B, 0, /* 0xA0 */
0x8DC9, 0, 0, 0x8A51, 0x8983, 0x8FAA, 0x89C6, 0, /* 0xB0 */
0x9B82, 0x9765, 0, 0, 0, 0, 0, 0x8F68, /* 0xB0 */
0xFAA7, 0, 0x8EE2, 0x9B83, 0x8AF1, 0x93D0, 0x96A7, 0x9B84, /* 0xC0 */
0, 0x9B85, 0, 0, 0x9578, 0, 0, 0, /* 0xC0 */
0x9B87, 0, 0x8AA6, 0x8BF5, 0x9B86, 0, 0, 0, /* 0xD0 */
0xFAA9, 0, 0, 0x8AB0, 0, 0x9051, 0x9B8B, 0x8E40, /* 0xD0 */
0, 0x89C7, 0x9B8A, 0, 0x9B88, 0x9B8C, 0x9B89, 0x944A, /* 0xE0 */
0x9ECB, 0x9052, 0, 0x9B8D, 0xFAAA, 0, 0x97BE, 0, /* 0xE0 */
0x9B8E, 0, 0, 0x9B90, 0, 0x929E, 0x9B8F, 0, /* 0xF0 */
0x90A1, 0, 0x8E9B, 0, 0, 0, 0x91CE, 0x8EF5 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_5C[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x9595, 0x90EA, 0, 0x8ECB, 0x9B91, 0x8FAB, 0x9B92, /* 0x00 */
0x9B93, 0x88D1, 0x91B8, 0x9071, 0, 0x9B94, 0x93B1, 0x8FAC, /* 0x00 */
0, 0x8FAD, 0, 0x9B95, 0, 0, 0x90EB, 0, /* 0x10 */
0, 0, 0x8FAE, 0, 0, 0, 0xFAAB, 0, /* 0x10 */
0x9B96, 0, 0x9B97, 0, 0x96DE, 0, 0, 0, /* 0x20 */
0x9B98, 0, 0, 0, 0, 0x8BC4, 0, 0, /* 0x20 */
0, 0x8F41, 0, 0, 0, 0, 0, 0, /* 0x30 */
0x9B99, 0x9B9A, 0x8EDA, 0x904B, 0x93F2, 0x9073, 0x94F6, 0x9441, /* 0x30 */
0x8BC7, 0x9B9B, 0, 0, 0, 0x8B8F, 0x9B9C, 0, /* 0x40 */
0x8BFC, 0, 0x93CD, 0x89AE, 0, 0x8E72, 0x9B9D, 0x9BA0, /* 0x40 */
0x9B9F, 0x8BFB, 0, 0x9B9E, 0, 0x9357, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0x91AE, 0, /* 0x50 */
0x936A, 0x8EC6, 0, 0, 0x9177, 0x979A, 0, 0, /* 0x60 */
0, 0, 0, 0, 0x9BA2, 0, 0x9BA3, 0x93D4, /* 0x60 */
0, 0x8E52, 0, 0, 0, 0, 0x9BA5, 0, /* 0x70 */
0, 0x9BA6, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0x9BA7, 0, 0, 0, /* 0x80 */
0x8AF2, 0x9BA8, 0, 0, 0x9BA9, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0x89AA, 0, 0, 0, 0, 0xFAAC, 0, /* 0xA0 */
0x915A, 0x8AE2, 0, 0x9BAB, 0x96A6, 0, 0, 0, /* 0xA0 */
0, 0x91D0, 0, 0x8A78, 0, 0, 0x9BAD, 0x9BAF, /* 0xB0 */
0x8ADD, 0, 0xFAAD, 0x9BAC, 0x9BAE, 0, 0x9BB1, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0x9BB0, 0, 0x9BB2, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0x9BB3, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0x93BB, 0x8BAC, 0, 0, 0, 0, 0, 0, /* 0xE0 */
0x89E3, 0x9BB4, 0x9BB9, 0, 0, 0x9BB7, 0, 0x95F5, /* 0xE0 */
0x95F4, 0, 0, 0, 0, 0xFAAE, 0x9387, 0, /* 0xF0 */
0, 0, 0x9BB6, 0x8F73, 0, 0x9BB5 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_5D[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x9092, /* 0x00 */
0, 0, 0, 0x9BBA, 0, 0, 0x8DE8, 0, /* 0x00 */
0, 0x9BC0, 0, 0, 0x9BC1, 0x9BBB, 0x8A52, 0x9BBC, /* 0x10 */
0x9BC5, 0x9BC4, 0x9BC3, 0x9BBF, 0, 0, 0, 0x9BBE, /* 0x10 */
0, 0, 0x9BC2, 0, 0, 0, 0, 0xFAAF, /* 0x20 */
0, 0x95F6, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0xFAB2, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0x9BC9, 0x9BC6, 0, 0x9BC8, 0, /* 0x40 */
0x9792, 0, 0x9BC7, 0xFAB0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0x9BBD, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0x9093, 0, 0, 0x9BCA, 0xFAB3, 0, 0x8DB5, /* 0x60 */
0, 0, 0, 0x9BCB, 0, 0, 0x9BCC, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0x9BCF, 0, 0x9BCE, 0, 0, 0x9BCD, /* 0x80 */
0, 0, 0, 0x9388, 0x9BB8, 0, 0, 0, /* 0x80 */
0x9BD5, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0x9BD1, 0, 0, /* 0x90 */
0, 0, 0x9BD0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0x9BD2, 0, 0x9BD3, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0x9BD6, /* 0xB0 */
0xFAB4, 0xFAB5, 0x97E4, 0, 0x9BD7, 0x9BD4, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0x9BD8, 0, 0, 0x8ADE, 0x9BD9, 0, 0, /* 0xC0 */
0xFAB6, 0, 0x9BDB, 0x9BDA, 0, 0, 0x9BDC, 0, /* 0xD0 */
0, 0, 0, 0x9BDD, 0, 0x90EC, 0x8F42, 0, /* 0xD0 */
0, 0x8F84, 0, 0x9183, 0, 0x8D48, 0x8DB6, 0x8D49, /* 0xE0 */
0x8B90, 0, 0, 0x9BDE, 0, 0, 0x8DB7, 0, /* 0xE0 */
0, 0x8CC8, 0x9BDF, 0x96A4, 0x9462, 0x9BE0, 0, 0x8D4A, /* 0xF0 */
0, 0, 0, 0x8AAA, 0, 0x9246, 0x8BD0 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_5E[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8E73, 0x957A, 0, 0, 0x94BF, 0, /* 0x00 */
0, 0, 0, 0x9BE1, 0x8AF3, 0, 0, 0, /* 0x00 */
0, 0x9BE4, 0, 0, 0, 0, 0x929F, 0, /* 0x10 */
0, 0x9BE3, 0x9BE2, 0x9BE5, 0, 0x92E9, 0, 0, /* 0x10 */
0, 0, 0, 0, 0, 0x9083, 0, 0, /* 0x20 */
0, 0, 0, 0x8E74, 0, 0x90C8, 0, 0x91D1, /* 0x20 */
0x8B41, 0, 0, 0x92A0, 0, 0, 0x9BE6, 0x9BE7, /* 0x30 */
0x8FED, 0, 0, 0, 0, 0x9658, 0, 0, /* 0x30 */
0x9BEA, 0, 0, 0x9BE9, 0x9BE8, 0x959D, 0, 0x9BF1, /* 0x40 */
0, 0, 0, 0, 0x9679, 0, 0x9BEB, 0, /* 0x40 */
0, 0, 0, 0, 0x9BED, 0x968B, 0, 0x9BEC, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0x9BEE, /* 0x50 */
0, 0x94A6, 0x9BEF, 0x95BC, 0x9BF0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0x8AB1, 0x95BD, 0x944E, 0x9BF2, 0x9BF3, 0, /* 0x70 */
0x8D4B, 0x8AB2, 0x9BF4, 0x8CB6, 0x9763, 0x9748, 0x8AF4, 0x9BF6, /* 0x70 */
0, 0x92A1, 0, 0x8D4C, 0x8FAF, 0, 0, 0x94DD, /* 0x80 */
0, 0, 0x8FB0, 0, 0, 0, 0, 0x8F98, /* 0x80 */
0, 0, 0, 0, 0, 0x92EA, 0x95F7, 0x9358, /* 0x90 */
0, 0, 0x8D4D, 0, 0x957B, 0, 0, 0, /* 0x90 */
0x9BF7, 0, 0, 0, 0, 0, 0x9378, 0x8DC0, /* 0xA0 */
0, 0, 0, 0x8CC9, 0, 0x92EB, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0x88C1, 0x8F8E, 0x8D4E, /* 0xB0 */
0x9766, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0x9BF8, 0x9BF9, 0x9470, 0, 0, 0, 0, /* 0xC0 */
0x9BFA, 0x97F5, 0x984C, 0, 0, 0, 0, 0x9BFC, /* 0xC0 */
0x9BFB, 0, 0, 0x8A66, 0, 0, 0x9C40, 0, /* 0xD0 */
0, 0, 0x9C43, 0x9C44, 0, 0x9C42, 0, 0x955F, /* 0xD0 */
0x8FB1, 0x9C46, 0x9C45, 0x9C41, 0, 0, 0, 0, /* 0xE0 */
0x9C47, 0x9C48, 0, 0, 0x9C49, 0, 0, 0, /* 0xE0 */
0x9C4C, 0x9C4A, 0, 0x9C4B, 0x9C4D, 0, 0x8984, 0x92EC, /* 0xF0 */
0x9C4E, 0, 0x8C9A, 0x89F4, 0x9455, 0, 0x9C4F, 0x93F9 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_5F[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x95D9, 0, 0x9C50, 0x984D, 0, 0, 0, /* 0x00 */
0, 0x9C51, 0x95BE, 0x9C54, 0x989F, 0x98AF, 0, 0x8EAE, /* 0x00 */
0x93F3, 0x9C55, 0, 0x8B7C, 0x92A2, 0x88F8, 0x9C56, 0x95A4, /* 0x10 */
0x8D4F, 0, 0, 0x926F, 0, 0, 0, 0x92ED, /* 0x10 */
0, 0xFAB7, 0, 0, 0, 0x96ED, 0x8CB7, 0x8CCA, /* 0x20 */
0, 0x9C57, 0, 0, 0, 0x9C58, 0, 0x9C5E, /* 0x20 */
0, 0x8EE3, 0, 0, 0xFAB8, 0x92A3, 0, 0x8BAD, /* 0x30 */
0x9C59, 0, 0, 0, 0x954A, 0, 0x9265, 0, /* 0x30 */
0, 0x9C5A, 0, 0, 0, 0xFA67, 0, 0, /* 0x40 */
0x9C5B, 0, 0x8BAE, 0, 0x9C5C, 0, 0x9C5D, 0, /* 0x40 */
0, 0x9C5F, 0, 0x9396, 0, 0, 0x9C60, 0x9C61, /* 0x50 */
0, 0x9C62, 0, 0, 0x9C53, 0x9C52, 0, 0, /* 0x50 */
0, 0x9C63, 0x8C60, 0, 0, 0, 0x9546, 0xFAB9, /* 0x60 */
0, 0x8DCA, 0x9556, 0x92A4, 0x956A, 0x9C64, 0, 0, /* 0x60 */
0x8FB2, 0x8965, 0, 0x9C65, 0, 0, 0, 0x9C66, /* 0x70 */
0, 0x96F0, 0, 0, 0x94DE, 0, 0, 0x9C69, /* 0x70 */
0x899D, 0x90AA, 0x9C68, 0x9C67, 0x8C61, 0x91D2, 0, 0x9C6D, /* 0x80 */
0x9C6B, 0, 0x9C6A, 0x97A5, 0x8CE3, 0, 0, 0, /* 0x80 */
0x8F99, 0x9C6C, 0x936B, 0x8F5D, 0, 0, 0, 0x93BE, /* 0x90 */
0x9C70, 0x9C6F, 0, 0, 0, 0, 0x9C6E, 0, /* 0x90 */
0x9C71, 0x8CE4, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0x9C72, 0x959C, 0x8F7A, 0, 0, 0x9C73, 0x94F7, 0, /* 0xA0 */
0, 0, 0, 0x93BF, 0x92A5, 0, 0, 0xFABA, /* 0xB0 */
0, 0x934F, 0, 0, 0x9C74, 0x8B4A, 0, 0, /* 0xB0 */
0, 0, 0, 0x9053, 0, 0x954B, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0x8AF5, 0x9445, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0x9C75, 0x8E75, /* 0xD0 */
0x9659, 0x965A, 0, 0, 0x899E, 0x9C7A, 0xFABB, 0, /* 0xD0 */
0x9289, 0, 0, 0, 0x9C77, 0, 0, 0, /* 0xE0 */
0, 0, 0, 0x89F5, 0, 0, 0, 0, /* 0xE0 */
0x9CAB, 0x9C79, 0, 0, 0, 0x944F, 0, 0, /* 0xF0 */
0x9C78, 0, 0, 0x9C76, 0, 0x8D9A, 0, 0x9C7C /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_60[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
/* 0x00 */
0x9C83, 0x9C89, /* 0x00 */
0x9C81, 0, 0x937B, 0, 0, 0x9C86, 0x957C, 0, /* 0x10 */
0, 0x9C80, 0, 0x9C85, 0x97E5, 0x8E76, 0, 0, /* 0x10 */
0x91D3, 0x9C7D, 0, 0, 0, 0x8B7D, 0x9C88, 0x90AB, /* 0x20 */
0x8985, 0x9C82, 0x89F6, 0x9C87, 0, 0, 0, 0x8BAF, /* 0x20 */
0, 0x9C84, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0x9C8A, 0, 0, 0, 0, 0, /* 0x30 */
0, 0x9C8C, 0x9C96, 0x9C94, 0, 0, 0x9C91, 0, /* 0x40 */
0, 0, 0x9C90, 0x97F6, 0, 0x9C92, 0, 0, /* 0x40 */
0x8BB0, 0, 0x8D50, 0, 0, 0x8F9A, 0, 0, /* 0x50 */
0, 0x9C99, 0x9C8B, 0, 0, 0xFABC, 0, 0x9C8F, /* 0x50 */
0x9C7E, 0, 0x89F8, 0x9C93, 0x9C95, 0x9270, 0, 0, /* 0x60 */
0x8DA6, 0x89B6, 0x9C8D, 0x9C98, 0x9C97, 0x8BB1, 0, 0x91A7, /* 0x60 */
0x8A86, 0, 0, 0, 0, 0x8C62, 0, 0x9C8E, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0x9C9A, 0, 0x9C9D, 0x9C9F, 0xFABD, 0, 0, /* 0x80 */
0, 0x8EBB, 0xFABE, 0x9CA5, 0x92EE, 0x9C9B, 0, 0, /* 0x80 */
0, 0, 0x9CA3, 0, 0x89F7, 0, 0x9CA1, 0x9CA2, /* 0x90 */
0, 0, 0x9C9E, 0x9CA0, 0, 0, 0, 0x8CE5, /* 0x90 */
0x9749, 0, 0, 0x8AB3, 0, 0, 0x8978, 0x9CA4, /* 0xA0 */
0, 0x9459, 0x88AB, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0x94DF, 0x9C7B, 0x9CAA, 0x9CAE, 0x96E3, 0, /* 0xB0 */
0x9CA7, 0, 0, 0, 0x9389, 0x9CAC, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0x8FEE, 0x9CAD, 0x93D5, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0x9866, 0, 0x9CA9, 0, 0xFAC0, 0, 0, /* 0xD0 */
0x9CAF, 0, 0x8D9B, 0, 0x90C9, 0, 0xFABF, 0x88D2, /* 0xD0 */
0x9CA8, 0x9CA6, 0, 0x9179, 0, 0, 0, 0x9C9C, /* 0xE0 */
0x8E53, 0, 0, 0, 0, 0, 0, 0, /* 0xE0 */
0x91C4, 0x9CBB, 0xFAC2, 0x917A, 0x9CB6, 0, 0x9CB3, 0x9CB4, /* 0xF0 */
0, 0x8EE4, 0x9CB7, 0x9CBA /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_61[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x9CB5, 0x8F44, 0, 0x9CB8, 0, 0, 0x9CB2, 0, /* 0x00 */
0x96FA, 0x96F9, 0, 0, 0, 0x9CBC, 0x9CBD, 0x88D3, /* 0x00 */
0, 0xFAC3, 0, 0, 0, 0x9CB1, 0, 0, /* 0x10 */
0, 0, 0x8BF0, 0x88A4, 0, 0, 0, 0x8AB4, /* 0x10 */
0xFAC1, 0x9CB9, 0, 0, 0, 0, 0, 0x9CC1, /* 0x20 */
0x9CC0, 0, 0, 0, 0x9CC5, 0, 0, 0, /* 0x20 */
0xFAC5, 0, 0, 0, 0x9CC6, 0, 0, 0xFAC4, /* 0x30 */
0, 0, 0, 0, 0x9CC4, 0x9CC7, 0x9CBF, 0x9CC3, /* 0x30 */
0, 0, 0x9CC8, 0, 0x9CC9, 0, 0, 0x9CBE, /* 0x40 */
0x8E9C, 0, 0x9CC2, 0x91D4, 0x8D51, 0x9CB0, 0x9054, 0, /* 0x40 */
0, 0, 0, 0x9CD6, 0, 0x95E7, 0, 0, /* 0x50 */
0x9CCC, 0x9CCD, 0x9CCE, 0, 0, 0x9CD5, 0, 0x9CD4, /* 0x50 */
0, 0, 0x969D, 0x8AB5, 0, 0x9CD2, 0, 0x8C64, /* 0x60 */
0x8A53, 0, 0, 0x9CCF, 0, 0, 0x97B6, 0x9CD1, /* 0x60 */
0x88D4, 0x9CD3, 0, 0x9CCA, 0x9CD0, 0x9CD7, 0x8C63, 0x9CCB, /* 0x70 */
0, 0, 0, 0, 0, 0, 0x977C, 0, /* 0x70 */
0, 0, 0x974A, 0, 0, 0, 0, 0x9CDA, /* 0x80 */
0, 0, 0x9CDE, 0, 0, 0, 0x919E, 0, /* 0x80 */
0x97F7, 0x9CDF, 0, 0, 0x9CDC, 0, 0x9CD9, 0, /* 0x90 */
0xFAC6, 0x9CD8, 0x9CDD, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0x95AE, 0, 0, 0x93B2, /* 0xA0 */
0, 0x8C65, 0, 0x9CE0, 0x9CDB, 0, 0x9CE1, 0, /* 0xA0 */
0, 0, 0x8C9B, 0, 0, 0, 0x89AF, 0, /* 0xB0 */
0, 0, 0x9CE9, 0, 0, 0, 0x8AB6, 0, /* 0xB0 */
0, 0, 0, 0x9CE7, 0, 0, 0x9CE8, 0x8DA7, /* 0xC0 */
0x9CE6, 0x9CE4, 0x9CE3, 0x9CEA, 0x9CE2, 0x9CEC, 0, 0, /* 0xC0 */
0x89F9, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0, 0, 0x9CEE, 0, 0, 0x9CED, 0, /* 0xE0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xE0 */
0, 0, 0x92A6, 0, 0x9CF1, 0, 0x9CEF, 0x9CE5, /* 0xF0 */
0x8C9C, 0, 0x9CF0, 0, 0x9CF4, 0x9CF3, 0x9CF5, 0x9CF2 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_62[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x9CF6, 0, 0, 0, 0, 0, 0, 0, /* 0x00 */
0x9CF7, 0x9CF8, 0x95E8, 0, 0x9CFA, 0x9CF9, 0x8F5E, 0, /* 0x00 */
0x90AC, 0x89E4, 0x89FA, 0xFAC7, 0x9CFB, 0, 0x88BD, 0, /* 0x10 */
0, 0, 0x90CA, 0x9CFC, 0, 0xE6C1, 0x9D40, 0x8C81, /* 0x10 */
0, 0x9D41, 0, 0, 0, 0, 0x90ED, 0, /* 0x20 */
0, 0, 0x9D42, 0, 0, 0, 0x9D43, 0x8B59, /* 0x20 */
0x9D44, 0, 0x9D45, 0x9D46, 0x91D5, 0, 0, 0, /* 0x30 */
0x8CCB, 0, 0, 0x96DF, 0, 0, 0, 0x965B, /* 0x30 */
0x8F8A, 0x9D47, 0, 0, 0, 0, 0, 0x90EE, /* 0x40 */
0xE7BB, 0x94E0, 0, 0x8EE8, 0, 0x8DCB, 0x9D48, 0, /* 0x40 */
0, 0, 0, 0x91C5, 0, 0x95A5, 0, 0, /* 0x50 */
0x91EF, 0, 0, 0x9D4B, 0, 0, 0x9D49, 0, /* 0x50 */
0x9D4C, 0, 0, 0x9D4A, 0, 0, 0, 0, /* 0x60 */
0x9D4D, 0, 0, 0, 0, 0, 0x95AF, 0, /* 0x60 */
0, 0x88B5, 0, 0, 0, 0, 0x957D, 0, /* 0x70 */
0, 0x94E1, 0, 0, 0x9D4E, 0, 0x9D51, 0x8FB3, /* 0x70 */
0x8B5A, 0, 0x9D4F, 0x9D56, 0x8FB4, 0, 0, 0, /* 0x80 */
0, 0x9D50, 0x9463, 0, 0, 0, 0, 0, /* 0x80 */
0, 0x977D, 0x9D52, 0x9D53, 0x9D57, 0x938A, 0x9D54, 0x8D52, /* 0x90 */
0x90DC, 0, 0, 0x9D65, 0x94B2, 0, 0x91F0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0xFAC8, 0, /* 0xA0 */
0, 0, 0, 0x94E2, 0x9DAB, 0, 0, 0, /* 0xA0 */
0, 0x95F8, 0, 0, 0, 0x92EF, 0, 0, /* 0xB0 */
0, 0x9695, 0, 0x9D5A, 0x899F, 0x928A, 0, 0, /* 0xB0 */
0, 0, 0x9D63, 0, 0, 0x9253, 0x9D5D, 0x9D64, /* 0xC0 */
0x9D5F, 0x9D66, 0x9D62, 0, 0x9D61, 0x948F, 0, 0x9D5B, /* 0xC0 */
0x89FB, 0x9D59, 0x8B91, 0x91F1, 0x9D55, 0, 0, 0x9D58, /* 0xD0 */
0x8D53, 0x90D9, 0, 0x8FB5, 0x9D60, 0x9471, 0, 0, /* 0xD0 */
0x8B92, 0x8A67, 0, 0, 0, 0, 0, 0, /* 0xE0 */
0, 0, 0, 0, 0x8A87, 0x9040, 0x9D68, 0x9D6D, /* 0xE0 */
0, 0x9D69, 0, 0x8C9D, 0, 0x9D6E, 0x8E41, 0x8D89, /* 0xF0 */
0, 0, 0, 0, 0, 0, 0x8F45, 0x9D5C /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_63[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8E9D, 0x9D6B, 0, 0, 0, 0, 0x8E77, /* 0x00 */
0x9D6C, 0x88C2, 0, 0, 0x9D67, 0, 0, 0, /* 0x00 */
0, 0x92A7, 0, 0, 0, 0, 0, 0, /* 0x10 */
0, 0x8B93, 0, 0, 0, 0, 0, 0x8BB2, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0x9D6A, /* 0x20 */
0x88A5, 0, 0, 0x8DC1, 0, 0, 0, 0x9055, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0x92F0, 0, 0, 0x94D2, 0x9D70, 0x917D, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0x91A8, 0, 0, 0x8E4A, 0x9D71, 0, 0x9D73, /* 0x40 */
0x9D6F, 0, 0, 0, 0, 0x95DF, 0, 0x92BB, /* 0x50 */
0, 0, 0, 0, 0x917B, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0x95F9, /* 0x60 */
0x8ECC, 0x9D80, 0, 0x9D7E, 0, 0, 0x9098, 0, /* 0x60 */
0, 0, 0x8C9E, 0, 0, 0, 0x9D78, 0x8FB7, /* 0x70 */
0, 0, 0x93E6, 0x9450, 0, 0, 0, 0, /* 0x70 */
0x9D76, 0, 0, 0x917C, 0, 0, 0, 0, /* 0x80 */
0x8EF6, 0x9D7B, 0, 0, 0x8FB6, 0, 0x9D75, 0x9D7A, /* 0x80 */
0, 0, 0x9472, 0, 0, 0, 0x9D74, 0, /* 0x90 */
0x8C40, 0, 0, 0x8A7C, 0, 0, 0, 0x9D7C, /* 0x90 */
0x97A9, 0x8DCC, 0x9254, 0x9D79, 0, 0x90DA, 0, 0x8D54, /* 0xA0 */
0x9084, 0x8986, 0x915B, 0x9D77, 0x8B64, 0, 0, 0, /* 0xA0 */
0, 0, 0x8C66, 0, 0x92CD, 0x9D7D, 0, 0, /* 0xB0 */
0, 0, 0, 0x917E, 0, 0, 0x9D81, 0, /* 0xB0 */
0x9D83, 0, 0, 0x91B5, 0x9D89, 0, 0x9D84, 0, /* 0xC0 */
0, 0x9D86, 0, 0, 0, 0, 0, 0x9560, /* 0xC0 */
0x92F1, 0, 0x9D87, 0, 0, 0, 0x974B, 0, /* 0xD0 */
0, 0, 0x9767, 0x8AB7, 0, 0, 0, 0, /* 0xD0 */
0, 0x88AC, 0, 0x9D85, 0, 0, 0, 0, /* 0xE0 */
0, 0x9D82, 0, 0, 0, 0, 0x8AF6, 0, /* 0xE0 */
0, 0, 0, 0, 0x8987, 0xFAC9, 0x9D88, 0, /* 0xF0 */
0, 0, 0x9768 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_64[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x9D8C, 0, /* 0x00 */
0, 0, 0, 0, 0, 0x91B9, 0, 0x9D93, /* 0x00 */
0, 0, 0, 0x9D8D, 0, 0, 0x9D8A, 0x9D91, /* 0x10 */
0, 0, 0, 0, 0x9D72, 0, 0, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0x9D8E, 0, /* 0x20 */
0x9D92, 0, 0, 0, 0x94C0, 0x938B, 0, 0, /* 0x20 */
0, 0, 0, 0, 0x9D8B, 0, 0x9D8F, 0, /* 0x30 */
0, 0, 0x8C67, 0, 0, 0, 0x8DEF, 0, /* 0x30 */
0, 0, 0x90DB, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0x9D97, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0x9345, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0xFACA, 0, 0, 0, 0, 0, 0, 0x9D94, /* 0x60 */
0, 0x9680, 0, 0, 0, 0, 0, 0x9D95, /* 0x60 */
0, 0, 0, 0, 0, 0, 0x9D96, 0, /* 0x70 */
0x96CC, 0, 0x90A0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0x8C82, 0, 0, 0, 0, /* 0x80 */
0x9D9D, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0x8E54, 0x9D9A, 0, 0x9D99, 0, 0, /* 0x90 */
0, 0, 0x9451, 0, 0, 0xFACB, 0x93B3, 0, /* 0x90 */
0, 0, 0, 0, 0x9350, 0x9D9B, 0, 0, /* 0xA0 */
0, 0x9D9C, 0, 0x958F, 0, 0x9464, 0x8E42, 0, /* 0xA0 */
0x90EF, 0, 0x966F, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0x8A68, 0, 0x9DA3, 0x9D9E, 0, 0, 0, /* 0xB0 */
0, 0x9769, 0x9DA5, 0, 0, 0x9DA1, 0, 0x9DA2, /* 0xC0 */
0, 0, 0, 0, 0, 0x9180, 0xFACC, 0, /* 0xC0 */
0, 0, 0x9DA0, 0, 0x9D5E, 0, 0, 0, /* 0xD0 */
0x9DA4, 0, 0x9D9F, 0, 0, 0, 0, 0, /* 0xD0 */
0x9DA9, 0x9DAA, 0x9346, 0x9DAC, 0, 0, 0x8E43, 0x9DA7, /* 0xE0 */
0, 0, 0, 0, 0x8B5B, 0, 0, 0x9DAD, /* 0xE0 */
0, 0x9DA6, 0x9DB1, 0, 0x9DB0, 0, 0x9DAF, 0, /* 0xF0 */
0, 0, 0x9DB2, 0, 0, 0x9DB4, 0x8FEF /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_65[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x9DB3, 0, 0, 0, 0, 0x9DB7, 0, 0, /* 0x00 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */
0x9DB5, 0, 0, 0, 0x9DB6, 0x9D90, 0, 0, /* 0x10 */
0, 0, 0, 0x9DB9, 0x9DB8, 0, 0, 0, /* 0x20 */
0, 0, 0x9D98, 0x9DBA, 0x9DAE, 0, 0, 0x8E78, /* 0x20 */
0, 0, 0, 0, 0x9DBB, 0x9DBC, 0x9DBE, 0x9DBD, /* 0x30 */
0x9DBF, 0x89FC, 0, 0x8D55, 0, 0, 0x95FA, 0x90AD, /* 0x30 */
0, 0, 0, 0, 0, 0x8CCC, 0, 0, /* 0x40 */
0x9DC1, 0, 0, 0, 0, 0x9DC4, 0xFACD, 0x9571, /* 0x40 */
0, 0x8B7E, 0, 0, 0, 0x9DC3, 0x9DC2, 0x9473, /* 0x50 */
0x9DC5, 0x8BB3, 0, 0, 0, 0x9DC7, 0x9DC6, 0, /* 0x50 */
0, 0, 0x8AB8, 0x8E55, 0, 0, 0x93D6, 0, /* 0x60 */
0, 0, 0, 0, 0x8C68, 0, 0, 0, /* 0x60 */
0x9094, 0, 0x9DC8, 0, 0x90AE, 0x9347, 0, 0x957E, /* 0x70 */
0x9DC9, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0x9DCA, 0x9DCB, 0, 0, 0, 0x95B6, /* 0x80 */
0x9B7C, 0x90C4, 0, 0, 0x956B, 0, 0x8DD6, 0, /* 0x80 */
0x94E3, 0x94C1, 0, 0, 0, 0, 0, 0x936C, /* 0x90 */
0, 0x97BF, 0, 0x9DCD, 0x8ECE, 0, 0, 0x9DCE, /* 0x90 */
0, 0x88B4, 0, 0, 0x8BD2, 0x90CB, 0, 0x9580, /* 0xA0 */
0, 0, 0, 0x9DCF, 0x8E61, 0x9266, 0, 0x8E7A, /* 0xA0 */
0x9056, 0, 0, 0, 0, 0, 0, 0x9DD0, /* 0xB0 */
0, 0x95FB, 0, 0, 0x8997, 0x8E7B, 0, 0, /* 0xB0 */
0, 0x9DD3, 0, 0x9DD1, 0x9DD4, 0x97B7, 0x9DD2, 0, /* 0xC0 */
0, 0, 0, 0x90F9, 0x9DD5, 0, 0, 0x91B0, /* 0xC0 */
0, 0, 0x9DD6, 0, 0, 0, 0, 0x8AF8, /* 0xD0 */
0, 0x9DD8, 0, 0x9DD7, 0, 0, 0, 0, /* 0xD0 */
0x9DD9, 0x9DDA, 0x8AF9, 0, 0, 0x93FA, 0x9255, 0x8B8C, /* 0xE0 */
0x8E7C, 0x9181, 0, 0, 0x8F7B, 0x88AE, 0, 0, /* 0xE0 */
0, 0x9DDB, 0, 0, 0, 0, 0, 0, /* 0xF0 */
0, 0, 0x89A0, 0x9DDF /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_66[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xFACE, 0, 0x8D56, 0x9DDE, 0, 0, 0x8DA9, 0x8FB8, /* 0x00 */
0, 0xFAD1, 0x9DDD, 0, 0x8FB9, 0, 0x96BE, 0x8DA8, /* 0x00 */
0, 0, 0, 0x88D5, 0x90CC, 0xFACF, 0, 0, /* 0x10 */
0, 0, 0, 0, 0x9DE4, 0, 0xFAD3, 0x90AF, /* 0x10 */
0x8966, 0, 0, 0, 0xFAD4, 0x8F74, 0, 0x9686, /* 0x20 */
0x8DF0, 0, 0, 0, 0, 0x8FBA, 0xFAD2, 0x90A5, /* 0x20 */
0, 0xFA63, 0, 0, 0x9DE3, 0x9DE1, 0x9DE2, 0, /* 0x30 */
0, 0, 0, 0xFAD0, 0x928B, 0, 0, 0x9E45, /* 0x30 */
0, 0x9DE8, 0x8E9E, 0x8D57, 0x9DE6, 0, 0, 0, /* 0x40 */
0, 0x9DE7, 0, 0x9057, 0, 0, 0, 0x9DE5, /* 0x40 */
0, 0, 0x8E4E, 0, 0, 0, 0, 0xFAD6, /* 0x50 */
0, 0xFAD7, 0, 0, 0, 0x9DEA, 0x9DE9, 0x9DEE, /* 0x50 */
0, 0, 0x9DEF, 0, 0x9DEB, 0xFAD5, 0x8A41, 0x9DEC, /* 0x60 */
0x9DED, 0x94D3, 0, 0, 0, 0, 0x9581, 0x8C69, /* 0x60 */
0x9DF0, 0, 0, 0xFAD9, 0x90B0, 0, 0x8FBB, 0, /* 0x70 */
0, 0, 0x9271, 0, 0, 0, 0, 0, /* 0x70 */
0, 0x8BC5, 0, 0x9DF1, 0x9DF5, 0, 0, 0x89C9, /* 0x80 */
0x9DF2, 0x9DF4, 0, 0, 0, 0, 0x9DF3, 0, /* 0x80 */
0, 0x8F8B, 0, 0, 0, 0, 0x9267, 0x88C3, /* 0x90 */
0x9DF6, 0xFADA, 0, 0, 0, 0x9DF7, 0, 0, /* 0x90 */
0xFADB, 0, 0x92A8, 0, 0, 0, 0x97EF, 0, /* 0xA0 */
0, 0, 0, 0x8E62, 0, 0, 0x95E9, 0, /* 0xA0 */
0, 0, 0xFADC, 0, 0x965C, 0, 0, 0, /* 0xB0 */
0x9E41, 0x9DF9, 0, 0, 0x9DFC, 0, 0x9DFB, 0xFADD, /* 0xB0 */
0, 0x9DF8, 0, 0, 0x9E40, 0, 0, 0x93DC, /* 0xC0 */
0, 0x9DFA, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0x9E42, 0, /* 0xD0 */
0, 0x8F8C, 0x9E43, 0, 0x976A, 0x9498, 0, 0, /* 0xD0 */
0x9E44, 0, 0, 0, 0, 0, 0x9E46, 0, /* 0xE0 */
0, 0x9E47, 0, 0, 0, 0, 0, 0, /* 0xE0 */
0x9E48, 0, 0x8BC8, 0x8967, 0x8D58, 0x9E49, 0, 0x9E4A, /* 0xF0 */
0x8F91, 0x9182, 0xFADE, 0xFA66, 0x99D6, 0x915D, 0x915C, 0x91D6 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_67[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8DC5, 0, 0, 0x98F0, 0, 0, 0, 0, /* 0x00 */
0x8C8E, 0x974C, 0, 0x95FC, 0, 0x959E, 0xFADF, 0x9E4B, /* 0x00 */
0, 0, 0, 0, 0x8DF1, 0x92BD, 0x9E4C, 0x984E, /* 0x10 */
0, 0, 0, 0x965D, 0, 0x92A9, 0x9E4D, 0x8AFA, /* 0x10 */
0, 0, 0, 0, 0, 0, 0x9E4E, 0x9E4F, /* 0x20 */
0x96D8, 0, 0x96A2, 0x9696, 0x967B, 0x8E44, 0x9E51, 0, /* 0x20 */
0, 0x8EE9, 0, 0, 0x9670, 0, 0x9E53, 0x9E56, /* 0x30 */
0x9E55, 0, 0x8AF7, 0, 0, 0x8B80, 0, 0x9E52, /* 0x30 */
0, 0x9E54, 0, 0, 0, 0, 0x9E57, 0, /* 0x40 */
0, 0x9099, 0, 0, 0, 0, 0x979B, 0x88C7, /* 0x40 */
0x8DDE, 0x91BA, 0, 0x8EDB, 0, 0, 0x8FF1, 0, /* 0x50 */
0, 0x9E5A, 0, 0, 0x936D, 0, 0x9E58, 0x91A9, /* 0x50 */
0x9E59, 0x8FF0, 0x96DB, 0x9E5B, 0x9E5C, 0x9788, 0xFAE1, 0, /* 0x60 */
0, 0, 0x9E61, 0, 0, 0x8D59, 0, 0x9474, /* 0x60 */
0x9E5E, 0x938C, 0x9DDC, 0x9DE0, 0, 0x8B6E, 0, 0x9466, /* 0x70 */
0, 0, 0, 0, 0x9E60, 0, 0x8FBC, 0x94C2, /* 0x70 */
0, 0, 0, 0, 0, 0x9E66, 0, 0x94F8, /* 0x80 */
0, 0x9E5D, 0, 0x9E63, 0x9E62, 0, 0, 0, /* 0x80 */
0x90CD, 0, 0, 0, 0, 0x968D, 0, 0x97D1, /* 0x90 */
0, 0, 0x9687, 0, 0x89CA, 0x8E7D, 0, 0, /* 0x90 */
0x9867, 0x9E65, 0x9095, 0, 0, 0, 0x9E64, 0, /* 0xA0 */
0, 0x9E5F, 0, 0, 0, 0, 0, 0x8CCD, /* 0xA0 */
0, 0, 0, 0x9E6B, 0x9E69, 0, 0x89CB, 0x9E67, /* 0xB0 */
0x9E6D, 0x9E73, 0, 0xFAE2, 0, 0, 0, 0, /* 0xB0 */
0xFAE4, 0x91C6, 0, 0, 0x95BF, 0, 0x9E75, 0, /* 0xC0 */
0, 0, 0x9541, 0, 0, 0, 0x9E74, 0x9490, /* 0xC0 */
0x965E, 0x8AB9, 0, 0x90F5, 0x8F5F, 0, 0, 0, /* 0xD0 */
0x92D1, 0, 0x974D, 0, 0, 0x9E70, 0x9E6F, 0, /* 0xD0 */
0, 0, 0x9E71, 0, 0x9E6E, 0, 0, 0x9E76, /* 0xE0 */
0, 0x9E6C, 0, 0, 0x9E6A, 0, 0x9E72, 0x9E68, /* 0xE0 */
0, 0x928C, 0, 0x96F6, 0x8EC4, 0x8DF2, 0, 0, /* 0xF0 */
0, 0, 0, 0x8DB8, 0, 0, 0x968F, 0x8A60 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_68[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xFAE5, 0x92CC, 0x93C8, 0x8968, 0, 0, 0, /* 0x00 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 */
0, 0, 0, 0x90F0, 0, 0, 0x90B2, 0x8C49, /* 0x10 */
0, 0, 0, 0, 0, 0, 0x9E78, 0, /* 0x10 */
0, 0x8D5A, 0x8A9C, 0, 0, 0, 0, 0, /* 0x20 */
0, 0x9E7A, 0x8A94, 0x9E81, 0, 0, 0, 0, /* 0x20 */
0, 0, 0x9E7D, 0, 0x90F1, 0, 0, 0, /* 0x30 */
0x8A6A, 0x8DAA, 0, 0, 0x8A69, 0x8DCD, 0, 0, /* 0x30 */
0x9E7B, 0x8C85, 0x8C6A, 0x938D, 0xFAE6, 0, 0x9E79, 0, /* 0x40 */
0x88C4, 0, 0, 0, 0, 0x9E7C, 0x9E7E, 0, /* 0x40 */
0x8BCB, 0x8C4B, 0xFAE3, 0x8ABA, 0x8B6A, 0, 0, 0, /* 0x50 */
0, 0x9E82, 0, 0, 0x8DF7, 0x9691, 0, 0x8E56, /* 0x50 */
0, 0, 0, 0x9E83, 0, 0, 0, 0x954F, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0x9E8F, 0, 0x89B1, 0x9E84, /* 0x70 */
0, 0, 0, 0, 0, 0, 0x9E95, 0x9E85, /* 0x70 */
0, 0x97C0, 0, 0x9E8C, 0, 0x947E, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0x9E94, 0, 0x9E87, /* 0x80 */
0, 0, 0, 0x88B2, 0x9E89, 0, 0, 0x8D5B, /* 0x90 */
0, 0, 0, 0x9E8B, 0, 0x9E8A, 0, 0x9E86, /* 0x90 */
0x9E91, 0, 0x8FBD, 0, 0, 0, 0x9AEB, 0x8CE6, /* 0xA0 */
0x979C, 0, 0, 0, 0, 0x9E88, 0, 0x92F2, /* 0xA0 */
0x8A42, 0x8DAB, 0, 0x9E80, 0, 0x9E90, 0x8A81, 0, /* 0xB0 */
0, 0x9E8E, 0x9E92, 0, 0x938E, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0x8AFC, 0, 0x9EB0, 0, /* 0xC0 */
0xFA64, 0x96C7, 0x9E97, 0x8AFB, 0, 0x9E9E, 0, 0xFAE7, /* 0xC0 */
0, 0, 0x965F, 0, 0x9E9F, 0x9EA1, 0, 0x9EA5, /* 0xD0 */
0x9E99, 0, 0x9249, 0, 0, 0, 0, 0x938F, /* 0xD0 */
0x9EA9, 0x9E9C, 0, 0x9EA6, 0, 0, 0, 0x9EA0, /* 0xE0 */
0, 0, 0, 0, 0, 0, 0x9058, 0x9EAA, /* 0xE0 */
0, 0, 0x90B1, 0, 0, 0, 0, 0, /* 0xF0 */
0, 0x9EA8, 0x8ABB /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_69[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x986F, 0x9E96, 0, 0, 0x9EA4, 0x88D6, 0, 0, /* 0x00 */
0x9E98, 0, 0, 0x96B8, 0x9E9D, 0x9041, 0x92C5, 0x9E93, /* 0x00 */
0, 0, 0x9EA3, 0, 0, 0, 0, 0, /* 0x10 */
0, 0x909A, 0x9EAD, 0x8A91, 0x8C9F, 0, 0, 0, /* 0x10 */
0, 0x9EAF, 0x9E9A, 0x9EAE, 0, 0x9EA7, 0x9E9B, 0, /* 0x20 */
0x9EAB, 0, 0x9EAC, 0, 0, 0, 0, 0, /* 0x20 */
0x9EBD, 0, 0, 0, 0x93CC, 0, 0x9EA2, 0, /* 0x30 */
0, 0x9EB9, 0, 0, 0, 0x9EBB, 0, 0x92D6, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0x976B, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0x9596, 0x9EB6, 0x91C8, 0, 0, /* 0x50 */
0, 0x9EBC, 0x915E, 0, 0x9EB3, 0x9EC0, 0x9EBF, 0, /* 0x50 */
0x93ED, 0x9EBE, 0x93E8, 0, 0, 0, 0, 0, /* 0x60 */
0xFAE9, 0, 0x9EC2, 0x9EB5, 0, 0x8BC6, 0x9EB8, 0x8F7C, /* 0x60 */
0, 0, 0, 0x9480, 0x9EBA, 0x8BC9, 0, 0x9EB2, /* 0x70 */
0x9EB4, 0x9EB1, 0, 0, 0x984F, 0x8A79, 0x9EB7, 0, /* 0x70 */
0, 0x9EC1, 0x8A54, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0x8DE5, 0, 0, 0, 0x897C, 0, /* 0x80 */
0, 0x9ED2, 0, 0, 0x9850, 0x9ED5, 0, 0, /* 0x90 */
0xFAEB, 0, 0, 0x9059, 0x9ED4, 0, 0, 0, /* 0x90 */
0x9ED3, 0, 0, 0, 0, 0, 0, 0x9ED0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0x9EC4, 0, /* 0xA0 */
0, 0x9EE1, 0x9EC3, 0, 0x9ED6, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0x9ECE, 0, 0, 0x9EC9, 0x9EC6, /* 0xB0 */
0, 0x9EC7, 0, 0x9ECF, 0, 0, 0, 0xEAA0, /* 0xC0 */
0, 0, 0x9ECC, 0x8D5C, 0x92C6, 0x9184, 0x9ECA, 0, /* 0xC0 */
0x9EC5, 0, 0, 0x9EC8, 0, 0, 0, 0, /* 0xD0 */
0x976C, 0x968A, 0, 0, 0, 0x9ECD, 0x9ED7, 0, /* 0xD0 */
0, 0, 0xFAEC, 0, 0, 0, 0, 0x9EDF, /* 0xE0 */
0x9ED8, 0, 0, 0x9EE5, 0, 0x9EE3, 0, 0, /* 0xE0 */
0, 0, 0x9EDE, 0, 0, 0, 0, 0, /* 0xF0 */
0, 0x9EDD, 0, 0x92CE, 0, 0x9185, 0, 0x9EDB /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_6A[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x9ED9, 0, 0, 0x9EE0, 0, 0, /* 0x00 */
0, 0, 0x9EE6, 0x94F3, 0x9EEC, 0, 0, 0, /* 0x00 */
0, 0, 0x9EE7, 0x9EEA, 0x9EE4, 0, 0, 0x9294, /* 0x10 */
0, 0x9557, 0, 0x9EDA, 0, 0, 0x9EE2, 0x8FBE, /* 0x10 */
0, 0x96CD, 0x9EF6, 0x9EE9, 0, 0, 0, 0, /* 0x20 */
0, 0x8CA0, 0x89A1, 0x8A7E, 0, 0, 0x9ED1, 0, /* 0x20 */
0xFAED, 0, 0, 0, 0, 0x8FBF, 0x9EEE, 0, /* 0x30 */
0x9EF5, 0x8EF7, 0x8A92, 0, 0, 0x924D, 0, 0, /* 0x30 */
0, 0, 0, 0, 0x9EEB, 0, 0xFAEF, 0x9EF0, /* 0x40 */
0x9EF4, 0, 0, 0x8BB4, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0x8B6B, 0x9EF2, 0, 0, 0, 0, 0, 0x8B40, /* 0x50 */
0, 0x93C9, 0x9EF1, 0, 0, 0, 0x9EF3, 0, /* 0x60 */
0, 0, 0, 0xFAEE, 0, 0, 0, 0, /* 0x60 */
0, 0, 0x9EED, 0xFAF0, 0, 0, 0, 0, /* 0x70 */
0x9EEF, 0, 0, 0, 0, 0, 0xFAF1, 0x8A80, /* 0x70 */
0x9268, 0, 0, 0, 0x9EFA, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0x9EF8, 0x8CE7, 0, /* 0x80 */
0x9EF7, 0, 0, 0, 0, 0, 0, 0x9F40, /* 0x90 */
0, 0, 0, 0, 0x9E77, 0, 0, 0, /* 0x90 */
0x9EF9, 0, 0x9EFB, 0x9EFC, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0x9F4B, 0, 0x9F47, 0, 0x9E8D, 0, /* 0xA0 */
0, 0, 0, 0x9F46, 0, 0, 0, 0, /* 0xB0 */
0x9F45, 0, 0, 0x9F42, 0, 0, 0, 0, /* 0xB0 */
0, 0x9EE8, 0x9F44, 0x9F43, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0x9F49, 0, 0x9845, 0, 0, 0, 0, /* 0xD0 */
0, 0, 0x9F4C, 0x8BF9, 0, 0, 0x9F48, 0x9F4A, /* 0xD0 */
0, 0, 0xFAF2, 0, 0xFAF3, 0, 0, 0, /* 0xE0 */
0x94A5, 0, 0x9F4D, 0, 0, 0, 0, 0, /* 0xE0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xF0 */
0, 0, 0x9F51, 0x9F4E /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_6B[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x9793, 0x9F4F, 0, 0, /* 0x00 */
0, 0, 0x9EDC, 0, 0, 0, 0, 0, /* 0x00 */
0, 0, 0x9F52, 0, 0, 0, 0x9F53, 0, /* 0x10 */
0, 0, 0, 0, 0, 0x8954, 0, 0x9F55, /* 0x10 */
0x8C87, 0x8E9F, 0, 0x8BD3, 0, 0, 0, 0x89A2, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0x977E, 0, 0, 0, 0, 0x9F57, /* 0x30 */
0x9F56, 0x9F59, 0x8B5C, 0, 0, 0x8BD4, 0x8ABC, 0, /* 0x30 */
0, 0, 0, 0x9F5C, 0, 0, 0, 0x9F5B, /* 0x40 */
0, 0x9F5D, 0, 0, 0x89CC, 0, 0x9256, 0, /* 0x40 */
0x9F5E, 0, 0, 0x8ABD, 0x9F60, 0, 0, 0, /* 0x50 */
0, 0x9F5F, 0, 0x9F61, 0, 0, 0, 0x9F62, /* 0x50 */
0, 0x9F63, 0x8E7E, 0x90B3, 0x8D9F, 0, 0x9590, 0, /* 0x60 */
0, 0x95E0, 0x9863, 0, 0, 0, 0, 0x8E95, /* 0x60 */
0, 0, 0, 0x8DCE, 0x97F0, 0, 0, 0, /* 0x70 */
0x9F64, 0x9F65, 0, 0x8E80, 0, 0, 0, 0x9F66, /* 0x70 */
0x9F67, 0, 0, 0x9F69, 0x9F68, 0, 0x9677, 0, /* 0x80 */
0, 0x8F7D, 0x8EEA, 0x8E63, 0, 0x9F6A, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0x9F6C, 0x9042, 0, /* 0x90 */
0x9F6B, 0, 0, 0, 0, 0, 0x9F6D, 0, /* 0x90 */
0, 0, 0, 0, 0x9F6E, 0, 0, 0, /* 0xA0 */
0, 0, 0x9F6F, 0x9F70, 0, 0, 0, 0x9F71, /* 0xA0 */
0, 0x9F73, 0x9F72, 0x9F74, 0x89A3, 0x9269, 0, 0x9F75, /* 0xB0 */
0, 0, 0x8E45, 0x8A6B, 0x9F76, 0, 0, 0x9361, /* 0xB0 */
0x9ACA, 0, 0, 0, 0, 0x8B42, 0x9F77, 0, /* 0xC0 */
0, 0, 0, 0x9F78, 0, 0x95EA, 0x9688, 0, /* 0xC0 */
0, 0, 0x93C5, 0x9F79, 0x94E4, 0, 0xFAF4, 0, /* 0xD0 */
0x94F9, 0, 0, 0x96D1, 0, 0, 0, 0x9F7A, /* 0xD0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xE0 */
0, 0, 0, 0x9F7C, 0x9F7B, 0, 0, 0x9F7E, /* 0xE0 */
0, 0, 0, 0x9F7D /* 0xF0 */
/* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_6C[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
/* 0x00 */
0x9F81, 0, 0, 0, 0, 0, 0, 0x8E81, /* 0x00 */
0, 0x96AF, 0, 0x9F82, 0x9F83, 0, 0, 0x8B43, /* 0x10 */
0, 0, 0, 0x9F84, 0, 0, 0, 0, /* 0x10 */
0, 0, 0, 0x9F86, 0x9F85, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0x9085, 0, 0, 0x9558, /* 0x30 */
0x8969, 0, 0, 0, 0, 0, 0x94C3, 0xFAF5, /* 0x30 */
0x92F3, 0x8F60, 0x8B81, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0x94C4, 0, /* 0x40 */
0x8EAC, 0, 0, 0, 0, 0x9F88, 0, 0x8ABE, /* 0x50 */
0, 0, 0x8998, 0, 0xFAF6, 0x93F0, 0x9F87, 0x8D5D, /* 0x50 */
0x9272, 0, 0x9F89, 0, 0, 0, 0, 0, /* 0x60 */
0x9F91, 0, 0x9F8A, 0, 0, 0, 0, 0xFAF8, /* 0x60 */
0x91BF, 0, 0x8B82, 0x9F92, 0, 0, 0, 0, /* 0x70 */
0, 0, 0x8C88, 0, 0, 0x8B44, 0x9F90, 0, /* 0x70 */
0, 0x9F8E, 0x9F8B, 0x9780, 0, 0, 0xFAF7, 0, /* 0x80 */
0x92BE, 0, 0, 0, 0x93D7, 0x9F8C, 0, 0, /* 0x80 */
0x9F94, 0, 0x9F93, 0x8C42, 0, 0, 0x89AB, 0, /* 0x90 */
0, 0x8DB9, 0x9F8D, 0x9F8F, 0, 0, 0, 0, /* 0x90 */
0, 0x9676, 0x91F2, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0x9697, 0, 0, 0x9F9C, 0, /* 0xA0 */
0, 0x9F9D, 0, 0x89CD, 0, 0, 0, 0, /* 0xB0 */
0x95A6, 0x96FB, 0x9F9F, 0x8EA1, 0x8FC0, 0x9F98, 0x9F9E, 0x8988, /* 0xB0 */
0, 0x8BB5, 0, 0, 0x9F95, 0x9F9A, 0, 0, /* 0xC0 */
0, 0x90F2, 0x9491, 0, 0x94E5, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0x9F97, 0, 0x9640, 0, 0x9F99, /* 0xD0 */
0, 0x9FA2, 0xFAF9, 0x9FA0, 0, 0x9F9B, 0, 0, /* 0xD0 */
0, 0x9641, 0x9467, 0x8B83, 0, 0x9344, 0, 0, /* 0xE0 */
0x928D, 0, 0x9FA3, 0, 0, 0, 0, 0x9FA1, /* 0xE0 */
0x91D7, 0x9F96, 0, 0x896A /* 0xF0 */
/* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_6D[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xFAFA, 0, 0, 0, /* 0x00 */
0, 0, 0, 0x976D, 0x9FAE, 0, 0, 0, /* 0x00 */
0, 0, 0x9FAD, 0, 0, 0, 0, 0x90F4, /* 0x10 */
0, 0x9FAA, 0, 0x978C, 0, 0, 0x93B4, 0x9FA4, /* 0x10 */
0, 0, 0, 0, 0, 0x92C3, 0, 0, /* 0x20 */
0, 0x896B, 0x8D5E, 0x9FA7, 0, 0, 0, 0, /* 0x20 */
0, 0, 0x8F46, 0x9FAC, 0, 0x9FAB, 0x9FA6, 0, /* 0x30 */
0x9FA9, 0, 0, 0x8A88, 0, 0x9FA8, 0x9468, 0, /* 0x30 */
0, 0x97AC, 0, 0, 0x8FF2, 0x90F3, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0x9FB4, 0x9FB2, 0, 0x956C, 0, 0, 0, /* 0x50 */
0, 0, 0, 0x9FAF, 0x9FB1, 0, 0x8959, 0, /* 0x60 */
0, 0x8D5F, 0x9851, 0, 0x8A5C, 0, 0x9582, 0xFAFC, /* 0x60 */
0, 0, 0, 0, 0x9781, 0, 0, 0x8A43, /* 0x70 */
0x905A, 0x9FB3, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0x9FB8, 0, 0xFAFB, /* 0x80 */
0x8FC1, 0, 0, 0, 0x974F, 0, 0x9FB5, 0, /* 0x80 */
0, 0, 0, 0x9FB0, 0, 0x9FB6, 0xFB40, 0, /* 0x90 */
0, 0x97DC, 0, 0x9393, 0x93C0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0xFB41, 0, 0, 0x8A55, /* 0xA0 */
0, 0, 0x8974, 0, 0, 0x9FBC, 0, 0, /* 0xB0 */
0x9FBF, 0, 0, 0, 0x97C1, 0, 0, 0, /* 0xB0 */
0x9784, 0, 0, 0, 0, 0x9FC6, 0x9FC0, 0x9FBD, /* 0xC0 */
0, 0, 0, 0x97D2, 0x9FC3, 0, 0, 0xFB42, /* 0xC0 */
0, 0x8F69, 0x9FC5, 0, 0, 0x9FCA, 0, 0, /* 0xD0 */
0x9391, 0x9FC8, 0, 0, 0, 0, 0x9FC2, 0, /* 0xD0 */
0, 0x9257, 0, 0, 0x9FC9, 0, 0x9FBE, 0, /* 0xE0 */
0x9FC4, 0, 0x9FCB, 0x88FA, 0x9FC1, 0, 0x9FCC, 0, /* 0xE0 */
0, 0x905B, 0xFB44, 0x8F7E, 0, 0x95A3, 0, 0x8DAC, /* 0xF0 */
0xFB43, 0x9FB9, 0x9FC7, 0x9359, 0xFB45 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_6E[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x90B4, 0, 0x8A89, /* 0x00 */
0x8DCF, 0x8FC2, 0x9FBB, 0x8F61, 0, 0, 0, 0, /* 0x00 */
0, 0, 0, 0x8C6B, 0, 0x9FBA, 0, 0, /* 0x10 */
0, 0x9FD0, 0x8F8D, 0x8CB8, 0, 0x9FDF, 0, 0x9FD9, /* 0x10 */
0x8B94, 0x936E, 0, 0x9FD4, 0x9FDD, 0x88AD, 0x8951, 0xFB48, /* 0x20 */
0, 0x89B7, 0, 0x9FD6, 0x91AA, 0x9FCD, 0x9FCF, 0x8D60, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0x9FE0, 0xFB46, 0x9FDB, 0, 0xFB49, 0, 0x9FD3, 0, /* 0x30 */
0, 0, 0, 0x9FDA, 0, 0, 0, 0, /* 0x40 */
0, 0, 0x96A9, 0, 0, 0x9FD8, 0x9FDC, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0x8CCE, 0, /* 0x50 */
0x8FC3, 0, 0, 0x9258, 0xFB47, 0, 0, 0x9FD2, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0x974E, /* 0x60 */
0, 0, 0, 0x9FD5, 0, 0, 0x9FCE, 0x9392, /* 0x60 */
0, 0, 0x9FD1, 0, 0, 0, 0x9FD7, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0x9870, 0x8EBC, /* 0x70 */
0x969E, 0, 0x9FE1, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0x94AC, 0, 0, 0x9FED, /* 0x80 */
0x8CB9, 0, 0, 0, 0, 0, 0x8F80, 0, /* 0x90 */
0x9FE3, 0, 0, 0, 0x97AD, 0x8D61, 0, 0x9FF0, /* 0x90 */
0, 0, 0x88EC, 0, 0, 0x9FEE, 0, 0, /* 0xA0 */
0, 0, 0x9FE2, 0, 0, 0, 0, 0x9FE8, /* 0xA0 */
0, 0, 0x9FEA, 0, 0, 0, 0x976E, 0x9FE5, /* 0xB0 */
0, 0, 0x934D, 0, 0, 0x9FE7, 0, 0xFB4A, /* 0xB0 */
0, 0, 0x9FEF, 0, 0x9FE9, 0x96C5, 0, 0, /* 0xC0 */
0, 0x9FE4, 0, 0x8EA0, 0x9FFC, 0, 0, 0, /* 0xC0 */
0, 0x8A8A, 0, 0x9FE6, 0x9FEB, 0x9FEC, 0, 0, /* 0xD0 */
0, 0, 0, 0, 0, 0x91EA, 0x91D8, 0, /* 0xD0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xE0 */
0, 0, 0, 0, 0x9FF4, 0, 0, 0x9FFA, /* 0xE0 */
0, 0, 0x9FF8, 0, 0x9348, 0, 0, 0xE042, /* 0xF0 */
0x9FF5, 0, 0, 0, 0, 0, 0x9FF6, 0x9FDE /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_6F[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8B99, 0x9559, 0, 0, 0, 0x8EBD, 0, /* 0x00 */
0, 0x8D97, 0, 0, 0, 0, 0, 0x9852, /* 0x00 */
0, 0x9FF2, 0, 0xE041, 0x8989, 0x9186, 0, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */
0x9499, 0, 0x8ABF, 0x97F8, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0x969F, 0x92D0, 0, 0, 0, /* 0x20 */
0, 0x9FF9, 0x9FFB, 0, 0, 0, 0, 0, /* 0x30 */
0x9151, 0, 0, 0, 0, 0, 0xE040, 0x9FF7, /* 0x30 */
0, 0x9FF1, 0, 0, 0, 0x8AC1, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0x8C89, 0, 0, 0, /* 0x50 */
0xE04E, 0, 0, 0xE049, 0x90F6, 0, 0, 0x8A83, /* 0x50 */
0, 0, 0, 0, 0x8F81, 0, 0xE052, 0, /* 0x60 */
0, 0, 0, 0, 0, 0xE04B, 0x92AA, 0xE048, /* 0x60 */
0x92D7, 0, 0, 0, 0xE06B, 0, 0, 0, /* 0x70 */
0xE045, 0, 0xE044, 0, 0xE04D, 0, 0, 0, /* 0x70 */
0xE047, 0xE046, 0xE04C, 0, 0x909F, 0, 0xE043, 0, /* 0x80 */
0xFB4B, 0, 0, 0, 0, 0, 0xE04F, 0, /* 0x80 */
0, 0xE050, 0, 0, 0, 0, 0, 0x8AC0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0xE055, 0, 0xE054, 0xE056, 0, 0, 0, /* 0xA0 */
0, 0, 0xE059, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0x9362, 0, 0xE053, 0, 0xFB4C, 0, 0, /* 0xB0 */
0, 0xE057, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0x8C83, 0x91F7, 0xE051, 0x945A, 0, 0, 0xE058, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0xE05D, 0xE05B, 0, 0, /* 0xD0 */
0xE05E, 0, 0, 0xE061, 0, 0, 0, 0xE05A, /* 0xD0 */
0x8D8A, 0x9447, 0, 0, 0x9FB7, 0, 0, 0, /* 0xE0 */
0, 0, 0, 0x9794, 0xE05C, 0, 0xE060, 0x91F3, /* 0xE0 */
0, 0xE05F, 0, 0xE04A, 0, 0xFB4D, 0xE889, 0, /* 0xF0 */
0, 0, 0xE064, 0, 0, 0, 0xE068 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_70[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xE066, 0, 0, 0, 0xFB4E, 0, 0xFB4F, /* 0x00 */
0, 0xE062, 0, 0xE063, 0, 0, 0, 0xE067, /* 0x00 */
0, 0xE065, 0, 0, 0, 0x956D, 0, 0, /* 0x10 */
0xE06D, 0, 0xE06A, 0xE069, 0, 0xE06C, 0x93D2, 0xE06E, /* 0x10 */
0, 0, 0, 0, 0, 0, 0x9295, 0x91EB, /* 0x20 */
0xFB50, 0, 0, 0, 0x90A3, 0, 0, 0, /* 0x20 */
0xE06F, 0, 0xE071, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0xE070, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0x9FF3, 0, 0, 0, /* 0x40 */
0, 0xE072, 0, 0, 0, 0, 0, 0, /* 0x50 */
0x93E5, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0xE073, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0x89CE, 0, 0, 0, 0x9394, /* 0x60 */
0x8A44, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0x8B84, 0, 0, 0, 0x8EDC, 0x8DD0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0xFB51, 0, 0, /* 0x80 */
0, 0x9846, 0x9086, 0, 0, 0, 0x898A, 0, /* 0x80 */
0, 0, 0xE075, 0, 0, 0, 0, 0, /* 0x90 */
0, 0xE074, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0xFB52, 0xE078, 0x9259, 0xE07B, 0xE076, /* 0xA0 */
0, 0, 0, 0xE07A, 0, 0, 0, 0, /* 0xB0 */
0xE079, 0x935F, 0x88D7, 0xFA62, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0x97F3, 0, 0, 0xE07D, 0, 0, 0, 0x8947, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0xE080, 0, 0, 0, 0xE07E, 0, 0xE07C, /* 0xD0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xE0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xE0 */
0, 0xE077, 0, 0, 0, 0, 0, 0, /* 0xF0 */
0, 0x9642, 0, 0, 0, 0xE082 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_71[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xFB54, 0, 0, 0, /* 0x00 */
0, 0xE081, 0, 0, 0, 0, 0, 0xFB53, /* 0x00 */
0, 0, 0, 0, 0x898B, 0, 0, 0, /* 0x10 */
0, 0xE084, 0x95B0, 0, 0xE083, 0, 0, 0, /* 0x10 */
0, 0x96B3, 0, 0, 0, 0, 0x8FC5, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0x9152, 0, /* 0x30 */
0, 0, 0, 0, 0x8FC4, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0xFB56, 0xFB57, /* 0x40 */
0, 0x97F9, 0, 0, 0xE08A, 0, 0x90F7, 0, /* 0x40 */
0, 0, 0, 0, 0, 0xE086, 0xE08B, 0, /* 0x50 */
0, 0x898C, 0, 0, 0xFB55, 0, 0, 0, /* 0x50 */
0, 0, 0xE089, 0, 0x9481, 0xE085, 0xE088, 0x8FC6, /* 0x60 */
0, 0x94CF, 0, 0, 0xE08C, 0, 0x8ECF, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0x90F8, 0, 0, /* 0x70 */
0, 0, 0, 0, 0xE08F, 0, 0, 0, /* 0x80 */
0xE087, 0, 0x8C46, 0, 0, 0, 0, 0xE08D, /* 0x80 */
0, 0, 0, 0, 0x976F, 0xE090, 0, 0, /* 0x90 */
0, 0xEAA4, 0, 0, 0, 0, 0, 0x8F6E, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0xE091, 0, 0, 0, 0xE092, 0, 0, 0, /* 0xA0 */
0, 0x944D, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0xE094, 0, 0, 0, 0, 0xE095, 0, /* 0xB0 */
0, 0xFB59, 0, 0x9452, 0, 0, 0, 0, /* 0xC0 */
0x9395, 0xE097, 0, 0, 0, 0, 0xE099, 0, /* 0xC0 */
0x97D3, 0, 0xE096, 0, 0xE098, 0x898D, 0, 0xE093, /* 0xD0 */
0, 0, 0, 0, 0, 0, 0, 0x9A7A, /* 0xD0 */
0xE09A, 0, 0, 0, 0, 0x9187, 0x8E57, 0xE09C, /* 0xE0 */
0, 0, 0, 0, 0xE09B, 0x9043, 0x99D7, 0, /* 0xE0 */
0, 0, 0, 0, 0, 0xE09D, 0, 0, /* 0xF0 */
0, 0xE09F, 0, 0xE08E, 0xE09E, 0, 0xFB5A, 0xE0A0 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_72[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x949A, 0, /* 0x00 */
0, 0, 0, 0, 0, 0xE0A1, 0, 0, /* 0x00 */
0xE0A2, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */
0, 0, 0, 0xE0A3, 0, 0, 0, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0xE0A4, 0, 0x92DC, 0, 0xE0A6, 0xE0A5, 0, 0, /* 0x20 */
0xE0A7, 0, 0xE0A8, 0, 0, 0x8EDD, 0x9583, 0, /* 0x30 */
0, 0, 0x96EA, 0xE0A9, 0xE0AA, 0x9175, 0x8EA2, 0xE0AB, /* 0x30 */
0xE0AC, 0, 0, 0, 0, 0, 0xE0AD, 0x95D0, /* 0x40 */
0x94C5, 0, 0, 0xE0AE, 0x9476, 0, 0, 0, /* 0x40 */
0, 0, 0x92AB, 0, 0, 0, 0, 0, /* 0x50 */
0xE0AF, 0x89E5, 0, 0x8B8D, 0, 0x96C4, 0, 0x96B4, /* 0x50 */
0, 0x89B2, 0x9853, 0, 0, 0, 0, 0x9671, /* 0x60 */
0, 0x95A8, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0x90B5, 0, 0xE0B0, 0, 0, 0, /* 0x70 */
0, 0x93C1, 0, 0, 0, 0x8CA1, 0xE0B1, 0, /* 0x70 */
0x8DD2, 0xE0B3, 0xE0B2, 0, 0, 0, 0, 0xE0B4, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0xE0B5, 0, 0, 0, 0xE0B6, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0x8B5D, 0, 0xE0B7, 0, 0, 0, 0, 0xE0B8, /* 0xA0 */
0, 0, 0, 0, 0x8CA2, 0, 0, 0x94C6, /* 0xA0 */
0, 0xFB5B, 0xE0BA, 0, 0, 0, 0x8FF3, 0, /* 0xB0 */
0, 0xE0B9, 0, 0, 0, 0, 0xFB5C, 0, /* 0xB0 */
0, 0, 0x8BB6, 0xE0BB, 0xE0BD, 0, 0xE0BC, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0xE0BE, 0, /* 0xC0 */
0x8CCF, 0, 0xE0BF, 0, 0, 0, 0, 0x8BE7, /* 0xD0 */
0, 0x915F, 0, 0x8D9D, 0, 0, 0, 0, /* 0xD0 */
0xE0C1, 0xE0C2, 0xE0C0, 0, 0, 0, 0, 0, /* 0xE0 */
0, 0x8EEB, 0, 0, 0x93C6, 0x8BB7, 0, 0, /* 0xE0 */
0, 0, 0, 0, 0, 0, 0, 0xE0C4, /* 0xF0 */
0x924B, 0xE0C3, 0, 0, 0x9854, 0x9482 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_73[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
/* 0x00 */
0xE0C7, 0, 0, 0, 0, 0, /* 0x00 */
0, 0, 0, 0, 0, 0, 0xE0C9, 0xE0C6, /* 0x10 */
0, 0, 0, 0x96D2, 0xE0C8, 0xE0CA, 0, 0x97C2, /* 0x10 */
0, 0, 0, 0, 0xFB5D, 0xE0CE, 0, 0, /* 0x20 */
0, 0xE0CD, 0x9296, 0x944C, 0, 0, 0x8CA3, 0xE0CC, /* 0x20 */
0, 0, 0, 0, 0xE0CB, 0, 0x9750, 0x9751, /* 0x30 */
0, 0, 0, 0, 0, 0, 0xE0CF, 0x898E, /* 0x30 */
0, 0, 0, 0, 0x8D96, 0x8E82, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0xE0D0, 0xE0D1, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0xE0D3, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0x8F62, 0, 0, 0, 0, /* 0x60 */
0xE0D5, 0, 0xE0D4, 0, 0, 0, 0, 0, /* 0x60 */
0xE0D6, 0, 0x8A6C, 0, 0, 0xE0D8, 0, 0xFB5F, /* 0x70 */
0xE0D7, 0, 0xE0DA, 0xE0D9, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0x8CBA, 0, 0, 0x97A6, /* 0x80 */
0, 0x8BCA, 0, 0x89A4, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0x8BE8, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0x8ADF, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0x97E6, 0xE0DC, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0xE0DE, 0, 0xFB60, 0, 0, /* 0xB0 */
0xE0DF, 0, 0x89CF, 0, 0, 0, 0, 0, /* 0xC0 */
0xE0DB, 0xFB61, 0x8E58, 0, 0, 0x92BF, 0xE0DD, 0, /* 0xC0 */
0, 0, 0xFB64, 0, 0, 0, 0xFB62, 0, /* 0xD0 */
0, 0, 0, 0, 0, 0, 0xE0E2, 0, /* 0xD0 */
0x8EEC, 0, 0, 0xFB63, 0, 0xE0E0, 0, 0, /* 0xE0 */
0, 0, 0x8C5D, 0, 0, 0x94C7, 0xE0E1, 0, /* 0xE0 */
0, 0xE0FC, 0, 0, 0, 0xFB66, 0, 0, /* 0xF0 */
0xE0E7, 0, 0, 0, 0, 0, 0x8CBB /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_74[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8B85, 0, 0xE0E4, 0x979D, 0xFB65, /* 0x00 */
0, 0x97AE, 0, 0, 0, 0, 0, 0, /* 0x00 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */
0, 0, 0x91F4, 0, 0, 0xE0E6, 0xFB67, 0, /* 0x20 */
0, 0xFB69, 0xFB68, 0, 0, 0, 0xFB6A, 0, /* 0x20 */
0, 0, 0xE0E8, 0x97D4, 0x8BD5, 0x94FA, 0x9469, 0, /* 0x30 */
0, 0, 0xE0E9, 0, 0, 0, 0, 0xE0EB, /* 0x30 */
0, 0xE0EE, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0xE0EA, 0, 0, /* 0x50 */
0, 0xE0ED, 0x8CE8, 0x896C, 0xE0EF, 0, 0x9090, 0xE0EC, /* 0x50 */
0x97DA, 0, 0xFB6B, 0xE0F2, 0xEAA2, 0, 0, 0, /* 0x60 */
0, 0xE0F0, 0xE0F3, 0, 0, 0, 0, 0xE0E5, /* 0x60 */
0xE0F1, 0, 0, 0x8DBA, 0, 0, 0xE0F4, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0xE0F5, 0, /* 0x70 */
0, 0, 0, 0x979E, 0, 0, 0, 0, /* 0x80 */
0, 0xFB6C, 0, 0xE0F6, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0xE0F7, 0xFB6D, /* 0x90 */
0, 0, 0xE0E3, 0, 0, 0, 0, 0xE0F8, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0x8AC2, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0x8EA3, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0xE0F9, 0, 0, 0, 0, 0xE0FA, /* 0xC0 */
0, 0, 0, 0, 0xE0FB, 0, 0, 0, /* 0xD0 */
0, 0, 0, 0, 0x895A, 0, 0, 0, /* 0xD0 */
0xE140, 0, 0x955A, 0xE141, 0, 0, 0x8AA2, 0xE142, /* 0xE0 */
0, 0xE143, 0, 0, 0, 0, 0xE144, 0, /* 0xE0 */
0xE146, 0xE147, 0xE145, 0, 0, 0, 0x9572, 0xE149, /* 0xF0 */
0xE148 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_75[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xFB6E, 0, 0xE14B, 0xE14A, 0xE14C, 0, 0, /* 0x00 */
0, 0, 0, 0, 0xE14D, 0xE14F, 0xE14E, 0, /* 0x00 */
0, 0x8D99, 0, 0xE151, 0, 0xE150, 0, 0, /* 0x10 */
0x8AC3, 0, 0x9072, 0, 0x935B, 0, 0xE152, 0x90B6, /* 0x10 */
0, 0, 0, 0x8E59, 0, 0x8999, 0xE153, 0, /* 0x20 */
0x9770, 0, 0, 0x95E1, 0xE154, 0, 0, 0xFAA8, /* 0x20 */
0x9363, 0x9752, 0x8D62, 0x905C, 0, 0, 0, 0x926A, /* 0x30 */
0x99B2, 0, 0x92AC, 0x89E6, 0xE155, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0xE156, 0, 0xE15B, 0, /* 0x40 */
0, 0xE159, 0xE158, 0x9DC0, 0x8A45, 0xE157, 0, 0x88D8, /* 0x40 */
0, 0x94A8, 0, 0, 0x94C8, 0, 0, 0, /* 0x50 */
0, 0x97AF, 0xE15C, 0xE15A, 0x927B, 0x90A4, 0, 0, /* 0x50 */
0x94A9, 0, 0x954C, 0, 0xE15E, 0x97AA, 0x8C6C, 0xE15F, /* 0x60 */
0, 0xE15D, 0x94D4, 0xE160, 0, 0xE161, 0, 0xFB6F, /* 0x60 */
0x88D9, 0, 0, 0x8FF4, 0xE166, 0, 0xE163, 0x93EB, /* 0x70 */
0xE162, 0, 0, 0, 0, 0, 0, 0x8B45, /* 0x70 */
0, 0, 0xE169, 0, 0, 0, 0xE164, 0xE165, /* 0x80 */
0, 0xE168, 0xE167, 0x9544, 0, 0, 0x9161, 0x9160, /* 0x80 */
0, 0x8B5E, 0, 0, 0xE16A, 0, 0, 0, /* 0x90 */
0, 0, 0xE16B, 0, 0, 0xE16C, 0, 0, /* 0x90 */
0, 0, 0, 0xE16E, 0, 0xE16D, 0, 0, /* 0xA0 */
0, 0, 0, 0x8975, 0, 0, 0, 0, /* 0xA0 */
0, 0xE176, 0x94E6, 0xE170, 0, 0xE172, 0, 0, /* 0xB0 */
0xE174, 0x905D, 0, 0, 0xE175, 0xE173, 0x8EBE, 0, /* 0xB0 */
0, 0, 0xE16F, 0xE171, 0, 0x9561, 0, 0x8FC7, /* 0xC0 */
0, 0, 0xE178, 0, 0, 0xE177, 0, 0, /* 0xC0 */
0, 0, 0xE179, 0, 0x8EA4, 0x8DAD, 0, 0, /* 0xD0 */
0x9397, 0xE17A, 0, 0x92C9, 0, 0, 0xE17C, 0, /* 0xD0 */
0, 0, 0x979F, 0xE17B, 0, 0, 0, 0, /* 0xE0 */
0, 0x9189, 0, 0, 0, 0, 0, 0, /* 0xE0 */
0xE182, 0, 0xE184, 0xE185, 0x9273, 0, 0, 0, /* 0xF0 */
0, 0, 0xE183, 0, 0xE180, 0, 0xE17D, 0xE17E /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_76[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xE181, 0, 0, 0, 0, 0, 0, /* 0x00 */
0, 0xE188, 0, 0xE186, 0, 0xE187, 0, 0, /* 0x00 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0xE189, /* 0x10 */
0xE18B, 0xE18C, 0xE18D, 0, 0xE18E, 0, 0, 0xE18A, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0xE190, 0, 0, 0, 0xE18F, 0, 0, 0, /* 0x30 */
0, 0, 0, 0xE191, 0, 0, 0, 0, /* 0x30 */
0, 0, 0x97C3, 0, 0, 0, 0xE194, 0xE192, /* 0x40 */
0xE193, 0, 0, 0, 0x8AE0, 0, 0, 0, /* 0x40 */
0, 0, 0x96FC, 0, 0, 0, 0x95C8, 0, /* 0x50 */
0xE196, 0, 0, 0, 0xE195, 0, 0, 0, /* 0x50 */
0, 0xE197, 0xE198, 0, 0, 0, 0, 0xE19C, /* 0x60 */
0xE199, 0xE19A, 0xE19B, 0, 0xE19D, 0, 0, 0, /* 0x60 */
0xE19E, 0, 0xE19F, 0, 0, 0, 0xE1A0, 0, /* 0x70 */
0xE1A1, 0, 0x94AD, 0x936F, 0xE1A2, 0x9492, 0x9553, 0, /* 0x70 */
0xE1A3, 0, 0xFB70, 0xE1A4, 0x9349, 0, 0x8A46, 0x8D63, /* 0x80 */
0xE1A5, 0, 0, 0xE1A6, 0, 0, 0xE1A7, 0, /* 0x80 */
0x8E48, 0, 0, 0xE1A9, 0, 0, 0xE1A8, 0, /* 0x90 */
0, 0xE1AA, 0xE1AB, 0xFB73, 0xFB71, 0, 0xFB72, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0xFB74, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0x94E7, 0, /* 0xA0 */
0xE1AC, 0, 0, 0, 0xE1AD, 0, 0, 0xEA89, /* 0xB0 */
0xE1AE, 0xE1AF, 0xE1B0, 0, 0, 0, 0, 0x8E4D, /* 0xB0 */
0, 0, 0xE1B1, 0x9475, 0, 0, 0x967E, 0, /* 0xC0 */
0x896D, 0, 0x8976, 0, 0, 0xE1B2, 0, 0, /* 0xC0 */
0, 0, 0xE1B4, 0, 0, 0, 0xE1B3, 0x9390, /* 0xD0 */
0, 0, 0, 0x90B7, 0x9F58, 0, 0xE1B5, 0x96BF, /* 0xD0 */
0, 0xE1B6, 0, 0x8AC4, 0x94D5, 0xE1B7, 0, 0xE1B8, /* 0xE0 */
0, 0, 0xE1B9, 0, 0, 0, 0x96DA, 0, /* 0xE0 */
0, 0, 0x96D3, 0, 0x92BC, 0, 0, 0, /* 0xF0 */
0x918A, 0, 0, 0xE1BB, 0, 0, 0x8F82 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_77[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8FC8, 0, 0, 0xE1BE, 0, 0, 0xE1BD, /* 0x00 */
0xE1BC, 0x94FB, 0, 0x8AC5, 0x8CA7, 0, 0, 0, /* 0x00 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */
0, 0, 0, 0xE1C4, 0, 0, 0xE1C1, 0x905E, /* 0x10 */
0x96B0, 0, 0, 0, 0xE1C0, 0xE1C2, 0xE1C3, 0, /* 0x20 */
0, 0xE1BF, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0xE1C5, /* 0x30 */
0xE1C6, 0, 0x92AD, 0, 0x8AE1, 0, 0, 0, /* 0x30 */
0x9285, 0, 0, 0, 0, 0, 0xFB76, 0xE1C7, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0xE1C8, 0xE1CB, 0, 0, 0, 0, /* 0x50 */
0, 0x9087, 0, 0x93C2, 0, 0xE1CC, 0x9672, 0, /* 0x60 */
0xE1C9, 0, 0, 0xE1CA, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0xE1CF, 0, 0, 0, 0, 0xE1CE, 0xE1CD, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0xE1D1, 0, 0, 0xE1D0, 0, /* 0x80 */
0, 0xE1D2, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0xE1D4, 0, /* 0x90 */
0xE1D3, 0, 0, 0, 0, 0x95CB, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0x8F75, 0x97C4, 0, 0, /* 0xA0 */
0xE1D5, 0, 0, 0x93B5, 0, 0, 0xE1D6, 0, /* 0xB0 */
0, 0xE1D7, 0, 0xE1DB, 0xE1D9, 0xE1DA, 0, 0xE1D8, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0xE1DC, /* 0xC0 */
0, 0, 0, 0, 0, 0xE1DD, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0xE1DE, /* 0xD0 */
0, 0, 0xE1DF, 0x96B5, 0xE1E0, 0, 0, 0, /* 0xD0 */
0, 0, 0x96EE, 0xE1E1, 0, 0x926D, 0, 0x948A, /* 0xE0 */
0, 0x8BE9, 0, 0, 0, 0x925A, 0xE1E2, 0x8BB8, /* 0xE0 */
0, 0, 0, 0x90CE, 0, 0, 0, 0, /* 0xF0 */
0, 0, 0, 0, 0xE1E3 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_78[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8DBB, 0, 0, 0, 0, 0, /* 0x00 */
0, 0, 0, 0, 0xE1E4, 0, 0, 0, /* 0x00 */
0, 0, 0xE1E5, 0, 0x8CA4, 0x8DD3, 0, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */
0xE1E7, 0xFB78, 0, 0, 0, 0x9375, 0x8DD4, 0x8B6D, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0x9643, 0, 0x946A, 0, 0, 0, /* 0x30 */
0, 0, 0x9376, 0, 0, 0, 0, 0x8D7B, /* 0x30 */
0, 0, 0, 0, 0, 0xE1E9, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0xFB79, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0x8FC9, 0, 0, /* 0x50 */
0, 0, 0, 0, 0xFB7A, 0, 0, 0, /* 0x60 */
0, 0, 0, 0x97B0, 0x8D64, 0, 0, 0x8CA5, /* 0x60 */
0, 0, 0x94A1, 0, 0xE1EB, 0, 0, 0, /* 0x70 */
0, 0, 0xFB7B, 0, 0xE1ED, 0, 0, 0, /* 0x70 */
0, 0x8CE9, 0, 0, 0, 0, 0xE1EC, 0x92F4, /* 0x80 */
0, 0, 0, 0, 0xE1EF, 0x8A56, 0xE1EA, 0, /* 0x80 */
0, 0x94E8, 0, 0x894F, 0, 0x8DEA, 0, 0x9871, /* 0x90 */
0, 0, 0xE1EE, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0xE1F0, 0, 0, 0, 0x95C9, /* 0xA0 */
0, 0x90D7, 0xE1F2, 0, 0, 0, 0, 0xE1F3, /* 0xA0 */
0, 0, 0, 0, 0, 0xE1F1, 0, 0, /* 0xB0 */
0, 0, 0x8A6D, 0, 0xE1F9, 0, 0xE1F8, 0, /* 0xB0 */
0, 0x8EA5, 0, 0, 0, 0xE1FA, 0xE1F5, 0, /* 0xC0 */
0, 0, 0xE1FB, 0xE1F6, 0, 0, 0, 0, /* 0xC0 */
0x94D6, 0xE1F4, 0, 0, 0xE1F7, 0, 0, 0, /* 0xD0 */
0, 0, 0xE241, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0, 0, 0, 0, 0, 0, 0xE240, /* 0xE0 */
0x9681, 0, 0, 0, 0xE1FC, 0, 0, 0x88E9, /* 0xE0 */
0, 0, 0, 0, 0xE243, 0, 0, 0, /* 0xF0 */
0, 0, 0, 0, 0, 0xE242 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_79[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8FCA, 0, 0, 0, 0, 0, 0xE244, /* 0x00 */
0, 0, 0, 0, 0, 0, 0x9162, 0, /* 0x00 */
0, 0xE246, 0xE245, 0, 0, 0, 0, 0, /* 0x10 */
0, 0xE247, 0, 0, 0, 0, 0, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0xE1E6, 0, /* 0x20 */
0, 0, 0xE1E8, 0xE249, 0xE248, 0, 0, 0, /* 0x20 */
0xFB7C, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0x8EA6, 0, 0x97E7, 0, 0x8ED0, 0, /* 0x30 */
0xE24A, 0x8C56, 0, 0, 0, 0, 0, 0x8B5F, /* 0x40 */
0x8B46, 0x8E83, 0, 0, 0, 0, 0, 0, /* 0x40 */
0x9753, 0, 0, 0xE250, 0, 0xE24F, 0x9163, 0xE24C, /* 0x50 */
0, 0, 0xE24E, 0, 0, 0x8F6A, 0x905F, 0xE24D, /* 0x50 */
0xE24B, 0, 0x9449, 0, 0, 0x8FCB, 0, 0, /* 0x60 */
0x955B, 0, 0, 0, 0, 0x8DD5, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0x9398, /* 0x70 */
0, 0, 0xE251, 0, 0, 0, 0, 0xE252, /* 0x70 */
0xE268, 0x8BD6, 0, 0, 0x985C, 0x9154, 0, 0, /* 0x80 */
0, 0, 0xE253, 0, 0, 0x89D0, 0x92F5, 0x959F, /* 0x80 */
0, 0, 0, 0, 0xFB81, 0, 0, 0, /* 0x90 */
0, 0, 0, 0xFB83, 0, 0xE254, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0x8B9A, 0xE255, /* 0xA0 */
0, 0, 0xE257, 0, 0, 0, 0xE258, 0, /* 0xA0 */
0x9448, 0, 0, 0xE259, 0, 0, 0, 0, /* 0xB0 */
0, 0xE25A, 0xE25B, 0, 0, 0x8BD7, 0x89D1, 0x93C3, /* 0xB0 */
0x8F47, 0x8E84, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0xE25C, 0, 0x8F48, 0, 0, 0, 0, /* 0xC0 */
0, 0x89C8, 0x9562, 0, 0, 0xE25D, 0, 0, /* 0xD0 */
0x94E9, 0, 0, 0, 0, 0, 0, 0x9164, /* 0xD0 */
0, 0xE260, 0, 0xE261, 0x9489, 0, 0x9060, 0xE25E, /* 0xE0 */
0, 0x9281, 0, 0, 0xE25F, 0, 0, 0, /* 0xE0 */
0x8FCC, 0, 0, 0, 0, 0, 0, 0, /* 0xF0 */
0, 0, 0, 0x88DA /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_7A[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8B48, 0, 0, 0, 0, 0, 0, 0, /* 0x00 */
0xE262, 0, 0, 0x92F6, 0, 0xE263, 0x90C5, 0, /* 0x00 */
0, 0, 0, 0, 0x96AB, 0, 0, 0x9542, /* 0x10 */
0xE264, 0xE265, 0x9274, 0, 0x97C5, 0, 0, 0xE267, /* 0x10 */
0xE266, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0x8EED, 0, /* 0x20 */
0, 0xE269, 0x88EE, 0, 0, 0, 0, 0xE26C, /* 0x30 */
0, 0, 0, 0xE26A, 0x89D2, 0x8C6D, 0xE26B, 0x8D65, /* 0x30 */
0x8D92, 0, 0x95E4, 0xE26D, 0, 0, 0x9673, 0, /* 0x40 */
0, 0xE26F, 0, 0, 0, 0x90CF, 0x896E, 0x89B8, /* 0x40 */
0x88AA, 0, 0, 0, 0, 0, 0, 0xE26E, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0xE270, 0xE271, 0x8FF5, 0, 0, 0, 0, /* 0x60 */
0, 0xE272, 0, 0x8A6E, 0, 0, 0, 0, /* 0x60 */
0xE274, 0, 0, 0, 0x8C8A, 0, 0x8B86, 0, /* 0x70 */
0, 0xE275, 0x8BF3, 0, 0, 0xE276, 0, 0x90FA, /* 0x70 */
0, 0x93CB, 0, 0x90DE, 0x8DF3, 0, 0, 0, /* 0x80 */
0xE277, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0x9282, 0x918B, 0, 0xE279, 0xE27B, 0xE278, /* 0x90 */
0xE27A, 0, 0, 0, 0, 0, 0, 0x8C41, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0xE27C, 0x8C45, 0, 0, 0, 0x8B87, 0x9771, /* 0xA0 */
0xE27E, 0, 0, 0, 0, 0, 0xE280, 0, /* 0xB0 */
0, 0, 0x894D, 0, 0, 0, 0, 0xE283, /* 0xB0 */
0, 0, 0, 0x8A96, 0xE282, 0xE281, 0, 0xE285, /* 0xC0 */
0xE27D, 0, 0xE286, 0x97A7, 0, 0xE287, 0, 0xE288, /* 0xC0 */
0, 0xFB84, 0x9AF2, 0xE28A, 0, 0xE289, 0, 0, /* 0xD0 */
0, 0xE28B, 0xE28C, 0, 0x97B3, 0xE28D, 0, 0xE8ED, /* 0xD0 */
0x8FCD, 0xE28E, 0xE28F, 0x8F76, 0, 0x93B6, 0xE290, 0xFB85, /* 0xE0 */
0, 0, 0x9247, 0xFB87, 0, 0xE291, 0, 0x925B, /* 0xE0 */
0xE292, 0, 0, 0, 0, 0, 0x8BA3, 0, /* 0xF0 */
0x995E, 0x927C, 0x8EB1, 0, 0, 0, 0, 0x8AC6 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_7B[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xE293, 0, 0xE2A0, 0, 0xE296, 0, /* 0x00 */
0x8B88, 0, 0xE295, 0xE2A2, 0, 0, 0, 0xE294, /* 0x00 */
0, 0x8FCE, 0, 0, 0, 0, 0, 0, /* 0x10 */
0xE298, 0xE299, 0, 0x934A, 0, 0, 0xE29A, 0, /* 0x10 */
0x8A7D, 0, 0, 0, 0, 0x9079, 0x9584, 0, /* 0x20 */
0xE29C, 0, 0, 0, 0x91E6, 0, 0, 0, /* 0x20 */
0, 0, 0, 0xE297, 0, 0xE29B, 0xE29D, 0, /* 0x30 */
0, 0x8DF9, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0xE2A4, 0x954D, 0, /* 0x40 */
0x94A4, 0x9399, 0, 0x8BD8, 0xE2A3, 0xE2A1, 0, 0x94B3, /* 0x40 */
0xE29E, 0x927D, 0x939B, 0, 0x939A, 0, 0x8DF4, 0, /* 0x50 */
0, 0, 0, 0, 0, 0xE2B6, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0xE2A6, 0, 0xE2A8, /* 0x60 */
0, 0, 0, 0, 0xE2AB, 0, 0xE2AC, 0, /* 0x60 */
0xE2A9, 0xE2AA, 0, 0, 0xE2A7, 0xE2A5, 0, 0, /* 0x70 */
0, 0, 0xE29F, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0x95CD, 0x89D3, /* 0x80 */
0, 0, 0, 0xE2B3, 0, 0xE2B0, 0, 0xE2B5, /* 0x80 */
0, 0, 0xE2B4, 0, 0x9493, 0x96A5, 0, 0x8E5A, /* 0x90 */
0xE2AE, 0xE2B7, 0xE2B2, 0, 0xE2B1, 0xE2AD, 0xFB88, 0xE2AF, /* 0x90 */
0, 0x8AC7, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0x925C, 0, 0, 0x90FB, 0, 0, /* 0xA0 */
0, 0x94A0, 0, 0, 0xE2BC, 0, 0, 0, /* 0xB0 */
0x94A2, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0x90DF, 0xE2B9, 0, 0, 0x94CD, 0, 0xE2BD, 0x95D1, /* 0xC0 */
0, 0x927A, 0, 0xE2B8, 0xE2BA, 0, 0, 0xE2BB, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0, 0, 0, 0, 0xE2BE, 0, 0, /* 0xD0 */
0x8EC2, 0, 0, 0, 0x93C4, 0xE2C3, 0xE2C2, 0, /* 0xE0 */
0, 0xE2BF, 0, 0, 0, 0x9855, 0, 0, /* 0xE0 */
0, 0, 0, 0xE2C8, 0, 0, 0xE2CC, 0xE2C9, /* 0xF0 */
/* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_7C[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xE2C5, 0, 0, 0, 0, 0, 0, 0xE2C6, /* 0x00 */
0, 0, 0, 0, 0, 0xE2CB, 0, 0, /* 0x00 */
0, 0xE2C0, 0x99D3, 0xE2C7, 0xE2C1, 0, 0, 0xE2CA, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0xE2D0, /* 0x10 */
0, 0x8AC8, 0, 0xE2CD, 0, 0, 0, 0xE2CE, /* 0x20 */
0, 0, 0xE2CF, 0xE2D2, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0xE2D1, /* 0x30 */
0x94F4, 0, 0, 0, 0, 0xE2D3, 0x97FA, 0x95EB, /* 0x30 */
0xE2D8, 0, 0, 0xE2D5, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0xE2D4, 0x90D0, 0, 0xE2D7, /* 0x40 */
0xE2D9, 0, 0, 0, 0xE2D6, 0, 0xE2DD, 0, /* 0x50 */
0xE2DA, 0, 0, 0, 0, 0, 0, 0xE2DB, /* 0x50 */
0xE2C4, 0, 0, 0, 0xE2DC, 0xE2DE, 0, 0, /* 0x60 */
0, 0, 0, 0, 0xE2DF, 0, 0, 0, /* 0x60 */
0, 0, 0, 0x95C4, 0, 0xE2E0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0x96E0, 0, /* 0x70 */
0, 0x8BCC, 0x8C48, 0xE2E1, 0, 0, 0, 0, /* 0x80 */
0, 0x95B2, 0, 0x9088, 0, 0x96AE, 0, 0, /* 0x80 */
0xE2E2, 0, 0x97B1, 0, 0, 0x9494, 0, 0x9165, /* 0x90 */
0x9453, 0, 0, 0x8F6C, 0, 0, 0, 0x88BE, /* 0x90 */
0, 0xE2E7, 0xE2E5, 0, 0xE2E3, 0x8A9F, 0, 0x8FCF, /* 0xA0 */
0xE2E8, 0, 0, 0xE2E6, 0, 0xE2E4, 0xE2EC, 0, /* 0xA0 */
0, 0xE2EB, 0xE2EA, 0xE2E9, 0, 0, 0, 0, /* 0xB0 */
0, 0xE2ED, 0, 0, 0, 0xE2EE, 0x90B8, 0, /* 0xB0 */
0xE2EF, 0, 0xE2F1, 0, 0, 0xE2F0, 0, 0, /* 0xC0 */
0, 0, 0x8CD0, 0, 0, 0, 0x9157, 0, /* 0xC0 */
0, 0, 0xE2F3, 0, 0, 0, 0x939C, 0, /* 0xD0 */
0xE2F2, 0, 0, 0, 0xE2F4, 0, 0x95B3, 0x918C, /* 0xD0 */
0x8D66, 0, 0xE2F5, 0, 0, 0, 0, 0x97C6, /* 0xE0 */
0, 0, 0, 0, 0, 0, 0, 0xE2F7, /* 0xE0 */
0, 0, 0xE2F8, 0, 0xE2F9, 0, 0xE2FA, 0, /* 0xF0 */
0x8E85, 0, 0xE2FB, 0x8C6E, 0, 0, 0x8B8A /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_7D[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8B49, 0, 0xE340, 0, 0x96F1, 0x8D67, 0xE2FC, 0, /* 0x00 */
0, 0, 0xE343, 0x96E4, 0, 0x945B, 0, 0, /* 0x00 */
0x9552, 0, 0, 0, 0x8F83, 0xE342, 0, 0x8ED1, /* 0x10 */
0x8D68, 0x8E86, 0x8B89, 0x95B4, 0xE341, 0, 0, 0, /* 0x10 */
0x9166, 0x9661, 0x8DF5, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0x8E87, 0x92DB, 0, 0xE346, 0x97DD, /* 0x20 */
0x8DD7, 0, 0xE347, 0x9061, 0, 0xE349, 0, 0, /* 0x30 */
0, 0x8FD0, 0x8DAE, 0, 0, 0, 0, 0xE348, /* 0x30 */
0, 0, 0x8F49, 0x8CBC, 0x9167, 0xE344, 0xE34A, 0, /* 0x40 */
0xFB8A, 0, 0, 0xE345, 0x8C6F, 0, 0xE34D, 0xE351, /* 0x40 */
0x8C8B, 0, 0, 0, 0, 0, 0xE34C, 0, /* 0x50 */
0, 0, 0, 0xE355, 0xFB8B, 0, 0x8D69, 0, /* 0x50 */
0, 0x978D, 0x88BA, 0xE352, 0, 0, 0x8B8B, 0, /* 0x60 */
0xE34F, 0, 0, 0, 0, 0, 0xE350, 0, /* 0x60 */
0, 0x939D, 0xE34E, 0xE34B, 0, 0x8A47, 0x90E2, 0, /* 0x70 */
0, 0x8CA6, 0, 0, 0, 0xE357, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0xE354, 0, 0, 0, 0, 0, 0xE356, /* 0x80 */
0, 0, 0, 0xE353, 0, 0, 0, 0, /* 0x90 */
0, 0x8C70, 0x91B1, 0xE358, 0x918E, 0, 0, 0xE365, /* 0x90 */
0xFB8D, 0, 0xE361, 0xE35B, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0xE35F, 0x8EF8, 0x88DB, 0xE35A, 0xE362, /* 0xA0 */
0xE366, 0x8D6A, 0x96D4, 0, 0x92D4, 0xE35C, 0, 0xFB8C, /* 0xB0 */
0xE364, 0, 0xE359, 0x925D, 0, 0xE35E, 0x88BB, 0x96C8, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0xE35D, /* 0xC0 */
0, 0, 0x8BD9, 0x94EA, 0, 0, 0, 0x918D, /* 0xC0 */
0, 0x97CE, 0x8F8F, 0, 0, 0xE38E, 0xFB8E, 0, /* 0xD0 */
0xE367, 0, 0x90FC, 0, 0xE363, 0xE368, 0xE36A, 0, /* 0xD0 */
0x92F7, 0xE36D, 0, 0, 0xE369, 0, 0, 0, /* 0xE0 */
0x95D2, 0x8AC9, 0, 0, 0x96C9, 0, 0, 0x88DC, /* 0xE0 */
0, 0, 0xE36C, 0, 0x97FB, 0, 0, 0, /* 0xF0 */
0, 0, 0, 0xE36B /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_7E[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x898F, 0, 0, 0x93EA, 0xE36E, 0, 0, /* 0x00 */
0, 0xE375, 0xE36F, 0xE376, 0, 0, 0, 0, /* 0x00 */
0, 0, 0xE372, 0, 0, 0, 0, 0, /* 0x10 */
0, 0, 0, 0x949B, 0, 0, 0x8EC8, 0xE374, /* 0x10 */
0, 0xE371, 0xE377, 0xE370, 0, 0, 0x8F63, 0, /* 0x20 */
0, 0, 0, 0x9644, 0, 0, 0x8F6B, 0, /* 0x20 */
0, 0xE373, 0xE380, 0, 0, 0xE37B, 0, 0xE37E, /* 0x30 */
0, 0xE37C, 0xE381, 0xE37A, 0, 0xE360, 0x90D1, 0, /* 0x30 */
0, 0x94C9, 0, 0xE37D, 0, 0, 0xE378, 0, /* 0x40 */
0, 0, 0x9140, 0x8C71, 0, 0x8F4A, 0, 0, /* 0x40 */
0, 0, 0xFB8F, 0, 0x9044, 0x9155, 0xE384, 0, /* 0x50 */
0, 0xE386, 0xE387, 0, 0, 0xE383, 0xE385, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0xE379, 0xE382, /* 0x60 */
0, 0xE38A, 0xE389, 0, 0, 0x969A, 0, 0, /* 0x60 */
0x8C4A, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0xE388, 0, 0xE38C, 0xE38B, 0xE38F, 0, 0xE391, /* 0x70 */
0, 0, 0x8E5B, 0xE38D, 0, 0, 0, 0, /* 0x80 */
0xE392, 0xE393, 0xFA5C, 0, 0xE394, 0, 0xE39A, 0x935A, /* 0x80 */
0xE396, 0, 0xE395, 0xE397, 0xE398, 0, 0xE399, 0, /* 0x90 */
0, 0, 0, 0xE39B, 0xE39C /* 0x90 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_7F[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8ACA, 0, /* 0x30 */
0xE39D, 0, 0xE39E, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0xE39F, 0, 0xFB90, /* 0x40 */
0, 0, 0, 0, 0xE3A0, 0xE3A1, 0xE3A2, 0, /* 0x40 */
0xE3A3, 0xE3A4, 0, 0, 0xE3A6, 0xE3A5, 0, 0, /* 0x50 */
0xE3A7, 0, 0, 0, 0, 0, 0, 0xE3A8, /* 0x50 */
0xE3A9, 0, 0, 0, 0, 0, 0, 0xE3AC, /* 0x60 */
0xE3AA, 0xE3AB, 0x8DDF, 0x8C72, 0, 0, 0x9275, 0, /* 0x60 */
0x94B1, 0, 0x8F90, 0, 0, 0x946C, 0, 0x94EB, /* 0x70 */
0xE3AD, 0x9CEB, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0xE3AE, 0xE3B0, 0, 0x9785, 0xE3AF, 0xE3B2, /* 0x80 */
0xE3B1, 0, 0x9772, 0, 0xE3B3, 0, 0x94FC, 0, /* 0x80 */
0, 0, 0, 0, 0xE3B4, 0, 0, 0, /* 0x90 */
0, 0, 0xE3B7, 0, 0, 0xE3B6, 0xE3B5, 0, /* 0x90 */
0, 0xFB91, 0, 0xE3B8, 0x8C51, 0, 0, 0, /* 0xA0 */
0x9141, 0x8B60, 0, 0, 0, 0, 0xE3BC, 0xE3B9, /* 0xA0 */
0, 0, 0xE3BA, 0, 0, 0, 0xE3BD, 0, /* 0xB0 */
0xE3BE, 0xE3BB, 0, 0, 0, 0x8948, 0, 0, /* 0xB0 */
0, 0x89A5, 0, 0, 0, 0xE3C0, 0xE3C1, 0, /* 0xC0 */
0, 0, 0xE3C2, 0, 0x9782, 0, 0, 0, /* 0xC0 */
0, 0, 0x8F4B, 0, 0xE3C4, 0xE3C3, 0, 0, /* 0xD0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0x9089, 0xE3C5, 0, 0, 0, 0, 0xE3C6, 0, /* 0xE0 */
0, 0xE3C7, 0, 0x8AE3, 0, 0, 0, 0, /* 0xE0 */
0x8ACB, 0, 0, 0xE3C8, 0, 0, 0, 0, /* 0xF0 */
0, 0xE3C9, 0, 0x967C, 0x9783 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_80[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x9773, 0x9856, 0, 0x8D6C, 0xE3CC, 0x8ED2, 0xE3CB, 0, /* 0x00 */
0, 0, 0, 0xE3CD, 0x8EA7, 0, 0, 0, /* 0x00 */
0x91CF, 0, 0xE3CE, 0, 0, 0x8D6B, 0, 0x96D5, /* 0x10 */
0xE3CF, 0xE3D0, 0, 0, 0xE3D1, 0, 0, 0, /* 0x10 */
0, 0xE3D2, 0, 0, 0, 0, 0, 0, /* 0x20 */
0xE3D3, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0x8EA8, 0, 0, 0x96EB, 0, /* 0x30 */
0, 0, 0, 0xE3D5, 0, 0x925E, 0, 0xE3D4, /* 0x30 */
0, 0, 0, 0, 0, 0, 0xE3D7, 0, /* 0x40 */
0, 0, 0xE3D6, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0xE3D8, 0, 0, 0, 0x90B9, 0, /* 0x50 */
0xE3D9, 0, 0xE3DA, 0, 0, 0, 0x95B7, 0xE3DB, /* 0x50 */
0, 0x918F, 0xE3DC, 0, 0, 0, 0, 0, /* 0x60 */
0xE3DD, 0, 0, 0, 0, 0, 0, 0x97FC, /* 0x60 */
0xE3E0, 0, 0xE3DF, 0xE3DE, 0x92AE, 0, 0xE3E1, 0x9045, /* 0x70 */
0, 0xE3E2, 0, 0, 0, 0xE3E3, 0x9857, 0xE3E4, /* 0x70 */
0, 0, 0, 0, 0xE3E5, 0xE3E7, 0xE3E6, 0x94A3, /* 0x80 */
0, 0x93F7, 0, 0x985D, 0x94A7, 0, 0, 0, /* 0x80 */
0, 0, 0, 0xE3E9, 0, 0, 0x8FD1, 0, /* 0x90 */
0x9549, 0, 0xE3EA, 0xE3E8, 0, 0x8ACC, 0, 0, /* 0x90 */
0, 0x8CD2, 0x8E88, 0, 0, 0x94EC, 0, 0, /* 0xA0 */
0, 0x8CA8, 0x9662, 0, 0xE3ED, 0xE3EB, 0, 0x8D6D, /* 0xA0 */
0, 0x8D6E, 0x88E7, 0, 0x8DE6, 0, 0, 0, /* 0xB0 */
0, 0, 0x9478, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0x88DD, 0xE3F2, 0, 0x925F, 0, /* 0xC0 */
0, 0, 0, 0, 0x9477, 0, 0x91D9, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0xE3F4, 0, /* 0xD0 */
0, 0xE3F0, 0xE3F3, 0xE3EE, 0, 0xE3F1, 0x9645, 0, /* 0xD0 */
0, 0x8CD3, 0, 0, 0x88FB, 0xE3EF, 0, 0, /* 0xE0 */
0, 0, 0, 0, 0, 0, 0, 0xE3F6, /* 0xE0 */
0, 0xE3F7, 0, 0, 0x93B7, 0, 0, 0, /* 0xF0 */
0x8BB9, 0, 0, 0, 0xE445, 0x945C /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_81[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8E89, 0, 0, 0x8BBA, 0x90C6, 0x9865, /* 0x00 */
0x96AC, 0xE3F5, 0x90D2, 0, 0, 0, 0, 0, /* 0x00 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */
0, 0, 0x8B72, 0xE3F8, 0, 0, 0, 0, /* 0x10 */
0, 0, 0, 0xE3FA, 0, 0, 0, 0, /* 0x20 */
0, 0xE3F9, 0, 0, 0, 0, 0, 0xE3FB, /* 0x20 */
0, 0x9245, 0, 0x945D, 0, 0, 0, 0, /* 0x30 */
0, 0x92AF, 0, 0, 0, 0, 0xE442, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0xE441, 0, /* 0x40 */
0, 0, 0, 0xE3FC, 0, 0, 0x9074, 0, /* 0x40 */
0x9585, 0xE444, 0, 0xE443, 0x8D6F, 0x9872, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0xE454, /* 0x50 */
0, 0, 0, 0, 0, 0xE448, 0xE449, 0, /* 0x60 */
0, 0, 0, 0x8EEE, 0, 0, 0xE447, 0, /* 0x60 */
0x8D98, 0xE446, 0, 0, 0xE44A, 0, 0, 0, /* 0x70 */
0x92B0, 0x95A0, 0x9142, 0, 0, 0, 0, 0x91DA, /* 0x70 */
0xE44E, 0, 0xE44F, 0xE44B, 0, 0, 0, 0, /* 0x80 */
0xE44C, 0, 0xE44D, 0, 0, 0, 0, 0x8D70, /* 0x80 */
0, 0, 0, 0xE455, 0, 0xE451, 0, 0, /* 0x90 */
0, 0, 0x9586, 0, 0x968C, 0x9547, 0, 0, /* 0x90 */
0xE450, 0, 0, 0xE453, 0xE452, 0, 0, 0, /* 0xA0 */
0x9663, 0xE456, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0xE457, 0, 0, 0x9156, 0, 0xE458, 0, 0, /* 0xB0 */
0xE45A, 0, 0xE45E, 0, 0, 0xE45B, 0xE459, 0x945E, /* 0xB0 */
0xE45C, 0, 0xE45D, 0, 0, 0, 0x89B0, 0, /* 0xC0 */
0xE464, 0xE45F, 0, 0, 0, 0xE460, 0, 0, /* 0xC0 */
0, 0xE461, 0, 0x919F, 0, 0, 0, 0, /* 0xD0 */
0xE463, 0xE462, 0xE465, 0, 0, 0, 0, 0xE466, /* 0xD0 */
0xE467, 0, 0, 0x9062, 0, 0x89E7, 0, 0xE468, /* 0xE0 */
0x97D5, 0, 0x8EA9, 0, 0, 0x8F4C, 0, 0, /* 0xE0 */
0, 0, 0, 0x8E8A, 0x9276, 0, 0, 0, /* 0xF0 */
0, 0, 0xE469, 0xE46A, 0x8950, 0, 0xE46B /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_82[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xE46C, 0xE46D, 0, 0, 0xE46E, 0, 0xE46F, /* 0x00 */
0x8BBB, 0x9DA8, 0xE470, 0, 0x90E3, 0xE471, 0x8EC9, 0, /* 0x00 */
0xE472, 0, 0x98AE, 0, 0, 0, 0xE473, 0x95DC, /* 0x10 */
0x8ADA, 0, 0, 0x9143, 0x8F77, 0, 0x9591, 0x8F4D, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0xE474, 0x8D71, 0xE475, 0x94CA, 0, 0xE484, 0, /* 0x20 */
0, 0, 0, 0xE477, 0, 0x91C7, 0x9495, 0x8CBD, /* 0x30 */
0xE476, 0x9144, 0, 0, 0, 0, 0, 0, /* 0x30 */
0xE478, 0, 0, 0, 0, 0, 0, 0x92F8, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0xE47A, 0xE479, 0xE47C, 0, 0, 0xE47B, 0, 0xE47D, /* 0x50 */
0, 0, 0xE480, 0, 0xE47E, 0, 0x8ACD, 0, /* 0x60 */
0xE481, 0, 0xE482, 0xE483, 0, 0, 0x8DAF, 0x97C7, /* 0x60 */
0, 0xE485, 0x9046, 0, 0, 0, 0x8990, 0xE486, /* 0x70 */
0xE487, 0, 0, 0, 0, 0, 0xE488, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0x88F0, 0, 0xE489, 0, 0, /* 0x80 */
0, 0, 0xE48A, 0, 0, 0, 0, 0, /* 0x90 */
0, 0x9587, 0, 0, 0, 0x8EC5, 0, 0xE48C, /* 0x90 */
0, 0, 0, 0, 0, 0x8A48, 0x88B0, 0, /* 0xA0 */
0, 0, 0, 0xE48B, 0xE48E, 0x946D, 0, 0x9063, /* 0xA0 */
0, 0x89D4, 0, 0x9646, 0, 0, 0, 0, /* 0xB0 */
0x8C7C, 0x8BDA, 0, 0xE48D, 0, 0x89E8, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0x8AA1, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0x8991, 0xE492, 0x97E8, 0x91DB, 0, 0, 0x9563, /* 0xD0 */
0, 0xE49E, 0, 0x89D5, 0xE49C, 0, 0xE49A, 0xE491, /* 0xD0 */
0, 0xE48F, 0, 0xE490, 0, 0x8EE1, 0x8BEA, 0x9297, /* 0xE0 */
0, 0, 0, 0x93CF, 0, 0, 0, 0, /* 0xE0 */
0, 0x8970, 0, 0xE494, 0xE493, 0, 0, 0, /* 0xF0 */
0, 0xE499, 0xE495, 0xE498 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_83[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xFB93, 0x96CE, 0xE497, 0x89D6, 0x8A9D, 0xE49B, 0, /* 0x00 */
0, 0xE49D, 0, 0, 0, 0, 0x8C73, 0, /* 0x00 */
0, 0, 0, 0, 0, 0, 0xE4A1, 0xE4AA, /* 0x10 */
0xE4AB, 0, 0, 0, 0x88A9, 0, 0, 0, /* 0x10 */
0, 0, 0, 0xE4B2, 0, 0, 0, 0, /* 0x20 */
0x88EF, 0, 0, 0xE4A9, 0, 0, 0, 0xE4A8, /* 0x20 */
0, 0xE4A3, 0xE4A2, 0, 0xE4A0, 0xE49F, 0x9283, 0, /* 0x30 */
0x91F9, 0xE4A5, 0, 0, 0, 0, 0, 0, /* 0x30 */
0xE4A4, 0, 0, 0, 0, 0xE4A7, 0, 0, /* 0x40 */
0, 0x9190, 0x8C74, 0, 0, 0, 0, 0x8960, /* 0x40 */
0xE4A6, 0, 0x8D72, 0, 0, 0, 0, 0, /* 0x50 */
0x9191, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0xFB94, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0xE4B8, 0, 0xE4B9, 0, 0x89D7, /* 0x70 */
0, 0, 0, 0x89AC, 0xE4B6, 0, 0, 0xFB95, /* 0x70 */
0, 0, 0, 0, 0, 0xE4AC, 0, 0xE4B4, /* 0x80 */
0, 0xE4BB, 0xE4B5, 0, 0, 0, 0xE4B3, 0, /* 0x80 */
0, 0, 0, 0xE496, 0, 0, 0xE4B1, 0, /* 0x90 */
0, 0, 0xE4AD, 0, 0, 0, 0x8ACE, 0xE4AF, /* 0x90 */
0xE4BA, 0, 0xE4B0, 0, 0, 0, 0, 0, /* 0xA0 */
0xE4BC, 0, 0xE4AE, 0x949C, 0, 0, 0, 0, /* 0xA0 */
0, 0x9789, 0, 0, 0, 0xE4B7, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0xE4CD, 0, 0, /* 0xB0 */
0, 0xE4C5, 0, 0, 0, 0x909B, 0, 0xFB96, /* 0xC0 */
0, 0, 0x8B65, 0, 0x8BDB, 0, 0xE4C0, 0, /* 0xC0 */
0, 0, 0, 0x89D9, 0, 0, 0x8FD2, 0, /* 0xD0 */
0xE4C3, 0, 0, 0, 0x8DD8, 0, 0, 0x9370, /* 0xD0 */
0xE4C8, 0, 0, 0, 0, 0, 0, 0, /* 0xE0 */
0, 0x95EC, 0, 0xE4BF, 0, 0, 0, 0x89D8, /* 0xE0 */
0x8CD4, 0x9548, 0xE4C9, 0, 0xE4BD, 0, 0xFB97, 0xE4C6, /* 0xF0 */
0, 0, 0, 0xE4D0, 0, 0xE4C1 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_84[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xE4C2, 0x93B8, 0, 0, 0xE4C7, /* 0x00 */
0, 0, 0, 0xE4C4, 0x9647, 0xE4CA, 0x88DE, 0, /* 0x00 */
0, 0, 0, 0xE4BE, 0, 0, 0, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */
0xE4CC, 0, 0xE4CB, 0, 0, 0, 0, 0, /* 0x20 */
0, 0x948B, 0xE4D2, 0, 0xE4DD, 0, 0, 0, /* 0x20 */
0, 0x8A9E, 0, 0, 0, 0xE4E0, 0, 0, /* 0x30 */
0xE4CE, 0, 0, 0, 0xE4D3, 0x978E, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0xE4DC, 0, /* 0x40 */
0xFB98, 0x9774, 0, 0, 0, 0, 0x97A8, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0x9298, /* 0x50 */
0, 0, 0, 0x8A8B, 0, 0, 0, 0, /* 0x50 */
0, 0x9592, 0xE4E2, 0x939F, 0, 0, 0x88AF, 0, /* 0x60 */
0, 0xE4DB, 0, 0xE4D7, 0x9192, 0xE4D1, 0xE4D9, 0xE4DE, /* 0x60 */
0, 0x944B, 0, 0, 0, 0x88A8, 0, 0xE4D6, /* 0x70 */
0, 0xE4DF, 0x9598, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0xE4DA, 0, 0xE4D5, 0, 0, 0, /* 0x80 */
0, 0, 0, 0x8FD3, 0, 0, 0, 0, /* 0x80 */
0x8F4E, 0, 0, 0, 0x8EAA, 0, 0, 0, /* 0x90 */
0, 0x96D6, 0, 0, 0x9566, 0, 0, 0xE4E5, /* 0x90 */
0, 0xE4EE, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0xE4D8, 0, 0, /* 0xA0 */
0, 0, 0x8A97, 0, 0xFB99, 0, 0, 0, /* 0xB0 */
0x8FF6, 0xE4E3, 0, 0xE4E8, 0x9193, 0, 0, 0xE4E4, /* 0xB0 */
0, 0xE4EB, 0, 0, 0x927E, 0, 0xE4EC, 0, /* 0xC0 */
0, 0x9775, 0xE4E1, 0x8A57, 0, 0xE4E7, 0, 0, /* 0xC0 */
0xE4EA, 0x96AA, 0, 0, 0, 0, 0xE4ED, 0, /* 0xD0 */
0, 0xE4E6, 0xE4E9, 0, 0xFA60, 0, 0, 0, /* 0xD0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xE0 */
0, 0, 0, 0, 0x9648, 0, 0x9840, 0, /* 0xE0 */
0, 0, 0, 0, 0xE4F1, 0, 0, 0, /* 0xF0 */
0, 0, 0, 0, 0xE4F8, 0, 0, 0xE4F0 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_85[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8EC1, 0, 0, 0, 0, 0, 0xE4CF, 0, /* 0x00 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 */
0, 0x95CC, 0, 0x96A0, 0xE4F7, 0xE4F6, 0, 0xE4F2, /* 0x10 */
0xE4F3, 0, 0x8955, 0, 0, 0, 0, 0xE4F5, /* 0x10 */
0, 0xE4EF, 0, 0, 0, 0, 0x92D3, 0, /* 0x20 */
0, 0, 0, 0, 0xE4F4, 0x88FC, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0x91A0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0x95C1, 0, 0, /* 0x30 */
0xE4F9, 0xE540, 0, 0x94D7, 0, 0, 0, 0, /* 0x40 */
0xE4FC, 0x8FD4, 0x8EC7, 0xE542, 0, 0, 0x8BBC, 0, /* 0x40 */
0, 0, 0, 0xFB9A, 0, 0xE543, 0, 0x9599, /* 0x50 */
0xE4FB, 0xFB9B, 0xE4D4, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0xE4FA, 0, 0, 0, 0, /* 0x60 */
0x986E, 0x93A0, 0x9593, 0xFB9C, 0, 0xE54A, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0xE550, /* 0x70 */
0, 0, 0, 0, 0, 0, 0xE551, 0, /* 0x70 */
0xE544, 0, 0, 0, 0x9496, 0, 0, 0xE54E, /* 0x80 */
0xE546, 0, 0xE548, 0, 0, 0, 0, 0, /* 0x80 */
0xE552, 0xE547, 0, 0, 0xE54B, 0, 0, 0x8992, /* 0x90 */
0, 0x93E3, 0, 0xE54C, 0xE54F, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0xE545, 0, 0x9145, 0, /* 0xA0 */
0xE549, 0x8E46, 0x9064, 0x8C4F, 0x96F2, 0, 0x96F7, 0x8F92, /* 0xA0 */
0xFB9E, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0xE556, 0xE554, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0x986D, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0xE553, 0, 0, 0, 0x9795, 0, 0xE555, /* 0xC0 */
0xE557, 0, 0, 0, 0, 0xE558, 0, 0, /* 0xD0 */
0, 0, 0, 0, 0xE55B, 0xE559, 0, 0, /* 0xD0 */
0, 0, 0, 0, 0x93A1, 0xE55A, 0, 0, /* 0xE0 */
0, 0x94CB, 0xE54D, 0, 0, 0, 0, 0, /* 0xE0 */
0, 0, 0, 0, 0, 0, 0, 0x8F93, /* 0xF0 */
0, 0xE55C, 0xE561, 0x9194, 0, 0, 0xE560 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_86[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xE541, 0, 0, 0, 0xE562, 0x9168, /* 0x00 */
0, 0, 0xE55D, 0xE55F, 0, 0, 0, 0, /* 0x00 */
0, 0, 0, 0xE55E, 0, 0, 0x9F50, 0x9F41, /* 0x10 */
0, 0, 0xE564, 0, 0, 0, 0, 0, /* 0x10 */
0, 0, 0xE563, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0x9796, 0, 0xE1BA, /* 0x20 */
0xE565, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0xE566, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0xE567, 0x8CD5, 0, /* 0x40 */
0x8B73, 0, 0, 0, 0xE569, 0x997C, 0, 0, /* 0x50 */
0, 0, 0x8B95, 0, 0x97B8, 0, 0x8BF1, 0xE56A, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0xE56B, /* 0x60 */
0, 0, 0, 0x928E, 0, 0, 0, 0, /* 0x60 */
0, 0xE56C, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0x93F8, 0, 0x88B8, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0x89E1, 0xE571, 0xE572, 0, 0, 0, /* 0x80 */
0, 0, 0, 0xE56D, 0, 0x8E5C, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0xE56E, 0x9461, 0, 0, 0, /* 0xA0 */
0, 0xE56F, 0xE570, 0xE57A, 0, 0, 0, 0xE574, /* 0xA0 */
0xE577, 0, 0, 0, 0, 0, 0xE573, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0xE575, 0, 0xE576, 0x8ED6, /* 0xC0 */
0, 0xE578, 0, 0x9260, 0, 0x8C75, 0x8A61, 0, /* 0xC0 */
0, 0, 0, 0, 0xE57B, 0, 0, 0, /* 0xD0 */
0, 0x8A5E, 0, 0xE581, 0, 0, 0xE57C, 0xE580, /* 0xD0 */
0, 0, 0, 0, 0x94B8, 0, 0, 0, /* 0xE0 */
0, 0xE57D, 0, 0, 0xE57E, 0x9567, 0x94D8, 0xE582, /* 0xE0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xF0 */
0x91FB, 0xE58C, 0, 0xE588, 0, 0, 0x89E9 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_87[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xE586, 0, 0x9649, 0xE587, 0, 0, 0xE584, 0, /* 0x00 */
0xE585, 0xE58A, 0xE58D, 0, 0, 0xE58B, 0, 0, /* 0x00 */
0, 0xE589, 0xE583, 0, 0, 0, 0, 0, /* 0x10 */
0x9277, 0, 0xE594, 0, 0x96A8, 0, 0, 0, /* 0x10 */
0, 0, 0, 0, 0, 0xE592, 0, 0, /* 0x20 */
0, 0xE593, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0xE58E, 0, 0, 0xE590, /* 0x30 */
0, 0, 0, 0xE591, 0, 0, 0, 0xE58F, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0x90E4, 0, 0x9858, 0xE598, 0, 0xE599, 0, /* 0x40 */
0, 0, 0, 0xE59F, 0, 0x9049, 0, 0xE59B, /* 0x50 */
0, 0xE59E, 0, 0, 0, 0, 0, 0xE596, /* 0x50 */
0xE595, 0, 0, 0xE5A0, 0, 0, 0x89DA, 0, /* 0x60 */
0xE59C, 0, 0xE5A1, 0, 0, 0, 0xE59D, 0, /* 0x60 */
0, 0, 0, 0, 0xE59A, 0, 0x92B1, 0, /* 0x70 */
0xE597, 0, 0, 0, 0, 0, 0, 0x9488, /* 0x70 */
0, 0, 0xE5A5, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0x975A, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0xE5A4, /* 0x90 */
0, 0, 0xE5A3, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0xE5AC, 0, 0, 0, 0xE5A6, /* 0xA0 */
0, 0, 0, 0xE5AE, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0x9786, 0xE5B1, 0, 0xE5A8, 0, 0, /* 0xB0 */
0xE5A9, 0, 0, 0, 0xE5AD, 0, 0xE5B0, 0xE5AF, /* 0xC0 */
0, 0, 0, 0xE5A7, 0, 0, 0, 0, /* 0xC0 */
0xE5AA, 0, 0xE5BB, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0xE5B4, 0, 0, 0, 0, 0, 0, 0, /* 0xE0 */
0, 0, 0, 0, 0, 0, 0, 0xE5B2, /* 0xE0 */
0, 0, 0xE5B3, 0, 0, 0, 0xE5B8, 0xE5B9, /* 0xF0 */
0, 0x8A49, 0, 0x8B61, 0, 0, 0xE5B7 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_88[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xE5A2, 0, 0xFBA1, /* 0x00 */
0, 0, 0, 0, 0, 0xE5B6, 0xE5BA, 0xE5B5, /* 0x00 */
0, 0xE5BC, 0, 0, 0, 0xE5BE, 0xE5BD, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */
0, 0xE5C0, 0xE5BF, 0xE579, 0, 0, 0, 0xE5C4, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0xE5C1, 0, 0, 0, 0, 0xE5C2, 0, /* 0x30 */
0, 0xE5C3, 0, 0xE5C5, 0, 0, 0, 0, /* 0x30 */
0x8C8C, 0, 0xE5C7, 0, 0xE5C6, 0, 0x8F4F, 0, /* 0x40 */
0, 0, 0, 0, 0x8D73, 0x9FA5, 0, 0, /* 0x40 */
0, 0, 0xE5C8, 0x8F70, 0, 0, 0, 0x8A58, /* 0x50 */
0, 0xE5C9, 0, 0x8971, 0, 0x8FD5, 0xE5CA, 0, /* 0x50 */
0, 0x8D74, 0xE5CB, 0x88DF, 0, 0, 0, 0, /* 0x60 */
0x955C, 0, 0, 0xE5CC, 0, 0, 0, 0, /* 0x60 */
0x908A, 0, 0xE5D3, 0, 0, 0xE5D0, 0, 0x928F, /* 0x70 */
0, 0, 0, 0, 0, 0xE5D1, 0xE5CE, 0x8BDC, /* 0x70 */
0, 0xE5CD, 0xE5D4, 0, 0, 0, 0, 0, /* 0x80 */
0x8C55, 0, 0, 0x91DC, 0, 0xE5DA, 0, 0, /* 0x80 */
0, 0, 0xE5D6, 0, 0, 0, 0x91B3, 0xE5D5, /* 0x90 */
0, 0xE5D8, 0, 0, 0, 0, 0xE5CF, 0, /* 0x90 */
0, 0, 0xE5D9, 0, 0xE5DB, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0x94ED, 0, 0, 0xE5D7, 0, /* 0xA0 */
0xE5DC, 0xE5DE, 0, 0, 0x8CD1, 0xE5D2, 0, 0x88BF, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0xE5DD, /* 0xB0 */
0, 0x8DD9, 0x97F4, 0xE5DF, 0xE5E0, 0x9195, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0x97A0, /* 0xC0 */
0, 0, 0, 0, 0xE5E1, 0x9754, 0, 0, /* 0xD0 */
0xE5E2, 0xE5E3, 0, 0, 0x95E2, 0xE5E4, 0, 0x8DBE, /* 0xD0 */
0, 0x97A1, 0, 0, 0, 0, 0, 0, /* 0xE0 */
0xE5E9, 0, 0, 0, 0, 0, 0, 0, /* 0xE0 */
0, 0, 0xE5EA, 0x8FD6, 0xE5E8, 0xFBA2, 0, 0, /* 0xF0 */
0x9787, 0xE5E5, 0, 0, 0xE5E7, 0x90BB, 0x909E /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_89[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xE5E6, 0, 0xE5EB, 0, 0, 0x95A1, /* 0x00 */
0, 0, 0xE5ED, 0, 0xE5EC, 0, 0, 0, /* 0x00 */
0x8A8C, 0, 0x964A, 0xE5EE, 0, 0, 0, 0, /* 0x10 */
0, 0, 0, 0, 0xFA5D, 0xE5FA, 0xE5F0, 0, /* 0x10 */
0, 0, 0, 0, 0, 0xE5F1, 0, 0, /* 0x20 */
0, 0, 0xE5F2, 0xE5F3, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0xE5F7, 0, /* 0x30 */
0xE5F8, 0, 0, 0xE5F6, 0, 0, 0, 0, /* 0x30 */
0, 0xE5F4, 0, 0xE5EF, 0xE5F5, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0xE5F9, 0xE8B5, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0x89A6, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0xE5FC, 0x8BDD, /* 0x50 */
0xE5FB, 0, 0, 0, 0xE641, 0, 0xE640, 0, /* 0x60 */
0, 0, 0xE643, 0, 0, 0xE642, 0, 0xE644, /* 0x60 */
0, 0, 0x8F50, 0, 0xE645, 0, 0, 0xE646, /* 0x70 */
0, 0, 0, 0, 0, 0, 0xE647, 0x90BC, /* 0x70 */
0, 0x9776, 0, 0xE648, 0, 0, 0x95A2, 0x9465, /* 0x80 */
0xE649, 0, 0xE64A, 0x8CA9, 0, 0, 0, 0x8B4B, /* 0x80 */
0, 0, 0, 0xE64B, 0, 0, 0x8E8B, 0x9460, /* 0x90 */
0xE64C, 0, 0x8A6F, 0, 0, 0, 0, 0, /* 0x90 */
0, 0xE64D, 0, 0, 0, 0, 0xE64F, 0x9797, /* 0xA0 */
0, 0xE64E, 0x9065, 0, 0xE650, 0, 0, 0xE651, /* 0xA0 */
0, 0, 0xE652, 0x8ACF, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0xE653, 0, 0, 0xE654, 0, 0xE655, /* 0xB0 */
0xE656, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0x8A70, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0, 0xE657, 0, 0xE658, 0xE659, 0, 0, /* 0xD0 */
0, 0, 0, 0x89F0, 0, 0, 0x9047, 0xE65A, /* 0xE0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xE0 */
0, 0, 0, 0, 0xE65B, 0, 0, 0, /* 0xF0 */
0xE65C /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_8A[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8CBE, 0, 0x92F9, 0xE65D, 0, 0, 0, 0, /* 0x00 */
0x8C76, 0, 0x9075, 0, 0xE660, 0, 0x93A2, 0, /* 0x00 */
0xE65F, 0, 0xFBA3, 0x8C50, 0, 0, 0xE65E, 0x91F5, /* 0x10 */
0x8B4C, 0, 0, 0xE661, 0, 0xE662, 0, 0x8FD7, /* 0x10 */
0, 0, 0, 0x8C8D, 0, 0xE663, 0, 0, /* 0x20 */
0, 0, 0x964B, 0, 0, 0x90DD, 0, 0, /* 0x20 */
0, 0x8B96, 0, 0x96F3, 0x9169, 0, 0xE664, 0xFBA4, /* 0x30 */
0, 0, 0x9066, 0x9290, 0x8FD8, 0, 0, 0, /* 0x30 */
0, 0xE665, 0, 0, 0, 0, 0xE668, 0, /* 0x40 */
0xE669, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0x8DBC, 0x91C0, 0xE667, 0, 0x8FD9, 0x955D, 0, 0, /* 0x50 */
0, 0, 0, 0xE666, 0, 0, 0x8E8C, 0, /* 0x50 */
0x8972, 0, 0xE66D, 0x8C77, 0, 0, 0x8E8E, 0, /* 0x60 */
0, 0x8E8D, 0, 0x986C, 0xE66C, 0xE66B, 0x9146, 0, /* 0x60 */
0x8B6C, 0x9862, 0x8A59, 0x8FDA, 0, 0, 0, 0, /* 0x70 */
0, 0xFBA5, 0, 0, 0xE66A, 0, 0, 0, /* 0x70 */
0, 0, 0xE66F, 0, 0xE670, 0xE66E, 0, 0x8CD6, /* 0x80 */
0, 0x975F, 0, 0, 0x8E8F, 0x9446, 0, 0, /* 0x80 */
0, 0xE673, 0, 0x90BE, 0, 0x9261, 0, 0, /* 0x90 */
0x9755, 0, 0xE676, 0, 0, 0, 0x8CEA, 0, /* 0x90 */
0x90BD, 0xE672, 0, 0xE677, 0x8CEB, 0xE674, 0xE675, 0xFBA6, /* 0xA0 */
0xE671, 0, 0, 0, 0x90E0, 0x93C7, 0, 0, /* 0xA0 */
0x924E, 0, 0x89DB, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0x94EE, 0, 0, 0x8B62, 0, 0xFBA7, 0x92B2, /* 0xB0 */
0, 0, 0xE67A, 0, 0xE678, 0, 0, 0x926B, /* 0xC0 */
0, 0, 0, 0x90BF, 0x8AD0, 0xE679, 0, 0x907A, /* 0xC0 */
0, 0, 0x97C8, 0, 0, 0, 0x985F, 0, /* 0xD0 */
0, 0, 0xE67B, 0xE687, 0x92B3, 0, 0xE686, 0xFBA8, /* 0xD0 */
0xE683, 0xE68B, 0xE684, 0, 0xE680, 0, 0x92FA, 0xE67E, /* 0xE0 */
0, 0, 0, 0xE67C, 0, 0x9740, 0x8E90, 0, /* 0xE0 */
0, 0xE681, 0, 0xE67D, 0, 0, 0xFBAA, 0xE685, /* 0xF0 */
0x8F94, 0, 0x8CBF, 0, 0, 0, 0x91F8 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_8B[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x9664, 0x8979, 0x88E0, 0, 0x93A3, 0, 0, 0xE689, /* 0x00 */
0, 0, 0, 0, 0xE688, 0, 0x93E4, 0, /* 0x00 */
0xE68D, 0, 0, 0, 0xE682, 0, 0xE68C, 0xE68E, /* 0x10 */
0, 0x8CAA, 0xE68A, 0x8D75, 0, 0x8ED3, 0, 0, /* 0x10 */
0xE68F, 0x9777, 0, 0, 0, 0, 0xE692, 0, /* 0x20 */
0xE695, 0, 0, 0xE693, 0x9554, 0, 0, 0, /* 0x20 */
0, 0, 0, 0xE690, 0, 0, 0, 0, /* 0x30 */
0, 0x8BDE, 0, 0, 0, 0, 0xE694, 0, /* 0x30 */
0, 0xE696, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0xE69A, 0, 0, 0xE697, 0, 0xE699, 0xE698, /* 0x40 */
0, 0, 0, 0xFBAB, 0, 0, 0xE69B, 0, /* 0x50 */
0x8EAF, 0, 0xE69D, 0xE69C, 0x9588, 0, 0, 0xE69F, /* 0x50 */
0, 0, 0, 0, 0, 0, 0x8C78, 0, /* 0x60 */
0, 0, 0, 0xE69E, 0xE6A0, 0, 0, 0xE6A1, /* 0x60 */
0x8B63, 0xE3BF, 0x8FF7, 0, 0xE6A2, 0, 0, 0x8CEC, /* 0x70 */
0, 0, 0, 0, 0, 0xE6A3, 0, 0xFBAC, /* 0x70 */
0xE6A4, 0, 0, 0x8E5D, 0, 0, 0, 0, /* 0x80 */
0, 0, 0x9DCC, 0, 0xE6A5, 0, 0xE6A6, 0, /* 0x80 */
0x8F51, 0, 0xE6A7, 0xE6A8, 0, 0, 0xE6A9, 0, /* 0x90 */
0, 0xE6AA, 0xE6AB /* 0x90 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_8C[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x924A, /* 0x30 */
0, 0, 0xE6AC, 0, 0, 0, 0, 0xE6AE, /* 0x30 */
0, 0xE6AD, 0, 0, 0, 0, 0x93A4, 0, /* 0x40 */
0xE6AF, 0, 0x964C, 0, 0xE6B0, 0, 0xE6B1, 0, /* 0x40 */
0xE6B2, 0, 0, 0, 0, 0xE6B3, 0, 0, /* 0x50 */
0, 0, 0x93D8, 0, 0, 0, 0, 0, /* 0x50 */
0, 0x8FDB, 0xE6B4, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0x8D8B, 0x98AC, 0xE6B5, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0xE6B6, 0x955E, 0xE6B7, 0, 0xE6BF, 0, 0, 0, /* 0x70 */
0, 0, 0xE6B8, 0, 0, 0xE6BA, 0, 0, /* 0x80 */
0, 0xE6B9, 0xE6BB, 0, 0x9665, 0xE6BC, 0xE6BD, 0, /* 0x80 */
0, 0, 0, 0, 0xE6BE, 0, 0, 0, /* 0x90 */
0xE6C0, 0, 0, 0, 0, 0x8A4C, 0x92E5, 0, /* 0x90 */
0x9589, 0x8DE0, 0x8D76, 0, 0, 0, 0, 0x956E, /* 0xA0 */
0x89DD, 0x94CC, 0xE6C3, 0x8AD1, 0x90D3, 0xE6C2, 0xE6C7, 0x9299, /* 0xA0 */
0x96E1, 0, 0xE6C5, 0xE6C6, 0x8B4D, 0, 0xE6C8, 0x9483, /* 0xB0 */
0x91DD, 0, 0, 0x94EF, 0x935C, 0xE6C4, 0, 0x9666, /* 0xB0 */
0x89EA, 0xE6CA, 0x9847, 0x92C0, 0x9864, 0, 0, 0x8E91, /* 0xC0 */
0xE6C9, 0, 0x91AF, 0, 0, 0xE6DA, 0x9147, 0, /* 0xC0 */
0, 0x93F6, 0, 0x956F, 0, 0, 0, 0, /* 0xD0 */
0, 0, 0xE6CD, 0x8E5E, 0x8E92, 0, 0x8FDC, 0, /* 0xD0 */
0x9485, 0, 0x8CAB, 0xE6CC, 0xE6CB, 0, 0x958A, 0, /* 0xE0 */
0, 0, 0x8EBF, 0, 0, 0x9371, 0, 0, /* 0xE0 */
0xFBAD, 0, 0, 0, 0xFBAE, 0, 0, 0, /* 0xF0 */
0, 0, 0xE6CF, 0xE6D0, 0x8D77, 0xE6CE /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_8D[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xE6D1, 0xE6D2, 0, 0xE6D4, /* 0x00 */
0x91A1, 0, 0xE6D3, 0x8AE4, 0, 0xE6D6, 0, 0xE6D5, /* 0x00 */
0xE6D7, 0, 0xFBAF, 0xE6D9, 0xE6DB, 0, 0xE6DC, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0x90D4, 0, 0x8ECD, 0xE6DD, /* 0x60 */
0, 0, 0, 0x8A71, 0, 0xE6DE, 0, 0, /* 0x60 */
0x9196, 0xE6DF, 0, 0xE6E0, 0x958B, 0, 0xFBB0, 0x8B4E, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0xE6E1, 0, 0, 0, 0x92B4, 0, 0, /* 0x80 */
0, 0, 0x897A, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0xE6E2, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0x8EEF, 0, 0, 0, 0, /* 0xA0 */
0x9096, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0x91AB, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0xE6E5, 0, 0, 0, 0xE6E4, 0, /* 0xB0 */
0, 0, 0xE6E3, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0xE6EB, 0xE6E9, 0, 0, 0xE6E6, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0xE6E8, 0, /* 0xD0 */
0, 0, 0xE6E7, 0xE6EA, 0, 0x8B97, 0, 0xE6EE, /* 0xD0 */
0, 0x90D5, 0, 0xE6EF, 0, 0, 0, 0, /* 0xE0 */
0x8CD7, 0, 0xE6EC, 0xE6ED, 0, 0, 0, 0x9848, /* 0xE0 */
0, 0, 0, 0x92B5, 0, 0x9148, 0, 0, /* 0xF0 */
0, 0, 0, 0, 0xE6F0, 0, 0, 0xE6F3 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_8E[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
/* 0x00 */
0xE6F1, 0xE6F2, 0x9778, 0, 0, 0, 0, 0x93A5, /* 0x00 */
0xE6F6, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */
0, 0, 0, 0, 0, 0xE6F4, 0xE6F5, 0xE6F7, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0xE748, 0, 0, 0, 0, 0, /* 0x20 */
0xE6FA, 0, 0, 0, 0xE6FB, 0xE6F9, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0xE6F8, 0, 0x92FB, 0, 0, 0xE740, /* 0x40 */
0xE744, 0xE741, 0xE6FC, 0, 0xE742, 0, 0, 0, /* 0x40 */
0xE743, 0, 0, 0, 0, 0xE74A, 0, 0, /* 0x50 */
0, 0xE745, 0, 0, 0, 0, 0, 0x90D6, /* 0x50 */
0xE747, 0, 0, 0xE749, 0xE746, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0xE74C, 0, 0x8F52, 0, 0xE74B, 0, /* 0x70 */
0, 0, 0, 0, 0xE74D, 0, 0, 0, /* 0x70 */
0, 0xE74E, 0, 0, 0xE751, 0xE750, 0, 0xE74F, /* 0x80 */
0, 0, 0xE753, 0xE752, 0, 0x96F4, 0, 0, /* 0x80 */
0, 0xE755, 0, 0xE754, 0xE756, 0, 0, 0, /* 0x90 */
0, 0xE757, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0xE759, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0xE758, 0x9067, 0xE75A, 0, 0, 0x8BEB, /* 0xA0 */
0xE75B, 0xE75D, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0xE75E, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0xE75F, 0xE75C, 0, /* 0xC0 */
0xE760, 0, 0x8ED4, 0xE761, 0x8B4F, 0x8C52, 0, 0xFBB2, /* 0xC0 */
0, 0, 0x8CAC, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0, 0, 0xE762, 0, 0, 0, 0x93EE, /* 0xD0 */
0, 0, 0x935D, 0xE763, 0, 0, 0, 0, /* 0xE0 */
0, 0, 0, 0xE766, 0, 0, 0, 0, /* 0xE0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xF0 */
0x8EB2, 0, 0, 0xE765, 0xE764, 0x8C79, 0xE767 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_8F[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8A72, 0, 0xE769, 0, 0, /* 0x00 */
0, 0x8DDA, 0xE768, 0, 0xE771, 0, 0, 0, /* 0x00 */
0, 0, 0xE76B, 0xE76D, 0x95E3, 0xE76A, 0, 0, /* 0x10 */
0, 0xE76C, 0, 0xE770, 0xE76E, 0x8B50, 0, 0xE76F, /* 0x10 */
0, 0, 0, 0, 0, 0, 0xE772, 0, /* 0x20 */
0, 0x9479, 0x97D6, 0, 0, 0, 0, 0x8F53, /* 0x20 */
0, 0, 0, 0xE773, 0, 0, 0, 0, /* 0x30 */
0x9741, 0xE775, 0, 0xE774, 0, 0, 0xE778, 0x9760, /* 0x30 */
0, 0, 0xE777, 0, 0x8A8D, 0xE776, 0xE77B, 0, /* 0x40 */
0, 0xE77A, 0, 0, 0xE779, 0x9351, 0xE77C, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0xE77D, /* 0x50 */
0, 0, 0, 0, 0xE77E, 0, 0, 0x8D8C, /* 0x50 */
0, 0x8C44, 0xE780, 0xE781, 0xE782, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0x9068, 0xE783, 0, 0x8EAB, 0xE784, /* 0x90 */
0, 0, 0, 0xE785, 0, 0, 0, 0x999F, /* 0xA0 */
0x999E, 0, 0, 0, 0, 0xE786, 0xE390, 0xE787, /* 0xA0 */
0x9243, 0x904A, 0x945F, 0, 0, 0, 0, 0xE788, /* 0xB0 */
0, 0, 0x95D3, 0x92D2, 0x8D9E, 0, 0, 0x9248, /* 0xB0 */
0, 0, 0x8949, 0, 0x9698, 0x9076, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0x8C7D, 0, /* 0xC0 */
0, 0x8BDF, 0, 0, 0x95D4, 0, 0, 0, /* 0xD0 */
0, 0, 0xE789, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0, 0xE78B, 0, 0, 0xE78A, 0x89DE, 0, /* 0xE0 */
0, 0x93F4, 0xE78C, 0x9497, 0, 0x9352, 0, 0xE78D, /* 0xE0 */
0x8F71, 0, 0, 0, 0xE78F, 0, 0, 0x96C0, /* 0xF0 */
0xE79E, 0xE791, 0xE792, 0, 0, 0x92C7 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_90[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x91DE, 0x9197, 0, 0x93A6, 0, 0xE790, 0x8B74, 0, /* 0x00 */
0, 0, 0, 0xE799, 0, 0xE796, 0xE7A3, 0x93A7, /* 0x00 */
0x9280, 0xE793, 0, 0x92FC, 0x9372, 0xE794, 0xE798, 0x9080, /* 0x10 */
0, 0x9487, 0x92CA, 0, 0, 0x90C0, 0xE797, 0x91AC, /* 0x10 */
0x91A2, 0xE795, 0x88A7, 0x9841, 0, 0, 0, 0xE79A, /* 0x20 */
0, 0, 0, 0, 0, 0, 0x91DF, 0, /* 0x20 */
0, 0x8F54, 0x9069, 0, 0, 0xE79C, 0xE79B, 0, /* 0x30 */
0x88ED, 0xE79D, 0, 0, 0x954E, 0, 0xE7A5, 0, /* 0x30 */
0, 0x93D9, 0x908B, 0, 0, 0x9278, 0, 0x8BF6, /* 0x40 */
0, 0xE7A4, 0x9756, 0x895E, 0, 0x95D5, 0x89DF, 0xE79F, /* 0x40 */
0xE7A0, 0xE7A1, 0xE7A2, 0x93B9, 0x9242, 0x88E1, 0xE7A6, 0, /* 0x50 */
0xE7A7, 0xEAA1, 0, 0, 0x91BB, 0, 0xE7A8, 0, /* 0x50 */
0x8993, 0x916B, 0, 0x8CAD, 0, 0x9779, 0, 0xFBB5, /* 0x60 */
0xE7A9, 0x934B, 0, 0, 0, 0x9198, 0x8ED5, 0xE7AA, /* 0x60 */
0, 0, 0xE7AD, 0, 0, 0x8F85, 0xE7AB, 0x914A, /* 0x70 */
0x9149, 0, 0x88E2, 0, 0x97C9, 0xE7AF, 0, 0x94F0, /* 0x70 */
0xE7B1, 0xE7B0, 0xE7AE, 0xE284, 0x8AD2, 0, 0, 0xE78E, /* 0x80 */
0, 0xE7B3, 0xE7B2, 0, 0, 0, 0, 0xE7B4, /* 0x80 */
0, 0x9757, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0x93DF, 0, 0, 0x964D, 0, /* 0xA0 */
0xE7B5, 0, 0x8ED7, 0, 0, 0, 0, 0xE7B6, /* 0xA0 */
0, 0xE7B7, 0, 0, 0, 0xE7B8, 0, 0, /* 0xB0 */
0x9340, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0x88E8, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0x8D78, 0, 0, 0, 0x9859, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0, 0, 0xE7BC, 0, 0, 0xFBB6, 0, /* 0xD0 */
0, 0x8C53, 0xE7B9, 0, 0xE7BA, 0, 0, 0, /* 0xE0 */
0x9594, 0, 0, 0, 0, 0x8A73, 0, 0, /* 0xE0 */
0, 0, 0, 0, 0, 0x9758, 0, 0x8BBD, /* 0xF0 */
0, 0, 0, 0, 0, 0x9373 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_91[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xE7BD, 0, 0, 0, 0, 0, /* 0x00 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 */
0, 0, 0xE7BE, 0, 0, 0xFBB8, 0, 0, /* 0x10 */
0, 0xE7BF, 0, 0, 0, 0, 0, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0xFBB9, /* 0x20 */
0, 0, 0, 0, 0, 0x9341, 0, 0, /* 0x20 */
0xE7C1, 0, 0xE7C0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0x93D1, 0xE7C2, 0x8F55, 0x8EDE, 0x947A, 0x9291, 0, /* 0x40 */
0, 0, 0x8EF0, 0, 0x908C, 0, 0xE7C3, 0, /* 0x50 */
0xE7C4, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0x907C, 0xE7C5, 0, 0xE7C6, 0, 0, /* 0x60 */
0, 0xE7C7, 0x978F, 0, 0x8F56, 0, 0, 0, /* 0x60 */
0, 0, 0xE7C9, 0xE7C8, 0, 0x8D79, 0, 0x8D93, /* 0x70 */
0x8E5F, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0xE7CC, 0, 0, 0, 0, 0x8F86, /* 0x80 */
0, 0xE7CB, 0, 0xE7CA, 0, 0x91E7, 0, 0, /* 0x80 */
0x8CED, 0, 0x90C1, 0, 0, 0, 0, 0x94AE, /* 0x90 */
0, 0, 0, 0, 0x8F58, 0, 0, 0, /* 0x90 */
0, 0, 0xE7CD, 0, 0x8FDD, 0, 0, 0, /* 0xA0 */
0, 0, 0xE7D0, 0xE7CE, 0, 0, 0, 0xE7CF, /* 0xA0 */
0, 0, 0, 0, 0xE7D2, 0xE7D1, 0, 0, /* 0xB0 */
0x8FF8, 0, 0xE7D3, 0, 0, 0, 0, 0, /* 0xB0 */
0xE7D4, 0xE7D5, 0, 0, 0, 0, 0x94CE, 0x8DD1, /* 0xC0 */
0x8EDF, 0xE7D6, 0, 0xE7D7, 0x97A2, 0x8F64, 0x96EC, 0x97CA, /* 0xC0 */
0xE7D8, 0x8BE0, 0, 0, 0, 0, 0xE7D9, 0xFBBB, /* 0xD0 */
0x9342, 0, 0xFBBA, 0xE7DC, 0x8A98, 0x906A, 0xFBBC, 0xE7DA, /* 0xD0 */
0, 0xE7DB, 0, 0x92DE, 0xFBBF, 0xFBC0, 0x9674, 0x8BFA, /* 0xE0 */
0, 0, 0, 0, 0, 0xFBBD, 0xFBBE, 0, /* 0xE0 */
0, 0, 0, 0, 0, 0xE7DE, 0xE7DF, 0, /* 0xF0 */
0, 0, 0, 0, 0xE7DD, 0, 0, 0xE7E1 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_92[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xFBC1, 0, /* 0x00 */
0, 0, 0xFBC3, 0, 0, 0x93DD, 0x8A62, 0, /* 0x00 */
0xFBC2, 0xE7E5, 0, 0, 0xE7E2, 0xE7E4, 0, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0xE7E0, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0xE86E, 0, 0, 0xE7E3, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0x97E9, 0, 0, 0x8CD8, /* 0x30 */
0, 0xFBCA, 0xFBC4, 0, 0xFBC6, 0, 0, 0xE7ED, /* 0x30 */
0xFBC5, 0, 0, 0, 0x9353, 0xE7E8, 0, 0, /* 0x40 */
0xE7EB, 0xE7E9, 0, 0xE7EE, 0, 0, 0xFBC7, 0, /* 0x40 */
0xE7EF, 0xFBC9, 0, 0, 0, 0, 0, 0xE7E7, /* 0x50 */
0, 0xFBC8, 0xE7F4, 0x8994, 0, 0, 0xE7E6, 0, /* 0x50 */
0, 0, 0x94AB, 0, 0xE7EA, 0, 0x8FDE, 0xFBCB, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0x8D7A, 0, 0, 0, 0, 0, 0xFBCD, /* 0x70 */
0xFBCE, 0, 0, 0, 0, 0, 0x9667, 0, /* 0x70 */
0x8BE2, 0, 0, 0x8F65, 0, 0x93BA, 0, 0, /* 0x80 */
0xFA5F, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0x914C, 0, 0xE7F2, 0, 0xE7EC, 0xE7F1, 0, /* 0x90 */
0x96C1, 0, 0x92B6, 0xE7F3, 0xE7F0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0xFBCC, /* 0xA0 */
0, 0, 0, 0, 0, 0x914B, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0xE7F7, /* 0xB0 */
0, 0xE7F6, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0xE7F5, /* 0xC0 */
0xFBD2, 0, 0x964E, 0xFBD6, 0, 0xFBD4, 0, 0xFBD0, /* 0xD0 */
0, 0xFBD1, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0xFBD5, 0, 0, 0, 0x8F9B, 0, 0, 0xFBCF, /* 0xE0 */
0, 0xE7F8, 0x95DD, 0, 0, 0x8973, 0, 0, /* 0xE0 */
0, 0, 0x9565, 0x9292, 0, 0, 0, 0, /* 0xF0 */
0x8B98, 0xFA65, 0xE7FA, 0xFBD9, 0x8D7C, 0, 0, 0xFBDC /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_93[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xFBDE, 0, 0, 0, 0x8E4B, 0, /* 0x00 */
0, 0, 0, 0, 0, 0, 0, 0xE7F9, /* 0x00 */
0x908D, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */
0x908E, 0xE840, 0xE842, 0, 0, 0xFBDD, 0xFBDB, 0, /* 0x10 */
0x8FF9, 0xFBD8, 0xE841, 0xE843, 0, 0xFBD7, 0x8BD1, 0, /* 0x20 */
0x9564, 0, 0, 0x8EE0, 0x9842, 0, 0xE7FC, 0x8DF6, /* 0x20 */
0, 0, 0x985E, 0, 0, 0xE845, 0, 0, /* 0x30 */
0, 0, 0xE844, 0xE846, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0xE7FB, 0, 0, 0, /* 0x40 */
0xFA5E, 0, 0, 0x93E7, 0, 0x9374, 0, 0, /* 0x40 */
0, 0, 0, 0, 0x92D5, 0, 0xE84B, 0xFBE0, /* 0x50 */
0, 0, 0, 0x9262, 0xE847, 0, 0, 0, /* 0x50 */
0xE848, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0x8C4C, 0, 0xE84A, 0, /* 0x60 */
0xFBDF, 0, 0, 0, 0, 0x8CAE, 0, 0, /* 0x70 */
0, 0, 0, 0, 0xE849, 0, 0x8FDF, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0x8A99, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0xE84F, 0, 0x8DBD, 0x9199, /* 0x90 */
0, 0, 0x92C8, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0xFBE1, 0, 0, 0x8A5A, /* 0xA0 */
0, 0, 0, 0, 0xE84D, 0xE84E, 0x92C1, 0, /* 0xA0 */
0xE84C, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0xE850, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0xE856, 0, 0, 0xFBE2, 0, /* 0xC0 */
0xE859, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0xE858, 0x934C, 0, 0, 0, 0, 0xE851, 0xE852, /* 0xD0 */
0xE855, 0, 0, 0, 0, 0xE857, 0xFBE3, 0, /* 0xD0 */
0, 0x8BBE, 0, 0, 0xE85A, 0xE854, 0, 0, /* 0xE0 */
0xE853, 0, 0, 0, 0, 0, 0, 0, /* 0xE0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xF0 */
0xFBE4 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_94[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xE85E, 0, 0, 0, 0xE85F, /* 0x00 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 */
0xE860, 0, 0, 0xE85D, 0xE85C, 0, 0, 0, /* 0x10 */
0x8FE0, 0x93A8, 0xE85B, 0, 0, 0, 0, 0, /* 0x10 */
0, 0xE864, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0xE862, 0, 0, 0, 0, /* 0x20 */
0, 0xFBE5, 0, 0, 0, 0xE863, 0xE861, 0, /* 0x30 */
0x91F6, 0, 0xE865, 0, 0, 0, 0, 0, /* 0x30 */
0, 0xE866, 0, 0, 0xE868, 0xFBE6, 0, 0, /* 0x40 */
0xFBE7, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0x8AD3, 0xE867, 0x96F8, 0, 0, 0, 0, /* 0x50 */
0, 0, 0xE873, 0xE869, 0, 0, 0xE86C, 0, /* 0x50 */
0xE86A, 0, 0xE86B, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0xE86D, 0, 0, 0, 0, 0, /* 0x60 */
0xE86F, 0, 0, 0, 0, 0xE870, 0, 0xE871, /* 0x70 */
0, 0, 0, 0, 0xE874, 0xE872, 0xE875, 0xE877, /* 0x70 */
0, 0xE876 /* 0x80 */
/* 0x80 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_95[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x92B7, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0x96E5, 0, 0xE878, 0x914D, 0, 0, 0, 0xE879, /* 0x80 */
0, 0x95C2, 0xE87A, 0x8A4A, 0, 0, 0, 0x895B, /* 0x80 */
0, 0x8AD5, 0xFBE8, 0x8AD4, 0xE87B, 0, 0xE87C, 0, /* 0x90 */
0xE87D, 0xE87E, 0, 0, 0, 0, 0, 0, /* 0x90 */
0xE880, 0, 0x8AD6, 0x8A74, 0x8D7D, 0x94B4, 0, 0xE882, /* 0xA0 */
0xE881, 0, 0, 0, 0, 0xE883, 0, 0, /* 0xA0 */
0, 0, 0x897B, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0xE886, 0, 0xE885, 0xE884, 0, 0xE887, 0, /* 0xB0 */
0, 0, 0, 0xE88A, 0, 0, 0, 0x88C5, /* 0xC0 */
0, 0, 0xE888, 0, 0xE88C, 0xE88B, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0xE88E, 0xE88D, 0xE88F, 0, /* 0xD0 */
0x93AC, 0, 0, 0, 0xE890, 0, 0, 0, /* 0xD0 */
0, 0xE891, 0xE893, 0, 0, 0xE892 /* 0xE0 */
/* 0xE0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_96[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
/* 0x10 */
0x958C, 0, 0, 0, /* 0x10 */
0, 0xE894, 0, 0, 0, 0, 0, 0, /* 0x20 */
0xE895, 0, 0x8DE3, 0, 0, 0, 0xE896, 0xE897, /* 0x20 */
0, 0, 0x9668, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0x916A, 0, 0, 0, 0x88A2, /* 0x30 */
0x91C9, 0, 0xE898, 0, 0x958D, 0, 0, 0, /* 0x40 */
0, 0, 0, 0xE89B, 0xE899, 0x8D7E, 0, 0xE89A, /* 0x40 */
0x8CC0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0x95C3, 0xE89D, 0xE89F, 0xE89E, 0xE8A0, /* 0x50 */
0, 0, 0x8940, 0x9077, 0x8F9C, 0x8AD7, 0xE8A1, 0, /* 0x60 */
0, 0, 0x9486, 0, 0xE8A3, 0, 0, 0, /* 0x60 */
0x8941, 0, 0xE8A2, 0x92C2, 0, 0x97CB, 0x93A9, 0xE89C, /* 0x70 */
0x97A4, 0, 0x8CAF, 0, 0, 0x977A, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0x8BF7, 0x97B2, 0, /* 0x80 */
0x8C47, 0, 0x91E0, 0xE440, 0, 0xE8A4, 0x8A4B, 0x908F, /* 0x80 */
0, 0, 0, 0, 0x8A75, 0xE8A6, 0, 0xE8A7, /* 0x90 */
0xE8A5, 0x8C84, 0, 0x8DDB, 0x8FE1, 0xFBEB, 0, 0, /* 0x90 */
0x8942, 0, 0, 0x97D7, 0, 0, 0, 0xE8A9, /* 0xA0 */
0xE7AC, 0, 0xE8A8, 0, 0, 0, 0, 0xFBEC, /* 0xA0 */
0xE8AC, 0xE8AA, 0xE8AB, 0, 0xE8AD, 0, 0xE8AE, 0x97EA, /* 0xB0 */
0xE8AF, 0xE8B0, 0, 0x90C7, 0x94B9, 0, 0, 0, /* 0xB0 */
0x909D, 0x8AE5, 0, 0, 0x9759, 0x89EB, 0x8F57, 0x8CD9, /* 0xC0 */
0, 0xE8B3, 0, 0xE8B2, 0x8E93, 0xE8B4, 0xE8B1, 0, /* 0xC0 */
0, 0x8E47, 0, 0, 0, 0xE8B8, 0xE5AB, 0, /* 0xD0 */
0, 0x99D4, 0, 0x9097, 0xE8B6, 0, 0, 0, /* 0xD0 */
0, 0, 0x97A3, 0x93EF, 0, 0, 0, 0, /* 0xE0 */
0x894A, 0, 0x90E1, 0x8EB4, 0, 0, 0, 0, /* 0xE0 */
0x95B5, 0, 0x895F, 0, 0, 0, 0x97EB, 0x978B, /* 0xF0 */
0, 0xE8B9, 0, 0x9364 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_97[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8EF9, 0, 0, 0, 0xE8BA, 0, 0xE8BB, 0x906B, /* 0x00 */
0xE8BC, 0, 0x97EC, 0, 0, 0xE8B7, 0xE8BE, 0xE8C0, /* 0x00 */
0, 0xE8BF, 0, 0xE8BD, 0, 0, 0xE8C1, 0, /* 0x10 */
0, 0xE8C2, 0, 0, 0x919A, 0, 0x89E0, 0, /* 0x10 */
0, 0, 0, 0, 0xE8C3, 0, 0, 0x96B6, /* 0x20 */
0, 0, 0xE8C4, 0, 0, 0, 0, 0, /* 0x20 */
0xE8C5, 0, 0x9849, 0xFBED, 0, 0, 0, 0, /* 0x30 */
0x9E50, 0xE8C6, 0, 0xFBEE, 0, 0xE8C7, 0xE8C8, 0, /* 0x30 */
0, 0, 0xE8CC, 0xFBEF, 0xE8C9, 0, 0xE8CA, 0, /* 0x40 */
0xE8CB, 0xE8CD, 0, 0, 0, 0xFBF0, 0, 0xFBF1, /* 0x40 */
0, 0xFBF2, 0x90C2, 0, 0, 0xFBF3, 0x96F5, 0, /* 0x50 */
0, 0x90C3, 0, 0, 0xE8CE, 0, 0x94F1, 0, /* 0x50 */
0xE8CF, 0xEA72, 0x96CA, 0, 0xE8D0, 0, 0xE8D1, 0, /* 0x60 */
0xE8D2, 0x8A76, 0, 0xE8D4, 0, 0x9078, 0, 0, /* 0x60 */
0, 0xE8D5, 0, 0, 0x8C43, 0, 0, 0, /* 0x70 */
0, 0xE8D6, 0xE8DA, 0, 0xE8D8, 0, 0, 0, /* 0x70 */
0, 0xE8D9, 0, 0, 0x8A93, 0xE8D7, 0xE8DB, 0, /* 0x80 */
0, 0, 0, 0xE8DC, 0, 0x88C6, 0, 0xE8DD, /* 0x80 */
0xE8DE, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0x8FE2, 0, 0, 0, 0xE8DF, 0, 0, 0, /* 0x90 */
0x8B66, 0, 0, 0xE8E2, 0, 0, 0xE8E1, 0, /* 0xA0 */
0xE8E0, 0, 0, 0xE691, 0, 0x95DA, 0, 0, /* 0xA0 */
0, 0, 0, 0xE8E3, 0xE8E4, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0xE8E5, 0, 0, 0xE8E6, 0, /* 0xC0 */
0xE8E7, 0, 0, 0xE8E8, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0x8AD8, 0, 0, 0, 0, /* 0xD0 */
0, 0, 0, 0, 0xE8E9, 0, 0, 0, /* 0xD0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xE0 */
0, 0, 0, 0, 0, 0xE8EA, 0x9442, 0, /* 0xE0 */
0, 0, 0xE8EC, 0x89B9, 0, 0xE8EF, 0xE8EE, 0, /* 0xF0 */
0, 0, 0, 0x8943, 0, 0, 0, 0x8BBF /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_98[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x95C5, 0x92B8, 0x8DA0, 0, 0x8D80, 0x8F87, 0, /* 0x00 */
0x907B, 0, 0, 0, 0xE8F1, 0, 0, 0xE8F0, /* 0x00 */
0x9761, 0x8AE6, 0x94D0, 0x93DA, 0, 0, 0, 0x909C, /* 0x10 */
0x97CC, 0, 0x8C7A, 0, 0, 0, 0, 0, /* 0x10 */
0, 0xE8F4, 0, 0, 0xE8F3, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0x966A, 0x93AA, 0, 0, /* 0x20 */
0, 0, 0, 0, 0x896F, 0, 0, 0xE8F5, /* 0x30 */
0xE8F2, 0, 0, 0x9570, 0x978A, 0xE8F6, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0xE8F7, 0, /* 0x40 */
0, 0, 0, 0xE8F9, 0x91E8, 0x8A7A, 0x8A7B, 0xE8F8, /* 0x40 */
0, 0, 0, 0, 0x8AE7, 0x8CB0, 0, 0xFBF4, /* 0x50 */
0x8AE8, 0, 0, 0x935E, 0, 0, 0x97DE, 0, /* 0x50 */
0, 0, 0, 0, 0, 0xFBF5, 0, 0x8CDA, /* 0x60 */
0, 0, 0, 0xE8FA, 0, 0, 0, 0xE8FB, /* 0x60 */
0xE8FC, 0xE940, 0, 0xE942, 0xE941, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0x9597, 0, 0xE943, 0, 0, 0, 0, 0xE944, /* 0xA0 */
0, 0xE945, 0, 0, 0, 0, 0xE946, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0xE948, 0xE947, 0, 0xE949, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0, 0, 0x94F2, 0xE3CA, 0, 0, 0x9048, /* 0xD0 */
0, 0, 0x8B51, 0, 0, 0, 0, 0, /* 0xE0 */
0, 0xE94A, 0, 0xE94B, 0, 0x99AA, 0x9F5A, 0x94D1, /* 0xE0 */
0, 0, 0x88F9, 0, 0x88B9, 0, 0, 0, /* 0xF0 */
0, 0, 0, 0, 0x8E94, 0x964F, 0x8FFC /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_99[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xE94C, 0, 0x96DD, 0, 0, /* 0x00 */
0, 0xE94D, 0x977B, 0, 0x8961, 0, 0, 0, /* 0x00 */
0x8E60, 0, 0xE94E, 0x89EC, 0xE94F, 0, 0, 0, /* 0x10 */
0xE950, 0, 0, 0, 0, 0xE952, 0xE953, 0, /* 0x10 */
0xE955, 0xE951, 0, 0, 0xE954, 0, 0, 0xFBF8, /* 0x20 */
0x8AD9, 0, 0, 0, 0xE956, 0, 0xE957, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0xE958, 0xE959, 0, /* 0x30 */
0, 0, 0xE95A, 0, 0, 0xE95C, 0, 0, /* 0x40 */
0, 0xE95B, 0, 0xE95E, 0xE961, 0, 0, 0, /* 0x40 */
0xE95D, 0xE95F, 0xE960, 0, 0, 0xE962, 0, 0x8BC0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0x8EF1, 0xE963, /* 0x90 */
0xE964, 0x8D81, 0, 0, 0, 0, 0xFBFA, 0, /* 0x90 */
0, 0, 0, 0, 0, 0xE965, 0, 0, /* 0xA0 */
0x8A5D, 0, 0, 0, 0x946E, 0xE966, 0xE967, 0, /* 0xA0 */
0, 0, 0, 0x9279, 0x93E9, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0xE968, 0, 0, 0, /* 0xB0 */
0, 0x949D, 0, 0, 0x91CA, 0x8977, 0x8BEC, 0, /* 0xC0 */
0x8BED, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0x9293, 0xE96D, 0x8BEE, 0, 0, 0x89ED, 0, 0, /* 0xD0 */
0xE96C, 0, 0, 0xE96A, 0, 0xE96B, 0, 0xE969, /* 0xD0 */
0, 0, 0xE977, 0, 0, 0, 0, 0, /* 0xE0 */
0, 0, 0, 0, 0, 0xE96E, 0xE96F, 0, /* 0xE0 */
0, 0xE970, 0xE971, 0, 0, 0, 0, 0, /* 0xF0 */
0xE973, 0, 0, 0xE972, 0, 0, 0, 0x8F78 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_9A[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xE974, 0, 0, 0, 0xE976, 0, 0, /* 0x00 */
0, 0, 0, 0, 0, 0, 0x8B52, 0xE975, /* 0x00 */
0, 0, 0x919B, 0x8CB1, 0, 0, 0, 0, /* 0x10 */
0, 0xE978, 0, 0, 0, 0, 0, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0x91CB, 0, 0, 0xE979, 0, 0, 0, 0, /* 0x20 */
0x93AB, 0, 0, 0, 0, 0, 0, 0xE97A, /* 0x30 */
0, 0, 0, 0, 0, 0, 0xE980, 0, /* 0x30 */
0xE97D, 0, 0xE97C, 0xE97E, 0, 0xE97B, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0xE982, 0xFBFB, 0, /* 0x40 */
0, 0, 0, 0, 0, 0xE981, 0, 0xE984, /* 0x50 */
0, 0, 0x8BC1, 0xE983, 0, 0, 0, 0xE985, /* 0x50 */
0, 0, 0xE986, 0, 0xE988, 0xE987, 0, 0, /* 0x60 */
0, 0xE989, 0xE98B, 0xE98A, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0x8D9C, 0, 0, 0, 0, 0xE98C, 0, 0, /* 0xA0 */
0xE98D, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0x8A5B, 0, 0, 0, 0xE98E, 0, 0, 0, /* 0xB0 */
0xE98F, 0, 0, 0, 0x9091, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0xE990, /* 0xC0 */
0, 0xE991, 0, 0xE992, 0xE993, 0, 0, 0, /* 0xD0 */
0x8D82, 0xFBFC, 0, 0, 0xFC40, 0, 0xE994, 0xE995, /* 0xD0 */
0, 0, 0xE996, 0xE997, 0, 0, 0xE998, 0, /* 0xE0 */
0, 0, 0x94AF, 0xE99A, 0, 0x9545, 0xE99B, 0xE999, /* 0xE0 */
0, 0xE99D, 0, 0, 0xE99C, 0, 0, 0xE99E, /* 0xF0 */
0, 0, 0, 0xE99F /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_9B[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xE9A0, 0, /* 0x00 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */
0xE9A1, 0, 0xE9A2, 0, 0, 0, 0, 0xE9A3, /* 0x10 */
0, 0, 0xE9A4, 0xE9A5, 0, 0xE9A6, 0, 0xE9A7, /* 0x20 */
0xE9A8, 0xE9A9, 0xE9AA, 0, 0, 0, 0xE9AB, 0xE9AC, /* 0x20 */
0, 0x9F54, 0xE9AD, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0xE2F6, 0x8B53, 0, 0, 0, /* 0x30 */
0, 0x8A40, 0x8DB0, 0xE9AF, 0xE9AE, 0x96A3, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0xE9B1, 0xE9B2, 0xE9B0, /* 0x40 */
0, 0xE9B3, 0, 0, 0x9682, 0, 0, 0, /* 0x50 */
0xE9B4, 0, 0x8B9B, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0x9844, /* 0x60 */
0, 0, 0xFC42, 0, 0xE9B5, 0xFC41, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0xE9B7, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0x88BC, 0xFC43, /* 0x80 */
0, 0xE9B8, 0x95A9, 0xE9B6, 0, 0, 0xE9B9, 0xE9BA, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0xE9BB, /* 0x90 */
0xE9BC, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0xE9BD, 0, 0x968E, 0x8E4C, 0, 0x8DF8, 0x914E, 0, /* 0xA0 */
0, 0xFC44, 0, 0, 0xE9BE, 0, 0, 0, /* 0xB0 */
0, 0xE9C1, 0, 0xFC45, 0, 0, 0, 0, /* 0xB0 */
0xE9BF, 0, 0, 0, 0, 0, 0xE9C2, 0, /* 0xC0 */
0, 0x8CEF, 0xE9C0, 0, 0, 0, 0, 0xE9C3, /* 0xC0 */
0, 0xE9C4, 0xE9C5, 0, 0xE9C9, 0, 0x8E49, 0, /* 0xD0 */
0, 0, 0, 0x91E2, 0, 0, 0, 0, /* 0xD0 */
0, 0xE9CA, 0xE9C7, 0xE9C6, 0xE9C8, 0, 0, 0, /* 0xE0 */
0x8C7E, 0, 0, 0, 0, 0, 0, 0, /* 0xE0 */
0xE9CE, 0xE9CD, 0xE9CC, 0, 0, 0x88B1 /* 0xF0 */
/* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_9C[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xFC46, 0, 0, 0, 0xE9D8, 0, 0xE9D4, 0, /* 0x00 */
0xE9D5, 0xE9D1, 0xE9D7, 0, 0xE9D3, 0x8A82, 0, 0, /* 0x00 */
0x986B, 0, 0xE9D6, 0xE9D2, 0xE9D0, 0xE9CF, 0, 0, /* 0x10 */
0, 0, 0, 0xE9DA, 0, 0, 0, 0, /* 0x10 */
0, 0xE9DD, 0, 0, 0xE9DC, 0xE9DB, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0x9568, 0xE9D9, 0x88F1, /* 0x20 */
0xE9DE, 0, 0xE9E0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0x8A8F, 0xE9CB, 0x8956, 0, 0, 0xE9E2, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0xE9E1, 0xE9DF, /* 0x40 */
0x924C, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0x9690, 0, 0, 0, 0, 0x97D8, /* 0x50 */
0, 0, 0xE9E3, 0, 0, 0, 0, 0, /* 0x50 */
0xE9E4, 0, 0, 0, 0, 0, 0, 0xE9E5, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0xE9E6, 0, /* 0x70 */
0xE9E7, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0, 0, 0, 0, 0x92B9, 0, 0xE9E8, /* 0xE0 */
0, 0x94B5, 0, 0xE9ED, 0xE9E9, 0, 0, 0, /* 0xE0 */
0xE9EA, 0, 0, 0x9650, 0x96C2, 0, 0x93CE /* 0xF0 */
/* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_9D[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xE9EE, 0, 0, 0xE9EF, 0x93BC, /* 0x00 */
0xE9EC, 0xE9EB, 0, 0, 0, 0, 0x89A8, 0, /* 0x00 */
0, 0, 0xE9F7, 0, 0, 0xE9F6, 0, 0, /* 0x10 */
0, 0, 0, 0x8995, 0, 0, 0, 0xE9F4, /* 0x10 */
0, 0, 0, 0xE9F3, 0, 0, 0xE9F1, 0, /* 0x20 */
0x8A9B, 0, 0xE9F0, 0x8EB0, 0x89A7, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0x8D83, 0, 0, 0xE9FA, 0xE9F9, /* 0x30 */
0, 0xE9F8, 0, 0, 0xE9F5, 0, 0xE9FB, 0, /* 0x40 */
0xE9FC, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0xEA44, 0xEA43, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0xEA45, 0, 0, 0x894C, 0xEA40, 0xEA41, 0, /* 0x50 */
0x8D94, 0x96B7, 0, 0, 0xEA42, 0, 0, 0, /* 0x60 */
0, 0, 0, 0xFC48, 0x9651, 0, 0, 0xEA4A, /* 0x60 */
0xFC47, 0, 0xEA46, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0xEA4B, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0xEA48, /* 0x80 */
0, 0xEA47, 0, 0, 0, 0, 0, 0x8C7B, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0xEA4C, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0xEA4D, 0, 0, 0, /* 0xA0 */
0, 0xEA4E, 0, 0xEA49, 0, 0, 0, 0xE9F2, /* 0xA0 */
0, 0, 0xEA4F, 0, 0x92DF, 0, 0, 0, /* 0xB0 */
0xEA53, 0, 0xEA54, 0xEA52, 0, 0, 0, 0, /* 0xB0 */
0, 0xEA51, 0xEA57, 0, 0xEA50, 0, 0xEA55, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0xEA56, /* 0xC0 */
0, 0, 0, 0xEA59, 0, 0, 0, 0, /* 0xD0 */
0, 0xEA58, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0, 0, 0, 0, 0, 0xEA5B, 0, /* 0xE0 */
0, 0, 0, 0, 0, 0xEA5C, 0, 0xEA5D, /* 0xE0 */
0, 0, 0x9868, 0, 0, 0, 0, 0, /* 0xF0 */
0xEA5A, 0x91E9, 0x8DEB, 0, 0, 0xEA5E /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_9E[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
/* 0x10 */
0xFC4A, 0xEA5F, 0xEA60, 0, 0, 0xEA61, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0xEA62, 0, 0, /* 0x70 */
0x8CB2, 0xEA63, 0, 0, 0, 0xEA64, 0, 0x8EAD, /* 0x70 */
0, 0xEA65, 0, 0, 0, 0, 0, 0, /* 0x80 */
0xEA66, 0, 0, 0xEA67, 0xEA68, 0, 0, 0, /* 0x80 */
0, 0xEA6B, 0xEA69, 0x985B, 0, 0xEA6A, 0, 0x97ED, /* 0x90 */
0, 0, 0, 0, 0, 0xEA6C, 0, 0x97D9, /* 0x90 */
0, 0, 0, 0, 0, 0xEA6D, 0x949E, 0, /* 0xA0 */
0, 0xEA6E, 0xEA70, 0, 0, 0xEA71, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0xEA6F, 0x8D8D, 0x96CB, 0x9683, 0x9BF5, 0, 0x9F80, 0x969B, /* 0xB0 */
0, 0, 0, 0, 0x89A9, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0xEA73, 0x8B6F, 0xEA74, 0xEA75, /* 0xC0 */
0xEA76, 0xFC4B, 0x8D95, 0, 0xEA77, 0, 0, 0, /* 0xD0 */
0xE0D2, 0x96D9, 0, 0x91E1, 0xEA78, 0xEA7A, 0xEA79, 0, /* 0xD0 */
0xEA7B, 0, 0, 0, 0, 0xEA7C, 0, 0, /* 0xE0 */
0xEA7D, 0, 0, 0, 0, 0, 0, 0xEA7E, /* 0xE0 */
0, 0, 0, 0, 0xEA80, 0, 0xEA81, 0xEA82, /* 0xF0 */
0, 0xEA83, 0, 0xEA84, 0xEA85, 0xEA86 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_9F[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xEA87, /* 0x00 */
0xEA88, 0, 0, 0, 0, 0, 0x9343, 0, /* 0x00 */
0, 0, 0, 0x8CDB, 0, 0xEA8A, 0, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */
0x916C, 0xEA8B, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0xEA8C, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0x9540, 0, 0, 0xEA8D, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0xEA8E, 0xE256, 0, 0, 0xE6D8, 0xE8EB, /* 0x40 */
0, 0, 0xEA8F, 0, 0xEA90, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0xEA92, /* 0x50 */
0xEA93, 0xEA94, 0x97EE, 0xEA91, 0, 0, 0xEA95, 0xEA96, /* 0x60 */
0, 0, 0xEA98, 0, 0xEA97, 0, 0, 0, /* 0x60 */
0, 0, 0xEA9A, 0, 0, 0, 0xEA9B, 0xEA99, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0x97B4, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0xEA9C, 0, 0, /* 0x90 */
0, 0, 0, 0, 0xEA9D, 0xE273, 0, 0, /* 0x90 */
0xEA9E /* 0xA0 */
/* 0xA0 */
};
/* ----------------------------------------------------------------------- */
/* this table includes some IBM Kanji's */
static sal_uInt16 const aImplUniToDBCSTab_MS932_F9[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
/* 0x20 */
0xFAE0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0, 0, 0, 0xFBE9 /* 0xD0 */
};
/* ----------------------------------------------------------------------- */
/* this table includes some IBM Kanji's */
static sal_uInt16 const aImplUniToDBCSTab_MS932_FA[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
/* 0x00 */
0xFA90, 0xFA9B, /* 0x00 */
0xFA9C, 0xFAB1, 0xFAD8, 0xFAE8, 0xFAEA, 0xFB58, 0xFB5E, 0xFB75, /* 0x10 */
0xFB7D, 0xFB7E, 0xFB80, 0xFB82, 0xFB86, 0xFB89, 0xFB92, 0xFB9D, /* 0x10 */
0xFB9F, 0xFBA0, 0xFBA9, 0xFBB1, 0xFBB3, 0xFBB4, 0xFBB7, 0xFBD3, /* 0x20 */
0xFBDA, 0xFBEA, 0xFBF6, 0xFBF7, 0xFBF9, 0xFC49 /* 0x20 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_APPLEJAPANESE_FE[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xEB64, 0xEB5C, 0, 0xEB51, 0, 0xEB69, 0xEB6A, 0xEB6F, /* 0x30 */
0xEB70, 0xEB6B, 0xEB6C, 0xEB79, 0xEB7A, 0xEB73, 0xEB74, 0xEB71, /* 0x30 */
0xEB72, 0xEB75, 0xEB76, 0xEB77, 0xEB78 /* 0x40 */
/* 0x40 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_SJIS_FF[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8149, 0xFA57, 0x8194, 0x8190, 0x8193, 0x8195, 0xFA56, /* 0x00 */
0x8169, 0x816A, 0x8196, 0x817B, 0x8143, 0x817C, 0x8144, 0x815E, /* 0x00 */
0x824F, 0x8250, 0x8251, 0x8252, 0x8253, 0x8254, 0x8255, 0x8256, /* 0x10 */
0x8257, 0x8258, 0x8146, 0x8147, 0x8183, 0x8181, 0x8184, 0x8148, /* 0x10 */
0x8197, 0x8260, 0x8261, 0x8262, 0x8263, 0x8264, 0x8265, 0x8266, /* 0x20 */
0x8267, 0x8268, 0x8269, 0x826A, 0x826B, 0x826C, 0x826D, 0x826E, /* 0x20 */
0x826F, 0x8270, 0x8271, 0x8272, 0x8273, 0x8274, 0x8275, 0x8276, /* 0x30 */
0x8277, 0x8278, 0x8279, 0x816D, 0x815F, 0x816E, 0x814F, 0x8151, /* 0x30 */
0x814D, 0x8281, 0x8282, 0x8283, 0x8284, 0x8285, 0x8286, 0x8287, /* 0x40 */
0x8288, 0x8289, 0x828A, 0x828B, 0x828C, 0x828D, 0x828E, 0x828F, /* 0x40 */
0x8290, 0x8291, 0x8292, 0x8293, 0x8294, 0x8295, 0x8296, 0x8297, /* 0x50 */
0x8298, 0x8299, 0x829A, 0x816F, 0x8162, 0x8170, 0x8160, 0, /* 0x50 */
0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, /* 0x60 */
0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, /* 0x60 */
0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, /* 0x70 */
0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, /* 0x70 */
0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, /* 0x80 */
0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, /* 0x80 */
0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, /* 0x90 */
0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0x8191, 0x8192, 0x81CA, 0x8150, 0xFA55, 0x818F /* 0xE0 */
/* 0xE0 */
}; | the_stack |
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION isn" to load this file. \quit
-- Example:
-- create table test ( id isbn );
-- insert into test values('978-0-393-04002-9');
--
-- select isbn('978-0-393-04002-9');
-- select isbn13('0-901690-54-6');
--
--
-- Input and output functions and data types:
--
---------------------------------------------------
CREATE FUNCTION ean13_in(cstring)
RETURNS ean13
AS 'MODULE_PATHNAME'
LANGUAGE C
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION ean13_out(ean13)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE C
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE TYPE ean13 (
INPUT = ean13_in,
OUTPUT = ean13_out,
LIKE = pg_catalog.int8
);
COMMENT ON TYPE ean13
IS 'International European Article Number (EAN13)';
CREATE FUNCTION isbn13_in(cstring)
RETURNS isbn13
AS 'MODULE_PATHNAME', 'isbn_in'
LANGUAGE C
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION ean13_out(isbn13)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE C
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE TYPE isbn13 (
INPUT = isbn13_in,
OUTPUT = ean13_out,
LIKE = pg_catalog.int8
);
COMMENT ON TYPE isbn13
IS 'International Standard Book Number 13 (ISBN13)';
CREATE FUNCTION ismn13_in(cstring)
RETURNS ismn13
AS 'MODULE_PATHNAME', 'ismn_in'
LANGUAGE C
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION ean13_out(ismn13)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE C
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE TYPE ismn13 (
INPUT = ismn13_in,
OUTPUT = ean13_out,
LIKE = pg_catalog.int8
);
COMMENT ON TYPE ismn13
IS 'International Standard Music Number 13 (ISMN13)';
CREATE FUNCTION issn13_in(cstring)
RETURNS issn13
AS 'MODULE_PATHNAME', 'issn_in'
LANGUAGE C
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION ean13_out(issn13)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE C
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE TYPE issn13 (
INPUT = issn13_in,
OUTPUT = ean13_out,
LIKE = pg_catalog.int8
);
COMMENT ON TYPE issn13
IS 'International Standard Serial Number 13 (ISSN13)';
-- Short format:
CREATE FUNCTION isbn_in(cstring)
RETURNS isbn
AS 'MODULE_PATHNAME'
LANGUAGE C
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isn_out(isbn)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE C
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE TYPE isbn (
INPUT = isbn_in,
OUTPUT = isn_out,
LIKE = pg_catalog.int8
);
COMMENT ON TYPE isbn
IS 'International Standard Book Number (ISBN)';
CREATE FUNCTION ismn_in(cstring)
RETURNS ismn
AS 'MODULE_PATHNAME'
LANGUAGE C
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isn_out(ismn)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE C
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE TYPE ismn (
INPUT = ismn_in,
OUTPUT = isn_out,
LIKE = pg_catalog.int8
);
COMMENT ON TYPE ismn
IS 'International Standard Music Number (ISMN)';
CREATE FUNCTION issn_in(cstring)
RETURNS issn
AS 'MODULE_PATHNAME'
LANGUAGE C
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isn_out(issn)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE C
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE TYPE issn (
INPUT = issn_in,
OUTPUT = isn_out,
LIKE = pg_catalog.int8
);
COMMENT ON TYPE issn
IS 'International Standard Serial Number (ISSN)';
CREATE FUNCTION upc_in(cstring)
RETURNS upc
AS 'MODULE_PATHNAME'
LANGUAGE C
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isn_out(upc)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE C
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE TYPE upc (
INPUT = upc_in,
OUTPUT = isn_out,
LIKE = pg_catalog.int8
);
COMMENT ON TYPE upc
IS 'Universal Product Code (UPC)';
--
-- Operator functions:
--
---------------------------------------------------
-- EAN13:
CREATE FUNCTION isnlt(ean13, ean13)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnle(ean13, ean13)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isneq(ean13, ean13)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnge(ean13, ean13)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isngt(ean13, ean13)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnne(ean13, ean13)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnlt(ean13, isbn13)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnle(ean13, isbn13)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isneq(ean13, isbn13)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnge(ean13, isbn13)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isngt(ean13, isbn13)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnne(ean13, isbn13)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnlt(ean13, ismn13)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnle(ean13, ismn13)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isneq(ean13, ismn13)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnge(ean13, ismn13)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isngt(ean13, ismn13)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnne(ean13, ismn13)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnlt(ean13, issn13)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnle(ean13, issn13)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isneq(ean13, issn13)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnge(ean13, issn13)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isngt(ean13, issn13)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnne(ean13, issn13)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnlt(ean13, isbn)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnle(ean13, isbn)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isneq(ean13, isbn)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnge(ean13, isbn)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isngt(ean13, isbn)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnne(ean13, isbn)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnlt(ean13, ismn)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnle(ean13, ismn)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isneq(ean13, ismn)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnge(ean13, ismn)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isngt(ean13, ismn)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnne(ean13, ismn)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnlt(ean13, issn)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnle(ean13, issn)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isneq(ean13, issn)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnge(ean13, issn)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isngt(ean13, issn)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnne(ean13, issn)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnlt(ean13, upc)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnle(ean13, upc)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isneq(ean13, upc)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnge(ean13, upc)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isngt(ean13, upc)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnne(ean13, upc)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
---------------------------------------------------
-- ISBN13:
CREATE FUNCTION isnlt(isbn13, isbn13)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnle(isbn13, isbn13)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isneq(isbn13, isbn13)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnge(isbn13, isbn13)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isngt(isbn13, isbn13)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnne(isbn13, isbn13)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnlt(isbn13, isbn)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnle(isbn13, isbn)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isneq(isbn13, isbn)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnge(isbn13, isbn)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isngt(isbn13, isbn)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnne(isbn13, isbn)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnlt(isbn13, ean13)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnle(isbn13, ean13)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isneq(isbn13, ean13)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnge(isbn13, ean13)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isngt(isbn13, ean13)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnne(isbn13, ean13)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
---------------------------------------------------
-- ISBN:
CREATE FUNCTION isnlt(isbn, isbn)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnle(isbn, isbn)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isneq(isbn, isbn)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnge(isbn, isbn)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isngt(isbn, isbn)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnne(isbn, isbn)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnlt(isbn, isbn13)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnle(isbn, isbn13)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isneq(isbn, isbn13)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnge(isbn, isbn13)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isngt(isbn, isbn13)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnne(isbn, isbn13)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnlt(isbn, ean13)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnle(isbn, ean13)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isneq(isbn, ean13)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnge(isbn, ean13)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isngt(isbn, ean13)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnne(isbn, ean13)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
---------------------------------------------------
-- ISMN13:
CREATE FUNCTION isnlt(ismn13, ismn13)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnle(ismn13, ismn13)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isneq(ismn13, ismn13)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnge(ismn13, ismn13)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isngt(ismn13, ismn13)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnne(ismn13, ismn13)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnlt(ismn13, ismn)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnle(ismn13, ismn)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isneq(ismn13, ismn)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnge(ismn13, ismn)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isngt(ismn13, ismn)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnne(ismn13, ismn)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnlt(ismn13, ean13)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnle(ismn13, ean13)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isneq(ismn13, ean13)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnge(ismn13, ean13)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isngt(ismn13, ean13)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnne(ismn13, ean13)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
---------------------------------------------------
-- ISMN:
CREATE FUNCTION isnlt(ismn, ismn)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnle(ismn, ismn)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isneq(ismn, ismn)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnge(ismn, ismn)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isngt(ismn, ismn)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnne(ismn, ismn)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnlt(ismn, ismn13)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnle(ismn, ismn13)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isneq(ismn, ismn13)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnge(ismn, ismn13)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isngt(ismn, ismn13)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnne(ismn, ismn13)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnlt(ismn, ean13)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnle(ismn, ean13)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isneq(ismn, ean13)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnge(ismn, ean13)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isngt(ismn, ean13)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnne(ismn, ean13)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
---------------------------------------------------
-- ISSN13:
CREATE FUNCTION isnlt(issn13, issn13)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnle(issn13, issn13)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isneq(issn13, issn13)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnge(issn13, issn13)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isngt(issn13, issn13)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnne(issn13, issn13)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnlt(issn13, issn)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnle(issn13, issn)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isneq(issn13, issn)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnge(issn13, issn)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isngt(issn13, issn)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnne(issn13, issn)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnlt(issn13, ean13)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnle(issn13, ean13)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isneq(issn13, ean13)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnge(issn13, ean13)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isngt(issn13, ean13)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnne(issn13, ean13)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
---------------------------------------------------
-- ISSN:
CREATE FUNCTION isnlt(issn, issn)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnle(issn, issn)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isneq(issn, issn)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnge(issn, issn)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isngt(issn, issn)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnne(issn, issn)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnlt(issn, issn13)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnle(issn, issn13)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isneq(issn, issn13)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnge(issn, issn13)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isngt(issn, issn13)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnne(issn, issn13)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnlt(issn, ean13)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnle(issn, ean13)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isneq(issn, ean13)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnge(issn, ean13)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isngt(issn, ean13)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnne(issn, ean13)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
---------------------------------------------------
-- UPC:
CREATE FUNCTION isnlt(upc, upc)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnle(upc, upc)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isneq(upc, upc)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnge(upc, upc)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isngt(upc, upc)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnne(upc, upc)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnlt(upc, ean13)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnle(upc, ean13)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isneq(upc, ean13)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnge(upc, ean13)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isngt(upc, ean13)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION isnne(upc, ean13)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
--
-- Now the operators:
--
--
-- EAN13 operators:
--
---------------------------------------------------
CREATE OPERATOR < (
PROCEDURE = isnlt,
LEFTARG = ean13,
RIGHTARG = ean13,
COMMUTATOR = >,
NEGATOR = >=,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR <= (
PROCEDURE = isnle,
LEFTARG = ean13,
RIGHTARG = ean13,
COMMUTATOR = >=,
NEGATOR = >,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR = (
PROCEDURE = isneq,
LEFTARG = ean13,
RIGHTARG = ean13,
COMMUTATOR = =,
NEGATOR = <>,
RESTRICT = eqsel,
JOIN = eqjoinsel,
MERGES,
HASHES);
CREATE OPERATOR >= (
PROCEDURE = isnge,
LEFTARG = ean13,
RIGHTARG = ean13,
COMMUTATOR = <=,
NEGATOR = <,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR > (
PROCEDURE = isngt,
LEFTARG = ean13,
RIGHTARG = ean13,
COMMUTATOR = <,
NEGATOR = <=,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR <> (
PROCEDURE = isnne,
LEFTARG = ean13,
RIGHTARG = ean13,
COMMUTATOR = <>,
NEGATOR = =,
RESTRICT = neqsel,
JOIN = neqjoinsel);
CREATE OPERATOR < (
PROCEDURE = isnlt,
LEFTARG = ean13,
RIGHTARG = isbn13,
COMMUTATOR = >,
NEGATOR = >=,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR <= (
PROCEDURE = isnle,
LEFTARG = ean13,
RIGHTARG = isbn13,
COMMUTATOR = >=,
NEGATOR = >,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR = (
PROCEDURE = isneq,
LEFTARG = ean13,
RIGHTARG = isbn13,
COMMUTATOR = =,
NEGATOR = <>,
RESTRICT = eqsel,
JOIN = eqjoinsel,
MERGES,
HASHES);
CREATE OPERATOR >= (
PROCEDURE = isnge,
LEFTARG = ean13,
RIGHTARG = isbn13,
COMMUTATOR = <=,
NEGATOR = <,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR > (
PROCEDURE = isngt,
LEFTARG = ean13,
RIGHTARG = isbn13,
COMMUTATOR = <,
NEGATOR = <=,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR <> (
PROCEDURE = isnne,
LEFTARG = ean13,
RIGHTARG = isbn13,
COMMUTATOR = <>,
NEGATOR = =,
RESTRICT = neqsel,
JOIN = neqjoinsel);
CREATE OPERATOR < (
PROCEDURE = isnlt,
LEFTARG = isbn13,
RIGHTARG = ean13,
COMMUTATOR = >,
NEGATOR = >=,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR <= (
PROCEDURE = isnle,
LEFTARG = isbn13,
RIGHTARG = ean13,
COMMUTATOR = >=,
NEGATOR = >,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR = (
PROCEDURE = isneq,
LEFTARG = isbn13,
RIGHTARG = ean13,
COMMUTATOR = =,
NEGATOR = <>,
RESTRICT = eqsel,
JOIN = eqjoinsel,
MERGES,
HASHES);
CREATE OPERATOR >= (
PROCEDURE = isnge,
LEFTARG = isbn13,
RIGHTARG = ean13,
COMMUTATOR = <=,
NEGATOR = <,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR > (
PROCEDURE = isngt,
LEFTARG = isbn13,
RIGHTARG = ean13,
COMMUTATOR = <,
NEGATOR = <=,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR <> (
PROCEDURE = isnne,
LEFTARG = isbn13,
RIGHTARG = ean13,
COMMUTATOR = <>,
NEGATOR = =,
RESTRICT = neqsel,
JOIN = neqjoinsel);
CREATE OPERATOR < (
PROCEDURE = isnlt,
LEFTARG = ean13,
RIGHTARG = ismn13,
COMMUTATOR = >,
NEGATOR = >=,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR <= (
PROCEDURE = isnle,
LEFTARG = ean13,
RIGHTARG = ismn13,
COMMUTATOR = >=,
NEGATOR = >,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR = (
PROCEDURE = isneq,
LEFTARG = ean13,
RIGHTARG = ismn13,
COMMUTATOR = =,
NEGATOR = <>,
RESTRICT = eqsel,
JOIN = eqjoinsel,
MERGES,
HASHES);
CREATE OPERATOR >= (
PROCEDURE = isnge,
LEFTARG = ean13,
RIGHTARG = ismn13,
COMMUTATOR = <=,
NEGATOR = <,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel);
CREATE OPERATOR > (
PROCEDURE = isngt,
LEFTARG = ean13,
RIGHTARG = ismn13,
COMMUTATOR = <,
NEGATOR = <=,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel);
CREATE OPERATOR <> (
PROCEDURE = isnne,
LEFTARG = ean13,
RIGHTARG = ismn13,
COMMUTATOR = <>,
NEGATOR = =,
RESTRICT = neqsel,
JOIN = neqjoinsel);
CREATE OPERATOR < (
PROCEDURE = isnlt,
LEFTARG = ismn13,
RIGHTARG = ean13,
COMMUTATOR = >,
NEGATOR = >=,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR <= (
PROCEDURE = isnle,
LEFTARG = ismn13,
RIGHTARG = ean13,
COMMUTATOR = >=,
NEGATOR = >,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR = (
PROCEDURE = isneq,
LEFTARG = ismn13,
RIGHTARG = ean13,
COMMUTATOR = =,
NEGATOR = <>,
RESTRICT = eqsel,
JOIN = eqjoinsel,
MERGES,
HASHES);
CREATE OPERATOR >= (
PROCEDURE = isnge,
LEFTARG = ismn13,
RIGHTARG = ean13,
COMMUTATOR = <=,
NEGATOR = <,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR > (
PROCEDURE = isngt,
LEFTARG = ismn13,
RIGHTARG = ean13,
COMMUTATOR = <,
NEGATOR = <=,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR <> (
PROCEDURE = isnne,
LEFTARG = ismn13,
RIGHTARG = ean13,
COMMUTATOR = <>,
NEGATOR = =,
RESTRICT = neqsel,
JOIN = neqjoinsel);
CREATE OPERATOR < (
PROCEDURE = isnlt,
LEFTARG = ean13,
RIGHTARG = issn13,
COMMUTATOR = >,
NEGATOR = >=,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR <= (
PROCEDURE = isnle,
LEFTARG = ean13,
RIGHTARG = issn13,
COMMUTATOR = >=,
NEGATOR = >,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR = (
PROCEDURE = isneq,
LEFTARG = ean13,
RIGHTARG = issn13,
COMMUTATOR = =,
NEGATOR = <>,
RESTRICT = eqsel,
JOIN = eqjoinsel,
MERGES,
HASHES);
CREATE OPERATOR >= (
PROCEDURE = isnge,
LEFTARG = ean13,
RIGHTARG = issn13,
COMMUTATOR = <=,
NEGATOR = <,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel);
CREATE OPERATOR > (
PROCEDURE = isngt,
LEFTARG = ean13,
RIGHTARG = issn13,
COMMUTATOR = <,
NEGATOR = <=,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel);
CREATE OPERATOR <> (
PROCEDURE = isnne,
LEFTARG = ean13,
RIGHTARG = issn13,
COMMUTATOR = <>,
NEGATOR = =,
RESTRICT = neqsel,
JOIN = neqjoinsel);
CREATE OPERATOR < (
PROCEDURE = isnlt,
LEFTARG = ean13,
RIGHTARG = isbn,
COMMUTATOR = >,
NEGATOR = >=,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR <= (
PROCEDURE = isnle,
LEFTARG = ean13,
RIGHTARG = isbn,
COMMUTATOR = >=,
NEGATOR = >,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR = (
PROCEDURE = isneq,
LEFTARG = ean13,
RIGHTARG = isbn,
COMMUTATOR = =,
NEGATOR = <>,
RESTRICT = eqsel,
JOIN = eqjoinsel,
MERGES,
HASHES);
CREATE OPERATOR >= (
PROCEDURE = isnge,
LEFTARG = ean13,
RIGHTARG = isbn,
COMMUTATOR = <=,
NEGATOR = <,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel);
CREATE OPERATOR > (
PROCEDURE = isngt,
LEFTARG = ean13,
RIGHTARG = isbn,
COMMUTATOR = <,
NEGATOR = <=,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel);
CREATE OPERATOR <> (
PROCEDURE = isnne,
LEFTARG = ean13,
RIGHTARG = isbn,
COMMUTATOR = <>,
NEGATOR = =,
RESTRICT = neqsel,
JOIN = neqjoinsel);
CREATE OPERATOR < (
PROCEDURE = isnlt,
LEFTARG = ean13,
RIGHTARG = ismn,
COMMUTATOR = >,
NEGATOR = >=,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR <= (
PROCEDURE = isnle,
LEFTARG = ean13,
RIGHTARG = ismn,
COMMUTATOR = >=,
NEGATOR = >,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR = (
PROCEDURE = isneq,
LEFTARG = ean13,
RIGHTARG = ismn,
COMMUTATOR = =,
NEGATOR = <>,
RESTRICT = eqsel,
JOIN = eqjoinsel,
MERGES,
HASHES);
CREATE OPERATOR >= (
PROCEDURE = isnge,
LEFTARG = ean13,
RIGHTARG = ismn,
COMMUTATOR = <=,
NEGATOR = <,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel);
CREATE OPERATOR > (
PROCEDURE = isngt,
LEFTARG = ean13,
RIGHTARG = ismn,
COMMUTATOR = <,
NEGATOR = <=,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel);
CREATE OPERATOR <> (
PROCEDURE = isnne,
LEFTARG = ean13,
RIGHTARG = ismn,
COMMUTATOR = <>,
NEGATOR = =,
RESTRICT = neqsel,
JOIN = neqjoinsel);
CREATE OPERATOR < (
PROCEDURE = isnlt,
LEFTARG = ean13,
RIGHTARG = issn,
COMMUTATOR = >,
NEGATOR = >=,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR <= (
PROCEDURE = isnle,
LEFTARG = ean13,
RIGHTARG = issn,
COMMUTATOR = >=,
NEGATOR = >,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR = (
PROCEDURE = isneq,
LEFTARG = ean13,
RIGHTARG = issn,
COMMUTATOR = =,
NEGATOR = <>,
RESTRICT = eqsel,
JOIN = eqjoinsel,
MERGES,
HASHES);
CREATE OPERATOR >= (
PROCEDURE = isnge,
LEFTARG = ean13,
RIGHTARG = issn,
COMMUTATOR = <=,
NEGATOR = <,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel);
CREATE OPERATOR > (
PROCEDURE = isngt,
LEFTARG = ean13,
RIGHTARG = issn,
COMMUTATOR = <,
NEGATOR = <=,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel);
CREATE OPERATOR <> (
PROCEDURE = isnne,
LEFTARG = ean13,
RIGHTARG = issn,
COMMUTATOR = <>,
NEGATOR = =,
RESTRICT = neqsel,
JOIN = neqjoinsel);
CREATE OPERATOR < (
PROCEDURE = isnlt,
LEFTARG = ean13,
RIGHTARG = upc,
COMMUTATOR = >,
NEGATOR = >=,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR <= (
PROCEDURE = isnle,
LEFTARG = ean13,
RIGHTARG = upc,
COMMUTATOR = >=,
NEGATOR = >,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR = (
PROCEDURE = isneq,
LEFTARG = ean13,
RIGHTARG = upc,
COMMUTATOR = =,
NEGATOR = <>,
RESTRICT = eqsel,
JOIN = eqjoinsel,
MERGES,
HASHES);
CREATE OPERATOR >= (
PROCEDURE = isnge,
LEFTARG = ean13,
RIGHTARG = upc,
COMMUTATOR = <=,
NEGATOR = <,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel);
CREATE OPERATOR > (
PROCEDURE = isngt,
LEFTARG = ean13,
RIGHTARG = upc,
COMMUTATOR = <,
NEGATOR = <=,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel);
CREATE OPERATOR <> (
PROCEDURE = isnne,
LEFTARG = ean13,
RIGHTARG = upc,
COMMUTATOR = <>,
NEGATOR = =,
RESTRICT = neqsel,
JOIN = neqjoinsel);
--
-- ISBN13 operators:
--
---------------------------------------------------
CREATE OPERATOR < (
PROCEDURE = isnlt,
LEFTARG = isbn13,
RIGHTARG = isbn13,
COMMUTATOR = >,
NEGATOR = >=,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR <= (
PROCEDURE = isnle,
LEFTARG = isbn13,
RIGHTARG = isbn13,
COMMUTATOR = >=,
NEGATOR = >,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR = (
PROCEDURE = isneq,
LEFTARG = isbn13,
RIGHTARG = isbn13,
COMMUTATOR = =,
NEGATOR = <>,
RESTRICT = eqsel,
JOIN = eqjoinsel,
MERGES,
HASHES);
CREATE OPERATOR >= (
PROCEDURE = isnge,
LEFTARG = isbn13,
RIGHTARG = isbn13,
COMMUTATOR = <=,
NEGATOR = <,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR > (
PROCEDURE = isngt,
LEFTARG = isbn13,
RIGHTARG = isbn13,
COMMUTATOR = <,
NEGATOR = <=,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR <> (
PROCEDURE = isnne,
LEFTARG = isbn13,
RIGHTARG = isbn13,
COMMUTATOR = <>,
NEGATOR = =,
RESTRICT = neqsel,
JOIN = neqjoinsel);
CREATE OPERATOR < (
PROCEDURE = isnlt,
LEFTARG = isbn13,
RIGHTARG = isbn,
COMMUTATOR = >,
NEGATOR = >=,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR <= (
PROCEDURE = isnle,
LEFTARG = isbn13,
RIGHTARG = isbn,
COMMUTATOR = >=,
NEGATOR = >,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR = (
PROCEDURE = isneq,
LEFTARG = isbn13,
RIGHTARG = isbn,
COMMUTATOR = =,
NEGATOR = <>,
RESTRICT = eqsel,
JOIN = eqjoinsel,
MERGES,
HASHES);
CREATE OPERATOR >= (
PROCEDURE = isnge,
LEFTARG = isbn13,
RIGHTARG = isbn,
COMMUTATOR = <=,
NEGATOR = <,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR > (
PROCEDURE = isngt,
LEFTARG = isbn13,
RIGHTARG = isbn,
COMMUTATOR = <,
NEGATOR = <=,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR <> (
PROCEDURE = isnne,
LEFTARG = isbn13,
RIGHTARG = isbn,
COMMUTATOR = <>,
NEGATOR = =,
RESTRICT = neqsel,
JOIN = neqjoinsel);
--
-- ISBN operators:
--
---------------------------------------------------
CREATE OPERATOR < (
PROCEDURE = isnlt,
LEFTARG = isbn,
RIGHTARG = isbn,
COMMUTATOR = >,
NEGATOR = >=,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR <= (
PROCEDURE = isnle,
LEFTARG = isbn,
RIGHTARG = isbn,
COMMUTATOR = >=,
NEGATOR = >,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR = (
PROCEDURE = isneq,
LEFTARG = isbn,
RIGHTARG = isbn,
COMMUTATOR = =,
NEGATOR = <>,
RESTRICT = eqsel,
JOIN = eqjoinsel,
MERGES,
HASHES);
CREATE OPERATOR >= (
PROCEDURE = isnge,
LEFTARG = isbn,
RIGHTARG = isbn,
COMMUTATOR = <=,
NEGATOR = <,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR > (
PROCEDURE = isngt,
LEFTARG = isbn,
RIGHTARG = isbn,
COMMUTATOR = <,
NEGATOR = <=,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR <> (
PROCEDURE = isnne,
LEFTARG = isbn,
RIGHTARG = isbn,
COMMUTATOR = <>,
NEGATOR = =,
RESTRICT = neqsel,
JOIN = neqjoinsel);
CREATE OPERATOR < (
PROCEDURE = isnlt,
LEFTARG = isbn,
RIGHTARG = isbn13,
COMMUTATOR = >,
NEGATOR = >=,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR <= (
PROCEDURE = isnle,
LEFTARG = isbn,
RIGHTARG = isbn13,
COMMUTATOR = >=,
NEGATOR = >,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR = (
PROCEDURE = isneq,
LEFTARG = isbn,
RIGHTARG = isbn13,
COMMUTATOR = =,
NEGATOR = <>,
RESTRICT = eqsel,
JOIN = eqjoinsel,
MERGES,
HASHES);
CREATE OPERATOR >= (
PROCEDURE = isnge,
LEFTARG = isbn,
RIGHTARG = isbn13,
COMMUTATOR = <=,
NEGATOR = <,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR > (
PROCEDURE = isngt,
LEFTARG = isbn,
RIGHTARG = isbn13,
COMMUTATOR = <,
NEGATOR = <=,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR <> (
PROCEDURE = isnne,
LEFTARG = isbn,
RIGHTARG = isbn13,
COMMUTATOR = <>,
NEGATOR = =,
RESTRICT = neqsel,
JOIN = neqjoinsel);
CREATE OPERATOR < (
PROCEDURE = isnlt,
LEFTARG = isbn,
RIGHTARG = ean13,
COMMUTATOR = >,
NEGATOR = >=,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR <= (
PROCEDURE = isnle,
LEFTARG = isbn,
RIGHTARG = ean13,
COMMUTATOR = >=,
NEGATOR = >,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR = (
PROCEDURE = isneq,
LEFTARG = isbn,
RIGHTARG = ean13,
COMMUTATOR = =,
NEGATOR = <>,
RESTRICT = eqsel,
JOIN = eqjoinsel,
MERGES,
HASHES);
CREATE OPERATOR >= (
PROCEDURE = isnge,
LEFTARG = isbn,
RIGHTARG = ean13,
COMMUTATOR = <=,
NEGATOR = <,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR > (
PROCEDURE = isngt,
LEFTARG = isbn,
RIGHTARG = ean13,
COMMUTATOR = <,
NEGATOR = <=,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR <> (
PROCEDURE = isnne,
LEFTARG = isbn,
RIGHTARG = ean13,
COMMUTATOR = <>,
NEGATOR = =,
RESTRICT = neqsel,
JOIN = neqjoinsel);
--
-- ISMN13 operators:
--
---------------------------------------------------
CREATE OPERATOR < (
PROCEDURE = isnlt,
LEFTARG = ismn13,
RIGHTARG = ismn13,
COMMUTATOR = >,
NEGATOR = >=,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR <= (
PROCEDURE = isnle,
LEFTARG = ismn13,
RIGHTARG = ismn13,
COMMUTATOR = >=,
NEGATOR = >,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR = (
PROCEDURE = isneq,
LEFTARG = ismn13,
RIGHTARG = ismn13,
COMMUTATOR = =,
NEGATOR = <>,
RESTRICT = eqsel,
JOIN = eqjoinsel,
MERGES,
HASHES);
CREATE OPERATOR >= (
PROCEDURE = isnge,
LEFTARG = ismn13,
RIGHTARG = ismn13,
COMMUTATOR = <=,
NEGATOR = <,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR > (
PROCEDURE = isngt,
LEFTARG = ismn13,
RIGHTARG = ismn13,
COMMUTATOR = <,
NEGATOR = <=,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR <> (
PROCEDURE = isnne,
LEFTARG = ismn13,
RIGHTARG = ismn13,
COMMUTATOR = <>,
NEGATOR = =,
RESTRICT = neqsel,
JOIN = neqjoinsel);
CREATE OPERATOR < (
PROCEDURE = isnlt,
LEFTARG = ismn13,
RIGHTARG = ismn,
COMMUTATOR = >,
NEGATOR = >=,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR <= (
PROCEDURE = isnle,
LEFTARG = ismn13,
RIGHTARG = ismn,
COMMUTATOR = >=,
NEGATOR = >,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR = (
PROCEDURE = isneq,
LEFTARG = ismn13,
RIGHTARG = ismn,
COMMUTATOR = =,
NEGATOR = <>,
RESTRICT = eqsel,
JOIN = eqjoinsel,
MERGES,
HASHES);
CREATE OPERATOR >= (
PROCEDURE = isnge,
LEFTARG = ismn13,
RIGHTARG = ismn,
COMMUTATOR = <=,
NEGATOR = <,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR > (
PROCEDURE = isngt,
LEFTARG = ismn13,
RIGHTARG = ismn,
COMMUTATOR = <,
NEGATOR = <=,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR <> (
PROCEDURE = isnne,
LEFTARG = ismn13,
RIGHTARG = ismn,
COMMUTATOR = <>,
NEGATOR = =,
RESTRICT = neqsel,
JOIN = neqjoinsel);
--
-- ISMN operators:
--
---------------------------------------------------
CREATE OPERATOR < (
PROCEDURE = isnlt,
LEFTARG = ismn,
RIGHTARG = ismn,
COMMUTATOR = >,
NEGATOR = >=,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR <= (
PROCEDURE = isnle,
LEFTARG = ismn,
RIGHTARG = ismn,
COMMUTATOR = >=,
NEGATOR = >,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR = (
PROCEDURE = isneq,
LEFTARG = ismn,
RIGHTARG = ismn,
COMMUTATOR = =,
NEGATOR = <>,
RESTRICT = eqsel,
JOIN = eqjoinsel,
MERGES,
HASHES);
CREATE OPERATOR >= (
PROCEDURE = isnge,
LEFTARG = ismn,
RIGHTARG = ismn,
COMMUTATOR = <=,
NEGATOR = <,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR > (
PROCEDURE = isngt,
LEFTARG = ismn,
RIGHTARG = ismn,
COMMUTATOR = <,
NEGATOR = <=,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR <> (
PROCEDURE = isnne,
LEFTARG = ismn,
RIGHTARG = ismn,
COMMUTATOR = <>,
NEGATOR = =,
RESTRICT = neqsel,
JOIN = neqjoinsel);
CREATE OPERATOR < (
PROCEDURE = isnlt,
LEFTARG = ismn,
RIGHTARG = ismn13,
COMMUTATOR = >,
NEGATOR = >=,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR <= (
PROCEDURE = isnle,
LEFTARG = ismn,
RIGHTARG = ismn13,
COMMUTATOR = >=,
NEGATOR = >,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR = (
PROCEDURE = isneq,
LEFTARG = ismn,
RIGHTARG = ismn13,
COMMUTATOR = =,
NEGATOR = <>,
RESTRICT = eqsel,
JOIN = eqjoinsel,
MERGES,
HASHES);
CREATE OPERATOR >= (
PROCEDURE = isnge,
LEFTARG = ismn,
RIGHTARG = ismn13,
COMMUTATOR = <=,
NEGATOR = <,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR > (
PROCEDURE = isngt,
LEFTARG = ismn,
RIGHTARG = ismn13,
COMMUTATOR = <,
NEGATOR = <=,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR <> (
PROCEDURE = isnne,
LEFTARG = ismn,
RIGHTARG = ismn13,
COMMUTATOR = <>,
NEGATOR = =,
RESTRICT = neqsel,
JOIN = neqjoinsel);
CREATE OPERATOR < (
PROCEDURE = isnlt,
LEFTARG = ismn,
RIGHTARG = ean13,
COMMUTATOR = >,
NEGATOR = >=,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR <= (
PROCEDURE = isnle,
LEFTARG = ismn,
RIGHTARG = ean13,
COMMUTATOR = >=,
NEGATOR = >,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR = (
PROCEDURE = isneq,
LEFTARG = ismn,
RIGHTARG = ean13,
COMMUTATOR = =,
NEGATOR = <>,
RESTRICT = eqsel,
JOIN = eqjoinsel,
MERGES,
HASHES);
CREATE OPERATOR >= (
PROCEDURE = isnge,
LEFTARG = ismn,
RIGHTARG = ean13,
COMMUTATOR = <=,
NEGATOR = <,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR > (
PROCEDURE = isngt,
LEFTARG = ismn,
RIGHTARG = ean13,
COMMUTATOR = <,
NEGATOR = <=,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR <> (
PROCEDURE = isnne,
LEFTARG = ismn,
RIGHTARG = ean13,
COMMUTATOR = <>,
NEGATOR = =,
RESTRICT = neqsel,
JOIN = neqjoinsel);
--
-- ISSN13 operators:
--
---------------------------------------------------
CREATE OPERATOR < (
PROCEDURE = isnlt,
LEFTARG = issn13,
RIGHTARG = issn13,
COMMUTATOR = >,
NEGATOR = >=,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR <= (
PROCEDURE = isnle,
LEFTARG = issn13,
RIGHTARG = issn13,
COMMUTATOR = >=,
NEGATOR = >,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR = (
PROCEDURE = isneq,
LEFTARG = issn13,
RIGHTARG = issn13,
COMMUTATOR = =,
NEGATOR = <>,
RESTRICT = eqsel,
JOIN = eqjoinsel,
MERGES,
HASHES);
CREATE OPERATOR >= (
PROCEDURE = isnge,
LEFTARG = issn13,
RIGHTARG = issn13,
COMMUTATOR = <=,
NEGATOR = <,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR > (
PROCEDURE = isngt,
LEFTARG = issn13,
RIGHTARG = issn13,
COMMUTATOR = <,
NEGATOR = <=,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR <> (
PROCEDURE = isnne,
LEFTARG = issn13,
RIGHTARG = issn13,
COMMUTATOR = <>,
NEGATOR = =,
RESTRICT = neqsel,
JOIN = neqjoinsel);
CREATE OPERATOR < (
PROCEDURE = isnlt,
LEFTARG = issn13,
RIGHTARG = issn,
COMMUTATOR = >,
NEGATOR = >=,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR <= (
PROCEDURE = isnle,
LEFTARG = issn13,
RIGHTARG = issn,
COMMUTATOR = >=,
NEGATOR = >,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR = (
PROCEDURE = isneq,
LEFTARG = issn13,
RIGHTARG = issn,
COMMUTATOR = =,
NEGATOR = <>,
RESTRICT = eqsel,
JOIN = eqjoinsel,
MERGES,
HASHES);
CREATE OPERATOR >= (
PROCEDURE = isnge,
LEFTARG = issn13,
RIGHTARG = issn,
COMMUTATOR = <=,
NEGATOR = <,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR > (
PROCEDURE = isngt,
LEFTARG = issn13,
RIGHTARG = issn,
COMMUTATOR = <,
NEGATOR = <=,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR <> (
PROCEDURE = isnne,
LEFTARG = issn13,
RIGHTARG = issn,
COMMUTATOR = <>,
NEGATOR = =,
RESTRICT = neqsel,
JOIN = neqjoinsel);
CREATE OPERATOR < (
PROCEDURE = isnlt,
LEFTARG = issn13,
RIGHTARG = ean13,
COMMUTATOR = >,
NEGATOR = >=,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR <= (
PROCEDURE = isnle,
LEFTARG = issn13,
RIGHTARG = ean13,
COMMUTATOR = >=,
NEGATOR = >,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR = (
PROCEDURE = isneq,
LEFTARG = issn13,
RIGHTARG = ean13,
COMMUTATOR = =,
NEGATOR = <>,
RESTRICT = eqsel,
JOIN = eqjoinsel,
MERGES,
HASHES);
CREATE OPERATOR >= (
PROCEDURE = isnge,
LEFTARG = issn13,
RIGHTARG = ean13,
COMMUTATOR = <=,
NEGATOR = <,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR > (
PROCEDURE = isngt,
LEFTARG = issn13,
RIGHTARG = ean13,
COMMUTATOR = <,
NEGATOR = <=,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR <> (
PROCEDURE = isnne,
LEFTARG = issn13,
RIGHTARG = ean13,
COMMUTATOR = <>,
NEGATOR = =,
RESTRICT = neqsel,
JOIN = neqjoinsel);
--
-- ISSN operators:
--
---------------------------------------------------
CREATE OPERATOR < (
PROCEDURE = isnlt,
LEFTARG = issn,
RIGHTARG = issn,
COMMUTATOR = >,
NEGATOR = >=,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR <= (
PROCEDURE = isnle,
LEFTARG = issn,
RIGHTARG = issn,
COMMUTATOR = >=,
NEGATOR = >,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR = (
PROCEDURE = isneq,
LEFTARG = issn,
RIGHTARG = issn,
COMMUTATOR = =,
NEGATOR = <>,
RESTRICT = eqsel,
JOIN = eqjoinsel,
MERGES,
HASHES);
CREATE OPERATOR >= (
PROCEDURE = isnge,
LEFTARG = issn,
RIGHTARG = issn,
COMMUTATOR = <=,
NEGATOR = <,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR > (
PROCEDURE = isngt,
LEFTARG = issn,
RIGHTARG = issn,
COMMUTATOR = <,
NEGATOR = <=,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR <> (
PROCEDURE = isnne,
LEFTARG = issn,
RIGHTARG = issn,
COMMUTATOR = <>,
NEGATOR = =,
RESTRICT = neqsel,
JOIN = neqjoinsel);
CREATE OPERATOR < (
PROCEDURE = isnlt,
LEFTARG = issn,
RIGHTARG = issn13,
COMMUTATOR = >,
NEGATOR = >=,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR <= (
PROCEDURE = isnle,
LEFTARG = issn,
RIGHTARG = issn13,
COMMUTATOR = >=,
NEGATOR = >,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR = (
PROCEDURE = isneq,
LEFTARG = issn,
RIGHTARG = issn13,
COMMUTATOR = =,
NEGATOR = <>,
RESTRICT = eqsel,
JOIN = eqjoinsel,
MERGES,
HASHES);
CREATE OPERATOR >= (
PROCEDURE = isnge,
LEFTARG = issn,
RIGHTARG = issn13,
COMMUTATOR = <=,
NEGATOR = <,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR > (
PROCEDURE = isngt,
LEFTARG = issn,
RIGHTARG = issn13,
COMMUTATOR = <,
NEGATOR = <=,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR <> (
PROCEDURE = isnne,
LEFTARG = issn,
RIGHTARG = issn13,
COMMUTATOR = <>,
NEGATOR = =,
RESTRICT = neqsel,
JOIN = neqjoinsel);
CREATE OPERATOR < (
PROCEDURE = isnlt,
LEFTARG = issn,
RIGHTARG = ean13,
COMMUTATOR = >,
NEGATOR = >=,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR <= (
PROCEDURE = isnle,
LEFTARG = issn,
RIGHTARG = ean13,
COMMUTATOR = >=,
NEGATOR = >,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR = (
PROCEDURE = isneq,
LEFTARG = issn,
RIGHTARG = ean13,
COMMUTATOR = =,
NEGATOR = <>,
RESTRICT = eqsel,
JOIN = eqjoinsel,
MERGES,
HASHES);
CREATE OPERATOR >= (
PROCEDURE = isnge,
LEFTARG = issn,
RIGHTARG = ean13,
COMMUTATOR = <=,
NEGATOR = <,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR > (
PROCEDURE = isngt,
LEFTARG = issn,
RIGHTARG = ean13,
COMMUTATOR = <,
NEGATOR = <=,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR <> (
PROCEDURE = isnne,
LEFTARG = issn,
RIGHTARG = ean13,
COMMUTATOR = <>,
NEGATOR = =,
RESTRICT = neqsel,
JOIN = neqjoinsel);
--
-- UPC operators:
--
---------------------------------------------------
CREATE OPERATOR < (
PROCEDURE = isnlt,
LEFTARG = upc,
RIGHTARG = upc,
COMMUTATOR = >,
NEGATOR = >=,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR <= (
PROCEDURE = isnle,
LEFTARG = upc,
RIGHTARG = upc,
COMMUTATOR = >=,
NEGATOR = >,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR = (
PROCEDURE = isneq,
LEFTARG = upc,
RIGHTARG = upc,
COMMUTATOR = =,
NEGATOR = <>,
RESTRICT = eqsel,
JOIN = eqjoinsel,
MERGES,
HASHES);
CREATE OPERATOR >= (
PROCEDURE = isnge,
LEFTARG = upc,
RIGHTARG = upc,
COMMUTATOR = <=,
NEGATOR = <,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR > (
PROCEDURE = isngt,
LEFTARG = upc,
RIGHTARG = upc,
COMMUTATOR = <,
NEGATOR = <=,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR <> (
PROCEDURE = isnne,
LEFTARG = upc,
RIGHTARG = upc,
COMMUTATOR = <>,
NEGATOR = =,
RESTRICT = neqsel,
JOIN = neqjoinsel);
CREATE OPERATOR < (
PROCEDURE = isnlt,
LEFTARG = upc,
RIGHTARG = ean13,
COMMUTATOR = >,
NEGATOR = >=,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR <= (
PROCEDURE = isnle,
LEFTARG = upc,
RIGHTARG = ean13,
COMMUTATOR = >=,
NEGATOR = >,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR = (
PROCEDURE = isneq,
LEFTARG = upc,
RIGHTARG = ean13,
COMMUTATOR = =,
NEGATOR = <>,
RESTRICT = eqsel,
JOIN = eqjoinsel,
MERGES,
HASHES);
CREATE OPERATOR >= (
PROCEDURE = isnge,
LEFTARG = upc,
RIGHTARG = ean13,
COMMUTATOR = <=,
NEGATOR = <,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR > (
PROCEDURE = isngt,
LEFTARG = upc,
RIGHTARG = ean13,
COMMUTATOR = <,
NEGATOR = <=,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel );
CREATE OPERATOR <> (
PROCEDURE = isnne,
LEFTARG = upc,
RIGHTARG = ean13,
COMMUTATOR = <>,
NEGATOR = =,
RESTRICT = neqsel,
JOIN = neqjoinsel);
--
-- Operator families for the various operator classes:
--
---------------------------------------------------
CREATE OPERATOR FAMILY isn_ops USING btree;
CREATE OPERATOR FAMILY isn_ops USING hash;
--
-- Operator classes:
--
---------------------------------------------------
-- EAN13:
CREATE FUNCTION btean13cmp(ean13, ean13)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE OPERATOR CLASS ean13_ops DEFAULT
FOR TYPE ean13 USING btree FAMILY isn_ops AS
OPERATOR 1 <,
OPERATOR 2 <=,
OPERATOR 3 =,
OPERATOR 4 >=,
OPERATOR 5 >,
FUNCTION 1 btean13cmp(ean13, ean13);
CREATE FUNCTION hashean13(ean13)
RETURNS int4
AS 'hashint8'
LANGUAGE 'internal' IMMUTABLE STRICT
PARALLEL SAFE;
CREATE OPERATOR CLASS ean13_ops DEFAULT
FOR TYPE ean13 USING hash FAMILY isn_ops AS
OPERATOR 1 =,
FUNCTION 1 hashean13(ean13);
-- EAN13 vs other types:
CREATE FUNCTION btean13cmp(ean13, isbn13)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION btean13cmp(ean13, ismn13)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION btean13cmp(ean13, issn13)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION btean13cmp(ean13, isbn)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION btean13cmp(ean13, ismn)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION btean13cmp(ean13, issn)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION btean13cmp(ean13, upc)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
ALTER OPERATOR FAMILY isn_ops USING btree ADD
OPERATOR 1 < (ean13, isbn13),
OPERATOR 1 < (ean13, ismn13),
OPERATOR 1 < (ean13, issn13),
OPERATOR 1 < (ean13, isbn),
OPERATOR 1 < (ean13, ismn),
OPERATOR 1 < (ean13, issn),
OPERATOR 1 < (ean13, upc),
OPERATOR 2 <= (ean13, isbn13),
OPERATOR 2 <= (ean13, ismn13),
OPERATOR 2 <= (ean13, issn13),
OPERATOR 2 <= (ean13, isbn),
OPERATOR 2 <= (ean13, ismn),
OPERATOR 2 <= (ean13, issn),
OPERATOR 2 <= (ean13, upc),
OPERATOR 3 = (ean13, isbn13),
OPERATOR 3 = (ean13, ismn13),
OPERATOR 3 = (ean13, issn13),
OPERATOR 3 = (ean13, isbn),
OPERATOR 3 = (ean13, ismn),
OPERATOR 3 = (ean13, issn),
OPERATOR 3 = (ean13, upc),
OPERATOR 4 >= (ean13, isbn13),
OPERATOR 4 >= (ean13, ismn13),
OPERATOR 4 >= (ean13, issn13),
OPERATOR 4 >= (ean13, isbn),
OPERATOR 4 >= (ean13, ismn),
OPERATOR 4 >= (ean13, issn),
OPERATOR 4 >= (ean13, upc),
OPERATOR 5 > (ean13, isbn13),
OPERATOR 5 > (ean13, ismn13),
OPERATOR 5 > (ean13, issn13),
OPERATOR 5 > (ean13, isbn),
OPERATOR 5 > (ean13, ismn),
OPERATOR 5 > (ean13, issn),
OPERATOR 5 > (ean13, upc),
FUNCTION 1 btean13cmp(ean13, isbn13),
FUNCTION 1 btean13cmp(ean13, ismn13),
FUNCTION 1 btean13cmp(ean13, issn13),
FUNCTION 1 btean13cmp(ean13, isbn),
FUNCTION 1 btean13cmp(ean13, ismn),
FUNCTION 1 btean13cmp(ean13, issn),
FUNCTION 1 btean13cmp(ean13, upc);
ALTER OPERATOR FAMILY isn_ops USING hash ADD
OPERATOR 1 = (ean13, isbn13),
OPERATOR 1 = (ean13, ismn13),
OPERATOR 1 = (ean13, issn13),
OPERATOR 1 = (ean13, isbn),
OPERATOR 1 = (ean13, ismn),
OPERATOR 1 = (ean13, issn),
OPERATOR 1 = (ean13, upc);
---------------------------------------------------
-- ISBN13:
CREATE FUNCTION btisbn13cmp(isbn13, isbn13)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE OPERATOR CLASS isbn13_ops DEFAULT
FOR TYPE isbn13 USING btree FAMILY isn_ops AS
OPERATOR 1 <,
OPERATOR 2 <=,
OPERATOR 3 =,
OPERATOR 4 >=,
OPERATOR 5 >,
FUNCTION 1 btisbn13cmp(isbn13, isbn13);
CREATE FUNCTION hashisbn13(isbn13)
RETURNS int4
AS 'hashint8'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE OPERATOR CLASS isbn13_ops DEFAULT
FOR TYPE isbn13 USING hash FAMILY isn_ops AS
OPERATOR 1 =,
FUNCTION 1 hashisbn13(isbn13);
-- ISBN13 vs other types:
CREATE FUNCTION btisbn13cmp(isbn13, ean13)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION btisbn13cmp(isbn13, isbn)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
ALTER OPERATOR FAMILY isn_ops USING btree ADD
OPERATOR 1 < (isbn13, ean13),
OPERATOR 1 < (isbn13, isbn),
OPERATOR 2 <= (isbn13, ean13),
OPERATOR 2 <= (isbn13, isbn),
OPERATOR 3 = (isbn13, ean13),
OPERATOR 3 = (isbn13, isbn),
OPERATOR 4 >= (isbn13, ean13),
OPERATOR 4 >= (isbn13, isbn),
OPERATOR 5 > (isbn13, ean13),
OPERATOR 5 > (isbn13, isbn),
FUNCTION 1 btisbn13cmp(isbn13, ean13),
FUNCTION 1 btisbn13cmp(isbn13, isbn);
ALTER OPERATOR FAMILY isn_ops USING hash ADD
OPERATOR 1 = (isbn13, ean13),
OPERATOR 1 = (isbn13, isbn);
---------------------------------------------------
-- ISBN:
CREATE FUNCTION btisbncmp(isbn, isbn)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE OPERATOR CLASS isbn_ops DEFAULT
FOR TYPE isbn USING btree FAMILY isn_ops AS
OPERATOR 1 <,
OPERATOR 2 <=,
OPERATOR 3 =,
OPERATOR 4 >=,
OPERATOR 5 >,
FUNCTION 1 btisbncmp(isbn, isbn);
CREATE FUNCTION hashisbn(isbn)
RETURNS int4
AS 'hashint8'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE OPERATOR CLASS isbn_ops DEFAULT
FOR TYPE isbn USING hash FAMILY isn_ops AS
OPERATOR 1 =,
FUNCTION 1 hashisbn(isbn);
-- ISBN vs other types:
CREATE FUNCTION btisbncmp(isbn, ean13)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION btisbncmp(isbn, isbn13)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
ALTER OPERATOR FAMILY isn_ops USING btree ADD
OPERATOR 1 < (isbn, ean13),
OPERATOR 1 < (isbn, isbn13),
OPERATOR 2 <= (isbn, ean13),
OPERATOR 2 <= (isbn, isbn13),
OPERATOR 3 = (isbn, ean13),
OPERATOR 3 = (isbn, isbn13),
OPERATOR 4 >= (isbn, ean13),
OPERATOR 4 >= (isbn, isbn13),
OPERATOR 5 > (isbn, ean13),
OPERATOR 5 > (isbn, isbn13),
FUNCTION 1 btisbncmp(isbn, ean13),
FUNCTION 1 btisbncmp(isbn, isbn13);
ALTER OPERATOR FAMILY isn_ops USING hash ADD
OPERATOR 1 = (isbn, ean13),
OPERATOR 1 = (isbn, isbn13);
---------------------------------------------------
-- ISMN13:
CREATE FUNCTION btismn13cmp(ismn13, ismn13)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE OPERATOR CLASS ismn13_ops DEFAULT
FOR TYPE ismn13 USING btree FAMILY isn_ops AS
OPERATOR 1 <,
OPERATOR 2 <=,
OPERATOR 3 =,
OPERATOR 4 >=,
OPERATOR 5 >,
FUNCTION 1 btismn13cmp(ismn13, ismn13);
CREATE FUNCTION hashismn13(ismn13)
RETURNS int4
AS 'hashint8'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE OPERATOR CLASS ismn13_ops DEFAULT
FOR TYPE ismn13 USING hash FAMILY isn_ops AS
OPERATOR 1 =,
FUNCTION 1 hashismn13(ismn13);
-- ISMN13 vs other types:
CREATE FUNCTION btismn13cmp(ismn13, ean13)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION btismn13cmp(ismn13, ismn)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
ALTER OPERATOR FAMILY isn_ops USING btree ADD
OPERATOR 1 < (ismn13, ean13),
OPERATOR 1 < (ismn13, ismn),
OPERATOR 2 <= (ismn13, ean13),
OPERATOR 2 <= (ismn13, ismn),
OPERATOR 3 = (ismn13, ean13),
OPERATOR 3 = (ismn13, ismn),
OPERATOR 4 >= (ismn13, ean13),
OPERATOR 4 >= (ismn13, ismn),
OPERATOR 5 > (ismn13, ean13),
OPERATOR 5 > (ismn13, ismn),
FUNCTION 1 btismn13cmp(ismn13, ean13),
FUNCTION 1 btismn13cmp(ismn13, ismn);
ALTER OPERATOR FAMILY isn_ops USING hash ADD
OPERATOR 1 = (ismn13, ean13),
OPERATOR 1 = (ismn13, ismn);
---------------------------------------------------
-- ISMN:
CREATE FUNCTION btismncmp(ismn, ismn)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE OPERATOR CLASS ismn_ops DEFAULT
FOR TYPE ismn USING btree FAMILY isn_ops AS
OPERATOR 1 <,
OPERATOR 2 <=,
OPERATOR 3 =,
OPERATOR 4 >=,
OPERATOR 5 >,
FUNCTION 1 btismncmp(ismn, ismn);
CREATE FUNCTION hashismn(ismn)
RETURNS int4
AS 'hashint8'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE OPERATOR CLASS ismn_ops DEFAULT
FOR TYPE ismn USING hash FAMILY isn_ops AS
OPERATOR 1 =,
FUNCTION 1 hashismn(ismn);
-- ISMN vs other types:
CREATE FUNCTION btismncmp(ismn, ean13)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION btismncmp(ismn, ismn13)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
ALTER OPERATOR FAMILY isn_ops USING btree ADD
OPERATOR 1 < (ismn, ean13),
OPERATOR 1 < (ismn, ismn13),
OPERATOR 2 <= (ismn, ean13),
OPERATOR 2 <= (ismn, ismn13),
OPERATOR 3 = (ismn, ean13),
OPERATOR 3 = (ismn, ismn13),
OPERATOR 4 >= (ismn, ean13),
OPERATOR 4 >= (ismn, ismn13),
OPERATOR 5 > (ismn, ean13),
OPERATOR 5 > (ismn, ismn13),
FUNCTION 1 btismncmp(ismn, ean13),
FUNCTION 1 btismncmp(ismn, ismn13);
ALTER OPERATOR FAMILY isn_ops USING hash ADD
OPERATOR 1 = (ismn, ean13),
OPERATOR 1 = (ismn, ismn13);
---------------------------------------------------
-- ISSN13:
CREATE FUNCTION btissn13cmp(issn13, issn13)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE OPERATOR CLASS issn13_ops DEFAULT
FOR TYPE issn13 USING btree FAMILY isn_ops AS
OPERATOR 1 <,
OPERATOR 2 <=,
OPERATOR 3 =,
OPERATOR 4 >=,
OPERATOR 5 >,
FUNCTION 1 btissn13cmp(issn13, issn13);
CREATE FUNCTION hashissn13(issn13)
RETURNS int4
AS 'hashint8'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE OPERATOR CLASS issn13_ops DEFAULT
FOR TYPE issn13 USING hash FAMILY isn_ops AS
OPERATOR 1 =,
FUNCTION 1 hashissn13(issn13);
-- ISSN13 vs other types:
CREATE FUNCTION btissn13cmp(issn13, ean13)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION btissn13cmp(issn13, issn)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
ALTER OPERATOR FAMILY isn_ops USING btree ADD
OPERATOR 1 < (issn13, ean13),
OPERATOR 1 < (issn13, issn),
OPERATOR 2 <= (issn13, ean13),
OPERATOR 2 <= (issn13, issn),
OPERATOR 3 = (issn13, ean13),
OPERATOR 3 = (issn13, issn),
OPERATOR 4 >= (issn13, ean13),
OPERATOR 4 >= (issn13, issn),
OPERATOR 5 > (issn13, ean13),
OPERATOR 5 > (issn13, issn),
FUNCTION 1 btissn13cmp(issn13, ean13),
FUNCTION 1 btissn13cmp(issn13, issn);
ALTER OPERATOR FAMILY isn_ops USING hash ADD
OPERATOR 1 = (issn13, ean13),
OPERATOR 1 = (issn13, issn);
---------------------------------------------------
-- ISSN:
CREATE FUNCTION btissncmp(issn, issn)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE OPERATOR CLASS issn_ops DEFAULT
FOR TYPE issn USING btree FAMILY isn_ops AS
OPERATOR 1 <,
OPERATOR 2 <=,
OPERATOR 3 =,
OPERATOR 4 >=,
OPERATOR 5 >,
FUNCTION 1 btissncmp(issn, issn);
CREATE FUNCTION hashissn(issn)
RETURNS int4
AS 'hashint8'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE OPERATOR CLASS issn_ops DEFAULT
FOR TYPE issn USING hash FAMILY isn_ops AS
OPERATOR 1 =,
FUNCTION 1 hashissn(issn);
-- ISSN vs other types:
CREATE FUNCTION btissncmp(issn, ean13)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION btissncmp(issn, issn13)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
ALTER OPERATOR FAMILY isn_ops USING btree ADD
OPERATOR 1 < (issn, ean13),
OPERATOR 1 < (issn, issn13),
OPERATOR 2 <= (issn, ean13),
OPERATOR 2 <= (issn, issn13),
OPERATOR 3 = (issn, ean13),
OPERATOR 3 = (issn, issn13),
OPERATOR 4 >= (issn, ean13),
OPERATOR 4 >= (issn, issn13),
OPERATOR 5 > (issn, ean13),
OPERATOR 5 > (issn, issn13),
FUNCTION 1 btissncmp(issn, ean13),
FUNCTION 1 btissncmp(issn, issn13);
ALTER OPERATOR FAMILY isn_ops USING hash ADD
OPERATOR 1 = (issn, ean13),
OPERATOR 1 = (issn, issn13);
---------------------------------------------------
-- UPC:
CREATE FUNCTION btupccmp(upc, upc)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE OPERATOR CLASS upc_ops DEFAULT
FOR TYPE upc USING btree FAMILY isn_ops AS
OPERATOR 1 <,
OPERATOR 2 <=,
OPERATOR 3 =,
OPERATOR 4 >=,
OPERATOR 5 >,
FUNCTION 1 btupccmp(upc, upc);
CREATE FUNCTION hashupc(upc)
RETURNS int4
AS 'hashint8'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE OPERATOR CLASS upc_ops DEFAULT
FOR TYPE upc USING hash FAMILY isn_ops AS
OPERATOR 1 =,
FUNCTION 1 hashupc(upc);
-- UPC vs other types:
CREATE FUNCTION btupccmp(upc, ean13)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT
PARALLEL SAFE;
ALTER OPERATOR FAMILY isn_ops USING btree ADD
OPERATOR 1 < (upc, ean13),
OPERATOR 2 <= (upc, ean13),
OPERATOR 3 = (upc, ean13),
OPERATOR 4 >= (upc, ean13),
OPERATOR 5 > (upc, ean13),
FUNCTION 1 btupccmp(upc, ean13);
ALTER OPERATOR FAMILY isn_ops USING hash ADD
OPERATOR 1 = (upc, ean13);
--
-- Type casts:
--
---------------------------------------------------
CREATE FUNCTION isbn13(ean13)
RETURNS isbn13
AS 'MODULE_PATHNAME', 'isbn_cast_from_ean13'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION ismn13(ean13)
RETURNS ismn13
AS 'MODULE_PATHNAME', 'ismn_cast_from_ean13'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION issn13(ean13)
RETURNS issn13
AS 'MODULE_PATHNAME', 'issn_cast_from_ean13'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION isbn(ean13)
RETURNS isbn
AS 'MODULE_PATHNAME', 'isbn_cast_from_ean13'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION ismn(ean13)
RETURNS ismn
AS 'MODULE_PATHNAME', 'ismn_cast_from_ean13'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION issn(ean13)
RETURNS issn
AS 'MODULE_PATHNAME', 'issn_cast_from_ean13'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION upc(ean13)
RETURNS upc
AS 'MODULE_PATHNAME', 'upc_cast_from_ean13'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE CAST (ean13 AS isbn13) WITH FUNCTION isbn13(ean13);
CREATE CAST (ean13 AS isbn) WITH FUNCTION isbn(ean13);
CREATE CAST (ean13 AS ismn13) WITH FUNCTION ismn13(ean13);
CREATE CAST (ean13 AS ismn) WITH FUNCTION ismn(ean13);
CREATE CAST (ean13 AS issn13) WITH FUNCTION issn13(ean13);
CREATE CAST (ean13 AS issn) WITH FUNCTION issn(ean13);
CREATE CAST (ean13 AS upc) WITH FUNCTION upc(ean13);
CREATE CAST (isbn13 AS ean13) WITHOUT FUNCTION AS ASSIGNMENT;
CREATE CAST (isbn AS ean13) WITHOUT FUNCTION AS ASSIGNMENT;
CREATE CAST (ismn13 AS ean13) WITHOUT FUNCTION AS ASSIGNMENT;
CREATE CAST (ismn AS ean13) WITHOUT FUNCTION AS ASSIGNMENT;
CREATE CAST (issn13 AS ean13) WITHOUT FUNCTION AS ASSIGNMENT;
CREATE CAST (issn AS ean13) WITHOUT FUNCTION AS ASSIGNMENT;
CREATE CAST (upc AS ean13) WITHOUT FUNCTION AS ASSIGNMENT;
CREATE CAST (isbn AS isbn13) WITHOUT FUNCTION AS ASSIGNMENT;
CREATE CAST (isbn13 AS isbn) WITHOUT FUNCTION AS ASSIGNMENT;
CREATE CAST (ismn AS ismn13) WITHOUT FUNCTION AS ASSIGNMENT;
CREATE CAST (ismn13 AS ismn) WITHOUT FUNCTION AS ASSIGNMENT;
CREATE CAST (issn AS issn13) WITHOUT FUNCTION AS ASSIGNMENT;
CREATE CAST (issn13 AS issn) WITHOUT FUNCTION AS ASSIGNMENT;
--
-- Validation stuff for lose types:
--
CREATE FUNCTION make_valid(ean13)
RETURNS ean13
AS 'MODULE_PATHNAME'
LANGUAGE C
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION make_valid(isbn13)
RETURNS isbn13
AS 'MODULE_PATHNAME'
LANGUAGE C
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION make_valid(ismn13)
RETURNS ismn13
AS 'MODULE_PATHNAME'
LANGUAGE C
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION make_valid(issn13)
RETURNS issn13
AS 'MODULE_PATHNAME'
LANGUAGE C
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION make_valid(isbn)
RETURNS isbn
AS 'MODULE_PATHNAME'
LANGUAGE C
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION make_valid(ismn)
RETURNS ismn
AS 'MODULE_PATHNAME'
LANGUAGE C
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION make_valid(issn)
RETURNS issn
AS 'MODULE_PATHNAME'
LANGUAGE C
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION make_valid(upc)
RETURNS upc
AS 'MODULE_PATHNAME'
LANGUAGE C
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION is_valid(ean13)
RETURNS boolean
AS 'MODULE_PATHNAME'
LANGUAGE C
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION is_valid(isbn13)
RETURNS boolean
AS 'MODULE_PATHNAME'
LANGUAGE C
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION is_valid(ismn13)
RETURNS boolean
AS 'MODULE_PATHNAME'
LANGUAGE C
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION is_valid(issn13)
RETURNS boolean
AS 'MODULE_PATHNAME'
LANGUAGE C
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION is_valid(isbn)
RETURNS boolean
AS 'MODULE_PATHNAME'
LANGUAGE C
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION is_valid(ismn)
RETURNS boolean
AS 'MODULE_PATHNAME'
LANGUAGE C
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION is_valid(issn)
RETURNS boolean
AS 'MODULE_PATHNAME'
LANGUAGE C
IMMUTABLE STRICT
PARALLEL SAFE;
CREATE FUNCTION is_valid(upc)
RETURNS boolean
AS 'MODULE_PATHNAME'
LANGUAGE C
IMMUTABLE STRICT
PARALLEL SAFE;
--
-- isn_weak(boolean) - Sets the weak input mode.
-- This function is intended for testing use only!
--
CREATE FUNCTION isn_weak(boolean)
RETURNS boolean
AS 'MODULE_PATHNAME', 'accept_weak_input'
LANGUAGE C
IMMUTABLE STRICT
PARALLEL RESTRICTED;
--
-- isn_weak() - Gets the weak input mode status
--
CREATE FUNCTION isn_weak()
RETURNS boolean
AS 'MODULE_PATHNAME', 'weak_input_status'
LANGUAGE C
IMMUTABLE STRICT
PARALLEL RESTRICTED; | the_stack |
-- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jul 05, 2017 at 11:30 PM
-- Server version: 5.5.55-0ubuntu0.14.04.1
-- PHP Version: 5.5.9-1ubuntu4.21
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `easyHousing`
--
-- --------------------------------------------------------
--
-- Table structure for table `Administrator`
--
CREATE TABLE IF NOT EXISTS `Administrator` (
`administratorDepartment` varchar(20) DEFAULT NULL,
`administratorId` int(11) NOT NULL AUTO_INCREMENT,
`administratorName` varchar(15) NOT NULL,
`administratorPassword` varchar(20) NOT NULL,
`administratorSex` varchar(5) DEFAULT NULL,
PRIMARY KEY (`administratorName`),
UNIQUE KEY `administratorId` (`administratorId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
--
-- Dumping data for table `Administrator`
--
INSERT INTO `Administrator` (`administratorDepartment`, `administratorId`, `administratorName`, `administratorPassword`, `administratorSex`) VALUES
('梅六305', 1, 'admin', 'team632', '女');
-- --------------------------------------------------------
--
-- Table structure for table `Agent`
--
CREATE TABLE IF NOT EXISTS `Agent` (
`agentId` int(11) NOT NULL,
`picUrl` varchar(200) DEFAULT NULL,
`agentName` varchar(20) DEFAULT NULL,
`agentEmail` varchar(20) DEFAULT NULL,
`agentPhoneNumber` varchar(20) DEFAULT NULL,
`agentSex` varchar(15) DEFAULT NULL,
PRIMARY KEY (`agentId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `Agent`
--
INSERT INTO `Agent` (`agentId`, `picUrl`, `agentName`, `agentEmail`, `agentPhoneNumber`, `agentSex`) VALUES
(1, '1421', 'sbgzy', '1231231@qq.com', '123124214', '男'),
(2132315, 'http://os8z6i0zb.bkt.clouddn.com/2017-07-04T10:52:56.766Z', '213231231', '455354', '231231423', '男'),
(20141791, 'http://os8z6i0zb.bkt.clouddn.com/defaultPhoto.png', '梁先锋', 'lainglsdi@163.com', '18059739987', '男');
-- --------------------------------------------------------
--
-- Table structure for table `BuildingDeal`
--
CREATE TABLE IF NOT EXISTS `BuildingDeal` (
`agentId` int(11) DEFAULT NULL,
`buildingId` int(11) DEFAULT NULL,
`userId` int(11) DEFAULT NULL,
`buildingDealPerPrice` int(11) DEFAULT NULL,
`buildingDealTotalPrice` int(11) DEFAULT NULL,
`buildingDealId` int(11) NOT NULL AUTO_INCREMENT,
`buildingDealTime` datetime DEFAULT NULL,
`buildingLayout` varchar(20) DEFAULT NULL,
`buildingArea` int(11) DEFAULT NULL,
PRIMARY KEY (`buildingDealId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ;
--
-- Dumping data for table `BuildingDeal`
--
INSERT INTO `BuildingDeal` (`agentId`, `buildingId`, `userId`, `buildingDealPerPrice`, `buildingDealTotalPrice`, `buildingDealId`, `buildingDealTime`, `buildingLayout`, `buildingArea`) VALUES
(20141791, 3, 6, 632, 632632632, 2, '2017-07-02 22:12:10', '1室0厅1厕', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `BuildingInfo`
--
CREATE TABLE IF NOT EXISTS `BuildingInfo` (
`buildingAddress` varchar(200) NOT NULL,
`buildingId` int(11) NOT NULL AUTO_INCREMENT,
`buildingName` varchar(200) NOT NULL,
`buildingDecoration` varchar(20) DEFAULT NULL,
`buildingMaxArea` int(11) DEFAULT NULL,
`buildingMinArea` int(11) DEFAULT NULL,
`buildingNeighbourhood` varchar(50) DEFAULT NULL,
`buildingReferencePrice` int(11) DEFAULT NULL,
`buildingSaleState` varchar(50) DEFAULT NULL,
`buildingTimeHanded` datetime DEFAULT NULL,
PRIMARY KEY (`buildingId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=17 ;
--
-- Dumping data for table `BuildingInfo`
--
INSERT INTO `BuildingInfo` (`buildingAddress`, `buildingId`, `buildingName`, `buildingDecoration`, `buildingMaxArea`, `buildingMinArea`, `buildingNeighbourhood`, `buildingReferencePrice`, `buildingSaleState`, `buildingTimeHanded`) VALUES
('重庆大学', 2, '梅园', '精修', 111, 110, 'huxi', 305, '待售', '2017-06-27 00:00:00'),
('重庆市沙坪坝区重庆大学虎溪校区松园3栋', 3, '松三', '简修', 20, 100, NULL, 632, '已售', '2011-11-10 00:00:00'),
('\r\n金州大道重光立交', 4, '恒大世纪城', '精装', 116, 63, '', 110, '在售', '2019-06-30 00:00:00'),
('照母山植物园旁', 5, '融创凡尔赛花园', '精装', 306, 306, '融创凡尔赛花园', 270, '在售', '2017-06-30 00:00:00'),
('金州大道北侧', 6, '北大资源博雅', '精装', 133, 133, NULL, 266, '在售', '2018-04-30 00:00:00'),
('\r\n渝北区空港大道', 7, '桥达蓝湾半岛', '精装', 73, 73, NULL, 61, '在售', '2018-12-30 00:00:00'),
('\r\n石桥铺石杨路附近', 8, '金辉优步大道', '精装', 78, 78, NULL, 125, '在售', '2018-12-27 00:00:00'),
('\r\n龙腾大道(陈家坪展览中心正对面)', 9, '通用晶城', '精装', 55, 58, NULL, 84, '在售', '2017-07-28 00:00:00'),
('西部新城陶家商圈', 10, '旭城公园府邸', '精装', 78, 78, NULL, 40, '在售', '2017-10-27 00:00:00'),
('北京城建龙樾湾', 11, '松三', '简修', NULL, NULL, NULL, 632, '已售', '2011-11-10 00:00:00'),
('西海岸', 12, '龙腾大道(陈家坪展览中心正对面)', '精装', 46, 88, NULL, 84, '在售', '2017-11-17 00:00:00'),
('九龙坡-石桥铺石杨路附近(原啤酒厂地块,永辉超市对面)', 13, '华宇锦绣花城', '精装', 78, 88, NULL, 130, '在售', '2018-05-11 00:00:00'),
('\r\n九龙坡-西部新城陶家商圈(陶家百可广场旁,陶家老街站)', 14, '旭城公园府邸', '精装', 55, 100, NULL, 120, '在售', '2017-07-28 00:00:00');
-- --------------------------------------------------------
--
-- Table structure for table `BuildingLayout`
--
CREATE TABLE IF NOT EXISTS `BuildingLayout` (
`buildingId` int(11) NOT NULL,
`buildingLayoutPicUrl` varchar(200) DEFAULT NULL,
`buildingLayoutReferencePrice` int(11) DEFAULT NULL,
`buildingLayout` varchar(20) NOT NULL,
`buildingLayoutSoldOut` tinyint(1) NOT NULL,
`buildingLayoutPerPrice` int(11) NOT NULL,
PRIMARY KEY (`buildingId`,`buildingLayout`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `BuildingPic`
--
CREATE TABLE IF NOT EXISTS `BuildingPic` (
`buildingId` int(11) DEFAULT NULL,
`buildingPicInsertTime` datetime DEFAULT NULL,
`buildingPicUrl` varchar(200) NOT NULL DEFAULT '',
`buildingPicType` varchar(20) DEFAULT NULL,
`picId` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`picId`),
UNIQUE KEY `buildingPicUrl` (`buildingPicUrl`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=202 ;
--
-- Dumping data for table `BuildingPic`
--
INSERT INTO `BuildingPic` (`buildingId`, `buildingPicInsertTime`, `buildingPicUrl`, `buildingPicType`, `picId`) VALUES
(15, NULL, 'http://os8z6i0zb.bkt.clouddn.com/08c3171e-c3ec-4445-8d94-5764454e75f0.jpg.239x174.jpg', NULL, 97),
(13, NULL, 'http://os8z6i0zb.bkt.clouddn.com/136c3fc4-8ebc-48d6-bee5-505b975d42cf.jpg.239x174.jpg', NULL, 98),
(13, '2017-07-02 16:33:35', 'http://os8z6i0zb.bkt.clouddn.com/e4187395-7945-4ba5-8719-ecfe3b535d1f.jpg.239x174.jpg', NULL, 99),
(12, '2017-07-02 17:14:13', 'http://os8z6i0zb.bkt.clouddn.com/e18404a6-08c2-4f86-b1d8-fdb3d1f69634.jpg.239x174.jpg', NULL, 100),
(11, '2017-07-02 17:20:07', 'http://os8z6i0zb.bkt.clouddn.com/dedc0565-4e19-4f2b-b5ec-6a369a529acb.jpg.239x174.jpg', NULL, 101),
(10, '2017-07-03 21:07:12', 'http://os8z6i0zb.bkt.clouddn.com/d2b7e780-4124-40c1-8590-849cf34ce542.jpg.239x174.jpg', NULL, 102),
(9, '2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/cb73d5b7-855b-4745-93d9-91c72d302dad.jpg.239x174.jpg', NULL, 103),
(8, '2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/c9827156-e0be-4da2-8b8f-9dc659dea6d2.jpg.239x174.jpg', NULL, 104),
(5, '2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/afbdd6be-554d-491a-80b1-0810b95c99a9.jpg.239x174.jpg', NULL, 105),
(4, '2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/a52315cc-9af9-4371-a59d-ae72d1fcc3c7.jpg.239x174.jpg', NULL, 106),
(3, '2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/83671b16-2f6c-4b55-99c3-3e8c7ce08377.jpg.239x174.jpg', NULL, 107),
(2, '2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/795f17f1-7ffb-4a7f-b489-07e743ea3069.jpg.239x174.jpg', NULL, 108),
(1, '2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/7850ee8c-0c1f-4c8d-af10-01c5754faa01.jpg.239x174.jpg', NULL, 109),
(1, NULL, 'http://os8z6i0zb.bkt.clouddn.com/loupan1.jpg', NULL, 179),
(2, NULL, 'http://os8z6i0zb.bkt.clouddn.com/loupan2.jpg', NULL, 180),
(3, NULL, 'http://os8z6i0zb.bkt.clouddn.com/loupan3.jpg', NULL, 181),
(4, NULL, 'http://os8z6i0zb.bkt.clouddn.com/loupan4.jpg', NULL, 182),
(5, NULL, 'http://os8z6i0zb.bkt.clouddn.com/loupan5.jpg', NULL, 183),
(6, NULL, 'http://os8z6i0zb.bkt.clouddn.com/loupan6.jpg', NULL, 184),
(7, NULL, 'http://os8z6i0zb.bkt.clouddn.com/loupan7.jpg', NULL, 185),
(8, NULL, 'http://os8z6i0zb.bkt.clouddn.com/loupan8.jpg', NULL, 186),
(9, NULL, 'http://os8z6i0zb.bkt.clouddn.com/loupan9.jpg', NULL, 187),
(10, NULL, 'http://os8z6i0zb.bkt.clouddn.com/loupan10.jpg', NULL, 188),
(11, NULL, 'http://os8z6i0zb.bkt.clouddn.com/loupan11.jpg', NULL, 189),
(12, NULL, 'http://os8z6i0zb.bkt.clouddn.com/loupan12.jpg', NULL, 190),
(13, NULL, 'http://os8z6i0zb.bkt.clouddn.com/loupan13.jpg', NULL, 191),
(14, NULL, 'http://os8z6i0zb.bkt.clouddn.com/loupan14.jpg', NULL, 192),
(15, NULL, 'http://os8z6i0zb.bkt.clouddn.com/loupan15.jpg', NULL, 193),
(1, NULL, 'http://os8z6i0zb.bkt.clouddn.com/y1.jpg', NULL, 194),
(2, NULL, 'http://os8z6i0zb.bkt.clouddn.com/y2.jpg', NULL, 195),
(3, NULL, 'http://os8z6i0zb.bkt.clouddn.com/y3.jpg', NULL, 196),
(4, NULL, 'http://os8z6i0zb.bkt.clouddn.com/y4.jpg', NULL, 197),
(1, NULL, 'http://os8z6i0zb.bkt.clouddn.com/2017-07-04T12:26:24.589Z', '卧室', 198),
(1, NULL, 'http://os8z6i0zb.bkt.clouddn.com/2017-07-04T12:28:36.911Z', 'woshi', 199),
(0, NULL, 'http://os8z6i0zb.bkt.clouddn.com/defaultPhoto.png', NULL, 200);
-- --------------------------------------------------------
--
-- Table structure for table `BuyHouseComment`
--
CREATE TABLE IF NOT EXISTS `BuyHouseComment` (
`buildingId` int(11) DEFAULT NULL,
`userId` int(11) NOT NULL,
`buyHouseCommentId` int(11) NOT NULL AUTO_INCREMENT,
`userComment` varchar(300) NOT NULL,
`userCommentDate` datetime NOT NULL,
PRIMARY KEY (`buyHouseCommentId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ;
--
-- Dumping data for table `BuyHouseComment`
--
INSERT INTO `BuyHouseComment` (`buildingId`, `userId`, `buyHouseCommentId`, `userComment`, `userCommentDate`) VALUES
(3, 6, 3, '可惜没有电梯', '2017-07-04 10:22:01'),
(14, 48, 4, '来看看', '2017-07-05 15:28:25'),
(14, 48, 5, '接着看看', '2017-07-05 15:28:45'),
(5, 49, 6, '房子很好', '2017-07-05 19:35:23');
-- --------------------------------------------------------
--
-- Table structure for table `Characteristics`
--
CREATE TABLE IF NOT EXISTS `Characteristics` (
`characteristicsId` int(11) NOT NULL,
`description` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `Community`
--
CREATE TABLE IF NOT EXISTS `Community` (
`communityId` int(11) NOT NULL AUTO_INCREMENT,
`communityBuildingNum` int(11) DEFAULT NULL,
`communityBuildTime` datetime DEFAULT NULL,
`communityDeveloper` varchar(100) DEFAULT NULL,
`communityHouseNum` int(11) DEFAULT NULL,
`communityPrice` float NOT NULL,
`communityPropertyCompany` varchar(100) DEFAULT NULL,
`communityPropertyFee` float DEFAULT NULL,
`communityName` varchar(50) DEFAULT NULL,
`communityAddress` varchar(100) DEFAULT NULL,
PRIMARY KEY (`communityId`),
KEY `communityId` (`communityId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
--
-- Dumping data for table `Community`
--
INSERT INTO `Community` (`communityId`, `communityBuildingNum`, `communityBuildTime`, `communityDeveloper`, `communityHouseNum`, `communityPrice`, `communityPropertyCompany`, `communityPropertyFee`, `communityName`, `communityAddress`) VALUES
(2, 0, NULL, NULL, 0, 0, NULL, 0, '66666小区', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `OrderBuilding`
--
CREATE TABLE IF NOT EXISTS `OrderBuilding` (
`buildingId` int(11) NOT NULL,
`userId` int(11) NOT NULL,
`orderId` int(11) NOT NULL AUTO_INCREMENT,
`orderTime` varchar(50) NOT NULL,
`agentId` int(11) NOT NULL,
`orderStatus` varchar(20) NOT NULL,
`userPhoneNumber` varchar(20) NOT NULL,
PRIMARY KEY (`orderId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
--
-- Dumping data for table `OrderBuilding`
--
INSERT INTO `OrderBuilding` (`buildingId`, `userId`, `orderId`, `orderTime`, `agentId`, `orderStatus`, `userPhoneNumber`) VALUES
(2, 6, 2, '2017-06-26 17:11:39', 1, '未处理', '18059739987');
-- --------------------------------------------------------
--
-- Table structure for table `OrderRentHouse`
--
CREATE TABLE IF NOT EXISTS `OrderRentHouse` (
`agentId` int(11) DEFAULT NULL,
`orderId` int(11) NOT NULL AUTO_INCREMENT,
`orderTime` varchar(50) DEFAULT NULL,
`rentHouseId` int(11) NOT NULL,
`userId` int(11) NOT NULL,
`orderStatus` varchar(20) DEFAULT NULL,
`userPhoneNumber` varchar(20) NOT NULL,
PRIMARY KEY (`orderId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ;
--
-- Dumping data for table `OrderRentHouse`
--
INSERT INTO `OrderRentHouse` (`agentId`, `orderId`, `orderTime`, `rentHouseId`, `userId`, `orderStatus`, `userPhoneNumber`) VALUES
(20141791, 2, '2017-06-26 17:30:18', 6, 6, '未处理', '18059739987'),
(0, 3, '2017-07-08 00:00:00', 0, 0, NULL, '18059739987'),
(0, 4, '2017-07-08 00:00:00', 5, 6, '未处理', '18059739987');
-- --------------------------------------------------------
--
-- Table structure for table `RentHouse`
--
CREATE TABLE IF NOT EXISTS `RentHouse` (
`rentHouseId` int(11) NOT NULL AUTO_INCREMENT,
`communityId` int(11) DEFAULT NULL,
`rentHouseAddress` varchar(100) DEFAULT NULL,
`rentHouseArea` float DEFAULT NULL,
`rentHouseBuildTime` datetime DEFAULT NULL,
`rentHouseFloor` int(11) DEFAULT NULL,
`rentHouseFloorAttribute` varchar(20) DEFAULT NULL,
`rentHouseHall` int(11) DEFAULT NULL,
`rentHouseRoom` int(11) DEFAULT NULL,
`rentHouseSubway` varchar(100) DEFAULT NULL,
`rentHouseToilet` int(11) DEFAULT NULL,
`rentHouseToward` varchar(10) DEFAULT NULL,
`rentHousePrice` int(11) DEFAULT NULL,
`rentHouseProvince` varchar(20) DEFAULT NULL,
`rentHouseRegion` varchar(20) DEFAULT NULL,
`rentHouseAllFloor` int(11) DEFAULT NULL,
`communityName` varchar(50) DEFAULT NULL,
`rentHouseUnitNumber` varchar(20) DEFAULT NULL,
`rentHousePublishTime` datetime DEFAULT NULL,
PRIMARY KEY (`rentHouseId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=46 ;
--
-- Dumping data for table `RentHouse`
--
INSERT INTO `RentHouse` (`rentHouseId`, `communityId`, `rentHouseAddress`, `rentHouseArea`, `rentHouseBuildTime`, `rentHouseFloor`, `rentHouseFloorAttribute`, `rentHouseHall`, `rentHouseRoom`, `rentHouseSubway`, `rentHouseToilet`, `rentHouseToward`, `rentHousePrice`, `rentHouseProvince`, `rentHouseRegion`, `rentHouseAllFloor`, `communityName`, `rentHouseUnitNumber`, `rentHousePublishTime`) VALUES
(5, 0, '重庆市渝北区加州城市花园', 182, '2016-01-04 00:00:00', 1, '低楼层', 2, 4, '6号线', 2, '西南', 4000, '重庆市', '渝北', 26, '加州城市花园', '5', '2017-07-02 00:00:00'),
(6, 0, '重庆市江北区华立天地豪园', 171, '2002-03-13 00:00:00', 21, '高楼层', 2, 4, NULL, 2, '南', 2400, '重庆市', '江北', 35, '华立天地豪园', '4', '2017-07-02 00:00:00'),
(7, 0, '重庆市渝北区北城国际中心', 83, '2017-02-28 00:00:00', 5, '低楼层', 1, 2, NULL, 1, NULL, 2500, '', '', 0, '', '', '2017-07-03 00:00:00'),
(8, 1, '重庆市南岸国际社区官邸三组团', 83, '2017-03-20 00:00:00', 15, '中楼层', 2, 2, NULL, 1, '东南', 2200, '重庆市', '南岸', 30, '', '', '2017-07-02 00:00:00'),
(9, 43, '重庆市江津朗苑', 41, '2017-03-28 00:00:00', 14, '中楼层', 1, 1, NULL, 1, '北', 900, '重庆市', '江津', 31, '', '', '2017-07-02 00:00:00'),
(10, 12, '重庆市巴南典雅龙海港湾', 58, '2017-01-24 00:00:00', 10, '中楼层', 1, 1, NULL, 1, '西', 1400, '重庆市', '巴南', 20, '', '', '2017-06-05 00:00:00'),
(23, 0, '江北机场路10号', 22, '2017-04-12 00:00:00', 3, '中楼层', 1, 2, '3号线', 1, '南', 1800, '重庆市', '江北区', 6, '江北机场', '45', '2017-07-02 00:00:00'),
(26, 1, '重庆市南岸四公里', 72.21, '2017-07-05 00:00:00', 14, '低楼层', 1, 2, '6号线', 1, '西北', 3000, '重庆市', '南岸', 20, '花园小区', '13', '2017-07-02 00:00:00'),
(27, 2, '重庆市巴南龙洲湾', 110, '2017-07-03 00:00:00', 11, '高楼层', 2, 3, '4号线', 1, '南', 5000, '重庆市', '巴南', 30, '典雅龙湾', '10', '2017-06-01 00:00:00'),
(28, 1, '重庆市江北观音桥', 86, '2017-07-05 00:00:00', 16, '高楼层', 2, 3, '3号线', 1, '北', 4500, '重庆市', '江北', 40, '东方家园', '94', '2017-06-16 00:00:00'),
(29, 1, '重庆市渝中大坪', 86, '2017-07-03 00:00:00', 6, '低层', 2, 2, '2号线', 1, '南', 3200, '重庆市', '渝中', 30, '龙湖花园', '111', '2017-06-05 00:00:00'),
(30, 580, '重庆渝北汽博中心融创紫枫郡 ', 94, '2014-03-15 00:00:00', 26, '高楼层', 1, 3, '3号线', 1, '西北', 3600, '重庆市', '渝北', 33, '融创紫枫郡', '22', '2017-06-28 00:00:00'),
(31, 107, '重庆市渝北汽博中心', 105, '2015-04-25 00:00:00', 6, '低楼层', 2, 2, '3号线', 1, '南', 3200, '重庆市', '渝北', 33, '奥林匹克花园新亚洲', '4', '2017-06-19 00:00:00'),
(32, 301, '重庆市南岸区四公里', 72.21, '2013-09-10 00:00:00', 3, '低楼层', 1, 2, NULL, 1, '北', 2000, '重庆市', '南岸区', 33, '华城国际 ', '2', '2017-06-04 00:00:00'),
(33, 268, '重庆市渝北区嘉州', 182.54, '2003-10-17 00:00:00', 15, '中楼层', 2, 4, NULL, 2, '西南', 4000, '重庆市', '渝北区', 26, '加州城市花园', '4', '2017-06-25 00:00:00'),
(34, 19, '重庆市江津老城区', 50, '2015-05-02 00:00:00', 5, '低楼层', 1, 1, NULL, 1, '东南', 1200, '重庆市', '江津', 32, '明月香山', '142', '2017-03-24 00:00:00'),
(35, 152, '重庆市渝中化龙桥', 61, '2017-07-04 00:00:00', 9, '中楼层', 1, 1, '4号线', 1, '西北', 2600, '重庆市', '渝中', 15, '天地雍江翠湖 ', '114', '2017-07-05 00:00:00'),
(36, 56, '重庆市江北区黄泥磅', 89, '2008-09-19 00:00:00', 24, '高楼层', 2, 2, '6号线', 1, '东南', 2800, '重庆市', '江北区', 33, '御景天成', '5', '2017-06-20 00:00:00'),
(38, 34, '重庆市渝北嘉州', 135, '2012-07-13 00:00:00', 6, '低楼层', 2, 3, '3号线', 2, '西', 7000, '重庆市', '渝北区', 32, '中渝山顶道国宾城 ', '5', '2017-06-05 00:00:00'),
(39, 12, '重庆大渡口', 0, '2017-07-06 00:00:00', 3, '低楼层', 3, 2, '6号线', 1, '南', 2321, '重庆', '大渡口', 12, '12345', '12', '2017-07-21 00:00:00'),
(40, 342, '重庆市渝北区人和', 213, '2013-05-04 00:00:00', 3, '低楼层', 2, 4, NULL, 2, '西南', 13000, '重庆市', '渝北区', 11, '棕榈泉三期', '2', '2017-05-09 00:00:00'),
(41, 34, '重庆渝北人和', 181, '2014-04-09 00:00:00', 14, '中层楼', 2, 3, NULL, 2, '西南', 15000, '重庆市', '渝北区', 33, '棕榈泉四期', '2', '2017-02-08 00:00:00'),
(42, 5, '重庆江北观音桥', 315, '2000-12-08 00:00:00', 14, '高楼层', 3, 7, '6号线', 4, '东南', 8500, '重庆市', '江北', 16, '望海花园', '21', '2016-08-18 00:00:00');
-- --------------------------------------------------------
--
-- Table structure for table `RentHouseComment`
--
CREATE TABLE IF NOT EXISTS `RentHouseComment` (
`rentHouseId` int(11) NOT NULL,
`userComment` varchar(300) NOT NULL,
`userId` int(11) NOT NULL,
`userCommentDate` datetime NOT NULL,
`rentHouseCommentId` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`rentHouseCommentId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=21 ;
--
-- Dumping data for table `RentHouseComment`
--
INSERT INTO `RentHouseComment` (`rentHouseId`, `userComment`, `userId`, `userCommentDate`, `rentHouseCommentId`) VALUES
(5, '喜欢~', 6, '2017-07-03 16:35:00', 6),
(5, '评论框有毒啊~', 2, '2017-07-03 12:22:31', 8),
(5, 'hello', 48, '2017-07-05 15:24:09', 18),
(5, '可以', 49, '2017-07-05 19:40:10', 20);
-- --------------------------------------------------------
--
-- Table structure for table `RentHouseDeal`
--
CREATE TABLE IF NOT EXISTS `RentHouseDeal` (
`agentId` int(11) NOT NULL,
`rentHouseId` int(11) NOT NULL,
`userId` int(11) NOT NULL,
`rentTime` datetime NOT NULL,
`rentId` int(11) NOT NULL AUTO_INCREMENT,
`rentPrice` float NOT NULL,
`rentHouseDay` int(11) NOT NULL,
PRIMARY KEY (`rentId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=13 ;
--
-- Dumping data for table `RentHouseDeal`
--
INSERT INTO `RentHouseDeal` (`agentId`, `rentHouseId`, `userId`, `rentTime`, `rentId`, `rentPrice`, `rentHouseDay`) VALUES
(1, 6, 6, '2017-06-02 20:47:46', 2, 2000, 33);
-- --------------------------------------------------------
--
-- Table structure for table `RentHousePic`
--
CREATE TABLE IF NOT EXISTS `RentHousePic` (
`insertTime` datetime DEFAULT NULL,
`picUrl` varchar(200) NOT NULL,
`rentHouseId` int(11) NOT NULL,
`rentHousePicId` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`rentHousePicId`),
UNIQUE KEY `picUrl` (`picUrl`),
UNIQUE KEY `picUrl_2` (`picUrl`),
UNIQUE KEY `picUrl_3` (`picUrl`),
UNIQUE KEY `rentHousePicId` (`rentHousePicId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=94 ;
--
-- Dumping data for table `RentHousePic`
--
INSERT INTO `RentHousePic` (`insertTime`, `picUrl`, `rentHouseId`, `rentHousePicId`) VALUES
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/h6.jpg', 32, 0),
('2017-07-08 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/Pic1', 5, 1),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/Pic2', 5, 2),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/Pic3', 5, 3),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/Pic4', 5, 4),
('2017-07-02 16:33:35', 'http://os8z6i0zb.bkt.clouddn.com/2017-07-02T08:33:34.043Z', 21, 5),
('2017-07-02 17:14:13', 'http://os8z6i0zb.bkt.clouddn.com/2017-07-02T09:14:12.199Z', 22, 6),
('2017-07-02 17:20:07', 'http://os8z6i0zb.bkt.clouddn.com/2017-07-02T09:20:05.501Z', 23, 7),
('2017-07-03 21:07:12', 'http://os8z6i0zb.bkt.clouddn.com/2017-07-03T13:07:11.947Z', 24, 8),
('2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/28.jpg', 26, 9),
('2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/27.jpg', 27, 10),
('2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/26.jpg', 28, 11),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/r4.jpg', 30, 12),
('2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/27.1.jpg', 27, 13),
('2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/27.2.jpg', 27, 14),
('2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/27.3.jpg', 27, 15),
('2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/26.1.jpg', 26, 16),
('2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/26.2.jpg', 26, 17),
('2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/26.3.jpg', 26, 18),
('2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/28.1.jpg', 28, 19),
('2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/28.2.jpg', 28, 20),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/h5.jpg', 32, 21),
('2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/28.3.jpg', 28, 22),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/h7.jpg', 32, 23),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/h8.jpg', 32, 24),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/r1.jpg', 30, 25),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/r2.jpg', 30, 26),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/r3.jpg', 30, 27),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/a1.jpg', 31, 28),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/j4.jpg', 33, 29),
('2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/j1.jpg', 33, 30),
('2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/j2.jpg', 33, 31),
('2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/j3.jpg', 33, 32),
('2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/m1.jpg', 34, 33),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/m2.jpg', 34, 34),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/m3.jpg', 34, 35),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/y5.jpg', 36, 36),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/y6.jpg', 36, 37),
('2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/35.jpg', 35, 38),
('2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/35.1.jpg', 35, 39),
('2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/35.2.jpg', 35, 40),
('2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/35.3.jpg', 35, 41),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/h1.jpg', 6, 43),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/h2.jpg', 6, 44),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/h3.jpg', 6, 45),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/h4.jpg', 6, 46),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/b1.jpg', 7, 47),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/b2.jpg', 7, 48),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/b3.jpg\n', 7, 49),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/b4.jpg', 7, 50),
('2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/8.jpg', 8, 51),
('2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/8.1.jpg', 8, 52),
('2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/8.2.jpg', 8, 53),
('2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/8.3.jpg', 8, 54),
('2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/9.jpg', 9, 55),
('2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/9.1.jpg', 9, 56),
('2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/9.2.jpg', 9, 57),
('2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/9.3.jpg', 9, 58),
('2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/10.jpg', 10, 59),
('2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/10.1.jpg', 10, 60),
('2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/10.2.jpg', 10, 61),
('2017-07-04 00:00:00', 'http://os8z6i0zb.bkt.clouddn.com/10.3.jpg', 10, 62),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/4.jpg', 37, 63),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/3.jpg', 37, 64),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/2.jpg', 37, 65),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/1.jpg', 37, 66),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/6.jpg', 38, 67),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/5.jpg', 38, 68),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/7.jpg', 38, 69),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/z1.jpg', 40, 73),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/z2.jpg', 40, 74),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/z3.jpg', 40, 75),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/z4.jpg', 40, 76),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/z8.jpg', 41, 77),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/z9.jpg', 41, 78),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/z10.jpg', 41, 79),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/z11.jpg', 41, 80),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/w1.jpg', 42, 81),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/w2.jpg', 42, 82),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/w3.jpg', 42, 83),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/w4.jpg', 42, 84),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/w5.jpg', 42, 85),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/a2.jpg', 31, 88),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/a3.jpg', 31, 89),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/a4.jpg', 31, 90),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/m4.jpg', 34, 91),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/y7.jpg', 36, 92),
(NULL, 'http://os8z6i0zb.bkt.clouddn.com/y8.jpg', 36, 93);
-- --------------------------------------------------------
--
-- Table structure for table `RentHouse_Characteristics`
--
CREATE TABLE IF NOT EXISTS `RentHouse_Characteristics` (
`rentHouseId` int(11) NOT NULL,
`characteristicsId` int(11) NOT NULL,
PRIMARY KEY (`rentHouseId`,`characteristicsId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `RentHouse_Characteristics`
--
INSERT INTO `RentHouse_Characteristics` (`rentHouseId`, `characteristicsId`) VALUES
(23, 6);
-- --------------------------------------------------------
--
-- Table structure for table `RentHouse_Community`
--
CREATE TABLE IF NOT EXISTS `RentHouse_Community` (
`communityId` int(11) NOT NULL,
`rentHouseId` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `User`
--
CREATE TABLE IF NOT EXISTS `User` (
`userId` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(15) NOT NULL,
`name` varchar(30) DEFAULT '',
`userPassword` varchar(15) NOT NULL,
`userSex` varchar(8) DEFAULT NULL,
`userEmail` varchar(30) DEFAULT '',
`userPhoneNumber` varchar(30) DEFAULT '',
`userPhoto` varchar(200) NOT NULL,
PRIMARY KEY (`userId`),
UNIQUE KEY `username` (`username`),
UNIQUE KEY `userEmail` (`userEmail`),
UNIQUE KEY `userPhoneNumber` (`userPhoneNumber`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=52 ;
--
-- Dumping data for table `User`
--
INSERT INTO `User` (`userId`, `username`, `name`, `userPassword`, `userSex`, `userEmail`, `userPhoneNumber`, `userPhoto`) VALUES
(2, 'gzy', 'null', '632', 'null', 'null', 'null', 'http://os8z6i0zb.bkt.clouddn.com/defaultPhoto.png'),
(3, 'SBgzy', 'wcc', '1996511', '男', '972115233@qq.com', '13370762548', 'http://os8z6i0zb.bkt.clouddn.com/2017-07-05T11:35:36.321Z'),
(6, 'guoziyao', '买不起房的郭先生', 'guoziyao', '男', '751744014@qq.com', '18059739987', 'http://os8z6i0zb.bkt.clouddn.com/2017-07-04T11:41:01.891Z'),
(8, 'guoguoguo', NULL, '666', NULL, NULL, NULL, 'http://os8z6i0zb.bkt.clouddn.com/defaultPhoto.png'),
(9, 'ThomasDrTang', '思博唐博士', '666666', NULL, NULL, NULL, 'http://os8z6i0zb.bkt.clouddn.com/2017-07-01T06:17:55.548Z'),
(10, 'zzzzz', NULL, '123456', NULL, NULL, NULL, 'http://os8z6i0zb.bkt.clouddn.com/2017-07-01T06:19:51.087Z'),
(11, 'liangxianfeng', '梁先锋', 'liangxianfeng', '男', '', '', 'http://os8z6i0zb.bkt.clouddn.com/2017-07-01T06:28:38.629Z'),
(43, '121345324', 'SBgzy', '1996511', 'on', '234235235', '2532523', 'http://os8z6i0zb.bkt.clouddn.com/2017-07-04T01:13:06.174Z'),
(44, '334551', 'SBgzy', '1996511', '男', '4', '4', 'http://os8z6i0zb.bkt.clouddn.com/defaultPhoto.png'),
(49, 'zhangzhiqiao', NULL, 'z123456', NULL, NULL, NULL, 'http://os8z6i0zb.bkt.clouddn.com/2017-07-05T11:30:35.803Z');
-- --------------------------------------------------------
--
-- Table structure for table `UserCollectBuilding`
--
CREATE TABLE IF NOT EXISTS `UserCollectBuilding` (
`userId` int(11) NOT NULL,
`buildingId` int(11) NOT NULL,
`collectTime` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `UserCollectBuilding`
--
INSERT INTO `UserCollectBuilding` (`userId`, `buildingId`, `collectTime`) VALUES
(6, 2, '2017-07-05 01:05:43'),
(48, 14, '2017-07-05 15:28:49'),
(49, 2, '2017-07-05 19:25:42');
-- --------------------------------------------------------
--
-- Table structure for table `UserCollectRentHouse`
--
CREATE TABLE IF NOT EXISTS `UserCollectRentHouse` (
`userId` int(11) NOT NULL,
`rentHouseId` int(11) NOT NULL,
`collectTime` datetime DEFAULT NULL,
PRIMARY KEY (`userId`,`rentHouseId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `UserCollectRentHouse`
--
INSERT INTO `UserCollectRentHouse` (`userId`, `rentHouseId`, `collectTime`) VALUES
(6, 5, NULL),
(6, 6, '2017-07-01 00:00:00'),
(6, 9, NULL),
(48, 23, NULL),
(49, 5, NULL);
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; | the_stack |
WITH
vars AS (
SELECT
'\x4215606a720477178AdFCd5A59775C63138711e8'::bytea AS fee_address,
'\xdac17f958d2ee523a2206206994597c13d831ec7'::bytea AS usdt_underlying_token, --USDT
'\xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'::bytea AS usdc_underlying_token, -- USDC
'\x6b175474e89094c44da98b954eedeac495271d0f'::bytea AS dai_underlying_token, -- DAI
'\x57ab1ec28d129707052df4df418d58a2d46d5f51'::bytea AS susd_underlying_token, -- SUSD
'\x0000000000085d4780b73119b644ae5ecd22b376'::bytea AS tusd_underlying_token, -- TUSD
'\x2260fac5e5542a773aa44fbcfedf7c193bc2c599'::bytea AS wbtc_underlying_token -- WBTC
),
idle_usdt_risk AS ( -- Change name here
SELECT
blocktime,
idle_token/1e18 as idle_token,
source_token as source_token,
fee as fee,
(SELECT usdt_underlying_token FROM vars) as underlying_token_address, -- Change var here
success,
contract_address,
'IdleV4 USDT Risk Adjusted' as contract_name
FROM
(
SELECT
mi.call_block_time AS blocktime,
mi."output_mintedTokens" AS idle_token,
mi."_amount" AS source_token,
mi.call_success as success,
mi.contract_address,
0 as fee
FROM idle_v4."IdleUSDT_v4_Risk_call_mintIdleToken" mi -- Change table here
UNION
SELECT
re.call_block_time AS blocktime,
-re."_amount" AS idle_token,
-re."output_redeemedTokens" AS source_token,
re.call_success as success,
re.contract_address,
-fee.value as fee
FROM idle_v4."IdleUSDT_v4_Risk_call_redeemIdleToken" re -- Change table here
LEFT OUTER JOIN (
SELECT value, evt_tx_hash, contract_address
FROM erc20."ERC20_evt_Transfer"
WHERE "to" IN(SELECT fee_address FROM vars)
AND contract_address IN (SELECT usdt_underlying_token from vars) ) fee ON fee.evt_tx_hash=re.call_tx_hash -- Change var here
) idle_usdt_risk -- Change name here
WHERE idle_token <> 0),
idle_usdc_risk AS ( -- Change name here
SELECT
blocktime,
idle_token/1e18 as idle_token,
source_token as source_token,
fee as fee,
(SELECT usdc_underlying_token FROM vars) as underlying_token_address, -- Change var here
success,
contract_address,
'IdleV4 USDC Risk Adjusted' as contract_name
FROM
(
SELECT
mi.call_block_time AS blocktime,
mi."output_mintedTokens" AS idle_token,
mi."_amount" AS source_token,
mi.call_success as success,
mi.contract_address,
0 as fee
FROM idle_v4."IdleUSDC_v4_Risk_call_mintIdleToken" mi -- Change table here
UNION
SELECT
re.call_block_time AS blocktime,
-re."_amount" AS idle_token,
-re."output_redeemedTokens" AS source_token,
re.call_success as success,
re.contract_address,
-fee.value as fee
FROM idle_v4."IdleUSDC_v4_Risk_call_redeemIdleToken" re -- Change table here
LEFT OUTER JOIN (
SELECT value, evt_tx_hash, contract_address
FROM erc20."ERC20_evt_Transfer"
WHERE "to" IN(SELECT fee_address FROM vars)
AND contract_address IN (SELECT usdc_underlying_token from vars) ) fee ON fee.evt_tx_hash=re.call_tx_hash -- Change var here
) idle_usdc_risk -- Change name here
WHERE idle_token <> 0),
idle_dai_risk AS ( -- Change name here
SELECT
blocktime,
idle_token/1e18 as idle_token,
source_token as source_token,
fee as fee,
(SELECT dai_underlying_token FROM vars) as underlying_token_address, -- Change var here
success,
contract_address,
'IdleV4 DAI Risk Adjusted' as contract_name
FROM
(
SELECT
mi.call_block_time AS blocktime,
mi."output_mintedTokens" AS idle_token,
mi."_amount" AS source_token,
mi.call_success as success,
mi.contract_address,
0 as fee
FROM idle_v4."IdleDAI_v4_Risk_call_mintIdleToken" mi -- Change table here
UNION
SELECT
re.call_block_time AS blocktime,
-re."_amount" AS idle_token,
-re."output_redeemedTokens" AS source_token,
re.call_success as success,
re.contract_address,
-fee.value as fee
FROM idle_v4."IdleDAI_v4_Risk_call_redeemIdleToken" re -- Change table here
LEFT OUTER JOIN (
SELECT value, evt_tx_hash, contract_address
FROM erc20."ERC20_evt_Transfer"
WHERE "to" IN(SELECT fee_address FROM vars)
AND contract_address IN (SELECT dai_underlying_token from vars) ) fee ON fee.evt_tx_hash=re.call_tx_hash -- Change var here
) idle_dai_risk -- Change name here
WHERE idle_token <> 0),
idle_wbtc_yield AS ( -- Change name here
SELECT
blocktime,
idle_token/1e18 as idle_token,
source_token as source_token,
fee as fee,
(SELECT wbtc_underlying_token FROM vars) as underlying_token_address, -- Change var here
success,
contract_address,
'IdleV4 WBTC Best Yield' as contract_name
FROM
(
SELECT
mi.call_block_time AS blocktime,
mi."output_mintedTokens" AS idle_token,
mi."_amount" AS source_token,
mi.call_success as success,
mi.contract_address,
0 as fee
FROM idle_v4."IdleWBTC_v4_Yield_call_mintIdleToken" mi -- Change table here
UNION
SELECT
re.call_block_time AS blocktime,
-re."_amount" AS idle_token,
-re."output_redeemedTokens" AS source_token,
re.call_success as success,
re.contract_address,
-fee.value as fee
FROM idle_v4."IdleWBTC_v4_Yield_call_redeemIdleToken" re -- Change table here
LEFT OUTER JOIN (
SELECT value, evt_tx_hash, contract_address
FROM erc20."ERC20_evt_Transfer"
WHERE "to" IN(SELECT fee_address FROM vars)
AND contract_address IN (SELECT wbtc_underlying_token from vars) ) fee ON fee.evt_tx_hash=re.call_tx_hash -- Change var here
) idle_wbtc_yield -- Change name here
WHERE idle_token <> 0),
idle_tusd_yield AS ( -- Change name here
SELECT
blocktime,
idle_token/1e18 as idle_token,
source_token as source_token,
fee as fee,
(SELECT tusd_underlying_token FROM vars) as underlying_token_address, -- Change var here
success,
contract_address,
'IdleV4 TUSD Best Yield' as contract_name
FROM
(
SELECT
mi.call_block_time AS blocktime,
mi."output_mintedTokens" AS idle_token,
mi."_amount" AS source_token,
mi.call_success as success,
mi.contract_address,
0 as fee
FROM idle_v4."IdleTUSD_v4_Yield_call_mintIdleToken" mi -- Change table here
UNION
SELECT
re.call_block_time AS blocktime,
-re."_amount" AS idle_token,
-re."output_redeemedTokens" AS source_token,
re.call_success as success,
re.contract_address,
-fee.value as fee
FROM idle_v4."IdleTUSD_v4_Yield_call_redeemIdleToken" re -- Change table here
LEFT OUTER JOIN (
SELECT value, evt_tx_hash, contract_address
FROM erc20."ERC20_evt_Transfer"
WHERE "to" IN(SELECT fee_address FROM vars)
AND contract_address IN (SELECT tusd_underlying_token from vars) ) fee ON fee.evt_tx_hash=re.call_tx_hash -- Change var here
) idle_tusd_yield -- Change name here
WHERE idle_token <> 0),
idle_usdt_yield AS ( -- Change name here
SELECT
blocktime,
idle_token/1e18 as idle_token,
source_token as source_token,
fee as fee,
(SELECT usdt_underlying_token FROM vars) as underlying_token_address, -- Change var here
success,
contract_address,
'IdleV4 USDT Best Yield' as contract_name
FROM
(
SELECT
mi.call_block_time AS blocktime,
mi."output_mintedTokens" AS idle_token,
mi."_amount" AS source_token,
mi.call_success as success,
mi.contract_address,
0 as fee
FROM idle_v4."IdleUSDT_v4_Yield_call_mintIdleToken" mi -- Change table here
UNION
SELECT
re.call_block_time AS blocktime,
-re."_amount" AS idle_token,
-re."output_redeemedTokens" AS source_token,
re.call_success as success,
re.contract_address,
-fee.value as fee
FROM idle_v4."IdleUSDT_v4_Yield_call_redeemIdleToken" re -- Change table here
LEFT OUTER JOIN (
SELECT value, evt_tx_hash, contract_address
FROM erc20."ERC20_evt_Transfer"
WHERE "to" IN(SELECT fee_address FROM vars)
AND contract_address IN (SELECT usdt_underlying_token from vars) ) fee ON fee.evt_tx_hash=re.call_tx_hash -- Change var here
) idle_usdt_yield -- Change name here
WHERE idle_token <> 0),
idle_susd_yield AS ( -- Change name here
SELECT
blocktime,
idle_token/1e18 as idle_token,
source_token as source_token,
fee as fee,
(SELECT susd_underlying_token FROM vars) as underlying_token_address, -- Change var here
success,
contract_address,
'IdleV4 SUSD Best Yield' as contract_name
FROM
(
SELECT
mi.call_block_time AS blocktime,
mi."output_mintedTokens" AS idle_token,
mi."_amount" AS source_token,
mi.call_success as success,
mi.contract_address,
0 as fee
FROM idle_v4."IdleSUSD_v4_Yield_call_mintIdleToken" mi -- Change table here
UNION
SELECT
re.call_block_time AS blocktime,
-re."_amount" AS idle_token,
-re."output_redeemedTokens" AS source_token,
re.call_success as success,
re.contract_address,
-fee.value as fee
FROM idle_v4."IdleSUSD_v4_Yield_call_redeemIdleToken" re -- Change table here
LEFT OUTER JOIN (
SELECT value, evt_tx_hash, contract_address
FROM erc20."ERC20_evt_Transfer"
WHERE "to" IN(SELECT fee_address FROM vars)
AND contract_address IN (SELECT susd_underlying_token from vars) ) fee ON fee.evt_tx_hash=re.call_tx_hash -- Change var here
) idle_susd_yield -- Change name here
WHERE idle_token <> 0),
idle_usdc_yield AS (
SELECT
blocktime,
idle_token/1e18 as idle_token,
source_token as source_token,
fee as fee,
(SELECT usdc_underlying_token FROM vars) as underlying_token_address,
success,
contract_address,
'IdleV4 USDC Best Yield' as contract_name
FROM
(
SELECT
mi.call_block_time AS blocktime,
mi."output_mintedTokens" AS idle_token,
mi."_amount" AS source_token,
mi.call_success as success,
mi.contract_address,
0 as fee
FROM idle_v4."IdleUSDC_v4_Yield_call_mintIdleToken" mi
UNION
SELECT
re.call_block_time AS blocktime,
-re."_amount" AS idle_token,
-re."output_redeemedTokens" AS source_token,
re.call_success as success,
re.contract_address,
-fee.value as fee
FROM idle_v4."IdleUSDC_v4_Yield_call_redeemIdleToken" re
LEFT OUTER JOIN (
SELECT value, evt_tx_hash
FROM erc20."ERC20_evt_Transfer"
WHERE "to" IN(SELECT fee_address FROM vars)
AND contract_address IN (SELECT usdc_underlying_token from vars) ) fee ON fee.evt_tx_hash=re.call_tx_hash
) idle_usdc_yield
WHERE idle_token <> 0),
idle_dai_yield AS (
SELECT
blocktime,
idle_token/1e18 as idle_token,
source_token as source_token,
fee as fee,
(SELECT dai_underlying_token FROM vars) as underlying_token_address,
success,
contract_address,
'IdleV4 DAI Best Yield' as contract_name
FROM
(
SELECT
mi.call_block_time AS blocktime,
mi."output_mintedTokens" AS idle_token,
mi."_amount" AS source_token,
mi.call_success as success,
mi.contract_address,
0 as fee
FROM idle_v4."IdleDAI_v4_Yield_call_mintIdleToken" mi
UNION
SELECT
re.call_block_time AS blocktime,
-re."_amount" AS idle_token,
-re."output_redeemedTokens" AS source_token,
re.call_success as success,
re.contract_address,
-fee.value as fee
FROM idle_v4."IdleDAI_v4_Yield_call_redeemIdleToken" re
LEFT OUTER JOIN (
SELECT value, evt_tx_hash
FROM erc20."ERC20_evt_Transfer"
WHERE "to" IN(SELECT fee_address FROM vars)
AND contract_address IN (SELECT dai_underlying_token from vars) ) fee ON fee.evt_tx_hash=re.call_tx_hash
) idle_dai_yield
WHERE idle_token <> 0),
idle_combined as (
SELECT * FROM idle_dai_yield
UNION
SELECT * FROM idle_usdc_yield
UNION
SELECT * FROM idle_usdt_yield
UNION
SELECT * FROM idle_tusd_yield
UNION
SELECT * FROM idle_susd_yield
UNION
SELECT * FROM idle_wbtc_yield
UNION
SELECT * FROM idle_dai_risk
UNION
SELECT * FROM idle_usdc_risk
UNION
SELECT * FROM idle_usdt_risk
),
idle_token_movements as (
SELECT
idle_token,
date_trunc('day', blocktime) as blockday,
underlying_token_address,
contract_address,
contract_name,
(source_token+fee)/idle_token as token_price_no_decimals
FROM
idle_combined
WHERE success=True
),
idle_token_daily_movement as (
SELECT
blockday,
underlying_token_address,
contract_address,
contract_name,
SUM(idle_token * token_price_no_decimals) as underlying_tokens_movement
FROM idle_token_movements
GROUP BY underlying_token_address, contract_address, contract_name, blockday
),
days AS (
SELECT
generate_series AS ts
FROM
generate_series(
'08-11-2020',
(SELECT max(blockday) FROM idle_token_daily_movement),
'1 day')
),
tokens AS (SELECT contract_name FROM idle_token_daily_movement GROUP BY contract_name),
idle_usd_movement as (
SELECT
blockday,
contract_name,
idle_token_daily_movement.contract_address,
p.price * underlying_tokens_movement / 10^p.decimals as usd_movement
FROM idle_token_daily_movement
LEFT OUTER JOIN prices.usd p ON
p.minute = blockday
AND p.contract_address=underlying_token_address
)
SELECT
-- *,
day.ts as blockday,
day.contract_name,
SUM(COALESCE(usd_movement, 0)) over (PARTITION BY day.contract_name ORDER BY day.ts) AS aum
FROM (
SELECT * FROM days CROSS JOIN tokens
) day
LEFT JOIN idle_usd_movement ON day.ts=idle_usd_movement.blockday AND day.contract_name=idle_usd_movement.contract_name | the_stack |
CREATE OR REPLACE PROCEDURE intab (table_in IN VARCHAR2,
where_in IN VARCHAR2 DEFAULT NULL,
colname_like_in IN VARCHAR2 := '%')
/*
| Demonstration of method 4 dynamic SQL with DBMS_SQL:
| Show the contents "in" a "tab"le - intab.
| Only supports number, date, string column types.
|
| Oracle Database 11g version utilizes DBMS_SQL.to_cursor_number
| to greatly simplify the code.
|
| Author: Steven Feuerstein, steven.feuerstein@oracle.com
*/
AUTHID CURRENT_USER
IS
-- Avoid repetitive "maximum size" declarations for VARCHAR2 variables.
SUBTYPE max_varchar2_t IS VARCHAR2 (32767);
-- Minimize size of a string column.
c_min_length CONSTANT PLS_INTEGER := 10;
-- Collection to hold the column information for this table.
TYPE columns_tt IS TABLE OF all_tab_columns%ROWTYPE
INDEX BY PLS_INTEGER;
l_columns columns_tt;
-- Open a cursor for use by DBMS_SQL subprograms throughout this procedure.
l_cursor INTEGER;
--
-- Formatting and SELECT elements used throughout the program.
l_header max_varchar2_t;
l_select_list max_varchar2_t;
g_row_line_length INTEGER := 0;
/* Utility functions that determine the "family" of the column datatype.
They do NOT comprehensively cover the datatypes supported by Oracle.
You will need to expand on these programs if you want your version of
intab to support a wider range of datatypes.
*/
FUNCTION is_string (columns_in IN columns_tt, row_in IN INTEGER)
RETURN BOOLEAN
IS
BEGIN
RETURN (columns_in (row_in).data_type IN ('CHAR', 'VARCHAR2', 'VARCHAR'));
END;
FUNCTION is_number (columns_in IN columns_tt, row_in IN INTEGER)
RETURN BOOLEAN
IS
BEGIN
RETURN (columns_in (row_in).data_type IN ('FLOAT', 'INTEGER', 'NUMBER'));
END;
FUNCTION is_date (columns_in IN columns_tt, row_in IN INTEGER)
RETURN BOOLEAN
IS
BEGIN
RETURN (columns_in (row_in).data_type IN ('DATE', 'TIMESTAMP'));
END;
PROCEDURE load_column_information (
select_list_io IN OUT NOCOPY VARCHAR2,
header_io IN OUT NOCOPY VARCHAR2,
columns_io IN OUT NOCOPY columns_tt)
IS
l_dot_location PLS_INTEGER;
l_owner VARCHAR2 (100);
l_table VARCHAR2 (100);
l_index PLS_INTEGER;
--
no_such_table EXCEPTION;
PRAGMA EXCEPTION_INIT (no_such_table, -942);
BEGIN
-- Separate the schema and table names, if both are present.
l_dot_location := INSTR (table_in, '.');
IF l_dot_location > 0
THEN
l_owner := SUBSTR (table_in, 1, l_dot_location - 1);
l_table := SUBSTR (table_in, l_dot_location + 1);
ELSE
l_owner := USER;
l_table := table_in;
END IF;
-- Retrieve all the column information into a collection of records.
SELECT *
BULK COLLECT INTO columns_io
FROM all_tab_columns
WHERE owner = l_owner
AND table_name = l_table
AND column_name LIKE NVL (colname_like_in, '%');
l_index := columns_io.FIRST;
IF l_index IS NULL
THEN
RAISE no_such_table;
ELSE
/* Add each column to the select list, calculate the length needed
to display each column, and also come up with the total line length.
Again, please note that the datatype support here is quite limited.
*/
WHILE (l_index IS NOT NULL)
LOOP
IF select_list_io IS NULL
THEN
select_list_io := columns_io (l_index).column_name;
ELSE
select_list_io :=
select_list_io || ', ' || columns_io (l_index).column_name;
END IF;
IF is_string (columns_io, l_index)
THEN
columns_io (l_index).data_length :=
GREATEST (
LEAST (columns_io (l_index).data_length, c_min_length),
LENGTH (columns_io (l_index).column_name));
ELSIF is_date (columns_io, l_index)
THEN
columns_io (l_index).data_length :=
GREATEST (c_min_length,
LENGTH (columns_io (l_index).column_name));
ELSIF is_number (columns_io, l_index)
THEN
columns_io (l_index).data_length :=
GREATEST (NVL (columns_io (l_index).data_precision, 38),
LENGTH (columns_io (l_index).column_name));
END IF;
g_row_line_length :=
g_row_line_length + columns_io (l_index).data_length + 1;
--
-- Construct column header line incrementally.
header_io :=
header_io
|| ' '
|| RPAD (columns_io (l_index).column_name,
columns_io (l_index).data_length);
l_index := columns_io.NEXT (l_index);
END LOOP;
END IF;
END load_column_information;
PROCEDURE report_error (text_in IN VARCHAR2, cursor_io IN OUT INTEGER)
IS
BEGIN
IF DBMS_SQL.is_open (cursor_io)
THEN
DBMS_SQL.close_cursor (cursor_io);
END IF;
DBMS_OUTPUT.put_line (text_in);
DBMS_OUTPUT.put_line (DBMS_UTILITY.format_error_backtrace);
END;
PROCEDURE construct_and_open_cursor (select_list_in IN VARCHAR2,
cursor_out OUT INTEGER)
IS
l_query max_varchar2_t;
l_where_clause max_varchar2_t := LTRIM (where_in);
l_cursor SYS_REFCURSOR;
BEGIN
-- Construct a where clause if a value was specified.
IF l_where_clause IS NOT NULL
THEN
--
IF ( l_where_clause NOT LIKE 'GROUP BY%'
AND l_where_clause NOT LIKE 'ORDER BY%')
THEN
l_where_clause := 'WHERE ' || LTRIM (l_where_clause, 'WHERE');
END IF;
END IF;
-- Assign the dynamic string to a local variable so that it can be
-- easily used to report an error.
l_query :=
'SELECT '
|| select_list_in
|| ' FROM '
|| table_in
|| ' '
|| l_where_clause;
DBMS_OUTPUT.put_line (l_querY);
-- 11.1 DBMS_SQL enhancement: convert to cursor variable.
OPEN l_cursor FOR l_query;
cursor_out := DBMS_SQL.to_cursor_number (l_cursor);
EXCEPTION
WHEN OTHERS
THEN
report_error ('Error constructing and opening cursor: ' || l_query,
cursor_out);
RAISE;
END;
PROCEDURE define_columns_and_execute (cursor_io IN OUT INTEGER,
columns_in IN columns_tt)
IS
l_index PLS_INTEGER;
l_feedback PLS_INTEGER;
BEGIN
/*
DBMS_SQL.DEFINE_COLUMN
Before executing the query, I need to tell DBMS_SQL the datatype
of each the columns being selected in the query. I simply pass
a literal of the appropriate type to an overloading of
DBMS_SQL.DEFINE_COLUMN. With string types, I need to also specify
the maximum length of the value.
*/
l_index := columns_in.FIRST;
WHILE (l_index IS NOT NULL)
LOOP
IF is_string (columns_in, l_index)
THEN
DBMS_SQL.define_column (cursor_io,
l_index,
'a',
columns_in (l_index).data_length);
ELSIF is_number (columns_in, l_index)
THEN
DBMS_SQL.define_column (cursor_io, l_index, 1);
ELSIF is_date (columns_in, l_index)
THEN
DBMS_SQL.define_column (cursor_io, l_index, SYSDATE);
END IF;
l_index := columns_in.NEXT (l_index);
END LOOP;
EXCEPTION
WHEN OTHERS
THEN
report_error ('Error defining columns', cursor_io);
RAISE;
END;
PROCEDURE build_and_display_output (header_in IN VARCHAR2,
cursor_io IN OUT INTEGER,
columns_in IN columns_tt)
IS
-- Used to hold the retrieved column values.
l_string_value VARCHAR2 (2000);
l_number_value NUMBER;
l_date_value DATE;
--
l_feedback INTEGER;
l_index PLS_INTEGER;
l_one_row_string max_varchar2_t;
-- Formatting for the output of the header information
PROCEDURE display_header
IS
l_border max_varchar2_t := RPAD ('-', g_row_line_length, '-');
FUNCTION centered_string (string_in IN VARCHAR2,
length_in IN INTEGER)
RETURN VARCHAR2
IS
len_string INTEGER := LENGTH (string_in);
BEGIN
IF len_string IS NULL OR length_in <= 0
THEN
RETURN NULL;
ELSE
RETURN RPAD (' ', (length_in - len_string) / 2 - 1)
|| LTRIM (RTRIM (string_in));
END IF;
END centered_string;
BEGIN
DBMS_OUTPUT.put_line (l_border);
DBMS_OUTPUT.put_line (
centered_string ('Contents of ' || table_in, g_row_line_length));
DBMS_OUTPUT.put_line (l_border);
DBMS_OUTPUT.put_line (l_header);
DBMS_OUTPUT.put_line (l_border);
END display_header;
BEGIN
display_header;
/*
DBMS_SQL.FETCH_ROWS
Fetch a row, and return the numbers of rows fetched.
When 0, we are done.
*/
WHILE DBMS_SQL.fetch_rows (cursor_io) > 0
LOOP
l_one_row_string := NULL;
l_index := columns_in.FIRST;
WHILE (l_index IS NOT NULL)
LOOP
/*
DBMS_SQL.COLUMN_VALUE
Retrieve each column value in the current row,
deposit it into a variable of the appropriate type,
then convert to a string and concatenate to the
full line variable.
*/
IF is_string (columns_in, l_index)
THEN
DBMS_SQL.COLUMN_VALUE (cursor_io, l_index, l_string_value);
ELSIF is_number (columns_in, l_index)
THEN
DBMS_SQL.COLUMN_VALUE (cursor_io, l_index, l_number_value);
l_string_value := TO_CHAR (l_number_value);
ELSIF is_date (columns_in, l_index)
THEN
DBMS_SQL.COLUMN_VALUE (cursor_io, l_index, l_date_value);
l_string_value := TO_CHAR (l_date_value);
END IF;
l_one_row_string :=
l_one_row_string
|| ' '
|| RPAD (NVL (l_string_value, ' '),
columns_in (l_index).data_length);
l_index := columns_in.NEXT (l_index);
END LOOP;
DBMS_OUTPUT.put_line (l_one_row_string);
END LOOP;
EXCEPTION
WHEN OTHERS
THEN
report_error (
'Error displaying output; last row = ' || l_one_row_string,
cursor_io);
END;
BEGIN
load_column_information (l_select_list, l_header, l_columns);
construct_and_open_cursor (l_select_list, l_cursor);
define_columns_and_execute (l_cursor, l_columns);
build_and_display_output (l_header, l_cursor, l_columns);
END intab;
/
BEGIN
intab ('HR.DEPARTMENTS',
where_in => 'department_name like ''%io%''',
colname_like_in => '%NAME%');
END;
/
BEGIN
intab ('HR.EMPLOYEES',
where_in => 'department_id = 80',
colname_like_in => '%NAME%');
END;
/ | the_stack |
SET NOCOUNT ON
GO
SELECT GETDATE()
GO
-- Get the information about the endpoints, owners, config, etc.
PRINT '==========================='
PRINT 'Database Mirroring Endpoint'
PRINT '==========================='
PRINT ''
SELECT *
FROM sys.tcp_endpoints tcpe
inner join sys.database_mirroring_endpoints me
on tcpe.endpoint_id = me.endpoint_id
inner join sys.server_principals sp
on tcpe.principal_id = sp.principal_id
--Database Mirroring Endpoint Permissions
PRINT '======================================='
PRINT 'Database Mirroring Endpoint Permissions'
PRINT '======================================='
PRINT ''
SELECT cast(perm.class_desc as varchar(30)) as [ClassDesc], cast(prin.name as varchar(30)) [Principal],
cast(perm.permission_name as varchar(30)) as [Permission],
cast(perm.state_desc as varchar(30)) as [StateDesc],
cast(prin.type_desc as varchar(30)) as [PrincipalType],
prin.is_disabled
FROM sys.server_permissions perm
LEFT JOIN sys.server_principals prin
ON perm.grantee_principal_id = prin.principal_id
LEFT JOIN sys.tcp_endpoints tep
ON perm.major_id = tep.endpoint_id
WHERE perm.class_desc = 'ENDPOINT' AND
perm.permission_name = 'CONNECT' AND
tep.type = 4
PRINT ''
--Availability Group Listeners and IP
PRINT '==================================='
PRINT 'Availability Group Listeners and IP'
PRINT '==================================='
PRINT ''
--First the listeners, one line per listener instead of the previous multi-line per IP.
-- IPs will be broken out in the next query.
SELECT agl.dns_name AS [Listener_Name], ag.name AS [AG_Name]
, agl.*
FROM sys.availability_group_listeners agl
inner join sys.availability_groups ag
on agl.group_id = ag.group_id
--IP information which isn't fully returned via the query above.
SELECT agl.dns_name AS [Listener_Name], aglip.*
FROM sys.availability_group_listener_ip_addresses aglip
inner join sys.availability_group_listeners agl
on aglip.listener_id = agl.listener_id
PRINT ''
--ROUTING LIST INFO
PRINT '==================================='
PRINT 'ROUTING LIST INFO'
PRINT '==================================='
PRINT ''
SELECT cast(ar.replica_server_name as varchar(30)) [When This Server is Primary],
rl.routing_priority [Priority],
cast(ar2.replica_server_name as varchar(30)) [Route to this Server],
ar.secondary_role_allow_connections_desc [Connections Allowed],
cast(ar2.read_only_routing_url as varchar(50)) as [Routing URL]
FROM sys.availability_read_only_routing_lists rl
inner join sys.availability_replicas ar on rl.replica_id = ar.replica_id
inner join sys.availability_replicas ar2 on rl.read_only_replica_id = ar2.replica_id
ORDER BY ar.replica_server_name, rl.routing_priority
PRINT ''
--AlwaysOn Cluster Information
PRINT '========================'
PRINT 'AlwaysOn Windows Cluster'
PRINT '========================'
PRINT ''
SELECT *
FROM sys.dm_hadr_cluster
PRINT ''
-- AlwaysOn Cluster Information
-- Note that this information is not guaranteed to be 100% accurate or correct since Windows Server 2012+.
PRINT '================================================'
PRINT 'Windows Cluster Member State, Quorum and Network'
PRINT '================================================'
PRINT ''
SELECT *
FROM sys.dm_hadr_cluster_members cm
inner join sys.dm_hadr_cluster_networks cn
on cn.member_name = cm.member_name
PRINT ''
--AlwaysOn Availability Group State, Identification and Configuration
PRINT '==================================================================='
PRINT 'AlwaysOn Availability Group State, Identification and Configuration'
PRINT '==================================================================='
PRINT ''
SELECT *
FROM sys.availability_groups ag
inner join sys.dm_hadr_availability_group_states ags
on ag.group_id = ags.group_id
PRINT ''
--AlwaysOn Availability Replica State, Identification and Configuration
PRINT '====================================================================='
PRINT 'AlwaysOn Availability Replica State, Identification and Configuration'
PRINT '====================================================================='
PRINT ''
SELECT arc.*, ar.*, ars.*
from sys.dm_hadr_availability_replica_cluster_nodes arc
join sys.dm_hadr_availability_replica_cluster_states arcs on arc.replica_server_name=arcs.replica_server_name
join sys.dm_hadr_availability_replica_states ars on arcs.replica_id=ars.replica_id
join sys.availability_replicas ar on ars.replica_id=ar.replica_id
join sys.availability_groups ag
on ag.group_id = arcs.group_id
and ag.name = arc.group_name
ORDER BY
cast(arc.group_name as varchar(30)),
cast(ars.role_desc as varchar(30))
PRINT ''
--AlwaysOn Availability Database Identification, Configuration, State and Performance
PRINT '==================================================================================='
PRINT 'AlwaysOn Availability Database Identification, Configuration, State and Performance'
PRINT '==================================================================================='
PRINT ''
select ag.name [Availability_Group], *
from sys.dm_hadr_database_replica_cluster_states drcs join
sys.dm_hadr_database_replica_states drs on drcs.replica_id=drs.replica_id
and drcs.group_database_id=drs.group_database_id left outer join
sys.dm_hadr_auto_page_repair pr on drs.database_id=pr.database_id
inner join sys.availability_groups ag
on ag.group_id = drs.group_id
order by drs.database_id
PRINT ''
PRINT ''
PRINT '-> dm_os_server_diagnostics_log_configurations'
select * from sys.dm_os_server_diagnostics_log_configurations
SET QUOTED_IDENTIFIER ON
DECLARE @XELFile VARCHAR(256)
SELECT @XELFile = path + 'AlwaysOn_health*.xel' FROM sys.dm_os_server_diagnostics_log_configurations
--read the AOHealth*.xel files into the table
SELECT cast(event_data as XML) AS EventData
INTO #AOHealth
FROM sys.fn_xe_file_target_read_file(
@XELFile, NULL, null, null);
PRINT ''
PRINT '==========================='
PRINT 'AlwaysOn_health DDL Events'
PRINT '==========================='
SELECT EventData.value('(event/@timestamp)[1]', 'datetime') AS TimeStampUTC,
EventData.value('(event/data/text)[1]', 'varchar(10)') AS DDLAction,
EventData.value('(event/data/text)[2]', 'varchar(10)') AS DDLPhase,
EventData.value('(event/data/value)[5]', 'varchar(20)') AS AGName,
CAST(REPLACE(REPLACE(EventData.value('(event/data/value)[3]',
'varchar(max)'), CHAR(10), ''), CHAR(13), '') AS VARCHAR(60)) AS DDLStatement
FROM #AOHealth
WHERE EventData.value('(event/@name)[1]', 'varchar(max)') = 'alwayson_ddl_executed'
AND UPPER(EventData.value('(event/data/value)[3]', 'varchar(60)')) NOT LIKE '%FAILOVER%'
ORDER BY EventData.value('(event/@timestamp)[1]', 'datetime');
PRINT ''
PRINT '============================='
PRINT 'AlwaysOn_health DDL FAILOVERS'
PRINT '============================='
SELECT EventData.value('(event/@timestamp)[1]', 'datetime') AS TimeStampUTC,
EventData.value('(event/data/text)[1]', 'varchar(10)') AS DDLAction,
EventData.value('(event/data/text)[2]', 'varchar(10)') AS DDLPhase,
EventData.value('(event/data/value)[5]', 'varchar(20)') AS AGName,
CAST(REPLACE(REPLACE(EventData.value('(event/data/value)[3]',
'varchar(max)'), CHAR(10), ''), CHAR(13), '') AS VARCHAR(60)) AS DDLStatement
FROM #AOHealth
WHERE EventData.value('(event/@name)[1]', 'varchar(max)') = 'alwayson_ddl_executed'
AND UPPER(EventData.value('(event/data/value)[3]', 'varchar(60)')) LIKE '%FAILOVER%'
ORDER BY EventData.value('(event/@timestamp)[1]', 'datetime');
PRINT ''
PRINT '=========================================='
PRINT 'AlwaysOn_health AR MGR State Change Events'
PRINT '=========================================='
SELECT CONVERT(char(25), EventData.value('(event/@timestamp)[1]', 'datetime'), 121) AS TimeStampUTC,
EventData.value('(event/data/text)[1]', 'varchar(30)') AS CurrentStateDesc
FROM #AOHealth
WHERE EventData.value('(event/@name)[1]', 'varchar(max)') = 'availability_replica_manager_state_change'
ORDER BY EventData.value('(event/@timestamp)[1]', 'datetime');
PRINT ''
PRINT '======================================'
PRINT 'AlwaysOn_health AR State Change Events'
PRINT '======================================'
SELECT EventData.value('(event/@timestamp)[1]', 'datetime') AS TimeStampUTC,
EventData.value('(event/data/value)[4]', 'varchar(20)') AS AGName,
EventData.value('(event/data/text)[1]', 'varchar(30)') AS PrevStateDesc,
EventData.value('(event/data/text)[2]', 'varchar(30)') AS CurrentStateDesc
FROM #AOHealth
WHERE EventData.value('(event/@name)[1]', 'varchar(max)') = 'availability_replica_state_change'
ORDER BY EventData.value('(event/@timestamp)[1]', 'datetime');
PRINT ''
PRINT '======================================'
PRINT 'Lease Expiration Events'
PRINT '======================================'
SELECT EventData.value('(event/@timestamp)[1]', 'datetime') AS TimeStampUTC,
EventData.value('(event/data/value)[2]', 'varchar(max)') AS AGName,
EventData.value('(event/data/value)[1]', 'varchar(max)') AS AG_ID
FROM #AOHealth
WHERE EventData.value('(event/@name)[1]', 'varchar(max)') = 'availability_group_lease_expired'
ORDER BY EventData.value('(event/@timestamp)[1]', 'datetime');
PRINT ''
PRINT '======================================'
PRINT 'Error events'
PRINT '======================================'
SELECT EventData.value('(event/@timestamp)[1]', 'datetime') AS TimeStampUTC,
EventData.value('(event/data/value)[1]', 'int') AS ErrorNum,
EventData.value('(event/data/value)[2]', 'int') AS Severity,
EventData.value('(event/data/value)[3]', 'int') AS State,
EventData.value('(event/data/value)[4]', 'varchar(max)') AS UserDefined,
EventData.value('(event/data/text)[5]', 'varchar(max)') AS Category,
EventData.value('(event/data/text)[6]', 'varchar(max)') AS DestinationLog,
EventData.value('(event/data/value)[7]', 'varchar(max)') AS IsIntercepted,
EventData.value('(event/data/value)[8]', 'varchar(max)') AS ErrMessage
INTO #error_reported
FROM #AOHealth
WHERE EventData.value('(event/@name)[1]', 'varchar(max)') = 'error_reported';
--display results from "error_reported" event data
WITH ErrorCTE (ErrorNum, ErrorCount, FirstDate, LastDate) AS (
SELECT ErrorNum, Count(ErrorNum), min(TimeStampUTC), max(TimeStampUTC) As ErrorCount FROM #error_reported
GROUP BY ErrorNum)
SELECT CAST(ErrorNum as CHAR(10)) ErrorNum,
CAST(ErrorCount as CHAR(10)) ErrorCount,
CONVERT(CHAR(25), FirstDate,121) FirstDate,
CONVERT(CHAR(25), LastDate, 121) LastDate,
CAST(CASE ErrorNum
WHEN 35202 THEN 'A connection for availability group ... has been successfully established...'
WHEN 1480 THEN 'The %S_MSG database "%.*ls" is changing roles ... because the AG failed over ...'
WHEN 35206 THEN 'A connection timeout has occurred on a previously established connection ...'
WHEN 35201 THEN 'A connection timeout has occurred while attempting to establish a connection ...'
WHEN 41050 THEN 'Waiting for local WSFC service to start.'
WHEN 41051 THEN 'Local WSFC service started.'
WHEN 41052 THEN 'Waiting for local WSFC node to start.'
WHEN 41053 THEN 'Local WSFC node started.'
WHEN 41054 THEN 'Waiting for local WSFC node to come online.'
WHEN 41055 THEN 'Local WSFC node is online.'
WHEN 41048 THEN 'Local WSFC service has become unavailable.'
WHEN 41049 THEN 'Local WSFC node is no longer online.'
ELSE m.text END AS VARCHAR(81)) [Abbreviated Message]
FROM
ErrorCTE ec LEFT JOIN sys.messages m on ec.ErrorNum = m.message_id
and m.language_id = 1033
ORDER BY CAST(ErrorCount as INT) DESC;
DROP TABLE #AOHealth
DROP TABLE #error_reported | the_stack |
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for clientdetails
-- ----------------------------
DROP TABLE IF EXISTS `clientdetails`;
CREATE TABLE `clientdetails` (
`appId` varchar(255) NOT NULL,
`resourceIds` varchar(256) DEFAULT NULL,
`appSecret` varchar(256) DEFAULT NULL,
`scope` varchar(256) DEFAULT NULL,
`grantTypes` varchar(256) DEFAULT NULL,
`redirectUrl` varchar(256) DEFAULT NULL,
`authorities` varchar(256) DEFAULT NULL,
`access_token_validity` int(11) DEFAULT NULL,
`refresh_token_validity` int(11) DEFAULT NULL,
`additionalInformation` varchar(4096) DEFAULT NULL,
`autoApproveScopes` varchar(256) DEFAULT NULL,
PRIMARY KEY (`appId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of clientdetails
-- ----------------------------
-- ----------------------------
-- Table structure for oauth_access_token
-- ----------------------------
DROP TABLE IF EXISTS `oauth_access_token`;
CREATE TABLE `oauth_access_token` (
`token_id` varchar(256) DEFAULT NULL,
`token` blob,
`authentication_id` varchar(255) NOT NULL,
`user_name` varchar(256) DEFAULT NULL,
`client_id` varchar(256) DEFAULT NULL,
`authentication` blob,
`refresh_token` varchar(256) DEFAULT NULL,
PRIMARY KEY (`authentication_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of oauth_access_token
-- ----------------------------
-- ----------------------------
-- Table structure for oauth_approvals
-- ----------------------------
DROP TABLE IF EXISTS `oauth_approvals`;
CREATE TABLE `oauth_approvals` (
`userId` varchar(256) DEFAULT NULL,
`clientId` varchar(256) DEFAULT NULL,
`scope` varchar(256) DEFAULT NULL,
`status` varchar(10) DEFAULT NULL,
`expiresAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`lastModifiedAt` timestamp NULL DEFAULT NULL
-- `lastModifiedAt` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of oauth_approvals
-- ----------------------------
-- ----------------------------
-- Table structure for oauth_client_details
-- ----------------------------
DROP TABLE IF EXISTS `oauth_client_details`;
CREATE TABLE `oauth_client_details` (
`client_id` varchar(255) NOT NULL,
`resource_ids` varchar(256) DEFAULT NULL,
`client_secret` varchar(256) DEFAULT NULL,
`scope` varchar(256) DEFAULT NULL,
`authorized_grant_types` varchar(256) DEFAULT NULL,
`web_server_redirect_uri` varchar(2560) DEFAULT NULL,
`authorities` varchar(256) DEFAULT NULL,
`access_token_validity` int(11) DEFAULT NULL,
`refresh_token_validity` int(11) DEFAULT NULL,
`additional_information` varchar(4096) DEFAULT NULL,
`autoapprove` varchar(256) DEFAULT NULL,
PRIMARY KEY (`client_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of oauth_client_details
-- ----------------------------
INSERT INTO `oauth_client_details` VALUES ('hiauth_swagger2', '', '$2a$10$1N/.LvTJuYpvxDzoJ1KdvuPDdV/kDSQE9Cxm9BzB1PreyzK6gmFRe', 'AUTH', 'authorization_code', 'http://localhost:8181/hiauth/webjars/springfox-swagger-ui/oauth2-redirect.html,http://hiauth.cn/hiauth/webjars/springfox-swagger-ui/oauth2-redirect.html', 'ROLE_USER', '1800', '86400', '', 'false');
INSERT INTO `oauth_client_details` VALUES ('himall_client_id', '', '$2a$10$1N/.LvTJuYpvxDzoJ1KdvuPDdV/kDSQE9Cxm9BzB1PreyzK6gmFRe', 'AUTH,GOODS,ORDER', 'authorization_code,client_credentials,password,refresh_token', 'http://localhost:8182/himall/callback,http://hiauth.cn/himall/callback', 'ROLE_USER', '1800', '86400', '', 'false');
INSERT INTO `oauth_client_details` VALUES ('umc_client_id', '', '$2a$10$1N/.LvTJuYpvxDzoJ1KdvuPDdV/kDSQE9Cxm9BzB1PreyzK6gmFRe', 'AUTH', 'password', '', 'ROLE_USER', '1800', '86400', '', 'false');
-- ----------------------------
-- Table structure for oauth_client_token
-- ----------------------------
DROP TABLE IF EXISTS `oauth_client_token`;
CREATE TABLE `oauth_client_token` (
`token_id` varchar(256) DEFAULT NULL,
`token` blob,
`authentication_id` varchar(255) NOT NULL,
`user_name` varchar(256) DEFAULT NULL,
`client_id` varchar(256) DEFAULT NULL,
PRIMARY KEY (`authentication_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of oauth_client_token
-- ----------------------------
-- ----------------------------
-- Table structure for oauth_code
-- ----------------------------
DROP TABLE IF EXISTS `oauth_code`;
CREATE TABLE `oauth_code` (
`code` varchar(256) DEFAULT NULL,
`authentication` blob
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of oauth_code
-- ----------------------------
-- ----------------------------
-- Table structure for oauth_refresh_token
-- ----------------------------
DROP TABLE IF EXISTS `oauth_refresh_token`;
CREATE TABLE `oauth_refresh_token` (
`token_id` varchar(256) DEFAULT NULL,
`token` blob,
`authentication` blob
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of oauth_refresh_token
-- ----------------------------
-- ----------------------------
-- Table structure for sys_account
-- ----------------------------
DROP TABLE IF EXISTS `sys_account`;
CREATE TABLE `sys_account` (
`id` bigint(20) NOT NULL,
`userId` bigint(20) DEFAULT NULL COMMENT '管理用户',
`type` varchar(20) DEFAULT NULL COMMENT '第三方账号类型',
`openid` int(64) DEFAULT NULL COMMENT '第三方用户表示',
`accessToken` varchar(100) DEFAULT NULL COMMENT 'accessToken',
`refreshToken` varchar(100) DEFAULT NULL COMMENT 'refreshToken',
`expireTime` datetime DEFAULT NULL COMMENT '失效时间',
`createTime` datetime DEFAULT NULL COMMENT '创建时间',
`lastLoginTime` datetime DEFAULT NULL COMMENT '最后一次登录时间',
PRIMARY KEY (`id`),
UNIQUE KEY `unique_accessToken` (`accessToken`) USING BTREE,
UNIQUE KEY `unique_bindUser` (`userId`,`type`,`openid`) USING BTREE COMMENT '确定user与第三方账号的绑定唯一性'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of sys_account
-- ----------------------------
-- ----------------------------
-- Table structure for sys_app
-- ----------------------------
DROP TABLE IF EXISTS `sys_app`;
CREATE TABLE `sys_app` (
`id` bigint(20) NOT NULL COMMENT '主键',
`clientId` varchar(255) NOT NULL COMMENT '关联oauth_client_details主键client_id',
`name` varchar(20) NOT NULL COMMENT '应用名称',
`img1X` varchar(100) DEFAULT NULL COMMENT '应用图标一倍图',
`createTime` datetime DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`),
UNIQUE KEY `un_clientId` (`clientId`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of sys_app
-- ----------------------------
INSERT INTO `sys_app` VALUES ('1', 'umc_client_id', 'HiAuth用户管理中心', 'https://file.iviewui.com/dist/a0e88e83800f138b94d2414621bd9704.png', '2019-02-05 16:32:36');
INSERT INTO `sys_app` VALUES ('2', 'himall_client_id', '黑猫商城', 'https://file.iviewui.com/dist/a0e88e83800f138b94d2414621bd9704.png', '2019-03-27 15:39:02');
INSERT INTO `sys_app` VALUES ('3', 'hiauth_swagger2', 'HiAuth Swagger2', 'https://file.iviewui.com/dist/a0e88e83800f138b94d2414621bd9704.png', '2019-03-27 15:39:02');
-- ----------------------------
-- Table structure for sys_resource
-- ----------------------------
DROP TABLE IF EXISTS `sys_resource`;
CREATE TABLE `sys_resource` (
`id` bigint(20) NOT NULL,
`domain` varchar(20) DEFAULT NULL COMMENT '资源所属域',
`operate` varchar(10) DEFAULT NULL COMMENT '操作类型:GET,POST,PUT',
`code` varchar(128) DEFAULT NULL COMMENT '资源标识,如果是接口则为url',
`name` varchar(50) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of sys_resource
-- ----------------------------
INSERT INTO `sys_resource` VALUES ('1', 'USER', 'GET', '/user/me', '查询我的信息');
INSERT INTO `sys_resource` VALUES ('2', 'USER', 'GET', '/user/list', '查询用户列表');
-- ----------------------------
-- Table structure for sys_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role` (
`id` bigint(20) NOT NULL,
`code` varchar(20) DEFAULT NULL,
`name` varchar(20) DEFAULT NULL,
`description` varchar(100) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of sys_role
-- ----------------------------
INSERT INTO `sys_role` VALUES ('1', 'ROLE_ADMIN', '管理员', null);
INSERT INTO `sys_role` VALUES ('2', 'ROLE_USER', '普通用户', null);
-- ----------------------------
-- Table structure for sys_role_resource
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_resource`;
CREATE TABLE `sys_role_resource` (
`id` bigint(20) NOT NULL,
`roleId` bigint(20) DEFAULT NULL,
`resourceId` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of sys_role_resource
-- ----------------------------
INSERT INTO `sys_role_resource` VALUES ('1', '1', '1');
INSERT INTO `sys_role_resource` VALUES ('2', '1', '2');
INSERT INTO `sys_role_resource` VALUES ('3', '2', '1');
-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user` (
`id` bigint(20) NOT NULL,
`name` varchar(20) DEFAULT NULL,
`avatarUrl` varchar(255) DEFAULT NULL COMMENT '头像',
`username` varchar(20) NOT NULL,
`password` varchar(128) NOT NULL,
`tel` varchar(20) DEFAULT NULL,
`gender` varchar(10) DEFAULT NULL,
`createTime` datetime DEFAULT NULL,
`lastLoginTime` datetime DEFAULT NULL COMMENT '最近一次登录时间',
PRIMARY KEY (`id`),
UNIQUE KEY `unique_username` (`username`) USING BTREE,
UNIQUE KEY `unique_tel` (`tel`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of sys_user
-- ----------------------------
INSERT INTO `sys_user` VALUES ('1', '张三', 'https://avatar.csdn.net/7/3/C/3_weixin_39780047.jpg', 'admin', '123456', '13712345678', 'MALE', '2018-12-03 17:57:12', '2019-03-25 15:36:02');
INSERT INTO `sys_user` VALUES ('2', '李四', 'https://avatar.csdnimg.cn/2/2/D/2_ayuanhaoshuai.jpg', 'user', '123456', '13812345678', 'UNKNOWN', '2018-12-03 17:57:12', '2019-03-22 15:36:06');
-- ----------------------------
-- Table structure for sys_user_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_role`;
CREATE TABLE `sys_user_role` (
`id` bigint(20) NOT NULL,
`userId` bigint(20) DEFAULT NULL,
`roleId` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of sys_user_role
-- ----------------------------
INSERT INTO `sys_user_role` VALUES ('1', '1', '1');
INSERT INTO `sys_user_role` VALUES ('2', '2', '2');
INSERT INTO `sys_user_role` VALUES ('3', '1', '2'); | the_stack |
-- 1 Update latest_update field to new date
DO $_$
BEGIN
PERFORM VOCABULARY_PACK.SetLatestUpdate(
pVocabularyName => 'OSM',
pVocabularyDate => (SELECT MIN(timestamp)::DATE FROM sources.osm),
pVocabularyVersion => 'OSM Release '||(SELECT MIN(timestamp)::DATE FROM sources.osm),
pVocabularyDevSchema => 'DEV_OSM'
);
PERFORM VOCABULARY_PACK.SetLatestUpdate(
pVocabularyName => 'US Census',
pVocabularyDate => TO_DATE('20170101','yyyymmdd'),
pVocabularyVersion => 'US Census 2017 Release',
pVocabularyDevSchema => 'DEV_OSM',
pAppendVocabulary => TRUE
);
END $_$;
-- 2 Truncate all working tables AND remove indices
TRUNCATE TABLE concept_stage;
TRUNCATE TABLE concept_relationship_stage;
TRUNCATE TABLE concept_synonym_stage;
TRUNCATE TABLE pack_content_stage;
TRUNCATE TABLE drug_strength_stage;
-- 3 OSM Preliminary work
-- 3.1 Creation of osm_boundaries_hierarchy temporary table
DROP TABLE IF EXISTS osm_boundaries_hierarchy;
CREATE TABLE osm_boundaries_hierarchy
( gid integer,
id integer,
country varchar(254),
name varchar(254),
enname varchar(254),
locname varchar(254),
offname varchar(254),
boundary varchar(254),
adminlevel integer,
wikidata varchar(254),
wikimedia varchar(254),
timestamp varchar(254),
note varchar(254),
rpath varchar(254),
iso3166_2 varchar(254),
firts_ancestor_id integer,
second_ancestor_id integer
);
-- 3.2 Creation of osm_excluded_objects temporary table
DROP TABLE IF EXISTS osm_excluded_objects;
CREATE TABLE osm_excluded_objects (LIKE osm_boundaries_hierarchy);
-- 3.3 Population of osm_boundaries_hierarchy temporary table
-- 3.3.1 id has the 1st position in rpath
INSERT INTO osm_boundaries_hierarchy
SELECT s.gid,
s.id,
s.country,
s.name,
s.enname,
s.locname,
s.offname,
s.boundary,
s.adminlevel,
s.wikidata,
s.wikimedia,
s.timestamp,
s.note,
s.rpath,
s.iso3166_2,
CASE WHEN s.adminlevel > s2.adminlevel THEN (regexp_split_to_array(s.rpath, ','))[2] :: INT
WHEN s.adminlevel = s2.adminlevel AND s2.adminlevel > s3.adminlevel THEN (regexp_split_to_array(s.rpath, ','))[3] :: INT
WHEN s.adminlevel = s2.adminlevel AND s2.adminlevel = s3.adminlevel AND s3.adminlevel > s4.adminlevel THEN (regexp_split_to_array(s.rpath, ','))[4] :: INT
WHEN s.adminlevel = s2.adminlevel AND s2.adminlevel = s3.adminlevel AND s3.adminlevel = s4.adminlevel AND s4.adminlevel > s5.adminlevel THEN (regexp_split_to_array(s.rpath, ','))[5] :: INT
WHEN s.adminlevel = 2 THEN (regexp_split_to_array(s.rpath, ','))[2] :: INT
ELSE 1
END as first_ancestor_id,
CASE WHEN s.adminlevel > s2.adminlevel THEN (regexp_split_to_array(s.rpath, ','))[3] :: INT
WHEN s.adminlevel = s2.adminlevel AND s2.adminlevel > s3.adminlevel THEN (regexp_split_to_array(s.rpath, ','))[4] :: INT
WHEN s.adminlevel = s2.adminlevel AND s2.adminlevel = s3.adminlevel AND s3.adminlevel > s4.adminlevel THEN (regexp_split_to_array(s.rpath, ','))[5] :: INT
WHEN s.adminlevel = s2.adminlevel AND s2.adminlevel = s3.adminlevel AND s3.adminlevel = s4.adminlevel AND s4.adminlevel > s5.adminlevel THEN (regexp_split_to_array(s.rpath, ','))[6] :: INT
WHEN s.adminlevel = 2 THEN (regexp_split_to_array(s.rpath, ','))[2] :: INT
ELSE 1
END as second_ancestor_id
FROM sources.osm s
LEFT JOIN sources.osm s2
ON (regexp_split_to_array(s.rpath, ','))[2] :: INT = s2.id
LEFT JOIN sources.osm s3
ON (regexp_split_to_array(s.rpath, ','))[3] :: INT = s3.id
LEFT JOIN sources.osm s4
ON (regexp_split_to_array(s.rpath, ','))[4] :: INT = s4.id
LEFT JOIN sources.osm s5
ON (regexp_split_to_array(s.rpath, ','))[5] :: INT = s5.id
WHERE s.id = (regexp_split_to_array(s.rpath, ','))[1] :: INT;
-- 3.3.2 id has the 2nd position in rpath
INSERT INTO osm_boundaries_hierarchy
SELECT s.gid,
s.id,
s.country,
s.name,
s.enname,
s.locname,
s.offname,
s.boundary,
s.adminlevel,
s.wikidata,
s.wikimedia,
s.timestamp,
s.note,
s.rpath,
s.iso3166_2,
CASE WHEN s.adminlevel = s1.adminlevel AND s.adminlevel > s3.adminlevel THEN (regexp_split_to_array(s.rpath, ','))[3] :: INT
WHEN s.adminlevel = s3.adminlevel AND s3.adminlevel > s4.adminlevel THEN (regexp_split_to_array(s.rpath, ','))[4] :: INT
ELSE 1
END as first_ancestor_id,
CASE WHEN s.adminlevel = s1.adminlevel AND s.adminlevel > s3.adminlevel THEN (regexp_split_to_array(s.rpath, ','))[4] :: INT
WHEN s.adminlevel = s3.adminlevel AND s3.adminlevel > s4.adminlevel THEN (regexp_split_to_array(s.rpath, ','))[5] :: INT
ELSE 1
END as second_ancestor_id
FROM sources.osm s
LEFT JOIN sources.osm s1
ON (regexp_split_to_array(s.rpath, ','))[1] :: INT = s1.id
LEFT JOIN sources.osm s3
ON (regexp_split_to_array(s.rpath, ','))[3] :: INT = s3.id
LEFT JOIN sources.osm s4
ON (regexp_split_to_array(s.rpath, ','))[4] :: INT = s4.id
WHERE s.id = (regexp_split_to_array(s.rpath, ','))[2] :: INT
AND s.id != (regexp_split_to_array(s.rpath, ','))[1] :: INT;
-- 3.3.3 id has the 3rd position in rpath
INSERT INTO osm_boundaries_hierarchy
SELECT s.gid,
s.id,
s.country,
s.name,
s.enname,
s.locname,
s.offname,
s.boundary,
s.adminlevel,
s.wikidata,
s.wikimedia,
s.timestamp,
s.note,
s.rpath,
s.iso3166_2,
CASE WHEN s.adminlevel = s1.adminlevel AND s.adminlevel = s2.adminlevel AND s.adminlevel > s4.adminlevel THEN (regexp_split_to_array(s.rpath, ','))[4] :: INT
WHEN s.adminlevel = s1.adminlevel AND s.adminlevel = s2.adminlevel AND s.adminlevel = s4.adminlevel AND s.adminlevel > s5.adminlevel THEN (regexp_split_to_array(s.rpath, ','))[5] :: INT
WHEN s.adminlevel = s1.adminlevel AND s.adminlevel = s2.adminlevel AND s.adminlevel = s4.adminlevel AND s.adminlevel = s5.adminlevel AND s.adminlevel > s10.adminlevel THEN (regexp_split_to_array(s.rpath, ','))[10] :: INT
ELSE 1
END as first_ancestor_id,
CASE WHEN s.adminlevel = s1.adminlevel AND s.adminlevel = s2.adminlevel AND s.adminlevel > s4.adminlevel THEN (regexp_split_to_array(s.rpath, ','))[5] :: INT
WHEN s.adminlevel = s1.adminlevel AND s.adminlevel = s2.adminlevel AND s.adminlevel = s4.adminlevel AND s.adminlevel > s5.adminlevel THEN (regexp_split_to_array(s.rpath, ','))[6] :: INT
WHEN s.adminlevel = s1.adminlevel AND s.adminlevel = s2.adminlevel AND s.adminlevel = s4.adminlevel AND s.adminlevel = s5.adminlevel AND s.adminlevel > s10.adminlevel THEN (regexp_split_to_array(s.rpath, ','))[11] :: INT
ELSE 1
END as second_ancestor_id
FROM sources.osm s
LEFT JOIN sources.osm s1
ON (regexp_split_to_array(s.rpath, ','))[1] :: INT = s1.id
LEFT JOIN sources.osm s2
ON (regexp_split_to_array(s.rpath, ','))[2] :: INT = s2.id
LEFT JOIN sources.osm s4
ON (regexp_split_to_array(s.rpath, ','))[4] :: INT = s4.id
LEFT JOIN sources.osm s5
ON (regexp_split_to_array(s.rpath, ','))[5] :: INT = s5.id
LEFT JOIN sources.osm s10
ON (regexp_split_to_array(s.rpath, ','))[10] :: INT = s10.id
WHERE s.id = (regexp_split_to_array(s.rpath, ','))[3] :: INT
AND s.id != (regexp_split_to_array(s.rpath, ','))[1] :: INT;
-- 3.4 Geo objects clean-up
-- 3.4.1 Excluding the useless & no name objects & >2 count objects
INSERT INTO osm_excluded_objects
SELECT *
FROM osm_boundaries_hierarchy
WHERE (name in ('(Neighborhood)', '平野', '村元')
OR name ilike '%-banchi'
OR name ~* '(Bear River|Membertou|Millbrook|Acadia|Pictou|Sipekne''katik)( First Nation)'
OR name ~* '^\d*$'
--counterpart objects
OR id in (8864148, 3960529, 8554903, 6890921, 341752, 341751, 8864429, 9078749, 627469724, 5776358, 7698707, 5815542, 8612543, 5812080, 9069117, 5289198, 7311462, 7311463, 4494994, 6596786, 112818, 4748341, 4755073,
6824037, 9342059, 9182094)
--wrong objects
OR id in (8481365, 9103732, 8476276, 6151013, 8283183, 9232301, 1790468, 8209939, 9122618, 3695278, 3185371, 7272976, 8118162, 6769003, 8864042, 3891647, 3883997, 8885026, 6188421, 7297827, 8325776, 5316707, 6190799,
5317611, 5326982, 6634642, 8461523, 8274922, 5316882, 9256382, 9133146, 7516050, 9245215, 9236300, 7400296, 5668303, 7783258, 2618987, 1614222, 64630, 3807709, 2725328, 8864116, 3879477, 3879474, 8880546, 33117499,
3881347, 3884282, 3884273, 8552675, 8885351, 8855702, 3011419, 5683043, 1969640, 6933036, 6891043, 7284117, 7311459, 7300811, 7389694, 2743802, 5476350, 112987, 133295, 3545808, 110743, 113000, 112361, 125443, 112421,
112395, 8249855, 110692, 141058, 110825, 3460806, 110547, 7008694, 5999407, 8539828, 4618535, 4559221, 8277846, 8250162, 8288009, 8246892, 8540079, 8288011, 5543342, 8158336, 8534055, 7311466, 4536855,904177, 7037589, 8250156,
8250158, 4603713, 4103691, 9107923, 6164994, 4002153, 8201989, 8199182, 6932977, 9215366, 4142039, 4142040, 9252171, 9302983, 6893574, 4079756, 9266970, 6164118, 3959632, 9182093, 8238110)
--wrong objects from different adminlevels, but equal geography
OR id in (5808786, 3884168, 6210876, 6992297, 6355818, 5231035, 8402981, 6242282, 6992286, 4587947, 6891534, 8388202, 3856703, 7182975, 7159794, 5758866, 5758865, 7783254, 7815256, 7763854, 3565868, 7972501, 8101735, 5190251))
AND id <> 5012169;
--Delete from osm_boundaries_hierarchy
DELETE FROM osm_boundaries_hierarchy
WHERE id in (SELECT id FROM osm_excluded_objects);
-- 3.4.2 Delete counterpart objects with same geography but without wikidata
INSERT INTO osm_excluded_objects
SELECT *
FROM osm_boundaries_hierarchy
WHERE id in (
SELECT MIN (a2.id)
FROM osm_boundaries_hierarchy a1
JOIN osm_boundaries_hierarchy a2
ON a1.country = a2.country AND a1.id != a2.id AND a1.name = a2.name AND a1.firts_ancestor_id = a2.firts_ancestor_id AND a1.adminlevel = a2.adminlevel
JOIN sources.osm osm1
ON a1.id = osm1.id
JOIN sources.osm osm2
ON a2.id = osm2.id
WHERE osm1.geom :: devv5.geography = osm2.geom :: devv5.geography
AND (a1.wikidata IS NOT NULL OR a1.wikimedia IS NOT NULL)
GROUP BY a1.name
HAVING COUNT (*) = 1
)
AND id not in (SELECT id FROM osm_excluded_objects);
--Delete from osm_boundaries_hierarchy
DELETE FROM osm_boundaries_hierarchy
WHERE id in (SELECT id FROM osm_excluded_objects);
-- 3.4.3 Delete counterpart objects with same geography, but higher id
INSERT INTO osm_excluded_objects
SELECT *
FROM osm_boundaries_hierarchy
WHERE id in (
SELECT MAX (a2.id)
FROM osm_boundaries_hierarchy a1
JOIN osm_boundaries_hierarchy a2
ON a1.country = a2.country AND a1.id != a2.id AND a1.name = a2.name AND a1.firts_ancestor_id = a2.firts_ancestor_id AND a1.adminlevel = a2.adminlevel
JOIN sources.osm osm1
ON a1.id = osm1.id
JOIN sources.osm osm2
ON a2.id = osm2.id
WHERE osm1.geom :: devv5.geography = osm2.geom :: devv5.geography
GROUP BY a1.name
HAVING COUNT (*) = 2
)
AND id not in (SELECT id FROM osm_excluded_objects);
--Delete from osm_boundaries_hierarchy
DELETE FROM osm_boundaries_hierarchy
WHERE id in (SELECT id FROM osm_excluded_objects);
-- 3.4.4 Excluding the useless & no name & counterpart objects in UK
INSERT INTO osm_excluded_objects
SELECT *
FROM osm_boundaries_hierarchy
WHERE name in ('Glebe', 'Mullaghmore', 'Ballykeel', 'Tully', 'Cabragh', 'Tamlaght', 'Dromore', 'Ballymoney', 'Greenan', 'Gorteen')
AND country = 'GBR'
AND adminlevel = 10
AND NOT (id = 4452073 AND firts_ancestor_id not in (156393, 1119534)) --Glebe
AND NOT (id = 5416800 AND firts_ancestor_id not in (156393, 1117773)) --Glebe
AND NOT (id = 5481741 AND firts_ancestor_id not in (156393)) --Glebe
AND NOT (id = 5321265 AND firts_ancestor_id not in (156393, 1117773)) --Mullaghmore
AND NOT (id = 4167260 AND firts_ancestor_id not in (156393, 1119534)) --Ballykeel
AND NOT (id = 3631266 AND firts_ancestor_id not in (156393, 1118085)) --Tully
AND NOT (id = 5476251 AND firts_ancestor_id not in (156393)) --Cabragh
AND NOT (id = 3629081 AND firts_ancestor_id not in (156393)) --Tamlaght
AND NOT (id = 267762718 AND firts_ancestor_id not in (156393)) --Tamlaght
AND NOT (id in (267763207, 267762836) AND firts_ancestor_id not in (156393)) --Dromore
AND NOT (id = 1604307220 AND firts_ancestor_id not in (156393)) --Ballymoney
AND NOT (id = 4519571 AND firts_ancestor_id not in (156393, 1119534)) --Ballymoney
AND id not in (SELECT id FROM osm_excluded_objects);
--Delete from osm_boundaries_hierarchy
DELETE FROM osm_boundaries_hierarchy
WHERE id in (SELECT id FROM osm_excluded_objects);
ANALYSE osm_boundaries_hierarchy;
-- 3.4.5 Excluding the counterpart objects in UK
with counterparts as (
SELECT a1.id as id_1,
a2.id as id_2
FROM osm_boundaries_hierarchy a1
JOIN osm_boundaries_hierarchy a2
ON a1.country = a2.country AND a1.name = a2.name AND a1.firts_ancestor_id = a2.firts_ancestor_id AND a1.adminlevel = a2.adminlevel
)
INSERT INTO osm_excluded_objects
SELECT *
FROM osm_boundaries_hierarchy bh
WHERE id in (
SELECT id_2
FROM counterparts
WHERE id_1 in (
SELECT id_1
FROM counterparts c
GROUP BY id_1
HAVING COUNT(*) > 1
)
)
AND wikidata IS NULL
AND wikimedia IS NULL
AND country = 'GBR'
AND adminlevel = 10
AND id NOT in (4868152, 5218754, 5225378, 2895940, 5160147)
AND id not in (SELECT id FROM osm_excluded_objects);
--Delete from osm_boundaries_hierarchy
DELETE FROM osm_boundaries_hierarchy
WHERE id in (SELECT id FROM osm_excluded_objects);
-- 3.5 Hierarchy fix
-- 3.5.1 Update firts_ancestor_id if parent was deleted
UPDATE osm_boundaries_hierarchy
SET firts_ancestor_id = second_ancestor_id
WHERE id in (
SELECT a.id
FROM osm_boundaries_hierarchy a
JOIN osm_excluded_objects b
ON a.firts_ancestor_id = b.id
)
AND country != 'CAN';
-- 3.5.2 Manual targeted updates
UPDATE osm_boundaries_hierarchy
SET firts_ancestor_id = 9150813
WHERE id = 9150812;
UPDATE osm_boundaries_hierarchy
SET firts_ancestor_id = 5884638
WHERE id = 206873;
-- 3.6 Delete remaining children of excluded objects
INSERT INTO osm_excluded_objects
SELECT *
FROM osm_boundaries_hierarchy
WHERE id in (
SELECT a.id
FROM osm_boundaries_hierarchy a
JOIN osm_excluded_objects b
ON a.firts_ancestor_id = b.id
)
AND id not in (SELECT id FROM osm_excluded_objects);
--Delete from osm_boundaries_hierarchy
DELETE FROM osm_boundaries_hierarchy
WHERE id in (SELECT id FROM osm_excluded_objects);
-- 4 OSM Population of stages
-- 4.1 Population of concept_stage
INSERT INTO concept_stage
SELECT NULL AS concept_id,
name AS concept_name,
'Geography' AS domain_id,
'OSM' AS vocabulary_id,
CASE adminlevel :: INT
WHEN 2 THEN '2nd level'
WHEN 3 THEN '3rd level'
WHEN 4 THEN '4th level'
WHEN 5 THEN '5th level'
WHEN 6 THEN '6th level'
WHEN 7 THEN '7th level'
WHEN 8 THEN '8th level'
WHEN 9 THEN '9th level'
WHEN 10 THEN '10th level'
WHEN 11 THEN '11th level'
WHEN 12 THEN '12th level' END as concept_class_id,
'S' as standard_concept,
id as concept_code,
TO_DATE('19700101','yyyymmdd') as valid_start_date,
TO_DATE('20991231','yyyymmdd') as valid_end_date,
NULL as invalid_reason
FROM osm_boundaries_hierarchy;
-- 4.2 Population of concept_synonym_stage
-- 4.2.1 Using locname
INSERT INTO concept_synonym_stage
SELECT NULL as synonym_concept_id,
locname as synonym_name,
id as synonym_concept_code,
'OSM' as synonym_vocabulary_id,
CASE country
WHEN 'BEL' THEN 4182503
WHEN 'BRA' THEN 4181536
WHEN 'CAN' THEN 4180190
WHEN 'CHN' THEN 4182948
WHEN 'DEU' THEN 4182504
WHEN 'DNK' THEN 4180183
WHEN 'ESP' THEN 4182511
WHEN 'FRA' THEN 4180190
WHEN 'GBR' THEN 4180186
WHEN 'ISR' THEN CASE WHEN locname ~* 'א|ב|ג|ד|ה|ו|ז|ח|ט|י|מ|נ|ם|ן|פ|צ|ף|ץ|ס|ע|ק|ר|ש|ת|ל|כ|ך' THEN 4180047
WHEN locname !~* 'א|ב|ג|ד|ה|ו|ז|ח|ט|י|מ|נ|ם|ן|פ|צ|ף|ץ|ס|ע|ק|ר|ש|ת|ל|כ|ך' THEN 4181374 ELSE 0 END
WHEN 'ITA' THEN 4182507
WHEN 'JPN' THEN 4181524
WHEN 'KOR' THEN 4175771
WHEN 'NLD' THEN 4182503
WHEN 'SAU' THEN 4181374
WHEN 'SWE' THEN 4175777
WHEN 'USA' THEN 4180186
WHEN 'ZAF' THEN 4180186
ELSE 0 END as language_concept_id
FROM osm_boundaries_hierarchy
WHERE locname != name;
-- 4.2.2 Using offname
INSERT INTO concept_synonym_stage
SELECT NULL as synonym_concept_id,
offname as synonym_name,
id as synonym_concept_code,
'OSM' as synonym_vocabulary_id,
CASE country
WHEN 'AUS' THEN 4180186
WHEN 'BEL' THEN 4182503
WHEN 'BRA' THEN 4181536
WHEN 'CAN' THEN 4180186
WHEN 'CHN' THEN 4182948
WHEN 'DEU' THEN 4182504
WHEN 'DNK' THEN 4180183
WHEN 'ESP' THEN 4182511
WHEN 'FRA' THEN 4180190
WHEN 'GBR' THEN 4180186
WHEN 'ISR' THEN CASE WHEN offname ~* 'א|ב|ג|ד|ה|ו|ז|ח|ט|י|מ|נ|ם|ן|פ|צ|ף|ץ|ס|ע|ק|ר|ש|ת|ל|כ|ך' THEN 4180047
WHEN offname !~* 'א|ב|ג|ד|ה|ו|ז|ח|ט|י|מ|נ|ם|ן|פ|צ|ף|ץ|ס|ע|ק|ר|ש|ת|ל|כ|ך' THEN 4181374 ELSE 0 END
WHEN 'ITA' THEN 4182507
WHEN 'JPN' THEN 4181524
WHEN 'KOR' THEN 4175771
WHEN 'NLD' THEN 4182503
WHEN 'SAU' THEN 4181374
WHEN 'SWE' THEN 4175777
WHEN 'USA' THEN 4180186
WHEN 'ZAF' THEN 4180186
ELSE 0 END as language_concept_id
FROM osm_boundaries_hierarchy
WHERE offname != name
AND offname != locname;
-- 4.3 Population of concept_relationship_stage
-- 4.3.1 Is a relationship
INSERT INTO concept_relationship_stage
SELECT NULL as concept_id_1,
NULL as concept_id_2,
id as concept_code_1,
firts_ancestor_id as concept_code_2,
'OSM' as vocabulary_id_1,
'OSM' as vocabulary_id_2,
'Is a' as relationship_id,
TO_DATE ('19700101', 'yyyymmdd') as valid_start_date,
TO_DATE ('20991231', 'yyyymmdd') as valid_end_date,
NULL as invalid_reason
FROM osm_boundaries_hierarchy
WHERE firts_ancestor_id != 0;
-- 5 US Census Preliminary work
-- 5.1 Creation of divisions temporary table with link to region
DROP TABLE IF EXISTS us_divisions;
CREATE TABLE us_divisions
(
gid int,
divisionce varchar(1),
affgeoid varchar(10),
geoid varchar(1),
name varchar(100),
lsad varchar(2),
aland double precision,
awater double precision,
region_code varchar(50)
);
-- 5.2 Creation of us_states temporary table with link to division
DROP TABLE IF EXISTS us_states;
CREATE TABLE us_states
(
state_concept_code varchar(50), --OSM concept_codes
division_concept_code varchar(50) --US Census concept_code
);
-- 5.3 Population of divisions temporary table with link to region
INSERT INTO us_divisions
SELECT gid,
divisionce,
affgeoid,
geoid,
name,
lsad,
aland,
awater,
CASE
WHEN name in ('New England' ,'Middle Atlantic')
THEN '0200000US1' --Region 1: Northeast
WHEN name in ('East North Central', 'West North Central')
THEN '0200000US2' --Region 2: Midwest
WHEN name in ('East South Central', 'West South Central', 'South Atlantic')
THEN '0200000US3' --Region 3: South
WHEN name in ('Mountain', 'Pacific')
THEN '0200000US4' --Region 4: West
ELSE '0'
END as region_code
FROM sources.cb_us_division_500k;
-- 5.4 Population of us_states temporary table with link to divisions
INSERT INTO us_states
SELECT id,
CASE WHEN name in ('Connecticut', 'Maine', 'Massachusetts', 'New Hampshire', 'Rhode Island', 'Vermont')
THEN '0300000US1' --Division 1: New England
WHEN name in ('New Jersey', 'New York', 'Pennsylvania')
THEN '0300000US2' --Division 2: Middle Atlantic
WHEN name in ('Illinois', 'Indiana', 'Michigan', 'Ohio', 'Wisconsin')
THEN '0300000US3' --Division 3: East North Central
WHEN name in ('Iowa', 'Kansas', 'Minnesota', 'Missouri', 'Nebraska', 'North Dakota', 'South Dakota')
THEN '0300000US4' --Division 4: West North Central
WHEN name in ('Delaware', 'District of Columbia', 'Florida', 'Georgia', 'Maryland', 'North Carolina', 'South Carolina', 'Virginia', 'West Virginia')
THEN '0300000US5' --Division 5: South Atlantic
WHEN name in ('Alabama', 'Kentucky', 'Mississippi', 'Tennessee')
THEN '0300000US6' --Division 6: East South Central
WHEN name in ('Arkansas', 'Louisiana', 'Oklahoma', 'Texas')
THEN '0300000US7' --Division 7: West South Central
WHEN name in ('Arizona', 'Colorado', 'Idaho', 'Montana', 'Nevada', 'New Mexico', 'Utah', 'Wyoming')
THEN '0300000US8' --Division 8: Mountain
WHEN name in ('Alaska', 'California', 'Hawaii', 'Oregon', 'Washington')
THEN '0300000US9' --Division 9: Pacific
ELSE '0'
END as division_concept_code
FROM osm_boundaries_hierarchy
WHERE country = 'USA'
AND adminlevel = 4;
-- 6 US Census Population of stages
-- 6.1 Population of concept_stage
-- 6.1.1 US Census regions
INSERT INTO concept_stage
SELECT NULL as concept_id,
name as concept_name,
'Geography' as domain_id,
'US Census' as vocabulary_id,
'US Census Region' as concept_class_id,
'S' as standard_concept,
affgeoid as concept_code,
TO_DATE('19700101','yyyymmdd') as valid_start_date,
TO_DATE('20991231','yyyymmdd') as valid_end_date,
null as invalid_reason
FROM sources.cb_us_region_500k;
-- 6.1.2 US Census divisions
INSERT INTO concept_stage
SELECT NULL as concept_id,
name as concept_name,
'Geography' as domain_id,
'US Census' as vocabulary_id,
'US Census Division' as concept_class_id,
'S' as standard_concept,
affgeoid as concept_code,
TO_DATE('19700101','yyyymmdd') as valid_start_date,
TO_DATE('20991231','yyyymmdd') as valid_end_date,
null as invalid_reason
FROM sources.cb_us_division_500k;
-- 6.2 Population of concept_synonym_stage
-- 6.2.1 US Census regions
INSERT INTO concept_synonym_stage
SELECT NULL as synonym_concept_id,
'Region ' || geoid || ': ' || name as synonym_name,
affgeoid as synonym_concept_code,
'US Census' as synonym_vocabulary_id,
4180186 as language_concept_id
FROM sources.cb_us_region_500k;
-- 6.2.2 US Census divisions
INSERT INTO concept_synonym_stage
SELECT NULL as synonym_concept_id,
'Division ' || geoid || ': ' || name as synonym_name,
affgeoid as synonym_concept_code,
'US Census' as synonym_vocabulary_id,
4180186 as language_concept_id
FROM sources.cb_us_division_500k;
-- 6.3 Population of concept_relationship_stage
-- 6.3.1 US Census regions
INSERT INTO concept_relationship_stage
SELECT NULL as concept_id_1,
NULL as concept_id_2,
affgeoid as concept_code_1,
'148838' as concept_code_2, --United States
'US Census' as vocabulary_id_1,
'OSM' as vocabulary_id_2,
'Is a' as relationship_id,
TO_DATE('19700101','yyyymmdd') as valid_start_date,
TO_DATE('20991231','yyyymmdd') as valid_end_date,
NULL as invalid_reason
FROM sources.cb_us_region_500k;
-- 6.3.2 US Census divisions
INSERT INTO concept_relationship_stage
SELECT NULL as concept_id_1,
NULL as concept_id_2,
affgeoid as concept_code_1,
region_code as concept_code_2,
'US Census' as vocabulary_id_1,
'US Census' as vocabulary_id_2,
'Is a' as relationship_id,
TO_DATE('19700101','yyyymmdd') as valid_start_date,
TO_DATE('20991231','yyyymmdd') as valid_end_date,
NULL as invalid_reason
FROM us_divisions;
-- 6.3.3 US states
INSERT INTO concept_relationship_stage
SELECT NULL as concept_id_1,
NULL as concept_id_2,
state_concept_code as concept_code_1,
division_concept_code as concept_code_2,
'OSM' as vocabulary_id_1,
'US Census' as vocabulary_id_2,
'Is a' as relationship_id,
TO_DATE('19700101','yyyymmdd') as valid_start_date,
TO_DATE('20991231','yyyymmdd') as valid_end_date,
NULL as invalid_reason
FROM us_states
WHERE division_concept_code <> '0';
-- 7 Removal of OSM relationships between USA and division-bounded states
DELETE FROM concept_relationship_stage
WHERE concept_code_2 = '148838' --United States
AND concept_code_1 in (
SELECT state_concept_code
FROM us_states
WHERE division_concept_code <> '0'
);
-- 8 Clean-up
DROP TABLE osm_boundaries_hierarchy;
DROP TABLE osm_excluded_objects;
DROP TABLE us_states;
DROP TABLE us_divisions;
-- At the end, the three tables concept_stage, concept_relationship_stage and concept_synonym_stage should be ready to be fed into the generic_update.sql script | the_stack |
-- SETTINGS
SET @iTypeOrder = (SELECT MAX(`order`) FROM `sys_options_types` WHERE `group` = 'modules');
INSERT INTO `sys_options_types`(`group`, `name`, `caption`, `icon`, `order`) VALUES
('modules', 'bx_persons', '_bx_persons', 'bx_persons@modules/boonex/persons/|std-mi.png', IF(ISNULL(@iTypeOrder), 1, @iTypeOrder + 1));
SET @iTypeId = LAST_INSERT_ID();
INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order`)
VALUES (@iTypeId, 'bx_persons', '_bx_persons', 1);
SET @iCategId = LAST_INSERT_ID();
INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
('bx_persons_autoapproval', 'on', @iCategId, '_bx_persons_option_autoapproval', 'checkbox', '', '', '', 1),
('bx_persons_default_acl_level', '3', @iCategId, '_bx_persons_option_default_acl_level', 'select', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:15:"get_memberships";s:6:"params";a:2:{i:0;b:0;i:1;b:1;}s:5:"class";s:16:"TemplAclServices";}', '', '', 2),
('bx_persons_num_connections_quick', '4', @iCategId, '_bx_persons_option_num_connections_quick', 'digit', '', '', '', 10),
('bx_persons_num_rss', '10', @iCategId, '_bx_persons_option_num_rss', 'digit', '', '', '', 12);
-- PAGES
-- PAGE: create profile
INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES
('bx_persons_create_profile', 'create-persons-profile', '_bx_persons_page_title_sys_create_profile', '_bx_persons_page_title_create_profile', 'bx_persons', 5, 2147483647, 1, 'page.php?i=create-persons-profile', '', '', '', 0, 1, 0, '', '');
INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
('bx_persons_create_profile', 1, 'bx_persons', '_bx_persons_page_block_title_create_profile', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:10:\"bx_persons\";s:6:\"method\";s:13:\"entity_create\";}', 0, 1, 1);
-- PAGE: view profile
INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES
('bx_persons_view_profile', 'view-persons-profile', '_bx_persons_page_title_sys_view_profile', '_bx_persons_page_title_view_profile', 'bx_persons', 10, 2147483647, 1, 'page.php?i=view-persons-profile', '', '', '', 0, 1, 0, 'BxPersonsPageEntry', 'modules/boonex/persons/classes/BxPersonsPageEntry.php');
INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
('bx_persons_view_profile', 1, 'bx_persons', '_bx_persons_page_block_title_profile_actions', 3, 2147483647, 'service', 'a:2:{s:6:\"module\";s:10:\"bx_persons\";s:6:\"method\";s:14:\"entity_actions\";}', 0, 0, 0),
('bx_persons_view_profile', 1, 'bx_persons', '_bx_persons_page_block_title_profile_cover', 3, 2147483647, 'service', 'a:2:{s:6:\"module\";s:10:\"bx_persons\";s:6:\"method\";s:13:\"profile_cover\";}', 0, 0, 1),
('bx_persons_view_profile', 2, 'bx_persons', '_bx_persons_page_block_title_profile_info', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:10:\"bx_persons\";s:6:\"method\";s:11:\"entity_info\";}', 0, 0, 0),
('bx_persons_view_profile', 3, 'bx_persons', '_bx_persons_page_block_title_profile_friends', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:10:\"bx_persons\";s:6:\"method\";s:15:\"profile_friends\";}', 0, 0, 0);
-- PAGE: edit profile
INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES
('bx_persons_edit_profile', 'edit-persons-profile', '_bx_persons_page_title_sys_edit_profile', '_bx_persons_page_title_edit_profile', 'bx_persons', 5, 2147483647, 1, 'page.php?i=edit-persons-profile', '', '', '', 0, 1, 0, 'BxPersonsPageEntry', 'modules/boonex/persons/classes/BxPersonsPageEntry.php');
INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
('bx_persons_edit_profile', 1, 'bx_persons', '_bx_persons_page_block_title_edit_profile', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:10:\"bx_persons\";s:6:\"method\";s:11:\"entity_edit\";}', 0, 0, 0);
-- PAGE: edit profile cover
INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES
('bx_persons_edit_profile_cover', 'edit-persons-cover', '_bx_persons_page_title_sys_edit_profile_cover', '_bx_persons_page_title_edit_profile_cover', 'bx_persons', 5, 2147483647, 1, 'page.php?i=edit-persons-cover', '', '', '', 0, 1, 0, 'BxPersonsPageEntry', 'modules/boonex/persons/classes/BxPersonsPageEntry.php');
INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
('bx_persons_edit_profile_cover', 1, 'bx_persons', '_bx_persons_page_block_title_edit_profile_cover', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:10:\"bx_persons\";s:6:\"method\";s:17:\"entity_edit_cover\";}', 0, 0, 0);
-- PAGE: delete profile
INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES
('bx_persons_delete_profile', 'delete-persons-profile', '_bx_persons_page_title_sys_delete_profile', '_bx_persons_page_title_delete_profile', 'bx_persons', 5, 2147483647, 1, 'page.php?i=delete-persons-profile', '', '', '', 0, 1, 0, 'BxPersonsPageEntry', 'modules/boonex/persons/classes/BxPersonsPageEntry.php');
INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
('bx_persons_delete_profile', 1, 'bx_persons', '_bx_persons_page_block_title_delete_profile', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:10:\"bx_persons\";s:6:\"method\";s:13:\"entity_delete\";}', 0, 0, 0);
-- PAGE: profile info
INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES
('bx_persons_profile_info', 'persons-profile-info', '_bx_persons_page_title_sys_profile_info', '_bx_persons_page_title_profile_info', 'bx_persons', 5, 2147483647, 1, 'page.php?i=persons-profile-info', '', '', '', 0, 1, 0, 'BxPersonsPageEntry', 'modules/boonex/persons/classes/BxPersonsPageEntry.php');
INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
('bx_persons_profile_info', 1, 'bx_persons', '_bx_persons_page_block_title_profile_info', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:10:\"bx_persons\";s:6:\"method\";s:11:\"entity_info\";}', 0, 0, 1);
-- PAGE: profile friends
INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES
('bx_persons_profile_friends', 'persons-profile-friends', '_bx_persons_page_title_sys_profile_friends', '_bx_persons_page_title_profile_friends', 'bx_persons', 5, 2147483647, 1, 'page.php?i=persons-profile-friends', '', '', '', 0, 1, 0, 'BxPersonsPageEntry', 'modules/boonex/persons/classes/BxPersonsPageEntry.php');
INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
('bx_persons_profile_friends', 1, 'bx_persons', '_bx_persons_page_block_title_profile_friends', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:6:\"system\";s:6:\"method\";s:17:\"connections_table\";s:5:\"class\";s:23:\"TemplServiceConnections\";}', 0, 0, 1);
-- PAGE: module home
INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES
('bx_persons_home', '_bx_persons_page_title_sys_home', '_bx_persons_page_title_home', 'bx_persons', 5, 2147483647, 1, 'persons-home', 'page.php?i=persons-home', '', '', '', 0, 1, 0, 'BxPersonsPageBrowse', 'modules/boonex/persons/classes/BxPersonsPageBrowse.php');
INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
('bx_persons_home', 1, 'bx_persons', '_bx_persons_page_block_title_latest_profiles', 0, 2147483647, 'service', 'a:3:{s:6:\"module\";s:10:\"bx_persons\";s:6:\"method\";s:22:\"browse_recent_profiles\";s:6:"params";a:1:{i:0;b:1;}}', 0, 1, 0);
-- PAGE: add block to homepage
SET @iBlockOrder = (SELECT `order` FROM `sys_pages_blocks` WHERE `object` = 'sys_home' AND `cell_id` = 1 ORDER BY `order` DESC LIMIT 1);
INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
('sys_home', 1, 'bx_persons', '_bx_persons_page_block_title_latest_profiles', 0, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_persons";s:6:"method";s:22:"browse_recent_profiles";}', 1, 0, IFNULL(@iBlockOrder, 0) + 1);
-- MENU
-- MENU: add to site menu
SET @iSiteMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_site' AND `active` = 1 ORDER BY `order` DESC LIMIT 1);
INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
('sys_site', 'bx_persons', 'persons-home', '_bx_persons_menu_item_title_system_entries_home', '_bx_persons_menu_item_title_entries_home', 'page.php?i=persons-home', '', '', 'user col-blue3', 'bx_persons_submenu', 2147483647, 1, 1, IFNULL(@iSiteMenuOrder, 0) + 1);
--SET @iCreateProfileMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_profiles_create' AND `active` = 1 ORDER BY `order` DESC LIMIT 1);
--INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
--('sys_profiles_create', 'bx_persons', 'create-person-profile', '_bx_persons_menu_item_title_system_profile_type', '_bx_persons_menu_item_title_profile_type', 'page.php?i=create-persons-profile', '', '', 'user', '', 2147483647, 1, 1, IFNULL(@iCreateProfileMenuOrder, 0) + 1);
SET @iAddMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_add_profile_links' AND `active` = 1 ORDER BY `order` DESC LIMIT 1);
INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
('sys_add_profile_links', 'bx_persons', 'create-persons-profile', '_bx_persons_menu_item_title_system_create_profile', '_bx_persons_menu_item_title_create_profile', 'page.php?i=create-persons-profile', '', '', 'user', '', 2147483647, 1, 1, IFNULL(@iAddMenuOrder, 0) + 1);
-- MENU: view actions
INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
('bx_persons_view_actions', '_bx_persons_menu_title_view_profile_actions', 'bx_persons_view_actions', 'bx_persons', 9, 0, 1, 'BxPersonsMenuView', 'modules/boonex/persons/classes/BxPersonsMenuView.php');
INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
('bx_persons_view_actions', 'bx_persons', '_bx_persons_menu_set_title_view_profile_actions', 0);
INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
('bx_persons_view_actions', 'bx_persons', 'profile-friend-add', '_bx_persons_menu_item_title_system_befriend', '{title_add_friend}', 'javascript:void(0)', 'bx_conn_action(this, \'sys_profiles_friends\', \'add\', \'{profile_id}\')', '', 'plus', '', 2147483647, 1, 0, 10),
('bx_persons_view_actions', 'bx_persons', 'profile-subscribe-add', '_bx_persons_menu_item_title_system_subscribe', '_bx_persons_menu_item_title_subscribe', 'javascript:void(0)', 'bx_conn_action(this, \'sys_profiles_subscriptions\', \'add\', \'{profile_id}\')', '', 'check', '', 2147483647, 1, 0, 20),
('bx_persons_view_actions', 'bx_persons', 'profile-set-acl-level', '_sys_menu_item_title_system_set_acl_level', '_sys_menu_item_title_set_acl_level', 'javascript:void(0)', 'bx_menu_popup(''sys_set_acl_level'', window, {}, {profile_id: {profile_id}});', '', 'certificate', '', 192, 1, 0, 1000),
('bx_persons_view_actions', 'bx_persons', 'profile-actions-more', '_bx_persons_menu_item_title_system_more_actions', '_bx_persons_menu_item_title_more_actions', 'javascript:void(0)', 'bx_menu_popup(''bx_persons_view_actions_more'', this, {}, {profile_id:{profile_id}});', '', 'cog', 'bx_persons_view_actions_more', 2147483647, 1, 0, 9999);
-- MENU: view actions more
INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
('bx_persons_view_actions_more', '_bx_persons_menu_title_view_profile_actions_more', 'bx_persons_view_actions_more', 'bx_persons', 6, 0, 1, 'BxPersonsMenuView', 'modules/boonex/persons/classes/BxPersonsMenuView.php');
INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
('bx_persons_view_actions_more', 'bx_persons', '_bx_persons_menu_set_title_view_profile_actions_more', 0);
INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
('bx_persons_view_actions_more', 'bx_persons', 'profile-friend-remove', '_bx_persons_menu_item_title_system_unfriend', '{title_remove_friend}', 'javascript:void(0)', 'bx_conn_action(this, \'sys_profiles_friends\', \'remove\', \'{profile_id}\')', '', 'minus', '', 2147483647, 1, 0, 10),
('bx_persons_view_actions_more', 'bx_persons', 'profile-subscribe-remove', '_bx_persons_menu_item_title_system_unsubscribe', '_bx_persons_menu_item_title_unsubscribe', 'javascript:void(0)', 'bx_conn_action(this, \'sys_profiles_subscriptions\', \'remove\', \'{profile_id}\')', '', 'check', '', 2147483647, 1, 0, 20),
('bx_persons_view_actions_more', 'bx_persons', 'edit-persons-profile', '_bx_persons_menu_item_title_system_edit_profile', '_bx_persons_menu_item_title_edit_profile', 'page.php?i=edit-persons-profile&id={content_id}', '', '', 'pencil', '', 2147483647, 1, 0, 30),
('bx_persons_view_actions_more', 'bx_persons', 'delete-persons-profile', '_bx_persons_menu_item_title_system_delete_profile', '_bx_persons_menu_item_title_delete_profile', 'page.php?i=delete-persons-profile&id={content_id}', '', '', 'remove', '', 2147483647, 1, 0, 40);
-- MENU: module sub-menu
INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
('bx_persons_submenu', '_bx_persons_menu_title_submenu', 'bx_persons_submenu', 'bx_persons', 8, 0, 1, '', '');
INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
('bx_persons_submenu', 'bx_persons', '_bx_persons_menu_set_title_submenu', 0);
INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
('bx_persons_submenu', 'bx_persons', 'persons-home', '_bx_persons_menu_item_title_system_entries_public', '_bx_persons_menu_item_title_entries_public', 'page.php?i=persons-home', '', '', '', '', 2147483647, 1, 1, 1);
-- MENU: view submenu
INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
('bx_persons_view_submenu', '_bx_persons_menu_title_view_profile_submenu', 'bx_persons_view_submenu', 'bx_persons', 8, 0, 1, 'BxPersonsMenuView', 'modules/boonex/persons/classes/BxPersonsMenuView.php');
INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
('bx_persons_view_submenu', 'bx_persons', '_bx_persons_menu_set_title_view_profile_submenu', 0);
INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
('bx_persons_view_submenu', 'bx_persons', 'persons-profile-info', '_bx_persons_menu_item_title_system_view_profile_info', '_bx_persons_menu_item_title_view_profile_info', 'page.php?i=persons-profile-info&id={content_id}', '', '', '', '', 2147483647, 1, 0, 0),
('bx_persons_view_submenu', 'bx_persons', 'persons-profile-friends', '_bx_persons_menu_item_title_system_view_profile_friends', '_bx_persons_menu_item_title_view_profile_friends', 'page.php?i=persons-profile-friends&profile_id={profile_id}', '', '', '', '', 2147483647, 1, 0, 1);
-- MENU: notifications menu in account popup
SET @iNotifMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_account_notifications' AND `active` = 1 ORDER BY `order` DESC LIMIT 1);
INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
('sys_account_notifications', 'bx_persons', 'notifications-friend-requests', '_bx_persons_menu_item_title_system_friends', '_bx_persons_menu_item_title_friends', 'page.php?i=persons-profile-friends&profile_id={member_id}', '', '', 'group col-blue3', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:31:"get_unconfirmed_connections_num";s:6:"params";a:1:{i:0;s:20:"sys_profiles_friends";}s:5:"class";s:23:"TemplServiceConnections";}', '', 2147483646, 1, 0, IFNULL(@iNotifMenuOrder, 0) + 1);
-- MENU: profile stats
SET @iNotifMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_account_notifications' AND `active` = 1 ORDER BY `order` DESC LIMIT 1);
INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
('sys_profile_stats', 'bx_persons', 'profile-stats-friend-requests', '_bx_persons_menu_item_title_system_friend_requests', '_bx_persons_menu_item_title_friend_requests', 'page.php?i=persons-profile-friends&profile_id={member_id}', '', '', 'group col-blue3', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:31:"get_unconfirmed_connections_num";s:6:"params";a:1:{i:0;s:20:"sys_profiles_friends";}s:5:"class";s:23:"TemplServiceConnections";}', '', 2147483646, 1, 0, IFNULL(@iNotifMenuOrder, 0) + 1);
-- ACL
INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
('bx_persons', 'create entry', NULL, '_bx_persons_acl_action_create_profile', '', 1, 1);
SET @iIdActionProfileCreate = LAST_INSERT_ID();
INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
('bx_persons', 'delete entry', NULL, '_bx_persons_acl_action_delete_profile', '', 1, 1);
SET @iIdActionProfileDelete = LAST_INSERT_ID();
INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
('bx_persons', 'view entry', NULL, '_bx_persons_acl_action_view_profile', '', 1, 0);
SET @iIdActionProfileView = LAST_INSERT_ID();
INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
('bx_persons', 'edit any entry', NULL, '_bx_persons_acl_action_edit_any_profile', '', 1, 3);
SET @iIdActionProfileEditAny = LAST_INSERT_ID();
SET @iUnauthenticated = 1;
SET @iAccount = 2;
SET @iStandard = 3;
SET @iUnconfirmed = 4;
SET @iPending = 5;
SET @iSuspended = 6;
SET @iModerator = 7;
SET @iAdministrator = 8;
SET @iPremium = 9;
INSERT INTO `sys_acl_matrix` (`IDLevel`, `IDAction`) VALUES
-- profile create
(@iAccount, @iIdActionProfileCreate),
(@iStandard, @iIdActionProfileCreate),
(@iUnconfirmed, @iIdActionProfileCreate),
(@iPending, @iIdActionProfileCreate),
(@iModerator, @iIdActionProfileCreate),
(@iAdministrator, @iIdActionProfileCreate),
(@iPremium, @iIdActionProfileCreate),
-- profile delete
(@iAccount, @iIdActionProfileDelete),
(@iStandard, @iIdActionProfileDelete),
(@iUnconfirmed, @iIdActionProfileDelete),
(@iPending, @iIdActionProfileDelete),
(@iModerator, @iIdActionProfileDelete),
(@iAdministrator, @iIdActionProfileDelete),
(@iPremium, @iIdActionProfileDelete),
-- profile view
(@iUnauthenticated, @iIdActionProfileView),
(@iAccount, @iIdActionProfileView),
(@iStandard, @iIdActionProfileView),
(@iUnconfirmed, @iIdActionProfileView),
(@iPending, @iIdActionProfileView),
(@iModerator, @iIdActionProfileView),
(@iAdministrator, @iIdActionProfileView),
(@iPremium, @iIdActionProfileView),
-- any profile edit
(@iModerator, @iIdActionProfileEditAny),
(@iAdministrator, @iIdActionProfileEditAny);
-- VIEWS
INSERT INTO `sys_objects_view` (`name`, `table_track`, `period`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_count`, `class_name`, `class_file`) VALUES
('bx_persons', 'bx_persons_views_track', '86400', '1', 'bx_persons_data', 'id', 'views', '', '');
-- SEARCH
INSERT INTO `sys_objects_search` (`ObjectName`, `Title`, `ClassName`, `ClassPath`) VALUES
('bx_persons', '_bx_persons', 'BxPersonsSearchResult', 'modules/boonex/persons/classes/BxPersonsSearchResult.php'); | the_stack |
-----------------------------------------
-- Tables Used in this Section
-----------------------------------------
@@&&fc_table_loader. 'OCI360_USAGECOSTS'
@@&&fc_table_loader. 'OCI360_SERV_ENTITLEMENTS'
@@&&fc_table_loader. 'OCI360_SERV_RESOURCES'
@@&&fc_table_loader. 'OCI360_ACCOUNTDETAILS'
@@&&fc_table_loader. 'OCI360_USAGECOSTS_TAGGED_DAILY'
@@&&fc_table_loader. 'OCI360_USAGETAGS'
@@&&fc_table_loader. 'OCI360_USAGE'
@@&&fc_table_loader. 'OCI360_CHECKQUOTA'
@@&&fc_table_loader. 'OCI360_PROMOTIONS'
@@&&fc_table_loader. 'OCI360_CLOUDLIMITS'
-----------------------------------------
--- Get some Billing info before starting
@@&&fc_def_empty_var. oci360_billing_currency
@@&&fc_def_empty_var. oci360_billing_date_from
@@&&fc_def_empty_var. oci360_billing_date_to
@@&&fc_def_empty_var. oci360_billing_period
COL oci360_billing_currency NEW_V oci360_billing_currency NOPRI
SELECT distinct CURRENCY oci360_billing_currency
from OCI360_USAGECOSTS;
COL oci360_billing_currency CLEAR
COL oci360_billing_date_from NEW_V oci360_billing_date_from NOPRI
COL oci360_billing_date_to NEW_V oci360_billing_date_to NOPRI
COL oci360_billing_period NEW_V oci360_billing_period NOPRI
SELECT TO_CHAR(min(TO_TIMESTAMP(ENDTIMEUTC,'&&oci360_tzcolformat.')),'YYYY-MM-DD') oci360_billing_date_from,
TO_CHAR(max(TO_TIMESTAMP(ENDTIMEUTC,'&&oci360_tzcolformat.')),'YYYY-MM-DD') oci360_billing_date_to,
EXTRACT(DAY FROM (max(TO_TIMESTAMP(ENDTIMEUTC,'&&oci360_tzcolformat.')) - min(TO_TIMESTAMP(ENDTIMEUTC,'&&oci360_tzcolformat.')))) oci360_billing_period
from OCI360_USAGECOSTS;
COL oci360_billing_date_from CLEAR
COL oci360_billing_date_to CLEAR
COL oci360_billing_period CLEAR
DEF oci360_billing_between = ', between &&oci360_billing_date_from. and &&oci360_billing_date_to.'
-----------------------------------------
DEF title = 'Service Entitlements'
DEF main_table = 'OCI360_SERV_ENTITLEMENTS'
BEGIN
:sql_text := q'{
SELECT t1.*
FROM OCI360_SERV_ENTITLEMENTS t1
}';
END;
/
@@&&9a_pre_one.
-----------------------------------------
DEF title = 'Service Resources'
DEF main_table = 'OCI360_SERV_RESOURCES'
BEGIN
:sql_text := q'{
SELECT t1.*
FROM OCI360_SERV_RESOURCES t1
}';
END;
/
@@&&9a_pre_one.
-----------------------------------------
DEF title = 'Resources Unit Prices'
DEF main_table = 'OCI360_USAGECOSTS'
BEGIN
:sql_text := q'{
select distinct
TO_CHAR(CEIL(COSTS$UNITPRICE*10000)/10000,'999G990D0000') UNITPRICE, -- CEIL * 10000 / 10000 is same as ROUNG UP in 4th digit
COSTS$OVERAGESFLAG OVERAGESFLAG,
CURRENCY,
SERVICENAME,
GSIPRODUCTID,
RESOURCENAME,
SUBSCRIPTIONID,
SUBSCRIPTIONTYPE,
DATACENTERID,
SERVICEENTITLEMENTID
from OCI360_USAGECOSTS
order by SERVICENAME, RESOURCENAME
}';
END;
/
@@&&9a_pre_one.
-----------------------------------------
DEF title = 'Cost division per Service'
DEF title_suffix = '&&oci360_billing_between.';
DEF main_table = 'OCI360_USAGECOSTS'
BEGIN
:sql_text := q'{
WITH t1 AS (
SELECT COSTS$COMPUTEDAMOUNT COMPUTEDAMOUNT,
SERVICENAME,
CURRENCY
FROM OCI360_USAGECOSTS ),
t2 as (select sum(COMPUTEDAMOUNT) total_global from t1)
SELECT t1.SERVICENAME || ' - ' || t1.CURRENCY || ' ' || round(sum(COMPUTEDAMOUNT)) SERVICENAME,
round(sum(COMPUTEDAMOUNT)) total,
trim(to_char(round(sum(COMPUTEDAMOUNT)/decode(total_global,0,1,total_global),4)*100,'990D99')) percent
FROM t1, t2
GROUP BY t1.SERVICENAME,t1.CURRENCY,total_global
having sum(COMPUTEDAMOUNT) <> 0
order by total desc
}';
END;
/
DEF skip_pch = ''
DEF foot = 'Total for &&oci360_billing_period. days period.';
@@&&9a_pre_one.
-----------------------------------------
DEF title = 'Cost division per Resource'
DEF title_suffix = '&&oci360_billing_between.';
DEF main_table = 'OCI360_USAGECOSTS'
BEGIN
:sql_text := q'{
WITH t1 AS (
SELECT COSTS$COMPUTEDAMOUNT COMPUTEDAMOUNT,
SERVICENAME,
RESOURCENAME,
CURRENCY
FROM OCI360_USAGECOSTS ),
t2 as (select sum(COMPUTEDAMOUNT) total_global from t1)
SELECT t1.SERVICENAME || ' - ' || t1.RESOURCENAME || ' - ' || t1.CURRENCY || ' ' || round(sum(COMPUTEDAMOUNT)) SERVICENAME,
round(sum(COMPUTEDAMOUNT)) total,
trim(to_char(round(sum(COMPUTEDAMOUNT)/decode(total_global,0,1,total_global),4)*100,'990D99')) percent
FROM t1, t2
GROUP BY t1.SERVICENAME,t1.RESOURCENAME,t1.CURRENCY,total_global
having sum(COMPUTEDAMOUNT) <> 0
order by total desc
}';
END;
/
DEF skip_pch = ''
DEF foot = 'Total for &&oci360_billing_period. days period.';
@@&&9a_pre_one.
-----------------------------------------
DEF title = 'Used Quota'
DEF main_table = 'OCI360_USAGECOSTS'
BEGIN
:sql_text := q'{
WITH trange as (
select /*+ materialize */ trunc(min(TO_TIMESTAMP(ENDTIMEUTC,'&&oci360_tzcolformat.')),'HH24') min,
trunc(max(TO_TIMESTAMP(ENDTIMEUTC,'&&oci360_tzcolformat.')),'HH24') max
FROM OCI360_USAGECOSTS
),
t1 AS (
SELECT /*+ materialize */ SUM(COSTS$COMPUTEDAMOUNT) COMPUTEDAMOUNT,
TO_TIMESTAMP(ENDTIMEUTC,'&&oci360_tzcolformat.') TIMEUTC
FROM OCI360_USAGECOSTS
GROUP BY TO_TIMESTAMP(ENDTIMEUTC,'&&oci360_tzcolformat.')
),
tcycle AS (
SELECT /*+ materialize */ PURCHASE$PURCHASEDRESOURCES$VALUE PURCHASEDRESOURCES,
TO_TIMESTAMP(PURCHASE$PURCHASEDRESOURCES$STARTDATE,'&&oci360_tzcolformat.') STARTDATE,
TO_TIMESTAMP(PURCHASE$PURCHASEDRESOURCES$ENDDATE,'&&oci360_tzcolformat.') ENDDATE
FROM OCI360_ACCOUNTDETAILS, trange
WHERE PURCHASE$ID is not null
AND PURCHASE$PURCHASEDRESOURCES$NAME = 'CLOUD_CREDIT_AMOUNT'
AND TO_TIMESTAMP(PURCHASE$PURCHASEDRESOURCES$STARTDATE,'&&oci360_tzcolformat.') > trange.min
),
allhours as ( -- Will generate all hours between Min and Max Start Time
SELECT /*+ materialize */ trange.min + (rownum - 1)/24 vdate,
rownum seq
FROM trange
WHERE trange.min + (rownum - 1)/24 <= trange.max - 1/24 -- Skip last hour as can be an incompleted current hour.
CONNECT BY LEVEL <= (trange.max - trange.min)*24 + 1
)
select seq snap_id,
TO_CHAR(vdate, 'YYYY-MM-DD HH24:MI') begin_time,
TO_CHAR(vdate+1/24,'YYYY-MM-DD HH24:MI') end_time,
TO_CHAR(CEIL(tcycle.PURCHASEDRESOURCES*100)/100,'99999990D00') line1,
TO_CHAR(CEIL(SUM(t1.COMPUTEDAMOUNT)*100)/100,'99999990D00') line2,
0 dummy_03,
0 dummy_04,
0 dummy_05,
0 dummy_06,
0 dummy_07,
0 dummy_08,
0 dummy_09,
0 dummy_10,
0 dummy_11,
0 dummy_12,
0 dummy_13,
0 dummy_14,
0 dummy_15
from t1, tcycle, allhours
WHERE vdate between tcycle.STARTDATE AND tcycle.ENDDATE -- For each hour frame I get the billing period range
AND t1.TIMEUTC >= tcycle.STARTDATE AND t1.TIMEUTC < vdate+1/24 -- The Billing end time must be inside the range until the computed hour
group by seq, vdate, PURCHASEDRESOURCES
order by seq
}';
END;
/
DEF tit_01 = 'Total Available'
DEF tit_02 = 'Total Used'
DEF vaxis = 'Cost (&&oci360_billing_currency.)'
DEF chartype = 'AreaChart'
DEF skip_lch = ''
@@&&9a_pre_one.
-----------------------------------------
DEF max_rows = 1000
DEF title = 'Computed Usage Costs - Last &&max_rows. lines'
DEF main_table = 'OCI360_USAGECOSTS'
BEGIN
:sql_text := q'{
SELECT t1.*
FROM OCI360_USAGECOSTS t1
ORDER BY TO_TIMESTAMP(LASTCOMPUTATIONDATE,'&&oci360_tzcolformat.') DESC FETCH NEXT &&max_rows. ROWS ONLY
}';
END;
/
@@&&9a_pre_one.
-----------------------------------------
DEF max_rows = 1000
DEF title = 'Computed Usage Costs Tagged - Last &&max_rows. lines'
DEF main_table = 'OCI360_USAGECOSTS_TAGGED_DAILY'
BEGIN
:sql_text := q'{
SELECT t1.*
FROM OCI360_USAGECOSTS_TAGGED_DAILY t1
ORDER BY TO_TIMESTAMP(ENDTIMEUTC,'&&oci360_tzcolformat.') DESC FETCH NEXT &&max_rows. ROWS ONLY
}';
END;
/
@@&&9a_pre_one.
-----------------------------------------
DEF max_rows = 1000
DEF title = 'Computed Usage - Last &&max_rows. lines'
DEF main_table = 'OCI360_USAGE'
BEGIN
:sql_text := q'{
SELECT t1.*
FROM OCI360_USAGE t1
ORDER BY TO_TIMESTAMP(ENDTIMEUTC,'&&oci360_tzcolformat.') DESC FETCH NEXT &&max_rows. ROWS ONLY
}';
END;
/
@@&&9a_pre_one.
-----------------------------------------
DEF title = 'Usage Tags'
DEF main_table = 'OCI360_USAGETAGS'
BEGIN
:sql_text := q'{
SELECT t1.*
FROM OCI360_USAGETAGS t1
}';
END;
/
@@&&9a_pre_one.
-----------------------------------------
DEF title = 'Account Details'
DEF main_table = 'OCI360_ACCOUNTDETAILS'
BEGIN
:sql_text := q'{
SELECT distinct
ID,
PAYG,
STATUS,
PROMOTION,
SOFTLIMIT,
BILLINGTYPE,
HARDLIMITALL,
HARDLIMITNEW,
CANONICALLINK,
ENTITLEMENTID,
CLOUDBUCKSTYPE,
OVERAGESALLOWED,
SUBSCRIPTIONTYPE,
SUBSCRIPTIONCATEGORY
FROM OCI360_ACCOUNTDETAILS t1
}';
END;
/
@@&&9a_pre_one.
-----------------------------------------
DEF title = 'Account Balance'
DEF main_table = 'OCI360_ACCOUNTDETAILS'
BEGIN
:sql_text := q'{
SELECT BALANCE$ID,
BALANCE$CREATEDON,
BALANCE$PURCHASEDRESOURCES$NAME,
BALANCE$PURCHASEDRESOURCES$UNIT,
BALANCE$PURCHASEDRESOURCES$VALUE,
BALANCE$PURCHASEDRESOURCES$DERIVED,
BALANCE$PURCHASEDRESOURCES$CREATEDON,
BALANCE$PURCHASEDRESOURCES$MODIFIEDON
FROM OCI360_ACCOUNTDETAILS t1
WHERE BALANCE$ID is not null
}';
END;
/
@@&&9a_pre_one.
-----------------------------------------
DEF title = 'Account Purchase'
DEF main_table = 'OCI360_ACCOUNTDETAILS'
BEGIN
:sql_text := q'{
SELECT PURCHASE$ID,
PURCHASE$CREATEDON,
PURCHASE$SOFTLIMIT,
PURCHASE$HARDLIMITALL,
PURCHASE$HARDLIMITNEW,
PURCHASE$OVERAGESALLOWED,
PURCHASE$PURCHASEDRESOURCES$NAME,
PURCHASE$PURCHASEDRESOURCES$UNIT,
PURCHASE$PURCHASEDRESOURCES$VALUE,
PURCHASE$PURCHASEDRESOURCES$ENDDATE,
PURCHASE$PURCHASEDRESOURCES$CREATEDON,
PURCHASE$PURCHASEDRESOURCES$STARTDATE,
PURCHASE$PURCHASEDRESOURCES$PURCHASETYPE
FROM OCI360_ACCOUNTDETAILS t1
WHERE PURCHASE$ID is not null
ORDER BY PURCHASE$PURCHASEDRESOURCES$STARTDATE ASC
}';
END;
/
@@&&9a_pre_one.
-----------------------------------------
DEF title = 'Account Running Balance'
DEF main_table = 'OCI360_ACCOUNTDETAILS'
BEGIN
:sql_text := q'{
SELECT RUNNINGBALANCE$ID,
RUNNINGBALANCE$CREATEDON,
RUNNINGBALANCE$PURCHASEDRESOURCES$NAME,
RUNNINGBALANCE$PURCHASEDRESOURCES$UNIT,
RUNNINGBALANCE$PURCHASEDRESOURCES$VALUE,
RUNNINGBALANCE$PURCHASEDRESOURCES$DERIVED,
RUNNINGBALANCE$PURCHASEDRESOURCES$CREATEDON,
RUNNINGBALANCE$PURCHASEDRESOURCES$MODIFIEDON,
RUNNINGBALANCE$PURCHASEDRESOURCES$PURCHASETYPE
FROM OCI360_ACCOUNTDETAILS t1
WHERE RUNNINGBALANCE$ID is not null
}';
END;
/
@@&&9a_pre_one.
-----------------------------------------
DEF title = 'Check Quota'
DEF main_table = 'OCI360_CHECKQUOTA'
BEGIN
:sql_text := q'{
SELECT t1.*
FROM OCI360_CHECKQUOTA t1
}';
END;
/
@@&&9a_pre_one.
-----------------------------------------
DEF title = 'Promotions'
DEF main_table = 'OCI360_PROMOTIONS'
BEGIN
:sql_text := q'{
SELECT t1.*
FROM OCI360_PROMOTIONS t1
}';
END;
/
@@&&9a_pre_one.
-----------------------------------------
DEF title = 'Cloud Limits'
DEF main_table = 'OCI360_CLOUDLIMITS'
BEGIN
:sql_text := q'{
SELECT t1.*
FROM OCI360_CLOUDLIMITS t1
}';
END;
/
@@&&9a_pre_one.
-----------------------------------------
DEF title = 'Raw Computed Usage Costs Tagged'
DEF main_table = 'OCI360_USAGECOSTS'
BEGIN
:sql_text := q'{
SELECT t1.*
FROM OCI360_USAGECOSTS_TAGGED_DAILY t1
ORDER BY TO_TIMESTAMP(ENDTIMEUTC,'&&oci360_tzcolformat.') DESC
}';
END;
/
DEF max_rows = 1000000
DEF skip_csv = ''
DEF skip_html = '--'
@@&&9a_pre_one.
-----------------------------------------
DEF title = 'Raw Computed Usage Costs'
DEF main_table = 'OCI360_USAGECOSTS'
BEGIN
:sql_text := q'{
SELECT t1.*
FROM OCI360_USAGECOSTS t1
ORDER BY TO_TIMESTAMP(LASTCOMPUTATIONDATE,'&&oci360_tzcolformat.') DESC
}';
END;
/
DEF max_rows = 1000000
DEF skip_csv = ''
DEF skip_html = '--'
@@&&9a_pre_one.
-----------------------------------------
UNDEF oci360_billing_currency oci360_billing_date_from oci360_billing_date_to oci360_billing_period | the_stack |
USE [${install.database}]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[AddAuditLogRecord]
(
@RecordID varchar(32),
@SeverityID int,
@UserID int,
@PackageID int,
@Username nvarchar(50),
@ItemID int,
@StartDate datetime,
@FinishDate datetime,
@SourceName varchar(50),
@TaskName varchar(50),
@ItemName nvarchar(50),
@ExecutionLog ntext
)
AS
IF @ItemID = 0 SET @ItemID = NULL
IF @UserID = 0 OR @UserID = -1 SET @UserID = NULL
INSERT INTO AuditLog
(
RecordID,
SeverityID,
UserID,
PackageID,
Username,
ItemID,
SourceName,
StartDate,
FinishDate,
TaskName,
ItemName,
ExecutionLog
)
VALUES
(
@RecordID,
@SeverityID,
@UserID,
@PackageID,
@Username,
@ItemID,
@SourceName,
@StartDate,
@FinishDate,
@TaskName,
@ItemName,
@ExecutionLog
)
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[AddBlackBerryUser]
@AccountID int
AS
BEGIN
SET NOCOUNT ON;
INSERT INTO
dbo.BlackBerryUsers
(
AccountID,
CreatedDate,
ModifiedDate)
VALUES
(
@AccountID,
getdate(),
getdate()
)
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE AddCluster
(
@ClusterID int OUTPUT,
@ClusterName nvarchar(100)
)
AS
INSERT INTO Clusters
(
ClusterName
)
VALUES
(
@ClusterName
)
SET @ClusterID = SCOPE_IDENTITY()
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE AddComment
(
@ActorID int,
@ItemTypeID varchar(50),
@ItemID int,
@CommentText nvarchar(1000),
@SeverityID int
)
AS
INSERT INTO Comments
(
ItemTypeID,
ItemID,
UserID,
CreatedDate,
CommentText,
SeverityID
)
VALUES
(
@ItemTypeID,
@ItemID,
@ActorID,
GETDATE(),
@CommentText,
@SeverityID
)
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[AddDnsRecord]
(
@ActorID int,
@ServiceID int,
@ServerID int,
@PackageID int,
@RecordType nvarchar(10),
@RecordName nvarchar(50),
@RecordData nvarchar(500),
@MXPriority int,
@SrvPriority int,
@SrvWeight int,
@SrvPort int,
@IPAddressID int
)
AS
IF (@ServiceID > 0 OR @ServerID > 0) AND dbo.CheckIsUserAdmin(@ActorID) = 0
RAISERROR('You should have administrator role to perform such operation', 16, 1)
IF (@PackageID > 0) AND dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
IF @ServiceID = 0 SET @ServiceID = NULL
IF @ServerID = 0 SET @ServerID = NULL
IF @PackageID = 0 SET @PackageID = NULL
IF @IPAddressID = 0 SET @IPAddressID = NULL
IF EXISTS
(
SELECT RecordID FROM GlobalDnsRecords WHERE
ServiceID = @ServiceID AND ServerID = @ServerID AND PackageID = @PackageID
AND RecordName = @RecordName AND RecordType = @RecordType
)
UPDATE GlobalDnsRecords
SET
RecordData = RecordData,
MXPriority = MXPriority,
SrvPriority = SrvPriority,
SrvWeight = SrvWeight,
SrvPort = SrvPort,
IPAddressID = @IPAddressID
WHERE
ServiceID = @ServiceID AND ServerID = @ServerID AND PackageID = @PackageID
ELSE
INSERT INTO GlobalDnsRecords
(
ServiceID,
ServerID,
PackageID,
RecordType,
RecordName,
RecordData,
MXPriority,
SrvPriority,
SrvWeight,
SrvPort,
IPAddressID
)
VALUES
(
@ServiceID,
@ServerID,
@PackageID,
@RecordType,
@RecordName,
@RecordData,
@MXPriority,
@SrvPriority,
@SrvWeight,
@SrvPort,
@IPAddressID
)
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE AddDomain
(
@DomainID int OUTPUT,
@ActorID int,
@PackageID int,
@ZoneItemID int,
@DomainName nvarchar(200),
@HostingAllowed bit,
@WebSiteID int,
@MailDomainID int,
@IsSubDomain bit,
@IsInstantAlias bit,
@IsDomainPointer bit
)
AS
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
IF @ZoneItemID = 0 SET @ZoneItemID = NULL
IF @WebSiteID = 0 SET @WebSiteID = NULL
IF @MailDomainID = 0 SET @MailDomainID = NULL
-- insert record
INSERT INTO Domains
(
PackageID,
ZoneItemID,
DomainName,
HostingAllowed,
WebSiteID,
MailDomainID,
IsSubDomain,
IsInstantAlias,
IsDomainPointer
)
VALUES
(
@PackageID,
@ZoneItemID,
@DomainName,
@HostingAllowed,
@WebSiteID,
@MailDomainID,
@IsSubDomain,
@IsInstantAlias,
@IsDomainPointer
)
SET @DomainID = SCOPE_IDENTITY()
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
/****** Object: Table [dbo].[AddExchangeAccount] ******/
CREATE PROCEDURE [dbo].[AddExchangeAccount]
(
@AccountID int OUTPUT,
@ItemID int,
@AccountType int,
@AccountName nvarchar(300),
@DisplayName nvarchar(300),
@PrimaryEmailAddress nvarchar(300),
@MailEnabledPublicFolder bit,
@MailboxManagerActions varchar(200),
@SamAccountName nvarchar(100),
@AccountPassword nvarchar(200),
@MailboxPlanId int,
@SubscriberNumber nvarchar(32)
)
AS
INSERT INTO ExchangeAccounts
(
ItemID,
AccountType,
AccountName,
DisplayName,
PrimaryEmailAddress,
MailEnabledPublicFolder,
MailboxManagerActions,
SamAccountName,
AccountPassword,
MailboxPlanId,
SubscriberNumber,
UserPrincipalName
)
VALUES
(
@ItemID,
@AccountType,
@AccountName,
@DisplayName,
@PrimaryEmailAddress,
@MailEnabledPublicFolder,
@MailboxManagerActions,
@SamAccountName,
@AccountPassword,
@MailboxPlanId,
@SubscriberNumber,
@PrimaryEmailAddress
)
SET @AccountID = SCOPE_IDENTITY()
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE AddExchangeAccountEmailAddress
(
@AccountID int,
@EmailAddress nvarchar(300)
)
AS
INSERT INTO ExchangeAccountEmailAddresses
(
AccountID,
EmailAddress
)
VALUES
(
@AccountID,
@EmailAddress
)
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[AddExchangeMailboxPlan]
(
@MailboxPlanId int OUTPUT,
@ItemID int,
@MailboxPlan nvarchar(300),
@EnableActiveSync bit,
@EnableIMAP bit,
@EnableMAPI bit,
@EnableOWA bit,
@EnablePOP bit,
@IsDefault bit,
@IssueWarningPct int,
@KeepDeletedItemsDays int,
@MailboxSizeMB int,
@MaxReceiveMessageSizeKB int,
@MaxRecipients int,
@MaxSendMessageSizeKB int,
@ProhibitSendPct int,
@ProhibitSendReceivePct int ,
@HideFromAddressBook bit,
@MailboxPlanType int
)
AS
IF (((SELECT Count(*) FROM ExchangeMailboxPlans WHERE ItemId = @ItemID) = 0) AND (@MailboxPlanType=0))
BEGIN
SET @IsDefault = 1
END
ELSE
BEGIN
IF ((@IsDefault = 1) AND (@MailboxPlanType=0))
BEGIN
UPDATE ExchangeMailboxPlans SET IsDefault = 0 WHERE ItemID = @ItemID
END
END
INSERT INTO ExchangeMailboxPlans
(
ItemID,
MailboxPlan,
EnableActiveSync,
EnableIMAP,
EnableMAPI,
EnableOWA,
EnablePOP,
IsDefault,
IssueWarningPct,
KeepDeletedItemsDays,
MailboxSizeMB,
MaxReceiveMessageSizeKB,
MaxRecipients,
MaxSendMessageSizeKB,
ProhibitSendPct,
ProhibitSendReceivePct,
HideFromAddressBook,
MailboxPlanType
)
VALUES
(
@ItemID,
@MailboxPlan,
@EnableActiveSync,
@EnableIMAP,
@EnableMAPI,
@EnableOWA,
@EnablePOP,
@IsDefault,
@IssueWarningPct,
@KeepDeletedItemsDays,
@MailboxSizeMB,
@MaxReceiveMessageSizeKB,
@MaxRecipients,
@MaxSendMessageSizeKB,
@ProhibitSendPct,
@ProhibitSendReceivePct,
@HideFromAddressBook,
@MailboxPlanType
)
SET @MailboxPlanId = SCOPE_IDENTITY()
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[AddExchangeOrganization]
(
@ItemID int,
@OrganizationID nvarchar(128)
)
AS
IF NOT EXISTS(SELECT * FROM ExchangeOrganizations WHERE OrganizationID = @OrganizationID)
BEGIN
INSERT INTO ExchangeOrganizations
(ItemID, OrganizationID)
VALUES
(@ItemID, @OrganizationID)
END
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE AddExchangeOrganizationDomain
(
@ItemID int,
@DomainID int,
@IsHost bit
)
AS
INSERT INTO ExchangeOrganizationDomains
(ItemID, DomainID, IsHost)
VALUES
(@ItemID, @DomainID, @IsHost)
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[AddIPAddress]
(
@AddressID int OUTPUT,
@ServerID int,
@ExternalIP varchar(24),
@InternalIP varchar(24),
@PoolID int,
@SubnetMask varchar(15),
@DefaultGateway varchar(15),
@Comments ntext
)
AS
BEGIN
IF @ServerID = 0
SET @ServerID = NULL
INSERT INTO IPAddresses (ServerID, ExternalIP, InternalIP, PoolID, SubnetMask, DefaultGateway, Comments)
VALUES (@ServerID, @ExternalIP, @InternalIP, @PoolID, @SubnetMask, @DefaultGateway, @Comments)
SET @AddressID = SCOPE_IDENTITY()
RETURN
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[AddItemIPAddress]
(
@ActorID int,
@ItemID int,
@PackageAddressID int
)
AS
BEGIN
UPDATE PackageIPAddresses
SET
ItemID = @ItemID,
IsPrimary = 0
FROM PackageIPAddresses AS PIP
WHERE
PIP.PackageAddressID = @PackageAddressID
AND dbo.CheckActorPackageRights(@ActorID, PIP.PackageID) = 1
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[AddItemPrivateIPAddress]
(
@ActorID int,
@ItemID int,
@IPAddress varchar(15)
)
AS
IF EXISTS (SELECT ItemID FROM ServiceItems AS SI WHERE dbo.CheckActorPackageRights(@ActorID, SI.PackageID) = 1)
BEGIN
INSERT INTO PrivateIPAddresses
(
ItemID,
IPAddress,
IsPrimary
)
VALUES
(
@ItemID,
@IPAddress,
0 -- not primary
)
END
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[AddLyncUser]
@AccountID int,
@LyncUserPlanID int,
@SipAddress nvarchar(300)
AS
INSERT INTO
dbo.LyncUsers
(AccountID,
LyncUserPlanID,
CreatedDate,
ModifiedDate,
SipAddress)
VALUES
(
@AccountID,
@LyncUserPlanID,
getdate(),
getdate(),
@SipAddress
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[AddLyncUserPlan]
(
@LyncUserPlanId int OUTPUT,
@ItemID int,
@LyncUserPlanName nvarchar(300),
@LyncUserPlanType int,
@IM bit,
@Mobility bit,
@MobilityEnableOutsideVoice bit,
@Federation bit,
@Conferencing bit,
@EnterpriseVoice bit,
@VoicePolicy int,
@IsDefault bit
)
AS
IF (((SELECT Count(*) FROM LyncUserPlans WHERE ItemId = @ItemID) = 0) AND (@LyncUserPlanType=0))
BEGIN
SET @IsDefault = 1
END
ELSE
BEGIN
IF ((@IsDefault = 1) AND (@LyncUserPlanType=0))
BEGIN
UPDATE LyncUserPlans SET IsDefault = 0 WHERE ItemID = @ItemID
END
END
INSERT INTO LyncUserPlans
(
ItemID,
LyncUserPlanName,
LyncUserPlanType,
IM,
Mobility,
MobilityEnableOutsideVoice,
Federation,
Conferencing,
EnterpriseVoice,
VoicePolicy,
IsDefault
)
VALUES
(
@ItemID,
@LyncUserPlanName,
@LyncUserPlanType,
@IM,
@Mobility,
@MobilityEnableOutsideVoice,
@Federation,
@Conferencing,
@EnterpriseVoice,
@VoicePolicy,
@IsDefault
)
SET @LyncUserPlanId = SCOPE_IDENTITY()
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[AddSfBUser]
@AccountID int,
@SfBUserPlanID int,
@SipAddress nvarchar(300)
AS
INSERT INTO
dbo.SfBUsers
(AccountID,
SfBUserPlanID,
CreatedDate,
ModifiedDate,
SipAddress)
VALUES
(
@AccountID,
@SfBUserPlanID,
getdate(),
getdate(),
@SipAddress
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[AddSfBUserPlan]
(
@SfBUserPlanId int OUTPUT,
@ItemID int,
@SfBUserPlanName nvarchar(300),
@SfBUserPlanType int,
@IM bit,
@Mobility bit,
@MobilityEnableOutsideVoice bit,
@Federation bit,
@Conferencing bit,
@EnterpriseVoice bit,
@VoicePolicy int,
@IsDefault bit,
@RemoteUserAccess bit,
@PublicIMConnectivity bit,
@AllowOrganizeMeetingsWithExternalAnonymous bit,
@Telephony int,
@ServerURI nvarchar(300),
@ArchivePolicy nvarchar(300),
@TelephonyDialPlanPolicy nvarchar(300),
@TelephonyVoicePolicy nvarchar(300)
)
AS
IF (((SELECT Count(*) FROM SfBUserPlans WHERE ItemId = @ItemID) = 0) AND (@SfBUserPlanType=0))
BEGIN
SET @IsDefault = 1
END
ELSE
BEGIN
IF ((@IsDefault = 1) AND (@SfBUserPlanType=0))
BEGIN
UPDATE SfBUserPlans SET IsDefault = 0 WHERE ItemID = @ItemID
END
END
INSERT INTO SfBUserPlans
(
ItemID,
SfBUserPlanName,
SfBUserPlanType,
IM,
Mobility,
MobilityEnableOutsideVoice,
Federation,
Conferencing,
EnterpriseVoice,
VoicePolicy,
IsDefault,
RemoteUserAccess,
PublicIMConnectivity,
AllowOrganizeMeetingsWithExternalAnonymous,
Telephony,
ServerURI,
ArchivePolicy,
TelephonyDialPlanPolicy,
TelephonyVoicePolicy
)
VALUES
(
@ItemID,
@SfBUserPlanName,
@SfBUserPlanType,
@IM,
@Mobility,
@MobilityEnableOutsideVoice,
@Federation,
@Conferencing,
@EnterpriseVoice,
@VoicePolicy,
@IsDefault,
@RemoteUserAccess,
@PublicIMConnectivity,
@AllowOrganizeMeetingsWithExternalAnonymous,
@Telephony,
@ServerURI,
@ArchivePolicy,
@TelephonyDialPlanPolicy,
@TelephonyVoicePolicy
)
SET @SfBUserPlanId = SCOPE_IDENTITY()
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[AddOCSUser]
@AccountID int,
@InstanceID nvarchar(50)
AS
BEGIN
SET NOCOUNT ON;
INSERT INTO
dbo.OCSUsers
(
AccountID,
InstanceID,
CreatedDate,
ModifiedDate)
VALUES
(
@AccountID,
@InstanceID,
getdate(),
getdate()
)
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[AddPackage]
(
@ActorID int,
@PackageID int OUTPUT,
@UserID int,
@PackageName nvarchar(300),
@PackageComments ntext,
@StatusID int,
@PlanID int,
@PurchaseDate datetime
)
AS
DECLARE @ParentPackageID int, @PlanServerID int
SELECT @ParentPackageID = PackageID, @PlanServerID = ServerID FROM HostingPlans
WHERE PlanID = @PlanID
IF @ParentPackageID = 0 OR @ParentPackageID IS NULL
SELECT @ParentPackageID = PackageID FROM Packages
WHERE ParentPackageID IS NULL -- root space
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @ParentPackageID) = 0
BEGIN
RAISERROR('You are not allowed to access this package', 16, 1);
RETURN;
END
BEGIN TRAN
-- insert package
INSERT INTO Packages
(
ParentPackageID,
UserID,
PackageName,
PackageComments,
ServerID,
StatusID,
PlanID,
PurchaseDate
)
VALUES
(
@ParentPackageID,
@UserID,
@PackageName,
@PackageComments,
@PlanServerID,
@StatusID,
@PlanID,
@PurchaseDate
)
SET @PackageID = SCOPE_IDENTITY()
-- add package to packages cache
INSERT INTO PackagesTreeCache (ParentPackageID, PackageID)
SELECT PackageID, @PackageID FROM dbo.PackageParents(@PackageID)
DECLARE @ExceedingQuotas AS TABLE (QuotaID int, QuotaName nvarchar(50), QuotaValue int)
INSERT INTO @ExceedingQuotas
SELECT * FROM dbo.GetPackageExceedingQuotas(@ParentPackageID) WHERE QuotaValue > 0
SELECT * FROM @ExceedingQuotas
IF EXISTS(SELECT * FROM @ExceedingQuotas)
BEGIN
ROLLBACK TRAN
RETURN
END
COMMIT TRAN
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE AddPackageAddon
(
@ActorID int,
@PackageAddonID int OUTPUT,
@PackageID int,
@PlanID int,
@Quantity int,
@StatusID int,
@PurchaseDate datetime,
@Comments ntext
)
AS
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
BEGIN TRAN
DECLARE @ParentPackageID int
SELECT @ParentPackageID = ParentPackageID FROM Packages
WHERE PackageID = @PackageID
-- insert record
INSERT INTO PackageAddons
(
PackageID,
PlanID,
PurchaseDate,
Quantity,
StatusID,
Comments
)
VALUES
(
@PackageID,
@PlanID,
@PurchaseDate,
@Quantity,
@StatusID,
@Comments
)
SET @PackageAddonID = SCOPE_IDENTITY()
DECLARE @ExceedingQuotas AS TABLE (QuotaID int, QuotaName nvarchar(50), QuotaValue int)
INSERT INTO @ExceedingQuotas
SELECT * FROM dbo.GetPackageExceedingQuotas(@ParentPackageID) WHERE QuotaValue > 0
SELECT * FROM @ExceedingQuotas
IF EXISTS(SELECT * FROM @ExceedingQuotas)
BEGIN
ROLLBACK TRAN
RETURN
END
COMMIT TRAN
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[AddPFX]
(
@ActorID int,
@PackageID int,
@UserID int,
@WebSiteID int,
@FriendlyName nvarchar(255),
@HostName nvarchar(255),
@CSRLength int,
@DistinguishedName nvarchar(500),
@SerialNumber nvarchar(250),
@ValidFrom datetime,
@ExpiryDate datetime
)
AS
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
BEGIN
RAISERROR('You are not allowed to access this package', 16, 1)
RETURN
END
-- insert record
INSERT INTO [dbo].[SSLCertificates]
([UserID], [SiteID], [FriendlyName], [Hostname], [DistinguishedName], [CSRLength], [SerialNumber], [ValidFrom], [ExpiryDate], [Installed])
VALUES
(@UserID, @WebSiteID, @FriendlyName, @HostName, @DistinguishedName, @CSRLength, @SerialNumber, @ValidFrom, @ExpiryDate, 1)
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE AddSchedule
(
@ActorID int,
@ScheduleID int OUTPUT,
@TaskID nvarchar(100),
@PackageID int,
@ScheduleName nvarchar(100),
@ScheduleTypeID nvarchar(50),
@Interval int,
@FromTime datetime,
@ToTime datetime,
@StartTime datetime,
@NextRun datetime,
@Enabled bit,
@PriorityID nvarchar(50),
@HistoriesNumber int,
@MaxExecutionTime int,
@WeekMonthDay int,
@XmlParameters ntext
)
AS
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
-- insert record
BEGIN TRAN
INSERT INTO Schedule
(
TaskID,
PackageID,
ScheduleName,
ScheduleTypeID,
Interval,
FromTime,
ToTime,
StartTime,
NextRun,
Enabled,
PriorityID,
HistoriesNumber,
MaxExecutionTime,
WeekMonthDay
)
VALUES
(
@TaskID,
@PackageID,
@ScheduleName,
@ScheduleTypeID,
@Interval,
@FromTime,
@ToTime,
@StartTime,
@NextRun,
@Enabled,
@PriorityID,
@HistoriesNumber,
@MaxExecutionTime,
@WeekMonthDay
)
SET @ScheduleID = SCOPE_IDENTITY()
DECLARE @idoc int
--Create an internal representation of the XML document.
EXEC sp_xml_preparedocument @idoc OUTPUT, @XmlParameters
-- Execute a SELECT statement that uses the OPENXML rowset provider.
DELETE FROM ScheduleParameters
WHERE ScheduleID = @ScheduleID
INSERT INTO ScheduleParameters
(
ScheduleID,
ParameterID,
ParameterValue
)
SELECT
@ScheduleID,
ParameterID,
ParameterValue
FROM OPENXML(@idoc, '/parameters/parameter',1) WITH
(
ParameterID nvarchar(50) '@id',
ParameterValue nvarchar(3000) '@value'
) as PV
-- remove document
exec sp_xml_removedocument @idoc
COMMIT TRAN
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE AddServer
(
@ServerID int OUTPUT,
@ServerName nvarchar(100),
@ServerUrl nvarchar(100),
@Password nvarchar(100),
@Comments ntext,
@VirtualServer bit,
@InstantDomainAlias nvarchar(200),
@PrimaryGroupID int,
@ADEnabled bit,
@ADRootDomain nvarchar(200),
@ADUsername nvarchar(100),
@ADPassword nvarchar(100),
@ADAuthenticationType varchar(50)
)
AS
IF @PrimaryGroupID = 0
SET @PrimaryGroupID = NULL
INSERT INTO Servers
(
ServerName,
ServerUrl,
Password,
Comments,
VirtualServer,
InstantDomainAlias,
PrimaryGroupID,
ADEnabled,
ADRootDomain,
ADUsername,
ADPassword,
ADAuthenticationType
)
VALUES
(
@ServerName,
@ServerUrl,
@Password,
@Comments,
@VirtualServer,
@InstantDomainAlias,
@PrimaryGroupID,
@ADEnabled,
@ADRootDomain,
@ADUsername,
@ADPassword,
@ADAuthenticationType
)
SET @ServerID = SCOPE_IDENTITY()
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE AddService
(
@ServiceID int OUTPUT,
@ServerID int,
@ProviderID int,
@ServiceQuotaValue int,
@ServiceName nvarchar(50),
@ClusterID int,
@Comments ntext
)
AS
BEGIN
BEGIN TRAN
IF @ClusterID = 0 SET @ClusterID = NULL
INSERT INTO Services
(
ServerID,
ProviderID,
ServiceName,
ServiceQuotaValue,
ClusterID,
Comments
)
VALUES
(
@ServerID,
@ProviderID,
@ServiceName,
@ServiceQuotaValue,
@ClusterID,
@Comments
)
SET @ServiceID = SCOPE_IDENTITY()
-- copy default service settings
INSERT INTO ServiceProperties (ServiceID, PropertyName, PropertyValue)
SELECT @ServiceID, PropertyName, PropertyValue
FROM ServiceDefaultProperties
WHERE ProviderID = @ProviderID
-- copy all default DNS records for the given service
DECLARE @GroupID int
SELECT @GroupID = GroupID FROM Providers
WHERE ProviderID = @ProviderID
-- default IP address for added records
DECLARE @AddressID int
SELECT TOP 1 @AddressID = AddressID FROM IPAddresses
WHERE ServerID = @ServerID
INSERT INTO GlobalDnsRecords
(
RecordType,
RecordName,
RecordData,
MXPriority,
IPAddressID,
ServiceID,
ServerID,
PackageID
)
SELECT
RecordType,
RecordName,
CASE WHEN RecordData = '[ip]' THEN ''
ELSE RecordData END,
MXPriority,
CASE WHEN RecordData = '[ip]' THEN @AddressID
ELSE NULL END,
@ServiceID,
NULL, -- server
NULL -- package
FROM
ResourceGroupDnsRecords
WHERE GroupID = @GroupID
ORDER BY RecordOrder
COMMIT TRAN
END
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[AddServiceItem]
(
@ActorID int,
@PackageID int,
@ServiceID int,
@ItemName nvarchar(500),
@ItemTypeName nvarchar(200),
@ItemID int OUTPUT,
@XmlProperties ntext,
@CreatedDate datetime
)
AS
BEGIN TRAN
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
-- get GroupID
DECLARE @GroupID int
SELECT
@GroupID = PROV.GroupID
FROM Services AS S
INNER JOIN Providers AS PROV ON S.ProviderID = PROV.ProviderID
WHERE S.ServiceID = @ServiceID
DECLARE @ItemTypeID int
SELECT @ItemTypeID = ItemTypeID FROM ServiceItemTypes
WHERE TypeName = @ItemTypeName
AND ((@GroupID IS NULL) OR (@GroupID IS NOT NULL AND GroupID = @GroupID))
-- Fix to allow plans assigned to serveradmin
IF (@ItemTypeName = 'SolidCP.Providers.HostedSolution.Organization, SolidCP.Providers.Base')
BEGIN
IF NOT EXISTS (SELECT * FROM ServiceItems WHERE PackageID = 1)
BEGIN
INSERT INTO ServiceItems (PackageID, ItemTypeID,ServiceID,ItemName,CreatedDate)
VALUES(1, @ItemTypeID, @ServiceID, 'System', @CreatedDate)
DECLARE @TempItemID int
SET @TempItemID = SCOPE_IDENTITY()
INSERT INTO ExchangeOrganizations (ItemID, OrganizationID)
VALUES(@TempItemID, 'System')
END
END
-- add item
INSERT INTO ServiceItems
(
PackageID,
ServiceID,
ItemName,
ItemTypeID,
CreatedDate
)
VALUES
(
@PackageID,
@ServiceID,
@ItemName,
@ItemTypeID,
@CreatedDate
)
SET @ItemID = SCOPE_IDENTITY()
DECLARE @idoc int
--Create an internal representation of the XML document.
EXEC sp_xml_preparedocument @idoc OUTPUT, @XmlProperties
-- Execute a SELECT statement that uses the OPENXML rowset provider.
DELETE FROM ServiceItemProperties
WHERE ItemID = @ItemID
INSERT INTO ServiceItemProperties
(
ItemID,
PropertyName,
PropertyValue
)
SELECT
@ItemID,
PropertyName,
PropertyValue
FROM OPENXML(@idoc, '/properties/property',1) WITH
(
PropertyName nvarchar(50) '@name',
PropertyValue nvarchar(3000) '@value'
) as PV
-- remove document
exec sp_xml_removedocument @idoc
COMMIT TRAN
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[AddSSLRequest]
(
@SSLID int OUTPUT,
@ActorID int,
@PackageID int,
@UserID int,
@WebSiteID int,
@FriendlyName nvarchar(255),
@HostName nvarchar(255),
@CSR ntext,
@CSRLength int,
@DistinguishedName nvarchar(500),
@IsRenewal bit = 0,
@PreviousId int = NULL
)
AS
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
BEGIN
RAISERROR('You are not allowed to access this package', 16, 1)
RETURN
END
-- insert record
INSERT INTO [dbo].[SSLCertificates]
([UserID], [SiteID], [FriendlyName], [Hostname], [DistinguishedName], [CSR], [CSRLength], [IsRenewal], [PreviousId])
VALUES
(@UserID, @WebSiteID, @FriendlyName, @HostName, @DistinguishedName, @CSR, @CSRLength, @IsRenewal, @PreviousId)
SET @SSLID = SCOPE_IDENTITY()
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[AddUser]
(
@ActorID int,
@UserID int OUTPUT,
@OwnerID int,
@RoleID int,
@StatusID int,
@SubscriberNumber nvarchar(32),
@LoginStatusID int,
@IsDemo bit,
@IsPeer bit,
@Comments ntext,
@Username nvarchar(50),
@Password nvarchar(200),
@FirstName nvarchar(50),
@LastName nvarchar(50),
@Email nvarchar(255),
@SecondaryEmail nvarchar(255),
@Address nvarchar(200),
@City nvarchar(50),
@State nvarchar(50),
@Country nvarchar(50),
@Zip varchar(20),
@PrimaryPhone varchar(30),
@SecondaryPhone varchar(30),
@Fax varchar(30),
@InstantMessenger nvarchar(200),
@HtmlMail bit,
@CompanyName nvarchar(100),
@EcommerceEnabled bit
)
AS
-- check if the user already exists
IF EXISTS(SELECT UserID FROM Users WHERE Username = @Username)
BEGIN
SET @UserID = -1
RETURN
END
-- check actor rights
IF dbo.CanCreateUser(@ActorID, @OwnerID) = 0
BEGIN
SET @UserID = -2
RETURN
END
INSERT INTO Users
(
OwnerID,
RoleID,
StatusID,
SubscriberNumber,
LoginStatusID,
Created,
Changed,
IsDemo,
IsPeer,
Comments,
Username,
Password,
FirstName,
LastName,
Email,
SecondaryEmail,
Address,
City,
State,
Country,
Zip,
PrimaryPhone,
SecondaryPhone,
Fax,
InstantMessenger,
HtmlMail,
CompanyName,
EcommerceEnabled
)
VALUES
(
@OwnerID,
@RoleID,
@StatusID,
@SubscriberNumber,
@LoginStatusID,
GetDate(),
GetDate(),
@IsDemo,
@IsPeer,
@Comments,
@Username,
@Password,
@FirstName,
@LastName,
@Email,
@SecondaryEmail,
@Address,
@City,
@State,
@Country,
@Zip,
@PrimaryPhone,
@SecondaryPhone,
@Fax,
@InstantMessenger,
@HtmlMail,
@CompanyName,
@EcommerceEnabled
)
SET @UserID = SCOPE_IDENTITY()
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE AddVirtualServices
(
@ServerID int,
@Xml ntext
)
AS
/*
XML Format:
<services>
<service id="16" />
</services>
*/
BEGIN TRAN
DECLARE @idoc int
--Create an internal representation of the XML document.
EXEC sp_xml_preparedocument @idoc OUTPUT, @xml
-- update HP resources
INSERT INTO VirtualServices
(
ServerID,
ServiceID
)
SELECT
@ServerID,
ServiceID
FROM OPENXML(@idoc, '/services/service',1) WITH
(
ServiceID int '@id'
) as XS
WHERE XS.ServiceID NOT IN (SELECT ServiceID FROM VirtualServices WHERE ServerID = @ServerID)
-- remove document
exec sp_xml_removedocument @idoc
COMMIT TRAN
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[AllocatePackageIPAddresses]
(
@PackageID int,
@xml ntext
)
AS
BEGIN
SET NOCOUNT ON;
DECLARE @idoc int
--Create an internal representation of the XML document.
EXEC sp_xml_preparedocument @idoc OUTPUT, @xml
-- delete
DELETE FROM PackageIPAddresses
FROM PackageIPAddresses AS PIP
INNER JOIN OPENXML(@idoc, '/items/item', 1) WITH
(
AddressID int '@id'
) as PV ON PIP.AddressID = PV.AddressID
-- insert
INSERT INTO dbo.PackageIPAddresses
(
PackageID,
AddressID
)
SELECT
@PackageID,
AddressID
FROM OPENXML(@idoc, '/items/item', 1) WITH
(
AddressID int '@id'
) as PV
-- remove document
exec sp_xml_removedocument @idoc
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].ChangeExchangeAcceptedDomainType
(
@ItemID int,
@DomainID int,
@DomainTypeID int
)
AS
UPDATE ExchangeOrganizationDomains
SET DomainTypeID=@DomainTypeID
WHERE ItemID=ItemID AND DomainID=@DomainID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ChangeUserPassword]
(
@ActorID int,
@UserID int,
@Password nvarchar(200)
)
AS
-- check actor rights
IF dbo.CanUpdateUserDetails(@ActorID, @UserID) = 0
RETURN
UPDATE Users
SET Password = @Password
WHERE UserID = @UserID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[CheckBlackBerryUserExists]
@AccountID int
AS
BEGIN
SELECT
COUNT(AccountID)
FROM
dbo.BlackBerryUsers
WHERE AccountID = @AccountID
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[CheckDomain]
(
@PackageID int,
@DomainName nvarchar(100),
@IsDomainPointer bit,
@Result int OUTPUT
)
AS
/*
@Result values:
0 - OK
-1 - already exists
-2 - sub-domain of prohibited domain
*/
SET @Result = 0 -- OK
-- check if the domain already exists
IF EXISTS(
SELECT DomainID FROM Domains
WHERE DomainName = @DomainName AND IsDomainPointer = @IsDomainPointer
)
BEGIN
SET @Result = -1
RETURN
END
-- check if this is a sub-domain of other domain
-- that is not allowed for 3rd level hosting
DECLARE @UserID int
SELECT @UserID = UserID FROM Packages
WHERE PackageID = @PackageID
-- find sub-domains
DECLARE @DomainUserID int, @HostingAllowed bit
SELECT
@DomainUserID = P.UserID,
@HostingAllowed = D.HostingAllowed
FROM Domains AS D
INNER JOIN Packages AS P ON D.PackageID = P.PackageID
WHERE CHARINDEX('.' + DomainName, @DomainName) > 0
AND (CHARINDEX('.' + DomainName, @DomainName) + LEN('.' + DomainName)) = LEN(@DomainName) + 1
AND IsDomainPointer = 0
-- this is a domain of other user
IF @UserID <> @DomainUserID AND @HostingAllowed = 0
BEGIN
SET @Result = -2
RETURN
END
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[CheckDomainUsedByHostedOrganization]
@DomainName nvarchar(100),
@Result int OUTPUT
AS
SET @Result = 0
IF EXISTS(SELECT 1 FROM ExchangeAccounts WHERE UserPrincipalName LIKE '%@'+ @DomainName)
BEGIN
SET @Result = 1
END
ELSE
IF EXISTS(SELECT 1 FROM ExchangeAccountEmailAddresses WHERE EmailAddress LIKE '%@'+ @DomainName)
BEGIN
SET @Result = 1
END
ELSE
IF EXISTS(SELECT 1 FROM LyncUsers WHERE SipAddress LIKE '%@'+ @DomainName)
BEGIN
SET @Result = 1
END
ELSE
IF EXISTS(SELECT 1 FROM SfBUsers WHERE SipAddress LIKE '%@'+ @DomainName)
BEGIN
SET @Result = 1
END
RETURN @Result
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[CheckLyncUserExists]
@AccountID int
AS
BEGIN
SELECT
COUNT(AccountID)
FROM
dbo.LyncUsers
WHERE AccountID = @AccountID
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[CheckSfBUserExists]
@AccountID int
AS
BEGIN
SELECT
COUNT(AccountID)
FROM
dbo.SfBUsers
WHERE AccountID = @AccountID
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[CheckOCSUserExists]
@AccountID int
AS
BEGIN
SELECT
COUNT(AccountID)
FROM
dbo.OCSUsers
WHERE AccountID = @AccountID
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE CheckServiceItemExists
(
@Exists bit OUTPUT,
@ItemName nvarchar(500),
@ItemTypeName nvarchar(200),
@GroupName nvarchar(100) = NULL
)
AS
SET @Exists = 0
DECLARE @ItemTypeID int
SELECT @ItemTypeID = ItemTypeID FROM ServiceItemTypes
WHERE TypeName = @ItemTypeName
IF EXISTS (
SELECT ItemID FROM ServiceItems AS SI
INNER JOIN Services AS S ON SI.ServiceID = S.ServiceID
INNER JOIN Providers AS PROV ON S.ProviderID = PROV.ProviderID
INNER JOIN ResourceGroups AS RG ON PROV.GroupID = RG.GroupID
WHERE SI.ItemName = @ItemName AND SI.ItemTypeID = @ItemTypeID
AND ((@GroupName IS NULL) OR (@GroupName IS NOT NULL AND RG.GroupName = @GroupName))
)
SET @Exists = 1
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE CheckServiceItemExistsInService
(
@Exists bit OUTPUT,
@ServiceID int,
@ItemName nvarchar(500),
@ItemTypeName nvarchar(200)
)
AS
SET @Exists = 0
DECLARE @ItemTypeID int
SELECT @ItemTypeID = ItemTypeID FROM ServiceItemTypes
WHERE TypeName = @ItemTypeName
IF EXISTS (SELECT ItemID FROM ServiceItems
WHERE ItemName = @ItemName AND ItemTypeID = @ItemTypeID AND ServiceID = @ServiceID)
SET @Exists = 1
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[CheckSSL]
(
@siteID int,
@Renewal bit = 0,
@Result int OUTPUT
)
AS
/*
@Result values:
0 - OK
-1 - already exists
*/
SET @Result = 0 -- OK
-- check if a SSL Certificate is installed for domain
IF EXISTS(SELECT [ID] FROM [dbo].[SSLCertificates] WHERE [SiteID] = @siteID)
BEGIN
SET @Result = -1
RETURN
END
--To Do add renewal stuff
RETURN
SET ANSI_NULLS ON
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[CheckSSLExistsForWebsite]
(
@siteID int,
@SerialNumber nvarchar(250),
@Result bit OUTPUT
)
AS
/*
@Result values:
0 - OK
-1 - already exists
*/
SET @Result = 0 -- OK
-- check if a SSL Certificate is installed for domain
IF EXISTS(SELECT [ID] FROM [dbo].[SSLCertificates] WHERE [SiteID] = @siteID
--AND SerialNumber=@SerialNumber
)
BEGIN
SET @Result = 1
RETURN
END
RETURN
SET ANSI_NULLS ON
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE CheckUserExists
(
@Exists bit OUTPUT,
@Username nvarchar(100)
)
AS
SET @Exists = 0
IF EXISTS (SELECT UserID FROM Users
WHERE Username = @Username)
SET @Exists = 1
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[CompleteSSLRequest]
(
@ActorID int,
@PackageID int,
@ID int,
@Certificate ntext,
@SerialNumber nvarchar(250),
@Hash ntext,
@DistinguishedName nvarchar(500),
@ValidFrom datetime,
@ExpiryDate datetime
)
AS
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
BEGIN
RAISERROR('You are not allowed to access this package', 16, 1)
RETURN
END
-- insert record
UPDATE
[dbo].[SSLCertificates]
SET
[Certificate] = @Certificate,
[Installed] = 1,
[SerialNumber] = @SerialNumber,
[DistinguishedName] = @DistinguishedName,
[Hash] = @Hash,
[ValidFrom] = @ValidFrom,
[ExpiryDate] = @ExpiryDate
WHERE
[ID] = @ID;
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ConvertToExchangeOrganization]
(
@ItemID int
)
AS
UPDATE
[dbo].[ServiceItems]
SET
[ItemTypeID] = 26
WHERE
[ItemID] = @ItemID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[DeallocatePackageIPAddress]
@PackageAddressID int
AS
BEGIN
SET NOCOUNT ON;
-- check parent package
DECLARE @ParentPackageID int
SELECT @ParentPackageID = P.ParentPackageID
FROM PackageIPAddresses AS PIP
INNER JOIN Packages AS P ON PIP.PackageID = P.PackageId
WHERE PIP.PackageAddressID = @PackageAddressID
IF (@ParentPackageID = 1) -- "System" space
BEGIN
DELETE FROM dbo.PackageIPAddresses
WHERE PackageAddressID = @PackageAddressID
END
ELSE -- 2rd level space and below
BEGIN
UPDATE PackageIPAddresses
SET PackageID = @ParentPackageID
WHERE PackageAddressID = @PackageAddressID
END
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE DeleteAllLogRecords
AS
DELETE FROM Log
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE DeleteAuditLogRecords
(
@ActorID int,
@UserID int,
@ItemID int,
@ItemName nvarchar(100),
@StartDate datetime,
@EndDate datetime,
@SeverityID int,
@SourceName varchar(100),
@TaskName varchar(100)
)
AS
-- check rights
IF dbo.CheckActorUserRights(@ActorID, @UserID) = 0
RAISERROR('You are not allowed to access this account', 16, 1)
DECLARE @IsAdmin bit
SET @IsAdmin = 0
IF EXISTS(SELECT UserID FROM Users WHERE UserID = @ActorID AND RoleID = 1)
SET @IsAdmin = 1
DELETE FROM AuditLog
WHERE (dbo.CheckUserParent(@UserID, UserID) = 1 OR (UserID IS NULL AND @IsAdmin = 1))
AND StartDate BETWEEN @StartDate AND @EndDate
AND ((@SourceName = '') OR (@SourceName <> '' AND SourceName = @SourceName))
AND ((@TaskName = '') OR (@TaskName <> '' AND TaskName = @TaskName))
AND ((@ItemID = 0) OR (@ItemID > 0 AND ItemID = @ItemID))
AND ((@ItemName = '') OR (@ItemName <> '' AND ItemName LIKE @ItemName))
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE DeleteAuditLogRecordsComplete
AS
TRUNCATE TABLE AuditLog
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[DeleteBlackBerryUser]
(
@AccountID int
)
AS
DELETE FROM
BlackBerryUsers
WHERE
AccountID = @AccountID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[DeleteCertificate]
(
@ActorID int,
@PackageID int,
@id int
)
AS
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
BEGIN
RAISERROR('You are not allowed to access this package', 16, 1)
RETURN
END
-- insert record
DELETE FROM
[dbo].[SSLCertificates]
WHERE
[ID] = @id
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE DeleteCluster
(
@ClusterID int
)
AS
-- reset cluster in services
UPDATE Services
SET ClusterID = NULL
WHERE ClusterID = @ClusterID
-- delete cluster
DELETE FROM Clusters
WHERE ClusterID = @ClusterID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE DeleteComment
(
@ActorID int,
@CommentID int
)
AS
-- check rights
DECLARE @UserID int
SELECT @UserID = UserID FROM Comments
WHERE CommentID = @CommentID
-- check rights
IF dbo.CheckActorUserRights(@ActorID, @UserID) = 0
RAISERROR('You are not allowed to perform this operation', 16, 1)
-- delete comment
DELETE FROM Comments
WHERE CommentID = @CommentID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[DeleteCRMOrganization]
@ItemID int
AS
BEGIN
SET NOCOUNT ON
DELETE FROM dbo.CRMUsers WHERE AccountID IN (SELECT AccountID FROM dbo.ExchangeAccounts WHERE ItemID = @ItemID)
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE DeleteDnsRecord
(
@ActorID int,
@RecordID int
)
AS
-- check rights
DECLARE @ServiceID int, @ServerID int, @PackageID int
SELECT
@ServiceID = ServiceID,
@ServerID = ServerID,
@PackageID = PackageID
FROM GlobalDnsRecords
WHERE
RecordID = @RecordID
IF (@ServiceID > 0 OR @ServerID > 0) AND dbo.CheckIsUserAdmin(@ActorID) = 0
RETURN
IF (@PackageID > 0) AND dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RETURN
-- delete record
DELETE FROM GlobalDnsRecords
WHERE RecordID = @RecordID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE DeleteDomain
(
@DomainID int,
@ActorID int
)
AS
-- check rights
DECLARE @PackageID int
SELECT @PackageID = PackageID FROM Domains
WHERE DomainID = @DomainID
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
DELETE FROM Domains
WHERE DomainID = @DomainID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE DeleteExchangeAccount
(
@ItemID int,
@AccountID int
)
AS
-- delete e-mail addresses
DELETE FROM ExchangeAccountEmailAddresses
WHERE AccountID = @AccountID
-- delete account
DELETE FROM ExchangeAccounts
WHERE ItemID = @ItemID AND AccountID = @AccountID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE DeleteExchangeAccountEmailAddress
(
@AccountID int,
@EmailAddress nvarchar(300)
)
AS
DELETE FROM ExchangeAccountEmailAddresses
WHERE AccountID = @AccountID AND EmailAddress = @EmailAddress
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[DeleteExchangeMailboxPlan]
(
@MailboxPlanId int
)
AS
-- delete mailboxplan
DELETE FROM ExchangeMailboxPlans
WHERE MailboxPlanId = @MailboxPlanId
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[DeleteExchangeOrganization]
(
@ItemID int
)
AS
BEGIN TRAN
DELETE FROM ExchangeMailboxPlans WHERE ItemID = @ItemID
DELETE FROM ExchangeOrganizations WHERE ItemID = @ItemID
COMMIT TRAN
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE DeleteExchangeOrganizationDomain
(
@ItemID int,
@DomainID int
)
AS
DELETE FROM ExchangeOrganizationDomains
WHERE DomainID = @DomainID AND ItemID = @ItemID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE DeleteHostingPlan
(
@ActorID int,
@PlanID int,
@Result int OUTPUT
)
AS
SET @Result = 0
-- check rights
DECLARE @PackageID int
SELECT @PackageID = PackageID FROM HostingPlans
WHERE PlanID = @PlanID
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
-- check if some packages uses this plan
IF EXISTS (SELECT PackageID FROM Packages WHERE PlanID = @PlanID)
BEGIN
SET @Result = -1
RETURN
END
-- check if some package addons uses this plan
IF EXISTS (SELECT PackageID FROM PackageAddons WHERE PlanID = @PlanID)
BEGIN
SET @Result = -2
RETURN
END
-- delete hosting plan
DELETE FROM HostingPlans
WHERE PlanID = @PlanID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[DeleteIPAddress]
(
@AddressID int,
@Result int OUTPUT
)
AS
SET @Result = 0
IF EXISTS(SELECT RecordID FROM GlobalDnsRecords WHERE IPAddressID = @AddressID)
BEGIN
SET @Result = -1
RETURN
END
IF EXISTS(SELECT AddressID FROM PackageIPAddresses WHERE AddressID = @AddressID AND ItemID IS NOT NULL)
BEGIN
SET @Result = -2
RETURN
END
-- delete package-IP relation
DELETE FROM PackageIPAddresses
WHERE AddressID = @AddressID
-- delete IP address
DELETE FROM IPAddresses
WHERE AddressID = @AddressID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[DeleteItemIPAddress]
(
@ActorID int,
@ItemID int,
@PackageAddressID int
)
AS
BEGIN
UPDATE PackageIPAddresses
SET
ItemID = NULL,
IsPrimary = 0
FROM PackageIPAddresses AS PIP
WHERE
PIP.PackageAddressID = @PackageAddressID
AND dbo.CheckActorPackageRights(@ActorID, PIP.PackageID) = 1
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[DeleteItemIPAddresses]
(
@ActorID int,
@ItemID int
)
AS
BEGIN
UPDATE PackageIPAddresses
SET
ItemID = NULL,
IsPrimary = 0
FROM PackageIPAddresses AS PIP
WHERE
PIP.ItemID = @ItemID
AND dbo.CheckActorPackageRights(@ActorID, PIP.PackageID) = 1
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE DeleteItemPrivateIPAddress
(
@ActorID int,
@ItemID int,
@PrivateAddressID int
)
AS
BEGIN
DELETE FROM PrivateIPAddresses
FROM PrivateIPAddresses AS PIP
INNER JOIN ServiceItems AS SI ON PIP.ItemID = SI.ItemID
WHERE PIP.PrivateAddressID = @PrivateAddressID
AND dbo.CheckActorPackageRights(@ActorID, SI.PackageID) = 1
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE DeleteItemPrivateIPAddresses
(
@ActorID int,
@ItemID int
)
AS
BEGIN
DELETE FROM PrivateIPAddresses
FROM PrivateIPAddresses AS PIP
INNER JOIN ServiceItems AS SI ON PIP.ItemID = SI.ItemID
WHERE PIP.ItemID = @ItemID
AND dbo.CheckActorPackageRights(@ActorID, SI.PackageID) = 1
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[DeleteLyncUser]
(
@AccountId int
)
AS
DELETE FROM
LyncUsers
WHERE
AccountId = @AccountId
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[DeleteLyncUserPlan]
(
@LyncUserPlanId int
)
AS
-- delete lyncuserplan
DELETE FROM LyncUserPlans
WHERE LyncUserPlanId = @LyncUserPlanId
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[DeleteSfBUser]
(
@AccountId int
)
AS
DELETE FROM
LyncUsers
WHERE
AccountId = @AccountId
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[DeleteSfBUserPlan]
(
@SfBUserPlanId int
)
AS
-- delete sfbuserplan
DELETE FROM SfBUserPlans
WHERE SfBUserPlanId = @SfBUserPlanId
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[DeleteOCSUser]
(
@InstanceId nvarchar(50)
)
AS
DELETE FROM
OCSUsers
WHERE
InstanceId = @InstanceId
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[DeleteOrganizationUsers]
@ItemID int
AS
BEGIN
SET NOCOUNT ON;
DELETE FROM ExchangeAccounts WHERE ItemID = @ItemID
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[DeletePackage]
(
@ActorID int,
@PackageID int
)
AS
BEGIN
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
BEGIN TRAN
-- remove package from cache
DELETE FROM PackagesTreeCache
WHERE
ParentPackageID = @PackageID OR
PackageID = @PackageID
-- delete package comments
DELETE FROM Comments
WHERE ItemID = @PackageID AND ItemTypeID = 'PACKAGE'
-- delete diskspace
DELETE FROM PackagesDiskspace
WHERE PackageID = @PackageID
-- delete bandwidth
DELETE FROM PackagesBandwidth
WHERE PackageID = @PackageID
-- delete settings
DELETE FROM PackageSettings
WHERE PackageID = @PackageID
-- delete domains
DELETE FROM Domains
WHERE PackageID = @PackageID
-- delete package IP addresses
DELETE FROM PackageIPAddresses
WHERE PackageID = @PackageID
-- delete service items
DELETE FROM ServiceItems
WHERE PackageID = @PackageID
-- delete global DNS records
DELETE FROM GlobalDnsRecords
WHERE PackageID = @PackageID
-- delete package services
DELETE FROM PackageServices
WHERE PackageID = @PackageID
-- delete package quotas
DELETE FROM PackageQuotas
WHERE PackageID = @PackageID
-- delete package resources
DELETE FROM PackageResources
WHERE PackageID = @PackageID
-- delete package
DELETE FROM Packages
WHERE PackageID = @PackageID
COMMIT TRAN
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE DeletePackageAddon
(
@ActorID int,
@PackageAddonID int
)
AS
DECLARE @PackageID int
SELECT @PackageID = PackageID FROM PackageAddons
WHERE PackageAddonID = @PackageAddonID
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
-- delete record
DELETE FROM PackageAddons
WHERE PackageAddonID = @PackageAddonID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE DeleteSchedule
(
@ActorID int,
@ScheduleID int
)
AS
-- check rights
DECLARE @PackageID int
SELECT @PackageID = PackageID FROM Schedule
WHERE ScheduleID = @ScheduleID
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
BEGIN TRAN
-- delete schedule parameters
DELETE FROM ScheduleParameters
WHERE ScheduleID = @ScheduleID
-- delete schedule
DELETE FROM Schedule
WHERE ScheduleID = @ScheduleID
COMMIT TRAN
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE DeleteServer
(
@ServerID int,
@Result int OUTPUT
)
AS
SET @Result = 0
-- check related services
IF EXISTS (SELECT ServiceID FROM Services WHERE ServerID = @ServerID)
BEGIN
SET @Result = -1
RETURN
END
-- check related packages
IF EXISTS (SELECT PackageID FROM Packages WHERE ServerID = @ServerID)
BEGIN
SET @Result = -2
RETURN
END
-- check related hosting plans
IF EXISTS (SELECT PlanID FROM HostingPlans WHERE ServerID = @ServerID)
BEGIN
SET @Result = -3
RETURN
END
BEGIN TRAN
-- delete IP addresses
DELETE FROM IPAddresses
WHERE ServerID = @ServerID
-- delete global DNS records
DELETE FROM GlobalDnsRecords
WHERE ServerID = @ServerID
-- delete server
DELETE FROM Servers
WHERE ServerID = @ServerID
-- delete virtual services if any
DELETE FROM VirtualServices
WHERE ServerID = @ServerID
COMMIT TRAN
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE DeleteService
(
@ServiceID int,
@Result int OUTPUT
)
AS
SET @Result = 0
-- check related service items
IF EXISTS (SELECT ItemID FROM ServiceItems WHERE ServiceID = @ServiceID)
BEGIN
SET @Result = -1
RETURN
END
IF EXISTS (SELECT ServiceID FROM VirtualServices WHERE ServiceID = @ServiceID)
BEGIN
SET @Result = -2
RETURN
END
BEGIN TRAN
-- delete global DNS records
DELETE FROM GlobalDnsRecords
WHERE ServiceID = @ServiceID
-- delete service
DELETE FROM Services
WHERE ServiceID = @ServiceID
COMMIT TRAN
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[DeleteServiceItem]
(
@ActorID int,
@ItemID int
)
AS
-- check rights
DECLARE @PackageID int
SELECT PackageID = @PackageID FROM ServiceItems
WHERE ItemID = @ItemID
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
BEGIN TRAN
UPDATE Domains
SET ZoneItemID = NULL
WHERE ZoneItemID = @ItemID
DELETE FROM Domains
WHERE WebSiteID = @ItemID AND IsDomainPointer = 1
UPDATE Domains
SET WebSiteID = NULL
WHERE WebSiteID = @ItemID
UPDATE Domains
SET MailDomainID = NULL
WHERE MailDomainID = @ItemID
-- delete item comments
DELETE FROM Comments
WHERE ItemID = @ItemID AND ItemTypeID = 'SERVICE_ITEM'
-- delete item properties
DELETE FROM ServiceItemProperties
WHERE ItemID = @ItemID
-- delete external IP addresses
EXEC dbo.DeleteItemIPAddresses @ActorID, @ItemID
-- delete item
DELETE FROM ServiceItems
WHERE ItemID = @ItemID
COMMIT TRAN
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[DeleteUser]
(
@ActorID int,
@UserID int
)
AS
-- check actor rights
IF dbo.CanUpdateUserDetails(@ActorID, @UserID) = 0
RETURN
BEGIN TRAN
-- delete user comments
DELETE FROM Comments
WHERE ItemID = @UserID AND ItemTypeID = 'USER'
IF (@@ERROR <> 0 )
BEGIN
ROLLBACK TRANSACTION
RETURN -1
END
--delete reseller addon
DELETE FROM HostingPlans WHERE UserID = @UserID AND IsAddon = 'True'
IF (@@ERROR <> 0 )
BEGIN
ROLLBACK TRANSACTION
RETURN -1
END
-- delete user peers
DELETE FROM Users
WHERE IsPeer = 1 AND OwnerID = @UserID
IF (@@ERROR <> 0 )
BEGIN
ROLLBACK TRANSACTION
RETURN -1
END
-- delete user
DELETE FROM Users
WHERE UserID = @UserID
IF (@@ERROR <> 0 )
BEGIN
ROLLBACK TRANSACTION
RETURN -1
END
COMMIT TRAN
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Description: Delete user email addresses except primary email
-- =============================================
CREATE PROCEDURE [dbo].[DeleteUserEmailAddresses]
@AccountId int,
@PrimaryEmailAddress nvarchar(300)
AS
BEGIN
DELETE FROM
ExchangeAccountEmailAddresses
WHERE
AccountID = @AccountID AND LOWER(EmailAddress) <> LOWER(@PrimaryEmailAddress)
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[DeleteVirtualServices]
(
@ServerID int,
@Xml ntext
)
AS
/*
XML Format:
<services>
<service id="16" />
</services>
*/
BEGIN TRAN
DECLARE @idoc int
--Create an internal representation of the XML document.
EXEC sp_xml_preparedocument @idoc OUTPUT, @xml
-- update HP resources
DELETE FROM VirtualServices
WHERE ServiceID IN (
SELECT
ServiceID
FROM OPENXML(@idoc, '/services/service',1) WITH
(
ServiceID int '@id'
) as XS)
AND ServerID = @ServerID
-- remove document
EXEC sp_xml_removedocument @idoc
COMMIT TRAN
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[DistributePackageServices]
(
@ActorID int,
@PackageID int
)
AS
-- get primary distribution group
DECLARE @PrimaryGroupID int
DECLARE @VirtualServer bit
DECLARE @PlanID int
DECLARE @ServerID int
SELECT
@PrimaryGroupID = ISNULL(S.PrimaryGroupID, 0),
@VirtualServer = S.VirtualServer,
@PlanID = P.PlanID,
@ServerID = P.ServerID
FROM Packages AS P
INNER JOIN Servers AS S ON P.ServerID = S.ServerID
WHERE P.PackageID = @PackageID
-- get the list of available groups from hosting plan
DECLARE @Groups TABLE
(
GroupID int,
PrimaryGroup bit
)
INSERT INTO @Groups (GroupID, PrimaryGroup)
SELECT
RG.GroupID,
CASE WHEN RG.GroupID = @PrimaryGroupID THEN 1 -- mark primary group
ELSE 0
END
FROM ResourceGroups AS RG
WHERE dbo.GetPackageAllocatedResource(@PackageID, RG.GroupID, NULL) = 1
AND RG.GroupID NOT IN
(
SELECT P.GroupID
FROM PackageServices AS PS
INNER JOIN Services AS S ON PS.ServiceID = S.ServiceID
INNER JOIN Providers AS P ON S.ProviderID = P.ProviderID
WHERE PS.PackageID = @PackageID
)
IF @VirtualServer <> 1
BEGIN
-- PHYSICAL SERVER
-- just return the list of services based on the plan
INSERT INTO PackageServices (PackageID, ServiceID)
SELECT
@PackageID,
S.ServiceID
FROM Services AS S
INNER JOIN Providers AS P ON S.ProviderID = P.ProviderID
INNER JOIN @Groups AS G ON P.GroupID = G.GroupID
WHERE S.ServerID = @ServerID
AND S.ServiceID NOT IN (SELECT ServiceID FROM PackageServices WHERE PackageID = @PackageID)
END
ELSE
BEGIN
-- VIRTUAL SERVER
DECLARE @GroupID int, @PrimaryGroup int
DECLARE GroupsCursor CURSOR FOR
SELECT GroupID, PrimaryGroup FROM @Groups
ORDER BY PrimaryGroup DESC
OPEN GroupsCursor
WHILE (10 = 10)
BEGIN --LOOP 10: thru groups
FETCH NEXT FROM GroupsCursor
INTO @GroupID, @PrimaryGroup
IF (@@fetch_status <> 0)
BEGIN
DEALLOCATE GroupsCursor
BREAK
END
-- read group information
DECLARE @DistributionType int, @BindDistributionToPrimary int
SELECT
@DistributionType = DistributionType,
@BindDistributionToPrimary = BindDistributionToPrimary
FROM VirtualGroups AS VG
WHERE ServerID = @ServerID AND GroupID = @GroupID
-- bind distribution to primary
IF @BindDistributionToPrimary = 1 AND @PrimaryGroup = 0 AND @PrimaryGroupID <> 0
BEGIN
-- if only one service found just use it and do not distribute
IF (SELECT COUNT(*) FROM VirtualServices AS VS
INNER JOIN Services AS S ON VS.ServiceID = S.ServiceID
INNER JOIN Providers AS P ON S.ProviderID = P.ProviderID
WHERE VS.ServerID = @ServerID AND P.GroupID = @GroupID) = 1
BEGIN
INSERT INTO PackageServices (PackageID, ServiceID)
SELECT
@PackageID,
VS.ServiceID
FROM VirtualServices AS VS
INNER JOIN Services AS S ON VS.ServiceID = S.ServiceID
INNER JOIN Providers AS P ON S.ProviderID = P.ProviderID
WHERE VS.ServerID = @ServerID AND P.GroupID = @GroupID
END
ELSE
BEGIN
DECLARE @PrimaryServerID int
-- try to get primary distribution server
SELECT
@PrimaryServerID = S.ServerID
FROM PackageServices AS PS
INNER JOIN Services AS S ON PS.ServiceID = S.ServiceID
INNER JOIN Providers AS P ON S.ProviderID = P.ProviderID
WHERE PS.PackageID = @PackageID AND P.GroupID = @PrimaryGroupID
INSERT INTO PackageServices (PackageID, ServiceID)
SELECT
@PackageID,
VS.ServiceID
FROM VirtualServices AS VS
INNER JOIN Services AS S ON VS.ServiceID = S.ServiceID
INNER JOIN Providers AS P ON S.ProviderID = P.ProviderID
WHERE VS.ServerID = @ServerID AND P.GroupID = @GroupID AND S.ServerID = @PrimaryServerID
END
END
ELSE
BEGIN
-- DISTRIBUTION
DECLARE @Services TABLE
(
ServiceID int,
ItemsNumber int,
RandomNumber int
)
DELETE FROM @Services
INSERT INTO @Services (ServiceID, ItemsNumber, RandomNumber)
SELECT
VS.ServiceID,
(SELECT COUNT(ItemID) FROM ServiceItems WHERE ServiceID = VS.ServiceID),
RAND()
FROM VirtualServices AS VS
INNER JOIN Services AS S ON VS.ServiceID = S.ServiceID
INNER JOIN Providers AS P ON S.ProviderID = P.ProviderID
WHERE VS.ServerID = @ServerID AND P.GroupID = @GroupID
-- BALANCED DISTRIBUTION
IF @DistributionType = 1
BEGIN
-- get the less allocated service
INSERT INTO PackageServices (PackageID, ServiceID)
SELECT TOP 1
@PackageID,
ServiceID
FROM @Services
ORDER BY ItemsNumber
END
ELSE
-- RANDOMIZED DISTRIBUTION
BEGIN
-- get the less allocated service
INSERT INTO PackageServices (PackageID, ServiceID)
SELECT TOP 1
@PackageID,
ServiceID
FROM @Services
ORDER BY RandomNumber
END
END
IF @PrimaryGroup = 1
SET @PrimaryGroupID = @GroupID
END -- while groups
END -- end virtual server
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecAddBillingCycle]
@ActorID int,
@UserID int,
@CycleName nvarchar(255),
@BillingPeriod nvarchar(50),
@PeriodLength int,
@Result int OUTPUT
AS
BEGIN
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
SET @Result = -1;
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
INSERT INTO [dbo].[ecBillingCycles]
(
[ResellerID],
[CycleName],
[BillingPeriod],
[PeriodLength],
[Created]
)
VALUES
(
@UserID,
@CycleName,
@BillingPeriod,
@PeriodLength,
GETDATE()
);
-- return result
SET @Result = SCOPE_IDENTITY();
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecAddCategory]
@ActorID int,
@UserID int,
@CategoryName nvarchar(255),
@CategorySku nvarchar(50),
@ParentID int,
@ShortDescription ntext,
@FullDescription ntext,
@Result int OUTPUT
AS
BEGIN
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
SET @Result = -1;
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
SET NOCOUNT ON;
DECLARE @Level int;
IF @ParentID = -1
SET @ParentID = NULL;
-- identify category level
SELECT @Level = [Level] FROM [dbo].[ecCategory] WHERE [CategoryID] = @ParentID AND [ResellerID] = @UserID;
IF @Level >= 0
SET @Level = @Level + 1;
ELSE
SET @Level = 0;
INSERT INTO [dbo].[ecCategory]
(
[CategoryName],
[CategorySku],
[ParentID],
[Level],
[ShortDescription],
[FullDescription],
[CreatorID],
[ResellerID]
)
VALUES
(
@CategoryName,
@CategorySku,
@ParentID,
@Level,
@ShortDescription,
@FullDescription,
@ActorID,
@UserID
)
SET @Result = SCOPE_IDENTITY();
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecAddContract]
@ContractID nvarchar(50) OUTPUT,
@CustomerID int,
@ResellerID int,
@AccountName nvarchar(50),
@Status int,
@Balance money,
@FirstName nvarchar(50),
@LastName nvarchar(50),
@Email nvarchar(255),
@CompanyName nvarchar(50),
@PropertyNames ntext,
@PropertyValues ntext
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
IF @CustomerID < 1
SET @CustomerID = NULL;
SET @ContractID = CAST(NEWID() as nvarchar(50));
INSERT INTO [ecContracts]
([ContractID],[CustomerID],[ResellerID],[AccountName],[Status],[Balance],
[FirstName],[LastName],[Email],[CompanyName],[PropertyNames],[PropertyValues])
VALUES
(@ContractID, @CustomerID, @ResellerID, @AccountName, @Status, @Balance, @FirstName,
@LastName, @Email, @CompanyName, @PropertyNames, @PropertyValues);
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecAddCustomerPayment]
@ActorID int,
@ContractID nvarchar(50),
@InvoiceID int,
@TransactionID nvarchar(255),
@Total money,
@Currency nvarchar(3),
@MethodName nvarchar(50),
@StatusID int,
@Result int OUTPUT
AS
BEGIN
DECLARE @ResellerID int, @IssuerID int;
SELECT
@ResellerID = [ResellerID],
@IssuerID = ISNULL([CustomerID],[ResellerID]) FROM [dbo].[ecContracts]
WHERE
[ContractID] = @ContractID;
--
IF [dbo].[CheckUserParent](@ActorID, @IssuerID) = 0
BEGIN
RAISERROR('You are not allowed to perform this action', 16, 1);
RETURN;
END
SET NOCOUNT ON;
INSERT INTO [dbo].[ecCustomersPayments]
(
[ContractID],
[InvoiceID],
[TransactionID],
[Total],
[Currency],
[MethodName],
[PluginID],
[StatusID]
)
SELECT
@ContractID,
@InvoiceID,
@TransactionID,
@Total,
@Currency,
@MethodName,
[PluginID],
@StatusID
FROM
[dbo].[ecPaymentMethods]
WHERE
[MethodName] = @MethodName
AND
[ResellerID] = @ResellerID;
SET @Result = SCOPE_IDENTITY();
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecAddDomainNameSvc]
@ContractID nvarchar(50),
@ParentID int,
@ProductID int,
@FQDN nvarchar(64),
@CycleID int,
@Currency nvarchar(10),
@PropertyNames ntext,
@PropertyValues ntext,
@Result int OUTPUT
AS
BEGIN
DECLARE @ResellerID int;
SELECT
@ResellerID = [ResellerID] FROM [dbo].[ecContracts]
WHERE
[ContractID] = @ContractID;
BEGIN TRAN ADD_TLD_SVC
-- add service
INSERT INTO [dbo].[ecService]
([ContractID], [ParentID], [ServiceName], [TypeID], [Status], [Created])
VALUES
(@ContractID, @ParentID, @FQDN, 3, 0, GETDATE());
-- check error
IF @@ERROR <> 0
GOTO ERROR_HANDLE;
-- obtain result
SET @Result = SCOPE_IDENTITY();
-- if product and cycle are defined
IF @ProductID > 0 OR @CycleID > 0
BEGIN
DECLARE @SvcCycleID int;
-- insert svc life-cycle
INSERT INTO [dbo].[ecDomainSvcsCycles]
(
[ServiceID],
[CycleName],
[BillingPeriod],
[PeriodLength],
[SetupFee],
[RecurringFee],
[Currency]
)
SELECT
@Result,
[BC].[CycleName],
[BC].[BillingPeriod],
[BC].[PeriodLength],
[TLDC].[SetupFee],
[TLDC].[RecurringFee],
@Currency
FROM
[dbo].[ecTopLevelDomainsCycles] AS [TLDC]
INNER JOIN
[dbo].[ecBillingCycles] AS [BC]
ON
[BC].[CycleID] = [TLDC].[CycleID]
WHERE
[TLDC].[CycleID] = @CycleID
AND
[TLDC].[ProductID] = @ProductID
AND
[BC].[ResellerID] = @ResellerID;
-- check error
IF @@ROWCOUNT = 0
GOTO ERROR_HANDLE;
-- obtain result
SET @SvcCycleID = SCOPE_IDENTITY();
-- add domain details
INSERT INTO [dbo].[ecDomainSvcs]
(
[ServiceID],
[ProductID],
[PluginID],
[FQDN],
[SvcCycleID],
[PropertyNames],
[PropertyValues]
)
SELECT
@Result,
@ProductID,
[PluginID],
@FQDN,
@SvcCycleID,
@PropertyNames,
@PropertyValues
FROM
[dbo].[ecTopLevelDomains]
WHERE
[ProductID] = @ProductID
AND
[ResellerID] = @ResellerID;
-- check error
IF @@ROWCOUNT = 0
GOTO ERROR_HANDLE;
END
ELSE
BEGIN
INSERT INTO [dbo].[ecDomainSvcs]
(
[ServiceID],
[ProductID],
[FQDN],
[SvcCycleID],
[PropertyNames],
[PropertyValues]
)
SELECT @Result, NULL, @FQDN, NULL, @PropertyNames, @PropertyValues;
-- check error
IF @@ROWCOUNT = 0
GOTO ERROR_HANDLE;
END
-- commit
COMMIT TRAN ADD_TLD_SVC;
-- exit
RETURN;
-- error handler
ERROR_HANDLE:
BEGIN
SET @Result = -1;
ROLLBACK TRAN ADD_TLD_SVC;
RETURN;
END
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecAddHostingAddon]
@ActorID int,
@UserID int,
@AddonName nvarchar(255),
@ProductSku nvarchar(50),
@TaxInclusive bit,
@Enabled bit,
@PlanID int,
@Recurring bit,
@DummyAddon bit,
@Countable bit,
@Description ntext,
@AddonCyclesXml xml,
@AssignedProductsXml xml,
@Result int OUTPUT
AS
BEGIN
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
SET @Result = -1;
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
-- dummy addon clause
IF @DummyAddon = 1
SET @PlanID = NULL;
BEGIN TRAN ADD_ADDON
DECLARE @XmlDocID int;
SET @XmlDocID = NULL;
-- insert product first
INSERT INTO [dbo].[ecProduct]
([ProductName], [ProductSKU], [TypeID], [TaxInclusive], [Description], [Created], [Enabled], [ResellerID])
VALUES
(@AddonName, @ProductSku, 2, @TaxInclusive, @Description, GETDATE(), @Enabled, @UserID);
-- check errors
IF @@ERROR <> 0
BEGIN
GOTO ERROR_HANDLE;
END
-- set product id created
SET @Result = SCOPE_IDENTITY();
-- insert hosting addon details
INSERT INTO [dbo].[ecHostingAddons]
([ProductID], [PlanID], [Recurring], [ResellerID], [DummyAddon], [Countable])
VALUES
(@Result, @PlanID, @Recurring, @UserID, @DummyAddon, @Countable);
-- check errors
IF @@ERROR <> 0
BEGIN
GOTO ERROR_HANDLE;
END
/*
XML Format:
<PlanCycles>
<Cycle ID="2" SetupFee="2.99" RecurringFee="3.99" SortOrder="1" />
</PlanCycles>
*/
-- save hosting addon cycles
IF @Recurring = 1
-- insert cycles
INSERT INTO [dbo].[ecHostingAddonsCycles]
([ProductID], [CycleID], [SetupFee], [RecurringFee], [SortOrder])
SELECT
@Result, [SXML].[Data].value('@ID','int'), [SXML].[Data].value('@SetupFee','money'),
[SXML].[Data].value('@RecurringFee','money'), [SXML].[Data].value('@SortOrder','int')
FROM @AddonCyclesXml.nodes('/PlanCycles/Cycle') [SXML]([Data])
ELSE
UPDATE
[dbo].[ecHostingAddons]
SET
[SetupFee] = [SXML].[Data].value('@SetupFee','money'),
[OneTimeFee] = [SXML].[Data].value('@RecurringFee','money')
FROM
@AddonCyclesXml.nodes('/PlanCycles/Cycle') [SXML]([Data])
WHERE
[ResellerID] = @UserID AND [ProductID] = @Result;
-- check errors
IF @@ERROR <> 0
BEGIN
GOTO ERROR_HANDLE;
END
/*
XML Format:
<AssignedProducts>
<Product ID="25" />
</AssignedProducts>
*/
-- insert cycles
INSERT INTO [dbo].[ecAddonProducts]
([AddonID], [ProductID], [ResellerID])
SELECT
@Result, [SXML].[Data].value('@ID','int'), @UserID
FROM
@AssignedProductsXml.nodes('/AssignedProducts/Product') [SXML]([Data])
-- check errors
IF @@ERROR <> 0
BEGIN
GOTO ERROR_HANDLE;
END
--
COMMIT TRAN ADD_ADDON;
--
RETURN;
ERROR_HANDLE:
BEGIN
SET @Result = -1;
ROLLBACK TRAN ADD_ADDON;
RETURN;
END
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecAddHostingAddonSvc]
@ContractID nvarchar(50),
@ParentID int,
@ProductID int,
@Quantity int,
@AddonName nvarchar(255),
@CycleID int,
@Currency nvarchar(10),
@Result int OUTPUT
AS
BEGIN
DECLARE @ResellerID int;
SELECT
@ResellerID = [ResellerID] FROM [dbo].[ecContracts]
WHERE
[ContractID] = @ContractID;
BEGIN TRAN ADD_ADDON_SVC
--
INSERT INTO [dbo].[ecService]
([ContractID], [ParentID], [ServiceName], [TypeID], [Status], [Created])
VALUES
(@ContractID, @ParentID, @AddonName, 2, 0, GETDATE());
-- obtain result
SET @Result = SCOPE_IDENTITY();
DECLARE @SvcCycleID int;
-- insert svc life-cycle
IF @CycleID > 0
BEGIN
INSERT INTO [dbo].[ecHostingAddonSvcsCycles]
(
[ServiceID],
[CycleName],
[BillingPeriod],
[PeriodLength],
[SetupFee],
[CyclePrice],
[Currency]
)
SELECT
@Result,
[BC].[CycleName],
[BC].[BillingPeriod],
[BC].[PeriodLength],
[HAC].[SetupFee],
[HAC].[RecurringFee],
@Currency
FROM
[dbo].[ecHostingAddonsCycles] AS [HAC]
INNER JOIN
[dbo].[ecBillingCycles] AS [BC]
ON
[BC].[CycleID] = [HAC].[CycleID]
WHERE
[HAC].[CycleID] = @CycleID
AND
[HAC].[ProductID] = @ProductID
AND
[BC].[ResellerID] = @ResellerID;
-- check error
IF @@ROWCOUNT = 0
GOTO ERROR_HANDLE;
-- obtain result
SET @SvcCycleID = SCOPE_IDENTITY();
END
ELSE
BEGIN
INSERT INTO [dbo].[ecHostingAddonSvcsCycles]
(
[ServiceID],
[CycleName],
[BillingPeriod],
[PeriodLength],
[SetupFee],
[CyclePrice],
[Currency]
)
SELECT
@Result,
NULL,
NULL,
NULL,
[SetupFee],
[OneTimeFee],
@Currency
FROM
[dbo].[ecHostingAddons]
WHERE
[ProductID] = @ProductID
AND
[ResellerID] = @ResellerID;
-- check error
IF @@ROWCOUNT = 0
GOTO ERROR_HANDLE;
-- obtain result
SET @SvcCycleID = SCOPE_IDENTITY();
END
-- insert addon svc details
INSERT INTO [dbo].[ecHostingAddonSvcs]
(
[ServiceID],
[ProductID],
[PlanID],
[Quantity],
[Recurring],
[DummyAddon],
[SvcCycleID]
)
SELECT
@Result,
@ProductID,
[PlanID],
@Quantity,
[Recurring],
[DummyAddon],
@SvcCycleID
FROM
[dbo].[ecHostingAddons]
WHERE
[ProductID] = @ProductID
AND
[ResellerID] = @ResellerID;
-- check error
IF @@ROWCOUNT = 0
GOTO ERROR_HANDLE;
-- commit tran
COMMIT TRAN ADD_ADDON_SVC;
-- exit
RETURN;
-- error handler
ERROR_HANDLE:
BEGIN
SET @Result = -1;
ROLLBACK TRAN ADD_ADDON_SVC;
RETURN;
END
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecAddHostingPlan]
@ActorID int,
@UserID int,
@PlanName nvarchar(255),
@ProductSku nvarchar(50),
@TaxInclusive bit,
@PlanID int,
@UserRole int,
@InitialStatus int,
@DomainOption int,
@Enabled bit,
@PlanDescription ntext,
@PlanCyclesXml xml,
@PlanHighlightsXml xml,
@PlanCategoriesXml xml,
@Result int OUTPUT
AS
BEGIN
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
SET @Result = -1;
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
BEGIN TRAN ADD_PLAN
-- insert product first
INSERT INTO [dbo].[ecProduct]
([ProductName], [ProductSKU], [TypeID], [TaxInclusive], [Description], [Created], [Enabled], [ResellerID])
VALUES
(@PlanName, @ProductSku, 1, @TaxInclusive, @PlanDescription, GETDATE(), @Enabled, @UserID);
-- set product id created
SET @Result = SCOPE_IDENTITY();
-- save hosting plan details
INSERT INTO [dbo].[ecHostingPlans]
([ProductID], [ResellerID], [PlanID], [UserRole], [InitialStatus], [DomainOption])
VALUES
(@Result, @UserID, @PlanID, @UserRole, @InitialStatus, @DomainOption);
-- check errors
IF @@ERROR <> 0
BEGIN
GOTO ERROR_HANDLE;
END
/*
XML Format:
<PlanCycles>
<Cycle ID="2" SetupFee="2.99" RecurringFee="3.99" SortOrder="1" />
</PlanCycles>
*/
-- insert cycles
INSERT INTO [dbo].[ecHostingPlansBillingCycles]
([ProductID], [CycleID], [SetupFee], [RecurringFee], [SortOrder])
SELECT
@Result, [SXML].[Data].value('@ID','int'), [SXML].[Data].value('@SetupFee','money'),
[SXML].[Data].value('@RecurringFee','money'), [SXML].[Data].value('@SortOrder','int')
FROM @PlanCyclesXml.nodes('/PlanCycles/Cycle') [SXML]([Data])
-- check errors
IF @@ERROR <> 0
BEGIN
GOTO ERROR_HANDLE;
END
/*
XML Format:
<PlanHighlights>
<Item Text="My Highlight Text" SortOrder="0" />
</PlanHighlights>
*/
-- insert cycles
INSERT INTO [dbo].[ecProductsHighlights]
([ProductID], [HighlightText], [SortOrder])
SELECT
@Result, [SXML].[Data].value('@Text','nvarchar(255)'), [SXML].[Data].value('@SortOrder','int')
FROM @PlanHighlightsXml.nodes('/PlanHighlights/Item') [SXML]([Data])
-- check errors
IF @@ERROR <> 0
BEGIN
GOTO ERROR_HANDLE;
END
/*
XML Format:
<PlanCategories>
<Category ID="2" />
</PlanCategories>
*/
-- insert categories
INSERT INTO [dbo].[ecProductCategories]
([ProductID], [CategoryID], [ResellerID])
SELECT
@Result, [SXML].[Data].value('@ID','int'), @UserID FROM @PlanCategoriesXml.nodes('/PlanCategories/Category') [SXML]([Data])
-- check errors
IF @@ERROR <> 0
GOTO ERROR_HANDLE;
-- commit changes
COMMIT TRAN ADD_PLAN;
-- return result
RETURN;
ERROR_HANDLE:
BEGIN
SET @Result = -1;
ROLLBACK TRAN ADD_PLAN;
RETURN;
END
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecAddHostingPlanSvc]
@ContractID nvarchar(50),
@ProductID int,
@PlanName nvarchar(255),
@CycleID int,
@Currency nvarchar(10),
@Result int OUTPUT
AS
BEGIN
DECLARE @ResellerID int;
SELECT
@ResellerID = [ResellerID] FROM [dbo].[ecContracts]
WHERE
[ContractID] = @ContractID;
BEGIN TRAN ADD_HPLAN_SVC
-- add service
INSERT INTO [dbo].[ecService]
([ContractID], [ServiceName], [TypeID], [Status], [Created])
VALUES
(@ContractID, @PlanName, 1, 0, GETDATE());
-- check error
IF @@ERROR <> 0
GOTO ERROR_HANDLE;
-- obtain result
SET @Result = SCOPE_IDENTITY();
DECLARE @SvcCycleID int;
-- insert svc life-cycle
INSERT INTO [dbo].[ecHostingPackageSvcsCycles]
(
[ServiceID],
[CycleName],
[BillingPeriod],
[PeriodLength],
[SetupFee],
[RecurringFee],
[Currency]
)
SELECT
@Result,
[BC].[CycleName],
[BC].[BillingPeriod],
[BC].[PeriodLength],
[HPBC].[SetupFee],
[HPBC].[RecurringFee],
@Currency
FROM
[dbo].[ecHostingPlansBillingCycles] AS [HPBC]
INNER JOIN
[dbo].[ecBillingCycles] AS [BC]
ON
[BC].[CycleID] = [HPBC].[CycleID]
WHERE
[HPBC].[CycleID] = @CycleID
AND
[HPBC].[ProductID] = @ProductID
AND
[BC].[ResellerID] = @ResellerID;
-- check error
IF @@ROWCOUNT = 0
GOTO ERROR_HANDLE;
-- obtain result
SET @SvcCycleID = SCOPE_IDENTITY();
-- add plan details
INSERT INTO [dbo].[ecHostingPackageSvcs]
(
[ServiceID],
[ProductID],
[PlanID],
[UserRole],
[InitialStatus],
[SvcCycleID]
)
SELECT
@Result,
@ProductID,
[PlanID],
[UserRole],
[InitialStatus],
@SvcCycleID
FROM
[dbo].[ecHostingPlans]
WHERE
[ProductID] = @ProductID
AND
[ResellerID] = @ResellerID;
-- check error
IF @@ROWCOUNT = 0
GOTO ERROR_HANDLE;
-- commit tran
COMMIT TRAN ADD_HPLAN_SVC;
-- exit
RETURN;
-- error handler
ERROR_HANDLE:
BEGIN
SET @Result = -1;
ROLLBACK TRAN ADD_HPLAN_SVC;
RETURN;
END
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecAddInvoice]
@ContractID nvarchar(50),
@Created datetime,
@DueDate datetime,
@TaxationID int,
@TotalAmount money,
@SubTotalAmount money,
@TaxAmount money,
@Xml ntext,
@Currency nvarchar(3),
@Result int OUTPUT
AS
BEGIN
/*
XML Format:
<items>
<item serviceid="" itemname="" typename="" quantity="" total="" subtotal="" unitprice="" />
</items>
*/
BEGIN TRAN ADD_INVOICE
DECLARE @XmlDocID int;
SET @XmlDocID = NULL;
--
IF @TaxationID < 1
SET @TaxationID = NULL;
-- emit invoice
INSERT INTO [dbo].[ecInvoice]
([ContractID], [Created], [DueDate], [TaxationID], [Total], [SubTotal], [TaxAmount], [Currency])
VALUES
(@ContractID, @Created, @DueDate, @TaxationID, @TotalAmount, @SubTotalAmount, @TaxAmount, @Currency);
-- obtain result
SET @Result = SCOPE_IDENTITY();
--Create an internal representation of the XML document.
EXEC sp_xml_preparedocument @XmlDocID OUTPUT, @Xml;;
--
INSERT INTO [dbo].[ecInvoiceItems]
(
[InvoiceID],
[ServiceID],
[ItemName],
[TypeName],
[Quantity],
[Total],
[SubTotal],
[UnitPrice]
)
SELECT
@Result,
CASE [XML].[ServiceID]
WHEN 0 THEN NULL
ELSE [XML].[ServiceID]
END,
[XML].[ItemName],
[XML].[TypeName],
[XML].[Quantity],
[XML].[Total],
[XML].[SubTotal],
[XML].[UnitPrice]
FROM OPENXML(@XmlDocID, '/items/item',1) WITH
(
[ServiceID] int '@serviceid',
[ItemName] nvarchar(255) '@itemname',
[TypeName] nvarchar(255) '@typename',
[Quantity] int '@quantity',
[Total] money '@total',
[SubTotal] money '@subtotal',
[UnitPrice] money '@unitprice'
) AS [XML];
-- check errors
IF @@ERROR <> 0
GOTO ERROR_HANDLE;
-- remove document
EXEC sp_xml_removedocument @XmlDocID;
-- commit
COMMIT TRAN ADD_INVOICE;
-- exit
RETURN;
-- error handle
ERROR_HANDLE:
BEGIN
IF NOT @XmlDocID IS NULL
EXEC sp_xml_removedocument @XmlDocID;
SET @Result = -1;
ROLLBACK TRAN ADD_INVOICE;
RETURN;
END
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecAddServiceHandlerTextResponse]
@ServiceID nvarchar(50),
@ContractID nvarchar(50),
@InvoiceID int,
@DataReceived ntext
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
IF @InvoiceID = 0
SET @InvoiceID = NULL;
INSERT INTO [ecServiceHandlersResponses] ([ServiceID],[ContractID],[InvoiceID],[TextResponse])
VALUES (@ServiceID,@ContractID,@InvoiceID,@DataReceived);
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecAddServiceUsageRecord]
@ActorID int,
@ServiceID int,
@SvcCycleID int,
@StartDate datetime,
@EndDate datetime,
@Result int OUTPUT
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SET @Result = 0;
INSERT INTO [dbo].[ecSvcsUsageLog]
(
[ServiceID],
[SvcCycleID],
[StartDate],
[EndDate]
)
VALUES
(
@ServiceID,
@SvcCycleID,
@StartDate,
@EndDate
);
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[ecAddSystemTrigger]
@ActorID int,
@OwnerID int,
@TriggerHandler nvarchar(512),
@ReferenceID nvarchar(50),
@Namespace nvarchar(255),
@Status nvarchar(50)
AS
BEGIN
IF [dbo].[CheckUserParent](@ActorID, @OwnerID) = 0
BEGIN
RAISERROR('You are not allowed to perform this action', 16, 1);
RETURN;
END
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
IF NOT EXISTS(SELECT * FROM [dbo].[ecSystemTriggers] WHERE [OwnerID] = @OwnerID AND
[TriggerHandler] = @TriggerHandler AND [ReferenceID] = @ReferenceID AND
[Namespace] = @Namespace AND [Status] = @Status)
BEGIN
INSERT INTO [dbo].[ecSystemTriggers]
([OwnerID], [TriggerHandler], [ReferenceID], [Namespace], [Status])
VALUES
(@OwnerID, @TriggerHandler, @ReferenceID, @Namespace, @Status);
END
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecAddTaxation]
@ActorID int,
@UserID int,
@Country nvarchar(3),
@State nvarchar(50),
@Description nvarchar(50),
@TypeID int,
@Amount decimal(5,2),
@Active bit,
@Result int OUTPUT
AS
BEGIN
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- check before insert
IF EXISTS (SELECT [TaxationID] FROM [dbo].[ecTaxations]
WHERE [ResellerID] = @UserID AND [Country] = @Country AND [State] = @State)
BEGIN
SET @Result = -202;
RETURN;
END
-- insert
INSERT INTO [dbo].[ecTaxations]
(
[ResellerID],
[Country],
[State],
[Description],
[TypeID],
[Amount],
[Active]
)
VALUES
(
@UserID,
@Country,
@State,
@Description,
@TypeID,
@Amount,
@Active
);
--
SET @Result = SCOPE_IDENTITY();
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecAddTopLevelDomain]
@ActorID int,
@UserID int,
@TopLevelDomain nvarchar(10),
@ProductSku nvarchar(50),
@TaxInclusive bit,
@PluginID int,
@Enabled bit,
@WhoisEnabled bit,
@DomainCyclesXml xml,
@Result int OUTPUT
AS
BEGIN
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
SET @Result = -1;
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
BEGIN TRAN ADD_DOMAIN
-- insert product first
INSERT INTO [dbo].[ecProduct]
(
[ProductName],
[ProductSKU],
[TypeID],
[Description],
[Created],
[Enabled],
[ResellerID],
[TaxInclusive]
)
VALUES
(
@TopLevelDomain,
@ProductSku,
3, -- Domain Name type
NULL,
GETDATE(),
@Enabled,
@UserID,
@TaxInclusive
);
-- set product id created
SET @Result = SCOPE_IDENTITY();
-- save top level domain details
INSERT INTO [dbo].[ecTopLevelDomains]
(
[ProductID],
[ResellerID],
[TopLevelDomain],
[PluginID],
[WhoisEnabled]
)
VALUES
(
@Result,
@UserID,
@TopLevelDomain,
@PluginID,
@WhoisEnabled
);
-- check errors
IF @@ERROR <> 0
BEGIN
GOTO ERROR_HANDLE;
END
/*
XML Format:
<DomainCycles>
<Cycle ID="2" SetupFee="2.99" RecurringFee="3.99" TransferFee="3.99" SortOrder="1" />
</DomainCycles>
*/
-- insert cycles
INSERT INTO [dbo].[ecTopLevelDomainsCycles]
(
[ProductID],
[CycleID],
[SetupFee],
[RecurringFee],
[TransferFee],
[SortOrder]
)
SELECT
@Result,
[SXML].[Data].value('@ID','int'),
[SXML].[Data].value('@SetupFee','money'),
[SXML].[Data].value('@RecurringFee','money'),
[SXML].[Data].value('@TransferFee','money'),
[SXML].[Data].value('@SortOrder','int')
FROM @DomainCyclesXml.nodes('/DomainCycles/Cycle') [SXML]([Data]);
-- check errors
IF @@ERROR <> 0
GOTO ERROR_HANDLE;
--
COMMIT TRAN ADD_DOMAIN;
--
RETURN;
ERROR_HANDLE:
BEGIN
SET @Result = -1;
ROLLBACK TRAN ADD_DOMAIN;
RETURN;
END
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecBulkServiceDelete]
@ActorID int,
@ContractID nvarchar(50),
@SvcsXml xml,
@Result int OUTPUT
AS
BEGIN
DECLARE @IssuerID int;
SELECT
@IssuerID = ISNULL([CustomerID],[ResellerID]) FROM [dbo].[ecContracts]
WHERE
[ContractID] = @ContractID;
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @IssuerID) = 0
BEGIN
RAISERROR('You are not allowed to access this information', 16, 1);
RETURN;
END
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
DELETE
FROM [dbo].[ecService]
WHERE
[ServiceID] IN(SELECT [SXML].[Data].value('@id','int') FROM @SvcsXml.nodes('/Svcs/Svc') [SXML]([Data]));
--
SET @Result = 0;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecChangeHostingPlanSvcCycle]
@ActorID int,
@ServiceID int,
@ProductID int,
@CycleID int,
@Currency nvarchar(3),
@Result int OUTPUT
AS
BEGIN
DECLARE @ResellerID int, @CustomerID int, @ContractID nvarchar(50);
SELECT
@ContractID = [ContractID] FROM [dbo].[ecService]
WHERE
[ServiceID] = @ServiceID;
SELECT
@CustomerID = [CustomerID], @ResellerID = [ResellerID] FROM [ecContracts]
WHERE
[ContractID] = @ContractID;
-- check actor user rights
IF [dbo].[CanUpdateUserDetails](@ActorID, @CustomerID) = 0
BEGIN
RAISERROR('You are not allowed to access this action', 16, 1);
RETURN;
END
BEGIN TRAN CHNG_SVC_CYCLE
-- insert svc life-cycle
INSERT INTO [dbo].[ecHostingPackageSvcsCycles]
(
[ServiceID],
[CycleName],
[BillingPeriod],
[PeriodLength],
[SetupFee],
[RecurringFee],
[Currency]
)
SELECT
@Result,
[BC].[CycleName],
[BC].[BillingPeriod],
[BC].[PeriodLength],
[HPBC].[SetupFee],
[HPBC].[RecurringFee],
@Currency
FROM
[dbo].[ecHostingPlansBillingCycles] AS [HPBC]
INNER JOIN
[dbo].[ecBillingCycles] AS [BC]
ON
[BC].[CycleID] = [HPBC].[CycleID]
WHERE
[HPBC].[ProductID] = @ProductID
AND
[BC].[ResellerID] = @ResellerID;
-- check error
IF @@ERROR <> 0
GOTO ERROR_HANDLE;
-- obtain result
SET @Result = SCOPE_IDENTITY();
-- update service
UPDATE
[dbo].[ecHostingPackageSvcs]
SET
[SvcCycleID] = @Result
WHERE
[ServiceID] = @ServiceID;
-- check error
IF @@ERROR <> 0 OR @@ROWCOUNT = 0
GOTO ERROR_HANDLE;
-- commit changes
COMMIT TRAN CHNG_SVC_CYCLE;
-- exit
RETURN;
-- error handler
ERROR_HANDLE:
BEGIN
SET @Result = -1;
ROLLBACK TRAN CHNG_SVC_CYCLE;
RETURN;
END
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecCheckCustomerContractExists]
@CustomerID int,
@Result bit OUTPUT
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
IF EXISTS (SELECT * FROM [ecContracts] WHERE [CustomerID] = @CustomerID)
BEGIN
SET @Result = 1;
RETURN;
END
SET @Result = 0;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecDeleteBillingCycle]
@ActorID int,
@UserID int,
@CycleID int,
@Result int OUTPUT
AS
BEGIN
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
SET @Result = -1;
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
DELETE FROM [dbo].[ecBillingCycles] WHERE [ResellerID] = @UserID AND [CycleID] = @CycleID;
SET @Result = 0;
RETURN;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecDeleteCategory]
@ActorID int,
@UserID int,
@CategoryID int,
@Result int OUTPUT
AS
BEGIN
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
SET @Result = -1;
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
SET NOCOUNT ON;
SET @Result = 0;
-- check whether the category doesn't empty
IF EXISTS(
SELECT
[ProductID]
FROM
[dbo].[ecProductCategories]
WHERE
[CategoryID] = @CategoryID
AND
[ResellerID] = @UserID
)
BEGIN
SET @Result = -1;
RETURN;
END
-- check if category has a sub-categories
IF EXISTS(
SELECT
[CategoryID]
FROM
[dbo].[ecCategory]
WHERE
[ParentID] = @CategoryID
AND
[ResellerID] = @UserID
)
BEGIN
SET @Result = -2;
RETURN;
END
-- delete a category
DELETE FROM
[dbo].[ecCategory]
WHERE
[CategoryID] = @CategoryID
AND
[ResellerID] = @UserID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecDeleteContract]
@ContractID nvarchar(50),
@Result int OUTPUT
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
IF NOT EXISTS (SELECT * FROM [dbo].[ecContracts] WHERE [ContractID] = @ContractID)
BEGIN
SET @Result = -1;
RETURN;
END
SET @Result = 0;
DELETE FROM [dbo].[ecContracts] WHERE [ContractID] = @ContractID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecDeleteCustomerPayment]
@ActorID int,
@PaymentID int,
@Result int OUTPUT
AS
BEGIN
DECLARE @IssuerID int, @ContractID nvarchar(50);
SELECT
@ContractID = [ContractID] FROM [dbo].[ecCustomersPayments]
WHERE
[PaymentID] = @PaymentID
SELECT
@IssuerID = [ResellerID] FROM [dbo].[ecContracts]
WHERE
[ContractID] = @ContractID;
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @IssuerID) = 0
BEGIN
RAISERROR('You are not allowed to access this action', 16, 1);
RETURN;
END
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SET @Result = 0;
DELETE
FROM [dbo].[ecCustomersPayments]
WHERE
[PaymentID] = @PaymentID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecDeleteCustomerService]
@ActorID int,
@ServiceID int,
@Result int OUTPUT
AS
BEGIN
DECLARE @IssuerID int, @ContractID nvarchar(50);
SELECT
@ContractID = [ContractID] FROM [dbo].[ecService]
WHERE
[ServiceID] = @ServiceID;
SELECT
@IssuerID = [ResellerID] FROM [dbo].[ecContracts]
WHERE
[ContractID] = @ContractID;
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @IssuerID) = 0
BEGIN
RAISERROR('You are not allowed to access this action', 16, 1);
RETURN;
END
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SET @Result = 0;
DELETE FROM [dbo].[ecService] WHERE [ServiceID] = @ServiceID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecDeletePaymentMethod]
@ActorID int,
@UserID int,
@MethodName nvarchar(50),
@Result int OUTPUT
AS
BEGIN
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
SET @Result = -1;
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
--
SET @Result = 0;
-- remove
DELETE FROM [dbo].[ecPaymentMethods]
WHERE [ResellerID] = @UserID AND [MethodName] = @MethodName;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecDeletePaymentProfile]
@ActorID int,
@ContractID nvarchar(50),
@Result int OUTPUT
AS
BEGIN
DECLARE @CustomerID int;
SELECT
@CustomerID = [CustomerID] FROM [dbo].[ecContracts]
WHERE
[ContractID] = @ContractID;
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @CustomerID) = 0
BEGIN
RAISERROR('You are not allowed to perform this action', 16, 1);
RETURN;
END
SET @Result = 0;
DELETE FROM [dbo].[ecPaymentProfiles] WHERE [ContractID] = @ContractID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecDeleteProduct]
@ActorID int,
@UserID int,
@ProductID int,
@Result int OUTPUT
AS
BEGIN
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
SET @Result = -1;
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
BEGIN TRAN RMV_PRODUCT
-- remove product
DELETE FROM [dbo].[ecProduct] WHERE [ProductID] = @ProductID AND [ResellerID] = @UserID;
-- check errors
IF @@ERROR <> 0
GOTO ERROR_HANDLE;
-- workaround for cyclic cascades
DELETE FROM [dbo].[ecAddonProducts] WHERE [ProductID] = @ProductID AND [ResellerID] = @UserID;
-- check errors
IF @@ERROR <> 0
GOTO ERROR_HANDLE;
-- set result ok
SET @Result = 0;
-- commit actions
COMMIT TRAN RMV_PRODUCT;
-- exit routine
RETURN;
ERROR_HANDLE:
BEGIN
SET @Result = -1;
ROLLBACK TRAN RMV_PRODUCT;
RETURN;
END
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecDeleteSystemTrigger]
@ActorID int,
@TriggerID nvarchar(50)
AS
BEGIN
DECLARE @OwnerID int;
SELECT
@OwnerID = [OwnerID] FROM [dbo].[ecSystemTriggers]
WHERE
[TriggerID] = @TriggerID;
--
IF [dbo].[CheckUserParent](@ActorID, @OwnerID) = 0
BEGIN
RAISERROR('You are not allowed to perform this action', 16, 1);
RETURN;
END
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
DELETE FROM [dbo].[ecSystemTriggers] WHERE [TriggerID] = @TriggerID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecDeleteTaxation]
@ActorID int,
@UserID int,
@TaxationID int,
@Result int OUTPUT
AS
BEGIN
--
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
--
DELETE FROM [dbo].[ecTaxations] WHERE [ResellerID] = @UserID AND [TaxationID] = @TaxationID;
--
SET @Result = 0;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetAddonProducts]
@UserID int,
@ProductID int
AS
BEGIN
SELECT
[P].*
FROM
[dbo].[ecProduct] AS [P]
INNER JOIN [dbo].[ecAddonProducts] AS [ATP]
ON [P].[ProductID] = [ATP].[ProductID]
WHERE
[ATP].[AddonID] = @ProductID
AND
[P].[ResellerID] = @UserID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetAddonProductsIds]
@UserID int,
@ProductID int
AS
BEGIN
SELECT
[P].[ProductID]
FROM
[dbo].[ecProduct] AS [P]
INNER JOIN [dbo].[ecAddonProducts] AS [ATP]
ON [P].[ProductID] = [ATP].[ProductID]
WHERE
[ATP].[AddonID] = @ProductID
AND
[P].[ResellerID] = @UserID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetBillingCycle]
@ActorID int,
@UserID int,
@CycleID int
AS
BEGIN
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
SELECT * FROM [dbo].[ecBillingCycles] WHERE [ResellerID] = @UserID AND [CycleID] = @CycleID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetBillingCyclesCount]
@ActorID int,
@UserID int,
@Count int OUTPUT
AS
BEGIN
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
SELECT @Count = COUNT(*) FROM [dbo].[ecBillingCycles] WHERE [ResellerID] = @UserID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetBillingCyclesFree]
@ActorID int,
@UserID int,
@CyclesTakenXml ntext
AS
BEGIN
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
DECLARE @DocID int;
EXEC sp_xml_preparedocument @DocID OUTPUT, @CyclesTakenXml;
SELECT * FROM [dbo].[ecBillingCycles] WHERE [ResellerID] = @UserID AND [CycleID] NOT IN (
SELECT [CycleTakenID] FROM OPENXML(@DocID, '/CyclesTaken/Cycle',1) WITH
(
[CycleTakenID] int '@id'
)
);
EXEC sp_xml_removedocument @DocID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetBillingCyclesPaged]
@ActorID int,
@UserID int,
@MaximumRows int,
@StartRowIndex int
AS
BEGIN
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
DECLARE @EndIndex int;
SET @EndIndex = @MaximumRows + @StartRowIndex;
SET @StartRowIndex = @StartRowIndex + 1;
WITH [BillingCyclesCTE] AS (
SELECT
ROW_NUMBER() OVER(ORDER BY [Created] DESC) AS [RowIndex],
*
FROM
[dbo].[ecBillingCycles]
WHERE
[ResellerID] = @UserID
)
SELECT
*
FROM
[BillingCyclesCTE]
WHERE
[RowIndex] BETWEEN @StartRowIndex AND @EndIndex;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetCategoriesCount]
@ActorID int,
@UserID int,
@ParentID int,
@Count int OUTPUT
AS
IF @ParentID > 0
BEGIN
SELECT
@Count = COUNT([CategoryID])
FROM
[ecCategory]
WHERE
[ParentID] = @ParentID
AND
[ResellerID] = @UserID;
END
ELSE
BEGIN
SELECT
@Count = COUNT([CategoryID])
FROM
[ecCategory]
WHERE
[ParentID] IS NULL
AND
[ResellerID] = @UserID;
END
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetCategoriesPaged]
@ActorID int,
@UserID int,
@ParentID int,
@MaximumRows int,
@StartRowIndex int
AS
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
DECLARE @EndIndex int;
SET @EndIndex = @MaximumRows + @StartRowIndex;
SET @StartRowIndex = @StartRowIndex + 1;
IF @ParentID > 0
BEGIN
WITH [CategoryCTE] AS (
SELECT
ROW_NUMBER() OVER(ORDER BY [Created] DESC) AS [RowIndex],
*
FROM
[dbo].[ecCategory]
WHERE
[ParentID] = @ParentID
AND
[ResellerID] = @UserID
)
SELECT * FROM [CategoryCTE] WHERE [RowIndex] BETWEEN @StartRowIndex AND @EndIndex ORDER BY [CategoryName];
END
ELSE
BEGIN
WITH [CategoryCTE] AS (
SELECT
ROW_NUMBER() OVER(ORDER BY [Created] DESC) AS [RowIndex],
*
FROM
[dbo].[ecCategory]
WHERE
[ParentID] IS NULL
AND
[ResellerID] = @UserID
)
SELECT * FROM [CategoryCTE] WHERE [RowIndex] BETWEEN @StartRowIndex AND @EndIndex ORDER BY [CategoryID], [CategoryName];
END
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetCategory]
@ActorID int,
@UserID int,
@CategoryID int
AS
BEGIN
SET NOCOUNT ON;
SELECT
*
FROM
[dbo].[ecCategory]
WHERE
[CategoryID] = @CategoryID
AND
[ResellerID] = @UserID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetContract]
@ContractID nvarchar(50)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SELECT * FROM [dbo].[ecContracts] WHERE [ContractID] = @ContractID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetCustomerContract]
@CustomerID int
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SELECT * FROM [dbo].[ecContracts] WHERE [CustomerID] = @CustomerID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetCustomerInvoice]
@ActorID int,
@InvoiceID int
AS
BEGIN
DECLARE @IssuerID int, @ContractID nvarchar(50);
SELECT
@ContractID = [ContractID] FROM [dbo].[ecInvoice]
WHERE
[InvoiceID] = @InvoiceID;
SELECT
@IssuerID = ISNULL([CustomerID],[ResellerID]) FROM [dbo].[ecContracts]
WHERE
[ContractID] = @ContractID;
-- check actor rights
IF [dbo].[CheckUserParent](@ActorID, @IssuerID) = 0
BEGIN
RAISERROR('You are not allowed to access the contract', 16, 1);
RETURN;
END
--
SET NOCOUNT ON;
--
SELECT
* FROM [dbo].[ContractsInvoicesDetailed]
WHERE
[InvoiceID] = @InvoiceID AND [ContractID] = @ContractID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetCustomerInvoiceItems]
@ActorID int,
@InvoiceID int
AS
BEGIN
DECLARE @IssuerID int, @ContractID nvarchar(50);
SELECT
@ContractID = [ContractID] FROM [dbo].[ecInvoice]
WHERE
[InvoiceID] = @InvoiceID;
SELECT
@IssuerID = ISNULL([CustomerID],[ResellerID]) FROM [dbo].[ecContracts]
WHERE
[ContractID] = @ContractID;
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID,@IssuerID) = 0
BEGIN
RAISERROR('You are not allowed to access the contract', 16, 1);
RETURN;
END
--
SET NOCOUNT ON;
--
SELECT
* FROM [dbo].[ecInvoiceItems] AS [II]
INNER JOIN
[ecInvoice] AS [I] ON [I].[InvoiceID] = [II].[InvoiceID]
WHERE
[I].[InvoiceID] = @InvoiceID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetCustomerPayment]
@ActorID int,
@PaymentID int
AS
BEGIN
-- read an issuer information
DECLARE @ContractID nvarchar(50);
SELECT
@ContractID = [ContractID] FROM [dbo].[ecCustomersPayments]
WHERE
[PaymentID] = @PaymentID;
SET NOCOUNT ON;
SELECT
[P].*, [INV].[InvoiceNumber] FROM [dbo].[ecCustomersPayments] AS [P]
LEFT OUTER JOIN
[dbo].[ecInvoice] AS [INV] ON [INV].[InvoiceID] = [P].[InvoiceID]
WHERE
[P].[PaymentID] = @PaymentID AND [P].[ContractID] = @ContractID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetCustomerService]
@ActorID int,
@ServiceID int
AS
BEGIN
DECLARE @IssuerID int, @ContractID nvarchar(50);
SELECT
@ContractID = [ContractID] FROM [dbo].[ecService]
WHERE
[ServiceID] = @ServiceID;
SELECT
@IssuerID = ISNULL([CustomerID],[ResellerID]) FROM [dbo].[ecContracts]
WHERE
[ContractID] = @ContractID;
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @IssuerID) = 0
BEGIN
RAISERROR('You are not allowed to access this information', 16, 1);
RETURN;
END
SELECT * FROM [dbo].[ecService] WHERE [ServiceID] = @ServiceID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetCustomersInvoicesCount]
@ActorID int,
@UserID int,
@IsReseller bit,
@Result int OUTPUT
AS
BEGIN
-- check user parent
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
RAISERROR('You are not allowed to access this information', 16, 1);
RETURN;
END
SET NOCOUNT ON;
IF @IsReseller = 1
BEGIN
SELECT
@Result = COUNT([InvoiceID]) FROM [dbo].[ContractsInvoicesDetailed]
WHERE
[ResellerID] = @UserID;
RETURN;
END
SELECT
@Result = COUNT([InvoiceID]) FROM [dbo].[ContractsInvoicesDetailed]
WHERE
[CustomerID] = @UserID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetCustomersInvoicesPaged]
@ActorID int,
@UserID int,
@IsReseller bit,
@MaximumRows int,
@StartRowIndex int
AS
BEGIN
-- check actor rights
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
RAISERROR('You are not allowed to access this information', 16, 1);
RETURN;
END
SET NOCOUNT ON;
DECLARE @EndIndex int;
SET @EndIndex = @MaximumRows + @StartRowIndex;
SET @StartRowIndex = @StartRowIndex + 1;
IF @IsReseller = 1
BEGIN
-- get reseller invoices
WITH [INVOICES] AS (
SELECT
ROW_NUMBER() OVER(ORDER BY [Created] DESC) AS [RowIndex], * FROM [dbo].[ContractsInvoicesDetailed]
WHERE
[ResellerID] = @UserID
)
SELECT * FROM [INVOICES]
WHERE [RowIndex] BETWEEN @StartRowIndex AND @EndIndex
ORDER BY [Created] DESC;
RETURN;
END;
-- get customer invoices
WITH [INVOICES] AS (
SELECT
ROW_NUMBER() OVER(ORDER BY [Created] DESC) AS [RowIndex], * FROM [dbo].[ContractsInvoicesDetailed]
WHERE
[CustomerID] = @UserID
)
SELECT * FROM [INVOICES]
WHERE [RowIndex] BETWEEN @StartRowIndex AND @EndIndex
ORDER BY [Created] DESC;
RETURN;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetCustomersPaymentsCount]
@ActorID int,
@UserID int,
@IsReseller bit,
@Result int OUTPUT
AS
BEGIN
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
RAISERROR('You are not allowed to access this information', 16, 1);
RETURN;
END
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
IF @IsReseller = 1
BEGIN
SELECT
@Result = COUNT([CP].[PaymentID]) FROM [dbo].[ecCustomersPayments] AS [CP]
INNER JOIN
[dbo].[ecContracts] AS [C] ON [C].[ContractID] = [CP].[ContractID]
WHERE
[C].[ResellerID] = @UserID;
RETURN;
END
SELECT
@Result = COUNT([CP].[PaymentID]) FROM [dbo].[ecCustomersPayments] AS [CP]
INNER JOIN
[dbo].[ecContracts] AS [C] ON [C].[ContractID] = [CP].[ContractID]
WHERE
[C].[CustomerID] = @UserID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetCustomersPaymentsPaged]
@ActorID int,
@UserID int,
@IsReseller bit,
@MaximumRows int,
@StartRowIndex int
AS
BEGIN
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
RAISERROR('You are not allowed to access this information', 16, 1);
RETURN;
END
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
DECLARE @EndIndex int;
SET @EndIndex = @MaximumRows + @StartRowIndex;
SET @StartRowIndex = @StartRowIndex + 1;
IF @IsReseller = 1
BEGIN
WITH [PAYMENTS] AS (
SELECT
ROW_NUMBER() OVER(ORDER BY [CP].[Created] DESC) AS [RowIndex], [CP].* FROM [dbo].[ecCustomersPayments] AS [CP]
INNER JOIN
[dbo].[ecContracts] AS [C] ON [C].[ContractID] = [CP].[ContractID]
WHERE
[C].[ResellerID] = @UserID
)
SELECT
[P].*, [INV].[InvoiceNumber], [SP].[DisplayName] AS [ProviderName] FROM [PAYMENTS] AS [P]
LEFT OUTER JOIN
[dbo].[ecSupportedPlugins] AS [SP] ON [SP].[PluginID] = [P].[PluginID]
LEFT OUTER JOIN
[dbo].[ecInvoice] AS [INV] ON [INV].[InvoiceID] = [P].[InvoiceID]
WHERE
[RowIndex] BETWEEN @StartRowIndex AND @EndIndex
ORDER BY
[Created] DESC;
RETURN;
END;
WITH [PAYMENTS] AS (
SELECT
ROW_NUMBER() OVER(ORDER BY [CP].[Created] DESC) AS [RowIndex], [CP].* FROM [dbo].[ecCustomersPayments] AS [CP]
INNER JOIN
[dbo].[ecContracts] AS [C] ON [C].[ContractID] = [CP].[ContractID]
WHERE
[C].[CustomerID] = @UserID
)
SELECT
[P].*, [INV].[InvoiceNumber], [SP].[DisplayName] AS [ProviderName] FROM [PAYMENTS] AS [P]
LEFT OUTER JOIN
[dbo].[ecSupportedPlugins] AS [SP] ON [SP].[PluginID] = [P].[PluginID]
LEFT OUTER JOIN
[dbo].[ecInvoice] AS [INV] ON [INV].[InvoiceID] = [P].[InvoiceID]
WHERE
[RowIndex] BETWEEN @StartRowIndex AND @EndIndex
ORDER BY
[Created] DESC;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetCustomersServicesCount]
@ActorID int,
@UserID int,
@IsReseller bit,
@Result int OUTPUT
AS
BEGIN
-- check user parent
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
RAISERROR('You are not allowed to access this information', 16, 1);
RETURN;
END
SET NOCOUNT ON;
IF @IsReseller = 1
BEGIN
SELECT
@Result = COUNT([ServiceID]) FROM [dbo].[ContractsServicesDetailed]
WHERE
[ResellerID] = @UserID;
RETURN;
END
SELECT
@Result = COUNT([ServiceID]) FROM [dbo].[ContractsServicesDetailed]
WHERE
[CustomerID] = @UserID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetCustomersServicesPaged]
@ActorID int,
@UserID int,
@IsReseller bit,
@MaximumRows int,
@StartRowIndex int
AS
BEGIN
-- check user parent
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
RAISERROR('You are not allowed to access this information', 16, 1);
RETURN;
END
SET NOCOUNT ON;
DECLARE @EndIndex int;
SET @EndIndex = @MaximumRows + @StartRowIndex;
SET @StartRowIndex = @StartRowIndex + 1;
IF @IsReseller = 1
BEGIN
WITH [SERVICES] AS (
SELECT
ROW_NUMBER() OVER(ORDER BY [Created] DESC) AS [RowIndex], * FROM [dbo].[ContractsServicesDetailed]
WHERE
[ResellerID] = @UserID
)
SELECT
* FROM [SERVICES]
WHERE
[RowIndex] BETWEEN @StartRowIndex AND @EndIndex ORDER BY [Created] DESC;
-- exit
RETURN;
END;
WITH [SERVICES] AS (
SELECT
ROW_NUMBER() OVER(ORDER BY [Created] DESC) AS [RowIndex], * FROM [dbo].[ContractsServicesDetailed]
WHERE
[CustomerID] = @UserID
)
SELECT
* FROM [SERVICES]
WHERE
[RowIndex] BETWEEN @StartRowIndex AND @EndIndex ORDER BY [Created] DESC;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetCustomerTaxation]
@ContractID nvarchar(50),
@Country nvarchar(50),
@State nvarchar(50)
AS
BEGIN
DECLARE @ResellerID int;
SELECT
@ResellerID = [ResellerID] FROM [dbo].[ecContracts]
WHERE
[ContractID] = @ContractID;
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
--
SELECT TOP 1
ROW_NUMBER() OVER (ORDER BY [TypeId] DESC, [State] ASC),
*
FROM
[dbo].[ecTaxations]
WHERE
[ResellerID] = @ResellerID
AND
([Country] = @Country OR [Country] = '*')
AND
([State] = @State OR [State] = '*')
AND
[Active] = 1;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetDomainNameSvc]
@ActorID int,
@ServiceID int
AS
BEGIN
DECLARE @IssuerID int, @ContractID nvarchar(50);
SELECT
@ContractID = [ContractID] FROM [dbo].[ecService]
WHERE
[ServiceID] = @ServiceID;
SELECT
@IssuerID = ISNULL([CustomerID],[ResellerID]) FROM [dbo].[ecContracts]
WHERE
[ContractID] = @ContractID;
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @IssuerID) = 0
BEGIN
RAISERROR('You are not allowed to access this information', 16, 1);
RETURN;
END
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SELECT
[SVC].*,
[DMSVC].[ProductID],
[DMSVC].[DomainID],
[DMSVC].[PluginID],
[DMSVC].[FQDN],
[DMSVC].[PropertyNames],
[DMSVC].[PropertyValues],
[DMSVC].[SvcCycleID],
[SPS].[DisplayName] AS [ProviderName],
[DMSC].[CycleName],
[DMSC].[BillingPeriod],
[DMSC].[PeriodLength],
[DMSC].[SetupFee],
[DMSC].[RecurringFee],
[DMSC].[Currency]
FROM
[dbo].[ecService] AS [SVC]
INNER JOIN
[dbo].[ecDomainSvcs] AS [DMSVC]
ON
[DMSVC].[ServiceID] = [SVC].[ServiceID]
LEFT JOIN
[dbo].[ecSupportedPlugins] AS [SPS]
ON
[SPS].[PluginID] = [DMSVC].[PluginID]
LEFT JOIN
[dbo].[ecDomainSvcsCycles] AS [DMSC]
ON
[DMSC].[SvcCycleID] = [DMSVC].[SvcCycleID]
WHERE
[SVC].[ServiceID] = @ServiceID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetDomainNameSvcHistory]
@ActorID int,
@ServiceID int
AS
BEGIN
DECLARE @IssuerID int, @ContractID nvarchar(50);
SELECT
@ContractID = [ContractID] FROM [dbo].[ecService]
WHERE
[ServiceID] = @ServiceID;
SELECT
@IssuerID = ISNULL([CustomerID],[ResellerID]) FROM [dbo].[ecContracts]
WHERE
[ContractID] = @ContractID;
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @IssuerID) = 0
BEGIN
RAISERROR('You are not allowed to access this information', 16, 1);
RETURN;
END
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SELECT
[DNC].[CycleName],
[DNC].[BillingPeriod],
[DNC].[PeriodLength],
[DNC].[SetupFee],
[DNC].[RecurringFee],
[DNC].[Currency],
[SUL].[StartDate],
[SUL].[EndDate]
FROM
[dbo].[ecDomainSvcsCycles] AS [DNC]
INNER JOIN
[dbo].[ecSvcsUsageLog] AS [SUL]
ON
[SUL].[ServiceID] = [DNC].[ServiceID]
AND
[SUL].[SvcCycleID] = [DNC].[SvcCycleID]
WHERE
[DNC].[ServiceID] = @ServiceID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetHostingAddon]
@UserID int,
@ProductID int
AS
BEGIN
SELECT
[P].*,
[HA].*,
[HA].[2COID] AS [TCOID]
FROM
[dbo].[ecHostingAddons] AS [HA]
INNER JOIN
[dbo].[ecProduct] AS [P]
ON
[P].[ProductID] = [HA].[ProductID]
WHERE
[HA].[ResellerID] = @UserID
AND
[HA].[ProductID] = @ProductID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetHostingAddonCycles]
@UserID int,
@ProductID int
AS
BEGIN
SELECT
[BC].*, [HAC].[ProductID], [HAC].[SetupFee], [HAC].[RecurringFee] FROM [dbo].[ecHostingAddonsCycles] AS [HAC]
INNER JOIN
[dbo].[ecBillingCycles] AS [BC] ON [BC].[CycleID] = [HAC].[CycleID]
INNER JOIN
[dbo].[ecProduct] AS [PR] ON [HAC].[ProductID] = [PR].[ProductID]
WHERE
[PR].[ResellerID] = @UserID AND [HAC].[ProductID] = @ProductID
ORDER BY
[HAC].[SortOrder];
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetHostingAddonsTaken]
@ActorID int,
@UserID int
AS
BEGIN
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
SELECT [PlanID] FROM [dbo].[ecHostingAddons] WHERE [ResellerID] = @UserID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetHostingAddonSvc]
@ActorID int,
@ServiceID int
AS
BEGIN
DECLARE @IssuerID int, @ContractID nvarchar(50);
SELECT
@ContractID = [ContractID] FROM [dbo].[ecService]
WHERE
[ServiceID] = @ServiceID;
SELECT
@IssuerID = ISNULL([CustomerID],[ResellerID]) FROM [dbo].[ecContracts]
WHERE
[ContractID] = @ContractID;
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @IssuerID) = 0
BEGIN
RAISERROR('You are not allowed to access this information', 16, 1);
RETURN;
END
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SELECT
[SVC].*,
[HASVC].*,
[HASC].[CycleName],
[HASC].[BillingPeriod],
[HASC].[PeriodLength],
[HASC].[SetupFee],
[HASC].[CyclePrice],
[HASC].[Currency]
FROM
[dbo].[ecService] AS [SVC]
INNER JOIN
[dbo].[ecHostingAddonSvcs] AS [HASVC]
ON
[HASVC].[ServiceID] = [SVC].[ServiceID]
INNER JOIN
[dbo].[ecHostingAddonSvcsCycles] AS [HASC]
ON
[HASC].[SvcCycleID] = [HASVC].[SvcCycleID]
WHERE
[SVC].[ServiceID] = @ServiceID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetHostingAddonSvcHistory]
@ActorID int,
@ServiceID int
AS
BEGIN
DECLARE @IssuerID int, @ContractID nvarchar(50);
SELECT
@ContractID = [ContractID] FROM [dbo].[ecService]
WHERE
[ServiceID] = @ServiceID;
SELECT
@IssuerID = ISNULL([CustomerID],[ResellerID]) FROM [dbo].[ecContracts]
WHERE
[ContractID] = @ContractID;
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @IssuerID) = 0
BEGIN
RAISERROR('You are not allowed to access this information', 16, 1);
RETURN;
END
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SELECT
[HAC].[CycleName],
[HAC].[BillingPeriod],
[HAC].[PeriodLength],
[HAC].[SetupFee],
[HAC].[CyclePrice] AS [RecurringFee],
[HAC].[Currency],
[SUL].[StartDate],
[SUL].[EndDate]
FROM
[dbo].[ecHostingAddonSvcsCycles] AS [HAC]
INNER JOIN
[dbo].[ecSvcsUsageLog] AS [SUL]
ON
[SUL].[ServiceID] = [HAC].[ServiceID]
AND
[SUL].[SvcCycleID] = [HAC].[SvcCycleID]
WHERE
[HAC].[ServiceID] = @ServiceID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetHostingPackageSvc]
@ActorID int,
@ServiceID int
AS
BEGIN
DECLARE @IssuerID int, @ContractID nvarchar(50);
SELECT
@ContractID = [ContractID] FROM [dbo].[ecService]
WHERE
[ServiceID] = @ServiceID;
SELECT
@IssuerID = ISNULL([CustomerID],[ResellerID]) FROM [dbo].[ecContracts]
WHERE
[ContractID] = @ContractID;
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @IssuerID) = 0
BEGIN
RAISERROR('You are not allowed to access this information', 16, 1);
RETURN;
END
--
SET NOCOUNT ON;
SELECT
[SVC].*,
[HPSVC].[ProductID],
[HPSVC].[PlanID],
[HPSVC].[PackageID],
[HPSVC].[UserRole],
[HPSVC].[InitialStatus],
[HPSVC].[SvcCycleID],
[HPSC].[CycleName],
[HPSC].[BillingPeriod],
[HPSC].[PeriodLength],
[HPSC].[SetupFee],
[HPSC].[RecurringFee],
[HPSC].[Currency]
FROM
[dbo].[ecService] AS [SVC]
INNER JOIN
[dbo].[ecHostingPackageSvcs] AS [HPSVC]
ON
[HPSVC].[ServiceID] = [SVC].[ServiceID]
INNER JOIN
[dbo].[ecHostingPackageSvcsCycles] AS [HPSC]
ON
[HPSC].[SvcCycleID] = [HPSVC].[SvcCycleID]
WHERE
[SVC].[ServiceID] = @ServiceID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetHostingPackageSvcHistory]
@ActorID int,
@ServiceID int
AS
BEGIN
DECLARE @IssuerID int, @ContractID nvarchar(50);
SELECT
@ContractID = [ContractID] FROM [dbo].[ecService]
WHERE
[ServiceID] = @ServiceID;
SELECT
@IssuerID = ISNULL([CustomerID],[ResellerID]) FROM [dbo].[ecContracts]
WHERE
[ContractID] = @ContractID;
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @IssuerID) = 0
BEGIN
RAISERROR('You are not allowed to access this information', 16, 1);
RETURN;
END
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SELECT
[HPC].[CycleName],
[HPC].[BillingPeriod],
[HPC].[PeriodLength],
[HPC].[SetupFee],
[HPC].[RecurringFee],
[HPC].[Currency],
[SUL].[StartDate],
[SUL].[EndDate]
FROM
[dbo].[ecHostingPackageSvcsCycles] AS [HPC]
INNER JOIN
[dbo].[ecSvcsUsageLog] AS [SUL]
ON
[SUL].[ServiceID] = [HPC].[ServiceID]
AND
[SUL].[SvcCycleID] = [HPC].[SvcCycleID]
WHERE
[HPC].[ServiceID] = @ServiceID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetHostingPlan]
@UserID int,
@ProductID int
AS
BEGIN
SELECT
[PR].*,
[HP].[PlanID],
[HP].[UserRole],
[HP].[InitialStatus],
[HP].[DomainOption]
FROM
[dbo].[ecHostingPlans] AS [HP]
INNER JOIN
[dbo].[ecProduct] AS [PR]
ON
[PR].[ProductID] = [HP].[ProductID]
WHERE
[HP].[ResellerID] = @UserID
AND
[HP].[ProductID] = @ProductID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetHostingPlanCycles]
@UserID int,
@ProductID int
AS
BEGIN
SELECT
[BC].*, [HPC].[ProductID], [HPC].[SetupFee], [HPC].[RecurringFee] FROM [dbo].[ecHostingPlansBillingCycles] AS [HPC]
INNER JOIN
[dbo].[ecBillingCycles] AS [BC] ON [BC].[CycleID] = [HPC].[CycleID]
INNER JOIN
[dbo].[ecProduct] AS [PR] ON [HPC].[ProductID] = [PR].[ProductID]
WHERE
[PR].[ResellerID] = @UserID AND [HPC].[ProductID] = @ProductID
ORDER BY
[HPC].[SortOrder];
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetHostingPlansTaken]
@ActorID int,
@UserID int
AS
BEGIN
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
SELECT [PlanID] FROM [dbo].[ecHostingPlans] WHERE [ResellerID] = @UserID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetInvoicesItemsOverdue]
@ActorID int,
@ResellerID int,
@DateOverdue datetime
AS
BEGIN
-- check user parent
IF [dbo].[CheckUserParent](@ActorID, @ResellerID) = 0
BEGIN
RAISERROR('You are not allowed to access this information', 16, 1);
RETURN;
END
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- lookup for paid invoices
WITH [OVERDUE_INVOICES] ([InvoiceID]) AS
(
SELECT
[I].[InvoiceID]
FROM
[dbo].[ecInvoice] AS [I]
INNER JOIN
[dbo].[ecContracts] AS [C] ON [C].[ContractID] = [I].[ContractID]
WHERE
[C].[ResellerID] = @ResellerID
AND
DATEDIFF(second, [DueDate], @DateOverdue) >= 0
EXCEPT
SELECT
[InvoiceID]
FROM
[dbo].[ecCustomersPayments] AS [CP]
INNER JOIN
[dbo].[ecContracts] AS [C] ON [C].[ContractID] = [CP].[ContractID]
WHERE
[C].[ResellerID] = @ResellerID
AND
[CP].[StatusID] = 1 -- Approved payments only
)
SELECT * FROM [dbo].[ecInvoiceItems]
WHERE [ServiceID] IS NOT NULL
AND [InvoiceID] IN (
SELECT [InvoiceID] FROM [OVERDUE_INVOICES]
);
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetInvoicesItemsToActivate]
@ActorID int,
@ResellerID int
AS
BEGIN
IF [dbo].[CheckUserParent](@ActorID, @ResellerID) = 0
BEGIN
RAISERROR('You are not allowed to access this information', 16, 1);
RETURN;
END
SET NOCOUNT ON;
-- lookup for paid invoices
WITH [PAID_INVOICES] ([InvoiceID]) AS
(
SELECT
[InvoiceID] FROM [dbo].[ecCustomersPayments] AS [CP]
INNER JOIN
[dbo].[ecContracts] AS [C] ON [C].[ContractID] = [CP].[ContractID]
WHERE
[C].[ResellerID] = @ResellerID AND [StatusID] = 1 -- Approved Payments Only
)
SELECT
* FROM [dbo].[ecInvoiceItems]
WHERE
[ServiceID] IS NOT NULL AND [Processed] = 0 AND [InvoiceID] IN (SELECT [InvoiceID] FROM [PAID_INVOICES]);
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetPaymentMethod]
@ActorID int,
@UserID int,
@MethodName nvarchar(50)
AS
BEGIN
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SELECT * FROM [dbo].[ecPaymentMethods]
WHERE [MethodName] = @MethodName AND [ResellerID] = @UserID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetPaymentProfile]
@ActorID int,
@ContractID nvarchar(50)
AS
BEGIN
DECLARE @IssuerID int;
SELECT
@IssuerID = ISNULL([CustomerID],[ResellerID]) FROM [dbo].[ecContracts]
WHERE
[ContractID] = @ContractID;
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @IssuerID) = 0
BEGIN
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
--
SELECT * FROM [dbo].[ecPaymentProfiles] WHERE [ContractID] = @ContractID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetPluginProperties]
@ActorID int,
@UserID int,
@PluginID int
AS
BEGIN
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
SET NOCOUNT ON;
SELECT [PropertyName], [PropertyValue] FROM [dbo].[ecPluginsProperties]
WHERE [PluginID] = @PluginID AND [ResellerID] = @UserID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetProductCategories]
@UserID int,
@ProductID int
AS
BEGIN
SELECT
[C].*
FROM
[dbo].[ecCategories] AS [C]
INNER JOIN
[dbo].[ecProductCategories] AS [PC]
ON
[C].[CategoryID] = [PC].[CategoryID]
WHERE
[PC].[ProductID] = @ProductID
AND
[PC].[ResellerID] = @UserID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetProductCategoriesIds]
@UserID int,
@ProductID int
AS
BEGIN
SELECT [CategoryID] FROM [dbo].[ecProductCategories] WHERE [ResellerID] = @UserID AND [ProductID] = @ProductID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetProductHighlights]
@ResellerID int,
@ProductID int
AS
BEGIN
SELECT
[PH].[HighlightText]
FROM
[dbo].[ecProductsHighlights] AS [PH]
INNER JOIN
[dbo].[ecProduct] AS [P]
ON
[PH].[ProductID] = [P].[ProductID]
WHERE
[P].[ProductID] = @ProductID
AND
[P].[ResellerID] = @ResellerID
ORDER BY
[SortOrder];
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetProductsByType]
@UserID int,
@TypeID int
AS
BEGIN
SELECT * FROM [dbo].[ecProduct] WHERE [ResellerID] = @UserID AND [TypeID] = @TypeID ORDER BY [ProductName];
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetProductsCountByType]
@ActorID int,
@UserID int,
@TypeID int,
@Count int OUTPUT
AS
BEGIN
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
SELECT @Count = COUNT(*) FROM [dbo].[ecProduct] WHERE [TypeID] = @TypeID AND [ResellerID] = @UserID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetProductsPagedByType]
@ActorID int,
@UserID int,
@TypeID int,
@MaximumRows int,
@StartRowIndex int
AS
BEGIN
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
DECLARE @EndIndex int;
SET @EndIndex = @MaximumRows + @StartRowIndex;
SET @StartRowIndex = @StartRowIndex + 1;
WITH [ProductsCTE] AS (
SELECT
ROW_NUMBER() OVER(ORDER BY [Created] DESC) AS [RowIndex],
*
FROM
[dbo].[ecProduct]
WHERE
[ResellerID] = @UserID
AND
[TypeID] = @TypeID
)
SELECT * FROM [ProductsCTE] WHERE [RowIndex] BETWEEN @StartRowIndex AND @EndIndex;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetProductType]
@TypeID int
AS
BEGIN
SELECT * FROM [dbo].[ecProductType] WHERE [TypeID] = @TypeID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetProductTypeControl]
@TypeID int,
@ControlKey nvarchar(50),
@ControlSrc nvarchar(512) OUTPUT
AS
BEGIN
SET NOCOUNT ON;
SELECT
@ControlSrc = [ControlSrc]
FROM
[dbo].[ecProductTypeControls]
WHERE
[TypeID] = @TypeID
AND
[ControlKey] = @ControlKey;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetResellerPaymentMethod]
@ResellerID int,
@MethodName nvarchar(50)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SELECT
[PM].[ResellerID],
[PM].[MethodName],
[PM].[DisplayName],
[PM].[SupportedItems],
[SP].[Interactive]
FROM
[dbo].[ecPaymentMethods] AS [PM]
INNER JOIN
[dbo].[ecSupportedPlugins] AS [SP]
ON
[SP].[PluginID] = [PM].[PluginID]
WHERE
[PM].[ResellerID] = @ResellerID
AND
[PM].[MethodName] = @MethodName;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetResellerPaymentMethods]
@ResellerID int
AS
BEGIN
SELECT * FROM [dbo].[ecPaymentMethods]
WHERE [ResellerID] = @ResellerID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetResellerPMPlugin]
@ResellerID int,
@MethodName nvarchar(50)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SELECT
[SP].*
FROM
[dbo].[ecPaymentMethods] AS [PM]
INNER JOIN
[dbo].[ecSupportedPlugins] AS [SP]
ON
[SP].[PluginID] = [PM].[PluginID]
WHERE
[PM].[MethodName] = @MethodName
AND
[PM].[ResellerID] = @ResellerID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetResellerTopLevelDomain]
@ResellerID int,
@TLD nvarchar(10)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SELECT
[P].*,
[Tlds].[PluginID],
[Tlds].[WhoisEnabled]
FROM
[dbo].[ecProduct] AS [P]
INNER JOIN
[dbo].[ecTopLevelDomains] AS [Tlds]
ON
[Tlds].[ProductID] = [P].[ProductID]
WHERE
[P].[ResellerID] = @ResellerID
AND
[Tlds].[TopLevelDomain] = @TLD;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetServiceHandlersResponsesByReseller]
@ResellerID int
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SELECT
* FROM [ServiceHandlersResponsesDetailed]
WHERE
[ResellerID] = @ResellerID AND [ErrorMessage] IS NULL
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetServiceItemType]
@ServiceID int
AS
BEGIN
SELECT
[PT].* FROM [dbo].[ecProductType] AS [PT]
INNER JOIN
[dbo].[ecService] AS [S] ON [PT].[TypeID] = [S].[TypeID]
WHERE
[S].[ServiceID] = @ServiceID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetServicesToInvoice]
@ActorID int,
@ResellerID int,
@TodayDate datetime,
@DaysOffset int
AS
BEGIN
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @ResellerID) = 0
BEGIN
RAISERROR('You are not allowed to access this information', 16, 1);
RETURN;
END
SET NOCOUNT ON;
DECLARE @Svcs TABLE(
[ServiceID] int NOT NULL,
[MaxStartDate] datetime NOT NULL,
[MaxEndDate] datetime NOT NULL
);
-- filter service that don't have corresponding unpaid invoice and expired
INSERT INTO
@Svcs ([ServiceID], [MaxStartDate], [MaxEndDate])
SELECT
[SUL].[ServiceID], MAX([SUL].[StartDate]), MAX([SUL].[EndDate]) FROM [dbo].[ecSvcsUsageLog] AS [SUL]
INNER JOIN
[dbo].[ecService] AS [S] ON [SUL].[ServiceID] = [S].[ServiceID]
INNER JOIN
[dbo].[ecContracts] AS [C] ON [C].[ContractID] = [S].[ContractID]
WHERE
[C].[ResellerID] = @ResellerID
AND
ISNULL([SUL].[PeriodClosed], 0) = 0
GROUP BY
[SUL].[ServiceID];
SELECT
[S].* FROM [dbo].[ecService] AS [S]
INNER JOIN
@Svcs AS [SVCS] ON [S].[ServiceID] = [SVCS].[ServiceID]
WHERE
[S].[Status] = 1 AND @DaysOffset >= DATEDIFF(d, @TodayDate, [SVCS].[MaxEndDate])
ORDER BY
[ContractID];
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetServiceSuspendDate]
@ActorID int,
@ServiceID int,
@SuspendDate datetime OUTPUT
AS
BEGIN
DECLARE @IssuerID int, @ContractID nvarchar(50);
SELECT
@ContractID = [ContractID] FROM [dbo].[ecService]
WHERE
[ServiceID] = @ServiceID;
SELECT
@IssuerID = [ResellerID] FROM [dbo].[ecContracts]
WHERE
[ContractID] = @ContractID;
-- check actor rights
IF [dbo].[CheckUserParent](@ActorID, @IssuerID) = 0
BEGIN
RAISERROR('You are not allowed to access this information', 16, 1);
RETURN;
END
SET NOCOUNT ON;
SELECT @SuspendDate = ISNULL(MAX([EndDate]), GETDATE()) FROM [dbo].[ecSvcsUsageLog]
WHERE [ServiceID] = @ServiceID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetStoreDefaultSettings]
@SettingsName nvarchar(50)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SELECT * FROM [dbo].[ecStoreDefaultSettings]
WHERE [SettingsName] = @SettingsName;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetStorefrontCategories]
@ResellerID int,
@ParentID int
AS
BEGIN
SET NOCOUNT ON;
IF @ParentID < 1 OR @ParentID IS NULL
SET @ParentID = 0;
SELECT
*
FROM
[dbo].[ecCategory]
WHERE
[ResellerID] = @ResellerID
AND
ISNULL([ParentID], 0) = @ParentID
ORDER BY
[ItemOrder] ASC;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetStorefrontCategory]
@ResellerID int,
@CategoryID int
AS
BEGIN
SET NOCOUNT ON;
SELECT
*
FROM
[dbo].[ecCategory]
WHERE
[ResellerID] = @ResellerID
AND
[CategoryID] = @CategoryID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetStorefrontHostingPlanAddons]
@ResellerID int,
@PlanID int
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SELECT
[P].*,
[HA].*,
[HA].[2COID] AS [TCOID]
FROM
[dbo].[ecHostingAddons] AS [HA]
INNER JOIN
[dbo].[ecProduct] AS [P]
ON
[P].[ProductID] = [HA].[ProductID]
INNER JOIN
[dbo].[ecAddonProducts] AS [AP]
ON
[P].[ProductID] = [AP].[AddonID]
WHERE
[AP].[ResellerID] = @ResellerID
AND
[P].[Enabled] = 1
AND
[AP].[ProductID] = @PlanID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetStorefrontPath]
@ResellerID int,
@CategoryID int
AS
BEGIN
SET NOCOUNT ON;
WITH [PathCTE] ([CategoryID]) AS (
SELECT [ParentID] FROM [dbo].[ecCategory]
WHERE [CategoryID] = @CategoryID AND [ResellerID] = @ResellerID
UNION ALL
SELECT [ParentID] FROM [dbo].[ecCategory] AS [C]
INNER JOIN [PathCTE] AS [P] ON [C].[CategoryID] = [P].[CategoryID]
WHERE [ParentID] IS NOT NULL AND [ResellerID] = @ResellerID
)
SELECT
[CategoryID], [CategoryName]
FROM
[dbo].[ecCategory]
WHERE
(
[CategoryID] IN (
SELECT [CategoryID] FROM [PathCTE]
)
OR
[CategoryID] = @CategoryID
)
AND
[ResellerID] = @ResellerID
ORDER BY
[Level];
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetStorefrontProduct]
@ResellerID int,
@ProductID int
AS
BEGIN
SET NOCOUNT ON;
SELECT
*
FROM
[dbo].[ecProduct]
WHERE
[ProductID] = @ProductID
AND
[ResellerID] = @ResellerID
AND
[Enabled] = 1;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetStorefrontProductsByType]
@UserID int,
@TypeID int
AS
BEGIN
SELECT
*
FROM
[dbo].[ecProduct]
WHERE
[ResellerID] = @UserID
AND
[TypeID] = @TypeID
AND
[Enabled] = 1
ORDER BY
[ProductName] ASC;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetStorefrontProductsInCategory]
@ResellerID int,
@CategoryID int
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SELECT
[P].*
FROM
[dbo].[ecProduct] AS [P]
INNER JOIN
[dbo].[ecProductCategories] AS [PC]
ON
[P].[ProductID] = [PC].[ProductID]
WHERE
[PC].[CategoryID] = @CategoryID
AND
[P].[ResellerID] = @ResellerID
AND
[P].[Enabled] = 1;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetStoreSettings]
@ResellerID int,
@SettingsName nvarchar(50)
AS
BEGIN
SET NOCOUNT ON;
SELECT * FROM [dbo].[ecStoreSettings]
WHERE [SettingsName] = @SettingsName AND [ResellerID] = @ResellerID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetSupportedPlugin]
@PluginName nvarchar(50),
@GroupName nvarchar(50)
AS
BEGIN
SELECT * FROM [dbo].[ecSupportedPlugins]
WHERE [PluginName] = @PluginName AND [PluginGroup] = @GroupName;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetSupportedPluginByID]
@PluginID int
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SELECT * FROM [dbo].[ecSupportedPlugins] WHERE [PluginID] = @PluginID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetSupportedPluginsByGroup]
@GroupName nvarchar(50)
AS
BEGIN
SELECT * FROM [dbo].[ecSupportedPlugins]
WHERE [PluginGroup] = @GroupName
ORDER BY [DisplayName];
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetSvcsSuspendDateAligned]
@ResellerID int,
@SvcsXml xml,
@DefaultValue datetime,
@Result datetime OUTPUT
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SELECT
@Result = MAX([SUL].[EndDate]) FROM [dbo].[ecSvcsUsageLog] AS [SUL]
INNER JOIN
[dbo].[ecService] AS [S] ON [SUL].[ServiceID] = [S].[ServiceID]
INNER JOIn
[dbo].[ecContracts] AS [C] ON [C].[ContractID] = [S].[ContractID]
WHERE
[C].[ResellerID] = @ResellerID
AND
[S].[ServiceID] IN (SELECT [SXML].[Data].value('@id','int') FROM @SvcsXml.nodes('/Svcs/Svc') [SXML]([Data]));
-- result is empty
SET @Result = ISNULL(@Result, @DefaultValue);
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetSystemTrigger]
@ActorID int,
@ReferenceID nvarchar(50),
@Namespace nvarchar(255)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SELECT
* FROM [dbo].[ecSystemTriggers]
WHERE
[OwnerID] = @ActorID AND [ReferenceID] = @ReferenceID AND [Namespace] = @Namespace;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetTaxation]
@ActorID int,
@UserID int,
@TaxationID int
AS
BEGIN
--
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
--
SELECT * FROM [dbo].[ecTaxations] WHERE [ResellerID] = @UserID AND [TaxationID] = @TaxationID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetTaxationsCount]
@ActorID int,
@UserID int,
@Result int OUTPUT
AS
BEGIN
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SELECT @Result = COUNT([TaxationID]) FROM [dbo].[ecTaxations] WHERE [ResellerID] = @UserID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetTaxationsPaged]
@ActorID int,
@UserID int,
@MaximumRows int,
@StartRowIndex int
AS
BEGIN
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- do some calculations
DECLARE @EndIndex int;
--
SET @EndIndex = @MaximumRows + @StartRowIndex;
SET @StartRowIndex = @StartRowIndex + 1;
--
WITH [TaxesCTE] AS (
SELECT
ROW_NUMBER() OVER(ORDER BY [TaxationID] ASC) AS [RowIndex],
*
FROM
[dbo].[ecTaxations]
WHERE
[ResellerID] = @UserID
)
--
SELECT * FROM [TaxesCTE] WHERE [RowIndex] BETWEEN @StartRowIndex AND @EndIndex;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetTopLevelDomain]
@ActorID int,
@UserID int,
@ProductID int
AS
BEGIN
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
SELECT
[P].*,
[Tlds].[PluginID],
[Tlds].[WhoisEnabled],
[PLG].[DisplayName]
FROM
[dbo].[ecProduct] AS [P]
INNER JOIN
[dbo].[ecTopLevelDomains] AS [Tlds]
ON
[Tlds].[ProductID] = [P].[ProductID]
INNER JOIN
[dbo].[ecSupportedPlugins] AS [PLG]
ON
[PLG].[PluginID] = [Tlds].[PluginID]
WHERE
[P].[ResellerID] = @UserID
AND
[P].[ProductID] = @ProductID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetTopLevelDomainCycles]
@UserID int,
@ProductID int
AS
BEGIN
SELECT
[BC].*,
[TLDC].[ProductID],
[TLDC].[SetupFee],
[TLDC].[RecurringFee],
[TLDC].[TransferFee]
FROM
[dbo].[ecTopLevelDomainsCycles] AS [TLDC]
INNER JOIN
[dbo].[ecBillingCycles] AS [BC]
ON
[BC].[CycleID] = [TLDC].[CycleID]
INNER JOIN
[dbo].[ecProduct] AS [PR]
ON
[TLDC].[ProductID] = [PR].[ProductID]
WHERE
[PR].[ResellerID] = @UserID
AND
[TLDC].[ProductID] = @ProductID
ORDER BY
[TLDC].[SortOrder];
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetTopLevelDomainsPaged]
@ActorID int,
@UserID int,
@MaximumRows int,
@StartRowIndex int
AS
BEGIN
DECLARE @EndIndex int;
SET @EndIndex = @MaximumRows + @StartRowIndex;
SET @StartRowIndex = @StartRowIndex + 1;
WITH [TldsCTE] AS (
SELECT
ROW_NUMBER() OVER(ORDER BY [Created] DESC) AS [RowIndex],
*
FROM
[dbo].[ecProduct]
WHERE
[ResellerID] = @UserID
AND
[TypeID] = 3 -- Top Level Domain
)
SELECT
[TldsCTE].*,
[Tlds].[PluginId],
[PLG].[DisplayName]
FROM
[TldsCTE]
INNER JOIN
[dbo].[ecTopLevelDomains] AS [Tlds]
ON
[Tlds].[ProductID] = [TldsCTE].[ProductID]
INNER JOIN
[dbo].[ecSupportedPlugins] AS [PLG]
ON
[PLG].[PluginID] = [Tlds].[PluginID]
WHERE
[TldsCTE].[RowIndex] BETWEEN @StartRowIndex AND @EndIndex;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetUnpaidInvoices]
@ActorID int,
@ResellerID int
AS
BEGIN
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @ResellerID) = 0
BEGIN
RAISERROR('You are not allowed to access this information', 16, 1);
RETURN;
END
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- lookup for paid invoices
WITH [UNPAID_INVOICES] ([InvoiceID]) AS
(
SELECT
[I].[InvoiceID]
FROM
[dbo].[ecInvoice] AS [I]
INNER JOIN
[dbo].[ecContracts] AS [C] ON [C].[ContractID] = [I].[ContractID]
WHERE
[C].[ResellerID] = @ResellerID
EXCEPT
SELECT
[InvoiceID]
FROM
[dbo].[ecCustomersPayments] AS [CP]
INNER JOIN
[dbo].[ecContracts] AS [C] ON [C].[ContractID] = [CP].[ContractID]
WHERE
[C].[ResellerID] = @ResellerID
)
-- select unpaid invoices
SELECT * FROM [dbo].[ecInvoice] WHERE [InvoiceID] IN (
SELECT [InvoiceID] FROM [UNPAID_INVOICES]
);
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecGetWholeCategoriesSet]
@ActorID int,
@UserID int
AS
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
SELECT * FROM [dbo].[ecCategory] WHERE [ResellerID] = @UserID ORDER BY [CategoryName];
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecIsSupportedPluginActive]
@ActorID int,
@ResellerID int,
@PluginID int,
@Active bit OUTPUT
AS
BEGIN
-- check user parent
IF [dbo].[CheckUserParent](@ActorID, @ResellerID) = 0
BEGIN
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
IF EXISTS(SELECT * FROM [dbo].[ecPluginsProperties]
WHERE [ResellerID] = @ResellerID AND [PluginID] = @PluginID)
BEGIN
SET @Active = 1;
RETURN;
END
SET @Active = 0;
RETURN;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecLookupForTransaction]
@TransactionID nvarchar(255)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SELECT * FROM [dbo].[ecCustomersPayments] WHERE [TransactionID] = @TransactionID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecPaymentProfileExists]
@ActorID int,
@ContractID nvarchar(50),
@Result bit OUTPUT
AS
BEGIN
DECLARE @IssuerID int;
SELECT
@IssuerID = ISNULL([CustomerID],[ResellerID]) FROM [dbo].[ecContracts]
WHERE
[ContractID] = @ContractID;
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @IssuerID) = 0
BEGIN
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
IF EXISTS (SELECT [ContractID] FROM [dbo].[ecPaymentProfiles] WHERE [ContractID] = @ContractID)
BEGIN
SET @Result = 1;
RETURN;
END
--
SET @Result = 0;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecSetInvoiceItemProcessed]
@InvoiceID int,
@ItemID int,
@Result int OUTPUT
AS
BEGIN
SET NOCOUNT ON;
SET @Result = 0;
UPDATE
[dbo].[ecInvoiceItems]
SET
[Processed] = 1
WHERE
[InvoiceID] = @InvoiceID
AND
[ItemID] = @ItemID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecSetPaymentMethod]
@ActorID int,
@UserID int,
@MethodName nvarchar(50),
@DisplayName nvarchar(50),
@PluginID int,
@Result int OUTPUT
AS
BEGIN
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
SET @Result = -1;
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- cleanup
DELETE FROM [dbo].[ecPaymentMethods]
WHERE [ResellerID] = @UserID AND [MethodName] = @MethodName;
-- add
INSERT INTO [dbo].[ecPaymentMethods]
(
[ResellerID],
[MethodName],
[PluginID],
[DisplayName],
[SupportedItems]
)
SELECT
@UserID,
@MethodName,
@PluginID,
@DisplayName,
[SupportedItems]
FROM
[dbo].[ecSupportedPlugins]
WHERE
[PluginID] = @PluginID;
--
SET @Result = 0;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecSetPaymentProfile]
@ActorID int,
@ContractID nvarchar(50),
@PropertyNames ntext,
@PropertyValues ntext
AS
BEGIN
DECLARE @IssuerID int;
SELECT
@IssuerID = ISNULL([CustomerID],[ResellerID]) FROM [dbo].[ecContracts]
WHERE
[ContractID] = @ContractID;
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @IssuerID) = 0
BEGIN
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- cleanup first
DELETE FROM [dbo].[ecPaymentProfiles] WHERE [ContractID] = @ContractID;
--
INSERT INTO [dbo].[ecPaymentProfiles]
(
[ContractID],
[PropertyNames],
[PropertyValues]
)
VALUES
(
@ContractID,
@PropertyNames,
@PropertyValues
);
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecSetPluginProperties]
@ActorID int,
@UserID int,
@PluginID int,
@Xml ntext,
@Result int OUTPUT
AS
BEGIN
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
SET @Result = -1;
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
/*
XML Format:
<properties>
<property name="" value="" />
</properties>
*/
-- result is ok
SET @Result = 0;
--
DECLARE @XmlDocID int;
--Create an internal representation of the XML document.
EXEC sp_xml_preparedocument @XmlDocID OUTPUT, @xml;
-- cleanup
DELETE FROM [dbo].[ecPluginsProperties]
WHERE [ResellerID] = @UserID AND [PluginID] = @PluginID;
-- insert
INSERT INTO [dbo].[ecPluginsProperties]
(
[PluginID],
[ResellerID],
[PropertyName],
[PropertyValue]
)
SELECT
@PluginID,
@UserID,
[XML].[PropertyName],
[XML].[PropertyValue]
FROM OPENXML(@XmlDocID, '/properties/property',1) WITH
(
[PropertyName] nvarchar(50) '@name',
[PropertyValue] ntext '@value'
) AS [XML];
-- remove document
EXEC sp_xml_removedocument @XmlDocID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecSetStoreSettings]
@ActorID int,
@UserID int,
@SettingsName nvarchar(50),
@Xml ntext,
@Result int OUTPUT
AS
BEGIN
/*
XML Format:
<settings>
<setting name="" value="" />
</settings>
*/
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
SET @Result = -1;
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
--
SET @Result = 0;
DECLARE @docid int;
--Create an internal representation of the XML document.
EXEC sp_xml_preparedocument @docid OUTPUT, @Xml;
-- cleanup
DELETE FROM [dbo].[ecStoreSettings]
WHERE [SettingsName] = @SettingsName AND [ResellerID] = @UserID;
INSERT INTO [dbo].[ecStoreSettings]
(
[ResellerID],
[SettingsName],
[PropertyName],
[PropertyValue]
)
SELECT
@UserID,
@SettingsName,
[XML].[PropertyName],
[XML].[PropertyValue]
FROM OPENXML(@docid, '/settings/setting', 1) WITH
(
[PropertyName] nvarchar(50) '@name',
[PropertyValue] ntext '@value'
) AS [XML];
-- remove document
EXEC sp_xml_removedocument @docid;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecSetSvcsUsageRecordsClosed]
@ActorID int,
@XmlSvcs xml,
@Result int OUTPUT
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- result is ok
SET @Result = 0;
-- update all svc records
UPDATE
[dbo].[ecSvcsUsageLog]
SET
[PeriodClosed] = 1
WHERE
[ServiceID] IN (
SELECT [SXML].[Data].value('@id','int') FROM @XmlSvcs.nodes('/records/record') [SXML]([Data]));
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecUpdateBillingCycle]
@ActorID int,
@UserID int,
@CycleID int,
@CycleName nvarchar(255),
@BillingPeriod nvarchar(50),
@PeriodLength int,
@Result int OUTPUT
AS
BEGIN
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
SET @Result = -1;
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
-- update cycle details
UPDATE
[dbo].[ecBillingCycles]
SET
[CycleName] = @CycleName,
[BillingPeriod] = @BillingPeriod,
[PeriodLength] = @PeriodLength
WHERE
[ResellerID] = @UserID
AND
[CycleID] = @CycleID;
SET @Result = 0;
RETURN;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecUpdateCategory]
@ActorID int,
@UserID int,
@CategoryID int,
@CategoryName nvarchar(255),
@CategorySku nvarchar(50),
@ParentID int,
@ShortDescription ntext,
@FullDescription ntext,
@Result int OUTPUT
AS
BEGIN
-- check actor rights
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
SET @Result = -1;
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
SET NOCOUNT ON;
SET @Result = 0;
DECLARE @Level int;
IF @ParentID <= 0
SET @ParentID = NULL;
-- check whether a category exists
IF NOT EXISTS(
SELECT
[CategoryName]
FROM
[dbo].[ecCategory]
WHERE
[CategoryID] = @CategoryID
AND
[ResellerID] = @UserID
)
BEGIN
SET @Result = -1;
RETURN;
END
-- check whether the update is correct
IF @ParentID = @CategoryID
BEGIN
SET @Result = -1;
RETURN;
END
-- check consistency: sub-categories won't include a parent category
IF @ParentID IN (
SELECT
[CategoryID]
FROM
[dbo].[ecCategory]
WHERE
[ParentID] = @CategoryID
AND
[ResellerID] = @UserID
)
BEGIN
SET @Result = -1;
RETURN;
END
-- category level updates
IF @ParentID = 0
BEGIN
SET @ParentID = NULL;
SET @Level = 0;
END
ELSE
BEGIN
-- identify parent level
SELECT
@Level = [Level]
FROM
[dbo].[ecCategory]
WHERE
[CategoryID] = @ParentID
AND
[ResellerID] = @UserID;
-- increase if necessary
IF @Level >= 0
SET @Level = @Level + 1;
ELSE
SET @Level = 0;
END
-- update a category
UPDATE
[dbo].[ecCategory]
SET
[CategoryName] = @CategoryName,
[CategorySku] = @CategorySku,
[ParentID] = @ParentID,
[Level] = @Level,
[ShortDescription] = @ShortDescription,
[FullDescription] = @FullDescription,
[Modified] = GETUTCDATE(),
[ModifierID] = @ActorID
WHERE
[CategoryID] = @CategoryID
AND
[ResellerID] = @UserID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecUpdateContract]
@ContractID nvarchar(50),
@CustomerID int,
@AccountName nvarchar(50),
@Status int,
@Balance money,
@FirstName nvarchar(50),
@LastName nvarchar(50),
@Email nvarchar(255),
@CompanyName nvarchar(50),
@PropertyNames ntext,
@PropertyValues ntext,
@Result int OUTPUT
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SET @Result = 0;
IF @CustomerID < 1
SET @CustomerID = NULL;
UPDATE [dbo].[ecContracts] SET
[CustomerID] = @CustomerID,
[AccountName] = @AccountName,
[Status] = @Status,
[Balance] = @Balance,
[FirstName] = @FirstName,
[LastName] = @LastName,
[Email] = @Email,
[CompanyName] = @CompanyName,
[PropertyNames] = @PropertyNames,
[PropertyValues] = @PropertyValues
WHERE
[ContractID] = @ContractID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecUpdateCustomerPayment]
@ActorID int,
@PaymentID int,
@InvoiceID int,
@TransactionID nvarchar(255),
@Total money,
@Currency nvarchar(3),
@MethodName nvarchar(50),
@PluginID int,
@StatusID int,
@Result int OUTPUT
AS
BEGIN
DECLARE @IssuerID int, @ContractID nvarchar(50);
SELECT
@ContractID = [ContractID] FROM [dbo].[ecCustomersPayments]
WHERE
[PaymentID] = @PaymentID;
SELECT
@IssuerID = ISNULL([CustomerID],[ResellerID]) FROM [dbo].[ecContracts]
WHERE
[ContractID] = @ContractID;
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @IssuerID) = 0
BEGIN
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SET @Result = 0;
UPDATE [dbo].[ecCustomersPayments]
SET
[InvoiceID] = @InvoiceID,
[TransactionID] = @TransactionID,
[Total] = @Total,
[Currency] = @Currency,
[MethodName] = @MethodName,
[PluginID] = @PluginID,
[StatusID] = @StatusID
WHERE
[PaymentID] = @PaymentID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecUpdateDomainNameSvc]
@ActorID int,
@ServiceID int,
@ProductID int,
@Status int,
@DomainID int,
@FQDN nvarchar(64),
@PropertyNames ntext,
@PropertyValues ntext,
@Result int OUTPUT
AS
BEGIN
DECLARE @IssuerID int, @ContractID nvarchar(50);
SELECT
@ContractID = [ContractID] FROM [dbo].[ecService]
WHERE
[ServiceID] = @ServiceID;
SELECT
@IssuerID = [ResellerID] FROM [dbo].[ecContracts]
WHERE
[ContractID] = @ContractID;
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @IssuerID) = 0
BEGIN
RAISERROR('You are not allowed to access this action', 16, 1);
RETURN;
END
BEGIN TRAN UPD_TLD_SVC
-- update tld svc
UPDATE
[dbo].[ecService]
SET
[ServiceName] = @FQDN,
[Status] = @Status,
[Modified] = GETDATE()
WHERE
[ServiceID] = @ServiceID;
-- check error
IF @@ERROR <> 0
GOTO ERROR_HANDLE;
-- update tld svc
IF @DomainID < 1
SET @DomainID = NULL;
--
UPDATE
[dbo].[ecDomainSvcs]
SET
[ProductID] = @ProductID,
[DomainID] = @DomainID,
[FQDN] = @FQDN,
[PropertyNames] = @PropertyNames,
[PropertyValues] = @PropertyValues
WHERE
[ServiceID] = @ServiceID;
-- check error
IF @@ERROR <> 0
GOTO ERROR_HANDLE;
-- set result ok
SET @Result = 0;
-- commit changes
COMMIT TRAN UPD_TLD_SVC;
-- exit
RETURN;
-- error handler
ERROR_HANDLE:
BEGIN
SET @Result = -1;
ROLLBACK TRAN UPD_TLD_SVC;
RETURN;
END
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecUpdateHostingAddon]
@ActorID int,
@UserID int,
@ProductID int,
@AddonName nvarchar(255),
@ProductSku nvarchar(50),
@TaxInclusive bit,
@Enabled bit,
@PlanID int,
@Recurring bit,
@DummyAddon bit,
@Countable bit,
@Description ntext,
@AddonCyclesXml xml,
@AssignedProductsXml xml,
@Result int OUTPUT
AS
BEGIN
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
SET @Result = -1;
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
-- dummy addon clause
IF @DummyAddon = 1
SET @PlanID = NULL;
BEGIN TRAN UPDATE_ADDON
-- update product first
UPDATE [dbo].[ecProduct]
SET
[ProductName] = @AddonName,
[ProductSKU] = @ProductSku,
[Description] = @Description,
[Enabled] = @Enabled,
[TaxInclusive] = @TaxInclusive
WHERE
[ProductID] = @ProductID
AND
[ResellerID] = @UserID;
-- update hosting addon details
UPDATE [dbo].[ecHostingAddons]
SET
[PlanID] = @PlanID,
[Recurring] = @Recurring,
[DummyAddon] = @DummyAddon,
[Countable] = @Countable
WHERE
[ProductID] = @ProductID
AND
[ResellerID] = @UserID;
-- check errors
IF @@ERROR <> 0
BEGIN
GOTO ERROR_HANDLE;
END
/*
XML Format:
<PlanCycles>
<Cycle ID="2" SetupFee="2.99" RecurringFee="3.99" TCOID="1005" SortOrder="1" />
</PlanCycles>
*/
-- cleanup hosting addon cycles first
DELETE FROM [dbo].[ecHostingAddonsCycles] WHERE [ProductID] = @ProductID;
IF @Recurring = 1
-- insert cycles
INSERT INTO [dbo].[ecHostingAddonsCycles]
([ProductID], [CycleID], [SetupFee], [RecurringFee], [SortOrder])
SELECT
@ProductID,[SXML].[Data].value('@ID','int'),[SXML].[Data].value('@SetupFee','money'),
[SXML].[Data].value('@RecurringFee','money'), [SXML].[Data].value('@SortOrder','int')
FROM @AddonCyclesXml.nodes('/PlanCycles/Cycle') [SXML]([Data]);
-- check errors
IF @@ERROR <> 0
GOTO ERROR_HANDLE;
ELSE
UPDATE
[dbo].[ecHostingAddons]
SET
[SetupFee] = [SXML].[Data].value('@SetupFee','money'),
[OneTimeFee] = [SXML].[Data].value('@OneTimeFee','money')
FROM @AddonCyclesXml.nodes('/PlanCycles/Cycle') [SXML]([Data])
WHERE
[ResellerID] = @UserID
AND
[ProductID] = @ProductID;
-- check errors
IF @@ERROR <> 0
GOTO ERROR_HANDLE;
/*
XML Format:
<AssignedProducts>
<Product ID="25" />
</AssignedProducts>
*/
-- cleanup addon products first
DELETE FROM [dbo].[ecAddonProducts] WHERE [AddonID] = @ProductID AND [ResellerID] = @UserID;
-- insert cycles
INSERT INTO [dbo].[ecAddonProducts]
([AddonID], [ProductID], [ResellerID])
SELECT
@ProductID,[SXML].[Data].value('@ID','int'),@UserID
FROM @AssignedProductsXml.nodes('/AssignedProducts/Product') [SXML]([Data]);
-- check errors
IF @@ERROR <> 0
GOTO ERROR_HANDLE;
-- set result ok
SET @Result = 0;
--
COMMIT TRAN UPDATE_ADDON;
--
RETURN;
ERROR_HANDLE:
BEGIN
SET @Result = -1;
ROLLBACK TRAN UPDATE_ADDON;
RETURN;
END
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[ecUpdateHostingAddonSvc]
@ActorID int,
@ServiceID int,
@ProductID int,
@AddonName nvarchar(255),
@Status int,
@PlanID int,
@PackageAddonID int,
@Recurring bit,
@DummyAddon bit,
@Result int OUTPUT
AS
BEGIN
DECLARE @IssuerID int, @ContractID nvarchar(50);
SELECT
@ContractID = [ContractID] FROM [dbo].[ecService]
WHERE
[ServiceID] = @ServiceID;
SELECT
@IssuerID = [ResellerID] FROM [dbo].[ecContracts]
WHERE
[ContractID] = @ContractID;
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @IssuerID) = 0
BEGIN
RAISERROR('You are not allowed to access this action', 16, 1);
RETURN;
END
IF @PlanID < 1
SET @PlanID = NULL;
BEGIN TRAN UPD_HADDON_SVC
-- update addon svc
UPDATE
[dbo].[ecService]
SET
[ServiceName] = @AddonName,
[Status] = @Status,
[Modified] = GETDATE()
WHERE
[ServiceID] = @ServiceID;
-- check error
IF @@ERROR <> 0
GOTO ERROR_HANDLE;
-- update addon svc
IF @PackageAddonID < 1
SET @PackageAddonID = NULL;
--
UPDATE
[dbo].[ecHostingAddonSvcs]
SET
[ProductID] = @ProductID,
[PlanID] = @PlanID,
[PackageAddonID] = @PackageAddonID,
[Recurring] = @Recurring,
[DummyAddon] = @DummyAddon
WHERE
[ServiceID] = @ServiceID;
-- check error
IF @@ERROR <> 0
GOTO ERROR_HANDLE;
-- set result ok
SET @Result = 0;
-- commit changes
COMMIT TRAN UPD_HADDON_SVC;
-- exit
RETURN;
-- error handler
ERROR_HANDLE:
BEGIN
SET @Result = -1;
ROLLBACK TRAN UPD_HADDON_SVC;
RETURN;
END
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecUpdateHostingPlan]
@ActorID int,
@UserID int,
@ProductID int,
@PlanName nvarchar(255),
@ProductSku nvarchar(50),
@TaxInclusive bit,
@PlanID int,
@UserRole int,
@InitialStatus int,
@DomainOption int,
@Enabled bit,
@PlanDescription ntext,
@PlanCyclesXml xml,
@PlanHighlightsXml xml,
@PlanCategoriesXml xml,
@Result int OUTPUT
AS
BEGIN
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
SET @Result = -1;
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
BEGIN TRAN UPDATE_PLAN
-- update product first
UPDATE
[dbo].[ecProduct]
SET
[ProductName] = @PlanName,
[ProductSKU] = @ProductSku,
[Description] = @PlanDescription,
[Enabled] = @Enabled,
[TaxInclusive] = @TaxInclusive
WHERE
[ResellerID] = @UserID AND [ProductID] = @ProductID AND [TypeID] = 1;
-- update hosting plan details
UPDATE
[dbo].[ecHostingPlans]
SET
[PlanID] = @PlanID,
[UserRole] = @UserRole,
[InitialStatus] = @InitialStatus,
[DomainOption] = @DomainOption
WHERE
[ResellerID] = @UserID AND [ProductID] = @ProductID;
-- check errors
IF @@ERROR <> 0
BEGIN
GOTO ERROR_HANDLE;
END
/*
XML Format:
<PlanCycles>
<Cycle ID="2" SetupFee="2.99" RecurringFee="3.99" SortOrder="1" />
</PlanCycles>
*/
-- cleanup cycles
DELETE FROM [dbo].[ecHostingPlansBillingCycles] WHERE [ProductID] = @ProductID;
-- insert cycles
INSERT INTO [dbo].[ecHostingPlansBillingCycles]
([ProductID], [CycleID], [SetupFee], [RecurringFee], [SortOrder])
SELECT
@ProductID,[SXML].[Data].value('@ID','int'),[SXML].[Data].value('@SetupFee','money'),
[SXML].[Data].value('@RecurringFee','money'), [SXML].[Data].value('@SortOrder','int')
FROM @PlanCyclesXml.nodes('/PlanCycles/Cycle') [SXML]([Data]);
-- check errors
IF @@ERROR <> 0
GOTO ERROR_HANDLE;
/*
XML Format:
<PlanHighlights>
<Item Text="My Highlight Text" SortOrder="0" />
</PlanHighlights>
*/
-- cleanup highlights
DELETE FROM [dbo].[ecProductsHighlights] WHERE [ProductID] = @ProductID;
-- insert cycles
INSERT INTO [dbo].[ecProductsHighlights]
([ProductID], [HighlightText], [SortOrder])
SELECT
@ProductID, [SXML].[Data].value('@Text','nvarchar(255)'), [SXML].[Data].value('@SortOrder','int')
FROM @PlanHighlightsXml.nodes('/PlanHighlights/Item') [SXML]([Data]);
-- check errors
IF @@ERROR <> 0
GOTO ERROR_HANDLE;
/*
XML Format:
<PlanCategories>
<Category ID="2" />
</PlanCategories>
*/
-- cleanup categories
DELETE FROM [dbo].[ecProductCategories] WHERE [ProductID] = @ProductID;
-- insert categories
INSERT INTO [dbo].[ecProductCategories]
([ProductID], [CategoryID], [ResellerID])
SELECT
@ProductID, [SXML].[Data].value('@ID','int'), @UserID
FROM @PlanCategoriesXml.nodes('/PlanCategories/Category') [SXML]([Data]);
-- check errors
IF @@ERROR <> 0
GOTO ERROR_HANDLE;
--
SET @Result = 0;
-- commit changes
COMMIT TRAN UPDATE_PLAN;
-- exit
RETURN;
ERROR_HANDLE:
BEGIN
SET @Result = -1;
ROLLBACK TRAN UPDATE_PLAN;
RETURN;
END
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecUpdateHostingPlanSvc]
@ActorID int,
@ServiceID int,
@ProductID int,
@PlanName nvarchar(255),
@Status int,
@PlanID int,
@PackageID int,
@UserRole int,
@InitialStatus int,
@Result int OUTPUT
AS
BEGIN
DECLARE @IssuerID int, @ContractID nvarchar(50);
SELECT
@ContractID = [ContractID] FROM [dbo].[ecService]
WHERE
[ServiceID] = @ServiceID;
SELECT
@IssuerID = [ResellerID] FROM [dbo].[ecContracts]
WHERE
[ContractID] = @ContractID;
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @IssuerID) = 0
BEGIN
RAISERROR('You are not allowed to access this action', 16, 1);
RETURN;
END
BEGIN TRAN UPD_HPLAN_SVC
-- update plan svc
UPDATE
[dbo].[ecService]
SET
[ServiceName] = @PlanName,
[Status] = @Status,
[Modified] = GETDATE()
WHERE
[ServiceID] = @ServiceID;
-- check error
IF @@ERROR <> 0
GOTO ERROR_HANDLE;
-- update package svc
IF @PackageID < 1
SET @PackageID = NULL;
--
UPDATE
[dbo].[ecHostingPackageSvcs]
SET
[ProductID] = @ProductID,
[PlanID] = @PlanID,
[PackageID] = @PackageID,
[UserRole] = @UserRole,
[InitialStatus] = @InitialStatus
WHERE
[ServiceID] = @ServiceID;
-- check error
IF @@ERROR <> 0
GOTO ERROR_HANDLE;
-- set result ok
SET @Result = 0;
-- commit changes
COMMIT TRAN UPD_HPLAN_SVC;
-- exit
RETURN;
-- error handler
ERROR_HANDLE:
BEGIN
SET @Result = -1;
ROLLBACK TRAN UPD_HPLAN_SVC;
RETURN;
END
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecUpdateInvoice]
@ActorID int,
@InvoiceID int,
@InvoiceNumber nvarchar(50),
@DueDate datetime,
@TaxationID int,
@Total money,
@SubTotal money,
@TaxAmount money,
@Currency nvarchar(3),
@Result int OUTPUT
AS
BEGIN
-- ensure an update request has been issued by the right person
DECLARE @ContractID nvarchar(50), @IssuerID int;
SELECT
@ContractID = [ContractID] FROM [dbo].[ecInvoice]
WHERE
[InvoiceID] = @InvoiceID;
SELECT
@IssuerID = [ResellerID] FROM [dbo].[ecContracts]
WHERE
[ContractID] = @ContractID;
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @IssuerID) = 0
BEGIN
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
SET NOCOUNT ON;
SET @Result = 0;
UPDATE
[dbo].[ecInvoice]
SET
[InvoiceNumber] = @InvoiceNumber,
[DueDate] = @DueDate,
[Total] = @Total,
[SubTotal] = @SubTotal,
[TaxationID] = @TaxationID,
[TaxAmount] = @TaxAmount,
[Currency] = @Currency
WHERE
[InvoiceID] = @InvoiceID
AND
[ContractID] = @ContractID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecUpdateServiceHandlersResponses]
@ResellerID int,
@XmlData xml
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
/*
<Succeed>
<Response ID="" />
</Succeed>
<Failed>
<Response ID="" Error="" />
</Failed>
*/
DELETE
FROM [ecServiceHandlersResponses]
WHERE
[ResponseID] IN (SELECT [SXML].[Data].value('@ID','int') FROM @XmlData.nodes('/Succeed/Response') [SXML]([Data]))
UPDATE
[ecServiceHandlersResponses]
SET
[ErrorMessage] = [SXML].[Data].value('@Error','nvarchar(255)')
FROM @XmlData.nodes('/Failed/Response') [SXML]([Data])
WHERE
[ResponseID] = [SXML].[Data].value('@ID', 'int')
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecUpdateSystemTrigger]
@ActorID int,
@TriggerID nvarchar(50),
@TriggerHandler nvarchar(512),
@ReferenceID nvarchar(50),
@Namespace nvarchar(255),
@Status nvarchar(50)
AS
BEGIN
DECLARE @OwnerID int;
SELECT
@OwnerID = [OwnerID] FROM [dbo].[ecSystemTriggers]
WHERE
[TriggerID] = @TriggerID;
--
IF [dbo].[CheckUserParent](@ActorID, @OwnerID) = 0
BEGIN
RAISERROR('You are not allowed to perform this action', 16, 1);
RETURN;
END
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
UPDATE [dbo].[ecSystemTriggers] SET
[TriggerHandler] = @TriggerHandler,
[ReferenceID] = @ReferenceID,
[Namespace] = @Namespace,
[Status] = @Status
WHERE
[TriggerID] = @TriggerID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecUpdateTaxation]
@ActorID int,
@UserID int,
@TaxationID int,
@Country nvarchar(3),
@State nvarchar(50),
@Description nvarchar(50),
@TypeID int,
@Amount decimal(5,2),
@Active bit,
@Result int OUTPUT
AS
BEGIN
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
--
DECLARE @T_TaxationID int;
--
SELECT @T_TaxationID = [TaxationID] FROM [dbo].[ecTaxations] WHERE [ResellerID] = @UserID AND [Country] = @Country AND [State] = @State;
--
SET @T_TaxationID = ISNULL(@T_TaxationID, @TaxationID);
--
IF @T_TaxationID = @TaxationID
BEGIN
-- insert
UPDATE
[dbo].[ecTaxations]
SET
[Country] = @Country,
[State] = @State,
[Description] = @Description,
[TypeID] = @TypeID,
[Amount] = @Amount,
[Active] = @Active
WHERE
[ResellerID] = @UserID
AND
[TaxationID] = @TaxationID;
--
SET @Result = 0;
--
RETURN;
END
-- taxation update error
SET @Result = -202;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecUpdateTopLevelDomain]
@ActorID int,
@UserID int,
@ProductID int,
@TopLevelDomain nvarchar(10),
@ProductSku nvarchar(50),
@TaxInclusive bit,
@PluginID int,
@Enabled bit,
@WhoisEnabled bit,
@DomainCyclesXml xml,
@Result int OUTPUT
AS
BEGIN
-- check actor user rights
IF [dbo].[CheckUserParent](@ActorID, @UserID) = 0
BEGIN
SET @Result = -1;
RAISERROR('You are not allowed to access this account', 16, 1);
RETURN;
END
BEGIN TRAN UPDATE_DOMAIN
-- insert product first
UPDATE
[dbo].[ecProduct]
SET
[ProductName] = @TopLevelDomain,
[ProductSKU] = @ProductSku,
[Enabled] = @Enabled,
[TaxInclusive] = @TaxInclusive
WHERE
[ResellerID] = @UserID
AND
[ProductID] = @ProductID;
-- save top level domain details
UPDATE
[dbo].[ecTopLevelDomains]
SET
[TopLevelDomain] = @TopLevelDomain,
[PluginID] = @PluginID,
[WhoisEnabled] = @WhoisEnabled
WHERE
[ResellerID] = @UserID
AND
[ProductID] = @ProductID;
-- check errors
IF @@ERROR <> 0
BEGIN
GOTO ERROR_HANDLE;
END
/*
XML Format:
<DomainCycles>
<Cycle ID="2" SetupFee="2.99" RecurringFee="3.99" TransferFee="3.99" TCOID="1005" SortOrder="1" />
</DomainCycles>
*/
-- cleanup cycles
DELETE FROM [dbo].[ecTopLevelDomainsCycles] WHERE [ProductID] = @ProductID;
-- insert cycles
INSERT INTO [dbo].[ecTopLevelDomainsCycles]
(
[ProductID],
[CycleID],
[SetupFee],
[RecurringFee],
[TransferFee],
[SortOrder]
)
SELECT
@ProductID,
[SXML].[Data].value('@ID','int'),
[SXML].[Data].value('@SetupFee','money'),
[SXML].[Data].value('@RecurringFee','money'),
[SXML].[Data].value('@TransferFee','money'),
[SXML].[Data].value('@SortOrder','int')
FROM @DomainCyclesXml.nodes('/DomainCycles/Cycle') [SXML]([Data]);
-- check errors
IF @@ERROR <> 0
BEGIN
GOTO ERROR_HANDLE;
END
--
SET @Result = 0;
--
COMMIT TRAN UPDATE_DOMAIN;
--
RETURN;
ERROR_HANDLE:
BEGIN
SET @Result = -1;
ROLLBACK TRAN UPDATE_DOMAIN;
RETURN;
END
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecVoidCustomerInvoice]
@ActorID int,
@InvoiceID int
AS
BEGIN
-- load customer and reseller identities
DECLARE @ContractID nvarchar(50), @IssuerID int;
SELECT
@ContractID = [ContractID] FROM [dbo].[ecInvoice]
WHERE
[InvoiceID] = @InvoiceID;
SELECT
@IssuerID = [ResellerID] FROM [dbo].[ecContracts]
WHERE
[ContractID] = @ContractID;
-- check actor rights
IF [dbo].[CheckUserParent](@ActorID, @IssuerID) = 0
BEGIN
RAISERROR('You are not allowed to access the contract', 16, 1);
RETURN;
END
--
SET NOCOUNT ON;
-- void invoice
DELETE FROM [dbo].[ecInvoice] WHERE [InvoiceID] = @InvoiceID;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ecWriteSupportedPluginLog]
@ContractID nvarchar(50),
@PluginID int,
@RecordType int,
@RawData ntext,
@Result int OUTPUT
AS
BEGIN
SET NOCOUNT ON;
INSERT INTO [dbo].[ecSupportedPluginLog]
(
[PluginID],
[ContractID],
[RecordType],
[RawData]
)
VALUES
(
@PluginID,
@ContractID,
@RecordType,
@RawData
);
SET @Result = SCOPE_IDENTITY();
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ExchangeAccountEmailAddressExists]
(
@EmailAddress nvarchar(300),
@Exists bit OUTPUT
)
AS
SET @Exists = 0
IF EXISTS(SELECT * FROM [dbo].[ExchangeAccountEmailAddresses] WHERE [EmailAddress] = @EmailAddress)
BEGIN
SET @Exists = 1
END
ELSE IF EXISTS(SELECT * FROM [dbo].[ExchangeAccounts] WHERE [PrimaryEmailAddress] = @EmailAddress AND [AccountType] <> 2)
BEGIN
SET @Exists = 1
END
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[ExchangeAccountExists]
(
@AccountName nvarchar(20),
@Exists bit OUTPUT
)
AS
SET @Exists = 0
IF EXISTS(SELECT * FROM ExchangeAccounts WHERE sAMAccountName LIKE '%\'+@AccountName)
BEGIN
SET @Exists = 1
END
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE ExchangeOrganizationDomainExists
(
@DomainID int,
@Exists bit OUTPUT
)
AS
SET @Exists = 0
IF EXISTS(SELECT * FROM ExchangeOrganizationDomains WHERE DomainID = @DomainID)
BEGIN
SET @Exists = 1
END
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE ExchangeOrganizationExists
(
@OrganizationID nvarchar(10),
@Exists bit OUTPUT
)
AS
SET @Exists = 0
IF EXISTS(SELECT * FROM ExchangeOrganizations WHERE OrganizationID = @OrganizationID)
BEGIN
SET @Exists = 1
END
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetAllServers]
(
@ActorID int
)
AS
-- check rights
DECLARE @IsAdmin bit
SET @IsAdmin = dbo.CheckIsUserAdmin(@ActorID)
SELECT
S.ServerID,
S.ServerName,
S.ServerUrl,
(SELECT COUNT(SRV.ServiceID) FROM VirtualServices AS SRV WHERE S.ServerID = SRV.ServerID) AS ServicesNumber,
S.Comments
FROM Servers AS S
WHERE @IsAdmin = 1
ORDER BY S.VirtualServer, S.ServerName
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetAuditLogRecord]
(
@RecordID varchar(32)
)
AS
SELECT
L.RecordID,
L.SeverityID,
L.StartDate,
L.FinishDate,
L.ItemID,
L.SourceName,
L.TaskName,
L.ItemName,
L.ExecutionLog,
ISNULL(L.UserID, 0) AS UserID,
L.Username,
U.FirstName,
U.LastName,
U.FullName,
ISNULL(U.RoleID, 0) AS RoleID,
U.Email
FROM AuditLog AS L
LEFT OUTER JOIN UsersDetailed AS U ON L.UserID = U.UserID
WHERE RecordID = @RecordID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetAuditLogRecordsPaged]
(
@ActorID int,
@UserID int,
@PackageID int,
@ItemID int,
@ItemName nvarchar(100),
@StartDate datetime,
@EndDate datetime,
@SeverityID int,
@SourceName varchar(100),
@TaskName varchar(100),
@SortColumn nvarchar(50),
@StartRow int,
@MaximumRows int
)
AS
-- check rights
IF dbo.CheckActorUserRights(@ActorID, @UserID) = 0
RAISERROR('You are not allowed to access this account', 16, 1)
IF @SourceName IS NULL SET @SourceName = ''
IF @TaskName IS NULL SET @TaskName = ''
IF @ItemName IS NULL SET @ItemName = ''
IF @SortColumn IS NULL OR @SortColumn = ''
SET @SortColumn = 'L.StartDate DESC'
-- build query and run it to the temporary table
DECLARE @sql nvarchar(2000)
SET @sql = '
DECLARE @IsAdmin bit
SET @IsAdmin = 0
IF EXISTS(SELECT UserID FROM Users WHERE UserID = @ActorID AND RoleID = 1)
SET @IsAdmin = 1
DECLARE @EndRow int
SET @EndRow = @StartRow + @MaximumRows
DECLARE @Records TABLE
(
ItemPosition int IDENTITY(1,1),
RecordID varchar(32)
)
INSERT INTO @Records (RecordID)
SELECT
L.RecordID
FROM AuditLog AS L
WHERE
((@PackageID = 0 AND dbo.CheckUserParent(@UserID, L.UserID) = 1 OR (L.UserID IS NULL AND @IsAdmin = 1))
OR (@PackageID > 0 AND L.PackageID = @PackageID))
AND L.StartDate BETWEEN @StartDate AND @EndDate
AND ((@SourceName = '''') OR (@SourceName <> '''' AND L.SourceName = @SourceName))
AND ((@TaskName = '''') OR (@TaskName <> '''' AND L.TaskName = @TaskName))
AND ((@ItemID = 0) OR (@ItemID > 0 AND L.ItemID = @ItemID))
AND ((@ItemName = '''') OR (@ItemName <> '''' AND L.ItemName LIKE @ItemName))
AND ((@SeverityID = -1) OR (@SeverityID > -1 AND L.SeverityID = @SeverityID)) '
IF @SortColumn <> '' AND @SortColumn IS NOT NULL
SET @sql = @sql + ' ORDER BY ' + @SortColumn + ' '
SET @sql = @sql + ' SELECT COUNT(RecordID) FROM @Records;
SELECT
TL.RecordID,
L.SeverityID,
L.StartDate,
L.FinishDate,
L.ItemID,
L.SourceName,
L.TaskName,
L.ItemName,
L.ExecutionLog,
ISNULL(L.UserID, 0) AS UserID,
L.Username,
U.FirstName,
U.LastName,
U.FullName,
ISNULL(U.RoleID, 0) AS RoleID,
U.Email,
CASE U.IsPeer
WHEN 1 THEN U.OwnerID
ELSE U.UserID
END EffectiveUserID
FROM @Records AS TL
INNER JOIN AuditLog AS L ON TL.RecordID = L.RecordID
LEFT OUTER JOIN UsersDetailed AS U ON L.UserID = U.UserID
WHERE TL.ItemPosition BETWEEN @StartRow + 1 AND @EndRow'
exec sp_executesql @sql, N'@TaskName varchar(100), @SourceName varchar(100), @PackageID int, @ItemID int, @ItemName nvarchar(100), @StartDate datetime,
@EndDate datetime, @StartRow int, @MaximumRows int, @UserID int, @ActorID int, @SeverityID int',
@TaskName, @SourceName, @PackageID, @ItemID, @ItemName, @StartDate, @EndDate, @StartRow, @MaximumRows, @UserID, @ActorID,
@SeverityID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetAuditLogSources
AS
SELECT SourceName FROM AuditLogSources
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetAuditLogTasks
(
@SourceName varchar(100)
)
AS
IF @SourceName = '' SET @SourceName = NULL
SELECT SourceName, TaskName FROM AuditLogTasks
WHERE (@SourceName = NULL OR @SourceName IS NOT NULL AND SourceName = @SourceName)
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetAvailableVirtualServices
(
@ActorID int,
@ServerID int
)
AS
-- check rights
DECLARE @IsAdmin bit
SET @IsAdmin = dbo.CheckIsUserAdmin(@ActorID)
SELECT
S.ServerID,
S.ServerName,
S.Comments
FROM Servers AS S
WHERE
VirtualServer = 0 -- get only physical servers
AND @IsAdmin = 1
-- services
SELECT
ServiceID,
ServerID,
ProviderID,
ServiceName,
Comments
FROM Services
WHERE
ServiceID NOT IN (SELECT ServiceID FROM VirtualServices WHERE ServerID = @ServerID)
AND @IsAdmin = 1
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetBlackBerryUsers]
(
@ItemID int,
@SortColumn nvarchar(40),
@SortDirection nvarchar(20),
@Name nvarchar(400),
@Email nvarchar(400),
@StartRow int,
@Count int
)
AS
IF (@Name IS NULL)
BEGIN
SET @Name = '%'
END
IF (@Email IS NULL)
BEGIN
SET @Email = '%'
END
CREATE TABLE #TempBlackBerryUsers
(
[ID] [int] IDENTITY(1,1) NOT NULL,
[AccountID] [int],
[ItemID] [int] NOT NULL,
[AccountName] [nvarchar](300) NOT NULL,
[DisplayName] [nvarchar](300) NOT NULL,
[PrimaryEmailAddress] [nvarchar](300) NULL,
[SamAccountName] [nvarchar](100) NULL
)
IF (@SortColumn = 'DisplayName')
BEGIN
INSERT INTO
#TempBlackBerryUsers
SELECT
ea.AccountID,
ea.ItemID,
ea.AccountName,
ea.DisplayName,
ea.PrimaryEmailAddress,
ea.SamAccountName
FROM
ExchangeAccounts ea
INNER JOIN
BlackBerryUsers bu
ON
ea.AccountID = bu.AccountID
WHERE
ea.ItemID = @ItemID AND ea.DisplayName LIKE @Name AND ea.PrimaryEmailAddress LIKE @Email
ORDER BY
ea.DisplayName
END
ELSE
BEGIN
INSERT INTO
#TempBlackBerryUsers
SELECT
ea.AccountID,
ea.ItemID,
ea.AccountName,
ea.DisplayName,
ea.PrimaryEmailAddress,
ea.SamAccountName
FROM
ExchangeAccounts ea
INNER JOIN
BlackBerryUsers bu
ON
ea.AccountID = bu.AccountID
WHERE
ea.ItemID = @ItemID AND ea.DisplayName LIKE @Name AND ea.PrimaryEmailAddress LIKE @Email
ORDER BY
ea.PrimaryEmailAddress
END
DECLARE @RetCount int
SELECT @RetCount = COUNT(ID) FROM #TempBlackBerryUsers
IF (@SortDirection = 'ASC')
BEGIN
SELECT * FROM #TempBlackBerryUsers
WHERE ID > @StartRow AND ID <= (@StartRow + @Count)
END
ELSE
BEGIN
IF (@SortColumn = 'DisplayName')
BEGIN
SELECT * FROM #TempBlackBerryUsers
WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY DisplayName DESC
END
ELSE
BEGIN
SELECT * FROM #TempBlackBerryUsers
WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY PrimaryEmailAddress DESC
END
END
DROP TABLE #TempBlackBerryUsers
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetBlackBerryUsersCount]
(
@ItemID int,
@Name nvarchar(400),
@Email nvarchar(400)
)
AS
IF (@Name IS NULL)
BEGIN
SET @Name = '%'
END
IF (@Email IS NULL)
BEGIN
SET @Email = '%'
END
SELECT
COUNT(ea.AccountID)
FROM
ExchangeAccounts ea
INNER JOIN
BlackBerryUsers bu
ON
ea.AccountID = bu.AccountID
WHERE
ea.ItemID = @ItemID AND ea.DisplayName LIKE @Name AND ea.PrimaryEmailAddress LIKE @Email
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetCertificatesForSite]
(
@ActorID int,
@PackageID int,
@websiteid int
)
AS
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
BEGIN
RAISERROR('You are not allowed to access this package', 16, 1)
RETURN
END
SELECT
[ID], [UserID], [SiteID], [FriendlyName], [Hostname], [DistinguishedName],
[CSR], [CSRLength], [ValidFrom], [ExpiryDate], [Installed], [IsRenewal],
[PreviousId], [SerialNumber]
FROM
[dbo].[SSLCertificates]
WHERE
[SiteID] = @websiteid
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetClusters
(
@ActorID int
)
AS
-- check rights
DECLARE @IsAdmin bit
SET @IsAdmin = dbo.CheckIsUserAdmin(@ActorID)
-- get the list
SELECT
ClusterID,
ClusterName
FROM Clusters
WHERE @IsAdmin = 1
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetComments
(
@ActorID int,
@UserID int,
@ItemTypeID varchar(50),
@ItemID int
)
AS
-- check rights
IF dbo.CheckActorUserRights(@ActorID, @UserID) = 0
RAISERROR('You are not allowed to access this account', 16, 1)
SELECT
C.CommentID,
C.ItemTypeID,
C.ItemID,
C.UserID,
C.CreatedDate,
C.CommentText,
C.SeverityID,
-- user
U.Username,
U.FirstName,
U.LastName,
U.FullName,
U.RoleID,
U.Email
FROM Comments AS C
INNER JOIN UsersDetailed AS U ON C.UserID = U.UserID
WHERE
ItemTypeID = @ItemTypeID
AND ItemID = @ItemID
AND dbo.CheckUserParent(@UserID, C.UserID) = 1
ORDER BY C.CreatedDate ASC
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetCRMOrganizationUsers]
@ItemID int
AS
BEGIN
SELECT
ea.AccountID,
ea.ItemID,
ea.AccountName,
ea.DisplayName,
ea.PrimaryEmailAddress,
ea.SamAccountName
FROM
ExchangeAccounts ea
INNER JOIN
CRMUsers cu
ON
ea.AccountID = cu.AccountID
WHERE
ea.ItemID = @ItemID
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetCRMUser]
@AccountID int
AS
BEGIN
SET NOCOUNT ON;
SELECT
CRMUserGUID as CRMUserID,
BusinessUnitID
FROM
CRMUsers
WHERE
AccountID = @AccountID
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetCRMUsers]
(
@ItemID int,
@SortColumn nvarchar(40),
@SortDirection nvarchar(20),
@Name nvarchar(400),
@Email nvarchar(400),
@StartRow int,
@Count int
)
AS
IF (@Name IS NULL)
BEGIN
SET @Name = '%'
END
IF (@Email IS NULL)
BEGIN
SET @Email = '%'
END
CREATE TABLE #TempCRMUsers
(
[ID] [int] IDENTITY(1,1) NOT NULL,
[AccountID] [int],
[ItemID] [int] NOT NULL,
[AccountName] [nvarchar](300) NOT NULL,
[DisplayName] [nvarchar](300) NOT NULL,
[PrimaryEmailAddress] [nvarchar](300) NULL,
[SamAccountName] [nvarchar](100) NULL
)
IF (@SortColumn = 'DisplayName')
BEGIN
INSERT INTO
#TempCRMUsers
SELECT
ea.AccountID,
ea.ItemID,
ea.AccountName,
ea.DisplayName,
ea.PrimaryEmailAddress,
ea.SamAccountName
FROM
ExchangeAccounts ea
INNER JOIN
CRMUsers cu
ON
ea.AccountID = cu.AccountID
WHERE
ea.ItemID = @ItemID AND ea.DisplayName LIKE @Name AND ea.PrimaryEmailAddress LIKE @Email
ORDER BY
ea.DisplayName
END
ELSE
BEGIN
INSERT INTO
#TempCRMUsers
SELECT
ea.AccountID,
ea.ItemID,
ea.AccountName,
ea.DisplayName,
ea.PrimaryEmailAddress,
ea.SamAccountName
FROM
ExchangeAccounts ea
INNER JOIN
CRMUsers cu
ON
ea.AccountID = cu.AccountID
WHERE
ea.ItemID = @ItemID AND ea.DisplayName LIKE @Name AND ea.PrimaryEmailAddress LIKE @Email
ORDER BY
ea.PrimaryEmailAddress
END
DECLARE @RetCount int
SELECT @RetCount = COUNT(ID) FROM #TempCRMUsers
IF (@SortDirection = 'ASC')
BEGIN
SELECT * FROM #TempCRMUsers
WHERE ID > @StartRow AND ID <= (@StartRow + @Count)
END
ELSE
BEGIN
IF (@SortColumn = 'DisplayName')
BEGIN
SELECT * FROM #TempCRMUsers
WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY DisplayName DESC
END
ELSE
BEGIN
SELECT * FROM #TempCRMUsers
WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY PrimaryEmailAddress DESC
END
END
DROP TABLE #TempCRMUsers
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetCRMUsersCount]
(
@ItemID int,
@Name nvarchar(400),
@Email nvarchar(400)
)
AS
IF (@Name IS NULL)
BEGIN
SET @Name = '%'
END
IF (@Email IS NULL)
BEGIN
SET @Email = '%'
END
SELECT
COUNT(ea.AccountID)
FROM
ExchangeAccounts ea
INNER JOIN
CRMUsers cu
ON
ea.AccountID = cu.AccountID
WHERE
ea.ItemID = @ItemID AND ea.DisplayName LIKE @Name AND ea.PrimaryEmailAddress LIKE @Email
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetDnsRecord]
(
@ActorID int,
@RecordID int
)
AS
-- check rights
DECLARE @ServiceID int, @ServerID int, @PackageID int
SELECT
@ServiceID = ServiceID,
@ServerID = ServerID,
@PackageID = PackageID
FROM GlobalDnsRecords
WHERE
RecordID = @RecordID
IF (@ServiceID > 0 OR @ServerID > 0) AND dbo.CheckIsUserAdmin(@ActorID) = 0
RAISERROR('You are not allowed to perform this operation', 16, 1)
IF (@PackageID > 0) AND dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
SELECT
NR.RecordID,
NR.ServiceID,
NR.ServerID,
NR.PackageID,
NR.RecordType,
NR.RecordName,
NR.RecordData,
NR.MXPriority,
NR.SrvPriority,
NR.SrvWeight,
NR.SrvPort,
NR.IPAddressID
FROM
GlobalDnsRecords AS NR
WHERE NR.RecordID = @RecordID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetDnsRecordsByGroup
(
@GroupID int
)
AS
SELECT
RGR.RecordID,
RGR.RecordOrder,
RGR.GroupID,
RGR.RecordType,
RGR.RecordName,
RGR.RecordData,
RGR.MXPriority
FROM
ResourceGroupDnsRecords AS RGR
WHERE RGR.GroupID = @GroupID
ORDER BY RGR.RecordOrder
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetDnsRecordsByPackage]
(
@ActorID int,
@PackageID int
)
AS
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
SELECT
NR.RecordID,
NR.ServiceID,
NR.ServerID,
NR.PackageID,
NR.RecordType,
NR.RecordName,
NR.RecordData,
NR.MXPriority,
NR.SrvPriority,
NR.SrvWeight,
NR.SrvPort,
NR.IPAddressID,
CASE
WHEN NR.RecordType = 'A' AND NR.RecordData = '' THEN dbo.GetFullIPAddress(IP.ExternalIP, IP.InternalIP)
WHEN NR.RecordType = 'MX' THEN CONVERT(varchar(3), NR.MXPriority) + ', ' + NR.RecordData
WHEN NR.RecordType = 'SRV' THEN CONVERT(varchar(3), NR.SrvPort) + ', ' + NR.RecordData
ELSE NR.RecordData
END AS FullRecordData,
dbo.GetFullIPAddress(IP.ExternalIP, IP.InternalIP) AS IPAddress,
IP.ExternalIP,
IP.InternalIP
FROM
GlobalDnsRecords AS NR
LEFT OUTER JOIN IPAddresses AS IP ON NR.IPAddressID = IP.AddressID
WHERE NR.PackageID = @PackageID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetDnsRecordsByServer]
(
@ActorID int,
@ServerID int
)
AS
SELECT
NR.RecordID,
NR.ServiceID,
NR.ServerID,
NR.PackageID,
NR.RecordType,
NR.RecordName,
NR.RecordData,
CASE
WHEN NR.RecordType = 'A' AND NR.RecordData = '' THEN dbo.GetFullIPAddress(IP.ExternalIP, IP.InternalIP)
WHEN NR.RecordType = 'MX' THEN CONVERT(varchar(3), NR.MXPriority) + ', ' + NR.RecordData
WHEN NR.RecordType = 'SRV' THEN CONVERT(varchar(3), NR.SrvPort) + ', ' + NR.RecordData
ELSE NR.RecordData
END AS FullRecordData,
NR.MXPriority,
NR.SrvPriority,
NR.SrvWeight,
NR.SrvPort,
NR.IPAddressID,
dbo.GetFullIPAddress(IP.ExternalIP, IP.InternalIP) AS IPAddress,
IP.ExternalIP,
IP.InternalIP
FROM
GlobalDnsRecords AS NR
LEFT OUTER JOIN IPAddresses AS IP ON NR.IPAddressID = IP.AddressID
WHERE
NR.ServerID = @ServerID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetDnsRecordsByService]
(
@ActorID int,
@ServiceID int
)
AS
SELECT
NR.RecordID,
NR.ServiceID,
NR.ServerID,
NR.PackageID,
NR.RecordType,
NR.RecordName,
CASE
WHEN NR.RecordType = 'A' AND NR.RecordData = '' THEN dbo.GetFullIPAddress(IP.ExternalIP, IP.InternalIP)
WHEN NR.RecordType = 'MX' THEN CONVERT(varchar(3), NR.MXPriority) + ', ' + NR.RecordData
WHEN NR.RecordType = 'SRV' THEN CONVERT(varchar(3), NR.SrvPort) + ', ' + NR.RecordData
ELSE NR.RecordData
END AS FullRecordData,
NR.RecordData,
NR.MXPriority,
NR.SrvPriority,
NR.SrvWeight,
NR.SrvPort,
NR.IPAddressID,
dbo.GetFullIPAddress(IP.ExternalIP, IP.InternalIP) AS IPAddress,
IP.ExternalIP,
IP.InternalIP
FROM
GlobalDnsRecords AS NR
LEFT OUTER JOIN IPAddresses AS IP ON NR.IPAddressID = IP.AddressID
WHERE
NR.ServiceID = @ServiceID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetDnsRecordsTotal]
(
@ActorID int,
@PackageID int
)
AS
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
-- create temp table for DNS records
DECLARE @Records TABLE
(
RecordID int,
RecordType nvarchar(10),
RecordName nvarchar(50)
)
-- select PACKAGES DNS records
DECLARE @ParentPackageID int, @TmpPackageID int
SET @TmpPackageID = @PackageID
WHILE 10 = 10
BEGIN
-- get DNS records for the current package
INSERT INTO @Records (RecordID, RecordType, RecordName)
SELECT
GR.RecordID,
GR.RecordType,
GR.RecordName
FROM GlobalDNSRecords AS GR
WHERE GR.PackageID = @TmpPackageID
AND GR.RecordType + GR.RecordName NOT IN (SELECT RecordType + RecordName FROM @Records)
SET @ParentPackageID = NULL
-- get parent package
SELECT
@ParentPackageID = ParentPackageID
FROM Packages
WHERE PackageID = @TmpPackageID
IF @ParentPackageID IS NULL -- the last parent
BREAK
SET @TmpPackageID = @ParentPackageID
END
-- select VIRTUAL SERVER DNS records
DECLARE @ServerID int
SELECT @ServerID = ServerID FROM Packages
WHERE PackageID = @PackageID
INSERT INTO @Records (RecordID, RecordType, RecordName)
SELECT
GR.RecordID,
GR.RecordType,
GR.RecordName
FROM GlobalDNSRecords AS GR
WHERE GR.ServerID = @ServerID
AND GR.RecordType + GR.RecordName NOT IN (SELECT RecordType + RecordName FROM @Records)
-- select SERVER DNS records
INSERT INTO @Records (RecordID, RecordType, RecordName)
SELECT
GR.RecordID,
GR.RecordType,
GR.RecordName
FROM GlobalDNSRecords AS GR
WHERE GR.ServerID IN (SELECT
SRV.ServerID
FROM VirtualServices AS VS
INNER JOIN Services AS S ON VS.ServiceID = S.ServiceID
INNER JOIN Servers AS SRV ON S.ServerID = SRV.ServerID
WHERE VS.ServerID = @ServerID)
AND GR.RecordType + GR.RecordName NOT IN (SELECT RecordType + RecordName FROM @Records)
-- select SERVICES DNS records
-- re-distribute package services
EXEC DistributePackageServices @ActorID, @PackageID
--INSERT INTO @Records (RecordID, RecordType, RecordName)
--SELECT
-- GR.RecordID,
-- GR.RecordType,
-- GR.RecordName
-- FROM GlobalDNSRecords AS GR
-- WHERE GR.ServiceID IN (SELECT ServiceID FROM PackageServices WHERE PackageID = @PackageID)
-- AND GR.RecordType + GR.RecordName NOT IN (SELECT RecordType + RecordName FROM @Records)
SELECT
NR.RecordID,
NR.ServiceID,
NR.ServerID,
NR.PackageID,
NR.RecordType,
NR.RecordName,
NR.RecordData,
NR.MXPriority,
NR.SrvPriority,
NR.SrvWeight,
NR.SrvPort,
NR.IPAddressID,
ISNULL(IP.ExternalIP, '') AS ExternalIP,
ISNULL(IP.InternalIP, '') AS InternalIP,
CASE
WHEN NR.RecordType = 'A' AND NR.RecordData = '' THEN dbo.GetFullIPAddress(IP.ExternalIP, IP.InternalIP)
WHEN NR.RecordType = 'MX' THEN CONVERT(varchar(3), NR.MXPriority) + ', ' + NR.RecordData
WHEN NR.RecordType = 'SRV' THEN CONVERT(varchar(3), NR.SrvPort) + ', ' + NR.RecordData
ELSE NR.RecordData
END AS FullRecordData,
dbo.GetFullIPAddress(IP.ExternalIP, IP.InternalIP) AS IPAddress
FROM @Records AS TR
INNER JOIN GlobalDnsRecords AS NR ON TR.RecordID = NR.RecordID
LEFT OUTER JOIN IPAddresses AS IP ON NR.IPAddressID = IP.AddressID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetDomain]
(
@ActorID int,
@DomainID int
)
AS
SELECT
D.DomainID,
D.PackageID,
D.ZoneItemID,
D.DomainItemID,
D.DomainName,
D.HostingAllowed,
ISNULL(WS.ItemID, 0) AS WebSiteID,
WS.ItemName AS WebSiteName,
ISNULL(MD.ItemID, 0) AS MailDomainID,
MD.ItemName AS MailDomainName,
Z.ItemName AS ZoneName,
D.IsSubDomain,
D.IsInstantAlias,
D.IsDomainPointer
FROM Domains AS D
INNER JOIN Packages AS P ON D.PackageID = P.PackageID
LEFT OUTER JOIN ServiceItems AS WS ON D.WebSiteID = WS.ItemID
LEFT OUTER JOIN ServiceItems AS MD ON D.MailDomainID = MD.ItemID
LEFT OUTER JOIN ServiceItems AS Z ON D.ZoneItemID = Z.ItemID
WHERE
D.DomainID = @DomainID
AND dbo.CheckActorPackageRights(@ActorID, P.PackageID) = 1
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetDomainByName]
(
@ActorID int,
@DomainName nvarchar(100),
@SearchOnDomainPointer bit,
@IsDomainPointer bit
)
AS
IF (@SearchOnDomainPointer = 1)
BEGIN
SELECT
D.DomainID,
D.PackageID,
D.ZoneItemID,
D.DomainItemID,
D.DomainName,
D.HostingAllowed,
ISNULL(D.WebSiteID, 0) AS WebSiteID,
WS.ItemName AS WebSiteName,
ISNULL(D.MailDomainID, 0) AS MailDomainID,
MD.ItemName AS MailDomainName,
Z.ItemName AS ZoneName,
D.IsSubDomain,
D.IsInstantAlias,
D.IsDomainPointer
FROM Domains AS D
INNER JOIN Packages AS P ON D.PackageID = P.PackageID
LEFT OUTER JOIN ServiceItems AS WS ON D.WebSiteID = WS.ItemID
LEFT OUTER JOIN ServiceItems AS MD ON D.MailDomainID = MD.ItemID
LEFT OUTER JOIN ServiceItems AS Z ON D.ZoneItemID = Z.ItemID
WHERE
D.DomainName = @DomainName
AND D.IsDomainPointer = @IsDomainPointer
AND dbo.CheckActorPackageRights(@ActorID, P.PackageID) = 1
RETURN
END
ELSE
BEGIN
SELECT
D.DomainID,
D.PackageID,
D.ZoneItemID,
D.DomainItemID,
D.DomainName,
D.HostingAllowed,
ISNULL(D.WebSiteID, 0) AS WebSiteID,
WS.ItemName AS WebSiteName,
ISNULL(D.MailDomainID, 0) AS MailDomainID,
MD.ItemName AS MailDomainName,
Z.ItemName AS ZoneName,
D.IsSubDomain,
D.IsInstantAlias,
D.IsDomainPointer
FROM Domains AS D
INNER JOIN Packages AS P ON D.PackageID = P.PackageID
LEFT OUTER JOIN ServiceItems AS WS ON D.WebSiteID = WS.ItemID
LEFT OUTER JOIN ServiceItems AS MD ON D.MailDomainID = MD.ItemID
LEFT OUTER JOIN ServiceItems AS Z ON D.ZoneItemID = Z.ItemID
WHERE
D.DomainName = @DomainName
AND dbo.CheckActorPackageRights(@ActorID, P.PackageID) = 1
RETURN
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetDomains]
(
@ActorID int,
@PackageID int,
@Recursive bit = 1
)
AS
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
SELECT
D.DomainID,
D.PackageID,
D.ZoneItemID,
D.DomainItemID,
D.DomainName,
D.HostingAllowed,
ISNULL(WS.ItemID, 0) AS WebSiteID,
WS.ItemName AS WebSiteName,
ISNULL(MD.ItemID, 0) AS MailDomainID,
MD.ItemName AS MailDomainName,
Z.ItemName AS ZoneName,
D.IsSubDomain,
D.IsInstantAlias,
D.IsDomainPointer
FROM Domains AS D
INNER JOIN PackagesTree(@PackageID, @Recursive) AS PT ON D.PackageID = PT.PackageID
LEFT OUTER JOIN ServiceItems AS WS ON D.WebSiteID = WS.ItemID
LEFT OUTER JOIN ServiceItems AS MD ON D.MailDomainID = MD.ItemID
LEFT OUTER JOIN ServiceItems AS Z ON D.ZoneItemID = Z.ItemID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetDomainsByDomainItemID]
(
@ActorID int,
@DomainID int
)
AS
SELECT
D.DomainID,
D.PackageID,
D.ZoneItemID,
D.DomainItemID,
D.DomainName,
D.HostingAllowed,
ISNULL(D.WebSiteID, 0) AS WebSiteID,
WS.ItemName AS WebSiteName,
ISNULL(D.MailDomainID, 0) AS MailDomainID,
MD.ItemName AS MailDomainName,
Z.ItemName AS ZoneName,
D.IsSubDomain,
D.IsInstantAlias,
D.IsDomainPointer
FROM Domains AS D
INNER JOIN Packages AS P ON D.PackageID = P.PackageID
LEFT OUTER JOIN ServiceItems AS WS ON D.WebSiteID = WS.ItemID
LEFT OUTER JOIN ServiceItems AS MD ON D.MailDomainID = MD.ItemID
LEFT OUTER JOIN ServiceItems AS Z ON D.ZoneItemID = Z.ItemID
WHERE
D.DomainItemID = @DomainID
AND dbo.CheckActorPackageRights(@ActorID, P.PackageID) = 1
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetDomainsByZoneID]
(
@ActorID int,
@ZoneID int
)
AS
SELECT
D.DomainID,
D.PackageID,
D.ZoneItemID,
D.DomainItemID,
D.DomainName,
D.HostingAllowed,
ISNULL(D.WebSiteID, 0) AS WebSiteID,
WS.ItemName AS WebSiteName,
ISNULL(D.MailDomainID, 0) AS MailDomainID,
MD.ItemName AS MailDomainName,
Z.ItemName AS ZoneName,
D.IsSubDomain,
D.IsInstantAlias,
D.IsDomainPointer
FROM Domains AS D
INNER JOIN Packages AS P ON D.PackageID = P.PackageID
LEFT OUTER JOIN ServiceItems AS WS ON D.WebSiteID = WS.ItemID
LEFT OUTER JOIN ServiceItems AS MD ON D.MailDomainID = MD.ItemID
LEFT OUTER JOIN ServiceItems AS Z ON D.ZoneItemID = Z.ItemID
WHERE
D.ZoneItemID = @ZoneID
AND dbo.CheckActorPackageRights(@ActorID, P.PackageID) = 1
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetDomainsPaged]
(
@ActorID int,
@PackageID int,
@ServerID int,
@Recursive bit,
@FilterColumn nvarchar(50) = '',
@FilterValue nvarchar(50) = '',
@SortColumn nvarchar(50),
@StartRow int,
@MaximumRows int
)
AS
SET NOCOUNT ON
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
-- build query and run it to the temporary table
DECLARE @sql nvarchar(2000)
IF @SortColumn = '' OR @SortColumn IS NULL
SET @SortColumn = 'DomainName'
SET @sql = '
DECLARE @Domains TABLE
(
ItemPosition int IDENTITY(1,1),
DomainID int
)
INSERT INTO @Domains (DomainID)
SELECT
D.DomainID
FROM Domains AS D
INNER JOIN Packages AS P ON D.PackageID = P.PackageID
INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID
LEFT OUTER JOIN ServiceItems AS Z ON D.ZoneItemID = Z.ItemID
LEFT OUTER JOIN Services AS S ON Z.ServiceID = S.ServiceID
LEFT OUTER JOIN Servers AS SRV ON S.ServerID = SRV.ServerID
WHERE (D.IsInstantAlias = 0 AND D.IsDomainPointer = 0) AND
((@Recursive = 0 AND D.PackageID = @PackageID)
OR (@Recursive = 1 AND dbo.CheckPackageParent(@PackageID, D.PackageID) = 1))
AND (@ServerID = 0 OR (@ServerID > 0 AND S.ServerID = @ServerID))
'
IF @FilterColumn <> '' AND @FilterValue <> ''
SET @sql = @sql + ' AND ' + @FilterColumn + ' LIKE @FilterValue '
IF @SortColumn <> '' AND @SortColumn IS NOT NULL
SET @sql = @sql + ' ORDER BY ' + @SortColumn + ' '
SET @sql = @sql + ' SELECT COUNT(DomainID) FROM @Domains;SELECT
D.DomainID,
D.PackageID,
D.ZoneItemID,
D.DomainItemID,
D.DomainName,
D.HostingAllowed,
ISNULL(WS.ItemID, 0) AS WebSiteID,
WS.ItemName AS WebSiteName,
ISNULL(MD.ItemID, 0) AS MailDomainID,
MD.ItemName AS MailDomainName,
Z.ItemName AS ZoneName,
D.IsSubDomain,
D.IsInstantAlias,
D.IsDomainPointer,
-- packages
P.PackageName,
-- server
ISNULL(SRV.ServerID, 0) AS ServerID,
ISNULL(SRV.ServerName, '''') AS ServerName,
ISNULL(SRV.Comments, '''') AS ServerComments,
ISNULL(SRV.VirtualServer, 0) AS VirtualServer,
-- user
P.UserID,
U.Username,
U.FirstName,
U.LastName,
U.FullName,
U.RoleID,
U.Email
FROM @Domains AS SD
INNER JOIN Domains AS D ON SD.DomainID = D.DomainID
INNER JOIN Packages AS P ON D.PackageID = P.PackageID
INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID
LEFT OUTER JOIN ServiceItems AS WS ON D.WebSiteID = WS.ItemID
LEFT OUTER JOIN ServiceItems AS MD ON D.MailDomainID = MD.ItemID
LEFT OUTER JOIN ServiceItems AS Z ON D.ZoneItemID = Z.ItemID
LEFT OUTER JOIN Services AS S ON Z.ServiceID = S.ServiceID
LEFT OUTER JOIN Servers AS SRV ON S.ServerID = SRV.ServerID
WHERE SD.ItemPosition BETWEEN @StartRow + 1 AND @StartRow + @MaximumRows'
exec sp_executesql @sql, N'@StartRow int, @MaximumRows int, @PackageID int, @FilterValue nvarchar(50), @ServerID int, @Recursive bit',
@StartRow, @MaximumRows, @PackageID, @FilterValue, @ServerID, @Recursive
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetExchangeAccount]
(
@ItemID int,
@AccountID int
)
AS
SELECT
E.AccountID,
E.ItemID,
E.AccountType,
E.AccountName,
E.DisplayName,
E.PrimaryEmailAddress,
E.MailEnabledPublicFolder,
E.MailboxManagerActions,
E.SamAccountName,
E.AccountPassword,
E.MailboxPlanId,
P.MailboxPlan,
E.SubscriberNumber,
E.UserPrincipalName
FROM
ExchangeAccounts AS E
LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId
WHERE
E.ItemID = @ItemID AND
E.AccountID = @AccountID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetExchangeAccountByAccountName]
(
@ItemID int,
@AccountName nvarchar(300)
)
AS
SELECT
E.AccountID,
E.ItemID,
E.AccountType,
E.AccountName,
E.DisplayName,
E.PrimaryEmailAddress,
E.MailEnabledPublicFolder,
E.MailboxManagerActions,
E.SamAccountName,
E.AccountPassword,
E.MailboxPlanId,
P.MailboxPlan,
E.SubscriberNumber,
E.UserPrincipalName
FROM
ExchangeAccounts AS E
LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId
WHERE
E.ItemID = @ItemID AND
E.AccountName = @AccountName
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetExchangeAccountByMailboxPlanId]
(
@ItemID int,
@MailboxPlanId int
)
AS
IF (@MailboxPlanId < 0)
BEGIN
SELECT
E.AccountID,
E.ItemID,
E.AccountType,
E.AccountName,
E.DisplayName,
E.PrimaryEmailAddress,
E.MailEnabledPublicFolder,
E.MailboxManagerActions,
E.SamAccountName,
E.AccountPassword,
E.MailboxPlanId,
P.MailboxPlan,
E.SubscriberNumber,
E.UserPrincipalName
FROM
ExchangeAccounts AS E
LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId
WHERE
E.ItemID = @ItemID AND
E.MailboxPlanId IS NULL AND
E.AccountType IN (1,5)
RETURN
END
ELSE
IF (@ItemId = 0)
BEGIN
SELECT
E.AccountID,
E.ItemID,
E.AccountType,
E.AccountName,
E.DisplayName,
E.PrimaryEmailAddress,
E.MailEnabledPublicFolder,
E.MailboxManagerActions,
E.SamAccountName,
E.AccountPassword,
E.MailboxPlanId,
P.MailboxPlan,
E.SubscriberNumber,
E.UserPrincipalName
FROM
ExchangeAccounts AS E
LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId
WHERE
E.MailboxPlanId = @MailboxPlanId AND
E.AccountType IN (1,5)
END
ELSE
BEGIN
SELECT
E.AccountID,
E.ItemID,
E.AccountType,
E.AccountName,
E.DisplayName,
E.PrimaryEmailAddress,
E.MailEnabledPublicFolder,
E.MailboxManagerActions,
E.SamAccountName,
E.AccountPassword,
E.MailboxPlanId,
P.MailboxPlan,
E.SubscriberNumber,
E.UserPrincipalName
FROM
ExchangeAccounts AS E
LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId
WHERE
E.ItemID = @ItemID AND
E.MailboxPlanId = @MailboxPlanId AND
E.AccountType IN (1,5)
RETURN
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetExchangeAccountEmailAddresses
(
@AccountID int
)
AS
SELECT
AddressID,
AccountID,
EmailAddress
FROM
ExchangeAccountEmailAddresses
WHERE
AccountID = @AccountID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetExchangeAccounts]
(
@ItemID int,
@AccountType int
)
AS
SELECT
E.AccountID,
E.ItemID,
E.AccountType,
E.AccountName,
E.DisplayName,
E.PrimaryEmailAddress,
E.MailEnabledPublicFolder,
E.MailboxPlanId,
P.MailboxPlan,
E.SubscriberNumber,
E.UserPrincipalName
FROM
ExchangeAccounts AS E
LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId
WHERE
E.ItemID = @ItemID AND
(E.AccountType = @AccountType OR @AccountType IS NULL)
ORDER BY DisplayName
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetExchangeAccountsPaged]
(
@ActorID int,
@ItemID int,
@AccountTypes nvarchar(30),
@FilterColumn nvarchar(50) = '',
@FilterValue nvarchar(50) = '',
@SortColumn nvarchar(50),
@StartRow int,
@MaximumRows int
)
AS
DECLARE @PackageID int
SELECT @PackageID = PackageID FROM ServiceItems
WHERE ItemID = @ItemID
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
-- start
DECLARE @condition nvarchar(700)
SET @condition = '
EA.AccountType IN (' + @AccountTypes + ')
AND EA.ItemID = @ItemID
'
IF @FilterColumn <> '' AND @FilterColumn IS NOT NULL
AND @FilterValue <> '' AND @FilterValue IS NOT NULL
BEGIN
IF @FilterColumn = 'PrimaryEmailAddress' AND @AccountTypes <> '2'
BEGIN
SET @condition = @condition + ' AND EA.AccountID IN (SELECT EAEA.AccountID FROM ExchangeAccountEmailAddresses EAEA WHERE EAEA.EmailAddress LIKE ''' + @FilterValue + ''')'
END
ELSE
BEGIN
SET @condition = @condition + ' AND ' + @FilterColumn + ' LIKE ''' + @FilterValue + ''''
END
END
IF @SortColumn IS NULL OR @SortColumn = ''
SET @SortColumn = 'EA.DisplayName ASC'
DECLARE @joincondition nvarchar(700)
SET @joincondition = ',P.MailboxPlan FROM ExchangeAccounts AS EA
LEFT OUTER JOIN ExchangeMailboxPlans AS P ON EA.MailboxPlanId = P.MailboxPlanId'
DECLARE @sql nvarchar(3500)
set @sql = '
SELECT COUNT(EA.AccountID) FROM ExchangeAccounts AS EA
WHERE ' + @condition + ';
WITH Accounts AS (
SELECT ROW_NUMBER() OVER (ORDER BY ' + @SortColumn + ') as Row,
EA.AccountID,
EA.ItemID,
EA.AccountType,
EA.AccountName,
EA.DisplayName,
EA.PrimaryEmailAddress,
EA.MailEnabledPublicFolder,
EA.MailboxPlanId,
EA.SubscriberNumber,
EA.UserPrincipalName ' + @joincondition +
' WHERE ' + @condition + '
)
SELECT * FROM Accounts
WHERE Row BETWEEN @StartRow + 1 and @StartRow + @MaximumRows
'
print @sql
exec sp_executesql @sql, N'@ItemID int, @StartRow int, @MaximumRows int',
@ItemID, @StartRow, @MaximumRows
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetExchangeMailboxes]
@ItemID int
AS
BEGIN
SELECT
AccountID,
ItemID,
AccountType,
AccountName,
DisplayName,
PrimaryEmailAddress,
MailEnabledPublicFolder,
SubscriberNumber,
UserPrincipalName
FROM
ExchangeAccounts
WHERE
ItemID = @ItemID AND
(AccountType =1 OR AccountType=5 OR AccountType=6)
ORDER BY 1
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetExchangeMailboxPlan]
(
@MailboxPlanId int
)
AS
SELECT
MailboxPlanId,
ItemID,
MailboxPlan,
EnableActiveSync,
EnableIMAP,
EnableMAPI,
EnableOWA,
EnablePOP,
IsDefault,
IssueWarningPct,
KeepDeletedItemsDays,
MailboxSizeMB,
MaxReceiveMessageSizeKB,
MaxRecipients,
MaxSendMessageSizeKB,
ProhibitSendPct,
ProhibitSendReceivePct,
HideFromAddressBook,
MailboxPlanType
FROM
ExchangeMailboxPlans
WHERE
MailboxPlanId = @MailboxPlanId
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetExchangeMailboxPlans]
(
@ItemID int
)
AS
SELECT
MailboxPlanId,
ItemID,
MailboxPlan,
EnableActiveSync,
EnableIMAP,
EnableMAPI,
EnableOWA,
EnablePOP,
IsDefault,
IssueWarningPct,
KeepDeletedItemsDays,
MailboxSizeMB,
MaxReceiveMessageSizeKB,
MaxRecipients,
MaxSendMessageSizeKB,
ProhibitSendPct,
ProhibitSendReceivePct,
HideFromAddressBook,
MailboxPlanType
FROM
ExchangeMailboxPlans
WHERE
ItemID = @ItemID
ORDER BY MailboxPlan
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetExchangeOrganization]
(
@ItemID int
)
AS
SELECT
ItemID,
ExchangeMailboxPlanID,
LyncUserPlanID,
SfBUserPlanID
FROM
ExchangeOrganizations
WHERE
ItemID = @ItemID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetExchangeOrganizationDomains]
(
@ItemID int
)
AS
SELECT
ED.DomainID,
D.DomainName,
ED.IsHost,
ED.DomainTypeID
FROM
ExchangeOrganizationDomains AS ED
INNER JOIN Domains AS D ON ED.DomainID = D.DomainID
WHERE ED.ItemID = @ItemID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetExchangeOrganizationStatistics]
(
@ItemID int
)
AS
IF -1 IN (SELECT B.MailboxSizeMB FROM ExchangeAccounts AS A INNER JOIN ExchangeMailboxPlans AS B ON A.MailboxPlanId = B.MailboxPlanId WHERE A.ItemID=@ItemID)
BEGIN
SELECT
(SELECT COUNT(*) FROM ExchangeAccounts WHERE (AccountType = 1 OR AccountType = 5 OR AccountType = 6) AND ItemID = @ItemID) AS CreatedMailboxes,
(SELECT COUNT(*) FROM ExchangeAccounts WHERE AccountType = 2 AND ItemID = @ItemID) AS CreatedContacts,
(SELECT COUNT(*) FROM ExchangeAccounts WHERE AccountType = 3 AND ItemID = @ItemID) AS CreatedDistributionLists,
(SELECT COUNT(*) FROM ExchangeAccounts WHERE AccountType = 4 AND ItemID = @ItemID) AS CreatedPublicFolders,
(SELECT COUNT(*) FROM ExchangeOrganizationDomains WHERE ItemID = @ItemID) AS CreatedDomains,
(SELECT MIN(B.MailboxSizeMB) FROM ExchangeAccounts AS A INNER JOIN ExchangeMailboxPlans AS B ON A.MailboxPlanId = B.MailboxPlanId WHERE A.ItemID=@ItemID) AS UsedDiskSpace
END
ELSE
BEGIN
SELECT
(SELECT COUNT(*) FROM ExchangeAccounts WHERE (AccountType = 1 OR AccountType = 5 OR AccountType = 6) AND ItemID = @ItemID) AS CreatedMailboxes,
(SELECT COUNT(*) FROM ExchangeAccounts WHERE AccountType = 2 AND ItemID = @ItemID) AS CreatedContacts,
(SELECT COUNT(*) FROM ExchangeAccounts WHERE AccountType = 3 AND ItemID = @ItemID) AS CreatedDistributionLists,
(SELECT COUNT(*) FROM ExchangeAccounts WHERE AccountType = 4 AND ItemID = @ItemID) AS CreatedPublicFolders,
(SELECT COUNT(*) FROM ExchangeOrganizationDomains WHERE ItemID = @ItemID) AS CreatedDomains,
(SELECT SUM(B.MailboxSizeMB) FROM ExchangeAccounts AS A INNER JOIN ExchangeMailboxPlans AS B ON A.MailboxPlanId = B.MailboxPlanId WHERE A.ItemID=@ItemID) AS UsedDiskSpace
END
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetGroupProviders
(
@GroupID int
)
AS
SELECT
PROV.ProviderID,
PROV.GroupID,
PROV.ProviderName,
PROV.DisplayName,
PROV.ProviderType,
RG.GroupName + ' - ' + PROV.DisplayName AS ProviderName
FROM Providers AS PROV
INNER JOIN ResourceGroups AS RG ON PROV.GroupID = RG.GroupID
WHERE RG.GroupID = @GroupId
ORDER BY RG.GroupOrder, PROV.DisplayName
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetHostingAddons]
(
@ActorID int,
@UserID int
)
AS
-- check rights
IF dbo.CheckActorUserRights(@ActorID, @UserID) = 0
RAISERROR('You are not allowed to access this account', 16, 1)
SELECT
PlanID,
UserID,
PackageID,
PlanName,
PlanDescription,
Available,
SetupPrice,
RecurringPrice,
RecurrenceLength,
RecurrenceUnit,
IsAddon,
(SELECT COUNT(P.PackageID) FROM PackageAddons AS P WHERE P.PlanID = HP.PlanID) AS PackagesNumber
FROM
HostingPlans AS HP
WHERE
UserID = @UserID
AND IsAddon = 1
ORDER BY PlanName
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetHostingPlan
(
@ActorID int,
@PlanID int
)
AS
SELECT
PlanID,
UserID,
PackageID,
ServerID,
PlanName,
PlanDescription,
Available,
SetupPrice,
RecurringPrice,
RecurrenceLength,
RecurrenceUnit,
IsAddon
FROM HostingPlans AS HP
WHERE HP.PlanID = @PlanID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetHostingPlanQuotas]
(
@ActorID int,
@PlanID int,
@PackageID int,
@ServerID int
)
AS
-- check rights
IF dbo.CheckActorParentPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
DECLARE @IsAddon bit
IF @ServerID = 0
SELECT @ServerID = ServerID FROM Packages
WHERE PackageID = @PackageID
-- get resource groups
SELECT
RG.GroupID,
RG.GroupName,
CASE
WHEN HPR.CalculateDiskSpace IS NULL THEN CAST(0 as bit)
ELSE CAST(1 as bit)
END AS Enabled,
dbo.GetPackageAllocatedResource(@PackageID, RG.GroupID, @ServerID) AS ParentEnabled,
ISNULL(HPR.CalculateDiskSpace, 1) AS CalculateDiskSpace,
ISNULL(HPR.CalculateBandwidth, 1) AS CalculateBandwidth
FROM ResourceGroups AS RG
LEFT OUTER JOIN HostingPlanResources AS HPR ON RG.GroupID = HPR.GroupID AND HPR.PlanID = @PlanID
WHERE (RG.ShowGroup = 1)
ORDER BY RG.GroupOrder
-- get quotas by groups
SELECT
Q.QuotaID,
Q.GroupID,
Q.QuotaName,
Q.QuotaDescription,
Q.QuotaTypeID,
ISNULL(HPQ.QuotaValue, 0) AS QuotaValue,
dbo.GetPackageAllocatedQuota(@PackageID, Q.QuotaID) AS ParentQuotaValue
FROM Quotas AS Q
LEFT OUTER JOIN HostingPlanQuotas AS HPQ ON Q.QuotaID = HPQ.QuotaID AND HPQ.PlanID = @PlanID
WHERE Q.HideQuota IS NULL OR Q.HideQuota = 0
ORDER BY Q.QuotaOrder
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetHostingPlans]
(
@ActorID int,
@UserID int
)
AS
-- check rights
IF dbo.CheckActorUserRights(@ActorID, @UserID) = 0
RAISERROR('You are not allowed to access this account', 16, 1)
SELECT
HP.PlanID,
HP.UserID,
HP.PackageID,
HP.PlanName,
HP.PlanDescription,
HP.Available,
HP.SetupPrice,
HP.RecurringPrice,
HP.RecurrenceLength,
HP.RecurrenceUnit,
HP.IsAddon,
(SELECT COUNT(P.PackageID) FROM Packages AS P WHERE P.PlanID = HP.PlanID) AS PackagesNumber,
-- server
ISNULL(HP.ServerID, 0) AS ServerID,
ISNULL(S.ServerName, 'None') AS ServerName,
ISNULL(S.Comments, '') AS ServerComments,
ISNULL(S.VirtualServer, 1) AS VirtualServer,
-- package
ISNULL(HP.PackageID, 0) AS PackageID,
ISNULL(P.PackageName, 'None') AS PackageName
FROM HostingPlans AS HP
LEFT OUTER JOIN Servers AS S ON HP.ServerID = S.ServerID
LEFT OUTER JOIN Packages AS P ON HP.PackageID = P.PackageID
WHERE
HP.UserID = @UserID
AND HP.IsAddon = 0
ORDER BY HP.PlanName
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetInstanceID]
@AccountID int
AS
BEGIN
SET NOCOUNT ON;
SELECT InstanceID FROM OCSUsers WHERE AccountID = @AccountID
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetIPAddress]
(
@AddressID int
)
AS
BEGIN
-- select
SELECT
AddressID,
ServerID,
ExternalIP,
InternalIP,
PoolID,
SubnetMask,
DefaultGateway,
Comments
FROM IPAddresses
WHERE
AddressID = @AddressID
RETURN
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetIPAddresses]
(
@ActorID int,
@PoolID int,
@ServerID int
)
AS
BEGIN
-- check rights
DECLARE @IsAdmin bit
SET @IsAdmin = dbo.CheckIsUserAdmin(@ActorID)
SELECT
IP.AddressID,
IP.PoolID,
IP.ExternalIP,
IP.InternalIP,
IP.SubnetMask,
IP.DefaultGateway,
IP.Comments,
IP.ServerID,
S.ServerName,
PA.ItemID,
SI.ItemName,
PA.PackageID,
P.PackageName,
P.UserID,
U.UserName
FROM dbo.IPAddresses AS IP
LEFT JOIN Servers AS S ON IP.ServerID = S.ServerID
LEFT JOIN PackageIPAddresses AS PA ON IP.AddressID = PA.AddressID
LEFT JOIN ServiceItems SI ON PA.ItemId = SI.ItemID
LEFT JOIN dbo.Packages P ON PA.PackageID = P.PackageID
LEFT JOIN dbo.Users U ON U.UserID = P.UserID
WHERE @IsAdmin = 1
AND (@PoolID = 0 OR @PoolID <> 0 AND IP.PoolID = @PoolID)
AND (@ServerID = 0 OR @ServerID <> 0 AND IP.ServerID = @ServerID)
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetIPAddressesPaged]
(
@ActorID int,
@PoolID int,
@ServerID int,
@FilterColumn nvarchar(50) = '',
@FilterValue nvarchar(50) = '',
@SortColumn nvarchar(50),
@StartRow int,
@MaximumRows int
)
AS
BEGIN
-- check rights
DECLARE @IsAdmin bit
SET @IsAdmin = dbo.CheckIsUserAdmin(@ActorID)
-- start
DECLARE @condition nvarchar(700)
SET @condition = '
@IsAdmin = 1
AND (@PoolID = 0 OR @PoolID <> 0 AND IP.PoolID = @PoolID)
AND (@ServerID = 0 OR @ServerID <> 0 AND IP.ServerID = @ServerID)
'
IF @FilterColumn <> '' AND @FilterColumn IS NOT NULL
AND @FilterValue <> '' AND @FilterValue IS NOT NULL
SET @condition = @condition + ' AND ' + @FilterColumn + ' LIKE ''' + @FilterValue + ''''
IF @SortColumn IS NULL OR @SortColumn = ''
SET @SortColumn = 'IP.ExternalIP ASC'
DECLARE @sql nvarchar(3500)
set @sql = '
SELECT COUNT(IP.AddressID)
FROM dbo.IPAddresses AS IP
LEFT JOIN Servers AS S ON IP.ServerID = S.ServerID
LEFT JOIN PackageIPAddresses AS PA ON IP.AddressID = PA.AddressID
LEFT JOIN ServiceItems SI ON PA.ItemId = SI.ItemID
LEFT JOIN dbo.Packages P ON PA.PackageID = P.PackageID
LEFT JOIN dbo.Users U ON P.UserID = U.UserID
WHERE ' + @condition + '
DECLARE @Addresses AS TABLE
(
AddressID int
);
WITH TempItems AS (
SELECT ROW_NUMBER() OVER (ORDER BY ' + @SortColumn + ') as Row,
IP.AddressID
FROM dbo.IPAddresses AS IP
LEFT JOIN Servers AS S ON IP.ServerID = S.ServerID
LEFT JOIN PackageIPAddresses AS PA ON IP.AddressID = PA.AddressID
LEFT JOIN ServiceItems SI ON PA.ItemId = SI.ItemID
LEFT JOIN dbo.Packages P ON PA.PackageID = P.PackageID
LEFT JOIN dbo.Users U ON U.UserID = P.UserID
WHERE ' + @condition + '
)
INSERT INTO @Addresses
SELECT AddressID FROM TempItems
WHERE TempItems.Row BETWEEN @StartRow + 1 and @StartRow + @MaximumRows
SELECT
IP.AddressID,
IP.PoolID,
IP.ExternalIP,
IP.InternalIP,
IP.SubnetMask,
IP.DefaultGateway,
IP.Comments,
IP.ServerID,
S.ServerName,
PA.ItemID,
SI.ItemName,
PA.PackageID,
P.PackageName,
P.UserID,
U.UserName
FROM @Addresses AS TA
INNER JOIN dbo.IPAddresses AS IP ON TA.AddressID = IP.AddressID
LEFT JOIN Servers AS S ON IP.ServerID = S.ServerID
LEFT JOIN PackageIPAddresses AS PA ON IP.AddressID = PA.AddressID
LEFT JOIN ServiceItems SI ON PA.ItemId = SI.ItemID
LEFT JOIN dbo.Packages P ON PA.PackageID = P.PackageID
LEFT JOIN dbo.Users U ON U.UserID = P.UserID
'
exec sp_executesql @sql, N'@IsAdmin bit, @PoolID int, @ServerID int, @StartRow int, @MaximumRows int',
@IsAdmin, @PoolID, @ServerID, @StartRow, @MaximumRows
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetItemIdByOrganizationId]
@OrganizationId nvarchar(128)
AS
BEGIN
SET NOCOUNT ON;
SELECT
ItemID
FROM
dbo.ExchangeOrganizations
WHERE
OrganizationId = @OrganizationId
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetItemIPAddresses]
(
@ActorID int,
@ItemID int,
@PoolID int
)
AS
SELECT
PIP.PackageAddressID AS AddressID,
IP.ExternalIP AS IPAddress,
IP.InternalIP AS NATAddress,
IP.SubnetMask,
IP.DefaultGateway,
PIP.IsPrimary
FROM PackageIPAddresses AS PIP
INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID
INNER JOIN ServiceItems AS SI ON PIP.ItemID = SI.ItemID
WHERE PIP.ItemID = @ItemID
AND dbo.CheckActorPackageRights(@ActorID, SI.PackageID) = 1
AND (@PoolID = 0 OR @PoolID <> 0 AND IP.PoolID = @PoolID)
ORDER BY PIP.IsPrimary DESC
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetItemPrivateIPAddresses]
(
@ActorID int,
@ItemID int
)
AS
SELECT
PIP.PrivateAddressID AS AddressID,
PIP.IPAddress,
PIP.IsPrimary
FROM PrivateIPAddresses AS PIP
INNER JOIN ServiceItems AS SI ON PIP.ItemID = SI.ItemID
WHERE PIP.ItemID = @ItemID
AND dbo.CheckActorPackageRights(@ActorID, SI.PackageID) = 1
ORDER BY PIP.IsPrimary DESC
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetLyncUserPlan]
(
@LyncUserPlanId int
)
AS
SELECT
LyncUserPlanId,
ItemID,
LyncUserPlanName,
LyncUserPlanType,
IM,
Mobility,
MobilityEnableOutsideVoice,
Federation,
Conferencing,
EnterpriseVoice,
VoicePolicy,
IsDefault
FROM
LyncUserPlans
WHERE
LyncUserPlanId = @LyncUserPlanId
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetLyncUserPlanByAccountId]
(
@AccountID int
)
AS
SELECT
LyncUserPlanId,
ItemID,
LyncUserPlanName,
LyncUserPlanType,
IM,
Mobility,
MobilityEnableOutsideVoice,
Federation,
Conferencing,
EnterpriseVoice,
VoicePolicy,
IsDefault
FROM
LyncUserPlans
WHERE
LyncUserPlanId IN (SELECT LyncUserPlanId FROM LyncUsers WHERE AccountID = @AccountID)
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetLyncUserPlans]
(
@ItemID int
)
AS
SELECT
LyncUserPlanId,
ItemID,
LyncUserPlanName,
LyncUserPlanType,
IM,
Mobility,
MobilityEnableOutsideVoice,
Federation,
Conferencing,
EnterpriseVoice,
VoicePolicy,
IsDefault
FROM
LyncUserPlans
WHERE
ItemID = @ItemID
ORDER BY LyncUserPlanName
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetLyncUsers]
(
@ItemID int,
@SortColumn nvarchar(40),
@SortDirection nvarchar(20),
@StartRow int,
@Count int
)
AS
CREATE TABLE #TempLyncUsers
(
[ID] [int] IDENTITY(1,1) NOT NULL,
[AccountID] [int],
[ItemID] [int] NOT NULL,
[AccountName] [nvarchar](300) NOT NULL,
[DisplayName] [nvarchar](300) NOT NULL,
[UserPrincipalName] [nvarchar](300) NULL,
[SipAddress] [nvarchar](300) NULL,
[SamAccountName] [nvarchar](100) NULL,
[LyncUserPlanId] [int] NOT NULL,
[LyncUserPlanName] [nvarchar] (300) NOT NULL,
)
CREATE PROCEDURE [dbo].[GetSfBUserPlan]
(
@SfBUserPlanId int
)
AS
SELECT
SfBUserPlanId,
ItemID,
SfBUserPlanName,
SfBUserPlanType,
IM,
Mobility,
MobilityEnableOutsideVoice,
Federation,
Conferencing,
EnterpriseVoice,
VoicePolicy,
IsDefault
FROM
SfBUserPlans
WHERE
SfBUserPlanId = @SfBUserPlanId
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetSfBUserPlanByAccountId]
(
@AccountID int
)
AS
SELECT
SfBUserPlanId,
ItemID,
SfBUserPlanName,
SfBUserPlanType,
IM,
Mobility,
MobilityEnableOutsideVoice,
Federation,
Conferencing,
EnterpriseVoice,
VoicePolicy,
IsDefault
FROM
SfBUserPlans
WHERE
SfBUserPlanId IN (SELECT SfBUserPlanId FROM SfBUsers WHERE AccountID = @AccountID)
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetSfBUserPlans]
(
@ItemID int
)
AS
SELECT
SfBUserPlanId,
ItemID,
SfBUserPlanName,
SfBUserPlanType,
IM,
Mobility,
MobilityEnableOutsideVoice,
Federation,
Conferencing,
EnterpriseVoice,
VoicePolicy,
IsDefault
FROM
SfBUserPlans
WHERE
ItemID = @ItemID
ORDER BY SfBUserPlanName
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetSfBUsers]
(
@ItemID int,
@SortColumn nvarchar(40),
@SortDirection nvarchar(20),
@StartRow int,
@Count int
)
AS
CREATE TABLE #TempSfBUsers
(
[ID] [int] IDENTITY(1,1) NOT NULL,
[AccountID] [int],
[ItemID] [int] NOT NULL,
[AccountName] [nvarchar](300) NOT NULL,
[DisplayName] [nvarchar](300) NOT NULL,
[UserPrincipalName] [nvarchar](300) NULL,
[SipAddress] [nvarchar](300) NULL,
[SamAccountName] [nvarchar](100) NULL,
[SfBUserPlanId] [int] NOT NULL,
[SfBUserPlanName] [nvarchar] (300) NOT NULL,
)
DECLARE @condition nvarchar(700)
SET @condition = ''
IF (@SortColumn = 'DisplayName')
BEGIN
SET @condition = 'ORDER BY ea.DisplayName'
END
IF (@SortColumn = 'UserPrincipalName')
BEGIN
SET @condition = 'ORDER BY ea.UserPrincipalName'
END
IF (@SortColumn = 'SipAddress')
BEGIN
SET @condition = 'ORDER BY ou.SipAddress'
END
IF (@SortColumn = 'LyncUserPlanName')
BEGIN
SET @condition = 'ORDER BY lp.LyncUserPlanName'
END
IF (@SortColumn = 'SfBUserPlanName')
BEGIN
SET @condition = 'ORDER BY lp.SfBUserPlanName'
END
DECLARE @sql nvarchar(3500)
set @sql = ''
INSERT INTO
#TempLyncUsers
SELECT
ea.AccountID,
ea.ItemID,
ea.AccountName,
ea.DisplayName,
ea.UserPrincipalName,
ou.SipAddress,
ea.SamAccountName,
ou.LyncUserPlanId,
lp.LyncUserPlanName,
ou.SfBUserPlanId,
lp.SfBUserPlanName
FROM
ExchangeAccounts ea
INNER JOIN
LyncUsers ou
INNER JOIN
LyncUserPlans lp
INNER JOIN
SfBUsers ou
INNER JOIN
SfBUserPlans lp
ON
ou.LyncUserPlanId = lp.LyncUserPlanId
ON
ou.SfBUserPlanId = lp.SfBUserPlanId
ON
ea.AccountID = ou.AccountID
WHERE
ea.ItemID = @ItemID + @condition
exec sp_executesql @sql, N'@ItemID int',@ItemID
DECLARE @RetCount int
SELECT @RetCount = COUNT(ID) FROM #TempLyncUsers
IF (@SortDirection = 'ASC')
BEGIN
SELECT * FROM #TempLyncUsers
WHERE ID > @StartRow AND ID <= (@StartRow + @Count)
END
ELSE
BEGIN
IF @SortColumn <> '' AND @SortColumn IS NOT NULL
BEGIN
IF (@SortColumn = 'DisplayName')
BEGIN
SELECT * FROM #TempLyncUsers
WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY DisplayName DESC
END
IF (@SortColumn = 'UserPrincipalName')
BEGIN
SELECT * FROM #TempLyncUsers
WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY UserPrincipalName DESC
END
IF (@SortColumn = 'SipAddress')
BEGIN
SELECT * FROM #TempLyncUsers
WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY SipAddress DESC
END
IF (@SortColumn = 'LyncUserPlanName')
BEGIN
SELECT * FROM #TempLyncUsers
WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY LyncUserPlanName DESC
END
IF (@SortColumn = 'SfBUserPlanName')
BEGIN
SELECT * FROM #TempLyncUsers
WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY SfBUserPlanName DESC
END
END
ELSE
BEGIN
SELECT * FROM #TempLyncUsers
WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY UserPrincipalName DESC
END
END
DROP TABLE #TempLyncUsers
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
DECLARE @sql nvarchar(3500)
set @sql = ''
INSERT INTO
#TempSfBUsers
SELECT
ea.AccountID,
ea.ItemID,
ea.AccountName,
ea.DisplayName,
ea.UserPrincipalName,
ou.SipAddress,
ea.SamAccountName,
ou.SfBUserPlanId,
lp.SfBUserPlanName
FROM
ExchangeAccounts ea
INNER JOIN
SfBUsers ou
INNER JOIN
SfBUserPlans lp
ON
ou.SfBUserPlanId = lp.SfBUserPlanId
ON
ea.AccountID = ou.AccountID
WHERE
ea.ItemID = @ItemID + @condition
exec sp_executesql @sql, N'@ItemID int',@ItemID
DECLARE @RetCount int
SELECT @RetCount = COUNT(ID) FROM #TempSfBUsers
IF (@SortDirection = 'ASC')
BEGIN
SELECT * FROM #TempSfBUsers
WHERE ID > @StartRow AND ID <= (@StartRow + @Count)
END
ELSE
BEGIN
IF @SortColumn <> '' AND @SortColumn IS NOT NULL
BEGIN
IF (@SortColumn = 'DisplayName')
BEGIN
SELECT * FROM #TempSfBUsers
WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY DisplayName DESC
END
IF (@SortColumn = 'UserPrincipalName')
BEGIN
SELECT * FROM #TempSfBUsers
WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY UserPrincipalName DESC
END
IF (@SortColumn = 'SipAddress')
BEGIN
SELECT * FROM #TempSfBUsers
WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY SipAddress DESC
END
IF (@SortColumn = 'LyncUserPlanName')
BEGIN
SELECT * FROM #TempSfBUsers
WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY SfBUserPlanName DESC
END
IF (@SortColumn = 'SfBUserPlanName')
BEGIN
SELECT * FROM #TempSfBUsers
WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY SfBUserPlanName DESC
END
END
ELSE
BEGIN
SELECT * FROM #TempSfBUsers
WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY UserPrincipalName DESC
END
END
DROP TABLE #TempSfBUsers
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetLyncUsersByPlanId]
(
@ItemID int,
@PlanId int
)
AS
SELECT
ea.AccountID,
ea.ItemID,
ea.AccountName,
ea.DisplayName,
ea.UserPrincipalName,
ea.SamAccountName,
ou.LyncUserPlanId,
lp.LyncUserPlanName
FROM
ExchangeAccounts ea
INNER JOIN
LyncUsers ou
INNER JOIN
LyncUserPlans lp
ON
ou.LyncUserPlanId = lp.LyncUserPlanId
ON
ea.AccountID = ou.AccountID
WHERE
ea.ItemID = @ItemID AND
ou.LyncUserPlanId = @PlanId
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetLyncUsersCount]
(
@ItemID int
)
AS
SELECT
COUNT(ea.AccountID)
FROM
ExchangeAccounts ea
INNER JOIN
LyncUsers ou
ON
ea.AccountID = ou.AccountID
WHERE
ea.ItemID = @ItemID
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetSfBUsersByPlanId]
(
@ItemID int,
@PlanId int
)
AS
SELECT
ea.AccountID,
ea.ItemID,
ea.AccountName,
ea.DisplayName,
ea.UserPrincipalName,
ea.SamAccountName,
ou.SfBUserPlanId,
lp.SfBUserPlanName
FROM
ExchangeAccounts ea
INNER JOIN
SfBUsers ou
INNER JOIN
SfBUserPlans lp
ON
ou.SfBUserPlanId = lp.SfBUserPlanId
ON
ea.AccountID = ou.AccountID
WHERE
ea.ItemID = @ItemID AND
ou.SfBUserPlanId = @PlanId
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetSfBUsersCount]
(
@ItemID int
)
AS
SELECT
COUNT(ea.AccountID)
FROM
ExchangeAccounts ea
INNER JOIN
SfBUsers ou
ON
ea.AccountID = ou.AccountID
WHERE
ea.ItemID = @ItemID
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetMyPackages
(
@ActorID int,
@UserID int
)
AS
-- check rights
IF dbo.CheckActorUserRights(@ActorID, @UserID) = 0
RAISERROR('You are not allowed to access this account', 16, 1)
SELECT
P.PackageID,
P.ParentPackageID,
P.PackageName,
P.StatusID,
P.PlanID,
P.PurchaseDate,
dbo.GetItemComments(P.PackageID, 'PACKAGE', @ActorID) AS Comments,
-- server
ISNULL(P.ServerID, 0) AS ServerID,
ISNULL(S.ServerName, 'None') AS ServerName,
ISNULL(S.Comments, '') AS ServerComments,
ISNULL(S.VirtualServer, 1) AS VirtualServer,
-- hosting plan
HP.PlanName,
-- user
P.UserID,
U.Username,
U.FirstName,
U.LastName,
U.FullName,
U.RoleID,
U.Email
FROM Packages AS P
INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID
LEFT OUTER JOIN Servers AS S ON P.ServerID = S.ServerID
LEFT OUTER JOIN HostingPlans AS HP ON P.PlanID = HP.PlanID
WHERE P.UserID = @UserID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetNestedPackagesPaged]
(
@ActorID int,
@PackageID int,
@FilterColumn nvarchar(50) = '',
@FilterValue nvarchar(50) = '',
@StatusID int,
@PlanID int,
@ServerID int,
@SortColumn nvarchar(50),
@StartRow int,
@MaximumRows int
)
AS
-- build query and run it to the temporary table
DECLARE @sql nvarchar(2000)
SET @sql = '
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR(''You are not allowed to access this package'', 16, 1)
DECLARE @EndRow int
SET @EndRow = @StartRow + @MaximumRows
DECLARE @Packages TABLE
(
ItemPosition int IDENTITY(1,1),
PackageID int
)
INSERT INTO @Packages (PackageID)
SELECT
P.PackageID
FROM Packages AS P
INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID
INNER JOIN Servers AS S ON P.ServerID = S.ServerID
INNER JOIN HostingPlans AS HP ON P.PlanID = HP.PlanID
WHERE
P.ParentPackageID = @PackageID
AND ((@StatusID = 0) OR (@StatusID > 0 AND P.StatusID = @StatusID))
AND ((@PlanID = 0) OR (@PlanID > 0 AND P.PlanID = @PlanID))
AND ((@ServerID = 0) OR (@ServerID > 0 AND P.ServerID = @ServerID)) '
IF @FilterColumn <> '' AND @FilterValue <> ''
SET @sql = @sql + ' AND ' + @FilterColumn + ' LIKE @FilterValue '
IF @SortColumn <> '' AND @SortColumn IS NOT NULL
SET @sql = @sql + ' ORDER BY ' + @SortColumn + ' '
SET @sql = @sql + ' SELECT COUNT(PackageID) FROM @Packages;
SELECT
P.PackageID,
P.PackageName,
P.StatusID,
P.PurchaseDate,
dbo.GetItemComments(P.PackageID, ''PACKAGE'', @ActorID) AS Comments,
-- server
P.ServerID,
ISNULL(S.ServerName, ''None'') AS ServerName,
ISNULL(S.Comments, '''') AS ServerComments,
ISNULL(S.VirtualServer, 1) AS VirtualServer,
-- hosting plan
P.PlanID,
HP.PlanName,
-- user
P.UserID,
U.Username,
U.FirstName,
U.LastName,
U.FullName,
U.RoleID,
U.Email
FROM @Packages AS TP
INNER JOIN Packages AS P ON TP.PackageID = P.PackageID
INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID
INNER JOIN Servers AS S ON P.ServerID = S.ServerID
INNER JOIN HostingPlans AS HP ON P.PlanID = HP.PlanID
WHERE TP.ItemPosition BETWEEN @StartRow AND @EndRow'
exec sp_executesql @sql, N'@StartRow int, @MaximumRows int, @PackageID int, @FilterValue nvarchar(50), @ActorID int, @StatusID int, @PlanID int, @ServerID int',
@StartRow, @MaximumRows, @PackageID, @FilterValue, @ActorID, @StatusID, @PlanID, @ServerID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetNestedPackagesSummary
(
@ActorID int,
@PackageID int
)
AS
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
-- ALL spaces
SELECT COUNT(PackageID) AS PackagesNumber FROM Packages
WHERE ParentPackageID = @PackageID
-- BY STATUS spaces
SELECT StatusID, COUNT(PackageID) AS PackagesNumber FROM Packages
WHERE ParentPackageID = @PackageID AND StatusID > 0
GROUP BY StatusID
ORDER BY StatusID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetNextSchedule
AS
-- find next schedule
DECLARE @ScheduleID int
DECLARE @TaskID nvarchar(100)
SELECT TOP 1
@ScheduleID = ScheduleID,
@TaskID = TaskID
FROM Schedule AS S
WHERE Enabled = 1
ORDER BY NextRun ASC
-- select schedule
SELECT TOP 1
S.ScheduleID,
S.TaskID,
S.PackageID,
S.ScheduleName,
S.ScheduleTypeID,
S.Interval,
S.FromTime,
S.ToTime,
S.StartTime,
S.LastRun,
S.NextRun,
S.Enabled,
S.HistoriesNumber,
S.PriorityID,
S.MaxExecutionTime,
S.WeekMonthDay,
1 AS StatusID
FROM Schedule AS S
WHERE S.ScheduleID = @ScheduleID
ORDER BY NextRun ASC
-- select task
SELECT
TaskID,
TaskType,
RoleID
FROM ScheduleTasks
WHERE TaskID = @TaskID
-- select schedule parameters
SELECT
S.ScheduleID,
STP.ParameterID,
STP.DataTypeID,
ISNULL(SP.ParameterValue, STP.DefaultValue) AS ParameterValue
FROM Schedule AS S
INNER JOIN ScheduleTaskParameters AS STP ON S.TaskID = STP.TaskID
LEFT OUTER JOIN ScheduleParameters AS SP ON STP.ParameterID = SP.ParameterID AND SP.ScheduleID = S.ScheduleID
WHERE S.ScheduleID = @ScheduleID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetOCSUsers]
(
@ItemID int,
@SortColumn nvarchar(40),
@SortDirection nvarchar(20),
@Name nvarchar(400),
@Email nvarchar(400),
@StartRow int,
@Count int
)
AS
IF (@Name IS NULL)
BEGIN
SET @Name = '%'
END
IF (@Email IS NULL)
BEGIN
SET @Email = '%'
END
CREATE TABLE #TempOCSUsers
(
[ID] [int] IDENTITY(1,1) NOT NULL,
[AccountID] [int],
[ItemID] [int] NOT NULL,
[AccountName] [nvarchar](300) NOT NULL,
[DisplayName] [nvarchar](300) NOT NULL,
[InstanceID] [nvarchar](50) NOT NULL,
[PrimaryEmailAddress] [nvarchar](300) NULL,
[SamAccountName] [nvarchar](100) NULL
)
IF (@SortColumn = 'DisplayName')
BEGIN
INSERT INTO
#TempOCSUsers
SELECT
ea.AccountID,
ea.ItemID,
ea.AccountName,
ea.DisplayName,
ou.InstanceID,
ea.PrimaryEmailAddress,
ea.SamAccountName
FROM
ExchangeAccounts ea
INNER JOIN
OCSUsers ou
ON
ea.AccountID = ou.AccountID
WHERE
ea.ItemID = @ItemID AND ea.DisplayName LIKE @Name AND ea.PrimaryEmailAddress LIKE @Email
ORDER BY
ea.DisplayName
END
ELSE
BEGIN
INSERT INTO
#TempOCSUsers
SELECT
ea.AccountID,
ea.ItemID,
ea.AccountName,
ea.DisplayName,
ou.InstanceID,
ea.PrimaryEmailAddress,
ea.SamAccountName
FROM
ExchangeAccounts ea
INNER JOIN
OCSUsers ou
ON
ea.AccountID = ou.AccountID
WHERE
ea.ItemID = @ItemID AND ea.DisplayName LIKE @Name AND ea.PrimaryEmailAddress LIKE @Email
ORDER BY
ea.PrimaryEmailAddress
END
DECLARE @RetCount int
SELECT @RetCount = COUNT(ID) FROM #TempOCSUsers
IF (@SortDirection = 'ASC')
BEGIN
SELECT * FROM #TempOCSUsers
WHERE ID > @StartRow AND ID <= (@StartRow + @Count)
END
ELSE
BEGIN
IF (@SortColumn = 'DisplayName')
BEGIN
SELECT * FROM #TempOCSUsers
WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY DisplayName DESC
END
ELSE
BEGIN
SELECT * FROM #TempOCSUsers
WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY PrimaryEmailAddress DESC
END
END
DROP TABLE #TempOCSUsers
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetOCSUsersCount]
(
@ItemID int,
@Name nvarchar(400),
@Email nvarchar(400)
)
AS
IF (@Name IS NULL)
BEGIN
SET @Name = '%'
END
IF (@Email IS NULL)
BEGIN
SET @Email = '%'
END
SELECT
COUNT(ea.AccountID)
FROM
ExchangeAccounts ea
INNER JOIN
OCSUsers ou
ON
ea.AccountID = ou.AccountID
WHERE
ea.ItemID = @ItemID AND ea.DisplayName LIKE @Name AND ea.PrimaryEmailAddress LIKE @Email
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetOrganizationCRMUserCount]
@ItemID int
AS
BEGIN
SELECT
COUNT(CRMUserID)
FROM
CrmUsers CU
INNER JOIN
ExchangeAccounts EA
ON
CU.AccountID = EA.AccountID
WHERE EA.ItemID = @ItemID
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetOrganizationStatistics]
(
@ItemID int
)
AS
SELECT
(SELECT COUNT(*) FROM ExchangeAccounts WHERE (AccountType = 7 OR AccountType = 1 OR AccountType = 6 OR AccountType = 5) AND ItemID = @ItemID) AS CreatedUsers,
(SELECT COUNT(*) FROM ExchangeOrganizationDomains WHERE ItemID = @ItemID) AS CreatedDomains
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetPackage]
(
@PackageID int,
@ActorID int
)
AS
-- Note: ActorID is not verified
-- check both requested and parent package
SELECT
P.PackageID,
P.ParentPackageID,
P.UserID,
P.PackageName,
P.PackageComments,
P.ServerID,
P.StatusID,
P.PlanID,
P.PurchaseDate,
P.OverrideQuotas
FROM Packages AS P
WHERE P.PackageID = @PackageID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetPackageAddon]
(
@ActorID int,
@PackageAddonID int
)
AS
-- check rights
DECLARE @PackageID int
SELECT @PackageID = @PackageID FROM PackageAddons
WHERE PackageAddonID = @PackageAddonID
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
SELECT
PackageAddonID,
PackageID,
PlanID,
PurchaseDate,
Quantity,
StatusID,
Comments
FROM PackageAddons AS PA
WHERE PA.PackageAddonID = @PackageAddonID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetPackageAddons
(
@ActorID int,
@PackageID int
)
AS
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
SELECT
PA.PackageAddonID,
PA.PackageID,
PA.PlanID,
PA.Quantity,
PA.PurchaseDate,
PA.StatusID,
PA.Comments,
HP.PlanName,
HP.PlanDescription
FROM PackageAddons AS PA
INNER JOIN HostingPlans AS HP ON PA.PlanID = HP.PlanID
WHERE PA.PackageID = @PackageID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetPackageBandwidth
(
@ActorID int,
@PackageID int,
@StartDate datetime,
@EndDate datetime
)
AS
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
SELECT
RG.GroupID,
RG.GroupName,
ROUND(CONVERT(float, ISNULL(GB.BytesSent, 0)) / 1024 / 1024, 0) AS MegaBytesSent,
ROUND(CONVERT(float, ISNULL(GB.BytesReceived, 0)) / 1024 / 1024, 0) AS MegaBytesReceived,
ROUND(CONVERT(float, ISNULL(GB.BytesTotal, 0)) / 1024 / 1024, 0) AS MegaBytesTotal,
ISNULL(GB.BytesSent, 0) AS BytesSent,
ISNULL(GB.BytesReceived, 0) AS BytesReceived,
ISNULL(GB.BytesTotal, 0) AS BytesTotal
FROM ResourceGroups AS RG
LEFT OUTER JOIN
(
SELECT
PB.GroupID,
SUM(ISNULL(PB.BytesSent, 0)) AS BytesSent,
SUM(ISNULL(PB.BytesReceived, 0)) AS BytesReceived,
SUM(ISNULL(PB.BytesSent, 0)) + SUM(ISNULL(PB.BytesReceived, 0)) AS BytesTotal
FROM PackagesTreeCache AS PT
INNER JOIN PackagesBandwidth AS PB ON PT.PackageID = PB.PackageID
INNER JOIN Packages AS P ON PB.PackageID = P.PackageID
INNER JOIN HostingPlanResources AS HPR ON PB.GroupID = HPR.GroupID AND HPR.PlanID = P.PlanID
AND HPR.CalculateBandwidth = 1
WHERE
PT.ParentPackageID = @PackageID
AND PB.LogDate BETWEEN @StartDate AND @EndDate
GROUP BY PB.GroupID
) AS GB ON RG.GroupID = GB.GroupID
WHERE GB.BytesTotal > 0
ORDER BY RG.GroupOrder
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetPackageBandwidthUpdate
(
@PackageID int,
@UpdateDate datetime OUTPUT
)
AS
SELECT @UpdateDate = BandwidthUpdated FROM Packages
WHERE PackageID = @PackageID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetPackageDiskspace
(
@ActorID int,
@PackageID int
)
AS
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
SELECT
RG.GroupID,
RG.GroupName,
ROUND(CONVERT(float, ISNULL(GD.Diskspace, 0)) / 1024 / 1024, 0) AS Diskspace,
ISNULL(GD.Diskspace, 0) AS DiskspaceBytes
FROM ResourceGroups AS RG
LEFT OUTER JOIN
(
SELECT
PD.GroupID,
SUM(ISNULL(PD.DiskSpace, 0)) AS Diskspace -- in megabytes
FROM PackagesTreeCache AS PT
INNER JOIN PackagesDiskspace AS PD ON PT.PackageID = PD.PackageID
INNER JOIN Packages AS P ON PT.PackageID = P.PackageID
INNER JOIN HostingPlanResources AS HPR ON PD.GroupID = HPR.GroupID
AND HPR.PlanID = P.PlanID AND HPR.CalculateDiskspace = 1
WHERE PT.ParentPackageID = @PackageID
GROUP BY PD.GroupID
) AS GD ON RG.GroupID = GD.GroupID
WHERE GD.Diskspace <> 0
ORDER BY RG.GroupOrder
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetPackageIPAddress]
@PackageAddressID int
AS
BEGIN
SELECT
PA.PackageAddressID,
PA.AddressID,
IP.ExternalIP,
IP.InternalIP,
IP.SubnetMask,
IP.DefaultGateway,
PA.ItemID,
SI.ItemName,
PA.PackageID,
P.PackageName,
P.UserID,
U.UserName,
PA.IsPrimary
FROM dbo.PackageIPAddresses AS PA
INNER JOIN dbo.IPAddresses AS IP ON PA.AddressID = IP.AddressID
INNER JOIN dbo.Packages P ON PA.PackageID = P.PackageID
INNER JOIN dbo.Users U ON U.UserID = P.UserID
LEFT JOIN ServiceItems SI ON PA.ItemId = SI.ItemID
WHERE PA.PackageAddressID = @PackageAddressID
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetPackageIPAddresses]
(
@PackageID int,
@FilterColumn nvarchar(50) = '',
@FilterValue nvarchar(50) = '',
@SortColumn nvarchar(50),
@StartRow int,
@MaximumRows int,
@PoolID int = 0,
@Recursive bit = 0
)
AS
BEGIN
-- start
DECLARE @condition nvarchar(700)
SET @condition = '
((@Recursive = 0 AND PA.PackageID = @PackageID)
OR (@Recursive = 1 AND dbo.CheckPackageParent(@PackageID, PA.PackageID) = 1))
AND (@PoolID = 0 OR @PoolID <> 0 AND IP.PoolID = @PoolID)
'
IF @FilterColumn <> '' AND @FilterColumn IS NOT NULL
AND @FilterValue <> '' AND @FilterValue IS NOT NULL
SET @condition = @condition + ' AND ' + @FilterColumn + ' LIKE ''' + @FilterValue + ''''
IF @SortColumn IS NULL OR @SortColumn = ''
SET @SortColumn = 'IP.ExternalIP ASC'
DECLARE @sql nvarchar(3500)
set @sql = '
SELECT COUNT(PA.PackageAddressID)
FROM dbo.PackageIPAddresses PA
INNER JOIN dbo.IPAddresses AS IP ON PA.AddressID = IP.AddressID
INNER JOIN dbo.Packages P ON PA.PackageID = P.PackageID
INNER JOIN dbo.Users U ON U.UserID = P.UserID
LEFT JOIN ServiceItems SI ON PA.ItemId = SI.ItemID
WHERE ' + @condition + '
DECLARE @Addresses AS TABLE
(
PackageAddressID int
);
WITH TempItems AS (
SELECT ROW_NUMBER() OVER (ORDER BY ' + @SortColumn + ') as Row,
PA.PackageAddressID
FROM dbo.PackageIPAddresses PA
INNER JOIN dbo.IPAddresses AS IP ON PA.AddressID = IP.AddressID
INNER JOIN dbo.Packages P ON PA.PackageID = P.PackageID
INNER JOIN dbo.Users U ON U.UserID = P.UserID
LEFT JOIN ServiceItems SI ON PA.ItemId = SI.ItemID
WHERE ' + @condition + '
)
INSERT INTO @Addresses
SELECT PackageAddressID FROM TempItems
WHERE TempItems.Row BETWEEN @StartRow + 1 and @StartRow + @MaximumRows
SELECT
PA.PackageAddressID,
PA.AddressID,
IP.ExternalIP,
IP.InternalIP,
IP.SubnetMask,
IP.DefaultGateway,
PA.ItemID,
SI.ItemName,
PA.PackageID,
P.PackageName,
P.UserID,
U.UserName,
PA.IsPrimary
FROM @Addresses AS TA
INNER JOIN dbo.PackageIPAddresses AS PA ON TA.PackageAddressID = PA.PackageAddressID
INNER JOIN dbo.IPAddresses AS IP ON PA.AddressID = IP.AddressID
INNER JOIN dbo.Packages P ON PA.PackageID = P.PackageID
INNER JOIN dbo.Users U ON U.UserID = P.UserID
LEFT JOIN ServiceItems SI ON PA.ItemId = SI.ItemID
'
print @sql
exec sp_executesql @sql, N'@PackageID int, @StartRow int, @MaximumRows int, @Recursive bit, @PoolID int',
@PackageID, @StartRow, @MaximumRows, @Recursive, @PoolID
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetPackagePackages
(
@ActorID int,
@PackageID int,
@Recursive bit
)
AS
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
SELECT
P.PackageID,
P.ParentPackageID,
P.PackageName,
P.StatusID,
P.PurchaseDate,
-- server
P.ServerID,
ISNULL(S.ServerName, 'None') AS ServerName,
ISNULL(S.Comments, '') AS ServerComments,
ISNULL(S.VirtualServer, 1) AS VirtualServer,
-- hosting plan
P.PlanID,
HP.PlanName,
-- user
P.UserID,
U.Username,
U.FirstName,
U.LastName,
U.RoleID,
U.Email
FROM Packages AS P
INNER JOIN Users AS U ON P.UserID = U.UserID
INNER JOIN Servers AS S ON P.ServerID = S.ServerID
INNER JOIN HostingPlans AS HP ON P.PlanID = HP.PlanID
WHERE
((@Recursive = 1 AND dbo.CheckPackageParent(@PackageID, P.PackageID) = 1)
OR (@Recursive = 0 AND P.ParentPackageID = @PackageID))
AND P.PackageID <> @PackageID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetPackagePrivateIPAddresses]
@PackageID int
AS
BEGIN
SELECT
PA.PrivateAddressID,
PA.IPAddress,
PA.ItemID,
SI.ItemName,
PA.IsPrimary
FROM PrivateIPAddresses AS PA
INNER JOIN ServiceItems AS SI ON PA.ItemID = SI.ItemID
WHERE SI.PackageID = @PackageID
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetPackagePrivateIPAddressesPaged]
@PackageID int,
@FilterColumn nvarchar(50) = '',
@FilterValue nvarchar(50) = '',
@SortColumn nvarchar(50),
@StartRow int,
@MaximumRows int
AS
BEGIN
-- start
DECLARE @condition nvarchar(700)
SET @condition = '
SI.PackageID = @PackageID
'
IF @FilterColumn <> '' AND @FilterColumn IS NOT NULL
AND @FilterValue <> '' AND @FilterValue IS NOT NULL
SET @condition = @condition + ' AND ' + @FilterColumn + ' LIKE ''' + @FilterValue + ''''
IF @SortColumn IS NULL OR @SortColumn = ''
SET @SortColumn = 'PA.IPAddress ASC'
DECLARE @sql nvarchar(3500)
set @sql = '
SELECT COUNT(PA.PrivateAddressID)
FROM dbo.PrivateIPAddresses AS PA
INNER JOIN dbo.ServiceItems AS SI ON PA.ItemID = SI.ItemID
WHERE ' + @condition + '
DECLARE @Addresses AS TABLE
(
PrivateAddressID int
);
WITH TempItems AS (
SELECT ROW_NUMBER() OVER (ORDER BY ' + @SortColumn + ') as Row,
PA.PrivateAddressID
FROM dbo.PrivateIPAddresses AS PA
INNER JOIN dbo.ServiceItems AS SI ON PA.ItemID = SI.ItemID
WHERE ' + @condition + '
)
INSERT INTO @Addresses
SELECT PrivateAddressID FROM TempItems
WHERE TempItems.Row BETWEEN @StartRow + 1 and @StartRow + @MaximumRows
SELECT
PA.PrivateAddressID,
PA.IPAddress,
PA.ItemID,
SI.ItemName,
PA.IsPrimary
FROM @Addresses AS TA
INNER JOIN dbo.PrivateIPAddresses AS PA ON TA.PrivateAddressID = PA.PrivateAddressID
INNER JOIN dbo.ServiceItems AS SI ON PA.ItemID = SI.ItemID
'
print @sql
exec sp_executesql @sql, N'@PackageID int, @StartRow int, @MaximumRows int',
@PackageID, @StartRow, @MaximumRows
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetPackageQuota]
(
@ActorID int,
@PackageID int,
@QuotaName nvarchar(50)
)
AS
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
-- return quota
SELECT
Q.QuotaID,
Q.QuotaName,
Q.QuotaDescription,
Q.QuotaTypeID,
ISNULL(dbo.GetPackageAllocatedQuota(@PackageId, Q.QuotaID), 0) AS QuotaAllocatedValue,
ISNULL(dbo.CalculateQuotaUsage(@PackageId, Q.QuotaID), 0) AS QuotaUsedValue
FROM Quotas AS Q
WHERE Q.QuotaName = @QuotaName
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE GetPackageQuotas
(
@ActorID int,
@PackageID int
)
AS
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
DECLARE @PlanID int, @ParentPackageID int
SELECT @PlanID = PlanID, @ParentPackageID = ParentPackageID FROM Packages
WHERE PackageID = @PackageID
-- get resource groups
SELECT
RG.GroupID,
RG.GroupName,
ISNULL(HPR.CalculateDiskSpace, 0) AS CalculateDiskSpace,
ISNULL(HPR.CalculateBandwidth, 0) AS CalculateBandwidth,
dbo.GetPackageAllocatedResource(@ParentPackageID, RG.GroupID, 0) AS ParentEnabled
FROM ResourceGroups AS RG
LEFT OUTER JOIN HostingPlanResources AS HPR ON RG.GroupID = HPR.GroupID AND HPR.PlanID = @PlanID
WHERE dbo.GetPackageAllocatedResource(@PackageID, RG.GroupID, 0) = 1
ORDER BY RG.GroupOrder
-- return quotas
SELECT
Q.QuotaID,
Q.GroupID,
Q.QuotaName,
Q.QuotaDescription,
Q.QuotaTypeID,
dbo.GetPackageAllocatedQuota(@PackageID, Q.QuotaID) AS QuotaValue,
dbo.GetPackageAllocatedQuota(@ParentPackageID, Q.QuotaID) AS ParentQuotaValue,
ISNULL(dbo.CalculateQuotaUsage(@PackageID, Q.QuotaID), 0) AS QuotaUsedValue
FROM Quotas AS Q
ORDER BY Q.QuotaOrder
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetPackageQuotasForEdit
(
@ActorID int,
@PackageID int
)
AS
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
DECLARE @ServerID int, @ParentPackageID int, @PlanID int
SELECT @ServerID = ServerID, @ParentPackageID = ParentPackageID, @PlanID = PlanID FROM Packages
WHERE PackageID = @PackageID
-- get resource groups
SELECT
RG.GroupID,
RG.GroupName,
ISNULL(PR.CalculateDiskSpace, ISNULL(HPR.CalculateDiskSpace, 0)) AS CalculateDiskSpace,
ISNULL(PR.CalculateBandwidth, ISNULL(HPR.CalculateBandwidth, 0)) AS CalculateBandwidth,
dbo.GetPackageAllocatedResource(@PackageID, RG.GroupID, @ServerID) AS Enabled,
dbo.GetPackageAllocatedResource(@ParentPackageID, RG.GroupID, @ServerID) AS ParentEnabled
FROM ResourceGroups AS RG
LEFT OUTER JOIN PackageResources AS PR ON RG.GroupID = PR.GroupID AND PR.PackageID = @PackageID
LEFT OUTER JOIN HostingPlanResources AS HPR ON RG.GroupID = HPR.GroupID AND HPR.PlanID = @PlanID
ORDER BY RG.GroupOrder
-- return quotas
SELECT
Q.QuotaID,
Q.GroupID,
Q.QuotaName,
Q.QuotaDescription,
Q.QuotaTypeID,
CASE
WHEN PQ.QuotaValue IS NULL THEN dbo.GetPackageAllocatedQuota(@PackageID, Q.QuotaID)
ELSE PQ.QuotaValue
END QuotaValue,
dbo.GetPackageAllocatedQuota(@ParentPackageID, Q.QuotaID) AS ParentQuotaValue
FROM Quotas AS Q
LEFT OUTER JOIN PackageQuotas AS PQ ON PQ.QuotaID = Q.QuotaID AND PQ.PackageID = @PackageID
ORDER BY Q.QuotaOrder
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetPackages]
(
@ActorID int,
@UserID int
)
AS
SELECT
P.PackageID,
P.ParentPackageID,
P.PackageName,
P.StatusID,
P.PurchaseDate,
-- server
ISNULL(P.ServerID, 0) AS ServerID,
ISNULL(S.ServerName, 'None') AS ServerName,
ISNULL(S.Comments, '') AS ServerComments,
ISNULL(S.VirtualServer, 1) AS VirtualServer,
-- hosting plan
P.PlanID,
HP.PlanName,
-- user
P.UserID,
U.Username,
U.FirstName,
U.LastName,
U.RoleID,
U.Email
FROM Packages AS P
INNER JOIN Users AS U ON P.UserID = U.UserID
INNER JOIN Servers AS S ON P.ServerID = S.ServerID
INNER JOIN HostingPlans AS HP ON P.PlanID = HP.PlanID
WHERE
P.UserID = @UserID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetPackagesBandwidthPaged
(
@ActorID int,
@UserID int,
@PackageID int,
@StartDate datetime,
@EndDate datetime,
@SortColumn nvarchar(50),
@StartRow int,
@MaximumRows int
)
AS
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
DECLARE @sql nvarchar(4000)
SET @sql = '
DECLARE @EndRow int
SET @EndRow = @StartRow + @MaximumRows
DECLARE @Report TABLE
(
ItemPosition int IDENTITY(0,1),
PackageID int,
QuotaValue int,
Bandwidth int,
UsagePercentage int,
PackagesNumber int
)
INSERT INTO @Report (PackageID, QuotaValue, Bandwidth, UsagePercentage, PackagesNumber)
SELECT
P.PackageID,
PB.QuotaValue,
PB.Bandwidth,
UsagePercentage = CASE
WHEN PB.QuotaValue = -1 THEN 0
WHEN PB.QuotaValue <> 0 THEN PB.Bandwidth * 100 / PB.QuotaValue
ELSE 0
END,
(SELECT COUNT(NP.PackageID) FROM Packages AS NP WHERE NP.ParentPackageID = P.PackageID) AS PackagesNumber
FROM Packages AS P
LEFT OUTER JOIN
(
SELECT
P.PackageID,
dbo.GetPackageAllocatedQuota(P.PackageID, 51) AS QuotaValue, -- bandwidth
ROUND(CONVERT(float, SUM(ISNULL(PB.BytesSent + PB.BytesReceived, 0))) / 1024 / 1024, 0) AS Bandwidth -- in megabytes
FROM Packages AS P
INNER JOIN PackagesTreeCache AS PT ON P.PackageID = PT.ParentPackageID
INNER JOIN Packages AS PC ON PT.PackageID = PC.PackageID
INNER JOIN PackagesBandwidth AS PB ON PT.PackageID = PB.PackageID
INNER JOIN HostingPlanResources AS HPR ON PB.GroupID = HPR.GroupID
AND HPR.PlanID = PC.PlanID
WHERE PB.LogDate BETWEEN @StartDate AND @EndDate
AND HPR.CalculateBandwidth = 1
GROUP BY P.PackageID
) AS PB ON P.PackageID = PB.PackageID
WHERE (@PackageID = -1 AND P.UserID = @UserID) OR
(@PackageID <> -1 AND P.ParentPackageID = @PackageID) '
IF @SortColumn = '' OR @SortColumn IS NULL
SET @SortColumn = 'UsagePercentage DESC'
SET @sql = @sql + ' ORDER BY ' + @SortColumn + ' '
SET @sql = @sql + '
SELECT COUNT(PackageID) FROM @Report
SELECT
R.PackageID,
ISNULL(R.QuotaValue, 0) AS QuotaValue,
ISNULL(R.Bandwidth, 0) AS Bandwidth,
ISNULL(R.UsagePercentage, 0) AS UsagePercentage,
-- package
P.PackageName,
ISNULL(R.PackagesNumber, 0) AS PackagesNumber,
P.StatusID,
-- user
P.UserID,
U.Username,
U.FirstName,
U.LastName,
U.FullName,
U.RoleID,
U.Email,
dbo.GetItemComments(U.UserID, ''USER'', @ActorID) AS UserComments
FROM @Report AS R
INNER JOIN Packages AS P ON R.PackageID = P.PackageID
INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID
WHERE R.ItemPosition BETWEEN @StartRow AND @EndRow
'
exec sp_executesql @sql, N'@ActorID int, @UserID int, @PackageID int, @StartDate datetime, @EndDate datetime, @StartRow int, @MaximumRows int',
@ActorID, @UserID, @PackageID, @StartDate, @EndDate, @StartRow, @MaximumRows
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetPackagesDiskspacePaged
(
@ActorID int,
@UserID int,
@PackageID int,
@SortColumn nvarchar(50),
@StartRow int,
@MaximumRows int
)
AS
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
DECLARE @sql nvarchar(4000)
SET @sql = '
DECLARE @EndRow int
SET @EndRow = @StartRow + @MaximumRows
DECLARE @Report TABLE
(
ItemPosition int IDENTITY(0,1),
PackageID int,
QuotaValue int,
Diskspace int,
UsagePercentage int,
PackagesNumber int
)
INSERT INTO @Report (PackageID, QuotaValue, Diskspace, UsagePercentage, PackagesNumber)
SELECT
P.PackageID,
PD.QuotaValue,
PD.Diskspace,
UsagePercentage = CASE
WHEN PD.QuotaValue = -1 THEN 0
WHEN PD.QuotaValue <> 0 THEN PD.Diskspace * 100 / PD.QuotaValue
ELSE 0
END,
(SELECT COUNT(NP.PackageID) FROM Packages AS NP WHERE NP.ParentPackageID = P.PackageID) AS PackagesNumber
FROM Packages AS P
LEFT OUTER JOIN
(
SELECT
P.PackageID,
dbo.GetPackageAllocatedQuota(P.PackageID, 52) AS QuotaValue, -- diskspace
ROUND(CONVERT(float, SUM(ISNULL(PD.DiskSpace, 0))) / 1024 / 1024, 0) AS Diskspace -- in megabytes
FROM Packages AS P
INNER JOIN PackagesTreeCache AS PT ON P.PackageID = PT.ParentPackageID
INNER JOIN Packages AS PC ON PT.PackageID = PC.PackageID
INNER JOIN PackagesDiskspace AS PD ON PT.PackageID = PD.PackageID
INNER JOIN HostingPlanResources AS HPR ON PD.GroupID = HPR.GroupID
AND HPR.PlanID = PC.PlanID
WHERE HPR.CalculateDiskspace = 1
GROUP BY P.PackageID
) AS PD ON P.PackageID = PD.PackageID
WHERE (@PackageID = -1 AND P.UserID = @UserID) OR
(@PackageID <> -1 AND P.ParentPackageID = @PackageID)
'
IF @SortColumn = '' OR @SortColumn IS NULL
SET @SortColumn = 'UsagePercentage DESC'
SET @sql = @sql + ' ORDER BY ' + @SortColumn + ' '
SET @sql = @sql + '
SELECT COUNT(PackageID) FROM @Report
SELECT
R.PackageID,
ISNULL(R.QuotaValue, 0) AS QuotaValue,
ISNULL(R.Diskspace, 0) AS Diskspace,
ISNULL(R.UsagePercentage, 0) AS UsagePercentage,
-- package
P.PackageName,
ISNULL(R.PackagesNumber, 0) AS PackagesNumber,
P.StatusID,
-- user
P.UserID,
U.Username,
U.FirstName,
U.LastName,
U.FullName,
U.RoleID,
U.Email,
dbo.GetItemComments(U.UserID, ''USER'', @ActorID) AS UserComments
FROM @Report AS R
INNER JOIN Packages AS P ON R.PackageID = P.PackageID
INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID
WHERE R.ItemPosition BETWEEN @StartRow AND @EndRow
'
exec sp_executesql @sql, N'@ActorID int, @UserID int, @PackageID int, @StartRow int, @MaximumRows int',
@ActorID, @UserID, @PackageID, @StartRow, @MaximumRows
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetPackageServiceID
(
@ActorID int,
@PackageID int,
@GroupName nvarchar(100),
@ServiceID int OUTPUT
)
AS
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
SET @ServiceID = 0
-- load group info
DECLARE @GroupID int
SELECT @GroupID = GroupID FROM ResourceGroups
WHERE GroupName = @GroupName
-- check if user has this resource enabled
IF dbo.GetPackageAllocatedResource(@PackageID, @GroupID, NULL) = 0
BEGIN
-- remove all resource services from the space
DELETE FROM PackageServices FROM PackageServices AS PS
INNER JOIN Services AS S ON PS.ServiceID = S.ServiceID
INNER JOIN Providers AS P ON S.ProviderID = P.ProviderID
WHERE P.GroupID = @GroupID AND PS.PackageID = @PackageID
RETURN
END
-- check if the service is already distributed
SELECT
@ServiceID = PS.ServiceID
FROM PackageServices AS PS
INNER JOIN Services AS S ON PS.ServiceID = S.ServiceID
INNER JOIN Providers AS P ON S.ProviderID = P.ProviderID
WHERE PS.PackageID = @PackageID AND P.GroupID = @GroupID
IF @ServiceID <> 0
RETURN
-- distribute services
EXEC DistributePackageServices @ActorID, @PackageID
-- get distributed service again
SELECT
@ServiceID = PS.ServiceID
FROM PackageServices AS PS
INNER JOIN Services AS S ON PS.ServiceID = S.ServiceID
INNER JOIN Providers AS P ON S.ProviderID = P.ProviderID
WHERE PS.PackageID = @PackageID AND P.GroupID = @GroupID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetPackageSettings
(
@ActorID int,
@PackageID int,
@SettingsName nvarchar(50)
)
AS
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
DECLARE @ParentPackageID int, @TmpPackageID int
SET @TmpPackageID = @PackageID
WHILE 10 = 10
BEGIN
IF @TmpPackageID < 2 -- system package
BEGIN
SELECT
@TmpPackageID AS PackageID,
'Dump' AS PropertyName,
'' AS PropertyValue
END
ELSE
BEGIN
-- user package
IF EXISTS
(
SELECT PropertyName FROM PackageSettings
WHERE SettingsName = @SettingsName AND PackageID = @TmpPackageID
)
BEGIN
SELECT
PackageID,
PropertyName,
PropertyValue
FROM
PackageSettings
WHERE
PackageID = @TmpPackageID AND
SettingsName = @SettingsName
BREAK
END
END
SET @ParentPackageID = NULL --reset var
-- get owner
SELECT
@ParentPackageID = ParentPackageID
FROM Packages
WHERE PackageID = @TmpPackageID
IF @ParentPackageID IS NULL -- the last parent
BREAK
SET @TmpPackageID = @ParentPackageID
END
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetPackagesPaged]
(
@ActorID int,
@UserID int,
@FilterColumn nvarchar(50) = '',
@FilterValue nvarchar(50) = '',
@SortColumn nvarchar(50),
@StartRow int,
@MaximumRows int
)
AS
-- build query and run it to the temporary table
DECLARE @sql nvarchar(2000)
SET @sql = '
DECLARE @HasUserRights bit
SET @HasUserRights = dbo.CheckActorUserRights(@ActorID, @UserID)
DECLARE @EndRow int
SET @EndRow = @StartRow + @MaximumRows
DECLARE @Packages TABLE
(
ItemPosition int IDENTITY(1,1),
PackageID int
)
INSERT INTO @Packages (PackageID)
SELECT
P.PackageID
FROM Packages AS P
--INNER JOIN UsersTree(@UserID, 1) AS UT ON P.UserID = UT.UserID
INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID
INNER JOIN Servers AS S ON P.ServerID = S.ServerID
INNER JOIN HostingPlans AS HP ON P.PlanID = HP.PlanID
WHERE
P.UserID <> @UserID AND dbo.CheckUserParent(@UserID, P.UserID) = 1
AND @HasUserRights = 1 '
IF @FilterColumn <> '' AND @FilterValue <> ''
SET @sql = @sql + ' AND ' + @FilterColumn + ' LIKE @FilterValue '
IF @SortColumn <> '' AND @SortColumn IS NOT NULL
SET @sql = @sql + ' ORDER BY ' + @SortColumn + ' '
SET @sql = @sql + ' SELECT COUNT(PackageID) FROM @Packages;
SELECT
P.PackageID,
P.PackageName,
P.StatusID,
P.PurchaseDate,
dbo.GetItemComments(P.PackageID, ''PACKAGE'', @ActorID) AS Comments,
-- server
P.ServerID,
ISNULL(S.ServerName, ''None'') AS ServerName,
ISNULL(S.Comments, '''') AS ServerComments,
ISNULL(S.VirtualServer, 1) AS VirtualServer,
-- hosting plan
P.PlanID,
HP.PlanName,
-- user
P.UserID,
U.Username,
U.FirstName,
U.LastName,
U.FullName,
U.RoleID,
U.Email
FROM @Packages AS TP
INNER JOIN Packages AS P ON TP.PackageID = P.PackageID
INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID
INNER JOIN Servers AS S ON P.ServerID = S.ServerID
INNER JOIN HostingPlans AS HP ON P.PlanID = HP.PlanID
WHERE TP.ItemPosition BETWEEN @StartRow AND @EndRow'
exec sp_executesql @sql, N'@StartRow int, @MaximumRows int, @UserID int, @FilterValue nvarchar(50), @ActorID int',
@StartRow, @MaximumRows, @UserID, @FilterValue, @ActorID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetPackageUnassignedIPAddresses]
(
@ActorID int,
@PackageID int,
@PoolID int = 0
)
AS
BEGIN
SELECT
PIP.PackageAddressID,
IP.AddressID,
IP.ExternalIP,
IP.InternalIP,
IP.ServerID,
IP.PoolID,
PIP.IsPrimary,
IP.SubnetMask,
IP.DefaultGateway
FROM PackageIPAddresses AS PIP
INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID
WHERE
PIP.ItemID IS NULL
AND PIP.PackageID = @PackageID
AND (@PoolID = 0 OR @PoolID <> 0 AND IP.PoolID = @PoolID)
AND dbo.CheckActorPackageRights(@ActorID, PIP.PackageID) = 1
ORDER BY IP.DefaultGateway, IP.ExternalIP
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetPendingSSLForWebsite]
(
@ActorID int,
@PackageID int,
@websiteid int,
@Recursive bit = 1
)
AS
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
BEGIN
RAISERROR('You are not allowed to access this package', 16, 1)
RETURN
END
SELECT
[ID], [UserID], [SiteID], [Hostname], [CSR], [Certificate], [Hash], [Installed]
FROM
[dbo].[SSLCertificates]
WHERE
@websiteid = 2 AND [Installed] = 0 AND [IsRenewal] = 0
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetProvider
(
@ProviderID int
)
AS
SELECT
ProviderID,
GroupID,
ProviderName,
EditorControl,
DisplayName,
ProviderType
FROM Providers
WHERE
ProviderID = @ProviderID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetProviderByServiceID
(
@ServiceID int
)
AS
SELECT
P.ProviderID,
P.GroupID,
P.DisplayName,
P.EditorControl,
P.ProviderType
FROM Services AS S
INNER JOIN Providers AS P ON S.ProviderID = P.ProviderID
WHERE
S.ServiceID = @ServiceID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetProviders]
AS
SELECT
PROV.ProviderID,
PROV.GroupID,
PROV.ProviderName,
PROV.EditorControl,
PROV.DisplayName,
PROV.ProviderType,
RG.GroupName + ' - ' + PROV.DisplayName AS ProviderName,
PROV.DisableAutoDiscovery
FROM Providers AS PROV
INNER JOIN ResourceGroups AS RG ON PROV.GroupID = RG.GroupID
ORDER BY RG.GroupOrder, PROV.DisplayName
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetProviderServiceQuota
(
@ProviderID int
)
AS
SELECT TOP 1
Q.QuotaID,
Q.GroupID,
Q.QuotaName,
Q.QuotaDescription,
Q.QuotaTypeID,
Q.ServiceQuota
FROM Providers AS P
INNER JOIN Quotas AS Q ON P.GroupID = Q.GroupID
WHERE P.ProviderID = @ProviderID AND Q.ServiceQuota = 1
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetQuotas
AS
SELECT
Q.GroupID,
Q.QuotaID,
RG.GroupName,
Q.QuotaDescription,
Q.QuotaTypeID
FROM Quotas AS Q
INNER JOIN ResourceGroups AS RG ON Q.GroupID = RG.GroupID
ORDER BY RG.GroupOrder, Q.QuotaOrder
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetRawServicesByServerID]
(
@ActorID int,
@ServerID int
)
AS
-- check rights
DECLARE @IsAdmin bit
SET @IsAdmin = dbo.CheckIsUserAdmin(@ActorID)
-- resource groups
SELECT
GroupID,
GroupName
FROM ResourceGroups
WHERE @IsAdmin = 1 AND (ShowGroup = 1)
ORDER BY GroupOrder
-- services
SELECT
S.ServiceID,
S.ServerID,
S.ServiceName,
S.Comments,
RG.GroupID,
PROV.DisplayName AS ProviderName
FROM Services AS S
INNER JOIN Providers AS PROV ON S.ProviderID = PROV.ProviderID
INNER JOIN ResourceGroups AS RG ON PROV.GroupID = RG.GroupID
WHERE
S.ServerID = @ServerID
AND @IsAdmin = 1
ORDER BY RG.GroupOrder
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetResellerDomains
(
@ActorID int,
@PackageID int
)
AS
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
-- load parent package
DECLARE @ParentPackageID int
SELECT @ParentPackageID = ParentPackageID FROM Packages
WHERE PackageID = @PackageID
SELECT
D.DomainID,
D.PackageID,
D.ZoneItemID,
D.DomainName,
D.HostingAllowed,
D.WebSiteID,
WS.ItemName,
D.MailDomainID,
MD.ItemName
FROM Domains AS D
INNER JOIN PackagesTree(@ParentPackageID, 0) AS PT ON D.PackageID = PT.PackageID
LEFT OUTER JOIN ServiceItems AS WS ON D.WebSiteID = WS.ItemID
LEFT OUTER JOIN ServiceItems AS MD ON D.MailDomainID = MD.ItemID
WHERE HostingAllowed = 1
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetResourceGroup
(
@GroupID int
)
AS
SELECT
RG.GroupID,
RG.GroupOrder,
RG.GroupName,
RG.GroupController
FROM ResourceGroups AS RG
WHERE RG.GroupID = @GroupID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetResourceGroups
AS
SELECT
GroupID,
GroupName,
GroupController
FROM ResourceGroups
ORDER BY GroupOrder
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetSchedule
(
@ActorID int,
@ScheduleID int
)
AS
-- select schedule
SELECT TOP 1
S.ScheduleID,
S.TaskID,
S.PackageID,
S.ScheduleName,
S.ScheduleTypeID,
S.Interval,
S.FromTime,
S.ToTime,
S.StartTime,
S.LastRun,
S.NextRun,
S.Enabled,
S.HistoriesNumber,
S.PriorityID,
S.MaxExecutionTime,
S.WeekMonthDay,
1 AS StatusID
FROM Schedule AS S
WHERE
S.ScheduleID = @ScheduleID
AND dbo.CheckActorPackageRights(@ActorID, S.PackageID) = 1
-- select task
SELECT
ST.TaskID,
ST.TaskType,
ST.RoleID
FROM Schedule AS S
INNER JOIN ScheduleTasks AS ST ON S.TaskID = ST.TaskID
WHERE
S.ScheduleID = @ScheduleID
AND dbo.CheckActorPackageRights(@ActorID, S.PackageID) = 1
-- select schedule parameters
SELECT
S.ScheduleID,
STP.ParameterID,
STP.DataTypeID,
ISNULL(SP.ParameterValue, STP.DefaultValue) AS ParameterValue
FROM Schedule AS S
INNER JOIN ScheduleTaskParameters AS STP ON S.TaskID = STP.TaskID
LEFT OUTER JOIN ScheduleParameters AS SP ON STP.ParameterID = SP.ParameterID AND SP.ScheduleID = S.ScheduleID
WHERE
S.ScheduleID = @ScheduleID
AND dbo.CheckActorPackageRights(@ActorID, S.PackageID) = 1
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetScheduleInternal
(
@ScheduleID int
)
AS
-- select schedule
SELECT
S.ScheduleID,
S.TaskID,
ST.TaskType,
ST.RoleID,
S.PackageID,
S.ScheduleName,
S.ScheduleTypeID,
S.Interval,
S.FromTime,
S.ToTime,
S.StartTime,
S.LastRun,
S.NextRun,
S.Enabled,
1 AS StatusID,
S.PriorityID,
S.HistoriesNumber,
S.MaxExecutionTime,
S.WeekMonthDay
FROM Schedule AS S
INNER JOIN ScheduleTasks AS ST ON S.TaskID = ST.TaskID
WHERE ScheduleID = @ScheduleID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetScheduleParameters]
(
@ActorID int,
@TaskID nvarchar(100),
@ScheduleID int
)
AS
-- check rights
DECLARE @PackageID int
SELECT @PackageID = PackageID FROM Schedule
WHERE ScheduleID = @ScheduleID
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
SELECT
@ScheduleID AS ScheduleID,
STP.ParameterID,
STP.DataTypeID,
SP.ParameterValue,
STP.DefaultValue
FROM ScheduleTaskParameters AS STP
LEFT OUTER JOIN ScheduleParameters AS SP ON STP.ParameterID = SP.ParameterID AND SP.ScheduleID = @ScheduleID
WHERE STP.TaskID = @TaskID
ORDER BY STP.ParameterOrder
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetSchedules
(
@ActorID int,
@PackageID int,
@Recursive bit
)
AS
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
DECLARE @Schedules TABLE
(
ScheduleID int
)
INSERT INTO @Schedules (ScheduleID)
SELECT
S.ScheduleID
FROM Schedule AS S
INNER JOIN PackagesTree(@PackageID, @Recursive) AS PT ON S.PackageID = PT.PackageID
ORDER BY S.Enabled DESC, S.NextRun
-- select schedules
SELECT
S.ScheduleID,
S.TaskID,
ST.TaskType,
ST.RoleID,
S.PackageID,
S.ScheduleName,
S.ScheduleTypeID,
S.Interval,
S.FromTime,
S.ToTime,
S.StartTime,
S.LastRun,
S.NextRun,
S.Enabled,
1 AS StatusID,
S.PriorityID,
S.MaxExecutionTime,
S.WeekMonthDay,
ISNULL(0, (SELECT TOP 1 SeverityID FROM AuditLog WHERE ItemID = S.ScheduleID AND SourceName = 'SCHEDULER' ORDER BY StartDate DESC)) AS LastResult,
U.Username,
U.FirstName,
U.LastName,
U.FullName,
U.RoleID,
U.Email
FROM @Schedules AS STEMP
INNER JOIN Schedule AS S ON STEMP.ScheduleID = S.ScheduleID
INNER JOIN Packages AS P ON S.PackageID = P.PackageID
INNER JOIN ScheduleTasks AS ST ON S.TaskID = ST.TaskID
INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID
-- select schedule parameters
SELECT
S.ScheduleID,
STP.ParameterID,
STP.DataTypeID,
ISNULL(SP.ParameterValue, STP.DefaultValue) AS ParameterValue
FROM @Schedules AS STEMP
INNER JOIN Schedule AS S ON STEMP.ScheduleID = S.ScheduleID
INNER JOIN ScheduleTaskParameters AS STP ON S.TaskID = STP.TaskID
LEFT OUTER JOIN ScheduleParameters AS SP ON STP.ParameterID = SP.ParameterID AND SP.ScheduleID = S.ScheduleID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetSchedulesPaged
(
@ActorID int,
@PackageID int,
@Recursive bit,
@FilterColumn nvarchar(50) = '',
@FilterValue nvarchar(50) = '',
@SortColumn nvarchar(50),
@StartRow int,
@MaximumRows int
)
AS
BEGIN
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
DECLARE @condition nvarchar(400)
SET @condition = ' 1 = 1 '
IF @FilterColumn <> '' AND @FilterColumn IS NOT NULL
AND @FilterValue <> '' AND @FilterValue IS NOT NULL
SET @condition = @condition + ' AND ' + @FilterColumn + ' LIKE ''' + @FilterValue + ''''
IF @SortColumn IS NULL OR @SortColumn = ''
SET @SortColumn = 'S.ScheduleName ASC'
DECLARE @sql nvarchar(3500)
set @sql = '
SELECT COUNT(S.ScheduleID) FROM Schedule AS S
INNER JOIN PackagesTree(@PackageID, @Recursive) AS PT ON S.PackageID = PT.PackageID
INNER JOIN Packages AS P ON S.PackageID = P.PackageID
INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID
WHERE ' + @condition + '
DECLARE @Schedules AS TABLE
(
ScheduleID int
);
WITH TempSchedules AS (
SELECT ROW_NUMBER() OVER (ORDER BY ' + @SortColumn + ') as Row,
S.ScheduleID
FROM Schedule AS S
INNER JOIN Packages AS P ON S.PackageID = P.PackageID
INNER JOIN PackagesTree(@PackageID, @Recursive) AS PT ON S.PackageID = PT.PackageID
INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID
WHERE ' + @condition + '
)
INSERT INTO @Schedules
SELECT ScheduleID FROM TempSchedules
WHERE TempSchedules.Row BETWEEN @StartRow + 1 and @StartRow + @MaximumRows
SELECT
S.ScheduleID,
S.TaskID,
ST.TaskType,
ST.RoleID,
S.ScheduleName,
S.ScheduleTypeID,
S.Interval,
S.FromTime,
S.ToTime,
S.StartTime,
S.LastRun,
S.NextRun,
S.Enabled,
1 AS StatusID,
S.PriorityID,
S.MaxExecutionTime,
S.WeekMonthDay,
ISNULL(0, (SELECT TOP 1 SeverityID FROM AuditLog WHERE ItemID = S.ScheduleID AND SourceName = ''SCHEDULER'' ORDER BY StartDate DESC)) AS LastResult,
-- packages
P.PackageID,
P.PackageName,
-- user
P.UserID,
U.Username,
U.FirstName,
U.LastName,
U.FullName,
U.RoleID,
U.Email
FROM @Schedules AS STEMP
INNER JOIN Schedule AS S ON STEMP.ScheduleID = S.ScheduleID
INNER JOIN ScheduleTasks AS ST ON S.TaskID = ST.TaskID
INNER JOIN Packages AS P ON S.PackageID = P.PackageID
INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID'
exec sp_executesql @sql, N'@PackageID int, @StartRow int, @MaximumRows int, @Recursive bit',
@PackageID, @StartRow, @MaximumRows, @Recursive
END
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetScheduleTask
(
@ActorID int,
@TaskID nvarchar(100)
)
AS
-- get user role
DECLARE @RoleID int
SELECT @RoleID = RoleID FROM Users
WHERE UserID = @ActorID
SELECT
TaskID,
TaskType,
RoleID
FROM ScheduleTasks
WHERE
TaskID = @TaskID
AND @RoleID >= RoleID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetScheduleTasks
(
@ActorID int
)
AS
-- get user role
DECLARE @RoleID int
SELECT @RoleID = RoleID FROM Users
WHERE UserID = @ActorID
SELECT
TaskID,
TaskType,
RoleID
FROM ScheduleTasks
WHERE @RoleID <= RoleID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
/****** Object: StoredProcedure [dbo].[GetScheduleTaskViewConfigurations] Script Date: 09/10/2007 17:53:56 ******/
CREATE PROCEDURE [dbo].[GetScheduleTaskViewConfigurations]
(
@TaskID nvarchar(100)
)
AS
SELECT
@TaskID AS TaskID,
STVC.ConfigurationID,
STVC.Environment,
STVC.Description
FROM ScheduleTaskViewConfiguration AS STVC
WHERE STVC.TaskID = @TaskID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetSearchableServiceItemTypes
AS
SELECT
ItemTypeID,
DisplayName
FROM
ServiceItemTypes
WHERE Searchable = 1
ORDER BY TypeOrder
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetServer]
(
@ActorID int,
@ServerID int
)
AS
-- check rights
DECLARE @IsAdmin bit
SET @IsAdmin = dbo.CheckIsUserAdmin(@ActorID)
SELECT
ServerID,
ServerName,
ServerUrl,
Password,
Comments,
VirtualServer,
InstantDomainAlias,
PrimaryGroupID,
ADEnabled,
ADRootDomain,
ADUsername,
ADPassword,
ADAuthenticationType
FROM Servers
WHERE
ServerID = @ServerID
AND @IsAdmin = 1
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetServerByName
(
@ActorID int,
@ServerName nvarchar(100)
)
AS
-- check rights
DECLARE @IsAdmin bit
SET @IsAdmin = dbo.CheckIsUserAdmin(@ActorID)
SELECT
ServerID,
ServerName,
ServerUrl,
Password,
Comments,
VirtualServer,
InstantDomainAlias,
PrimaryGroupID,
ADRootDomain,
ADUsername,
ADPassword,
ADAuthenticationType
FROM Servers
WHERE
ServerName = @ServerName
AND @IsAdmin = 1
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetServerInternal
(
@ServerID int
)
AS
SELECT
ServerID,
ServerName,
ServerUrl,
Password,
Comments,
VirtualServer,
InstantDomainAlias,
PrimaryGroupID,
ADEnabled,
ADRootDomain,
ADUsername,
ADPassword,
ADAuthenticationType
FROM Servers
WHERE
ServerID = @ServerID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetServers
(
@ActorID int
)
AS
-- check rights
DECLARE @IsAdmin bit
SET @IsAdmin = dbo.CheckIsUserAdmin(@ActorID)
SELECT
S.ServerID,
S.ServerName,
S.ServerUrl,
(SELECT COUNT(SRV.ServiceID) FROM Services AS SRV WHERE S.ServerID = SRV.ServerID) AS ServicesNumber,
S.Comments,
PrimaryGroupID,
S.ADEnabled
FROM Servers AS S
WHERE VirtualServer = 0
AND @IsAdmin = 1
ORDER BY S.ServerName
-- services
SELECT
S.ServiceID,
S.ServerID,
S.ProviderID,
S.ServiceName,
S.Comments
FROM Services AS S
INNER JOIN Providers AS P ON S.ProviderID = P.ProviderID
INNER JOIN ResourceGroups AS RG ON P.GroupID = RG.GroupID
WHERE @IsAdmin = 1
ORDER BY RG.GroupOrder
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetServerShortDetails
(
@ServerID int
)
AS
SELECT
ServerID,
ServerName,
Comments,
VirtualServer,
InstantDomainAlias
FROM Servers
WHERE
ServerID = @ServerID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetService]
(
@ActorID int,
@ServiceID int
)
AS
SELECT
ServiceID,
Services.ServerID,
ProviderID,
ServiceName,
ServiceQuotaValue,
ClusterID,
Services.Comments,
Servers.ServerName
FROM Services INNER JOIN Servers ON Services.ServerID = Servers.ServerID
WHERE
ServiceID = @ServiceID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetServiceItem]
(
@ActorID int,
@ItemID int
)
AS
DECLARE @Items TABLE
(
ItemID int
)
-- find service items
INSERT INTO @Items
SELECT
SI.ItemID
FROM ServiceItems AS SI
INNER JOIN Packages AS P ON SI.PackageID = P.PackageID
WHERE
SI.ItemID = @ItemID
AND dbo.CheckActorPackageRights(@ActorID, SI.PackageID) = 1
-- select service items
SELECT
SI.ItemID,
SI.ItemName,
SI.ItemTypeID,
SIT.TypeName,
SI.ServiceID,
SI.PackageID,
P.PackageName,
S.ServiceID,
S.ServiceName,
SRV.ServerID,
SRV.ServerName,
RG.GroupName,
U.UserID,
U.Username,
U.FullName AS UserFullName,
SI.CreatedDate
FROM @Items AS FI
INNER JOIN ServiceItems AS SI ON FI.ItemID = SI.ItemID
INNER JOIN ServiceItemTypes AS SIT ON SI.ItemTypeID = SIT.ItemTypeID
INNER JOIN Packages AS P ON SI.PackageID = P.PackageID
INNER JOIN Services AS S ON SI.ServiceID = S.ServiceID
INNER JOIN Servers AS SRV ON S.ServerID = SRV.ServerID
INNER JOIN Providers AS PROV ON S.ProviderID = PROV.ProviderID
INNER JOIN ResourceGroups AS RG ON PROV.GroupID = RG.GroupID
INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID
-- select item properties
-- get corresponding item properties
SELECT
IP.ItemID,
IP.PropertyName,
IP.PropertyValue
FROM ServiceItemProperties AS IP
INNER JOIN @Items AS FI ON IP.ItemID = FI.ItemID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetServiceItemByName]
(
@ActorID int,
@PackageID int,
@ItemName nvarchar(500),
@GroupName nvarchar(100) = NULL,
@ItemTypeName nvarchar(200)
)
AS
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
DECLARE @Items TABLE
(
ItemID int
)
-- find service items
INSERT INTO @Items
SELECT
SI.ItemID
FROM ServiceItems AS SI
INNER JOIN ServiceItemTypes AS SIT ON SI.ItemTypeID = SIT.ItemTypeID
INNER JOIN ResourceGroups AS RG ON SIT.GroupID = RG.GroupID
WHERE SI.PackageID = @PackageID AND SIT.TypeName = @ItemTypeName
AND SI.ItemName = @ItemName
AND ((@GroupName IS NULL) OR (@GroupName IS NOT NULL AND RG.GroupName = @GroupName))
-- select service items
SELECT
SI.ItemID,
SI.ItemName,
SI.ItemTypeID,
SIT.TypeName,
SI.ServiceID,
SI.PackageID,
P.PackageName,
S.ServiceID,
S.ServiceName,
SRV.ServerID,
SRV.ServerName,
RG.GroupName,
U.UserID,
U.Username,
U.FullName AS UserFullName,
SI.CreatedDate
FROM @Items AS FI
INNER JOIN ServiceItems AS SI ON FI.ItemID = SI.ItemID
INNER JOIN ServiceItemTypes AS SIT ON SI.ItemTypeID = SIT.ItemTypeID
INNER JOIN Packages AS P ON SI.PackageID = P.PackageID
INNER JOIN Services AS S ON SI.ServiceID = S.ServiceID
INNER JOIN Servers AS SRV ON S.ServerID = SRV.ServerID
INNER JOIN Providers AS PROV ON S.ProviderID = PROV.ProviderID
INNER JOIN ResourceGroups AS RG ON PROV.GroupID = RG.GroupID
INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID
-- select item properties
-- get corresponding item properties
SELECT
IP.ItemID,
IP.PropertyName,
IP.PropertyValue
FROM ServiceItemProperties AS IP
INNER JOIN @Items AS FI ON IP.ItemID = FI.ItemID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetServiceItems]
(
@ActorID int,
@PackageID int,
@ItemTypeName nvarchar(200),
@GroupName nvarchar(100) = NULL,
@Recursive bit
)
AS
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
DECLARE @Items TABLE
(
ItemID int
)
-- find service items
INSERT INTO @Items
SELECT
SI.ItemID
FROM ServiceItems AS SI
INNER JOIN PackagesTree(@PackageID, @Recursive) AS PT ON SI.PackageID = PT.PackageID
INNER JOIN ServiceItemTypes AS IT ON SI.ItemTypeID = IT.ItemTypeID
INNER JOIN ResourceGroups AS RG ON IT.GroupID = RG.GroupID
WHERE IT.TypeName = @ItemTypeName
AND ((@GroupName IS NULL) OR (@GroupName IS NOT NULL AND RG.GroupName = @GroupName))
-- select service items
SELECT
SI.ItemID,
SI.ItemName,
SI.ItemTypeID,
SIT.TypeName,
SI.ServiceID,
SI.PackageID,
P.PackageName,
S.ServiceID,
S.ServiceName,
SRV.ServerID,
SRV.ServerName,
RG.GroupName,
U.UserID,
U.Username,
(U.FirstName + U.LastName) AS UserFullName,
SI.CreatedDate
FROM @Items AS FI
INNER JOIN ServiceItems AS SI ON FI.ItemID = SI.ItemID
INNER JOIN ServiceItemTypes AS SIT ON SI.ItemTypeID = SIT.ItemTypeID
INNER JOIN Packages AS P ON SI.PackageID = P.PackageID
INNER JOIN Services AS S ON SI.ServiceID = S.ServiceID
INNER JOIN Servers AS SRV ON S.ServerID = SRV.ServerID
INNER JOIN ResourceGroups AS RG ON SIT.GroupID = RG.GroupID
INNER JOIN Users AS U ON P.UserID = U.UserID
-- select item properties
-- get corresponding item properties
SELECT
IP.ItemID,
IP.PropertyName,
IP.PropertyValue
FROM ServiceItemProperties AS IP
INNER JOIN @Items AS FI ON IP.ItemID = FI.ItemID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetServiceItemsByName]
(
@ActorID int,
@PackageID int,
@ItemName nvarchar(500)
)
AS
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
DECLARE @Items TABLE
(
ItemID int
)
-- find service items
INSERT INTO @Items
SELECT
SI.ItemID
FROM ServiceItems AS SI
INNER JOIN ServiceItemTypes AS SIT ON SI.ItemTypeID = SIT.ItemTypeID
WHERE SI.PackageID = @PackageID
AND SI.ItemName LIKE @ItemName
-- select service items
SELECT
SI.ItemID,
SI.ItemName,
SI.ItemTypeID,
SIT.TypeName,
SI.ServiceID,
SI.PackageID,
P.PackageName,
S.ServiceID,
S.ServiceName,
SRV.ServerID,
SRV.ServerName,
RG.GroupName,
U.UserID,
U.Username,
U.FullName AS UserFullName,
SI.CreatedDate
FROM @Items AS FI
INNER JOIN ServiceItems AS SI ON FI.ItemID = SI.ItemID
INNER JOIN ServiceItemTypes AS SIT ON SI.ItemTypeID = SIT.ItemTypeID
INNER JOIN Packages AS P ON SI.PackageID = P.PackageID
INNER JOIN Services AS S ON SI.ServiceID = S.ServiceID
INNER JOIN Servers AS SRV ON S.ServerID = SRV.ServerID
INNER JOIN ResourceGroups AS RG ON SIT.GroupID = RG.GroupID
INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID
-- select item properties
-- get corresponding item properties
SELECT
IP.ItemID,
IP.PropertyName,
IP.PropertyValue
FROM ServiceItemProperties AS IP
INNER JOIN @Items AS FI ON IP.ItemID = FI.ItemID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetServiceItemsByPackage]
(
@ActorID int,
@PackageID int
)
AS
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
DECLARE @Items TABLE
(
ItemID int
)
-- find service items
INSERT INTO @Items
SELECT
SI.ItemID
FROM ServiceItems AS SI
WHERE SI.PackageID = @PackageID
-- select service items
SELECT
SI.ItemID,
SI.ItemName,
SI.ItemTypeID,
SIT.TypeName,
SIT.DisplayName,
SI.ServiceID,
SI.PackageID,
P.PackageName,
S.ServiceID,
S.ServiceName,
SRV.ServerID,
SRV.ServerName,
RG.GroupName,
U.UserID,
U.Username,
(U.FirstName + U.LastName) AS UserFullName,
SI.CreatedDate
FROM @Items AS FI
INNER JOIN ServiceItems AS SI ON FI.ItemID = SI.ItemID
INNER JOIN ServiceItemTypes AS SIT ON SI.ItemTypeID = SIT.ItemTypeID
INNER JOIN Packages AS P ON SI.PackageID = P.PackageID
INNER JOIN Services AS S ON SI.ServiceID = S.ServiceID
INNER JOIN Servers AS SRV ON S.ServerID = SRV.ServerID
INNER JOIN ResourceGroups AS RG ON SIT.GroupID = RG.GroupID
INNER JOIN Users AS U ON P.UserID = U.UserID
-- select item properties
-- get corresponding item properties
SELECT
IP.ItemID,
IP.PropertyName,
IP.PropertyValue
FROM ServiceItemProperties AS IP
INNER JOIN @Items AS FI ON IP.ItemID = FI.ItemID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetServiceItemsByService]
(
@ActorID int,
@ServiceID int
)
AS
-- check rights
DECLARE @IsAdmin bit
SET @IsAdmin = dbo.CheckIsUserAdmin(@ActorID)
DECLARE @Items TABLE
(
ItemID int
)
-- find service items
INSERT INTO @Items
SELECT
SI.ItemID
FROM ServiceItems AS SI
WHERE SI.ServiceID = @ServiceID
-- select service items
SELECT
SI.ItemID,
SI.ItemName,
SI.ItemTypeID,
SIT.TypeName,
SI.ServiceID,
SI.PackageID,
P.PackageName,
S.ServiceID,
S.ServiceName,
SRV.ServerID,
SRV.ServerName,
RG.GroupName,
U.UserID,
U.Username,
(U.FirstName + U.LastName) AS UserFullName,
SI.CreatedDate
FROM @Items AS FI
INNER JOIN ServiceItems AS SI ON FI.ItemID = SI.ItemID
INNER JOIN ServiceItemTypes AS SIT ON SI.ItemTypeID = SIT.ItemTypeID
INNER JOIN Packages AS P ON SI.PackageID = P.PackageID
INNER JOIN Services AS S ON SI.ServiceID = S.ServiceID
INNER JOIN Servers AS SRV ON S.ServerID = SRV.ServerID
INNER JOIN ResourceGroups AS RG ON SIT.GroupID = RG.GroupID
INNER JOIN Users AS U ON P.UserID = U.UserID
WHERE @IsAdmin = 1
-- select item properties
-- get corresponding item properties
SELECT
IP.ItemID,
IP.PropertyName,
IP.PropertyValue
FROM ServiceItemProperties AS IP
INNER JOIN @Items AS FI ON IP.ItemID = FI.ItemID
WHERE @IsAdmin = 1
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetServiceItemsCount]
(
@ItemTypeName nvarchar(200),
@GroupName nvarchar(100) = NULL,
@ServiceID int = 0,
@TotalNumber int OUTPUT
)
AS
SET @TotalNumber = 0
-- find service items
SELECT
@TotalNumber = COUNT(SI.ItemID)
FROM ServiceItems AS SI
INNER JOIN ServiceItemTypes AS IT ON SI.ItemTypeID = IT.ItemTypeID
INNER JOIN ResourceGroups AS RG ON IT.GroupID = RG.GroupID
WHERE IT.TypeName = @ItemTypeName
AND ((@GroupName IS NULL) OR (@GroupName IS NOT NULL AND RG.GroupName = @GroupName))
AND ((@ServiceID = 0) OR (@ServiceID > 0 AND SI.ServiceID = @ServiceID))
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetServiceItemsForStatistics]
(
@ActorID int,
@ServiceID int,
@PackageID int,
@CalculateDiskspace bit,
@CalculateBandwidth bit,
@Suspendable bit,
@Disposable bit
)
AS
DECLARE @Items TABLE
(
ItemID int
)
-- find service items
INSERT INTO @Items
SELECT
SI.ItemID
FROM ServiceItems AS SI
INNER JOIN ServiceItemTypes AS SIT ON SI.ItemTypeID = SIT.ItemTypeID
WHERE
((@ServiceID = 0) OR (@ServiceID > 0 AND SI.ServiceID = @ServiceID))
AND ((@PackageID = 0) OR (@PackageID > 0 AND SI.PackageID = @PackageID))
AND ((@CalculateDiskspace = 0) OR (@CalculateDiskspace = 1 AND SIT.CalculateDiskspace = @CalculateDiskspace))
AND ((@CalculateBandwidth = 0) OR (@CalculateBandwidth = 1 AND SIT.CalculateBandwidth = @CalculateBandwidth))
AND ((@Suspendable = 0) OR (@Suspendable = 1 AND SIT.Suspendable = @Suspendable))
AND ((@Disposable = 0) OR (@Disposable = 1 AND SIT.Disposable = @Disposable))
-- select service items
SELECT
SI.ItemID,
SI.ItemName,
SI.ItemTypeID,
RG.GroupName,
SIT.TypeName,
SI.ServiceID,
SI.PackageID,
SI.CreatedDate
FROM @Items AS FI
INNER JOIN ServiceItems AS SI ON FI.ItemID = SI.ItemID
INNER JOIN ServiceItemTypes AS SIT ON SI.ItemTypeID = SIT.ItemTypeID
INNER JOIN ResourceGroups AS RG ON SIT.GroupID = RG.GroupID
ORDER BY RG.GroupOrder DESC, SI.ItemName
-- select item properties
-- get corresponding item properties
SELECT
IP.ItemID,
IP.PropertyName,
IP.PropertyValue
FROM ServiceItemProperties AS IP
INNER JOIN @Items AS FI ON IP.ItemID = FI.ItemID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetServiceItemsPaged]
(
@ActorID int,
@PackageID int,
@ItemTypeName nvarchar(200),
@GroupName nvarchar(100) = NULL,
@ServerID int,
@Recursive bit,
@FilterColumn nvarchar(50) = '',
@FilterValue nvarchar(50) = '',
@SortColumn nvarchar(50),
@StartRow int,
@MaximumRows int
)
AS
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
-- start
DECLARE @GroupID int
SELECT @GroupID = GroupID FROM ResourceGroups
WHERE GroupName = @GroupName
DECLARE @ItemTypeID int
SELECT @ItemTypeID = ItemTypeID FROM ServiceItemTypes
WHERE TypeName = @ItemTypeName
AND ((@GroupID IS NULL) OR (@GroupID IS NOT NULL AND GroupID = @GroupID))
DECLARE @condition nvarchar(700)
SET @condition = 'SI.ItemTypeID = @ItemTypeID
AND ((@Recursive = 0 AND P.PackageID = @PackageID)
OR (@Recursive = 1 AND dbo.CheckPackageParent(@PackageID, P.PackageID) = 1))
AND ((@GroupID IS NULL) OR (@GroupID IS NOT NULL AND IT.GroupID = @GroupID))
AND (@ServerID = 0 OR (@ServerID > 0 AND S.ServerID = @ServerID))
'
IF @FilterColumn <> '' AND @FilterColumn IS NOT NULL
AND @FilterValue <> '' AND @FilterValue IS NOT NULL
SET @condition = @condition + ' AND ' + @FilterColumn + ' LIKE ''' + @FilterValue + ''''
IF @SortColumn IS NULL OR @SortColumn = ''
SET @SortColumn = 'SI.ItemName ASC'
DECLARE @sql nvarchar(3500)
set @sql = '
SELECT COUNT(SI.ItemID) FROM Packages AS P
INNER JOIN ServiceItems AS SI ON P.PackageID = SI.PackageID
INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID
INNER JOIN ServiceItemTypes AS IT ON SI.ItemTypeID = IT.ItemTypeID
INNER JOIN Services AS S ON SI.ServiceID = S.ServiceID
WHERE ' + @condition + '
DECLARE @Items AS TABLE
(
ItemID int
);
WITH TempItems AS (
SELECT ROW_NUMBER() OVER (ORDER BY ' + @SortColumn + ') as Row,
SI.ItemID
FROM Packages AS P
INNER JOIN ServiceItems AS SI ON P.PackageID = SI.PackageID
INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID
INNER JOIN ServiceItemTypes AS IT ON SI.ItemTypeID = IT.ItemTypeID
INNER JOIN Services AS S ON SI.ServiceID = S.ServiceID
INNER JOIN Servers AS SRV ON S.ServerID = SRV.ServerID
WHERE ' + @condition + '
)
INSERT INTO @Items
SELECT ItemID FROM TempItems
WHERE TempItems.Row BETWEEN @StartRow + 1 and @StartRow + @MaximumRows
SELECT
SI.ItemID,
SI.ItemName,
SI.ItemTypeID,
IT.TypeName,
SI.ServiceID,
SI.PackageID,
SI.CreatedDate,
RG.GroupName,
-- packages
P.PackageName,
-- server
ISNULL(SRV.ServerID, 0) AS ServerID,
ISNULL(SRV.ServerName, '''') AS ServerName,
ISNULL(SRV.Comments, '''') AS ServerComments,
ISNULL(SRV.VirtualServer, 0) AS VirtualServer,
-- user
P.UserID,
U.Username,
U.FirstName,
U.LastName,
U.FullName,
U.RoleID,
U.Email
FROM @Items AS TSI
INNER JOIN ServiceItems AS SI ON TSI.ItemID = SI.ItemID
INNER JOIN ServiceItemTypes AS IT ON SI.ItemTypeID = IT.ItemTypeID
INNER JOIN Packages AS P ON SI.PackageID = P.PackageID
INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID
INNER JOIN Services AS S ON SI.ServiceID = S.ServiceID
INNER JOIN Servers AS SRV ON S.ServerID = SRV.ServerID
INNER JOIN ResourceGroups AS RG ON IT.GroupID = RG.GroupID
SELECT
IP.ItemID,
IP.PropertyName,
IP.PropertyValue
FROM ServiceItemProperties AS IP
INNER JOIN @Items AS TSI ON IP.ItemID = TSI.ItemID'
--print @sql
exec sp_executesql @sql, N'@ItemTypeID int, @PackageID int, @GroupID int, @StartRow int, @MaximumRows int, @Recursive bit, @ServerID int',
@ItemTypeID, @PackageID, @GroupID, @StartRow, @MaximumRows, @Recursive, @ServerID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetServiceItemType]
(
@ItemTypeID int
)
AS
SELECT
[ItemTypeID],
[GroupID],
[DisplayName],
[TypeName],
[TypeOrder],
[CalculateDiskspace],
[CalculateBandwidth],
[Suspendable],
[Disposable],
[Searchable],
[Importable],
[Backupable]
FROM
[ServiceItemTypes]
WHERE
[ItemTypeID] = @ItemTypeID
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetServiceItemTypes]
AS
SELECT
[ItemTypeID],
[GroupID],
[DisplayName],
[TypeName],
[TypeOrder],
[CalculateDiskspace],
[CalculateBandwidth],
[Suspendable],
[Disposable],
[Searchable],
[Importable],
[Backupable]
FROM
[ServiceItemTypes]
ORDER BY TypeOrder
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetServiceProperties
(
@ActorID int,
@ServiceID int
)
AS
SELECT ServiceID, PropertyName, PropertyValue
FROM ServiceProperties
WHERE
ServiceID = @ServiceID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetServicesByGroupID
(
@ActorID int,
@GroupID int
)
AS
-- check rights
DECLARE @IsAdmin bit
SET @IsAdmin = dbo.CheckIsUserAdmin(@ActorID)
SELECT
S.ServiceID,
S.ServiceName,
S.ServerID,
S.ServiceQuotaValue,
SRV.ServerName,
S.ProviderID,
S.ServiceName+' on '+SRV.ServerName AS FullServiceName
FROM Services AS S
INNER JOIN Providers AS PROV ON S.ProviderID = PROV.ProviderID
INNER JOIN Servers AS SRV ON S.ServerID = SRV.ServerID
WHERE
PROV.GroupID = @GroupID
AND @IsAdmin = 1
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetServicesByGroupName]
(
@ActorID int,
@GroupName nvarchar(100)
)
AS
-- check rights
DECLARE @IsAdmin bit
SET @IsAdmin = dbo.CheckIsUserAdmin(@ActorID)
SELECT
S.ServiceID,
S.ServiceName,
S.ServerID,
S.ServiceQuotaValue,
SRV.ServerName,
S.ProviderID,
PROV.ProviderName,
S.ServiceName + ' on ' + SRV.ServerName AS FullServiceName
FROM Services AS S
INNER JOIN Providers AS PROV ON S.ProviderID = PROV.ProviderID
INNER JOIN Servers AS SRV ON S.ServerID = SRV.ServerID
INNER JOIN ResourceGroups AS RG ON PROV.GroupID = RG.GroupID
WHERE
RG.GroupName = @GroupName
AND @IsAdmin = 1
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetServicesByServerID
(
@ActorID int,
@ServerID int
)
AS
-- check rights
DECLARE @IsAdmin bit
SET @IsAdmin = dbo.CheckIsUserAdmin(@ActorID)
SELECT
S.ServiceID,
S.ServerID,
S.ServiceName,
S.Comments,
S.ServiceQuotaValue,
RG.GroupName,
S.ProviderID,
PROV.DisplayName AS ProviderName
FROM Services AS S
INNER JOIN Providers AS PROV ON S.ProviderID = PROV.ProviderID
INNER JOIN ResourceGroups AS RG ON PROV.GroupID = RG.GroupID
WHERE
S.ServerID = @ServerID
AND @IsAdmin = 1
ORDER BY RG.GroupOrder
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetServicesByServerIDGroupName
(
@ActorID int,
@ServerID int,
@GroupName nvarchar(50)
)
AS
-- check rights
DECLARE @IsAdmin bit
SET @IsAdmin = dbo.CheckIsUserAdmin(@ActorID)
SELECT
S.ServiceID,
S.ServerID,
S.ServiceName,
S.Comments,
S.ServiceQuotaValue,
RG.GroupName,
PROV.DisplayName AS ProviderName
FROM Services AS S
INNER JOIN Providers AS PROV ON S.ProviderID = PROV.ProviderID
INNER JOIN ResourceGroups AS RG ON PROV.GroupID = RG.GroupID
WHERE
S.ServerID = @ServerID AND RG.GroupName = @GroupName
AND @IsAdmin = 1
ORDER BY RG.GroupOrder
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetSiteCert]
(
@ActorID int,
@ID int
)
AS
SELECT
[UserID], [SiteID], [Hostname], [CSR], [Certificate], [Hash], [Installed], [IsRenewal]
FROM
[dbo].[SSLCertificates]
INNER JOIN
[dbo].[ServiceItems] AS [SI] ON [SSLCertificates].[SiteID] = [SI].[ItemID]
WHERE
[SiteID] = @ID AND [Installed] = 1 AND [dbo].CheckActorPackageRights(@ActorID, [SI].[PackageID]) = 1
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetSSLCertificateByID]
(
@ActorID int,
@ID int
)
AS
SELECT
[ID], [UserID], [SiteID], [Hostname], [FriendlyName], [CSR], [Certificate], [Hash], [Installed], [IsRenewal], [PreviousId]
FROM
[dbo].[SSLCertificates]
INNER JOIN
[dbo].[ServiceItems] AS [SI] ON [SSLCertificates].[SiteID] = [SI].[ItemID]
WHERE
[ID] = @ID AND [dbo].CheckActorPackageRights(@ActorID, [SI].[PackageID]) = 1
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetSystemSettings
@SettingsName nvarchar(50)
AS
BEGIN
SET NOCOUNT ON;
SELECT
[PropertyName],
[PropertyValue]
FROM
[dbo].[SystemSettings]
WHERE
[SettingsName] = @SettingsName;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetUnallottedIPAddresses]
@PackageID int,
@ServiceID int,
@PoolID int = 0
AS
BEGIN
DECLARE @ParentPackageID int
DECLARE @ServerID int
SELECT
@ParentPackageID = ParentPackageID,
@ServerID = ServerID
FROM Packages
WHERE PackageID = @PackageId
IF (@ParentPackageID = 1 OR @PoolID = 4 /* management network */) -- "System" space
BEGIN
-- check if server is physical
IF EXISTS(SELECT * FROM Servers WHERE ServerID = @ServerID AND VirtualServer = 0)
BEGIN
-- physical server
SELECT
IP.AddressID,
IP.ExternalIP,
IP.InternalIP,
IP.ServerID,
IP.PoolID,
IP.SubnetMask,
IP.DefaultGateway
FROM dbo.IPAddresses AS IP
WHERE
IP.ServerID = @ServerID
AND IP.AddressID NOT IN (SELECT PIP.AddressID FROM dbo.PackageIPAddresses AS PIP)
AND (@PoolID = 0 OR @PoolID <> 0 AND IP.PoolID = @PoolID)
ORDER BY IP.DefaultGateway, IP.ExternalIP
END
ELSE
BEGIN
-- virtual server
-- get resource group by service
DECLARE @GroupID int
SELECT @GroupID = P.GroupID FROM Services AS S
INNER JOIN Providers AS P ON S.ProviderID = P.ProviderID
WHERE S.ServiceID = @ServiceID
SELECT
IP.AddressID,
IP.ExternalIP,
IP.InternalIP,
IP.ServerID,
IP.PoolID,
IP.SubnetMask,
IP.DefaultGateway
FROM dbo.IPAddresses AS IP
WHERE
IP.ServerID IN (
SELECT SVC.ServerID FROM [dbo].[Services] AS SVC
INNER JOIN [dbo].[Providers] AS P ON SVC.ProviderID = P.ProviderID
WHERE [SVC].[ServiceID] = @ServiceId AND P.GroupID = @GroupID
)
AND IP.AddressID NOT IN (SELECT PIP.AddressID FROM dbo.PackageIPAddresses AS PIP)
AND (@PoolID = 0 OR @PoolID <> 0 AND IP.PoolID = @PoolID)
ORDER BY IP.DefaultGateway, IP.ExternalIP
END
END
ELSE -- 2rd level space and below
BEGIN
-- get service location
SELECT @ServerID = S.ServerID FROM Services AS S
WHERE S.ServiceID = @ServiceID
SELECT
IP.AddressID,
IP.ExternalIP,
IP.InternalIP,
IP.ServerID,
IP.PoolID,
IP.SubnetMask,
IP.DefaultGateway
FROM dbo.PackageIPAddresses AS PIP
INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID
WHERE
PIP.PackageID = @ParentPackageID
AND PIP.ItemID IS NULL
AND (@PoolID = 0 OR @PoolID <> 0 AND IP.PoolID = @PoolID)
AND IP.ServerID = @ServerID
ORDER BY IP.DefaultGateway, IP.ExternalIP
END
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetUserAvailableHostingAddons
(
@ActorID int,
@UserID int
)
AS
-- user should see the plans only of his reseller
-- also user can create packages based on his own plans (admins and resellers)
DECLARE @Plans TABLE
(
PlanID int
)
-- check rights
IF dbo.CheckActorUserRights(@ActorID, @UserID) = 0
RAISERROR('You are not allowed to access this account', 16, 1)
DECLARE @OwnerID int
SELECT @OwnerID = OwnerID FROM Users
WHERE UserID = @UserID
SELECT
HP.PlanID,
HP.PackageID,
HP.PlanName,
HP.PlanDescription,
HP.Available,
HP.ServerID,
HP.SetupPrice,
HP.RecurringPrice,
HP.RecurrenceLength,
HP.RecurrenceUnit,
HP.IsAddon
FROM
HostingPlans AS HP
WHERE HP.UserID = @OwnerID
AND HP.IsAddon = 1
ORDER BY PlanName
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetUserAvailableHostingPlans
(
@ActorID int,
@UserID int
)
AS
-- user should see the plans only of his reseller
-- also user can create packages based on his own plans (admins and resellers)
DECLARE @Plans TABLE
(
PlanID int
)
-- check rights
IF dbo.CheckActorUserRights(@ActorID, @UserID) = 0
RAISERROR('You are not allowed to access this account', 16, 1)
DECLARE @OwnerID int
SELECT @OwnerID = OwnerID FROM Users
WHERE UserID = @UserID
SELECT
HP.PlanID,
HP.PackageID,
HP.PlanName,
HP.PlanDescription,
HP.Available,
HP.ServerID,
HP.SetupPrice,
HP.RecurringPrice,
HP.RecurrenceLength,
HP.RecurrenceUnit,
HP.IsAddon
FROM
HostingPlans AS HP
WHERE HP.UserID = @OwnerID
AND HP.IsAddon = 0
ORDER BY PlanName
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetUserByExchangeOrganizationIdInternally]
(
@ItemID int
)
AS
SELECT
U.UserID,
U.RoleID,
U.StatusID,
U.SubscriberNumber,
U.LoginStatusId,
U.FailedLogins,
U.OwnerID,
U.Created,
U.Changed,
U.IsDemo,
U.Comments,
U.IsPeer,
U.Username,
U.Password,
U.FirstName,
U.LastName,
U.Email,
U.SecondaryEmail,
U.Address,
U.City,
U.State,
U.Country,
U.Zip,
U.PrimaryPhone,
U.SecondaryPhone,
U.Fax,
U.InstantMessenger,
U.HtmlMail,
U.CompanyName,
U.EcommerceEnabled,
U.[AdditionalParams]
FROM Users AS U
WHERE U.UserID IN (SELECT UserID FROM Packages WHERE PackageID IN (
SELECT PackageID FROM ServiceItems WHERE ItemID = @ItemID))
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetUserById]
(
@ActorID int,
@UserID int
)
AS
-- user can retrieve his own account, his users accounts
-- and his reseller account (without pasword)
SELECT
U.UserID,
U.RoleID,
U.StatusID,
U.SubscriberNumber,
U.LoginStatusId,
U.FailedLogins,
U.OwnerID,
U.Created,
U.Changed,
U.IsDemo,
U.Comments,
U.IsPeer,
U.Username,
CASE WHEN dbo.CanGetUserPassword(@ActorID, @UserID) = 1 THEN U.Password
ELSE '' END AS Password,
U.FirstName,
U.LastName,
U.Email,
U.SecondaryEmail,
U.Address,
U.City,
U.State,
U.Country,
U.Zip,
U.PrimaryPhone,
U.SecondaryPhone,
U.Fax,
U.InstantMessenger,
U.HtmlMail,
U.CompanyName,
U.EcommerceEnabled,
U.[AdditionalParams]
FROM Users AS U
WHERE U.UserID = @UserID
AND dbo.CanGetUserDetails(@ActorID, @UserID) = 1 -- actor user rights
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetUserByIdInternally]
(
@UserID int
)
AS
SELECT
U.UserID,
U.RoleID,
U.StatusID,
U.SubscriberNumber,
U.LoginStatusId,
U.FailedLogins,
U.OwnerID,
U.Created,
U.Changed,
U.IsDemo,
U.Comments,
U.IsPeer,
U.Username,
U.Password,
U.FirstName,
U.LastName,
U.Email,
U.SecondaryEmail,
U.Address,
U.City,
U.State,
U.Country,
U.Zip,
U.PrimaryPhone,
U.SecondaryPhone,
U.Fax,
U.InstantMessenger,
U.HtmlMail,
U.CompanyName,
U.EcommerceEnabled,
U.[AdditionalParams]
FROM Users AS U
WHERE U.UserID = @UserID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetUserByUsername]
(
@ActorID int,
@Username nvarchar(50)
)
AS
SELECT
U.UserID,
U.RoleID,
U.StatusID,
U.SubscriberNumber,
U.LoginStatusId,
U.FailedLogins,
U.OwnerID,
U.Created,
U.Changed,
U.IsDemo,
U.Comments,
U.IsPeer,
U.Username,
CASE WHEN dbo.CanGetUserPassword(@ActorID, UserID) = 1 THEN U.Password
ELSE '' END AS Password,
U.FirstName,
U.LastName,
U.Email,
U.SecondaryEmail,
U.Address,
U.City,
U.State,
U.Country,
U.Zip,
U.PrimaryPhone,
U.SecondaryPhone,
U.Fax,
U.InstantMessenger,
U.HtmlMail,
U.CompanyName,
U.EcommerceEnabled,
U.[AdditionalParams]
FROM Users AS U
WHERE U.Username = @Username
AND dbo.CanGetUserDetails(@ActorID, UserID) = 1 -- actor user rights
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetUserByUsernameInternally]
(
@Username nvarchar(50)
)
AS
SELECT
U.UserID,
U.RoleID,
U.StatusID,
U.SubscriberNumber,
U.LoginStatusId,
U.FailedLogins,
U.OwnerID,
U.Created,
U.Changed,
U.IsDemo,
U.Comments,
U.IsPeer,
U.Username,
U.Password,
U.FirstName,
U.LastName,
U.Email,
U.SecondaryEmail,
U.Address,
U.City,
U.State,
U.Country,
U.Zip,
U.PrimaryPhone,
U.SecondaryPhone,
U.Fax,
U.InstantMessenger,
U.HtmlMail,
U.CompanyName,
U.EcommerceEnabled,
U.[AdditionalParams]
FROM Users AS U
WHERE U.Username = @Username
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetUserDomainsPaged]
(
@ActorID int,
@UserID int,
@FilterColumn nvarchar(50) = '',
@FilterValue nvarchar(50) = '',
@SortColumn nvarchar(50),
@StartRow int,
@MaximumRows int
)
AS
-- build query and run it to the temporary table
DECLARE @sql nvarchar(2000)
SET @sql = '
DECLARE @HasUserRights bit
SET @HasUserRights = dbo.CheckActorUserRights(@ActorID, @UserID)
DECLARE @EndRow int
SET @EndRow = @StartRow + @MaximumRows
DECLARE @Users TABLE
(
ItemPosition int IDENTITY(1,1),
UserID int,
DomainID int
)
INSERT INTO @Users (UserID, DomainID)
SELECT
U.UserID,
D.DomainID
FROM Users AS U
INNER JOIN UsersTree(@UserID, 1) AS UT ON U.UserID = UT.UserID
LEFT OUTER JOIN Packages AS P ON U.UserID = P.UserID
LEFT OUTER JOIN Domains AS D ON P.PackageID = D.PackageID
WHERE
U.UserID <> @UserID AND U.IsPeer = 0
AND @HasUserRights = 1 '
IF @FilterColumn <> '' AND @FilterValue <> ''
SET @sql = @sql + ' AND ' + @FilterColumn + ' LIKE @FilterValue '
IF @SortColumn <> '' AND @SortColumn IS NOT NULL
SET @sql = @sql + ' ORDER BY ' + @SortColumn + ' '
SET @sql = @sql + ' SELECT COUNT(UserID) FROM @Users;
SELECT
U.UserID,
U.RoleID,
U.StatusID,
U.SubscriberNumber,
U.LoginStatusId,
U.FailedLogins,
U.OwnerID,
U.Created,
U.Changed,
U.IsDemo,
U.Comments,
U.IsPeer,
U.Username,
U.FirstName,
U.LastName,
U.Email,
D.DomainName
FROM @Users AS TU
INNER JOIN Users AS U ON TU.UserID = U.UserID
LEFT OUTER JOIN Domains AS D ON TU.DomainID = D.DomainID
WHERE TU.ItemPosition BETWEEN @StartRow AND @EndRow'
exec sp_executesql @sql, N'@StartRow int, @MaximumRows int, @UserID int, @FilterValue nvarchar(50), @ActorID int',
@StartRow, @MaximumRows, @UserID, @FilterValue, @ActorID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetUserParents]
(
@ActorID int,
@UserID int
)
AS
-- check rights
IF dbo.CheckActorUserRights(@ActorID, @UserID) = 0
RAISERROR('You are not allowed to access this account', 16, 1)
SELECT
U.UserID,
U.RoleID,
U.StatusID,
U.SubscriberNumber,
U.LoginStatusId,
U.FailedLogins,
U.OwnerID,
U.Created,
U.Changed,
U.IsDemo,
U.Comments,
U.IsPeer,
U.Username,
U.FirstName,
U.LastName,
U.Email,
U.CompanyName,
U.EcommerceEnabled
FROM UserParents(@ActorID, @UserID) AS UP
INNER JOIN Users AS U ON UP.UserID = U.UserID
ORDER BY UP.UserOrder DESC
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetUserPeers]
(
@ActorID int,
@UserID int
)
AS
DECLARE @CanGetDetails bit
SET @CanGetDetails = dbo.CanGetUserDetails(@ActorID, @UserID)
SELECT
U.UserID,
U.RoleID,
U.StatusID,
U.LoginStatusId,
U.FailedLogins,
U.OwnerID,
U.Created,
U.Changed,
U.IsDemo,
U.Comments,
U.IsPeer,
U.Username,
U.FirstName,
U.LastName,
U.Email,
U.FullName,
(U.FirstName + ' ' + U.LastName) AS FullName,
U.CompanyName,
U.EcommerceEnabled
FROM UsersDetailed AS U
WHERE U.OwnerID = @UserID AND IsPeer = 1
AND @CanGetDetails = 1 -- actor rights
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetUsers]
(
@ActorID int,
@OwnerID int,
@Recursive bit = 0
)
AS
DECLARE @CanGetDetails bit
SET @CanGetDetails = dbo.CanGetUserDetails(@ActorID, @OwnerID)
SELECT
U.UserID,
U.RoleID,
U.StatusID,
U.SubscriberNumber,
U.LoginStatusId,
U.FailedLogins,
U.OwnerID,
U.Created,
U.Changed,
U.IsDemo,
U.Comments,
U.IsPeer,
U.Username,
U.FirstName,
U.LastName,
U.Email,
U.FullName,
U.OwnerUsername,
U.OwnerFirstName,
U.OwnerLastName,
U.OwnerRoleID,
U.OwnerFullName,
U.PackagesNumber,
U.CompanyName,
U.EcommerceEnabled
FROM UsersDetailed AS U
WHERE U.UserID <> @OwnerID AND
((@Recursive = 1 AND dbo.CheckUserParent(@OwnerID, U.UserID) = 1) OR
(@Recursive = 0 AND U.OwnerID = @OwnerID))
AND U.IsPeer = 0
AND @CanGetDetails = 1 -- actor user rights
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/*
Algorythm:
0. Get the primary distribution resource from hosting plan
1. Check whether user has Resource of requested type in his user plans/add-ons
EXCEPTION "The requested service is not available for the user. The resource of the requested type {type} should be assigned to him through hosting plan or add-on"
1.1 If the number of returned reources is greater than 1
EXCEPTION "User has several resources assigned of the requested type"
2. If the requested resource has 0 services
EXCEPTION "The resource {name} of type {type} should contain atleast one service
3. If the requested resource has one service
remember the ID of this single service
4. If the requested resource has several services DO distribution:
4.1. If the resource is NOT BOUNDED or is PRIMARY DISTRIBUTION RESOURCE
if PRIMARY DISTRIBUTION RESOURCE and exists in UserServices
return serviceId from UserServices table
remember any service from that resource according to distribution type ("BALANCED" or "RANDOM") - get the number of ServiceItems for each service
4.2. If the resource is BOUNDED to primary distribution resource
- If the primary distribution resource is NULL
EXCEPTION "Requested resource marked as bound to primary distribution resource, but there is no any resources in hosting plan marked as primary"
- Get the service id of the primary distribution resource
GetServiceId(userId, primaryResourceId)
Get from user assigned hosting plan
5. If it is PRIMARY DISTRIBUTION RESOURCE
Save it's ID to UserServices table
6. return serviceId
ERROR CODES:
-1 - there are several hosting plans with PDR assigned to that user
-2 - The requested service is not available for the user. The resource of the
requested type {type} should be assigned to him through hosting plan or add-on
-3 - several resources of the same type was assigned through hosting plan or add-on
-4 - The resource {name} of type {type} should contain atleast one service
-5 - Requested resource marked as bound to primary distribution resource,
but there is no any resources in hosting plan marked as primary
-6 - the server where PDR is located doesn't contain the service of requested resource type
*/
CREATE PROCEDURE GetUserServiceID
(
@UserID int,
@TypeName nvarchar(1000),
@ServiceID int OUTPUT
)
AS
DECLARE @PrimaryResourceID int -- primary distribution resource assigned through hosting plan
----------------------------------------
-- Get the primary distribution resource
----------------------------------------
IF (SELECT COUNT (HP.PrimaryResourceID) FROM PurchasedHostingPlans AS PHP
INNER JOIN HostingPlans AS HP ON PHP.PlanID = HP.PlanID
WHERE PHP.UserID = @UserID AND HP.PrimaryResourceID IS NOT NULL AND HP.PrimaryResourceID <> 0) > 1
BEGIN
SET @ServiceID = -1
RETURN
END
SELECT @PrimaryResourceID = HP.PrimaryResourceID FROM PurchasedHostingPlans AS PHP
INNER JOIN HostingPlans AS HP ON PHP.PlanID = HP.PlanID
WHERE PHP.UserID = @UserID AND HP.PrimaryResourceID IS NOT NULL AND HP.PrimaryResourceID <> 0
----------------------------------------------
-- Check whether user has a resource
-- of this type in his hosting plans or addons
----------------------------------------------
DECLARE @UserResourcesTable TABLE
(
ResourceID int
)
INSERT INTO @UserResourcesTable
SELECT DISTINCT HPR.ResourceID FROM PurchasedHostingPlans AS PHP
INNER JOIN HostingPlans AS HP ON PHP.PlanID = HP.PlanID
INNER JOIN HostingPlanResources AS HPR ON HP.PlanID = HPR.PlanID
INNER JOIN Resources AS R ON HPR.ResourceID = R.ResourceID
INNER JOIN ServiceTypes AS ST ON R.ServiceTypeID = ST.ServiceTypeID
WHERE PHP.UserID = @UserID AND (ST.ImplementedTypeNames LIKE @TypeName OR ST.TypeName LIKE @TypeName)
----------------------------------------
-- Check resources number
----------------------------------------
DECLARE @ResourcesCount int
SET @ResourcesCount = @@ROWCOUNT
IF @ResourcesCount = 0
BEGIN
SET @ServiceID = -2 -- user doesn't have requested service assigned
RETURN
END
IF @ResourcesCount > 1
BEGIN
SET @ServiceID = -3 -- several resources of the same type was assigned
RETURN
END
----------------------------------------
-- Check services number
----------------------------------------
DECLARE @ResourceID int
SET @ResourceID = (SELECT TOP 1 ResourceID FROM @UserResourcesTable)
DECLARE @UserServicesTable TABLE
(
ServiceID int,
ServerID int,
ItemsNumber int,
Randomizer float
)
INSERT INTO @UserServicesTable
SELECT
RS.ServiceID,
S.ServerID,
(SELECT COUNT(ItemID) FROM ServiceItems AS SI WHERE SI.ServiceID = RS.ServiceID),
RAND()
FROM ResourceServices AS RS
INNER JOIN Services AS S ON RS.ServiceID = S.ServiceID
WHERE RS.ResourceID = @ResourceID
DECLARE @ServicesCount int
SET @ServicesCount = @@ROWCOUNT
IF @ServicesCount = 0
BEGIN
SET @ServiceID = -4 -- The resource {name} of type {type} should contain atleast one service
RETURN
END
-- try to return from UserServices
-- if it is a PDR
IF @ResourceID = @PrimaryResourceID
BEGIN
-- check in UserServices table
SELECT @ServiceID = US.ServiceID FROM ResourceServices AS RS
INNER JOIN UserServices AS US ON RS.ServiceID = US.ServiceID
WHERE RS.ResourceID = @ResourceID AND US.UserID = @UserID
-- check validness of the current primary service id
IF @ServiceID IS NOT NULL
BEGIN
IF EXISTS(SELECT ResourceServiceID FROM ResourceServices
WHERE ResourceID = @ResourceID AND ServiceID = @ServiceID)
RETURN
ELSE -- invalidate service
DELETE FROM UserServices WHERE UserID = @UserID
END
END
IF @ServicesCount = 1
BEGIN
-- nothing to distribute
-- just remember this single service id
SET @ServiceID = (SELECT TOP 1 ServiceID FROM @UserServicesTable)
END
ELSE
BEGIN
-- the service should be distributed
DECLARE @DistributionTypeID int
DECLARE @BoundToPrimaryResource bit
SELECT @DistributionTypeID = R.DistributionTypeID, @BoundToPrimaryResource = R.BoundToPrimaryResource
FROM Resources AS R WHERE R.ResourceID = @ResourceID
IF @BoundToPrimaryResource = 0 OR @ResourceID = @PrimaryResourceID
BEGIN
IF @ResourceID = @PrimaryResourceID -- it's PDR itself
BEGIN
-- check in UserServices table
SELECT @ServiceID = US.ServiceID FROM ResourceServices AS RS
INNER JOIN UserServices AS US ON RS.ServiceID = US.ServiceID
WHERE RS.ResourceID = @ResourceID AND US.UserID = @UserID
-- check validness of the current primary service id
IF @ServiceID IS NOT NULL
BEGIN
IF EXISTS(SELECT ResourceServiceID FROM ResourceServices
WHERE ResourceID = @ResourceID AND ServiceID = @ServiceID)
RETURN
ELSE -- invalidate service
DELETE FROM UserServices WHERE UserID = @UserID
END
END
-- distribute
IF @DistributionTypeID = 1 -- BALANCED distribution
SELECT @ServiceID = ServiceID FROM @UserServicesTable
ORDER BY ItemsNumber ASC
ELSE -- RANDOM distribution
SELECT @ServiceID = ServiceID FROM @UserServicesTable
ORDER BY Randomizer
END
ELSE -- BOUND to PDR resource
BEGIN
IF @PrimaryResourceID IS NULL
BEGIN
SET @ServiceID = -5 -- Requested resource marked as bound to primary distribution resource,
-- but there is no any resources in hosting plan marked as primary
RETURN
END
-- get the type of primary resource
DECLARE @PrimaryTypeName nvarchar(200)
SELECT @PrimaryTypeName = ST.TypeName FROM Resources AS R
INNER JOIN ServiceTypes AS ST ON R.ServiceTypeID = ST.ServiceTypeID
WHERE R.ResourceID = @PrimaryResourceID
DECLARE @PrimaryServiceID int
EXEC GetUserServiceID @UserID, @PrimaryTypeName, @PrimaryServiceID OUTPUT
IF @PrimaryServiceID < 0
BEGIN
SET @ServiceID = @PrimaryServiceID
RETURN
END
DECLARE @ServerID int
SET @ServerID = (SELECT ServerID FROM Services WHERE ServiceID = @PrimaryServiceID)
-- try to get the service of the requested type on PDR server
SET @ServiceID = (SELECT ServiceID FROM @UserServicesTable WHERE ServerID = @ServerID)
IF @ServiceID IS NULL
BEGIN
SET @ServiceID = -6 -- the server where PDR is located doesn't contain the service of requested resource type
END
END
END
IF @ResourceID = @PrimaryResourceID -- it's PDR
BEGIN
DELETE FROM UserServices WHERE UserID = @UserID
INSERT INTO UserServices (UserID, ServiceID)
VALUES (@UserID, @ServiceID)
END
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetUserSettings
(
@ActorID int,
@UserID int,
@SettingsName nvarchar(50)
)
AS
-- check rights
IF dbo.CheckActorUserRights(@ActorID, @UserID) = 0
RAISERROR('You are not allowed to access this account', 16, 1)
-- find which parent package has overriden NS
DECLARE @ParentUserID int, @TmpUserID int
SET @TmpUserID = @UserID
WHILE 10 = 10
BEGIN
IF EXISTS
(
SELECT PropertyName FROM UserSettings
WHERE SettingsName = @SettingsName AND UserID = @TmpUserID
)
BEGIN
SELECT
UserID,
PropertyName,
PropertyValue
FROM
UserSettings
WHERE
UserID = @TmpUserID AND
SettingsName = @SettingsName
BREAK
END
SET @ParentUserID = NULL --reset var
-- get owner
SELECT
@ParentUserID = OwnerID
FROM Users
WHERE UserID = @TmpUserID
IF @ParentUserID IS NULL -- the last parent
BREAK
SET @TmpUserID = @ParentUserID
END
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetUsersPaged]
(
@ActorID int,
@UserID int,
@FilterColumn nvarchar(50) = '',
@FilterValue nvarchar(50) = '',
@StatusID int,
@RoleID int,
@SortColumn nvarchar(50),
@StartRow int,
@MaximumRows int,
@Recursive bit
)
AS
-- build query and run it to the temporary table
DECLARE @sql nvarchar(2000)
SET @sql = '
DECLARE @HasUserRights bit
SET @HasUserRights = dbo.CheckActorUserRights(@ActorID, @UserID)
DECLARE @EndRow int
SET @EndRow = @StartRow + @MaximumRows
DECLARE @Users TABLE
(
ItemPosition int IDENTITY(0,1),
UserID int
)
INSERT INTO @Users (UserID)
SELECT
U.UserID
FROM UsersDetailed AS U
WHERE
U.UserID <> @UserID AND U.IsPeer = 0 AND
(
(@Recursive = 0 AND OwnerID = @UserID) OR
(@Recursive = 1 AND dbo.CheckUserParent(@UserID, U.UserID) = 1)
)
AND ((@StatusID = 0) OR (@StatusID > 0 AND U.StatusID = @StatusID))
AND ((@RoleID = 0) OR (@RoleID > 0 AND U.RoleID = @RoleID))
AND @HasUserRights = 1 '
IF @FilterColumn <> '' AND @FilterValue <> ''
SET @sql = @sql + ' AND ' + @FilterColumn + ' LIKE @FilterValue '
IF @SortColumn <> '' AND @SortColumn IS NOT NULL
SET @sql = @sql + ' ORDER BY ' + @SortColumn + ' '
SET @sql = @sql + ' SELECT COUNT(UserID) FROM @Users;
SELECT
U.UserID,
U.RoleID,
U.StatusID,
U.SubscriberNumber,
U.LoginStatusId,
U.FailedLogins,
U.OwnerID,
U.Created,
U.Changed,
U.IsDemo,
dbo.GetItemComments(U.UserID, ''USER'', @ActorID) AS Comments,
U.IsPeer,
U.Username,
U.FirstName,
U.LastName,
U.Email,
U.FullName,
U.OwnerUsername,
U.OwnerFirstName,
U.OwnerLastName,
U.OwnerRoleID,
U.OwnerFullName,
U.OwnerEmail,
U.PackagesNumber,
U.CompanyName,
U.EcommerceEnabled
FROM @Users AS TU
INNER JOIN UsersDetailed AS U ON TU.UserID = U.UserID
WHERE TU.ItemPosition BETWEEN @StartRow AND @EndRow'
exec sp_executesql @sql, N'@StartRow int, @MaximumRows int, @UserID int, @FilterValue nvarchar(50), @ActorID int, @Recursive bit, @StatusID int, @RoleID int',
@StartRow, @MaximumRows, @UserID, @FilterValue, @ActorID, @Recursive, @StatusID, @RoleID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetUsersSummary
(
@ActorID int,
@UserID int
)
AS
-- check rights
IF dbo.CheckActorUserRights(@ActorID, @UserID) = 0
RAISERROR('You are not allowed to access this account', 16, 1)
-- ALL users
SELECT COUNT(UserID) AS UsersNumber FROM Users
WHERE OwnerID = @UserID AND IsPeer = 0
-- BY STATUS users
SELECT StatusID, COUNT(UserID) AS UsersNumber FROM Users
WHERE OwnerID = @UserID AND IsPeer = 0
GROUP BY StatusID
ORDER BY StatusID
-- BY ROLE users
SELECT RoleID, COUNT(UserID) AS UsersNumber FROM Users
WHERE OwnerID = @UserID AND IsPeer = 0
GROUP BY RoleID
ORDER BY RoleID DESC
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetVirtualMachinesPaged]
(
@ActorID int,
@PackageID int,
@FilterColumn nvarchar(50) = '',
@FilterValue nvarchar(50) = '',
@SortColumn nvarchar(50),
@StartRow int,
@MaximumRows int,
@Recursive bit
)
AS
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
-- start
DECLARE @condition nvarchar(700)
SET @condition = '
SI.ItemTypeID = 33 -- VPS
AND ((@Recursive = 0 AND P.PackageID = @PackageID)
OR (@Recursive = 1 AND dbo.CheckPackageParent(@PackageID, P.PackageID) = 1))
'
IF @FilterColumn <> '' AND @FilterColumn IS NOT NULL
AND @FilterValue <> '' AND @FilterValue IS NOT NULL
SET @condition = @condition + ' AND ' + @FilterColumn + ' LIKE ''' + @FilterValue + ''''
IF @SortColumn IS NULL OR @SortColumn = ''
SET @SortColumn = 'SI.ItemName ASC'
DECLARE @sql nvarchar(3500)
set @sql = '
SELECT COUNT(SI.ItemID) FROM Packages AS P
INNER JOIN ServiceItems AS SI ON P.PackageID = SI.PackageID
INNER JOIN Users AS U ON P.UserID = U.UserID
LEFT OUTER JOIN (
SELECT PIP.ItemID, IP.ExternalIP FROM PackageIPAddresses AS PIP
INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID
WHERE PIP.IsPrimary = 1 AND IP.PoolID = 3 -- external IP addresses
) AS EIP ON SI.ItemID = EIP.ItemID
LEFT OUTER JOIN PrivateIPAddresses AS PIP ON PIP.ItemID = SI.ItemID AND PIP.IsPrimary = 1
WHERE ' + @condition + '
DECLARE @Items AS TABLE
(
ItemID int
);
WITH TempItems AS (
SELECT ROW_NUMBER() OVER (ORDER BY ' + @SortColumn + ') as Row,
SI.ItemID
FROM Packages AS P
INNER JOIN ServiceItems AS SI ON P.PackageID = SI.PackageID
INNER JOIN Users AS U ON P.UserID = U.UserID
LEFT OUTER JOIN (
SELECT PIP.ItemID, IP.ExternalIP FROM PackageIPAddresses AS PIP
INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID
WHERE PIP.IsPrimary = 1 AND IP.PoolID = 3 -- external IP addresses
) AS EIP ON SI.ItemID = EIP.ItemID
LEFT OUTER JOIN PrivateIPAddresses AS PIP ON PIP.ItemID = SI.ItemID AND PIP.IsPrimary = 1
WHERE ' + @condition + '
)
INSERT INTO @Items
SELECT ItemID FROM TempItems
WHERE TempItems.Row BETWEEN @StartRow + 1 and @StartRow + @MaximumRows
SELECT
SI.ItemID,
SI.ItemName,
SI.PackageID,
P.PackageName,
P.UserID,
U.Username,
EIP.ExternalIP,
PIP.IPAddress
FROM @Items AS TSI
INNER JOIN ServiceItems AS SI ON TSI.ItemID = SI.ItemID
INNER JOIN Packages AS P ON SI.PackageID = P.PackageID
INNER JOIN Users AS U ON P.UserID = U.UserID
LEFT OUTER JOIN (
SELECT PIP.ItemID, IP.ExternalIP FROM PackageIPAddresses AS PIP
INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID
WHERE PIP.IsPrimary = 1 AND IP.PoolID = 3 -- external IP addresses
) AS EIP ON SI.ItemID = EIP.ItemID
LEFT OUTER JOIN PrivateIPAddresses AS PIP ON PIP.ItemID = SI.ItemID AND PIP.IsPrimary = 1
'
--print @sql
exec sp_executesql @sql, N'@PackageID int, @StartRow int, @MaximumRows int, @Recursive bit',
@PackageID, @StartRow, @MaximumRows, @Recursive
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetVirtualMachinesPagedForPC]
(
@ActorID int,
@PackageID int,
@FilterColumn nvarchar(50) = '',
@FilterValue nvarchar(50) = '',
@SortColumn nvarchar(50),
@StartRow int,
@MaximumRows int,
@Recursive bit
)
AS
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
BEGIN
RAISERROR('You are not allowed to access this package', 16, 1)
RETURN
END
-- start
DECLARE @condition nvarchar(700)
SET @condition = '
SI.ItemTypeID = 35 -- VPS
AND ((@Recursive = 0 AND P.PackageID = @PackageID)
OR (@Recursive = 1 AND dbo.CheckPackageParent(@PackageID, P.PackageID) = 1))
'
IF @FilterColumn <> '' AND @FilterColumn IS NOT NULL
AND @FilterValue <> '' AND @FilterValue IS NOT NULL
SET @condition = @condition + ' AND ' + @FilterColumn + ' LIKE ''' + @FilterValue + ''''
IF @SortColumn IS NULL OR @SortColumn = ''
SET @SortColumn = 'SI.ItemName ASC'
DECLARE @sql nvarchar(3500)
set @sql = '
SELECT COUNT(SI.ItemID) FROM Packages AS P
INNER JOIN ServiceItems AS SI ON P.PackageID = SI.PackageID
INNER JOIN Users AS U ON P.UserID = U.UserID
LEFT OUTER JOIN (
SELECT PIP.ItemID, IP.ExternalIP FROM PackageIPAddresses AS PIP
INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID
WHERE PIP.IsPrimary = 1 AND IP.PoolID = 3 -- external IP addresses
) AS EIP ON SI.ItemID = EIP.ItemID
LEFT OUTER JOIN PrivateIPAddresses AS PIP ON PIP.ItemID = SI.ItemID AND PIP.IsPrimary = 1
WHERE ' + @condition + '
DECLARE @Items AS TABLE
(
ItemID int
);
WITH TempItems AS (
SELECT ROW_NUMBER() OVER (ORDER BY ' + @SortColumn + ') as Row,
SI.ItemID
FROM Packages AS P
INNER JOIN ServiceItems AS SI ON P.PackageID = SI.PackageID
INNER JOIN Users AS U ON P.UserID = U.UserID
LEFT OUTER JOIN (
SELECT PIP.ItemID, IP.ExternalIP FROM PackageIPAddresses AS PIP
INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID
WHERE PIP.IsPrimary = 1 AND IP.PoolID = 3 -- external IP addresses
) AS EIP ON SI.ItemID = EIP.ItemID
LEFT OUTER JOIN PrivateIPAddresses AS PIP ON PIP.ItemID = SI.ItemID AND PIP.IsPrimary = 1
WHERE ' + @condition + '
)
INSERT INTO @Items
SELECT ItemID FROM TempItems
WHERE TempItems.Row BETWEEN @StartRow + 1 and @StartRow + @MaximumRows
SELECT
SI.ItemID,
SI.ItemName,
SI.PackageID,
P.PackageName,
P.UserID,
U.Username,
EIP.ExternalIP,
PIP.IPAddress
FROM @Items AS TSI
INNER JOIN ServiceItems AS SI ON TSI.ItemID = SI.ItemID
INNER JOIN Packages AS P ON SI.PackageID = P.PackageID
INNER JOIN Users AS U ON P.UserID = U.UserID
LEFT OUTER JOIN (
SELECT PIP.ItemID, IP.ExternalIP FROM PackageIPAddresses AS PIP
INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID
WHERE PIP.IsPrimary = 1 AND IP.PoolID = 3 -- external IP addresses
) AS EIP ON SI.ItemID = EIP.ItemID
LEFT OUTER JOIN PrivateIPAddresses AS PIP ON PIP.ItemID = SI.ItemID AND PIP.IsPrimary = 1
'
--print @sql
exec sp_executesql @sql, N'@PackageID int, @StartRow int, @MaximumRows int, @Recursive bit',
@PackageID, @StartRow, @MaximumRows, @Recursive
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetVirtualServers]
(
@ActorID int
)
AS
-- check rights
DECLARE @IsAdmin bit
SET @IsAdmin = dbo.CheckIsUserAdmin(@ActorID)
SELECT
S.ServerID,
S.ServerName,
S.ServerUrl,
(SELECT COUNT(SRV.ServiceID) FROM VirtualServices AS SRV WHERE S.ServerID = SRV.ServerID) AS ServicesNumber,
S.Comments,
PrimaryGroupID
FROM Servers AS S
WHERE
VirtualServer = 1
AND @IsAdmin = 1
ORDER BY S.ServerName
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[GetVirtualServices]
(
@ActorID int,
@ServerID int
)
AS
-- check rights
DECLARE @IsAdmin bit
SET @IsAdmin = dbo.CheckIsUserAdmin(@ActorID)
-- virtual groups
SELECT
VRG.VirtualGroupID,
RG.GroupID,
RG.GroupName,
ISNULL(VRG.DistributionType, 1) AS DistributionType,
ISNULL(VRG.BindDistributionToPrimary, 1) AS BindDistributionToPrimary
FROM ResourceGroups AS RG
LEFT OUTER JOIN VirtualGroups AS VRG ON RG.GroupID = VRG.GroupID AND VRG.ServerID = @ServerID
WHERE
@IsAdmin = 1 AND (ShowGroup = 1)
ORDER BY RG.GroupOrder
-- services
SELECT
VS.ServiceID,
S.ServiceName,
S.Comments,
P.GroupID,
P.DisplayName,
SRV.ServerName
FROM VirtualServices AS VS
INNER JOIN Services AS S ON VS.ServiceID = S.ServiceID
INNER JOIN Servers AS SRV ON S.ServerID = SRV.ServerID
INNER JOIN Providers AS P ON S.ProviderID = P.ProviderID
WHERE
VS.ServerID = @ServerID
AND @IsAdmin = 1
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[InsertCRMUser]
@ItemID int,
@CrmUserID uniqueidentifier,
@BusinessUnitID uniqueidentifier
AS
BEGIN
SET NOCOUNT ON;
INSERT INTO
CRMUsers
(
AccountID,
CRMUserGuid,
BusinessUnitID
)
VALUES
(
@ItemID,
@CrmUserID,
@BusinessUnitID
)
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[LyncUserExists]
(
@AccountID int,
@SipAddress nvarchar(300),
@Exists bit OUTPUT
)
AS
SET @Exists = 0
IF EXISTS(SELECT * FROM [dbo].[ExchangeAccountEmailAddresses] WHERE [EmailAddress] = @SipAddress AND [AccountID] <> @AccountID)
BEGIN
SET @Exists = 1
END
ELSE IF EXISTS(SELECT * FROM [dbo].[ExchangeAccounts] WHERE [PrimaryEmailAddress] = @SipAddress AND [AccountID] <> @AccountID)
BEGIN
SET @Exists = 1
END
ELSE IF EXISTS(SELECT * FROM [dbo].[ExchangeAccounts] WHERE [UserPrincipalName] = @SipAddress AND [AccountID] <> @AccountID)
BEGIN
SET @Exists = 1
END
ELSE IF EXISTS(SELECT * FROM [dbo].[ExchangeAccounts] WHERE [AccountName] = @SipAddress AND [AccountID] <> @AccountID)
BEGIN
SET @Exists = 1
END
ELSE IF EXISTS(SELECT * FROM [dbo].[LyncUsers] WHERE [SipAddress] = @SipAddress)
BEGIN
SET @Exists = 1
END
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[SfBUserExists]
(
@AccountID int,
@SipAddress nvarchar(300),
@Exists bit OUTPUT
)
AS
SET @Exists = 0
IF EXISTS(SELECT * FROM [dbo].[ExchangeAccountEmailAddresses] WHERE [EmailAddress] = @SipAddress AND [AccountID] <> @AccountID)
BEGIN
SET @Exists = 1
END
ELSE IF EXISTS(SELECT * FROM [dbo].[ExchangeAccounts] WHERE [PrimaryEmailAddress] = @SipAddress AND [AccountID] <> @AccountID)
BEGIN
SET @Exists = 1
END
ELSE IF EXISTS(SELECT * FROM [dbo].[ExchangeAccounts] WHERE [UserPrincipalName] = @SipAddress AND [AccountID] <> @AccountID)
BEGIN
SET @Exists = 1
END
ELSE IF EXISTS(SELECT * FROM [dbo].[ExchangeAccounts] WHERE [AccountName] = @SipAddress AND [AccountID] <> @AccountID)
BEGIN
SET @Exists = 1
END
ELSE IF EXISTS(SELECT * FROM [dbo].[SfBUsers] WHERE [SipAddress] = @SipAddress)
BEGIN
SET @Exists = 1
END
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[MoveServiceItem]
(
@ActorID int,
@ItemID int,
@DestinationServiceID int
)
AS
-- check rights
DECLARE @PackageID int
SELECT PackageID = @PackageID FROM ServiceItems
WHERE ItemID = @ItemID
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
BEGIN TRAN
UPDATE ServiceItems
SET ServiceID = @DestinationServiceID
WHERE ItemID = @ItemID
COMMIT TRAN
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[OrganizationExists]
(
@OrganizationID nvarchar(10),
@Exists bit OUTPUT
)
AS
SET @Exists = 0
IF EXISTS(SELECT * FROM Organizations WHERE OrganizationID = @OrganizationID)
BEGIN
SET @Exists = 1
END
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[OrganizationUserExists]
(
@LoginName nvarchar(20),
@Exists bit OUTPUT
)
AS
SET @Exists = 0
IF EXISTS(SELECT * FROM ExchangeAccounts WHERE AccountName = @LoginName)
BEGIN
SET @Exists = 1
END
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[SearchExchangeAccount]
(
@ActorID int,
@AccountType int,
@PrimaryEmailAddress nvarchar(300)
)
AS
DECLARE @PackageID int
DECLARE @ItemID int
DECLARE @AccountID int
SELECT
@AccountID = AccountID,
@ItemID = ItemID
FROM ExchangeAccounts
WHERE PrimaryEmailAddress = @PrimaryEmailAddress
AND AccountType = @AccountType
-- check space rights
SELECT @PackageID = PackageID FROM ServiceItems
WHERE ItemID = @ItemID
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
SELECT
AccountID,
ItemID,
@PackageID AS PackageID,
AccountType,
AccountName,
DisplayName,
PrimaryEmailAddress,
MailEnabledPublicFolder,
MailboxManagerActions,
SamAccountName,
AccountPassword,
SubscriberNumber,
UserPrincipalName
FROM ExchangeAccounts
WHERE AccountID = @AccountID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[SearchExchangeAccounts]
(
@ActorID int,
@ItemID int,
@IncludeMailboxes bit,
@IncludeContacts bit,
@IncludeDistributionLists bit,
@IncludeRooms bit,
@IncludeEquipment bit,
@FilterColumn nvarchar(50) = '',
@FilterValue nvarchar(50) = '',
@SortColumn nvarchar(50)
)
AS
DECLARE @PackageID int
SELECT @PackageID = PackageID FROM ServiceItems
WHERE ItemID = @ItemID
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
-- start
DECLARE @condition nvarchar(700)
SET @condition = '
((@IncludeMailboxes = 1 AND EA.AccountType = 1)
OR (@IncludeContacts = 1 AND EA.AccountType = 2)
OR (@IncludeDistributionLists = 1 AND EA.AccountType = 3)
OR (@IncludeRooms = 1 AND EA.AccountType = 5)
OR (@IncludeEquipment = 1 AND EA.AccountType = 6))
AND EA.ItemID = @ItemID
'
IF @FilterColumn <> '' AND @FilterColumn IS NOT NULL
AND @FilterValue <> '' AND @FilterValue IS NOT NULL
SET @condition = @condition + ' AND ' + @FilterColumn + ' LIKE ''' + @FilterValue + ''''
IF @SortColumn IS NULL OR @SortColumn = ''
SET @SortColumn = 'EA.DisplayName ASC'
DECLARE @sql nvarchar(3500)
set @sql = '
SELECT
EA.AccountID,
EA.ItemID,
EA.AccountType,
EA.AccountName,
EA.DisplayName,
EA.PrimaryEmailAddress,
EA.MailEnabledPublicFolder,
EA.SubscriberNumber,
EA.UserPrincipalName
FROM ExchangeAccounts AS EA
WHERE ' + @condition
print @sql
exec sp_executesql @sql, N'@ItemID int, @IncludeMailboxes int, @IncludeContacts int,
@IncludeDistributionLists int, @IncludeRooms bit, @IncludeEquipment bit',
@ItemID, @IncludeMailboxes, @IncludeContacts, @IncludeDistributionLists, @IncludeRooms, @IncludeEquipment
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[SearchOrganizationAccounts]
(
@ActorID int,
@ItemID int,
@FilterColumn nvarchar(50) = '',
@FilterValue nvarchar(50) = '',
@SortColumn nvarchar(50),
@IncludeMailboxes bit
)
AS
DECLARE @PackageID int
SELECT @PackageID = PackageID FROM ServiceItems
WHERE ItemID = @ItemID
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
-- start
DECLARE @condition nvarchar(700)
SET @condition = '
(EA.AccountType = 7 OR (EA.AccountType = 1 AND @IncludeMailboxes = 1) )
AND EA.ItemID = @ItemID
'
IF @FilterColumn <> '' AND @FilterColumn IS NOT NULL
AND @FilterValue <> '' AND @FilterValue IS NOT NULL
SET @condition = @condition + ' AND ' + @FilterColumn + ' LIKE ''' + @FilterValue + ''''
IF @SortColumn IS NULL OR @SortColumn = ''
SET @SortColumn = 'EA.DisplayName ASC'
DECLARE @sql nvarchar(3500)
set @sql = '
SELECT
EA.AccountID,
EA.ItemID,
EA.AccountType,
EA.AccountName,
EA.DisplayName,
EA.PrimaryEmailAddress,
EA.SubscriberNumber,
EA.UserPrincipalName
FROM ExchangeAccounts AS EA
WHERE ' + @condition
print @sql
exec sp_executesql @sql, N'@ItemID int, @IncludeMailboxes bit',
@ItemID, @IncludeMailboxes
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[SearchServiceItemsPaged]
(
@ActorID int,
@UserID int,
@ItemTypeID int,
@FilterValue nvarchar(50) = '',
@SortColumn nvarchar(50),
@StartRow int,
@MaximumRows int
)
AS
-- check rights
IF dbo.CheckActorUserRights(@ActorID, @UserID) = 0
RAISERROR('You are not allowed to access this account', 16, 1)
-- build query and run it to the temporary table
DECLARE @sql nvarchar(2000)
IF @ItemTypeID <> 13
BEGIN
SET @sql = '
DECLARE @EndRow int
SET @EndRow = @StartRow + @MaximumRows
DECLARE @Items TABLE
(
ItemPosition int IDENTITY(1,1),
ItemID int
)
INSERT INTO @Items (ItemID)
SELECT
SI.ItemID
FROM ServiceItems AS SI
INNER JOIN Packages AS P ON P.PackageID = SI.PackageID
INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID
WHERE
dbo.CheckUserParent(@UserID, P.UserID) = 1
AND SI.ItemTypeID = @ItemTypeID
'
IF @FilterValue <> ''
SET @sql = @sql + ' AND SI.ItemName LIKE @FilterValue '
IF @SortColumn = '' OR @SortColumn IS NULL
SET @SortColumn = 'ItemName'
SET @sql = @sql + ' ORDER BY ' + @SortColumn + ' '
SET @sql = @sql + ' SELECT COUNT(ItemID) FROM @Items;
SELECT
SI.ItemID,
SI.ItemName,
P.PackageID,
P.PackageName,
P.StatusID,
P.PurchaseDate,
-- user
P.UserID,
U.Username,
U.FirstName,
U.LastName,
U.FullName,
U.RoleID,
U.Email
FROM @Items AS I
INNER JOIN ServiceItems AS SI ON I.ItemID = SI.ItemID
INNER JOIN Packages AS P ON SI.PackageID = P.PackageID
INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID
WHERE I.ItemPosition BETWEEN @StartRow AND @EndRow'
END
ELSE
BEGIN
SET @SortColumn = REPLACE(@SortColumn, 'ItemName', 'DomainName')
SET @sql = '
DECLARE @EndRow int
SET @EndRow = @StartRow + @MaximumRows
DECLARE @Items TABLE
(
ItemPosition int IDENTITY(1,1),
ItemID int
)
INSERT INTO @Items (ItemID)
SELECT
D.DomainID
FROM Domains AS D
INNER JOIN Packages AS P ON P.PackageID = D.PackageID
INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID
WHERE
dbo.CheckUserParent(@UserID, P.UserID) = 1
'
IF @FilterValue <> ''
SET @sql = @sql + ' AND D.DomainName LIKE @FilterValue '
IF @SortColumn = '' OR @SortColumn IS NULL
SET @SortColumn = 'DomainName'
SET @sql = @sql + ' ORDER BY ' + @SortColumn + ' '
SET @sql = @sql + ' SELECT COUNT(ItemID) FROM @Items;
SELECT
D.DomainID AS ItemID,
D.DomainName AS ItemName,
P.PackageID,
P.PackageName,
P.StatusID,
P.PurchaseDate,
-- user
P.UserID,
U.Username,
U.FirstName,
U.LastName,
U.FullName,
U.RoleID,
U.Email
FROM @Items AS I
INNER JOIN Domains AS D ON I.ItemID = D.DomainID
INNER JOIN Packages AS P ON D.PackageID = P.PackageID
INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID
WHERE I.ItemPosition BETWEEN @StartRow AND @EndRow AND D.IsDomainPointer=0'
END
exec sp_executesql @sql, N'@StartRow int, @MaximumRows int, @UserID int, @FilterValue nvarchar(50), @ItemTypeID int, @ActorID int',
@StartRow, @MaximumRows, @UserID, @FilterValue, @ItemTypeID, @ActorID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[SetExchangeAccountMailboxplan]
(
@AccountID int,
@MailboxPlanId int
)
AS
UPDATE ExchangeAccounts SET
MailboxPlanId = @MailboxPlanId
WHERE
AccountID = @AccountID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[SetItemPrimaryIPAddress]
(
@ActorID int,
@ItemID int,
@PackageAddressID int
)
AS
BEGIN
-- read item pool
DECLARE @PoolID int
SELECT @PoolID = IP.PoolID FROM PackageIPAddresses AS PIP
INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID
WHERE PIP.PackageAddressID = @PackageAddressID
-- update all IP addresses of the specified pool
UPDATE PackageIPAddresses
SET IsPrimary = CASE PIP.PackageAddressID WHEN @PackageAddressID THEN 1 ELSE 0 END
FROM PackageIPAddresses AS PIP
INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID
WHERE PIP.ItemID = @ItemID
AND IP.PoolID = @PoolID
AND dbo.CheckActorPackageRights(@ActorID, PIP.PackageID) = 1
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[SetItemPrivatePrimaryIPAddress]
(
@ActorID int,
@ItemID int,
@PrivateAddressID int
)
AS
BEGIN
UPDATE PrivateIPAddresses
SET IsPrimary = CASE PIP.PrivateAddressID WHEN @PrivateAddressID THEN 1 ELSE 0 END
FROM PrivateIPAddresses AS PIP
INNER JOIN ServiceItems AS SI ON PIP.ItemID = SI.ItemID
WHERE PIP.ItemID = @ItemID
AND dbo.CheckActorPackageRights(@ActorID, SI.PackageID) = 1
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[SetLyncUserLyncUserPlan]
(
@AccountID int,
@LyncUserPlanId int
)
AS
UPDATE LyncUsers SET
LyncUserPlanId = @LyncUserPlanId
WHERE
AccountID = @AccountID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[SetSfBUserSfBUserPlan]
(
@AccountID int,
@SfBUserPlanId int
)
AS
UPDATE SfBUsers SET
SfBUserPlanId = @SfBUserPlanId
WHERE
AccountID = @AccountID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[SetOrganizationDefaultExchangeMailboxPlan]
(
@ItemID int,
@MailboxPlanId int
)
AS
UPDATE ExchangeOrganizations SET
ExchangeMailboxPlanID = @MailboxPlanId
WHERE
ItemID = @ItemID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[SetOrganizationDefaultLyncUserPlan]
(
@ItemID int,
@LyncUserPlanId int
)
AS
UPDATE ExchangeOrganizations SET
LyncUserPlanID = @LyncUserPlanId
WHERE
ItemID = @ItemID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[SetOrganizationDefaultSfBUserPlan]
(
@ItemID int,
@SfBUserPlanId int
)
AS
UPDATE ExchangeOrganizations SET
SfBUserPlanID = @SfBUserPlanId
WHERE
ItemID = @ItemID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[SetSystemSettings]
@SettingsName nvarchar(50),
@Xml ntext
AS
BEGIN
/*
XML Format:
<properties>
<property name="" value=""/>
</properties>
*/
SET NOCOUNT ON;
BEGIN TRAN
DECLARE @idoc int;
--Create an internal representation of the XML document.
EXEC sp_xml_preparedocument @idoc OUTPUT, @xml;
DELETE FROM [dbo].[SystemSettings] WHERE [SettingsName] = @SettingsName;
INSERT INTO [dbo].[SystemSettings]
(
[SettingsName],
[PropertyName],
[PropertyValue]
)
SELECT
@SettingsName,
[XML].[PropertyName],
[XML].[PropertyValue]
FROM OPENXML(@idoc, '/properties/property',1) WITH
(
[PropertyName] nvarchar(50) '@name',
[PropertyValue] ntext '@value'
) AS XML;
-- remove document
EXEC sp_xml_removedocument @idoc;
COMMIT TRAN;
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[UpdateDnsRecord]
(
@ActorID int,
@RecordID int,
@RecordType nvarchar(10),
@RecordName nvarchar(50),
@RecordData nvarchar(500),
@MXPriority int,
@SrvPriority int,
@SrvWeight int,
@SrvPort int,
@IPAddressID int
)
AS
IF @IPAddressID = 0 SET @IPAddressID = NULL
-- check rights
DECLARE @ServiceID int, @ServerID int, @PackageID int
SELECT
@ServiceID = ServiceID,
@ServerID = ServerID,
@PackageID = PackageID
FROM GlobalDnsRecords
WHERE
RecordID = @RecordID
IF (@ServiceID > 0 OR @ServerID > 0) AND dbo.CheckIsUserAdmin(@ActorID) = 0
RAISERROR('You are not allowed to perform this operation', 16, 1)
IF (@PackageID > 0) AND dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
-- update record
UPDATE GlobalDnsRecords
SET
RecordType = @RecordType,
RecordName = @RecordName,
RecordData = @RecordData,
MXPriority = @MXPriority,
SrvPriority = @SrvPriority,
SrvWeight = @SrvWeight,
SrvPort = @SrvPort,
IPAddressID = @IPAddressID
WHERE
RecordID = @RecordID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[UpdateDomain]
(
@DomainID int,
@ActorID int,
@ZoneItemID int,
@HostingAllowed bit,
@WebSiteID int,
@MailDomainID int,
@DomainItemID int
)
AS
-- check rights
DECLARE @PackageID int
SELECT @PackageID = PackageID FROM Domains
WHERE DomainID = @DomainID
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
IF @ZoneItemID = 0 SET @ZoneItemID = NULL
IF @WebSiteID = 0 SET @WebSiteID = NULL
IF @MailDomainID = 0 SET @MailDomainID = NULL
-- update record
UPDATE Domains
SET
ZoneItemID = @ZoneItemID,
HostingAllowed = @HostingAllowed,
WebSiteID = @WebSiteID,
MailDomainID = @MailDomainID,
DomainItemID = @DomainItemID
WHERE
DomainID = @DomainID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[UpdateExchangeAccount]
(
@AccountID int,
@AccountName nvarchar(300),
@DisplayName nvarchar(300),
@PrimaryEmailAddress nvarchar(300),
@AccountType int,
@SamAccountName nvarchar(100),
@MailEnabledPublicFolder bit,
@MailboxManagerActions varchar(200),
@Password varchar(200),
@MailboxPlanId int,
@SubscriberNumber varchar(32)
)
AS
BEGIN TRAN
IF (@MailboxPlanId = -1)
BEGIN
SET @MailboxPlanId = NULL
END
UPDATE ExchangeAccounts SET
AccountName = @AccountName,
DisplayName = @DisplayName,
PrimaryEmailAddress = @PrimaryEmailAddress,
MailEnabledPublicFolder = @MailEnabledPublicFolder,
MailboxManagerActions = @MailboxManagerActions,
AccountType =@AccountType,
SamAccountName = @SamAccountName,
MailboxPlanId = @MailboxPlanId,
SubscriberNumber = @SubscriberNumber
WHERE
AccountID = @AccountID
IF (@@ERROR <> 0 )
BEGIN
ROLLBACK TRANSACTION
RETURN -1
END
UPDATE ExchangeAccounts SET
AccountPassword = @Password WHERE AccountID = @AccountID AND @Password IS NOT NULL
IF (@@ERROR <> 0 )
BEGIN
ROLLBACK TRANSACTION
RETURN -1
END
COMMIT TRAN
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[UpdateExchangeAccountUserPrincipalName]
(
@AccountID int,
@UserPrincipalName nvarchar(300)
)
AS
UPDATE ExchangeAccounts SET
UserPrincipalName = @UserPrincipalName
WHERE
AccountID = @AccountID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[UpdateExchangeMailboxPlan]
(
@MailboxPlanId int,
@MailboxPlan nvarchar(300),
@EnableActiveSync bit,
@EnableIMAP bit,
@EnableMAPI bit,
@EnableOWA bit,
@EnablePOP bit,
@IsDefault bit,
@IssueWarningPct int,
@KeepDeletedItemsDays int,
@MailboxSizeMB int,
@MaxReceiveMessageSizeKB int,
@MaxRecipients int,
@MaxSendMessageSizeKB int,
@ProhibitSendPct int,
@ProhibitSendReceivePct int ,
@HideFromAddressBook bit,
@MailboxPlanType int
)
AS
UPDATE ExchangeMailboxPlans SET
MailboxPlan = @MailboxPlan,
EnableActiveSync = @EnableActiveSync,
EnableIMAP = @EnableIMAP,
EnableMAPI = @EnableMAPI,
EnableOWA = @EnableOWA,
EnablePOP = @EnablePOP,
IsDefault = @IsDefault,
IssueWarningPct= @IssueWarningPct,
KeepDeletedItemsDays = @KeepDeletedItemsDays,
MailboxSizeMB= @MailboxSizeMB,
MaxReceiveMessageSizeKB= @MaxReceiveMessageSizeKB,
MaxRecipients= @MaxRecipients,
MaxSendMessageSizeKB= @MaxSendMessageSizeKB,
ProhibitSendPct= @ProhibitSendPct,
ProhibitSendReceivePct = @ProhibitSendReceivePct,
HideFromAddressBook = @HideFromAddressBook,
MailboxPlanType = @MailboxPlanType
WHERE MailboxPlanId = @MailboxPlanId
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE UpdateHostingPlanQuotas
(
@ActorID int,
@PlanID int,
@Xml ntext
)
AS
/*
XML Format:
<plan>
<groups>
<group id="16" enabled="1" calculateDiskSpace="1" calculateBandwidth="1"/>
</groups>
<quotas>
<quota id="2" value="2"/>
</quotas>
</plan>
*/
-- check rights
DECLARE @UserID int
SELECT @UserID = UserID FROM HostingPlans
WHERE PlanID = @PlanID
-- check rights
IF dbo.CheckActorUserRights(@ActorID, @UserID) = 0
RAISERROR('You are not allowed to access this account', 16, 1)
DECLARE @idoc int
--Create an internal representation of the XML document.
EXEC sp_xml_preparedocument @idoc OUTPUT, @xml
-- delete old HP resources
DELETE FROM HostingPlanResources
WHERE PlanID = @PlanID
-- delete old HP quotas
DELETE FROM HostingPlanQuotas
WHERE PlanID = @PlanID
-- update HP resources
INSERT INTO HostingPlanResources
(
PlanID,
GroupID,
CalculateDiskSpace,
CalculateBandwidth
)
SELECT
@PlanID,
GroupID,
CalculateDiskSpace,
CalculateBandwidth
FROM OPENXML(@idoc, '/plan/groups/group',1) WITH
(
GroupID int '@id',
CalculateDiskSpace bit '@calculateDiskSpace',
CalculateBandwidth bit '@calculateBandwidth'
) as XRG
-- update HP quotas
INSERT INTO HostingPlanQuotas
(
PlanID,
QuotaID,
QuotaValue
)
SELECT
@PlanID,
QuotaID,
QuotaValue
FROM OPENXML(@idoc, '/plan/quotas/quota',1) WITH
(
QuotaID int '@id',
QuotaValue int '@value'
) as PV
-- remove document
exec sp_xml_removedocument @idoc
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE UpdateHostingPlan
(
@ActorID int,
@PlanID int,
@PackageID int,
@ServerID int,
@PlanName nvarchar(200),
@PlanDescription ntext,
@Available bit,
@SetupPrice money,
@RecurringPrice money,
@RecurrenceLength int,
@RecurrenceUnit int,
@QuotasXml ntext
)
AS
-- check rights
DECLARE @UserID int
SELECT @UserID = UserID FROM HostingPlans
WHERE PlanID = @PlanID
-- check rights
IF dbo.CheckActorUserRights(@ActorID, @UserID) = 0
RAISERROR('You are not allowed to access this account', 16, 1)
IF @ServerID = 0
SELECT @ServerID = ServerID FROM Packages
WHERE PackageID = @PackageID
IF @PackageID = 0 SET @PackageID = NULL
IF @ServerID = 0 SET @ServerID = NULL
-- update record
UPDATE HostingPlans SET
PackageID = @PackageID,
ServerID = @ServerID,
PlanName = @PlanName,
PlanDescription = @PlanDescription,
Available = @Available,
SetupPrice = @SetupPrice,
RecurringPrice = @RecurringPrice,
RecurrenceLength = @RecurrenceLength,
RecurrenceUnit = @RecurrenceUnit
WHERE PlanID = @PlanID
BEGIN TRAN
-- update quotas
EXEC UpdateHostingPlanQuotas @ActorID, @PlanID, @QuotasXml
DECLARE @ExceedingQuotas AS TABLE (QuotaID int, QuotaName nvarchar(50), QuotaValue int)
INSERT INTO @ExceedingQuotas
SELECT * FROM dbo.GetPackageExceedingQuotas(@PackageID) WHERE QuotaValue > 0
SELECT * FROM @ExceedingQuotas
IF EXISTS(SELECT * FROM @ExceedingQuotas)
BEGIN
ROLLBACK TRAN
RETURN
END
COMMIT TRAN
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE AddHostingPlan
(
@ActorID int,
@PlanID int OUTPUT,
@UserID int,
@PackageID int,
@PlanName nvarchar(200),
@PlanDescription ntext,
@Available bit,
@ServerID int,
@SetupPrice money,
@RecurringPrice money,
@RecurrenceLength int,
@RecurrenceUnit int,
@IsAddon bit,
@QuotasXml ntext
)
AS
-- check rights
IF dbo.CheckActorUserRights(@ActorID, @UserID) = 0
RAISERROR('You are not allowed to access this account', 16, 1)
BEGIN TRAN
IF @ServerID = 0
SELECT @ServerID = ServerID FROM Packages
WHERE PackageID = @PackageID
IF @IsAddon = 1
SET @ServerID = NULL
IF @PackageID = 0 SET @PackageID = NULL
INSERT INTO HostingPlans
(
UserID,
PackageID,
PlanName,
PlanDescription,
Available,
ServerID,
SetupPrice,
RecurringPrice,
RecurrenceLength,
RecurrenceUnit,
IsAddon
)
VALUES
(
@UserID,
@PackageID,
@PlanName,
@PlanDescription,
@Available,
@ServerID,
@SetupPrice,
@RecurringPrice,
@RecurrenceLength,
@RecurrenceUnit,
@IsAddon
)
SET @PlanID = SCOPE_IDENTITY()
-- save quotas
EXEC UpdateHostingPlanQuotas @ActorID, @PlanID, @QuotasXml
COMMIT TRAN
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[UpdateIPAddress]
(
@AddressID int,
@ServerID int,
@ExternalIP varchar(24),
@InternalIP varchar(24),
@PoolID int,
@SubnetMask varchar(15),
@DefaultGateway varchar(15),
@Comments ntext
)
AS
BEGIN
IF @ServerID = 0
SET @ServerID = NULL
UPDATE IPAddresses SET
ExternalIP = @ExternalIP,
InternalIP = @InternalIP,
ServerID = @ServerID,
PoolID = @PoolID,
SubnetMask = @SubnetMask,
DefaultGateway = @DefaultGateway,
Comments = @Comments
WHERE AddressID = @AddressID
RETURN
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[UpdateIPAddresses]
(
@xml ntext,
@PoolID int,
@ServerID int,
@SubnetMask varchar(15),
@DefaultGateway varchar(15),
@Comments ntext
)
AS
BEGIN
SET NOCOUNT ON;
IF @ServerID = 0
SET @ServerID = NULL
DECLARE @idoc int
--Create an internal representation of the XML document.
EXEC sp_xml_preparedocument @idoc OUTPUT, @xml
-- update
UPDATE IPAddresses SET
ServerID = @ServerID,
PoolID = @PoolID,
SubnetMask = @SubnetMask,
DefaultGateway = @DefaultGateway,
Comments = @Comments
FROM IPAddresses AS IP
INNER JOIN OPENXML(@idoc, '/items/item', 1) WITH
(
AddressID int '@id'
) as PV ON IP.AddressID = PV.AddressID
-- remove document
exec sp_xml_removedocument @idoc
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[UpdateLyncUser]
(
@AccountID int,
@SipAddress nvarchar(300)
)
AS
UPDATE LyncUsers SET
SipAddress = @SipAddress
WHERE
AccountID = @AccountID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[UpdateLyncUserPlan]
(
@LyncUserPlanId int,
@LyncUserPlanName nvarchar(300),
@LyncUserPlanType int,
@IM bit,
@Mobility bit,
@MobilityEnableOutsideVoice bit,
@Federation bit,
@Conferencing bit,
@EnterpriseVoice bit,
@VoicePolicy int,
@IsDefault bit
)
AS
UPDATE LyncUserPlans SET
LyncUserPlanName = @LyncUserPlanName,
LyncUserPlanType = @LyncUserPlanType,
IM = @IM,
Mobility = @Mobility,
MobilityEnableOutsideVoice = @MobilityEnableOutsideVoice,
Federation = @Federation,
Conferencing =@Conferencing,
EnterpriseVoice = @EnterpriseVoice,
VoicePolicy = @VoicePolicy,
IsDefault = @IsDefault
WHERE LyncUserPlanId = @LyncUserPlanId
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[UpdateSfBUser]
(
@AccountID int,
@SipAddress nvarchar(300)
)
AS
UPDATE SfBUsers SET
SipAddress = @SipAddress
WHERE
AccountID = @AccountID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[UpdateSfBUserPlan]
(
@SfBUserPlanId int,
@SfBUserPlanName nvarchar(300),
@SfBUserPlanType int,
@IM bit,
@Mobility bit,
@MobilityEnableOutsideVoice bit,
@Federation bit,
@Conferencing bit,
@EnterpriseVoice bit,
@VoicePolicy int,
@IsDefault bit
)
AS
UPDATE SfBUserPlans SET
SfBUserPlanName = @SfBUserPlanName,
SfBUserPlanType = @SfBUserPlanType,
IM = @IM,
Mobility = @Mobility,
MobilityEnableOutsideVoice = @MobilityEnableOutsideVoice,
Federation = @Federation,
Conferencing =@Conferencing,
EnterpriseVoice = @EnterpriseVoice,
VoicePolicy = @VoicePolicy,
IsDefault = @IsDefault
WHERE SfBUserPlanId = @SfBUserPlanId
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE UpdatePackageAddon
(
@ActorID int,
@PackageAddonID int,
@PlanID int,
@Quantity int,
@PurchaseDate datetime,
@StatusID int,
@Comments ntext
)
AS
DECLARE @PackageID int
SELECT @PackageID = PackageID FROM PackageAddons
WHERE PackageAddonID = @PackageAddonID
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
BEGIN TRAN
DECLARE @ParentPackageID int
SELECT @ParentPackageID = ParentPackageID FROM Packages
WHERE PackageID = @PackageID
-- update record
UPDATE PackageAddons SET
PlanID = @PlanID,
Quantity = @Quantity,
PurchaseDate = @PurchaseDate,
StatusID = @StatusID,
Comments = @Comments
WHERE PackageAddonID = @PackageAddonID
DECLARE @ExceedingQuotas AS TABLE (QuotaID int, QuotaName nvarchar(50), QuotaValue int)
INSERT INTO @ExceedingQuotas
SELECT * FROM dbo.GetPackageExceedingQuotas(@ParentPackageID) WHERE QuotaValue > 0
SELECT * FROM @ExceedingQuotas
IF EXISTS(SELECT * FROM @ExceedingQuotas)
BEGIN
ROLLBACK TRAN
RETURN
END
COMMIT TRAN
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE UpdatePackageBandwidth
(
@PackageID int,
@xml ntext
)
AS
DECLARE @idoc int
--Create an internal representation of the XML document.
EXEC sp_xml_preparedocument @idoc OUTPUT, @xml
DECLARE @Items TABLE
(
ItemID int,
LogDate datetime,
BytesSent bigint,
BytesReceived bigint
)
INSERT INTO @Items
(
ItemID,
LogDate,
BytesSent,
BytesReceived
)
SELECT
ItemID,
CONVERT(datetime, LogDate, 101),
BytesSent,
BytesReceived
FROM OPENXML(@idoc, '/items/item',1) WITH
(
ItemID int '@id',
LogDate nvarchar(10) '@date',
BytesSent bigint '@sent',
BytesReceived bigint '@received'
)
-- delete current statistics
DELETE FROM PackagesBandwidth
FROM PackagesBandwidth AS PB
INNER JOIN (
SELECT
SIT.GroupID,
I.LogDate
FROM @Items AS I
INNER JOIN ServiceItems AS SI ON I.ItemID = SI.ItemID
INNER JOIN ServiceItemTypes AS SIT ON SI.ItemTypeID = SIT.ItemTypeID
GROUP BY I.LogDate, SIT.GroupID
) AS STAT ON PB.LogDate = STAT.LogDate AND PB.GroupID = STAT.GroupID
WHERE PB.PackageID = @PackageID
-- insert new statistics
INSERT INTO PackagesBandwidth (PackageID, GroupID, LogDate, BytesSent, BytesReceived)
SELECT
@PackageID,
SIT.GroupID,
I.LogDate,
SUM(I.BytesSent),
SUM(I.BytesReceived)
FROM @Items AS I
INNER JOIN ServiceItems AS SI ON I.ItemID = SI.ItemID
INNER JOIN ServiceItemTypes AS SIT ON SI.ItemTypeID = SIT.ItemTypeID
GROUP BY I.LogDate, SIT.GroupID
-- remove document
exec sp_xml_removedocument @idoc
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE UpdatePackageBandwidthUpdate
(
@PackageID int,
@UpdateDate datetime
)
AS
UPDATE Packages SET BandwidthUpdated = @UpdateDate
WHERE PackageID = @PackageID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE UpdatePackageDiskSpace
(
@PackageID int,
@xml ntext
)
AS
DECLARE @idoc int
--Create an internal representation of the XML document.
EXEC sp_xml_preparedocument @idoc OUTPUT, @xml
-- Execute a SELECT statement that uses the OPENXML rowset provider.
DECLARE @Items TABLE
(
ItemID int,
Bytes bigint
)
INSERT INTO @Items (ItemID, Bytes)
SELECT ItemID, DiskSpace FROM OPENXML (@idoc, '/items/item',1)
WITH
(
ItemID int '@id',
DiskSpace bigint '@bytes'
) as XSI
-- remove current diskspace
DELETE FROM PackagesDiskspace
WHERE PackageID = @PackageID
-- update package diskspace
INSERT INTO PackagesDiskspace (PackageID, GroupID, Diskspace)
SELECT
@PackageID,
SIT.GroupID,
SUM(I.Bytes)
FROM @Items AS I
INNER JOIN ServiceItems AS SI ON I.ItemID = SI.ItemID
INNER JOIN ServiceItemTypes AS SIT ON SI.ItemTypeID = SIT.ItemTypeID
GROUP BY SIT.GroupID
-- remove document
exec sp_xml_removedocument @idoc
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE UpdatePackageName
(
@ActorID int,
@PackageID int,
@PackageName nvarchar(300),
@PackageComments ntext
)
AS
-- check rights
DECLARE @UserID int
SELECT @UserID = UserID FROM Packages
WHERE PackageID = @PackageID
IF NOT(dbo.CheckActorPackageRights(@ActorID, @PackageID) = 1
OR @UserID = @ActorID
OR EXISTS(SELECT UserID FROM Users WHERE UserID = @ActorID AND OwnerID = @UserID AND IsPeer = 1))
RAISERROR('You are not allowed to access this package', 16, 1)
-- update package
UPDATE Packages SET
PackageName = @PackageName,
PackageComments = @PackageComments
WHERE
PackageID = @PackageID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE UpdatePackageQuotas
(
@ActorID int,
@PackageID int,
@Xml ntext
)
AS
/*
XML Format:
<plan>
<groups>
<group id="16" enabled="1" calculateDiskSpace="1" calculateBandwidth="1"/>
</groups>
<quotas>
<quota id="2" value="2"/>
</quotas>
</plan>
*/
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
DECLARE @OverrideQuotas bit
SELECT @OverrideQuotas = OverrideQuotas FROM Packages
WHERE PackageID = @PackageID
IF @OverrideQuotas = 0
BEGIN
-- delete old Package resources
DELETE FROM PackageResources
WHERE PackageID = @PackageID
-- delete old Package quotas
DELETE FROM PackageQuotas
WHERE PackageID = @PackageID
END
IF @OverrideQuotas = 1 AND @Xml IS NOT NULL
BEGIN
-- delete old Package resources
DELETE FROM PackageResources
WHERE PackageID = @PackageID
-- delete old Package quotas
DELETE FROM PackageQuotas
WHERE PackageID = @PackageID
DECLARE @idoc int
--Create an internal representation of the XML document.
EXEC sp_xml_preparedocument @idoc OUTPUT, @xml
-- update Package resources
INSERT INTO PackageResources
(
PackageID,
GroupID,
CalculateDiskSpace,
CalculateBandwidth
)
SELECT
@PackageID,
GroupID,
CalculateDiskSpace,
CalculateBandwidth
FROM OPENXML(@idoc, '/plan/groups/group',1) WITH
(
GroupID int '@id',
CalculateDiskSpace bit '@calculateDiskSpace',
CalculateBandwidth bit '@calculateBandwidth'
) as XRG
-- update Package quotas
INSERT INTO PackageQuotas
(
PackageID,
QuotaID,
QuotaValue
)
SELECT
@PackageID,
QuotaID,
QuotaValue
FROM OPENXML(@idoc, '/plan/quotas/quota',1) WITH
(
QuotaID int '@id',
QuotaValue int '@value'
) as PV
-- remove document
exec sp_xml_removedocument @idoc
END
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE UpdatePackageSettings
(
@ActorID int,
@PackageID int,
@SettingsName nvarchar(50),
@Xml ntext
)
AS
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
-- delete old properties
BEGIN TRAN
DECLARE @idoc int
--Create an internal representation of the XML document.
EXEC sp_xml_preparedocument @idoc OUTPUT, @xml
-- Execute a SELECT statement that uses the OPENXML rowset provider.
DELETE FROM PackageSettings
WHERE PackageID = @PackageID AND SettingsName = @SettingsName
INSERT INTO PackageSettings
(
PackageID,
SettingsName,
PropertyName,
PropertyValue
)
SELECT
@PackageID,
@SettingsName,
PropertyName,
PropertyValue
FROM OPENXML(@idoc, '/properties/property',1) WITH
(
PropertyName nvarchar(50) '@name',
PropertyValue ntext '@value'
) as PV
-- remove document
exec sp_xml_removedocument @idoc
COMMIT TRAN
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE UpdateSchedule
(
@ActorID int,
@ScheduleID int,
@TaskID nvarchar(100),
@ScheduleName nvarchar(100),
@ScheduleTypeID nvarchar(50),
@Interval int,
@FromTime datetime,
@ToTime datetime,
@StartTime datetime,
@LastRun datetime,
@NextRun datetime,
@Enabled bit,
@PriorityID nvarchar(50),
@HistoriesNumber int,
@MaxExecutionTime int,
@WeekMonthDay int,
@XmlParameters ntext
)
AS
-- check rights
DECLARE @PackageID int
SELECT @PackageID = PackageID FROM Schedule
WHERE ScheduleID = @ScheduleID
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
BEGIN TRAN
UPDATE Schedule
SET
TaskID = @TaskID,
ScheduleName = @ScheduleName,
ScheduleTypeID = @ScheduleTypeID,
Interval = @Interval,
FromTime = @FromTime,
ToTime = @ToTime,
StartTime = @StartTime,
LastRun = @LastRun,
NextRun = @NextRun,
Enabled = @Enabled,
PriorityID = @PriorityID,
HistoriesNumber = @HistoriesNumber,
MaxExecutionTime = @MaxExecutionTime,
WeekMonthDay = @WeekMonthDay
WHERE
ScheduleID = @ScheduleID
DECLARE @idoc int
--Create an internal representation of the XML document.
EXEC sp_xml_preparedocument @idoc OUTPUT, @XmlParameters
-- Execute a SELECT statement that uses the OPENXML rowset provider.
DELETE FROM ScheduleParameters
WHERE ScheduleID = @ScheduleID
INSERT INTO ScheduleParameters
(
ScheduleID,
ParameterID,
ParameterValue
)
SELECT
@ScheduleID,
ParameterID,
ParameterValue
FROM OPENXML(@idoc, '/parameters/parameter',1) WITH
(
ParameterID nvarchar(50) '@id',
ParameterValue nvarchar(3000) '@value'
) as PV
-- remove document
exec sp_xml_removedocument @idoc
COMMIT TRAN
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE UpdateServer
(
@ServerID int,
@ServerName nvarchar(100),
@ServerUrl nvarchar(100),
@Password nvarchar(100),
@Comments ntext,
@InstantDomainAlias nvarchar(200),
@PrimaryGroupID int,
@ADEnabled bit,
@ADRootDomain nvarchar(200),
@ADUsername nvarchar(100),
@ADPassword nvarchar(100),
@ADAuthenticationType varchar(50)
)
AS
IF @PrimaryGroupID = 0
SET @PrimaryGroupID = NULL
UPDATE Servers SET
ServerName = @ServerName,
ServerUrl = @ServerUrl,
Password = @Password,
Comments = @Comments,
InstantDomainAlias = @InstantDomainAlias,
PrimaryGroupID = @PrimaryGroupID,
ADEnabled = @ADEnabled,
ADRootDomain = @ADRootDomain,
ADUsername = @ADUsername,
ADPassword = @ADPassword,
ADAuthenticationType = @ADAuthenticationType
WHERE ServerID = @ServerID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE UpdateService
(
@ServiceID int,
@ServiceName nvarchar(50),
@Comments ntext,
@ServiceQuotaValue int,
@ClusterID int
)
AS
IF @ClusterID = 0 SET @ClusterID = NULL
UPDATE Services
SET
ServiceName = @ServiceName,
ServiceQuotaValue = @ServiceQuotaValue,
Comments = @Comments,
ClusterID = @ClusterID
WHERE ServiceID = @ServiceID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE UpdateServiceItem
(
@ActorID int,
@ItemID int,
@ItemName nvarchar(500),
@XmlProperties ntext
)
AS
BEGIN TRAN
-- check rights
DECLARE @PackageID int
SELECT PackageID = @PackageID FROM ServiceItems
WHERE ItemID = @ItemID
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
-- update item
UPDATE ServiceItems SET ItemName = @ItemName
WHERE ItemID=@ItemID
DECLARE @idoc int
--Create an internal representation of the XML document.
EXEC sp_xml_preparedocument @idoc OUTPUT, @XmlProperties
-- Execute a SELECT statement that uses the OPENXML rowset provider.
DELETE FROM ServiceItemProperties
WHERE ItemID = @ItemID
-- Add the xml data into a temp table for the capability and robust
IF OBJECT_ID('tempdb..#TempTable') IS NOT NULL DROP TABLE #TempTable
CREATE TABLE #TempTable(
ItemID int,
PropertyName nvarchar(50),
PropertyValue nvarchar(3000))
INSERT INTO #TempTable (ItemID, PropertyName, PropertyValue)
SELECT
@ItemID,
PropertyName,
PropertyValue
FROM OPENXML(@idoc, '/properties/property',1) WITH
(
PropertyName nvarchar(50) '@name',
PropertyValue nvarchar(3000) '@value'
) as PV
-- Move data from temp table to real table
INSERT INTO ServiceItemProperties
(
ItemID,
PropertyName,
PropertyValue
)
SELECT
ItemID,
PropertyName,
PropertyValue
FROM #TempTable
DROP TABLE #TempTable
-- remove document
exec sp_xml_removedocument @idoc
COMMIT TRAN
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE dbo.UpdateServiceProperties
(
@ServiceID int,
@Xml ntext
)
AS
-- delete old properties
BEGIN TRAN
DECLARE @idoc int
--Create an internal representation of the XML document.
EXEC sp_xml_preparedocument @idoc OUTPUT, @xml
-- Execute a SELECT statement that uses the OPENXML rowset provider.
DELETE FROM ServiceProperties
WHERE ServiceID = @ServiceID
AND PropertyName IN
(
SELECT PropertyName
FROM OPENXML(@idoc, '/properties/property', 1)
WITH (PropertyName nvarchar(50) '@name')
)
INSERT INTO ServiceProperties
(
ServiceID,
PropertyName,
PropertyValue
)
SELECT
@ServiceID,
PropertyName,
PropertyValue
FROM OPENXML(@idoc, '/properties/property',1) WITH
(
PropertyName nvarchar(50) '@name',
PropertyValue nvarchar(1000) '@value'
) as PV
-- remove document
exec sp_xml_removedocument @idoc
COMMIT TRAN
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[UpdateUser]
(
@ActorID int,
@UserID int,
@RoleID int,
@StatusID int,
@SubscriberNumber nvarchar(32),
@LoginStatusId int,
@IsDemo bit,
@IsPeer bit,
@Comments ntext,
@FirstName nvarchar(50),
@LastName nvarchar(50),
@Email nvarchar(255),
@SecondaryEmail nvarchar(255),
@Address nvarchar(200),
@City nvarchar(50),
@State nvarchar(50),
@Country nvarchar(50),
@Zip varchar(20),
@PrimaryPhone varchar(30),
@SecondaryPhone varchar(30),
@Fax varchar(30),
@InstantMessenger nvarchar(200),
@HtmlMail bit,
@CompanyName nvarchar(100),
@EcommerceEnabled BIT,
@AdditionalParams NVARCHAR(max)
)
AS
-- check actor rights
IF dbo.CanUpdateUserDetails(@ActorID, @UserID) = 0
BEGIN
RETURN
END
IF @LoginStatusId = 0
BEGIN
UPDATE Users SET
FailedLogins = 0
WHERE UserID = @UserID
END
UPDATE Users SET
RoleID = @RoleID,
StatusID = @StatusID,
SubscriberNumber = @SubscriberNumber,
LoginStatusId = @LoginStatusId,
Changed = GetDate(),
IsDemo = @IsDemo,
IsPeer = @IsPeer,
Comments = @Comments,
FirstName = @FirstName,
LastName = @LastName,
Email = @Email,
SecondaryEmail = @SecondaryEmail,
Address = @Address,
City = @City,
State = @State,
Country = @Country,
Zip = @Zip,
PrimaryPhone = @PrimaryPhone,
SecondaryPhone = @SecondaryPhone,
Fax = @Fax,
InstantMessenger = @InstantMessenger,
HtmlMail = @HtmlMail,
CompanyName = @CompanyName,
EcommerceEnabled = @EcommerceEnabled,
[AdditionalParams] = @AdditionalParams
WHERE UserID = @UserID
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[UpdateUserFailedLoginAttempt]
(
@UserID int,
@LockOut int,
@Reset int
)
AS
IF (@Reset = 1)
BEGIN
UPDATE Users SET FailedLogins = 0 WHERE UserID = @UserID
END
ELSE
BEGIN
IF (@LockOut <= (SELECT FailedLogins FROM USERS WHERE UserID = @UserID))
BEGIN
UPDATE Users SET LoginStatusId = 2 WHERE UserID = @UserID
END
ELSE
BEGIN
IF ((SELECT FailedLogins FROM Users WHERE UserID = @UserID) IS NULL)
BEGIN
UPDATE Users SET FailedLogins = 1 WHERE UserID = @UserID
END
ELSE
UPDATE Users SET FailedLogins = FailedLogins + 1 WHERE UserID = @UserID
END
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE UpdateUserSettings
(
@ActorID int,
@UserID int,
@SettingsName nvarchar(50),
@Xml ntext
)
AS
-- check rights
IF dbo.CheckActorUserRights(@ActorID, @UserID) = 0
RAISERROR('You are not allowed to access this account', 16, 1)
-- delete old properties
BEGIN TRAN
DECLARE @idoc int
--Create an internal representation of the XML document.
EXEC sp_xml_preparedocument @idoc OUTPUT, @xml
-- Execute a SELECT statement that uses the OPENXML rowset provider.
DELETE FROM UserSettings
WHERE UserID = @UserID AND SettingsName = @SettingsName
INSERT INTO UserSettings
(
UserID,
SettingsName,
PropertyName,
PropertyValue
)
SELECT
@UserID,
@SettingsName,
PropertyName,
PropertyValue
FROM OPENXML(@idoc, '/properties/property',1) WITH
(
PropertyName nvarchar(50) '@name',
PropertyValue ntext '@value'
) as PV
-- remove document
exec sp_xml_removedocument @idoc
COMMIT TRAN
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE UpdateVirtualGroups
(
@ServerID int,
@Xml ntext
)
AS
/*
XML Format:
<groups>
<group id="16" distributionType="1" bindDistributionToPrimary="1"/>
</groups>
*/
BEGIN TRAN
DECLARE @idoc int
--Create an internal representation of the XML document.
EXEC sp_xml_preparedocument @idoc OUTPUT, @xml
-- delete old virtual groups
DELETE FROM VirtualGroups
WHERE ServerID = @ServerID
-- update HP resources
INSERT INTO VirtualGroups
(
ServerID,
GroupID,
DistributionType,
BindDistributionToPrimary
)
SELECT
@ServerID,
GroupID,
DistributionType,
BindDistributionToPrimary
FROM OPENXML(@idoc, '/groups/group',1) WITH
(
GroupID int '@id',
DistributionType int '@distributionType',
BindDistributionToPrimary bit '@bindDistributionToPrimary'
) as XRG
-- remove document
exec sp_xml_removedocument @idoc
COMMIT TRAN
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION CalculatePackageBandwidth
(
@PackageID int
)
RETURNS int
AS
BEGIN
DECLARE @d datetime, @StartDate datetime, @EndDate datetime
SET @d = GETDATE()
SET @StartDate = DATEADD(Day, -DAY(@d) + 1, @d)
SET @EndDate = DATEADD(Day, -1, DATEADD(Month, 1, @StartDate))
--SET @EndDate = GETDATE()
--SET @StartDate = DATEADD(month, -1, @EndDate)
-- remove hours and minutes
SET @StartDate = CONVERT(datetime, CONVERT(nvarchar, @StartDate, 112))
SET @EndDate = CONVERT(datetime, CONVERT(nvarchar, @EndDate, 112))
DECLARE @Bandwidth int
SELECT
@Bandwidth = ROUND(CONVERT(float, SUM(ISNULL(PB.BytesSent + PB.BytesReceived, 0))) / 1024 / 1024, 0) -- in megabytes
FROM PackagesTreeCache AS PT
INNER JOIN Packages AS P ON PT.PackageID = P.PackageID
INNER JOIN PackagesBandwidth AS PB ON PT.PackageID = PB.PackageID
INNER JOIN HostingPlanResources AS HPR ON PB.GroupID = HPR.GroupID
AND HPR.PlanID = P.PlanID AND HPR.CalculateBandwidth = 1
WHERE
PT.ParentPackageID = @PackageID
AND PB.LogDate BETWEEN @StartDate AND @EndDate
IF @Bandwidth IS NULL
SET @Bandwidth = 0
RETURN @Bandwidth
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION CalculatePackageDiskspace
(
@PackageID int
)
RETURNS int
AS
BEGIN
DECLARE @Diskspace int
SELECT
@Diskspace = ROUND(CONVERT(float, SUM(ISNULL(PD.DiskSpace, 0))) / 1024 / 1024, 0) -- in megabytes
FROM PackagesTreeCache AS PT
INNER JOIN Packages AS P ON PT.PackageID = P.PackageID
INNER JOIN PackagesDiskspace AS PD ON P.PackageID = PD.PackageID
INNER JOIN HostingPlanResources AS HPR ON PD.GroupID = HPR.GroupID
AND HPR.PlanID = P.PlanID AND HPR.CalculateDiskspace = 1
WHERE PT.ParentPackageID = @PackageID
RETURN @Diskspace
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE FUNCTION [dbo].[CalculateQuotaUsage]
(
@PackageID int,
@QuotaID int
)
RETURNS int
AS
BEGIN
DECLARE @QuotaTypeID int
SELECT @QuotaTypeID = QuotaTypeID FROM Quotas
WHERE QuotaID = @QuotaID
IF @QuotaTypeID <> 2
RETURN 0
DECLARE @Result int
IF @QuotaID = 52 -- diskspace
SET @Result = dbo.CalculatePackageDiskspace(@PackageID)
ELSE IF @QuotaID = 51 -- bandwidth
SET @Result = dbo.CalculatePackageBandwidth(@PackageID)
ELSE IF @QuotaID = 53 -- domains
SET @Result = (SELECT COUNT(D.DomainID) FROM PackagesTreeCache AS PT
INNER JOIN Domains AS D ON D.PackageID = PT.PackageID
WHERE IsSubDomain = 0 AND IsInstantAlias = 0 AND IsDomainPointer = 0 AND PT.ParentPackageID = @PackageID)
ELSE IF @QuotaID = 54 -- sub-domains
SET @Result = (SELECT COUNT(D.DomainID) FROM PackagesTreeCache AS PT
INNER JOIN Domains AS D ON D.PackageID = PT.PackageID
WHERE IsSubDomain = 1 AND IsInstantAlias = 0 AND IsDomainPointer = 0 AND PT.ParentPackageID = @PackageID)
ELSE IF @QuotaID = 220 -- domain pointers
SET @Result = (SELECT COUNT(D.DomainID) FROM PackagesTreeCache AS PT
INNER JOIN Domains AS D ON D.PackageID = PT.PackageID
WHERE IsDomainPointer = 1 AND PT.ParentPackageID = @PackageID)
ELSE IF @QuotaID = 71 -- scheduled tasks
SET @Result = (SELECT COUNT(S.ScheduleID) FROM PackagesTreeCache AS PT
INNER JOIN Schedule AS S ON S.PackageID = PT.PackageID
WHERE PT.ParentPackageID = @PackageID)
ELSE IF @QuotaID = 305 -- RAM of VPS
SET @Result = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP
INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID
INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID
WHERE SIP.PropertyName = 'RamSize' AND PT.ParentPackageID = @PackageID)
ELSE IF @QuotaID = 306 -- HDD of VPS
SET @Result = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP
INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID
INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID
WHERE SIP.PropertyName = 'HddSize' AND PT.ParentPackageID = @PackageID)
ELSE IF @QuotaID = 309 -- External IP addresses of VPS
SET @Result = (SELECT COUNT(PIP.PackageAddressID) FROM PackageIPAddresses AS PIP
INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID
INNER JOIN PackagesTreeCache AS PT ON PIP.PackageID = PT.PackageID
WHERE PT.ParentPackageID = @PackageID AND IP.PoolID = 3)
ELSE IF @QuotaID = 100 -- Dedicated Web IP addresses
SET @Result = (SELECT COUNT(PIP.PackageAddressID) FROM PackageIPAddresses AS PIP
INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID
INNER JOIN PackagesTreeCache AS PT ON PIP.PackageID = PT.PackageID
WHERE PT.ParentPackageID = @PackageID AND IP.PoolID = 2)
ELSE IF @QuotaID = 350 -- RAM of VPSforPc
SET @Result = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP
INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID
INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID
WHERE SIP.PropertyName = 'Memory' AND PT.ParentPackageID = @PackageID)
ELSE IF @QuotaID = 351 -- HDD of VPSforPc
SET @Result = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP
INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID
INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID
WHERE SIP.PropertyName = 'HddSize' AND PT.ParentPackageID = @PackageID)
ELSE IF @QuotaID = 354 -- External IP addresses of VPSforPc
SET @Result = (SELECT COUNT(PIP.PackageAddressID) FROM PackageIPAddresses AS PIP
INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID
INNER JOIN PackagesTreeCache AS PT ON PIP.PackageID = PT.PackageID
WHERE PT.ParentPackageID = @PackageID AND IP.PoolID = 3)
ELSE IF @QuotaID = 319 -- BB Users
SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts ea
INNER JOIN BlackBerryUsers bu ON ea.AccountID = bu.AccountID
INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID
INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID
WHERE pt.ParentPackageID = @PackageID)
ELSE IF @QuotaID = 320 -- OCS Users
SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts ea
INNER JOIN OCSUsers ocs ON ea.AccountID = ocs.AccountID
INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID
INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID
WHERE pt.ParentPackageID = @PackageID)
ELSE IF @QuotaID = 206 -- HostedSolution.Users
SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea
INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID
INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID
WHERE pt.ParentPackageID = @PackageID AND ea.AccountType IN (1,5,6,7))
ELSE IF @QuotaID = 78 -- Exchange2007.Mailboxes
SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea
INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID
INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID
WHERE pt.ParentPackageID = @PackageID
AND ea.AccountType IN (1)
AND ea.MailboxPlanId IS NOT NULL)
ELSE IF @QuotaID = 77 -- Exchange2007.DiskSpace
SET @Result = (SELECT SUM(B.MailboxSizeMB) FROM ExchangeAccounts AS ea
INNER JOIN ExchangeMailboxPlans AS B ON ea.MailboxPlanId = B.MailboxPlanId
INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID
INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID
WHERE pt.ParentPackageID = @PackageID)
ELSE IF @QuotaID = 370 -- Lync.Users
SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea
INNER JOIN LyncUsers lu ON ea.AccountID = lu.AccountID
INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID
INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID
WHERE pt.ParentPackageID = @PackageID)
ELSE IF @QuotaID = 376 -- Lync.EVUsers
SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea
INNER JOIN LyncUsers lu ON ea.AccountID = lu.AccountID
INNER JOIN LyncUserPlans lp ON lu.LyncUserPlanId = lp.LyncUserPlanId
INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID
INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID
WHERE pt.ParentPackageID = @PackageID AND lp.EnterpriseVoice = 1)
ELSE IF @QuotaID = 570 -- SfB.Users
SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea
INNER JOIN SfBUsers lu ON ea.AccountID = lu.AccountID
INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID
INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID
WHERE pt.ParentPackageID = @PackageID)
ELSE IF @QuotaID = 576 -- SfB.EVUsers
SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea
INNER JOIN SfBUsers lu ON ea.AccountID = lu.AccountID
INNER JOIN SfBUserPlans lp ON lu.SfBUserPlanId = lp.SfBUserPlanId
INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID
INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID
WHERE pt.ParentPackageID = @PackageID AND lp.EnterpriseVoice = 1)
ELSE
SET @Result = (SELECT COUNT(SI.ItemID) FROM Quotas AS Q
INNER JOIN ServiceItems AS SI ON SI.ItemTypeID = Q.ItemTypeID
INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID AND PT.ParentPackageID = @PackageID
WHERE Q.QuotaID = @QuotaID)
RETURN @Result
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[CanCreateUser]
(
@ActorID int,
@UserID int
)
RETURNS bit
AS
BEGIN
IF @ActorID = -1
RETURN 1
-- check if the user requests himself
IF @ActorID = @UserID
RETURN 1
DECLARE @IsPeer bit
DECLARE @OwnerID int
SELECT @IsPeer = IsPeer, @OwnerID = OwnerID FROM Users
WHERE UserID = @ActorID
IF @IsPeer = 1
BEGIN
SET @ActorID = @OwnerID
END
IF @ActorID = @UserID
RETURN 1
DECLARE @ParentUserID int, @TmpUserID int
SET @TmpUserID = @UserID
WHILE 10 = 10
BEGIN
SET @ParentUserID = NULL --reset var
-- get owner
SELECT
@ParentUserID = OwnerID
FROM Users
WHERE UserID = @TmpUserID
IF @ParentUserID IS NULL -- the last parent
BREAK
IF @ParentUserID = @ActorID
RETURN 1
SET @TmpUserID = @ParentUserID
END
RETURN 0
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[CanGetUserDetails]
(
@ActorID int,
@UserID int
)
RETURNS bit
AS
BEGIN
IF @ActorID = -1
RETURN 1
-- check if the user requests himself
IF @ActorID = @UserID
BEGIN
RETURN 1
END
DECLARE @IsPeer bit
DECLARE @OwnerID int
SELECT @IsPeer = IsPeer, @OwnerID = OwnerID FROM Users
WHERE UserID = @ActorID
IF @IsPeer = 1
SET @ActorID = @OwnerID
-- get user's owner
SELECT @OwnerID = OwnerID FROM Users
WHERE UserID = @ActorID
IF @UserID = @OwnerID
RETURN 1 -- user can get the details of his owner
-- check if the user requests himself
IF @ActorID = @UserID
BEGIN
RETURN 1
END
DECLARE @ParentUserID int, @TmpUserID int
SET @TmpUserID = @UserID
WHILE 10 = 10
BEGIN
SET @ParentUserID = NULL --reset var
-- get owner
SELECT
@ParentUserID = OwnerID
FROM Users
WHERE UserID = @TmpUserID
IF @ParentUserID IS NULL -- the last parent
BREAK
IF @ParentUserID = @ActorID
RETURN 1
SET @TmpUserID = @ParentUserID
END
RETURN 0
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[CanGetUserPassword]
(
@ActorID int,
@UserID int
)
RETURNS bit
AS
BEGIN
IF @ActorID = -1
RETURN 1 -- unauthenticated mode
-- check if the user requests himself
IF @ActorID = @UserID
BEGIN
RETURN 1
END
DECLARE @IsPeer bit
DECLARE @OwnerID int
SELECT @IsPeer = IsPeer, @OwnerID = OwnerID FROM Users
WHERE UserID = @ActorID
IF @IsPeer = 1
BEGIN
-- peer can't get the password of his peers
-- and his owner
IF @UserID = @OwnerID
RETURN 0
IF EXISTS (
SELECT UserID FROM Users
WHERE IsPeer = 1 AND OwnerID = @OwnerID AND UserID = @UserID
) RETURN 0
-- set actor to his owner
SET @ActorID = @OwnerID
END
-- get user's owner
SELECT @OwnerID = OwnerID FROM Users
WHERE UserID = @ActorID
IF @UserID = @OwnerID
RETURN 0 -- user can't get the password of his owner
DECLARE @ParentUserID int, @TmpUserID int
SET @TmpUserID = @UserID
WHILE 10 = 10
BEGIN
SET @ParentUserID = NULL --reset var
-- get owner
SELECT
@ParentUserID = OwnerID
FROM Users
WHERE UserID = @TmpUserID
IF @ParentUserID IS NULL -- the last parent
BREAK
IF @ParentUserID = @ActorID
RETURN 1
SET @TmpUserID = @ParentUserID
END
RETURN 0
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[UpdatePackage]
(
@ActorID int,
@PackageID int,
@PackageName nvarchar(300),
@PackageComments ntext,
@StatusID int,
@PlanID int,
@PurchaseDate datetime,
@OverrideQuotas bit,
@QuotasXml ntext
)
AS
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
BEGIN TRAN
DECLARE @ParentPackageID int
DECLARE @OldPlanID int
SELECT @ParentPackageID = ParentPackageID, @OldPlanID = PlanID FROM Packages
WHERE PackageID = @PackageID
-- update package
UPDATE Packages SET
PackageName = @PackageName,
PackageComments = @PackageComments,
StatusID = @StatusID,
PlanID = @PlanID,
PurchaseDate = @PurchaseDate,
OverrideQuotas = @OverrideQuotas
WHERE
PackageID = @PackageID
-- update quotas (if required)
EXEC UpdatePackageQuotas @ActorID, @PackageID, @QuotasXml
-- check resulting quotas
DECLARE @ExceedingQuotas AS TABLE (QuotaID int, QuotaName nvarchar(50), QuotaValue int)
-- check exceeding quotas if plan has been changed
IF (@OldPlanID <> @PlanID) OR (@OverrideQuotas = 1)
BEGIN
INSERT INTO @ExceedingQuotas
SELECT * FROM dbo.GetPackageExceedingQuotas(@ParentPackageID) WHERE QuotaValue > 0
END
SELECT * FROM @ExceedingQuotas
IF EXISTS(SELECT * FROM @ExceedingQuotas)
BEGIN
ROLLBACK TRAN
RETURN
END
COMMIT TRAN
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[CanUpdatePackageDetails]
(
@ActorID int,
@PackageID int
)
RETURNS bit
AS
BEGIN
IF @ActorID = -1
RETURN 1
DECLARE @UserID int
SELECT @UserID = UserID FROM Packages
WHERE PackageID = @PackageID
-- check if the user requests himself
IF @ActorID = @UserID
RETURN 1
DECLARE @IsPeer bit
DECLARE @OwnerID int
SELECT @IsPeer = IsPeer, @OwnerID = OwnerID FROM Users
WHERE UserID = @ActorID
IF @IsPeer = 1
SET @ActorID = @OwnerID
IF @ActorID = @UserID
RETURN 1
DECLARE @ParentUserID int, @TmpUserID int
SET @TmpUserID = @UserID
WHILE 10 = 10
BEGIN
SET @ParentUserID = NULL --reset var
-- get owner
SELECT
@ParentUserID = OwnerID
FROM Users
WHERE UserID = @TmpUserID
IF @ParentUserID IS NULL -- the last parent
BREAK
IF @ParentUserID = @ActorID
RETURN 1
SET @TmpUserID = @ParentUserID
END
RETURN 0
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[CanUpdateUserDetails]
(
@ActorID int,
@UserID int
)
RETURNS bit
AS
BEGIN
IF @ActorID = -1
RETURN 1
-- check if the user requests himself
IF @ActorID = @UserID
BEGIN
RETURN 1
END
DECLARE @IsPeer bit
DECLARE @OwnerID int
SELECT @IsPeer = IsPeer, @OwnerID = OwnerID FROM Users
WHERE UserID = @ActorID
IF @IsPeer = 1
BEGIN
-- check if the peer is trying to update his owner
IF @UserID = @OwnerID
RETURN 0
-- check if the peer is trying to update his peers
IF EXISTS (SELECT UserID FROM Users
WHERE IsPeer = 1 AND OwnerID = @OwnerID AND UserID = @UserID)
RETURN 0
SET @ActorID = @OwnerID
END
DECLARE @ParentUserID int, @TmpUserID int
SET @TmpUserID = @UserID
WHILE 10 = 10
BEGIN
SET @ParentUserID = NULL --reset var
-- get owner
SELECT
@ParentUserID = OwnerID
FROM Users
WHERE UserID = @TmpUserID
IF @ParentUserID IS NULL -- the last parent
BREAK
IF @ParentUserID = @ActorID
RETURN 1
SET @TmpUserID = @ParentUserID
END
RETURN 0
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[CheckActorPackageRights]
(
@ActorID int,
@PackageID int
)
RETURNS bit
AS
BEGIN
IF @ActorID = -1 OR @PackageID IS NULL
RETURN 1
-- check if this is a 'system' package
IF @PackageID < 2 AND @PackageID > -1 AND dbo.CheckIsUserAdmin(@ActorID) = 0
RETURN 0
-- get package owner
DECLARE @UserID int
SELECT @UserID = UserID FROM Packages
WHERE PackageID = @PackageID
IF @UserID IS NULL
RETURN 1 -- unexisting package
-- check user
RETURN dbo.CheckActorUserRights(@ActorID, @UserID)
RETURN 0
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[CheckActorParentPackageRights]
(
@ActorID int,
@PackageID int
)
RETURNS bit
AS
BEGIN
IF @ActorID = -1 OR @PackageID IS NULL
RETURN 1
-- get package owner
DECLARE @UserID int
SELECT @UserID = UserID FROM Packages
WHERE PackageID = @PackageID
IF @UserID IS NULL
RETURN 1 -- unexisting package
-- check user
RETURN dbo.CanGetUserDetails(@ActorID, @UserID)
RETURN 0
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[CheckActorUserRights]
(
@ActorID int,
@UserID int
)
RETURNS bit
AS
BEGIN
IF @ActorID = -1 OR @UserID IS NULL
RETURN 1
-- check if the user requests himself
IF @ActorID = @UserID
BEGIN
RETURN 1
END
DECLARE @IsPeer bit
DECLARE @OwnerID int
SELECT @IsPeer = IsPeer, @OwnerID = OwnerID FROM Users
WHERE UserID = @ActorID
IF @IsPeer = 1
SET @ActorID = @OwnerID
-- check if the user requests his owner
/*
IF @ActorID = @UserID
BEGIN
RETURN 0
END
*/
IF @ActorID = @UserID
BEGIN
RETURN 1
END
DECLARE @ParentUserID int, @TmpUserID int
SET @TmpUserID = @UserID
WHILE 10 = 10
BEGIN
SET @ParentUserID = NULL --reset var
-- get owner
SELECT
@ParentUserID = OwnerID
FROM Users
WHERE UserID = @TmpUserID
IF @ParentUserID IS NULL -- the last parent
BREAK
IF @ParentUserID = @ActorID
RETURN 1
SET @TmpUserID = @ParentUserID
END
RETURN 0
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE FUNCTION dbo.CheckExceedingQuota
(
@PackageID int,
@QuotaID int,
@QuotaTypeID int
)
RETURNS int
AS
BEGIN
DECLARE @ExceedValue int
SET @ExceedValue = 0
DECLARE @PackageQuotaValue int
SET @PackageQuotaValue = dbo.GetPackageAllocatedQuota(@PackageID, @QuotaID)
-- check boolean quota
IF @QuotaTypeID = 1-- AND @PackageQuotaValue > 0 -- enabled
RETURN 0 -- can exceed
-- check numeric quota
IF @QuotaTypeID = 2 AND @PackageQuotaValue = -1 -- unlimited
RETURN 0 -- can exceed
-- get summary usage for the numeric quota
DECLARE @UsedQuantity int
DECLARE @UsedPlans int
DECLARE @UsedOverrides int
DECLARE @UsedAddons int
-- limited by hosting plans
SELECT @UsedPlans = SUM(HPQ.QuotaValue) FROM Packages AS P
INNER JOIN HostingPlanQuotas AS HPQ ON P.PlanID = HPQ.PlanID
WHERE HPQ.QuotaID = @QuotaID
AND P.ParentPackageID = @PackageID
AND P.OverrideQuotas = 0
-- overrides
SELECT @UsedOverrides = SUM(PQ.QuotaValue) FROM Packages AS P
INNER JOIN PackageQuotas AS PQ ON P.PackageID = PQ.PackageID AND PQ.QuotaID = @QuotaID
WHERE P.ParentPackageID = @PackageID
AND P.OverrideQuotas = 1
-- addons
SELECT @UsedAddons = SUM(HPQ.QuotaValue * PA.Quantity)
FROM Packages AS P
INNER JOIN PackageAddons AS PA ON P.PackageID = PA.PackageID
INNER JOIN HostingPlanQuotas AS HPQ ON PA.PlanID = HPQ.PlanID
WHERE P.ParentPackageID = @PackageID AND HPQ.QuotaID = @QuotaID AND PA.StatusID = 1 -- active
--SET @UsedQuantity = (SELECT SUM(dbo.GetPackageAllocatedQuota(PackageID, @QuotaID)) FROM Packages WHERE ParentPackageID = @PackageID)
SET @UsedQuantity = @UsedPlans + @UsedOverrides + @UsedAddons
IF @UsedQuantity IS NULL
RETURN 0 -- can exceed
SET @ExceedValue = @UsedQuantity - @PackageQuotaValue
RETURN @ExceedValue
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[CheckIsUserAdmin]
(
@UserID int
)
RETURNS bit
AS
BEGIN
IF @UserID = -1
RETURN 1
IF EXISTS (SELECT UserID FROM Users
WHERE UserID = @UserID AND RoleID = 1) -- administrator
RETURN 1
RETURN 0
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[CheckPackageParent]
(
@ParentPackageID int,
@PackageID int
)
RETURNS bit
AS
BEGIN
-- check if the user requests hiself
IF @ParentPackageID = @PackageID
BEGIN
RETURN 1
END
DECLARE @TmpParentPackageID int, @TmpPackageID int
SET @TmpPackageID = @PackageID
WHILE 10 = 10
BEGIN
SET @TmpParentPackageID = NULL --reset var
-- get owner
SELECT
@TmpParentPackageID = ParentPackageID
FROM Packages
WHERE PackageID = @TmpPackageID
IF @TmpParentPackageID IS NULL -- the last parent package
BREAK
IF @TmpParentPackageID = @ParentPackageID
RETURN 1
SET @TmpPackageID = @TmpParentPackageID
END
RETURN 0
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[CheckUserParent]
(
@OwnerID int,
@UserID int
)
RETURNS bit
AS
BEGIN
-- check if the user requests himself
IF @OwnerID = @UserID
BEGIN
RETURN 1
END
-- check if the owner is peer
DECLARE @IsPeer int, @TmpOwnerID int
SELECT @IsPeer = IsPeer, @TmpOwnerID = OwnerID FROM Users
WHERE UserID = @OwnerID
IF @IsPeer = 1
SET @OwnerID = @TmpOwnerID
-- check if the user requests himself
IF @OwnerID = @UserID
BEGIN
RETURN 1
END
DECLARE @ParentUserID int, @TmpUserID int
SET @TmpUserID = @UserID
WHILE 10 = 10
BEGIN
SET @ParentUserID = NULL --reset var
-- get owner
SELECT
@ParentUserID = OwnerID
FROM Users
WHERE UserID = @TmpUserID
IF @ParentUserID IS NULL -- the last parent
BREAK
IF @ParentUserID = @OwnerID
RETURN 1
SET @TmpUserID = @ParentUserID
END
RETURN 0
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION GetFullIPAddress
(
@ExternalIP varchar(24),
@InternalIP varchar(24)
)
RETURNS varchar(60)
AS
BEGIN
DECLARE @IP varchar(60)
SET @IP = ''
IF @ExternalIP IS NOT NULL AND @ExternalIP <> ''
SET @IP = @ExternalIP
IF @InternalIP IS NOT NULL AND @InternalIP <> ''
SET @IP = @IP + ' (' + @InternalIP + ')'
RETURN @IP
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION GetItemComments
(
@ItemID int,
@ItemTypeID varchar(50),
@ActorID int
)
RETURNS nvarchar(3000)
AS
BEGIN
DECLARE @text nvarchar(3000)
SET @text = ''
SELECT @text = @text + U.Username + ' - ' + CONVERT(nvarchar(50), C.CreatedDate) + '
' + CommentText + '
--------------------------------------
' FROM Comments AS C
INNER JOIN UsersDetailed AS U ON C.UserID = U.UserID
WHERE
ItemID = @ItemID
AND ItemTypeID = @ItemTypeID
AND dbo.CheckUserParent(@ActorID, C.UserID) = 1
ORDER BY C.CreatedDate DESC
RETURN @text
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION dbo.GetPackageAllocatedQuota
(
@PackageID int,
@QuotaID int
)
RETURNS int
AS
BEGIN
DECLARE @Result int
DECLARE @QuotaTypeID int
SELECT @QuotaTypeID = QuotaTypeID FROM Quotas
WHERE QuotaID = @QuotaID
IF @QuotaTypeID = 1
SET @Result = 1 -- enabled
ELSE
SET @Result = -1 -- unlimited
DECLARE @PID int, @ParentPackageID int
SET @PID = @PackageID
DECLARE @OverrideQuotas bit
WHILE 1 = 1
BEGIN
DECLARE @QuotaValue int
-- get package info
SELECT
@ParentPackageID = ParentPackageID,
@OverrideQuotas = OverrideQuotas
FROM Packages WHERE PackageID = @PID
SET @QuotaValue = NULL
-- check if this is a root 'System' package
IF @ParentPackageID IS NULL
BEGIN
IF @QuotaTypeID = 1 -- boolean
SET @QuotaValue = 1 -- enabled
ELSE IF @QuotaTypeID > 1 -- numeric
SET @QuotaValue = -1 -- unlimited
END
ELSE
BEGIN
-- check the current package
IF @OverrideQuotas = 1
SELECT @QuotaValue = QuotaValue FROM PackageQuotas WHERE QuotaID = @QuotaID AND PackageID = @PID
ELSE
SELECT @QuotaValue = HPQ.QuotaValue FROM Packages AS P
INNER JOIN HostingPlanQuotas AS HPQ ON P.PlanID = HPQ.PlanID
WHERE HPQ.QuotaID = @QuotaID AND P.PackageID = @PID
IF @QuotaValue IS NULL
SET @QuotaValue = 0
-- check package addons
DECLARE @QuotaAddonValue int
SELECT
@QuotaAddonValue = SUM(HPQ.QuotaValue * PA.Quantity)
FROM PackageAddons AS PA
INNER JOIN HostingPlanQuotas AS HPQ ON PA.PlanID = HPQ.PlanID
WHERE PA.PackageID = @PID AND HPQ.QuotaID = @QuotaID AND PA.StatusID = 1 -- active
-- process bool quota
IF @QuotaAddonValue IS NOT NULL
BEGIN
IF @QuotaTypeID = 1
BEGIN
IF @QuotaAddonValue > 0 AND @QuotaValue = 0 -- enabled
SET @QuotaValue = 1
END
ELSE
BEGIN -- numeric quota
IF @QuotaAddonValue < 0 -- unlimited
SET @QuotaValue = -1
ELSE
SET @QuotaValue = @QuotaValue + @QuotaAddonValue
END
END
END
-- process bool quota
IF @QuotaTypeID = 1
BEGIN
IF @QuotaValue = 0 OR @QuotaValue IS NULL -- disabled
RETURN 0
END
ELSE
BEGIN -- numeric quota
IF @QuotaValue = 0 OR @QuotaValue IS NULL -- zero quantity
RETURN 0
IF (@QuotaValue <> -1 AND @Result = -1) OR (@QuotaValue < @Result AND @QuotaValue <> -1)
SET @Result = @QuotaValue
END
IF @ParentPackageID IS NULL
RETURN @Result -- exit from the loop
SET @PID = @ParentPackageID
END -- end while
RETURN @Result
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION dbo.GetPackageAllocatedResource
(
@PackageID int,
@GroupID int,
@ServerID int
)
RETURNS bit
AS
BEGIN
IF @PackageID IS NULL
RETURN 1
DECLARE @Result bit
SET @Result = 1 -- enabled
DECLARE @PID int, @ParentPackageID int
SET @PID = @PackageID
DECLARE @OverrideQuotas bit
IF @ServerID IS NULL OR @ServerID = 0
SELECT @ServerID = ServerID FROM Packages
WHERE PackageID = @PackageID
WHILE 1 = 1
BEGIN
DECLARE @GroupEnabled int
-- get package info
SELECT
@ParentPackageID = ParentPackageID,
@OverrideQuotas = OverrideQuotas
FROM Packages WHERE PackageID = @PID
-- check if this is a root 'System' package
SET @GroupEnabled = 1 -- enabled
IF @ParentPackageID IS NULL
BEGIN
IF @ServerID = -1 OR @ServerID IS NULL
RETURN 1
IF EXISTS (SELECT VirtualServer FROM Servers WHERE ServerID = @ServerID AND VirtualServer = 1)
BEGIN
IF NOT EXISTS(
SELECT
DISTINCT(PROV.GroupID)
FROM VirtualServices AS VS
INNER JOIN Services AS S ON VS.ServiceID = S.ServiceID
INNER JOIN Providers AS PROV ON S.ProviderID = PROV.ProviderID
WHERE PROV.GroupID = @GroupID AND VS.ServerID = @ServerID
)
SET @GroupEnabled = 0
END
ELSE
BEGIN
IF NOT EXISTS(
SELECT
DISTINCT(PROV.GroupID)
FROM Services AS S
INNER JOIN Providers AS PROV ON S.ProviderID = PROV.ProviderID
WHERE PROV.GroupID = @GroupID AND S.ServerID = @ServerID
)
SET @GroupEnabled = 0
END
RETURN @GroupEnabled -- exit from the loop
END
ELSE -- parentpackage is not null
BEGIN
-- check the current package
IF @OverrideQuotas = 1
BEGIN
IF NOT EXISTS(
SELECT GroupID FROM PackageResources WHERE GroupID = @GroupID AND PackageID = @PID
)
SET @GroupEnabled = 0
END
ELSE
BEGIN
IF NOT EXISTS(
SELECT HPR.GroupID FROM Packages AS P
INNER JOIN HostingPlanResources AS HPR ON P.PlanID = HPR.PlanID
WHERE HPR.GroupID = @GroupID AND P.PackageID = @PID
)
SET @GroupEnabled = 0
END
-- check addons
IF EXISTS(
SELECT HPR.GroupID FROM PackageAddons AS PA
INNER JOIN HostingPlanResources AS HPR ON PA.PlanID = HPR.PlanID
WHERE HPR.GroupID = @GroupID AND PA.PackageID = @PID
AND PA.StatusID = 1 -- active add-on
)
SET @GroupEnabled = 1
END
IF @GroupEnabled = 0
RETURN 0
SET @PID = @ParentPackageID
END -- end while
RETURN @Result
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION dbo.GetPackageExceedingQuotas
(
@PackageID int
)
RETURNS @quotas TABLE (QuotaID int, QuotaName nvarchar(50), QuotaValue int)
AS
BEGIN
DECLARE @ParentPackageID int
DECLARE @PlanID int
DECLARE @OverrideQuotas bit
SELECT
@ParentPackageID = ParentPackageID,
@PlanID = PlanID,
@OverrideQuotas = OverrideQuotas
FROM Packages WHERE PackageID = @PackageID
IF @ParentPackageID IS NOT NULL -- not root package
BEGIN
IF @OverrideQuotas = 0 -- hosting plan quotas
BEGIN
INSERT INTO @quotas (QuotaID, QuotaName, QuotaValue)
SELECT
Q.QuotaID,
Q.QuotaName,
dbo.CheckExceedingQuota(@PackageID, Q.QuotaID, Q.QuotaTypeID) AS QuotaValue
FROM HostingPlanQuotas AS HPQ
INNER JOIN Quotas AS Q ON HPQ.QuotaID = Q.QuotaID
WHERE HPQ.PlanID = @PlanID AND Q.QuotaTypeID <> 3
END
ELSE -- overriden quotas
BEGIN
INSERT INTO @quotas (QuotaID, QuotaName, QuotaValue)
SELECT
Q.QuotaID,
Q.QuotaName,
dbo.CheckExceedingQuota(@PackageID, Q.QuotaID, Q.QuotaTypeID) AS QuotaValue
FROM PackageQuotas AS PQ
INNER JOIN Quotas AS Q ON PQ.QuotaID = Q.QuotaID
WHERE PQ.PackageID = @PackageID AND Q.QuotaTypeID <> 3
END
END -- if 'root' package
RETURN
END
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION dbo.PackageParents
(
@PackageID int
)
RETURNS @T TABLE (PackageOrder int IDENTITY(1,1), PackageID int)
AS
BEGIN
-- insert current user
INSERT @T VALUES (@PackageID)
-- owner
DECLARE @ParentPackageID int, @TmpPackageID int
SET @TmpPackageID = @PackageID
WHILE 10 = 10
BEGIN
SET @ParentPackageID = NULL --reset var
SELECT @ParentPackageID = ParentPackageID FROM Packages
WHERE PackageID = @TmpPackageID
IF @ParentPackageID IS NULL -- parent not found
BREAK
INSERT @T VALUES (@ParentPackageID)
SET @TmpPackageID = @ParentPackageID
END
RETURN
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION dbo.PackagesTree
(
@PackageID int,
@Recursive bit = 0
)
RETURNS @T TABLE (PackageID int)
AS
BEGIN
INSERT INTO @T VALUES (@PackageID)
IF @Recursive = 1
BEGIN
WITH RecursivePackages(ParentPackageID, PackageID, PackageLevel) AS
(
SELECT ParentPackageID, PackageID, 0 AS PackageLevel
FROM Packages
WHERE ParentPackageID = @PackageID
UNION ALL
SELECT p.ParentPackageID, p.PackageID, PackageLevel + 1
FROM Packages p
INNER JOIN RecursivePackages d
ON p.ParentPackageID = d.PackageID
WHERE @Recursive = 1
)
INSERT INTO @T
SELECT PackageID
FROM RecursivePackages
END
RETURN
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION dbo.UserParents
(
@ActorID int,
@UserID int
)
RETURNS @T TABLE (UserOrder int IDENTITY(1,1), UserID int)
AS
BEGIN
-- insert current user
INSERT @T VALUES (@UserID)
DECLARE @TopUserID int
IF @ActorID = -1
BEGIN
SELECT @TopUserID = UserID FROM Users WHERE OwnerID IS NULL
END
ELSE
BEGIN
SET @TopUserID = @ActorID
IF EXISTS (SELECT UserID FROM Users WHERE UserID = @ActorID AND IsPeer = 1)
SELECT @TopUserID = OwnerID FROM Users WHERE UserID = @ActorID AND IsPeer = 1
END
-- owner
DECLARE @OwnerID int, @TmpUserID int
SET @TmpUserID = @UserID
WHILE (@TmpUserID <> @TopUserID)
BEGIN
SET @OwnerID = NULL
SELECT @OwnerID = OwnerID FROM Users WHERE UserID = @TmpUserID
IF @OwnerID IS NOT NULL
BEGIN
INSERT @T VALUES (@OwnerID)
SET @TmpUserID = @OwnerID
END
END
RETURN
END
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION dbo.UsersTree
(
@OwnerID int,
@Recursive bit = 0
)
RETURNS @T TABLE (UserID int)
AS
BEGIN
IF @Recursive = 1
BEGIN
-- insert "root" user
INSERT @T VALUES(@OwnerID)
-- get all children recursively
WHILE @@ROWCOUNT > 0
BEGIN
INSERT @T SELECT UserID
FROM Users
WHERE OwnerID IN(SELECT UserID from @T) AND UserID NOT IN(SELECT UserID FROM @T)
END
END
ELSE
BEGIN
INSERT @T VALUES(@OwnerID)
END
RETURN
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[AuditLog](
[RecordID] [varchar](32) NOT NULL,
[UserID] [int] NULL,
[Username] [nvarchar](50) NULL,
[ItemID] [int] NULL,
[SeverityID] [int] NOT NULL,
[StartDate] [datetime] NOT NULL,
[FinishDate] [datetime] NOT NULL,
[SourceName] [varchar](50) NOT NULL,
[TaskName] [varchar](50) NOT NULL,
[ItemName] [nvarchar](100) NULL,
[ExecutionLog] [ntext] NULL,
[PackageID] [int] NULL,
CONSTRAINT [PK_Log] PRIMARY KEY CLUSTERED
(
[RecordID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[AuditLogSources](
[SourceName] [varchar](100) NOT NULL,
CONSTRAINT [PK_AuditLogSources] PRIMARY KEY CLUSTERED
(
[SourceName] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[AuditLogTasks](
[SourceName] [varchar](100) NOT NULL,
[TaskName] [varchar](100) NOT NULL,
[TaskDescription] [nvarchar](100) NULL,
CONSTRAINT [PK_LogActions] PRIMARY KEY CLUSTERED
(
[SourceName] ASC,
[TaskName] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BlackBerryUsers](
[BlackBerryUserId] [int] IDENTITY(1,1) NOT NULL,
[AccountId] [int] NOT NULL,
[CreatedDate] [datetime] NOT NULL,
[ModifiedDate] [datetime] NOT NULL,
CONSTRAINT [PK_BlackBerryUsers] PRIMARY KEY CLUSTERED
(
[BlackBerryUserId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Clusters](
[ClusterID] [int] IDENTITY(1,1) NOT NULL,
[ClusterName] [nvarchar](100) NOT NULL,
CONSTRAINT [PK_Clusters] PRIMARY KEY CLUSTERED
(
[ClusterID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Comments](
[CommentID] [int] IDENTITY(1,1) NOT NULL,
[ItemTypeID] [varchar](50) NOT NULL,
[ItemID] [int] NOT NULL,
[UserID] [int] NOT NULL,
[CreatedDate] [datetime] NOT NULL,
[CommentText] [nvarchar](1000) NULL,
[SeverityID] [int] NULL,
CONSTRAINT [PK_Comments] PRIMARY KEY CLUSTERED
(
[CommentID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[CRMUsers](
[CRMUserID] [int] IDENTITY(1,1) NOT NULL,
[AccountID] [int] NOT NULL,
[CreatedDate] [datetime] NOT NULL,
[ChangedDate] [datetime] NOT NULL,
[CRMUserGuid] [uniqueidentifier] NULL,
[BusinessUnitID] [uniqueidentifier] NULL,
CONSTRAINT [PK_CRMUsers] PRIMARY KEY CLUSTERED
(
[CRMUserID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Domains](
[DomainID] [int] IDENTITY(1,1) NOT NULL,
[PackageID] [int] NOT NULL,
[ZoneItemID] [int] NULL,
[DomainName] [nvarchar](100) NOT NULL,
[HostingAllowed] [bit] NOT NULL,
[WebSiteID] [int] NULL,
[MailDomainID] [int] NULL,
[IsSubDomain] [bit] NOT NULL,
[IsInstantAlias] [bit] NOT NULL,
[IsDomainPointer] [bit] NOT NULL,
[DomainItemId] [int] NULL,
CONSTRAINT [PK_Domains] PRIMARY KEY CLUSTERED
(
[DomainID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ecAddonProducts](
[AddonID] [int] NOT NULL,
[ProductID] [int] NOT NULL,
[ResellerID] [int] NOT NULL,
CONSTRAINT [PK_ecAddonProducts] PRIMARY KEY CLUSTERED
(
[AddonID] ASC,
[ProductID] ASC,
[ResellerID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ecBillingCycles](
[CycleID] [int] IDENTITY(1,1) NOT NULL,
[ResellerID] [int] NOT NULL,
[CycleName] [nvarchar](255) NOT NULL,
[BillingPeriod] [nvarchar](50) NOT NULL,
[PeriodLength] [int] NOT NULL,
[Created] [datetime] NOT NULL,
CONSTRAINT [PK_ecBillingCycles] PRIMARY KEY CLUSTERED
(
[CycleID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ecCategory](
[CategoryID] [int] IDENTITY(1,1) NOT NULL,
[CategoryName] [nvarchar](255) NOT NULL,
[CategorySku] [nvarchar](50) NOT NULL,
[ParentID] [int] NULL,
[Level] [int] NOT NULL,
[ShortDescription] [nvarchar](255) NULL,
[FullDescription] [ntext] NULL,
[Created] [datetime] NOT NULL,
[Modified] [datetime] NULL,
[CreatorID] [int] NOT NULL,
[ModifierID] [int] NULL,
[ItemOrder] [int] NULL,
[ResellerID] [int] NOT NULL,
CONSTRAINT [PK_EC_Categories] PRIMARY KEY CLUSTERED
(
[CategoryID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ecContracts](
[ContractID] [nvarchar](50) NOT NULL,
[CustomerID] [int] NULL,
[ResellerID] [int] NOT NULL,
[AccountName] [nvarchar](50) NOT NULL,
[OpenedDate] [datetime] NOT NULL,
[Status] [int] NOT NULL,
[ClosedDate] [datetime] NULL,
[Balance] [money] NOT NULL,
[FirstName] [nvarchar](50) NOT NULL,
[LastName] [nvarchar](50) NOT NULL,
[Email] [nvarchar](255) NOT NULL,
[CompanyName] [nvarchar](50) NULL,
[PropertyNames] [ntext] NULL,
[PropertyValues] [ntext] NULL,
CONSTRAINT [PK_ecContracts] PRIMARY KEY CLUSTERED
(
[ContractID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ecCustomersPayments](
[PaymentID] [int] IDENTITY(1,1) NOT NULL,
[InvoiceID] [int] NOT NULL,
[TransactionID] [nvarchar](255) NOT NULL,
[Total] [money] NOT NULL,
[Currency] [nvarchar](3) NOT NULL,
[Created] [datetime] NOT NULL,
[MethodName] [nvarchar](50) NOT NULL,
[PluginID] [int] NOT NULL,
[StatusID] [int] NOT NULL,
[ContractID] [nvarchar](50) NOT NULL,
CONSTRAINT [PK_EC_Payments] PRIMARY KEY CLUSTERED
(
[PaymentID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ecDomainSvcs](
[ServiceID] [int] NOT NULL,
[ProductID] [int] NULL,
[DomainID] [int] NULL,
[PluginID] [int] NULL,
[FQDN] [nvarchar](64) NOT NULL,
[SvcCycleID] [int] NULL,
[PropertyNames] [ntext] NULL,
[PropertyValues] [ntext] NULL,
CONSTRAINT [PK_ecDomainsSvcs] PRIMARY KEY CLUSTERED
(
[ServiceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ecDomainSvcsCycles](
[SvcCycleID] [int] IDENTITY(1,1) NOT NULL,
[ServiceID] [int] NOT NULL,
[CycleName] [nvarchar](255) NOT NULL,
[BillingPeriod] [nvarchar](50) NOT NULL,
[PeriodLength] [int] NOT NULL,
[SetupFee] [money] NOT NULL,
[RecurringFee] [money] NOT NULL,
[Currency] [nvarchar](3) NOT NULL,
CONSTRAINT [PK_ecDomainsSvcsCycles] PRIMARY KEY CLUSTERED
(
[SvcCycleID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ecHostingAddons](
[ProductID] [int] NOT NULL,
[PlanID] [int] NULL,
[Recurring] [bit] NOT NULL,
[DummyAddon] [bit] NOT NULL,
[Countable] [bit] NOT NULL,
[SetupFee] [money] NULL,
[OneTimeFee] [money] NULL,
[2COID] [nvarchar](50) NULL,
[ResellerID] [int] NOT NULL
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ecHostingAddonsCycles](
[ProductID] [int] NOT NULL,
[CycleID] [int] NOT NULL,
[SetupFee] [money] NOT NULL,
[RecurringFee] [money] NOT NULL,
[SortOrder] [int] NOT NULL,
CONSTRAINT [PK_ecHostingAddonsCycles] PRIMARY KEY CLUSTERED
(
[ProductID] ASC,
[CycleID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ecHostingAddonSvcs](
[ServiceID] [int] NOT NULL,
[ProductID] [int] NOT NULL,
[PlanID] [int] NULL,
[PackageAddonID] [int] NULL,
[Quantity] [int] NOT NULL,
[Recurring] [bit] NOT NULL,
[DummyAddon] [bit] NOT NULL,
[SvcCycleID] [int] NOT NULL,
CONSTRAINT [PK_ecAddonPackagesSvcs] PRIMARY KEY CLUSTERED
(
[ServiceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ecHostingAddonSvcsCycles](
[SvcCycleID] [int] IDENTITY(1,1) NOT NULL,
[ServiceID] [int] NOT NULL,
[CycleName] [nvarchar](255) NULL,
[BillingPeriod] [nvarchar](50) NULL,
[PeriodLength] [int] NULL,
[SetupFee] [money] NULL,
[CyclePrice] [money] NOT NULL,
[Currency] [nvarchar](3) NOT NULL,
CONSTRAINT [PK_ecAddonPackagesSvcsCycles] PRIMARY KEY CLUSTERED
(
[SvcCycleID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ecHostingPackageSvcs](
[ServiceID] [int] NOT NULL,
[ProductID] [int] NOT NULL,
[PlanID] [int] NOT NULL,
[PackageID] [int] NULL,
[UserRole] [int] NOT NULL,
[InitialStatus] [int] NOT NULL,
[SvcCycleID] [int] NOT NULL,
CONSTRAINT [PK_ecPackagesSvcs] PRIMARY KEY CLUSTERED
(
[ServiceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ecHostingPackageSvcsCycles](
[SvcCycleID] [int] IDENTITY(1,1) NOT NULL,
[ServiceID] [int] NOT NULL,
[CycleName] [nvarchar](255) NOT NULL,
[BillingPeriod] [nvarchar](50) NOT NULL,
[PeriodLength] [int] NOT NULL,
[SetupFee] [money] NULL,
[RecurringFee] [money] NOT NULL,
[Currency] [nvarchar](3) NOT NULL,
CONSTRAINT [PK_ecPackagesSvcsCycles] PRIMARY KEY CLUSTERED
(
[SvcCycleID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ecHostingPlans](
[ProductID] [int] NOT NULL,
[ResellerID] [int] NOT NULL,
[PlanID] [int] NOT NULL,
[UserRole] [int] NOT NULL,
[InitialStatus] [int] NOT NULL,
[DomainOption] [int] NOT NULL,
CONSTRAINT [PK_ecHostingPlans] PRIMARY KEY CLUSTERED
(
[ProductID] ASC,
[ResellerID] ASC,
[PlanID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ecHostingPlansBillingCycles](
[ProductID] [int] NOT NULL,
[CycleID] [int] NOT NULL,
[SetupFee] [money] NOT NULL,
[RecurringFee] [money] NOT NULL,
[SortOrder] [int] NOT NULL,
CONSTRAINT [PK_ecHostingPlansBillingCycles] PRIMARY KEY CLUSTERED
(
[ProductID] ASC,
[CycleID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ecInvoice](
[InvoiceID] [int] IDENTITY(1,1) NOT NULL,
[Created] [datetime] NOT NULL,
[DueDate] [datetime] NOT NULL,
[Total] [money] NOT NULL,
[SubTotal] [money] NOT NULL,
[TaxAmount] [money] NULL,
[Currency] [nvarchar](3) NOT NULL,
[InvoiceNumber] [nvarchar](50) NULL,
[TaxationID] [int] NULL,
[ContractID] [nvarchar](50) NOT NULL,
CONSTRAINT [PK_EC_Invoices] PRIMARY KEY CLUSTERED
(
[InvoiceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ecInvoiceItems](
[ItemID] [int] IDENTITY(1,1) NOT NULL,
[InvoiceID] [int] NOT NULL,
[ServiceID] [int] NULL,
[ItemName] [nvarchar](255) NOT NULL,
[TypeName] [nvarchar](255) NOT NULL,
[Quantity] [int] NOT NULL,
[Total] [money] NOT NULL,
[SubTotal] [money] NOT NULL,
[UnitPrice] [money] NOT NULL,
[Processed] [bit] NOT NULL,
CONSTRAINT [PK_EC_InvoiceItems] PRIMARY KEY CLUSTERED
(
[ItemID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ecPaymentMethods](
[ResellerID] [int] NOT NULL,
[MethodName] [nvarchar](50) NOT NULL,
[PluginID] [int] NOT NULL,
[DisplayName] [nvarchar](50) NOT NULL,
[SupportedItems] [nvarchar](255) NULL,
CONSTRAINT [PK_ecPaymentMethods] PRIMARY KEY CLUSTERED
(
[ResellerID] ASC,
[MethodName] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ecPaymentProfiles](
[PropertyNames] [ntext] NOT NULL,
[PropertyValues] [ntext] NOT NULL,
[Created] [datetime] NOT NULL,
[ContractID] [nvarchar](50) NOT NULL,
CONSTRAINT [PK_ecPaymentProfiles] PRIMARY KEY CLUSTERED
(
[ContractID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ecPluginsProperties](
[PluginID] [int] NOT NULL,
[PropertyName] [nvarchar](50) NOT NULL,
[PropertyValue] [nvarchar](512) NULL,
[ResellerID] [int] NOT NULL,
CONSTRAINT [PK_ecPluginsSettings] PRIMARY KEY CLUSTERED
(
[PluginID] ASC,
[ResellerID] ASC,
[PropertyName] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ecProduct](
[ProductID] [int] IDENTITY(1,1) NOT NULL,
[ProductName] [nvarchar](255) NOT NULL,
[ProductSKU] [nvarchar](50) NOT NULL,
[TypeID] [int] NULL,
[Description] [ntext] NULL,
[Created] [datetime] NOT NULL,
[Enabled] [bit] NOT NULL,
[ResellerID] [int] NOT NULL,
[TaxInclusive] [bit] NULL,
CONSTRAINT [PK_EC_Products] PRIMARY KEY CLUSTERED
(
[ProductID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ecProductCategories](
[ProductID] [int] NOT NULL,
[CategoryID] [int] NOT NULL,
[ResellerID] [int] NOT NULL,
CONSTRAINT [PK_ecProductCategories] PRIMARY KEY CLUSTERED
(
[ProductID] ASC,
[CategoryID] ASC,
[ResellerID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ecProductsHighlights](
[ProductID] [int] NOT NULL,
[HighlightText] [nvarchar](255) NOT NULL,
[SortOrder] [int] NOT NULL
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ecProductType](
[TypeID] [int] IDENTITY(1,1) NOT NULL,
[TypeName] [nvarchar](255) NULL,
[ProvisioningController] [nvarchar](512) NULL,
[Created] [datetime] NOT NULL,
[NativeItemType] [nvarchar](512) NOT NULL,
[ServiceItemType] [nvarchar](512) NOT NULL,
CONSTRAINT [PK_EC_ProductTypes] PRIMARY KEY CLUSTERED
(
[TypeID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ecProductTypeControls](
[TypeID] [int] NOT NULL,
[ControlKey] [nvarchar](50) NOT NULL,
[ControlSrc] [nvarchar](512) NOT NULL,
CONSTRAINT [PK_ecProductTypeControls] PRIMARY KEY CLUSTERED
(
[TypeID] ASC,
[ControlKey] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ecService](
[ServiceID] [int] IDENTITY(1,1) NOT NULL,
[ServiceName] [nvarchar](255) NOT NULL,
[TypeID] [int] NULL,
[Status] [int] NOT NULL,
[Created] [datetime] NOT NULL,
[Modified] [datetime] NULL,
[ParentID] [int] NULL,
[ContractID] [nvarchar](50) NOT NULL,
CONSTRAINT [PK_SpaceInstances] PRIMARY KEY CLUSTERED
(
[ServiceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ecServiceHandlersResponses](
[ResponseID] [int] IDENTITY(1,1) NOT NULL,
[ServiceID] [nvarchar](50) NOT NULL,
[ContractID] [nvarchar](50) NULL,
[InvoiceID] [int] NULL,
[TextResponse] [ntext] NULL,
[Received] [datetime] NOT NULL,
[ErrorMessage] [nvarchar](255) NULL,
CONSTRAINT [PK_ecServiceHandlersResponses] PRIMARY KEY CLUSTERED
(
[ResponseID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ecStoreDefaultSettings](
[SettingsName] [nvarchar](50) NOT NULL,
[PropertyName] [nvarchar](50) NOT NULL,
[PropertyValue] [ntext] NULL,
CONSTRAINT [PK_ecSpaceDefaultSettings] PRIMARY KEY CLUSTERED
(
[SettingsName] ASC,
[PropertyName] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ecStoreSettings](
[SettingsName] [nvarchar](50) NOT NULL,
[PropertyName] [nvarchar](50) NOT NULL,
[PropertyValue] [ntext] NULL,
[ResellerID] [int] NOT NULL,
CONSTRAINT [PK_ecSystemSettings] PRIMARY KEY CLUSTERED
(
[ResellerID] ASC,
[SettingsName] ASC,
[PropertyName] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ecSupportedPluginLog](
[RecordID] [int] IDENTITY(1,1) NOT NULL,
[PluginID] [int] NOT NULL,
[RecordType] [int] NOT NULL,
[RawData] [ntext] NOT NULL,
[Created] [datetime] NOT NULL,
[ContractID] [nvarchar](50) NOT NULL,
CONSTRAINT [PK_ecSpacePluginLog] PRIMARY KEY CLUSTERED
(
[RecordID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ecSupportedPlugins](
[PluginID] [int] IDENTITY(1,1) NOT NULL,
[PluginName] [nvarchar](50) NOT NULL,
[DisplayName] [nvarchar](50) NOT NULL,
[PluginGroup] [nvarchar](50) NOT NULL,
[TypeName] [nvarchar](255) NOT NULL,
[Interactive] [bit] NOT NULL,
[SupportedItems] [nvarchar](255) NULL,
[UniqueID] [nvarchar](50) NULL,
CONSTRAINT [PK_ecSupportedPlugins] PRIMARY KEY CLUSTERED
(
[PluginID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ecSvcsUsageLog](
[ServiceID] [int] NOT NULL,
[StartDate] [datetime] NOT NULL,
[EndDate] [datetime] NOT NULL,
[SvcCycleID] [int] NOT NULL,
[PeriodClosed] [bit] NULL,
CONSTRAINT [PK_ecServicesLifeCyclesLog] PRIMARY KEY CLUSTERED
(
[ServiceID] ASC,
[SvcCycleID] ASC,
[StartDate] ASC,
[EndDate] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ecSystemTriggers](
[TriggerID] [nvarchar](50) NOT NULL,
[OwnerID] [int] NOT NULL,
[TriggerHandler] [nvarchar](512) NOT NULL,
[ReferenceID] [nvarchar](50) NOT NULL,
[Namespace] [nvarchar](255) NOT NULL,
[Status] [nvarchar](50) NULL,
CONSTRAINT [PK_ecSystemTriggers] PRIMARY KEY CLUSTERED
(
[TriggerID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ecTaxations](
[TaxationID] [int] IDENTITY(1,1) NOT NULL,
[ResellerID] [int] NOT NULL,
[Country] [nvarchar](3) NOT NULL,
[State] [nvarchar](50) NOT NULL,
[Description] [nvarchar](50) NOT NULL,
[TypeID] [int] NOT NULL,
[Amount] [decimal](5, 2) NOT NULL,
[Active] [bit] NOT NULL,
CONSTRAINT [PK_ecTaxations_1] PRIMARY KEY CLUSTERED
(
[TaxationID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ecTopLevelDomains](
[TopLevelDomain] [nvarchar](10) NOT NULL,
[ProductID] [int] NOT NULL,
[PluginID] [int] NOT NULL,
[ResellerID] [int] NOT NULL,
[WhoisEnabled] [bit] NULL,
CONSTRAINT [PK_ecTopLevelDomains] PRIMARY KEY CLUSTERED
(
[TopLevelDomain] ASC,
[ResellerID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ecTopLevelDomainsCycles](
[ProductID] [int] NOT NULL,
[CycleID] [int] NOT NULL,
[SetupFee] [money] NOT NULL,
[RecurringFee] [money] NOT NULL,
[TransferFee] [money] NULL,
[SortOrder] [int] NOT NULL
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ExchangeAccountEmailAddresses](
[AddressID] [int] IDENTITY(1,1) NOT NULL,
[AccountID] [int] NOT NULL,
[EmailAddress] [nvarchar](300) NOT NULL,
CONSTRAINT [PK_ExchangeAccountEmailAddresses] PRIMARY KEY CLUSTERED
(
[AddressID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ExchangeAccounts](
[AccountID] [int] IDENTITY(1,1) NOT NULL,
[ItemID] [int] NOT NULL,
[AccountType] [int] NOT NULL,
[AccountName] [nvarchar](300) NOT NULL,
[DisplayName] [nvarchar](300) NOT NULL,
[PrimaryEmailAddress] [nvarchar](300) NULL,
[MailEnabledPublicFolder] [bit] NULL,
[MailboxManagerActions] [varchar](200) NULL,
[SamAccountName] [nvarchar](100) NULL,
[AccountPassword] [nvarchar](200) NULL,
[CreatedDate] [datetime] NOT NULL,
[MailboxPlanId] [int] NULL,
[SubscriberNumber] [nvarchar](32) NULL,
[UserPrincipalName] [nvarchar](300) NULL,
CONSTRAINT [PK_ExchangeAccounts] PRIMARY KEY CLUSTERED
(
[AccountID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ExchangeMailboxPlans](
[MailboxPlanId] [int] IDENTITY(1,1) NOT NULL,
[ItemID] [int] NOT NULL,
[MailboxPlan] [nvarchar](300) NOT NULL,
[MailboxPlanType] [int] NULL,
[EnableActiveSync] [bit] NOT NULL,
[EnableIMAP] [bit] NOT NULL,
[EnableMAPI] [bit] NOT NULL,
[EnableOWA] [bit] NOT NULL,
[EnablePOP] [bit] NOT NULL,
[IsDefault] [bit] NOT NULL,
[IssueWarningPct] [int] NOT NULL,
[KeepDeletedItemsDays] [int] NOT NULL,
[MailboxSizeMB] [int] NOT NULL,
[MaxReceiveMessageSizeKB] [int] NOT NULL,
[MaxRecipients] [int] NOT NULL,
[MaxSendMessageSizeKB] [int] NOT NULL,
[ProhibitSendPct] [int] NOT NULL,
[ProhibitSendReceivePct] [int] NOT NULL,
[HideFromAddressBook] [bit] NOT NULL,
CONSTRAINT [PK_ExchangeMailboxPlans] PRIMARY KEY CLUSTERED
(
[MailboxPlanId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ExchangeOrganizationDomains](
[OrganizationDomainID] [int] IDENTITY(1,1) NOT NULL,
[ItemID] [int] NOT NULL,
[DomainID] [int] NULL,
[IsHost] [bit] NULL,
[DomainTypeID] [int] NOT NULL,
CONSTRAINT [PK_ExchangeOrganizationDomains] PRIMARY KEY CLUSTERED
(
[OrganizationDomainID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ExchangeOrganizations](
[ItemID] [int] NOT NULL,
[OrganizationID] [nvarchar](128) NOT NULL,
[ExchangeMailboxPlanID] [int] NULL,
[LyncUserPlanID] [int] NULL,
[SfBUserPlanID] [int] NULL,
CONSTRAINT [PK_ExchangeOrganizations] PRIMARY KEY CLUSTERED
(
[ItemID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[GlobalDnsRecords](
[RecordID] [int] IDENTITY(1,1) NOT NULL,
[RecordType] [varchar](10) NOT NULL,
[RecordName] [nvarchar](50) NOT NULL,
[RecordData] [nvarchar](500) NOT NULL,
[MXPriority] [int] NOT NULL,
[ServiceID] [int] NULL,
[ServerID] [int] NULL,
[PackageID] [int] NULL,
[IPAddressID] [int] NULL,
[SrvPriority] [int] NULL,
[SrvWeight] [int] NULL,
[SrvPort] [int] NULL,
CONSTRAINT [PK_GlobalDnsRecords] PRIMARY KEY CLUSTERED
(
[RecordID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[HostingPlanQuotas](
[PlanID] [int] NOT NULL,
[QuotaID] [int] NOT NULL,
[QuotaValue] [int] NOT NULL,
CONSTRAINT [PK_HostingPlanQuotas_1] PRIMARY KEY CLUSTERED
(
[PlanID] ASC,
[QuotaID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[HostingPlanResources](
[PlanID] [int] NOT NULL,
[GroupID] [int] NOT NULL,
[CalculateDiskSpace] [bit] NULL,
[CalculateBandwidth] [bit] NULL,
CONSTRAINT [PK_HostingPlanResources] PRIMARY KEY CLUSTERED
(
[PlanID] ASC,
[GroupID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[HostingPlans](
[PlanID] [int] IDENTITY(1,1) NOT NULL,
[UserID] [int] NULL,
[PackageID] [int] NULL,
[ServerID] [int] NULL,
[PlanName] [nvarchar](200) NOT NULL,
[PlanDescription] [ntext] NULL,
[Available] [bit] NOT NULL,
[SetupPrice] [money] NULL,
[RecurringPrice] [money] NULL,
[RecurrenceUnit] [int] NULL,
[RecurrenceLength] [int] NULL,
[IsAddon] [bit] NULL,
CONSTRAINT [PK_HostingPlans] PRIMARY KEY CLUSTERED
(
[PlanID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[IPAddresses](
[AddressID] [int] IDENTITY(1,1) NOT NULL,
[ExternalIP] [varchar](24) NOT NULL,
[InternalIP] [varchar](24) NULL,
[ServerID] [int] NULL,
[Comments] [ntext] NULL,
[SubnetMask] [varchar](15) NULL,
[DefaultGateway] [varchar](15) NULL,
[PoolID] [int] NULL,
CONSTRAINT [PK_IPAddresses] PRIMARY KEY CLUSTERED
(
[AddressID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[LyncUserPlans](
[LyncUserPlanId] [int] IDENTITY(1,1) NOT NULL,
[ItemID] [int] NOT NULL,
[LyncUserPlanName] [nvarchar](300) NOT NULL,
[LyncUserPlanType] [int] NULL,
[IM] [bit] NOT NULL,
[Mobility] [bit] NOT NULL,
[MobilityEnableOutsideVoice] [bit] NOT NULL,
[Federation] [bit] NOT NULL,
[Conferencing] [bit] NOT NULL,
[EnterpriseVoice] [bit] NOT NULL,
[VoicePolicy] [int] NOT NULL,
[IsDefault] [bit] NOT NULL,
CONSTRAINT [PK_LyncUserPlans] PRIMARY KEY CLUSTERED
(
[LyncUserPlanId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[LyncUsers](
[LyncUserID] [int] IDENTITY(1,1) NOT NULL,
[AccountID] [int] NOT NULL,
[LyncUserPlanID] [int] NOT NULL,
[CreatedDate] [datetime] NOT NULL,
[ModifiedDate] [datetime] NOT NULL,
[SipAddress] [nvarchar](300) NULL,
CONSTRAINT [PK_LyncUsers] PRIMARY KEY CLUSTERED
(
[LyncUserID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[SfBUserPlans](
[SfBUserPlanId] [int] IDENTITY(1,1) NOT NULL,
[ItemID] [int] NOT NULL,
[SfBUserPlanName] [nvarchar](300) NOT NULL,
[SfBUserPlanType] [int] NULL,
[IM] [bit] NOT NULL,
[Mobility] [bit] NOT NULL,
[MobilityEnableOutsideVoice] [bit] NOT NULL,
[Federation] [bit] NOT NULL,
[Conferencing] [bit] NOT NULL,
[EnterpriseVoice] [bit] NOT NULL,
[VoicePolicy] [int] NOT NULL,
[IsDefault] [bit] NOT NULL,
CONSTRAINT [PK_SfBUserPlans] PRIMARY KEY CLUSTERED
(
[SfBUserPlanId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[SfBUsers](
[SfBUserID] [int] IDENTITY(1,1) NOT NULL,
[AccountID] [int] NOT NULL,
[SfBUserPlanID] [int] NOT NULL,
[CreatedDate] [datetime] NOT NULL,
[ModifiedDate] [datetime] NOT NULL,
[SipAddress] [nvarchar](300) NULL,
CONSTRAINT [PK_SfBUsers] PRIMARY KEY CLUSTERED
(
[SfBUserID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[OCSUsers](
[OCSUserID] [int] IDENTITY(1,1) NOT NULL,
[AccountID] [int] NOT NULL,
[InstanceID] [nvarchar](50) NOT NULL,
[CreatedDate] [datetime] NOT NULL,
[ModifiedDate] [datetime] NOT NULL,
CONSTRAINT [PK_OCSUsers] PRIMARY KEY CLUSTERED
(
[OCSUserID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[PackageAddons](
[PackageAddonID] [int] IDENTITY(1,1) NOT NULL,
[PackageID] [int] NULL,
[PlanID] [int] NULL,
[Quantity] [int] NULL,
[PurchaseDate] [datetime] NULL,
[Comments] [ntext] NULL,
[StatusID] [int] NULL,
CONSTRAINT [PK_PackageAddons] PRIMARY KEY CLUSTERED
(
[PackageAddonID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[PackageIPAddresses](
[PackageAddressID] [int] IDENTITY(1,1) NOT NULL,
[PackageID] [int] NOT NULL,
[AddressID] [int] NOT NULL,
[ItemID] [int] NULL,
[IsPrimary] [bit] NULL,
CONSTRAINT [PK_PackageIPAddresses] PRIMARY KEY CLUSTERED
(
[PackageAddressID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[PackageQuotas](
[PackageID] [int] NOT NULL,
[QuotaID] [int] NOT NULL,
[QuotaValue] [int] NOT NULL,
CONSTRAINT [PK_PackageQuotas] PRIMARY KEY CLUSTERED
(
[PackageID] ASC,
[QuotaID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[PackageResources](
[PackageID] [int] NOT NULL,
[GroupID] [int] NOT NULL,
[CalculateDiskspace] [bit] NOT NULL,
[CalculateBandwidth] [bit] NOT NULL,
CONSTRAINT [PK_PackageResources_1] PRIMARY KEY CLUSTERED
(
[PackageID] ASC,
[GroupID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Packages](
[PackageID] [int] IDENTITY(1,1) NOT NULL,
[ParentPackageID] [int] NULL,
[UserID] [int] NOT NULL,
[PackageName] [nvarchar](300) NULL,
[PackageComments] [ntext] NULL,
[ServerID] [int] NULL,
[StatusID] [int] NOT NULL,
[PlanID] [int] NULL,
[PurchaseDate] [datetime] NULL,
[OverrideQuotas] [bit] NOT NULL,
[BandwidthUpdated] [datetime] NULL,
CONSTRAINT [PK_Packages] PRIMARY KEY CLUSTERED
(
[PackageID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[PackagesBandwidth](
[PackageID] [int] NOT NULL,
[GroupID] [int] NOT NULL,
[LogDate] [datetime] NOT NULL,
[BytesSent] [bigint] NOT NULL,
[BytesReceived] [bigint] NOT NULL,
CONSTRAINT [PK_PackagesBandwidth] PRIMARY KEY CLUSTERED
(
[PackageID] ASC,
[GroupID] ASC,
[LogDate] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[PackagesDiskspace](
[PackageID] [int] NOT NULL,
[GroupID] [int] NOT NULL,
[DiskSpace] [bigint] NOT NULL,
CONSTRAINT [PK_PackagesDiskspace] PRIMARY KEY CLUSTERED
(
[PackageID] ASC,
[GroupID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[PackageServices](
[PackageID] [int] NOT NULL,
[ServiceID] [int] NOT NULL,
CONSTRAINT [PK_PackageServices] PRIMARY KEY CLUSTERED
(
[PackageID] ASC,
[ServiceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[PackageSettings](
[PackageID] [int] NOT NULL,
[SettingsName] [nvarchar](50) NOT NULL,
[PropertyName] [nvarchar](50) NOT NULL,
[PropertyValue] [ntext] NULL,
CONSTRAINT [PK_PackageSettings] PRIMARY KEY CLUSTERED
(
[PackageID] ASC,
[SettingsName] ASC,
[PropertyName] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[PackagesTreeCache](
[ParentPackageID] [int] NOT NULL,
[PackageID] [int] NOT NULL
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[PrivateIPAddresses](
[PrivateAddressID] [int] IDENTITY(1,1) NOT NULL,
[ItemID] [int] NOT NULL,
[IPAddress] [varchar](15) NOT NULL,
[IsPrimary] [bit] NOT NULL,
CONSTRAINT [PK_PrivateIPAddresses] PRIMARY KEY CLUSTERED
(
[PrivateAddressID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Providers](
[ProviderID] [int] NOT NULL,
[GroupID] [int] NOT NULL,
[ProviderName] [nvarchar](100) NULL,
[DisplayName] [nvarchar](200) NOT NULL,
[ProviderType] [nvarchar](400) NULL,
[EditorControl] [nvarchar](100) NULL,
[DisableAutoDiscovery] [bit] NULL,
CONSTRAINT [PK_ServiceTypes] PRIMARY KEY CLUSTERED
(
[ProviderID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Quotas](
[QuotaID] [int] NOT NULL,
[GroupID] [int] NOT NULL,
[QuotaOrder] [int] NOT NULL,
[QuotaName] [nvarchar](50) NOT NULL,
[QuotaDescription] [nvarchar](200) NULL,
[QuotaTypeID] [int] NOT NULL,
[ServiceQuota] [bit] NULL,
[ItemTypeID] [int] NULL,
[HideQuota] [bit] NULL,
CONSTRAINT [PK_Quotas] PRIMARY KEY CLUSTERED
(
[QuotaID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ResourceGroupDnsRecords](
[RecordID] [int] IDENTITY(1,1) NOT NULL,
[RecordOrder] [int] NOT NULL,
[GroupID] [int] NOT NULL,
[RecordType] [varchar](50) NOT NULL,
[RecordName] [nvarchar](50) NOT NULL,
[RecordData] [nvarchar](200) NOT NULL,
[MXPriority] [int] NULL,
CONSTRAINT [PK_ResourceGroupDnsRecords] PRIMARY KEY CLUSTERED
(
[RecordID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ResourceGroups](
[GroupID] [int] NOT NULL,
[GroupName] [nvarchar](100) NOT NULL,
[GroupOrder] [int] NOT NULL,
[GroupController] [nvarchar](1000) NULL,
[ShowGroup] [bit] NULL,
CONSTRAINT [PK_ResourceGroups] PRIMARY KEY CLUSTERED
(
[GroupID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Schedule](
[ScheduleID] [int] IDENTITY(1,1) NOT NULL,
[TaskID] [nvarchar](100) NOT NULL,
[PackageID] [int] NULL,
[ScheduleName] [nvarchar](100) NULL,
[ScheduleTypeID] [nvarchar](50) NULL,
[Interval] [int] NULL,
[FromTime] [datetime] NULL,
[ToTime] [datetime] NULL,
[StartTime] [datetime] NULL,
[LastRun] [datetime] NULL,
[NextRun] [datetime] NULL,
[Enabled] [bit] NOT NULL,
[PriorityID] [nvarchar](50) NULL,
[HistoriesNumber] [int] NULL,
[MaxExecutionTime] [int] NULL,
[WeekMonthDay] [int] NULL,
CONSTRAINT [PK_Schedule] PRIMARY KEY CLUSTERED
(
[ScheduleID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ScheduleParameters](
[ScheduleID] [int] NOT NULL,
[ParameterID] [nvarchar](100) NOT NULL,
[ParameterValue] [nvarchar](1000) NULL,
CONSTRAINT [PK_ScheduleParameters] PRIMARY KEY CLUSTERED
(
[ScheduleID] ASC,
[ParameterID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ScheduleTaskParameters](
[TaskID] [nvarchar](100) NOT NULL,
[ParameterID] [nvarchar](100) NOT NULL,
[DataTypeID] [nvarchar](50) NOT NULL,
[DefaultValue] [nvarchar](140) NULL,
[ParameterOrder] [int] NOT NULL,
CONSTRAINT [PK_ScheduleTaskParameters] PRIMARY KEY CLUSTERED
(
[TaskID] ASC,
[ParameterID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ScheduleTasks](
[TaskID] [nvarchar](100) NOT NULL,
[TaskType] [nvarchar](500) NOT NULL,
[RoleID] [int] NOT NULL,
CONSTRAINT [PK_ScheduleTasks] PRIMARY KEY CLUSTERED
(
[TaskID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ScheduleTaskViewConfiguration](
[TaskID] [nvarchar](100) NOT NULL,
[ConfigurationID] [nvarchar](100) NOT NULL,
[Environment] [nvarchar](100) NOT NULL,
[Description] [nvarchar](100) NOT NULL,
CONSTRAINT [PK_ScheduleTaskViewConfiguration] PRIMARY KEY CLUSTERED
(
[ConfigurationID] ASC,
[TaskID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Servers](
[ServerID] [int] IDENTITY(1,1) NOT NULL,
[ServerName] [nvarchar](100) NOT NULL,
[ServerUrl] [nvarchar](100) NULL,
[Password] [nvarchar](100) NULL,
[Comments] [ntext] NULL,
[VirtualServer] [bit] NOT NULL,
[InstantDomainAlias] [nvarchar](200) NULL,
[PrimaryGroupID] [int] NULL,
[ADRootDomain] [nvarchar](200) NULL,
[ADUsername] [nvarchar](100) NULL,
[ADPassword] [nvarchar](100) NULL,
[ADAuthenticationType] [varchar](50) NULL,
[ADEnabled] [bit] NULL,
CONSTRAINT [PK_Servers] PRIMARY KEY CLUSTERED
(
[ServerID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ServiceDefaultProperties](
[ProviderID] [int] NOT NULL,
[PropertyName] [nvarchar](50) NOT NULL,
[PropertyValue] [nvarchar](1000) NULL,
CONSTRAINT [PK_ServiceDefaultProperties_1] PRIMARY KEY CLUSTERED
(
[ProviderID] ASC,
[PropertyName] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ServiceItemProperties](
[ItemID] [int] NOT NULL,
[PropertyName] [nvarchar](50) NOT NULL,
[PropertyValue] [nvarchar](3000) NULL,
CONSTRAINT [PK_ServiceItemProperties] PRIMARY KEY CLUSTERED
(
[ItemID] ASC,
[PropertyName] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ServiceItems](
[ItemID] [int] IDENTITY(1,1) NOT NULL,
[PackageID] [int] NULL,
[ItemTypeID] [int] NULL,
[ServiceID] [int] NULL,
[ItemName] [nvarchar](500) NULL,
[CreatedDate] [datetime] NULL,
CONSTRAINT [PK_ServiceItems] PRIMARY KEY CLUSTERED
(
[ItemID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ServiceItemTypes](
[ItemTypeID] [int] NOT NULL,
[GroupID] [int] NULL,
[DisplayName] [nvarchar](50) NULL,
[TypeName] [nvarchar](200) NULL,
[TypeOrder] [int] NOT NULL,
[CalculateDiskspace] [bit] NULL,
[CalculateBandwidth] [bit] NULL,
[Suspendable] [bit] NULL,
[Disposable] [bit] NULL,
[Searchable] [bit] NULL,
[Importable] [bit] NOT NULL,
[Backupable] [bit] NOT NULL,
CONSTRAINT [PK_ServiceItemTypes] PRIMARY KEY CLUSTERED
(
[ItemTypeID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ServiceProperties](
[ServiceID] [int] NOT NULL,
[PropertyName] [nvarchar](50) NOT NULL,
[PropertyValue] [nvarchar](1000) NULL,
CONSTRAINT [PK_ServiceProperties_1] PRIMARY KEY CLUSTERED
(
[ServiceID] ASC,
[PropertyName] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Services](
[ServiceID] [int] IDENTITY(1,1) NOT NULL,
[ServerID] [int] NOT NULL,
[ProviderID] [int] NOT NULL,
[ServiceName] [nvarchar](50) NOT NULL,
[Comments] [ntext] NULL,
[ServiceQuotaValue] [int] NULL,
[ClusterID] [int] NULL,
CONSTRAINT [PK_Services] PRIMARY KEY CLUSTERED
(
[ServiceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[SSLCertificates](
[ID] [int] IDENTITY(1,1) NOT NULL,
[UserID] [int] NOT NULL,
[SiteID] [int] NOT NULL,
[FriendlyName] [nvarchar](255) NULL,
[Hostname] [nvarchar](255) NULL,
[DistinguishedName] [nvarchar](500) NULL,
[CSR] [ntext] NULL,
[CSRLength] [int] NULL,
[Certificate] [ntext] NULL,
[Hash] [ntext] NULL,
[Installed] [bit] NULL,
[IsRenewal] [bit] NULL,
[ValidFrom] [datetime] NULL,
[ExpiryDate] [datetime] NULL,
[SerialNumber] [nvarchar](250) NULL,
[Pfx] [ntext] NULL,
[PreviousId] [int] NULL
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[SystemSettings](
[SettingsName] [nvarchar](50) NOT NULL,
[PropertyName] [nvarchar](50) NOT NULL,
[PropertyValue] [ntext] NULL,
CONSTRAINT [PK_SystemSettings] PRIMARY KEY CLUSTERED
(
[SettingsName] ASC,
[PropertyName] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Users](
[UserID] [int] IDENTITY(1,1) NOT NULL,
[OwnerID] [int] NULL,
[RoleID] [int] NOT NULL,
[StatusID] [int] NOT NULL,
[IsDemo] [bit] NOT NULL,
[IsPeer] [bit] NOT NULL,
[Username] [nvarchar](50) NULL,
[Password] [nvarchar](200) NULL,
[FirstName] [nvarchar](50) NULL,
[LastName] [nvarchar](50) NULL,
[Email] [nvarchar](255) NULL,
[Created] [datetime] NULL,
[Changed] [datetime] NULL,
[Comments] [ntext] NULL,
[SecondaryEmail] [nvarchar](255) NULL,
[Address] [nvarchar](200) NULL,
[City] [nvarchar](50) NULL,
[State] [nvarchar](50) NULL,
[Country] [nvarchar](50) NULL,
[Zip] [varchar](20) NULL,
[PrimaryPhone] [varchar](30) NULL,
[SecondaryPhone] [varchar](30) NULL,
[Fax] [varchar](30) NULL,
[InstantMessenger] [varchar](100) NULL,
[HtmlMail] [bit] NULL,
[CompanyName] [nvarchar](100) NULL,
[EcommerceEnabled] [bit] NULL,
[AdditionalParams] [nvarchar](max) NULL,
[LoginStatusId] [int] NULL,
[FailedLogins] [int] NULL,
[SubscriberNumber] [nvarchar](32) NULL,
CONSTRAINT [PK_Users] PRIMARY KEY CLUSTERED
(
[UserID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[UserSettings](
[UserID] [int] NOT NULL,
[SettingsName] [nvarchar](50) NOT NULL,
[PropertyName] [nvarchar](50) NOT NULL,
[PropertyValue] [ntext] NULL,
CONSTRAINT [PK_UserSettings] PRIMARY KEY CLUSTERED
(
[UserID] ASC,
[SettingsName] ASC,
[PropertyName] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Versions](
[DatabaseVersion] [varchar](50) NOT NULL,
[BuildDate] [datetime] NOT NULL,
CONSTRAINT [PK_Versions] PRIMARY KEY CLUSTERED
(
[DatabaseVersion] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[VirtualGroups](
[VirtualGroupID] [int] IDENTITY(1,1) NOT NULL,
[ServerID] [int] NOT NULL,
[GroupID] [int] NOT NULL,
[DistributionType] [int] NULL,
[BindDistributionToPrimary] [bit] NULL,
CONSTRAINT [PK_VirtualGroups] PRIMARY KEY CLUSTERED
(
[VirtualGroupID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[VirtualServices](
[VirtualServiceID] [int] IDENTITY(1,1) NOT NULL,
[ServerID] [int] NOT NULL,
[ServiceID] [int] NOT NULL,
CONSTRAINT [PK_VirtualServices] PRIMARY KEY CLUSTERED
(
[VirtualServiceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[UsersDetailed]
AS
SELECT U.UserID, U.RoleID, U.StatusID, U.LoginStatusId, U.SubscriberNumber, U.FailedLogins, U.OwnerID, U.Created, U.Changed, U.IsDemo, U.Comments, U.IsPeer, U.Username, U.FirstName, U.LastName, U.Email,
U.CompanyName, U.FirstName + ' ' + U.LastName AS FullName, UP.Username AS OwnerUsername, UP.FirstName AS OwnerFirstName,
UP.LastName AS OwnerLastName, UP.RoleID AS OwnerRoleID, UP.FirstName + ' ' + UP.LastName AS OwnerFullName, UP.Email AS OwnerEmail, UP.RoleID AS Expr1,
(SELECT COUNT(PackageID) AS Expr1
FROM dbo.Packages AS P
WHERE (UserID = U.UserID)) AS PackagesNumber, U.EcommerceEnabled
FROM dbo.Users AS U LEFT OUTER JOIN
dbo.Users AS UP ON U.OwnerID = UP.UserID
GO
INSERT [dbo].[AuditLogSources] ([SourceName]) VALUES (N'APP_INSTALLER')
GO
INSERT [dbo].[AuditLogSources] ([SourceName]) VALUES (N'BACKUP')
GO
INSERT [dbo].[AuditLogSources] ([SourceName]) VALUES (N'DNS_ZONE')
GO
INSERT [dbo].[AuditLogSources] ([SourceName]) VALUES (N'DOMAIN')
GO
INSERT [dbo].[AuditLogSources] ([SourceName]) VALUES (N'EXCHANGE')
GO
INSERT [dbo].[AuditLogSources] ([SourceName]) VALUES (N'FILES')
GO
INSERT [dbo].[AuditLogSources] ([SourceName]) VALUES (N'FTP_ACCOUNT')
GO
INSERT [dbo].[AuditLogSources] ([SourceName]) VALUES (N'GLOBAL_DNS')
GO
INSERT [dbo].[AuditLogSources] ([SourceName]) VALUES (N'IMPORT')
GO
INSERT [dbo].[AuditLogSources] ([SourceName]) VALUES (N'IP_ADDRESS')
GO
INSERT [dbo].[AuditLogSources] ([SourceName]) VALUES (N'MAIL_ACCOUNT')
GO
INSERT [dbo].[AuditLogSources] ([SourceName]) VALUES (N'MAIL_DOMAIN')
GO
INSERT [dbo].[AuditLogSources] ([SourceName]) VALUES (N'MAIL_FORWARDING')
GO
INSERT [dbo].[AuditLogSources] ([SourceName]) VALUES (N'MAIL_GROUP')
GO
INSERT [dbo].[AuditLogSources] ([SourceName]) VALUES (N'MAIL_LIST')
GO
INSERT [dbo].[AuditLogSources] ([SourceName]) VALUES (N'ODBC_DSN')
GO
INSERT [dbo].[AuditLogSources] ([SourceName]) VALUES (N'SCHEDULER')
GO
INSERT [dbo].[AuditLogSources] ([SourceName]) VALUES (N'SERVER')
GO
INSERT [dbo].[AuditLogSources] ([SourceName]) VALUES (N'SHAREPOINT')
GO
INSERT [dbo].[AuditLogSources] ([SourceName]) VALUES (N'SPACE')
GO
INSERT [dbo].[AuditLogSources] ([SourceName]) VALUES (N'SQL_DATABASE')
GO
INSERT [dbo].[AuditLogSources] ([SourceName]) VALUES (N'SQL_USER')
GO
INSERT [dbo].[AuditLogSources] ([SourceName]) VALUES (N'STATS_SITE')
GO
INSERT [dbo].[AuditLogSources] ([SourceName]) VALUES (N'USER')
GO
INSERT [dbo].[AuditLogSources] ([SourceName]) VALUES (N'VIRTUAL_SERVER')
GO
INSERT [dbo].[AuditLogSources] ([SourceName]) VALUES (N'VPS')
GO
INSERT [dbo].[AuditLogSources] ([SourceName]) VALUES (N'WEB_SITE')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'APP_INSTALLER', N'INSTALL_APPLICATION', N'Install application')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'BACKUP', N'BACKUP', N'Backup')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'BACKUP', N'RESTORE', N'Restore')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'DNS_ZONE', N'ADD_RECORD', N'Add record')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'DNS_ZONE', N'DELETE_RECORD', N'Delete record')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'DNS_ZONE', N'UPDATE_RECORD', N'Update record')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'DOMAIN', N'ADD', N'Add')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'DOMAIN', N'DELETE', N'Delete')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'DOMAIN', N'UPDATE', N'Update')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'ADD_DISTR_LIST_ADDRESS', N'Add distribution list e-mail address')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'ADD_DOMAIN', N'Add organization domain')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'ADD_MAILBOX_ADDRESS', N'Add mailbox e-mail address')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'ADD_PUBLIC_FOLDER_ADDRESS', N'Add public folder e-mail address')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'CALCULATE_DISKSPACE', N'Calculate organization disk space')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'CREATE_CONTACT', N'Create contact')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'CREATE_DISTR_LIST', N'Create distribution list')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'CREATE_MAILBOX', N'Create mailbox')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'CREATE_ORG', N'Create organization')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'CREATE_PUBLIC_FOLDER', N'Create public folder')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'DELETE_CONTACT', N'Delete contact')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'DELETE_DISTR_LIST', N'Delete distribution list')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'DELETE_DISTR_LIST_ADDRESSES', N'Delete distribution list e-mail addresses')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'DELETE_DOMAIN', N'Delete organization domain')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'DELETE_MAILBOX', N'Delete mailbox')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'DELETE_MAILBOX_ADDRESSES', N'Delete mailbox e-mail addresses')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'DELETE_ORG', N'Delete organization')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'DELETE_PUBLIC_FOLDER', N'Delete public folder')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'DELETE_PUBLIC_FOLDER_ADDRESSES', N'Delete public folder e-mail addresses')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'DISABLE_MAIL_PUBLIC_FOLDER', N'Disable mail public folder')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'ENABLE_MAIL_PUBLIC_FOLDER', N'Enable mail public folder')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'GET_CONTACT_GENERAL', N'Get contact general settings')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'GET_CONTACT_MAILFLOW', N'Get contact mail flow settings')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'GET_DISTR_LIST_ADDRESSES', N'Get distribution list e-mail addresses')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'GET_DISTR_LIST_GENERAL', N'Get distribution list general settings')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'GET_DISTR_LIST_MAILFLOW', N'Get distribution list mail flow settings')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'GET_FOLDERS_STATS', N'Get organization public folder statistics')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'GET_MAILBOX_ADDRESSES', N'Get mailbox e-mail addresses')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'GET_MAILBOX_ADVANCED', N'Get mailbox advanced settings')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'GET_MAILBOX_GENERAL', N'Get mailbox general settings')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'GET_MAILBOX_MAILFLOW', N'Get mailbox mail flow settings')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'GET_MAILBOXES_STATS', N'Get organization mailboxes statistics')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'GET_ORG_LIMITS', N'Get organization storage limits')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'GET_ORG_STATS', N'Get organization statistics')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'GET_PUBLIC_FOLDER_ADDRESSES', N'Get public folder e-mail addresses')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'GET_PUBLIC_FOLDER_GENERAL', N'Get public folder general settings')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'GET_PUBLIC_FOLDER_MAILFLOW', N'Get public folder mail flow settings')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'SET_ORG_LIMITS', N'Update organization storage limits')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'SET_PRIMARY_DISTR_LIST_ADDRESS', N'Set distribution list primary e-mail address')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'SET_PRIMARY_MAILBOX_ADDRESS', N'Set mailbox primary e-mail address')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'SET_PRIMARY_PUBLIC_FOLDER_ADDRESS', N'Set public folder primary e-mail address')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'UPDATE_CONTACT_GENERAL', N'Update contact general settings')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'UPDATE_CONTACT_MAILFLOW', N'Update contact mail flow settings')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'UPDATE_DISTR_LIST_GENERAL', N'Update distribution list general settings')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'UPDATE_DISTR_LIST_MAILFLOW', N'Update distribution list mail flow settings')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'UPDATE_MAILBOX_ADVANCED', N'Update mailbox advanced settings')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'UPDATE_MAILBOX_GENERAL', N'Update mailbox general settings')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'UPDATE_MAILBOX_MAILFLOW', N'Update mailbox mail flow settings')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'UPDATE_PUBLIC_FOLDER_GENERAL', N'Update public folder general settings')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'EXCHANGE', N'UPDATE_PUBLIC_FOLDER_MAILFLOW', N'Update public folder mail flow settings')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'FILES', N'COPY_FILES', N'Copy files')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'FILES', N'CREATE_ACCESS_DATABASE', N'Create MS Access database')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'FILES', N'CREATE_FILE', N'Create file')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'FILES', N'CREATE_FOLDER', N'Create folder')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'FILES', N'DELETE_FILES', N'Delete files')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'FILES', N'MOVE_FILES', N'Move files')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'FILES', N'RENAME_FILE', N'Rename file')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'FILES', N'SET_PERMISSIONS', NULL)
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'FILES', N'UNZIP_FILES', N'Unzip files')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'FILES', N'UPDATE_BINARY_CONTENT', N'Update file binary content')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'FILES', N'ZIP_FILES', N'Zip files')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'FTP_ACCOUNT', N'ADD', N'Add')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'FTP_ACCOUNT', N'DELETE', N'Delete')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'FTP_ACCOUNT', N'UPDATE', N'Update')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'GLOBAL_DNS', N'ADD', N'Add')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'GLOBAL_DNS', N'DELETE', N'Delete')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'GLOBAL_DNS', N'UPDATE', N'Update')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'IMPORT', N'IMPORT', N'Import')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'IP_ADDRESS', N'ADD', N'Add')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'IP_ADDRESS', N'ADD_RANGE', N'Add range')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'IP_ADDRESS', N'ALLOCATE_PACKAGE_IP', N'Allocate package IP addresses')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'IP_ADDRESS', N'DEALLOCATE_PACKAGE_IP', N'Deallocate package IP addresses')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'IP_ADDRESS', N'DELETE', N'Delete')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'IP_ADDRESS', N'DELETE_RANGE', N'Delete IP Addresses')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'IP_ADDRESS', N'UPDATE', N'Update')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'IP_ADDRESS', N'UPDATE_RANGE', N'Update IP Addresses')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'MAIL_ACCOUNT', N'ADD', N'Add')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'MAIL_ACCOUNT', N'DELETE', N'Delete')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'MAIL_ACCOUNT', N'UPDATE', N'Update')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'MAIL_DOMAIN', N'ADD', N'Add')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'MAIL_DOMAIN', N'ADD_POINTER', N'Add pointer')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'MAIL_DOMAIN', N'DELETE', N'Delete')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'MAIL_DOMAIN', N'DELETE_POINTER', N'Update pointer')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'MAIL_DOMAIN', N'UPDATE', N'Update')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'MAIL_FORWARDING', N'ADD', N'Add')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'MAIL_FORWARDING', N'DELETE', N'Delete')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'MAIL_FORWARDING', N'UPDATE', N'Update')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'MAIL_GROUP', N'ADD', N'Add')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'MAIL_GROUP', N'DELETE', N'Delete')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'MAIL_GROUP', N'UPDATE', N'Update')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'MAIL_LIST', N'ADD', N'Add')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'MAIL_LIST', N'DELETE', N'Delete')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'MAIL_LIST', N'UPDATE', N'Update')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'ODBC_DSN', N'ADD', N'Add')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'ODBC_DSN', N'DELETE', N'Delete')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'ODBC_DSN', N'UPDATE', N'Update')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SCHEDULER', N'RUN_SCHEDULE', NULL)
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SERVER', N'ADD', N'Add')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SERVER', N'ADD_SERVICE', N'Add service')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SERVER', N'CHANGE_WINDOWS_SERVICE_STATUS', N'Change Windows service status')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SERVER', N'CHECK_AVAILABILITY', N'Check availability')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SERVER', N'CLEAR_EVENT_LOG', N'Clear Windows event log')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SERVER', N'DELETE', N'Delete')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SERVER', N'DELETE_SERVICE', N'Delete service')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SERVER', N'REBOOT', N'Reboot')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SERVER', N'RESET_TERMINAL_SESSION', N'Reset terminal session')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SERVER', N'TERMINATE_SYSTEM_PROCESS', N'Terminate system process')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SERVER', N'UPDATE', N'Update')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SERVER', N'UPDATE_AD_PASSWORD', N'Update active directory password')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SERVER', N'UPDATE_PASSWORD', N'Update access password')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SERVER', N'UPDATE_SERVICE', N'Update service')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SHAREPOINT', N'ADD_GROUP', N'Add group')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SHAREPOINT', N'ADD_SITE', N'Add site')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SHAREPOINT', N'ADD_USER', N'Add user')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SHAREPOINT', N'BACKUP_SITE', N'Backup site')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SHAREPOINT', N'DELETE_GROUP', N'Delete group')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SHAREPOINT', N'DELETE_SITE', N'Delete site')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SHAREPOINT', N'DELETE_USER', N'Delete user')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SHAREPOINT', N'INSTALL_WEBPARTS', N'Install Web Parts package')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SHAREPOINT', N'RESTORE_SITE', N'Restore site')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SHAREPOINT', N'UNINSTALL_WEBPARTS', N'Uninstall Web Parts package')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SHAREPOINT', N'UPDATE_GROUP', N'Update group')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SHAREPOINT', N'UPDATE_USER', N'Update user')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SPACE', N'CALCULATE_DISKSPACE', N'Calculate disk space')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SPACE', N'CHANGE_ITEMS_STATUS', N'Change hosting items status')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SPACE', N'CHANGE_STATUS', N'Change hostng space status')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SPACE', N'DELETE', N'Delete hosting space')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SPACE', N'DELETE_ITEMS', N'Delete hosting items')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SQL_DATABASE', N'ADD', N'Add')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SQL_DATABASE', N'BACKUP', N'Backup')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SQL_DATABASE', N'DELETE', N'Delete')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SQL_DATABASE', N'RESTORE', N'Restore')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SQL_DATABASE', N'TRUNCATE', N'Truncate')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SQL_DATABASE', N'UPDATE', N'Update')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SQL_USER', N'ADD', N'Add')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SQL_USER', N'DELETE', N'Delete')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'SQL_USER', N'UPDATE', N'Update')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'STATS_SITE', N'ADD', N'Add statistics site')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'STATS_SITE', N'DELETE', N'Delete statistics site')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'STATS_SITE', N'UPDATE', N'Update statistics site')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'USER', N'ADD', N'Add')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'USER', N'AUTHENTICATE', N'Authenticate')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'USER', N'CHANGE_PASSWORD', N'Change password')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'USER', N'CHANGE_PASSWORD_BY_USERNAME_PASSWORD', N'Change password by username/password')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'USER', N'CHANGE_STATUS', N'Change status')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'USER', N'DELETE', N'Delete')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'USER', N'GET_BY_USERNAME_PASSWORD', N'Get by username/password')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'USER', N'SEND_REMINDER', N'Send password reminder')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'USER', N'UPDATE', N'Update')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'USER', N'UPDATE_SETTINGS', N'Update settings')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'VIRTUAL_SERVER', N'ADD_SERVICES', N'Add services')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'VIRTUAL_SERVER', N'DELETE_SERVICES', N'Delete services')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'VPS', N'ADD_EXTERNAL_IP', N'Add external IP')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'VPS', N'ADD_PRIVATE_IP', N'Add private IP')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'VPS', N'APPLY_SNAPSHOT', N'Apply VPS snapshot')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'VPS', N'CANCEL_JOB', N'Cancel Job')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'VPS', N'CHANGE_ADMIN_PASSWORD', N'Change administrator password')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'VPS', N'CHANGE_STATE', N'Change VPS state')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'VPS', N'CREATE', N'Create VPS')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'VPS', N'DELETE', N'Delete VPS')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'VPS', N'DELETE_EXTERNAL_IP', N'Delete external IP')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'VPS', N'DELETE_PRIVATE_IP', N'Delete private IP')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'VPS', N'DELETE_SNAPSHOT', N'Delete VPS snapshot')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'VPS', N'DELETE_SNAPSHOT_SUBTREE', N'Delete VPS snapshot subtree')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'VPS', N'EJECT_DVD_DISK', N'Eject DVD disk')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'VPS', N'INSERT_DVD_DISK', N'Insert DVD disk')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'VPS', N'REINSTALL', N'Re-install VPS')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'VPS', N'RENAME_SNAPSHOT', N'Rename VPS snapshot')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'VPS', N'SEND_SUMMARY_LETTER', N'Send VPS summary letter')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'VPS', N'SET_PRIMARY_EXTERNAL_IP', N'Set primary external IP')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'VPS', N'SET_PRIMARY_PRIVATE_IP', N'Set primary private IP')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'VPS', N'TAKE_SNAPSHOT', N'Take VPS snapshot')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'VPS', N'UPDATE_CONFIGURATION', N'Update VPS configuration')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'VPS', N'UPDATE_HOSTNAME', N'Update host name')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'VPS', N'UPDATE_IP', N'Update IP Address')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'VPS', N'UPDATE_PERMISSIONS', N'Update VPS permissions')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'VPS', N'UPDATE_VDC_PERMISSIONS', N'Update space permissions')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'WEB_SITE', N'ADD', N'Add')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'WEB_SITE', N'ADD_POINTER', N'Add domain pointer')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'WEB_SITE', N'ADD_SSL_FOLDER', N'Add shared SSL folder')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'WEB_SITE', N'ADD_VDIR', N'Add virtual directory')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'WEB_SITE', N'CHANGE_FP_PASSWORD', N'Change FrontPage account password')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'WEB_SITE', N'CHANGE_STATE', N'Change state')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'WEB_SITE', N'DELETE', N'Delete')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'WEB_SITE', N'DELETE_POINTER', N'Delete domain pointer')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'WEB_SITE', N'DELETE_SECURED_FOLDER', N'Delete secured folder')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'WEB_SITE', N'DELETE_SECURED_GROUP', N'Delete secured group')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'WEB_SITE', N'DELETE_SECURED_USER', N'Delete secured user')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'WEB_SITE', N'DELETE_SSL_FOLDER', N'Delete shared SSL folder')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'WEB_SITE', N'DELETE_VDIR', N'Delete virtual directory')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'WEB_SITE', N'INSTALL_FP', N'Install FrontPage Extensions')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'WEB_SITE', N'INSTALL_SECURED_FOLDERS', N'Install secured folders')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'WEB_SITE', N'UNINSTALL_FP', N'Uninstall FrontPage Extensions')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'WEB_SITE', N'UNINSTALL_SECURED_FOLDERS', N'Uninstall secured folders')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'WEB_SITE', N'UPDATE', N'Update')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'WEB_SITE', N'UPDATE_SECURED_FOLDER', N'Add/update secured folder')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'WEB_SITE', N'UPDATE_SECURED_GROUP', N'Add/update secured group')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'WEB_SITE', N'UPDATE_SECURED_USER', N'Add/update secured user')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'WEB_SITE', N'UPDATE_SSL_FOLDER', N'Update shared SSL folder')
GO
INSERT [dbo].[AuditLogTasks] ([SourceName], [TaskName], [TaskDescription]) VALUES (N'WEB_SITE', N'UPDATE_VDIR', N'Update virtual directory')
GO
SET IDENTITY_INSERT [dbo].[ecProductType] ON
GO
INSERT [dbo].[ecProductType] ([TypeID], [TypeName], [ProvisioningController], [Created], [NativeItemType], [ServiceItemType]) VALUES (1, N'Hosting Plan', N'SolidCP.Ecommerce.EnterpriseServer.HostingPackageController,SolidCP.EnterpriseServer', CAST(0x0000993E010F2F0C AS DateTime), N'SolidCP.Ecommerce.EnterpriseServer.HostingPlan, SolidCP.EnterpriseServer', N'SolidCP.Ecommerce.EnterpriseServer.HostingPackageSvc, SolidCP.EnterpriseServer')
GO
INSERT [dbo].[ecProductType] ([TypeID], [TypeName], [ProvisioningController], [Created], [NativeItemType], [ServiceItemType]) VALUES (2, N'Hosting Add-On', N'SolidCP.Ecommerce.EnterpriseServer.HostingAddonController,SolidCP.EnterpriseServer', CAST(0x0000993E010F2F0C AS DateTime), N'SolidCP.Ecommerce.EnterpriseServer.HostingAddon, SolidCP.EnterpriseServer', N'SolidCP.Ecommerce.EnterpriseServer.HostingAddonSvc, SolidCP.EnterpriseServer')
GO
INSERT [dbo].[ecProductType] ([TypeID], [TypeName], [ProvisioningController], [Created], [NativeItemType], [ServiceItemType]) VALUES (3, N'Domain Name', N'SolidCP.Ecommerce.EnterpriseServer.DomainNameController,SolidCP.EnterpriseServer', CAST(0x0000993E010F2F0C AS DateTime), N'SolidCP.Ecommerce.EnterpriseServer.DomainName, SolidCP.EnterpriseServer', N'SolidCP.Ecommerce.EnterpriseServer.DomainNameSvc, SolidCP.EnterpriseServer')
GO
SET IDENTITY_INSERT [dbo].[ecProductType] OFF
GO
INSERT [dbo].[ecStoreDefaultSettings] ([SettingsName], [PropertyName], [PropertyValue]) VALUES (N'ActivateServicesTemplate', N'CC', N'info@solidcp.com')
GO
INSERT [dbo].[ecStoreDefaultSettings] ([SettingsName], [PropertyName], [PropertyValue]) VALUES (N'ActivateServicesTemplate', N'From', N'support@solidcp.com')
GO
INSERT [dbo].[ecStoreDefaultSettings] ([SettingsName], [PropertyName], [PropertyValue]) VALUES (N'ActivateServicesTemplate', N'HtmlBody', N'
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Activated Service Summary Information</title>
<style type="text/css">
.Summary { background-color: ##ffffff; padding: 5px; }
.Summary .Header { padding: 10px 0px 10px 10px; font-size: 16pt; background-color: ##E5F2FF; color: ##1F4978; border-bottom: solid 2px ##86B9F7; }
.Summary A { color: ##0153A4; }
.Summary { font-family: Tahoma; font-size: 9pt; }
.Summary H1 { font-size: 1.7em; color: ##1F4978; border-bottom: dotted 3px ##efefef; }
.Summary H2 { font-size: 1.2em; }
.Summary TABLE { border: solid 1px ##e5e5e5; }
.Summary TH,
.Summary TD.Label { padding: 5px; font-size: 8pt; font-weight: bold; background-color: ##f5f5f5; }
.Summary TD { padding: 8px; font-size: 9pt; }
.Summary UL LI { font-size: 1.1em; font-weight: bold; }
.Summary UL UL LI { font-size: 0.9em; font-weight: normal; }
</style>
</head>
<body>
<div class="Summary">
<a name="top"></a>
<div class="Header">
Activated Service Information
</div>
<p>Hello #customer["FirstName"]#,</p>
<p>"#service.ServiceName#" service has been activated under your user account
and below is the summary information.</p>
<a name="overview"></a>
<h1>Service Overview</h1>
<table>
<tr>
<td class="Label">Service Name:</td>
<td>#service.ServiceName#</td>
</tr>
<tr>
<td class="Label">Created:</td>
<td>#service.Created#</td>
</tr>
<tr>
<td class="Label">Setup fee:</td>
<td>#service.Currency# #format(service.SetupFee, "0.00")#</td>
</tr>
<tr>
<td class="Label">Recurring fee:</td>
<td>#service.Currency# #format(service.RecurringFee, "0.00")#</td>
</tr>
</table>
<p>
If you have any questions regarding your hosting account, feel free to contact our sales department at any time.
</p>
<p>
Best regards,<br />
SolidCP.<br />
Web Site: <a href="https://solidcp.com">https://solidcp.com</a><br />
E-Mail: <a href="mailto:support@solidcp.com">support@solidcp.com</a></p>
</div>
</body>
</html>')
GO
INSERT [dbo].[ecStoreDefaultSettings] ([SettingsName], [PropertyName], [PropertyValue]) VALUES (N'ActivateServicesTemplate', N'Subject', N'Activate Service Notification')
GO
INSERT [dbo].[ecStoreDefaultSettings] ([SettingsName], [PropertyName], [PropertyValue]) VALUES (N'ActivateServicesTemplate', N'TextBody', N'
================================
Activated Service Information
================================
Hello #Customer["FirstName"]#,
"#service.ServiceName#" service has been activated under your user account
and below is the summary information.
Service Overview
=============
Service Name: #service.ServiceName#
Created: #service.Created#
Setup fee: #service.Currency# #format(service.SetupFee, "0.00")#
Recurring fee: #service.Currency# #format(service.RecurringFee, "0.00")#
If you have any questions regarding your hosting account, feel free to contact our support department at any time.
Best regards,
SolidCP.
Web Site: https://solidcp.com
E-Mail: support@solidcp.com')
GO
INSERT [dbo].[ecStoreDefaultSettings] ([SettingsName], [PropertyName], [PropertyValue]) VALUES (N'CancelServicesTemplate', N'CC', N'sales@solidcp.com')
GO
INSERT [dbo].[ecStoreDefaultSettings] ([SettingsName], [PropertyName], [PropertyValue]) VALUES (N'CancelServicesTemplate', N'From', N'support@solidcp.com')
GO
INSERT [dbo].[ecStoreDefaultSettings] ([SettingsName], [PropertyName], [PropertyValue]) VALUES (N'CancelServicesTemplate', N'HtmlBody', N'
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Cancel Service Summary Information</title>
<style type="text/css">
.Summary { background-color: ##ffffff; padding: 5px; }
.Summary .Header { padding: 10px 0px 10px 10px; font-size: 16pt; background-color: ##E5F2FF; color: ##1F4978; border-bottom: solid 2px ##86B9F7; }
.Summary A { color: ##0153A4; }
.Summary { font-family: Tahoma; font-size: 9pt; }
.Summary H1 { font-size: 1.7em; color: ##1F4978; border-bottom: dotted 3px ##efefef; }
.Summary H2 { font-size: 1.2em; }
.Summary TABLE { border: solid 1px ##e5e5e5; }
.Summary TH,
.Summary TD.Label { padding: 5px; font-size: 8pt; font-weight: bold; background-color: ##f5f5f5; }
.Summary TD { padding: 8px; font-size: 9pt; }
.Summary UL LI { font-size: 1.1em; font-weight: bold; }
.Summary UL UL LI { font-size: 0.9em; font-weight: normal; }
</style>
</head>
<body>
<div class="Summary">
<a name="top"></a>
<div class="Header">
Cancelled Service Information
</div>
<p>Hello #customer["FirstName"]#,</p>
<p>"#service.ServiceName#" service has been cancelled under your user account
and below is the summary information.</p>
<h1>Service Overview</h1>
<table>
<tr>
<td class="Label">Service Name:</td>
<td>#service.ServiceName#</td>
</tr>
<tr>
<td class="Label">Created:</td>
<td>#service.Created#</td>
</tr>
</table>
<p>
If you have any questions regarding your hosting account, feel free to contact our sales department at any time.
</p>
<p>
Best regards,<br />
SolidCP.<br />
Web Site: <a href="https://solidcp.com">https://solidcp.com</a><br />
E-Mail: <a href="mailto:support@solidcp.com">support@solidcp.com</a></p>
</div>
</body>
</html>')
GO
INSERT [dbo].[ecStoreDefaultSettings] ([SettingsName], [PropertyName], [PropertyValue]) VALUES (N'CancelServicesTemplate', N'Subject', N'Cancel Service Notificaton')
GO
INSERT [dbo].[ecStoreDefaultSettings] ([SettingsName], [PropertyName], [PropertyValue]) VALUES (N'CancelServicesTemplate', N'TextBody', N'
================================
Cancelled Service Information
================================
Hello #Customer["FirstName"]#,
"#service.ServiceName#" service has been cancelled under your user account
and below is the summary information.
Service Overview
=============
Service Name: #service.ServiceName#
Created: #service.Created#
If you have any questions regarding your hosting account, feel free to contact our support department at any time.
Best regards,
SolidCP.
Web Site: https://solidcp.com
E-Mail: support@solidcp.com')
GO
INSERT [dbo].[ecStoreDefaultSettings] ([SettingsName], [PropertyName], [PropertyValue]) VALUES (N'EmitInvoiceTemplate', N'CC', N'info@solidcp.com')
GO
INSERT [dbo].[ecStoreDefaultSettings] ([SettingsName], [PropertyName], [PropertyValue]) VALUES (N'EmitInvoiceTemplate', N'From', N'sales@solidcp.com')
GO
INSERT [dbo].[ecStoreDefaultSettings] ([SettingsName], [PropertyName], [PropertyValue]) VALUES (N'EmitInvoiceTemplate', N'HtmlBody', N'<style type="text/css">
.Summary { background-color: ##ffffff; padding: 5px; }
.Summary .Header { padding: 10px 0px 10px 10px; font-size: 16pt; background-color: ##E5F2FF; color: ##1F4978; border-bottom: solid 2px ##86B9F7; }
.Summary A { color: ##0153A4; }
.Summary { font-family: Tahoma; font-size: 9pt; }
.Summary H1 { font-size: 1.7em; color: ##1F4978; border-bottom: dotted 3px ##efefef; }
.Summary H2 { font-size: 1.2em; }
.Summary TABLE { border: solid 1px ##e5e5e5; }
.Summary TH,
.Summary TD.Label { padding: 5px; font-size: 8pt; font-weight: bold; background-color: ##f5f5f5; }
.Summary TD { padding: 8px; font-size: 9pt; }
.Summary UL LI { font-size: 1.1em; font-weight: bold; }
.Summary UL UL LI { font-size: 0.9em; font-weight: normal; }
.Centered { text-align: center; }
.AlignRight { text-align: right; }
.Width12Percent { width: 12%; }
</style>
<div class="Summary">
<a name="top"></a>
<div class="Header">
Invoice Summary Information
</div>
<p>Hello #Customer["FirstName"]#,</p>
<p>We''ve created this invoice for services you ordered. You can find this invoice details under your user account
and below is the summary information.</p>
<ad:if test="#isdefined("IsEmail") and isdefined("ExtraArgs")#">
<ad:if test="#not(isnull(ExtraArgs["InvoiceDirectURL"]))#">
<p>You may use the following link to pay for invoice later <a href="#ExtraArgs["InvoiceDirectURL"]#">#ExtraArgs["InvoiceDirectURL"]#</a>.</p>
</ad:if>
</ad:if>
<h1>Invoice Overview</h1>
<table>
<tr>
<td class="Label">Invoice ##:</td>
<ad:if test="#isnull(Invoice.InvoiceNumber)#">
<td>#Invoice.InvoiceId#</td>
<ad:else>
<td>#Invoice.InvoiceNumber#</td>
</ad:if>
</tr>
<tr>
<td class="Label">Terms:</td>
<td>Due Upon Receipt</td>
</tr>
<tr>
<td class="Label">Invoice Date:</td>
<td>#Invoice.Created.ToShortDateString()#</td>
</tr>
</table>
<h1>Invoice Items</h1>
<table width="100%">
<tr>
<td class="Label">Description</td>
<td class="Label Centered">Type</td>
<td class="Label Centered">Qty</td>
<td class="Label Centered">Unit Price</td>
<td class="Label Centered">Total</td>
</tr>
<ad:foreach collection="#InvoiceLines#" var="Line" index="i">
<tr>
<td>#Line.ItemName#<ad:ShowBillingPeriod Item="#Line#" /></td>
<td class="Centered Width12Percent">#Line.TypeName#</td>
<td class="Centered Width12Percent">#Line.Quantity#</td>
<td class="Centered Width12Percent">#Invoice.Currency# #Line.UnitPrice.ToString("C")#</td>
<td class="Centered Width12Percent">#Invoice.Currency# #Line.Total.ToString("C")#</td>
</tr>
</ad:foreach>
<tr>
<td colspan="4" class="AlignRight">Sub Total </td>
<td class="Centered">#Invoice.Currency# #Invoice.SubTotal.ToString("C")#</td>
</tr>
<ad:if test="#isnull(Tax)#">
<tr>
<td colspan="4" class="AlignRight">Taxes #format(0.00, "#.##")#%</td>
<td class="Centered" nowrap="nowrap">#Invoice.Currency# #format(0.00, "C")#</td>
</tr>
<ad:elseif test="#equals(Tax.TypeId, 1)#">
<tr>
<td colspan="4" class="AlignRight">#Tax.Description#</td>
<td class="Centered" nowrap="nowrap">#Invoice.Currency# #Tax.Amount.ToString("C")#</td>
</tr>
<ad:elseif test="#equals(Tax.TypeId, 2)#">
<tr>
<td colspan="4" class="AlignRight">#Tax.Description# #Tax.Amount.ToString("#.##")#%</td>
<td class="Centered" nowrap="nowrap">#Invoice.Currency# #Invoice.TaxAmount.ToString("C")#</td>
</tr>
<ad:elseif test="#equals(Tax.TypeId, 3)#">
<tr>
<td colspan="4" class="AlignRight">#Tax.Description# #Tax.Amount.ToString("#.##")#%</td>
<td class="Centered" nowrap="nowrap">#Invoice.Currency# #Invoice.TaxAmount.ToString("C")#</td>
</tr>
</ad:if>
<tr>
<td colspan="4" class="AlignRight">Total </td>
<td class="Centered">#Invoice.Currency# #Invoice.Total.ToString("C")#</td>
</tr>
</table>
<p>
If you have any questions regarding your hosting account or this invoice, feel free to contact our sales department at any time.
</p>
<p>Some notes regarding invoice or how to apply your enquiries...</p>
<p>
Best regards,<br />
SolidCP.<br />
Web Site: <a href="https://solidcp.com">https://solidcp.com</a><br />
E-Mail: <a href="mailto:support@solidcp.com">support@solidcp.com</a></p>
</div>
<ad:template name="ShowBillingPeriod">
<ad:if test="#InvoiceServices.ContainsKey(Item.ServiceId)#">
<ad:set name="Service" value="#InvoiceServices[Item.ServiceId]#" />
<ad:if test="#isnotempty(Service.BillingPeriod)#"> (<b>#Service.PeriodLength# #Service.BillingPeriod#</b>)</ad:if>
</ad:if>
</ad:template>')
GO
INSERT [dbo].[ecStoreDefaultSettings] ([SettingsName], [PropertyName], [PropertyValue]) VALUES (N'EmitInvoiceTemplate', N'Subject', N'Invoice Summary Information')
GO
INSERT [dbo].[ecStoreDefaultSettings] ([SettingsName], [PropertyName], [PropertyValue]) VALUES (N'EmitInvoiceTemplate', N'TextBody', N'================================
Invoice Summary Information
================================
Hello #Customer["FirstName"]#,
We''ve created this invoice for services you ordered. You can find this invoice details under your user account
and below is the summary information.
<ad:if test="#isdefined("IsEmail") and isdefined("ExtraArgs")#">
<ad:if test="#not(isnull(ExtraArgs["InvoiceDirectURL"]))#">
You may copy and paste the following link to the browser in order to pay for invoice later #ExtraArgs["InvoiceDirectURL"]#.
</ad:if>
</ad:if>
Invoice Overview
=============
Invoice ##: <ad:if test="#isnull(Invoice.InvoiceNumber)#">#Invoice.InvoiceId#<ad:else>#Invoice.InvoiceNumber#</ad:if>
Terms: Due Upon Receipt
Invoice Date: #Invoice.Created.ToShortDateString()#
Invoice SubTotal: #Invoice.Currency# #Invoice.SubTotal.ToString("C")#
<ad:if test="#isnull(Tax)#">
Taxes #format(0.00, "#.##")#%: #Invoice.Currency# #format(0.00, "C")#
<ad:elseif test="#equals(Tax.TypeId, 1)#">
#Tax.Description#: #Invoice.Currency# #Tax.Amount.ToString("C")#
<ad:elseif test="#equals(Tax.TypeId, 2)#">
#Tax.Description# #Tax.Amount.ToString("#.##")#%: #Invoice.Currency# #Invoice.TaxAmount.ToString("C")#
<ad:elseif test="#equals(Tax.TypeId, 3)#">
#Tax.Description# #Tax.Amount.ToString("#.##")#%: #Invoice.Currency# #Invoice.TaxAmount.ToString("C")#
</ad:if>
Invoice Total: #Invoice.Currency# #Invoice.Total.ToString("C")#
Invoice Items
=============
<ad:foreach collection="#InvoiceLines#" var="Line" index="i">
#Line.ItemName#<ad:ShowBillingPeriod Item="#Line#" />
Type: #Line.TypeName#
Quantity: #Line.Quantity#
Unit Price: #Invoice.Currency# #Line.UnitPrice.ToString("C")#
Total: #Invoice.Currency# #Line.Total.ToString("C")#
</ad:foreach>
If you have any questions regarding your hosting account, feel free to contact our sales department at any time.
Some notes regarding invoice or how to apply your enquiries...
Best regards,
SolidCP.
Web Site: https://solidcp.com
E-Mail: support@solidcp.com
<ad:template name="ShowBillingPeriod">
<ad:if test="#InvoiceServices.ContainsKey(Item.ServiceId)#">
<ad:set name="Service" value="#InvoiceServices[Item.ServiceId]#" />
<ad:if test="#isnotempty(Service.BillingPeriod)#"> (#Service.PeriodLength# #Service.BillingPeriod#)</ad:if>
</ad:if>
</ad:template>')
GO
INSERT [dbo].[ecStoreDefaultSettings] ([SettingsName], [PropertyName], [PropertyValue]) VALUES (N'PaymentReceivedTemplate', N'CC', N'info@solidcp.com')
GO
INSERT [dbo].[ecStoreDefaultSettings] ([SettingsName], [PropertyName], [PropertyValue]) VALUES (N'PaymentReceivedTemplate', N'From', N'sales@solidcp.com')
GO
INSERT [dbo].[ecStoreDefaultSettings] ([SettingsName], [PropertyName], [PropertyValue]) VALUES (N'PaymentReceivedTemplate', N'HtmlBody', N'<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Received Payment Summary Information</title>
<style type="text/css">
.Summary { background-color: ##ffffff; padding: 5px; }
.Summary .Header { padding: 10px 0px 10px 10px; font-size: 16pt; background-color: ##E5F2FF; color: ##1F4978; border-bottom: solid 2px ##86B9F7; }
.Summary A { color: ##0153A4; }
.Summary { font-family: Tahoma; font-size: 9pt; }
.Summary H1 { font-size: 1.7em; color: ##1F4978; border-bottom: dotted 3px ##efefef; }
.Summary H2 { font-size: 1.2em; }
.Summary TABLE { border: solid 1px ##e5e5e5; }
.Summary TH,
.Summary TD.Label { padding: 5px; font-size: 8pt; font-weight: bold; background-color: ##f5f5f5; }
.Summary TD { padding: 8px; font-size: 9pt; }
.Summary UL LI { font-size: 1.1em; font-weight: bold; }
.Summary UL UL LI { font-size: 0.9em; font-weight: normal; }
</style>
</head>
<body>
<div class="Summary">
<a name="top"></a>
<div class="Header">
Received Payment Information
</div>
<p>
Hello #Customer["FirstName"]#,</p>
<p>
We''ve received your payment successfully. You can find this payment details under
your user account and below is the summary information.</p>
<h1>
Payment Overview</h1>
<table>
<tr>
<td class="Label">
Payment ##:
</td>
<td>
#payment.paymentid#
</td>
</tr>
<tr>
<td class="Label">
Invoice ##:
</td>
<td>
#payment.invoiceid#
</td>
</tr>
<tr>
<td class="Label">
Transaction ID ##:
</td>
<td>
#payment.transactionid#
</td>
</tr>
<tr>
<td class="Label">
Created:
</td>
<td>
#payment.created#
</td>
</tr>
<tr>
<td class="Label">
Payment Method:
</td>
<td>
#payment.methodname#
</td>
</tr>
<tr>
<td class="Label">
Payment Status:
</td>
<td>
#payment.status.ToString()#
</td>
</tr>
<tr>
<td class="Label">
Payment Total:
</td>
<td>
#payment.currency# #format(payment.total, "C")#
</td>
</tr>
</table>
<p>
If you have any questions regarding your hosting account, feel free to contact our
sales department at any time.
</p>
<p>
Best regards,<br />
SolidCP.<br />
Web Site: <a href="https://solidcp.com">https://solidcp.com</a><br />
E-Mail: <a href="mailto:support@solidcp.com">support@solidcp.com</a></p>
</div>
</body>
</html>
')
GO
INSERT [dbo].[ecStoreDefaultSettings] ([SettingsName], [PropertyName], [PropertyValue]) VALUES (N'PaymentReceivedTemplate', N'Subject', N'Payment Received Notification')
GO
INSERT [dbo].[ecStoreDefaultSettings] ([SettingsName], [PropertyName], [PropertyValue]) VALUES (N'PaymentReceivedTemplate', N'TextBody', N'================================ Received Payment Information ================================
Hello #Customer["FirstName"]#,
We''ve received your payment successfully. You can find this payment details under your user account and below is the summary information.
Payment Overview
=============
Payment ##: #payment.paymentid#
Invoice ##: #payment.invoiceid#
Transaction ID ##: #payment.transactionid#
Created: #payment.created#
Payment Method: #payment.methodname#
Payment Status: #payment.status.ToString()#
Payment Total: #payment.currency# #format(payment.total, "C")#
If you have any questions regarding your hosting account, feel free to contact our sales department at any time.
Best regards,
SolidCP.
Web Site: https://solidcp.com
E-Mail: support@solidcp.com')
GO
INSERT [dbo].[ecStoreDefaultSettings] ([SettingsName], [PropertyName], [PropertyValue]) VALUES (N'SignupSettings', N'NewbieStatus', N'4')
GO
INSERT [dbo].[ecStoreDefaultSettings] ([SettingsName], [PropertyName], [PropertyValue]) VALUES (N'SignupSettings', N'RegDomainMode', N'OPT_DOM_AVAIL')
GO
INSERT [dbo].[ecStoreDefaultSettings] ([SettingsName], [PropertyName], [PropertyValue]) VALUES (N'SignupSettings', N'SendRegistrationEmail', N'true')
GO
INSERT [dbo].[ecStoreDefaultSettings] ([SettingsName], [PropertyName], [PropertyValue]) VALUES (N'SuspendServicesTemplate', N'CC', N'sales@solidcp.com')
GO
INSERT [dbo].[ecStoreDefaultSettings] ([SettingsName], [PropertyName], [PropertyValue]) VALUES (N'SuspendServicesTemplate', N'From', N'support@solidcp.com')
GO
INSERT [dbo].[ecStoreDefaultSettings] ([SettingsName], [PropertyName], [PropertyValue]) VALUES (N'SuspendServicesTemplate', N'HtmlBody', N'
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Suspend Service Summary Information</title>
<style type="text/css">
.Summary { background-color: ##ffffff; padding: 5px; }
.Summary .Header { padding: 10px 0px 10px 10px; font-size: 16pt; background-color: ##E5F2FF; color: ##1F4978; border-bottom: solid 2px ##86B9F7; }
.Summary A { color: ##0153A4; }
.Summary { font-family: Tahoma; font-size: 9pt; }
.Summary H1 { font-size: 1.7em; color: ##1F4978; border-bottom: dotted 3px ##efefef; }
.Summary H2 { font-size: 1.2em; }
.Summary TABLE { border: solid 1px ##e5e5e5; }
.Summary TH,
.Summary TD.Label { padding: 5px; font-size: 8pt; font-weight: bold; background-color: ##f5f5f5; }
.Summary TD { padding: 8px; font-size: 9pt; }
.Summary UL LI { font-size: 1.1em; font-weight: bold; }
.Summary UL UL LI { font-size: 0.9em; font-weight: normal; }
</style>
</head>
<body>
<div class="Summary">
<a name="top"></a>
<div class="Header">
Suspended Service Information
</div>
<p>Hello #Customer["FirstName"]#,</p>
<p>"#service.ServiceName#" service has been suspended under your user account
and below is the summary information.</p>
<h1>Service Overview</h1>
<table>
<tr>
<td class="Label">Service Name:</td>
<td>#service.ServiceName#</td>
</tr>
<tr>
<td class="Label">Created:</td>
<td>#service.Created#</td>
</tr>
</table>
<p>
If you have any questions regarding your hosting account, feel free to contact our sales department at any time.
</p>
<p>
Best regards,<br />
SolidCP.<br />
Web Site: <a href="https://solidcp.com">https://solidcp.com</a><br />
E-Mail: <a href="mailto:support@solidcp.com">support@solidcp.com</a></p>
</div>
</body>
</html>')
GO
INSERT [dbo].[ecStoreDefaultSettings] ([SettingsName], [PropertyName], [PropertyValue]) VALUES (N'SuspendServicesTemplate', N'Subject', N'Suspend Service Notification')
GO
INSERT [dbo].[ecStoreDefaultSettings] ([SettingsName], [PropertyName], [PropertyValue]) VALUES (N'SuspendServicesTemplate', N'TextBody', N'
================================
Suspended Service Information
================================
Hello #Customer["FirstName"]#,
"#service.ServiceName#" service has been suspended under your user account
and below is the summary information.
Service Overview
=============
Service Name: #service.ServiceName#
Created: #service.Created#
If you have any questions regarding your hosting account, feel free to contact our support department at any time.
Best regards,
SolidCP.
Web Site: https://solidcp.com
E-Mail: support@solidcp.com')
GO
INSERT [dbo].[ecStoreDefaultSettings] ([SettingsName], [PropertyName], [PropertyValue]) VALUES (N'SystemSettings', N'BaseCurrency', N'USD')
GO
INSERT [dbo].[ecStoreDefaultSettings] ([SettingsName], [PropertyName], [PropertyValue]) VALUES (N'SystemSettings', N'InvoiceGracePeriod', N'2')
GO
INSERT [dbo].[ecStoreDefaultSettings] ([SettingsName], [PropertyName], [PropertyValue]) VALUES (N'SystemSettings', N'ServiceSuspendThreshold', N'3')
GO
INSERT [dbo].[ecStoreDefaultSettings] ([SettingsName], [PropertyName], [PropertyValue]) VALUES (N'SystemSettings', N'SvcCancelThreshold', N'3')
GO
INSERT [dbo].[ecStoreDefaultSettings] ([SettingsName], [PropertyName], [PropertyValue]) VALUES (N'SystemSettings', N'SvcInvoiceThreshold', N'7')
GO
SET IDENTITY_INSERT [dbo].[ecSupportedPlugins] ON
GO
INSERT [dbo].[ecSupportedPlugins] ([PluginID], [PluginName], [DisplayName], [PluginGroup], [TypeName], [Interactive], [SupportedItems], [UniqueID]) VALUES (1, N'AuthorizeNet', N'Authorize.Net', N'CC_GATEWAY', N'SolidCP.Ecommerce.EnterpriseServer.AuthorizeNetProvider, SolidCP.Plugins.AuthorizeNet', 0, N'American Express=Amex,Discover,Master Card=MasterCard,Visa', NULL)
GO
INSERT [dbo].[ecSupportedPlugins] ([PluginID], [PluginName], [DisplayName], [PluginGroup], [TypeName], [Interactive], [SupportedItems], [UniqueID]) VALUES (2, N'PayPalPro', N'PayPal Pro', N'CC_GATEWAY', N'SolidCP.Ecommerce.EnterpriseServer.PayPalProProvider, SolidCP.Plugins.PayPalPro', 0, N'Visa,Master Card=MasterCard,Discover,American Express=Amex,Switch,Solo', NULL)
GO
INSERT [dbo].[ecSupportedPlugins] ([PluginID], [PluginName], [DisplayName], [PluginGroup], [TypeName], [Interactive], [SupportedItems], [UniqueID]) VALUES (3, N'2Checkout', N'2Checkout', N'2CO', N'SolidCP.Ecommerce.EnterpriseServer.TCOProvider, SolidCP.Plugins.2Checkout', 1, NULL, N'6A847B61-6178-445d-93FC-1929E86984DF')
GO
INSERT [dbo].[ecSupportedPlugins] ([PluginID], [PluginName], [DisplayName], [PluginGroup], [TypeName], [Interactive], [SupportedItems], [UniqueID]) VALUES (4, N'PayPalStandard', N'PayPal Standard', N'PP_ACCOUNT', N'SolidCP.Ecommerce.EnterpriseServer.PayPalStandardProvider, SolidCP.Plugins.PayPalStandard', 1, NULL, N'C7EA147E-880D-46f4-88C0-90A9D58BB8C0')
GO
INSERT [dbo].[ecSupportedPlugins] ([PluginID], [PluginName], [DisplayName], [PluginGroup], [TypeName], [Interactive], [SupportedItems], [UniqueID]) VALUES (5, N'OfflinePayment', N'Offline Payment', N'OFFLINE', N'SolidCP.Ecommerce.EnterpriseServer.OfflinePayment, SolidCP.Plugins.OfflinePayment', 0, NULL, NULL)
GO
INSERT [dbo].[ecSupportedPlugins] ([PluginID], [PluginName], [DisplayName], [PluginGroup], [TypeName], [Interactive], [SupportedItems], [UniqueID]) VALUES (6, N'Enom', N'Enom', N'DOMAIN_REGISTRAR', N'SolidCP.Ecommerce.EnterpriseServer.EnomRegistrar, SolidCP.Plugins.Enom', 0, NULL, NULL)
GO
INSERT [dbo].[ecSupportedPlugins] ([PluginID], [PluginName], [DisplayName], [PluginGroup], [TypeName], [Interactive], [SupportedItems], [UniqueID]) VALUES (7, N'Directi', N'Directi', N'DOMAIN_REGISTRAR', N'SolidCP.Ecommerce.EnterpriseServer.DirectiRegistrar, SolidCP.Plugins.Directi', 0, NULL, NULL)
GO
INSERT [dbo].[ecSupportedPlugins] ([PluginID], [PluginName], [DisplayName], [PluginGroup], [TypeName], [Interactive], [SupportedItems], [UniqueID]) VALUES (8, N'OfflineRegistrar', N'Offline Registrar', N'DOMAIN_REGISTRAR', N'SolidCP.Ecommerce.EnterpriseServer.OfflineRegistrar, SolidCP.Plugins.OfflineRegistrar', 0, NULL, NULL)
GO
SET IDENTITY_INSERT [dbo].[ecSupportedPlugins] OFF
GO
SET IDENTITY_INSERT [dbo].[Packages] ON
GO
SET LANGUAGE us_english
INSERT [dbo].[Packages] ([PackageID], [ParentPackageID], [UserID], [PackageName], [PackageComments], [ServerID], [StatusID], [PlanID], [OverrideQuotas], [BandwidthUpdated]) VALUES (1, NULL, 1, N'System', N'', NULL, 1, NULL, 0, NULL)
GO
SET IDENTITY_INSERT [dbo].[Packages] OFF
GO
INSERT [dbo].[PackagesTreeCache] ([ParentPackageID], [PackageID]) VALUES (1, 1)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (1, 1, N'Windows2003', N'Windows Server 2003', N'SolidCP.Providers.OS.Windows2003, SolidCP.Providers.OS.Windows2003', N'Windows2003', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (2, 2, N'IIS60', N'Internet Information Services 6.0', N'SolidCP.Providers.Web.IIs60, SolidCP.Providers.Web.IIs60', N'IIS60', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (3, 3, N'MSFTP60', N'Microsoft FTP Server 6.0', N'SolidCP.Providers.FTP.MsFTP, SolidCP.Providers.FTP.IIs60', N'MSFTP60', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (4, 4, N'MailEnable', N'MailEnable Server 1.x - 7.x', N'SolidCP.Providers.Mail.MailEnable, SolidCP.Providers.Mail.MailEnable', N'MailEnable', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (5, 5, N'MSSQL', N'Microsoft SQL Server 2000', N'SolidCP.Providers.Database.MsSqlServer, SolidCP.Providers.Database.SqlServer', N'MSSQL', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (6, 6, N'MySQL', N'MySQL Server 4.x', N'SolidCP.Providers.Database.MySqlServer, SolidCP.Providers.Database.MySQL', N'MySQL', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (7, 7, N'MSDNS', N'Microsoft DNS Server', N'SolidCP.Providers.DNS.MsDNS, SolidCP.Providers.DNS.MsDNS', N'MSDNS', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (8, 8, N'AWStats', N'AWStats Statistics Service', N'SolidCP.Providers.Statistics.AWStats, SolidCP.Providers.Statistics.AWStats', N'AWStats', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (9, 7, N'SimpleDNS', N'SimpleDNS Plus 4.x', N'SolidCP.Providers.DNS.SimpleDNS, SolidCP.Providers.DNS.SimpleDNS', N'SimpleDNS', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (10, 8, N'SmarterStats', N'SmarterStats 3.x', N'SolidCP.Providers.Statistics.SmarterStats, SolidCP.Providers.Statistics.SmarterStats', N'SmarterStats', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (11, 4, N'SmarterMail', N'SmarterMail 2.x', N'SolidCP.Providers.Mail.SmarterMail2, SolidCP.Providers.Mail.SmarterMail2', N'SmarterMail', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (12, 3, N'Gene6FTP', N'Gene6 FTP Server 3.x', N'SolidCP.Providers.FTP.Gene6, SolidCP.Providers.FTP.Gene6', N'Gene6FTP', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (13, 4, N'Merak', N'Merak Mail Server 8.0.3 - 9.2.x', N'SolidCP.Providers.Mail.Merak, SolidCP.Providers.Mail.Merak', N'Merak', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (14, 4, N'SmarterMail', N'SmarterMail 3.x - 4.x', N'SolidCP.Providers.Mail.SmarterMail3, SolidCP.Providers.Mail.SmarterMail3', N'SmarterMail', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (15, 9, N'Sps20', N'Windows SharePoint Services 2.0', N'SolidCP.Providers.SharePoint.Sps20, SolidCP.Providers.SharePoint.Sps20', N'Sps20', 1)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (16, 10, N'MSSQL', N'Microsoft SQL Server 2005', N'SolidCP.Providers.Database.MsSqlServer2005, SolidCP.Providers.Database.SqlServer', N'MSSQL', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (17, 11, N'MySQL', N'MySQL Server 5.0', N'SolidCP.Providers.Database.MySqlServer50, SolidCP.Providers.Database.MySQL', N'MySQL', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (18, 4, N'MDaemon', N'MDaemon 9.x - 11.x', N'SolidCP.Providers.Mail.MDaemon, SolidCP.Providers.Mail.MDaemon', N'MDaemon', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (19, 4, N'ArgoMail', N'ArGoSoft Mail Server 1.x', N'SolidCP.Providers.Mail.ArgoMail, SolidCP.Providers.Mail.ArgoMail', N'ArgoMail', 1)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (20, 4, N'hMailServer', N'hMailServer 4.2', N'SolidCP.Providers.Mail.hMailServer, SolidCP.Providers.Mail.hMailServer', N'hMailServer', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (21, 4, N'AbilityMailServer', N'Ability Mail Server 2.x', N'SolidCP.Providers.Mail.AbilityMailServer, SolidCP.Providers.Mail.AbilityMailServer', N'AbilityMailServer', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (22, 4, N'hMailServer43', N'hMailServer 4.3', N'SolidCP.Providers.Mail.hMailServer43, SolidCP.Providers.Mail.hMailServer43', N'hMailServer43', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (23, 9, N'Sps20', N'Windows SharePoint Services 3.0', N'SolidCP.Providers.SharePoint.Sps30, SolidCP.Providers.SharePoint.Sps30', N'Sps20', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (24, 7, N'Bind', N'ISC BIND 8.x - 9.x', N'SolidCP.Providers.DNS.IscBind, SolidCP.Providers.DNS.Bind', N'Bind', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (25, 3, N'ServU', N'Serv-U FTP 6.x', N'SolidCP.Providers.FTP.ServU, SolidCP.Providers.FTP.ServU', N'ServU', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (26, 3, N'FileZilla', N'FileZilla FTP Server 0.9', N'SolidCP.Providers.FTP.FileZilla, SolidCP.Providers.FTP.FileZilla', N'FileZilla', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (27, 12, N'Exchange2007', N'Hosted Microsoft Exchange Server 2007', N'SolidCP.Providers.HostedSolution.Exchange2007, SolidCP.Providers.HostedSolution', N'Exchange', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (28, 7, N'SimpleDNS', N'SimpleDNS Plus 5.x', N'SolidCP.Providers.DNS.SimpleDNS5, SolidCP.Providers.DNS.SimpleDNS50', N'SimpleDNS', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (29, 4, N'SmarterMail', N'SmarterMail 5.x', N'SolidCP.Providers.Mail.SmarterMail5, SolidCP.Providers.Mail.SmarterMail5', N'SmarterMail50', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (30, 11, N'MySQL', N'MySQL Server 5.1', N'SolidCP.Providers.Database.MySqlServer51, SolidCP.Providers.Database.MySQL', N'MySQL', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (31, 8, N'SmarterStats', N'SmarterStats 4.x', N'SolidCP.Providers.Statistics.SmarterStats4, SolidCP.Providers.Statistics.SmarterStats', N'SmarterStats', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (32, 12, N'Exchange2010', N'Hosted Microsoft Exchange Server 2010', N'SolidCP.Providers.HostedSolution.Exchange2010, SolidCP.Providers.HostedSolution', N'Exchange', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (55, 7, N'NetticaDNS', N'Nettica DNS', N'SolidCP.Providers.DNS.Nettica, SolidCP.Providers.DNS.Nettica', N'NetticaDNS', 1)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (56, 7, N'PowerDNS', N'PowerDNS', N'SolidCP.Providers.DNS.PowerDNS, SolidCP.Providers.DNS.PowerDNS', N'PowerDNS', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (60, 4, N'SmarterMail', N'SmarterMail 6.x', N'SolidCP.Providers.Mail.SmarterMail6, SolidCP.Providers.Mail.SmarterMail6', N'SmarterMail60', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (61, 4, N'Merak', N'Merak Mail Server 10.x', N'SolidCP.Providers.Mail.Merak10, SolidCP.Providers.Mail.Merak10', N'Merak', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (62, 8, N'SmarterStats', N'SmarterStats 5.x +', N'SolidCP.Providers.Statistics.SmarterStats5, SolidCP.Providers.Statistics.SmarterStats', N'SmarterStats', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (63, 4, N'hMailServer5', N'hMailServer 5.x', N'SolidCP.Providers.Mail.hMailServer5, SolidCP.Providers.Mail.hMailServer5', N'hMailServer5', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (64, 4, N'SmarterMail', N'SmarterMail 7.x - 8.x', N'SolidCP.Providers.Mail.SmarterMail7, SolidCP.Providers.Mail.SmarterMail7', N'SmarterMail60', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (65, 4, N'SmarterMail', N'SmarterMail 9.x', N'SolidCP.Providers.Mail.SmarterMail9, SolidCP.Providers.Mail.SmarterMail9', N'SmarterMail60', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (66, 4, N'SmarterMail', N'SmarterMail 10.x +', N'SolidCP.Providers.Mail.SmarterMail10, SolidCP.Providers.Mail.SmarterMail10', N'SmarterMail100', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (90, 12, N'Exchange2010SP2', N'Hosted Microsoft Exchange Server 2010 SP2', N'SolidCP.Providers.HostedSolution.Exchange2010SP2, SolidCP.Providers.HostedSolution', N'Exchange', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (100, 1, N'Windows2008', N'Windows Server 2008', N'SolidCP.Providers.OS.Windows2008, SolidCP.Providers.OS.Windows2008', N'Windows2008', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (101, 2, N'IIS70', N'Internet Information Services 7.0', N'SolidCP.Providers.Web.IIs70, SolidCP.Providers.Web.IIs70', N'IIS70', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (102, 3, N'MSFTP70', N'Microsoft FTP Server 7.0', N'SolidCP.Providers.FTP.MsFTP, SolidCP.Providers.FTP.IIs70', N'MSFTP70', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (103, 13, N'Organizations', N'Hosted Organizations', N'SolidCP.Providers.HostedSolution.OrganizationProvider, SolidCP.Providers.HostedSolution', N'Organizations', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (104, 1, N'Windows2012', N'Windows Server 2012', N'SolidCP.Providers.OS.Windows2012, SolidCP.Providers.OS.Windows2012', N'Windows2008', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (105, 2, N'IIS80', N'Internet Information Services 8.0', N'SolidCP.Providers.Web.IIs80, SolidCP.Providers.Web.IIs80', N'IIS70', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (106, 3, N'MSFTP80', N'Microsoft FTP Server 8.0', N'SolidCP.Providers.FTP.MsFTP80, SolidCP.Providers.FTP.IIs80', N'MSFTP70', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (111, 1, N'Windows2016', N'Windows Server 2016', N'SolidCP.Providers.OS.Windows2016, SolidCP.Providers.OS.Windows2016', N'Windows2008', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (112, 2, N'IIS100', N'Internet Information Services 10.0', N'SolidCP.Providers.Web.IIs100, SolidCP.Providers.Web.IIs100', N'IIS70', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (113, 3, N'MSFTP100', N'Microsoft FTP Server 10.0', N'SolidCP.Providers.FTP.MsFTP100, SolidCP.Providers.FTP.IIs100', N'MSFTP70', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (200, 20, N'HostedSharePoint30', N'Hosted Windows SharePoint Services 3.0', N'SolidCP.Providers.HostedSolution.HostedSharePointServer, SolidCP.Providers.HostedSolution', N'HostedSharePoint30', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (201, 21, N'CRM', N'Hosted MS CRM 4.0', N'SolidCP.Providers.HostedSolution.CRMProvider, SolidCP.Providers.HostedSolution', N'CRM', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (202, 22, N'MsSQL', N'Microsoft SQL Server 2008', N'SolidCP.Providers.Database.MsSqlServer2008, SolidCP.Providers.Database.SqlServer', N'MSSQL', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (203, 31, N'BlackBerry 4.1', N'BlackBerry 4.1', N'SolidCP.Providers.HostedSolution.BlackBerryProvider, SolidCP.Providers.HostedSolution', N'BlackBerry', 1)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (204, 31, N'BlackBerry 5.0', N'BlackBerry 5.0', N'SolidCP.Providers.HostedSolution.BlackBerry5Provider, SolidCP.Providers.HostedSolution', N'BlackBerry5', 1)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (205, 32, N'OCS', N'Office Communications Server 2007 R2', N'SolidCP.Providers.HostedSolution.OCS2007R2, SolidCP.Providers.HostedSolution', N'OCS', 1)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (206, 32, N'OCSEdge', N'OCS Edge server', N'SolidCP.Providers.HostedSolution.OCSEdge2007R2, SolidCP.Providers.HostedSolution', N'OCS_Edge', 1)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (208, 20, N'HostedSharePoint2010', N'Hosted SharePoint Foundation 2010', N'SolidCP.Providers.HostedSolution.HostedSharePointServer2010, SolidCP.Providers.HostedSolution', N'HostedSharePoint30', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (209, 23, N'MsSQL', N'Microsoft SQL Server 2012', N'SolidCP.Providers.Database.MsSqlServer2012, SolidCP.Providers.Database.SqlServer', N'MSSQL', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (250, 41, N'Lync2010', N'Microsoft Lync Server 2010 Multitenant Hosting Pack', N'SolidCP.Providers.HostedSolution.Lync2010, SolidCP.Providers.HostedSolution', N'Lync', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (300, 30, N'HyperV', N'Microsoft Hyper-V', N'SolidCP.Providers.Virtualization.HyperV, SolidCP.Providers.Virtualization.HyperV', N'HyperV', 1)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (301, 11, N'MySQL', N'MySQL Server 5.5', N'SolidCP.Providers.Database.MySqlServer55, SolidCP.Providers.Database.MySQL', N'MySQL', NULL)
GO
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (400, 40, N'HyperVForPC', N'Microsoft Hyper-V For Private Cloud', N'SolidCP.Providers.VirtualizationForPC.HyperVForPC, SolidCP.Providers.VirtualizationForPC.HyperVForPC', N'HyperVForPrivateCloud', 1)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (2, 6, 1, N'MySQL4.Databases', N'Databases', 2, 1, 7, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (3, 5, 1, N'MsSQL2000.Databases', N'Databases', 2, 1, 5, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (4, 3, 1, N'FTP.Accounts', N'FTP Accounts', 2, 1, 9, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (11, 9, 2, N'SharePoint.Users', N'SharePoint Users', 2, 0, 1, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (12, 8, 1, N'Stats.Sites', N'Statistics Sites', 2, 1, 14, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (13, 2, 1, N'Web.Sites', N'Web Sites', 2, 1, 10, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (14, 4, 1, N'Mail.Accounts', N'Mail Accounts', 2, 1, 15, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (15, 5, 2, N'MsSQL2000.Users', N'Users', 2, 0, 6, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (18, 4, 3, N'Mail.Forwardings', N'Mail Forwardings', 2, 0, 16, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (19, 6, 2, N'MySQL4.Users', N'Users', 2, 0, 8, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (20, 4, 6, N'Mail.Lists', N'Mail Lists', 2, 0, 17, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (22, 9, 3, N'SharePoint.Groups', N'SharePoint Groups', 2, 0, 3, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (24, 4, 4, N'Mail.Groups', N'Mail Groups', 2, 0, 18, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (25, 2, 3, N'Web.AspNet11', N'ASP.NET 1.1', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (26, 2, 4, N'Web.AspNet20', N'ASP.NET 2.0', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (27, 2, 2, N'Web.Asp', N'ASP', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (28, 2, 5, N'Web.Php4', N'PHP 4.x', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (29, 2, 6, N'Web.Php5', N'PHP 5.x', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (30, 2, 7, N'Web.Perl', N'Perl', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (31, 2, 8, N'Web.Python', N'Python', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (32, 2, 9, N'Web.VirtualDirs', N'Virtual Directories', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (33, 2, 10, N'Web.FrontPage', N'FrontPage', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (34, 2, 11, N'Web.Security', N'Custom Security Settings', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (35, 2, 12, N'Web.DefaultDocs', N'Custom Default Documents', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (36, 2, 13, N'Web.AppPools', N'Dedicated Application Pools', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (37, 2, 14, N'Web.Headers', N'Custom Headers', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (38, 2, 15, N'Web.Errors', N'Custom Errors', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (39, 2, 16, N'Web.Mime', N'Custom MIME Types', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (40, 4, 2, N'Mail.MaxBoxSize', N'Max Mailbox Size', 3, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (41, 5, 3, N'MsSQL2000.MaxDatabaseSize', N'Max Database Size', 3, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (42, 5, 5, N'MsSQL2000.Backup', N'Database Backups', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (43, 5, 6, N'MsSQL2000.Restore', N'Database Restores', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (44, 5, 7, N'MsSQL2000.Truncate', N'Database Truncate', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (45, 6, 4, N'MySQL4.Backup', N'Database Backups', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (47, 1, 6, N'OS.ODBC', N'ODBC DSNs', 2, 0, 20, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (48, 7, 1, N'DNS.Editor', N'DNS Editor', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (49, 4, 5, N'Mail.MaxGroupMembers', N'Max Group Recipients', 3, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (50, 4, 7, N'Mail.MaxListMembers', N'Max List Recipients', 3, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (51, 1, 2, N'OS.Bandwidth', N'Bandwidth, MB', 2, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (52, 1, 1, N'OS.Diskspace', N'Disk space, MB', 2, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (53, 1, 3, N'OS.Domains', N'Domains', 2, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (54, 1, 4, N'OS.SubDomains', N'Sub-Domains', 2, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (55, 1, 6, N'OS.FileManager', N'File Manager', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (56, 9, 1, N'SharePoint.Sites', N'SharePoint Sites', 2, 0, 19, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (57, 2, 8, N'Web.CgiBin', N'CGI-BIN Folder', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (58, 2, 8, N'Web.SecuredFolders', N'Secured Folders', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (59, 2, 8, N'Web.SharedSSL', N'Shared SSL Folders', 2, 0, 25, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (60, 2, 8, N'Web.Redirections', N'Web Sites Redirection', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (61, 2, 8, N'Web.HomeFolders', N'Changing Sites Root Folders', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (62, 10, 1, N'MsSQL2005.Databases', N'Databases', 2, 0, 21, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (63, 10, 2, N'MsSQL2005.Users', N'Users', 2, 0, 22, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (64, 10, 3, N'MsSQL2005.MaxDatabaseSize', N'Max Database Size', 3, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (65, 10, 5, N'MsSQL2005.Backup', N'Database Backups', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (66, 10, 6, N'MsSQL2005.Restore', N'Database Restores', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (67, 10, 7, N'MsSQL2005.Truncate', N'Database Truncate', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (68, 11, 1, N'MySQL5.Databases', N'Databases', 2, 0, 23, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (69, 11, 2, N'MySQL5.Users', N'Users', 2, 0, 24, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (70, 11, 4, N'MySQL5.Backup', N'Database Backups', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (71, 1, 9, N'OS.ScheduledTasks', N'Scheduled Tasks', 2, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (72, 1, 10, N'OS.ScheduledIntervalTasks', N'Interval Tasks Allowed', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (73, 1, 11, N'OS.MinimumTaskInterval', N'Minimum Tasks Interval, minutes', 3, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (74, 1, 7, N'OS.AppInstaller', N'Applications Installer', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (75, 1, 8, N'OS.ExtraApplications', N'Extra Application Packs', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (77, 12, 2, N'Exchange2007.DiskSpace', N'Organization Disk Space, MB', 2, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (78, 12, 3, N'Exchange2007.Mailboxes', N'Mailboxes per Organization', 2, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (79, 12, 4, N'Exchange2007.Contacts', N'Contacts per Organization', 3, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (80, 12, 5, N'Exchange2007.DistributionLists', N'Distribution Lists per Organization', 3, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (81, 12, 6, N'Exchange2007.PublicFolders', N'Public Folders per Organization', 3, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (83, 12, 9, N'Exchange2007.POP3Allowed', N'POP3 Access', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (84, 12, 11, N'Exchange2007.IMAPAllowed', N'IMAP Access', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (85, 12, 13, N'Exchange2007.OWAAllowed', N'OWA/HTTP Access', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (86, 12, 15, N'Exchange2007.MAPIAllowed', N'MAPI Access', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (87, 12, 17, N'Exchange2007.ActiveSyncAllowed', N'ActiveSync Access', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (88, 12, 8, N'Exchange2007.MailEnabledPublicFolders', N'Mail Enabled Public Folders Allowed', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (94, 2, 17, N'Web.ColdFusion', N'ColdFusion', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (95, 2, 1, N'Web.WebAppGallery', N'Web Application Gallery', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (96, 2, 18, N'Web.CFVirtualDirectories', N'ColdFusion Virtual Directories', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (97, 2, 20, N'Web.RemoteManagement', N'Remote web management allowed', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (100, 2, 19, N'Web.IPAddresses', N'Dedicated IP Addresses', 2, 1, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (102, 4, 8, N'Mail.DisableSizeEdit', N'Disable Mailbox Size Edit', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (103, 6, 3, N'MySQL4.MaxDatabaseSize', N'Max Database Size', 3, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (104, 6, 5, N'MySQL4.Restore', N'Database Restores', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (105, 6, 6, N'MySQL4.Truncate', N'Database Truncate', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (106, 11, 3, N'MySQL5.MaxDatabaseSize', N'Max Database Size', 3, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (107, 11, 5, N'MySQL5.Restore', N'Database Restores', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (108, 11, 6, N'MySQL5.Truncate', N'Database Truncate', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (200, 20, 1, N'HostedSharePoint.Sites', N'SharePoint Site Collections', 2, 0, 200, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (203, 10, 4, N'MsSQL2005.MaxLogSize', N'Max Log Size', 3, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (204, 5, 4, N'MsSQL2000.MaxLogSize', N'Max Log Size', 3, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (205, 13, 1, N'HostedSolution.Organizations', N'Organizations', 2, 0, 29, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (206, 13, 2, N'HostedSolution.Users', N'Users', 2, 0, 30, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (207, 13, 3, N'HostedSolution.Domains', N'Domains per Organizations', 3, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (208, 20, 2, N'HostedSharePoint.MaxStorage', N'Max site storage, MB', 3, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (209, 21, 2, N'HostedCRM.Users', N'Users', 3, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (210, 21, 1, N'HostedCRM.Organization', N'CRM Organization', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (211, 22, 1, N'MsSQL2008.Databases', N'Databases', 2, 0, 31, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (212, 22, 2, N'MsSQL2008.Users', N'Users', 2, 0, 32, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (213, 22, 3, N'MsSQL2008.MaxDatabaseSize', N'Max Database Size', 3, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (214, 22, 5, N'MsSQL2008.Backup', N'Database Backups', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (215, 22, 6, N'MsSQL2008.Restore', N'Database Restores', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (216, 22, 7, N'MsSQL2008.Truncate', N'Database Truncate', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (217, 22, 4, N'MsSQL2008.MaxLogSize', N'Max Log Size', 3, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (218, 23, 1, N'MsSQL2012.Databases', N'Databases', 2, 0, 37, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (219, 23, 2, N'MsSQL2012.Users', N'Users', 2, 0, 38, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (220, 1, 5, N'OS.DomainPointers', N'Domain Pointers', 2, 0, NULL, 1)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (221, 23, 3, N'MsSQL2012.MaxDatabaseSize', N'Max Database Size', 3, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (222, 23, 5, N'MsSQL2012.Backup', N'Database Backups', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (223, 23, 6, N'MsSQL2012.Restore', N'Database Restores', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (224, 23, 7, N'MsSQL2012.Truncate', N'Database Truncate', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (225, 23, 4, N'MsSQL2012.MaxLogSize', N'Max Log Size', 3, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (230, 13, 4, N'HostedSolution.AllowChangeUPN', N'Allow to Change UserPrincipalName', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (300, 30, 1, N'VPS.ServersNumber', N'Number of VPS', 2, 0, 33, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (301, 30, 2, N'VPS.ManagingAllowed', N'Allow user to create VPS', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (302, 30, 3, N'VPS.CpuNumber', N'Number of CPU cores', 3, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (303, 30, 7, N'VPS.BootCdAllowed', N'Boot from CD allowed', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (304, 30, 8, N'VPS.BootCdEnabled', N'Boot from CD', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (305, 30, 4, N'VPS.Ram', N'RAM size, MB', 2, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (306, 30, 5, N'VPS.Hdd', N'Hard Drive size, GB', 2, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (307, 30, 6, N'VPS.DvdEnabled', N'DVD drive', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (308, 30, 10, N'VPS.ExternalNetworkEnabled', N'External Network', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (309, 30, 11, N'VPS.ExternalIPAddressesNumber', N'Number of External IP addresses', 2, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (310, 30, 13, N'VPS.PrivateNetworkEnabled', N'Private Network', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (311, 30, 14, N'VPS.PrivateIPAddressesNumber', N'Number of Private IP addresses per VPS', 3, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (312, 30, 9, N'VPS.SnapshotsNumber', N'Number of Snaphots', 3, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (313, 30, 15, N'VPS.StartShutdownAllowed', N'Allow user to Start, Turn off and Shutdown VPS', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (314, 30, 16, N'VPS.PauseResumeAllowed', N'Allow user to Pause, Resume VPS', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (315, 30, 17, N'VPS.RebootAllowed', N'Allow user to Reboot VPS', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (316, 30, 18, N'VPS.ResetAlowed', N'Allow user to Reset VPS', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (317, 30, 19, N'VPS.ReinstallAllowed', N'Allow user to Re-install VPS', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (318, 30, 12, N'VPS.Bandwidth', N'Monthly bandwidth, GB', 2, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (319, 31, 1, N'BlackBerry.Users', NULL, 2, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (320, 32, 1, N'OCS.Users', NULL, 2, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (321, 32, 2, N'OCS.Federation', NULL, 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (322, 32, 3, N'OCS.FederationByDefault', NULL, 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (323, 32, 4, N'OCS.PublicIMConnectivity', NULL, 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (324, 32, 5, N'OCS.PublicIMConnectivityByDefault', NULL, 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (325, 32, 6, N'OCS.ArchiveIMConversation', NULL, 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (326, 32, 7, N'OCS.ArchiveIMConvervationByDefault', NULL, 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (327, 32, 8, N'OCS.ArchiveFederatedIMConversation', NULL, 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (328, 32, 9, N'OCS.ArchiveFederatedIMConversationByDefault', NULL, 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (329, 32, 10, N'OCS.PresenceAllowed', NULL, 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (330, 32, 10, N'OCS.PresenceAllowedByDefault', NULL, 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (331, 2, 4, N'Web.AspNet40', N'ASP.NET 4.0', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (332, 2, 21, N'Web.SSL', N'SSL', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (333, 2, 22, N'Web.AllowIPAddressModeSwitch', N'Allow IP Address Mode Switch', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (334, 2, 23, N'Web.EnableHostNameSupport', N'Enable Hostname Support', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (344, 2, 9, N'Web.Htaccess', N'htaccess', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (345, 40, 1, N'VPSForPC.ServersNumber', N'Number of VPS', 2, 0, 35, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (346, 40, 2, N'VPSForPC.ManagingAllowed', N'Allow user to create VPS', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (347, 40, 3, N'VPSForPC.CpuNumber', N'Number of CPU cores', 3, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (348, 40, 7, N'VPSForPC.BootCdAllowed', N'Boot from CD allowed', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (349, 40, 7, N'VPSForPC.BootCdEnabled', N'Boot from CD', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (350, 40, 4, N'VPSForPC.Ram', N'RAM size, MB', 2, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (351, 40, 5, N'VPSForPC.Hdd', N'Hard Drive size, GB', 2, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (352, 40, 6, N'VPSForPC.DvdEnabled', N'DVD drive', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (353, 40, 10, N'VPSForPC.ExternalNetworkEnabled', N'External Network', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (354, 40, 11, N'VPSForPC.ExternalIPAddressesNumber', N'Number of External IP addresses', 2, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (355, 40, 13, N'VPSForPC.PrivateNetworkEnabled', N'Private Network', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (356, 40, 14, N'VPSForPC.PrivateIPAddressesNumber', N'Number of Private IP addresses per VPS', 3, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (357, 40, 9, N'VPSForPC.SnapshotsNumber', N'Number of Snaphots', 3, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (358, 40, 15, N'VPSForPC.StartShutdownAllowed', N'Allow user to Start, Turn off and Shutdown VPS', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (359, 40, 16, N'VPSForPC.PauseResumeAllowed', N'Allow user to Pause, Resume VPS', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (360, 40, 17, N'VPSForPC.RebootAllowed', N'Allow user to Reboot VPS', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (361, 40, 18, N'VPSForPC.ResetAlowed', N'Allow user to Reset VPS', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (362, 40, 19, N'VPSForPC.ReinstallAllowed', N'Allow user to Re-install VPS', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (363, 40, 12, N'VPSForPC.Bandwidth', N'Monthly bandwidth, GB', 2, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (364, 12, 19, N'Exchange2007.KeepDeletedItemsDays', N'Keep Deleted Items (days)', 3, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (365, 12, 20, N'Exchange2007.MaxRecipients', N'Maximum Recipients', 3, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (366, 12, 21, N'Exchange2007.MaxSendMessageSizeKB', N'Maximum Send Message Size (Kb)', 3, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (367, 12, 22, N'Exchange2007.MaxReceiveMessageSizeKB', N'Maximum Receive Message Size (Kb)', 3, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (368, 12, 1, N'Exchange2007.IsConsumer', N'Is Consumer Organization', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (369, 12, 23, N'Exchange2007.EnablePlansEditing', N'Enable Plans Editing', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (370, 41, 1, N'Lync.Users', N'Users', 2, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (371, 41, 2, N'Lync.Federation', N'Allow Federation', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (372, 41, 3, N'Lync.Conferencing', N'Allow Conferencing', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (373, 41, 4, N'Lync.MaxParticipants', N'Maximum Conference Particiapants', 3, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (374, 41, 5, N'Lync.AllowVideo', N'Allow Video in Conference', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (375, 41, 6, N'Lync.EnterpriseVoice', N'Allow EnterpriseVoice', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (376, 41, 7, N'Lync.EVUsers', N'Number of Enterprise Voice Users', 2, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (377, 41, 8, N'Lync.EVNational', N'Allow National Calls', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (378, 41, 9, N'Lync.EVMobile', N'Allow Mobile Calls', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (379, 41, 10, N'Lync.EVInternational', N'Allow International Calls', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (380, 41, 11, N'Lync.EnablePlansEditing', N'Enable Plans Editing', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (400, 20, 3, N'HostedSharePoint.UseSharedSSL', N'Use shared SSL Root', 1, 0, NULL, NULL)
GO
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (410, 1, 12, N'OS.AllowTenantCreateDomains', N'Allow Tenants to Create Top Level Domains', 1, 0, NULL, NULL)
GO
SET IDENTITY_INSERT [dbo].[ResourceGroupDnsRecords] ON
GO
INSERT [dbo].[ResourceGroupDnsRecords] ([RecordID], [RecordOrder], [GroupID], [RecordType], [RecordName], [RecordData], [MXPriority]) VALUES (1, 1, 2, N'A', N'', N'[IP]', 0)
GO
INSERT [dbo].[ResourceGroupDnsRecords] ([RecordID], [RecordOrder], [GroupID], [RecordType], [RecordName], [RecordData], [MXPriority]) VALUES (2, 2, 2, N'A', N'*', N'[IP]', 0)
GO
INSERT [dbo].[ResourceGroupDnsRecords] ([RecordID], [RecordOrder], [GroupID], [RecordType], [RecordName], [RecordData], [MXPriority]) VALUES (3, 3, 2, N'A', N'www', N'[IP]', 0)
GO
INSERT [dbo].[ResourceGroupDnsRecords] ([RecordID], [RecordOrder], [GroupID], [RecordType], [RecordName], [RecordData], [MXPriority]) VALUES (4, 1, 3, N'A', N'ftp', N'[IP]', 0)
GO
INSERT [dbo].[ResourceGroupDnsRecords] ([RecordID], [RecordOrder], [GroupID], [RecordType], [RecordName], [RecordData], [MXPriority]) VALUES (5, 1, 4, N'A', N'mail', N'[IP]', 0)
GO
INSERT [dbo].[ResourceGroupDnsRecords] ([RecordID], [RecordOrder], [GroupID], [RecordType], [RecordName], [RecordData], [MXPriority]) VALUES (6, 2, 4, N'A', N'mail2', N'[IP]', 0)
GO
INSERT [dbo].[ResourceGroupDnsRecords] ([RecordID], [RecordOrder], [GroupID], [RecordType], [RecordName], [RecordData], [MXPriority]) VALUES (7, 3, 4, N'MX', N'', N'mail.[DOMAIN_NAME]', 10)
GO
INSERT [dbo].[ResourceGroupDnsRecords] ([RecordID], [RecordOrder], [GroupID], [RecordType], [RecordName], [RecordData], [MXPriority]) VALUES (9, 4, 4, N'MX', N'', N'mail2.[DOMAIN_NAME]', 21)
GO
INSERT [dbo].[ResourceGroupDnsRecords] ([RecordID], [RecordOrder], [GroupID], [RecordType], [RecordName], [RecordData], [MXPriority]) VALUES (10, 1, 5, N'A', N'mssql', N'[IP]', 0)
GO
INSERT [dbo].[ResourceGroupDnsRecords] ([RecordID], [RecordOrder], [GroupID], [RecordType], [RecordName], [RecordData], [MXPriority]) VALUES (11, 1, 6, N'A', N'mysql', N'[IP]', 0)
GO
INSERT [dbo].[ResourceGroupDnsRecords] ([RecordID], [RecordOrder], [GroupID], [RecordType], [RecordName], [RecordData], [MXPriority]) VALUES (12, 1, 8, N'A', N'stats', N'[IP]', 0)
GO
INSERT [dbo].[ResourceGroupDnsRecords] ([RecordID], [RecordOrder], [GroupID], [RecordType], [RecordName], [RecordData], [MXPriority]) VALUES (13, 5, 4, N'TXT', N'', N'v=spf1 a mx -all', 0)
GO
INSERT [dbo].[ResourceGroupDnsRecords] ([RecordID], [RecordOrder], [GroupID], [RecordType], [RecordName], [RecordData], [MXPriority]) VALUES (14, 1, 12, N'A', N'smtp', N'[IP]', 0)
GO
INSERT [dbo].[ResourceGroupDnsRecords] ([RecordID], [RecordOrder], [GroupID], [RecordType], [RecordName], [RecordData], [MXPriority]) VALUES (15, 2, 12, N'MX', N'', N'smtp.[DOMAIN_NAME]', 10)
GO
INSERT [dbo].[ResourceGroupDnsRecords] ([RecordID], [RecordOrder], [GroupID], [RecordType], [RecordName], [RecordData], [MXPriority]) VALUES (16, 3, 12, N'CNAME', N'autodiscover', N'', 0)
GO
INSERT [dbo].[ResourceGroupDnsRecords] ([RecordID], [RecordOrder], [GroupID], [RecordType], [RecordName], [RecordData], [MXPriority]) VALUES (17, 4, 12, N'CNAME', N'owa', N'', 0)
GO
SET IDENTITY_INSERT [dbo].[ResourceGroupDnsRecords] OFF
GO
INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (1, N'OS', 1, N'SolidCP.EnterpriseServer.OperatingSystemController', 1)
GO
INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (2, N'Web', 2, N'SolidCP.EnterpriseServer.WebServerController', 1)
GO
INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (3, N'FTP', 3, N'SolidCP.EnterpriseServer.FtpServerController', 1)
GO
INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (4, N'Mail', 4, N'SolidCP.EnterpriseServer.MailServerController', 1)
GO
INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (5, N'MsSQL2000', 7, N'SolidCP.EnterpriseServer.DatabaseServerController', 1)
GO
INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (6, N'MySQL4', 11, N'SolidCP.EnterpriseServer.DatabaseServerController', 1)
GO
INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (7, N'DNS', 16, N'SolidCP.EnterpriseServer.DnsServerController', 1)
GO
INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (8, N'Statistics', 17, N'SolidCP.EnterpriseServer.StatisticsServerController', 1)
GO
INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (9, N'SharePoint', 13, N'SolidCP.EnterpriseServer.SharePointServerController', 1)
GO
INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (10, N'MsSQL2005', 8, N'SolidCP.EnterpriseServer.DatabaseServerController', 1)
GO
INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (11, N'MySQL5', 12, N'SolidCP.EnterpriseServer.DatabaseServerController', 1)
GO
INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (12, N'Exchange', 5, NULL, 1)
GO
INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (13, N'Hosted Organizations', 6, NULL, 1)
GO
INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (20, N'Hosted SharePoint', 14, N'SolidCP.EnterpriseServer.HostedSharePointServerController', 1)
GO
INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (21, N'Hosted CRM', 15, NULL, 1)
GO
INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (22, N'MsSQL2008', 9, N'SolidCP.EnterpriseServer.DatabaseServerController', 1)
GO
INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (23, N'MsSQL2012', 10, N'SolidCP.EnterpriseServer.DatabaseServerController', 1)
GO
INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (30, N'VPS', 18, NULL, 1)
GO
INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (31, N'BlackBerry', 20, NULL, 1)
GO
INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (32, N'OCS', 21, NULL, 1)
GO
INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (40, N'VPSForPC', 19, NULL, 1)
GO
INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (41, N'Lync', 23, NULL, 1)
GO
INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (52, N'SfB', 25, NULL, 1)
GO
SET IDENTITY_INSERT [dbo].[Schedule] ON
GO
INSERT [dbo].[Schedule] ([ScheduleID], [TaskID], [PackageID], [ScheduleName], [ScheduleTypeID], [Interval], [FromTime], [ToTime], [StartTime], [LastRun], [NextRun], [Enabled], [PriorityID], [HistoriesNumber], [MaxExecutionTime], [WeekMonthDay]) VALUES (1, N'SCHEDULE_TASK_CALCULATE_PACKAGES_DISKSPACE', 1, N'Calculate Disk Space', N'Daily', 0, CAST(0x00008EAC00C5C100 AS DateTime), CAST(0x00008EAC00C5C100 AS DateTime), CAST(0x00008EAC00CDFE60 AS DateTime), NULL, CAST(0x00009DB500F547F5 AS DateTime), 1, N'Normal', 7, 3600, 1)
GO
INSERT [dbo].[Schedule] ([ScheduleID], [TaskID], [PackageID], [ScheduleName], [ScheduleTypeID], [Interval], [FromTime], [ToTime], [StartTime], [LastRun], [NextRun], [Enabled], [PriorityID], [HistoriesNumber], [MaxExecutionTime], [WeekMonthDay]) VALUES (2, N'SCHEDULE_TASK_CALCULATE_PACKAGES_BANDWIDTH', 1, N'Calculate Bandwidth', N'Daily', 0, CAST(0x00008EAC00C5C100 AS DateTime), CAST(0x00008EAC00C5C100 AS DateTime), CAST(0x00008EAC00C5C100 AS DateTime), NULL, CAST(0x00009DB500F547F7 AS DateTime), 1, N'Normal', 7, 3600, 1)
GO
SET IDENTITY_INSERT [dbo].[Schedule] OFF
GO
INSERT [dbo].[ScheduleParameters] ([ScheduleID], [ParameterID], [ParameterValue]) VALUES (1, N'SUSPEND_OVERUSED', N'false')
GO
INSERT [dbo].[ScheduleParameters] ([ScheduleID], [ParameterID], [ParameterValue]) VALUES (2, N'SUSPEND_OVERUSED', N'false')
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_BACKUP', N'BACKUP_FILE_NAME', N'String', N'', 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_BACKUP', N'DELETE_TEMP_BACKUP', N'Boolean', N'true', 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_BACKUP', N'STORE_PACKAGE_FOLDER', N'String', N'\', 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_BACKUP', N'STORE_PACKAGE_ID', N'String', N'', 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_BACKUP', N'STORE_SERVER_FOLDER', N'String', N'', 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_BACKUP_DATABASE', N'BACKUP_FOLDER', N'String', N'\backups', 3)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_BACKUP_DATABASE', N'BACKUP_NAME', N'String', N'database_backup.bak', 4)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_BACKUP_DATABASE', N'DATABASE_GROUP', N'List', N'MsSQL2008=SQL Server 2008;MsSQL2012=SQL Server 2012;MsSQL2014=SQL Server 2014;MySQL4=MySQL 4.0;MySQL5=MySQL 5.0,MariaDB=MariaDB', 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_BACKUP_DATABASE', N'DATABASE_NAME', N'String', N'', 2)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_BACKUP_DATABASE', N'ZIP_BACKUP', N'List', N'true=Yes;false=No', 5)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_CHECK_WEBSITE', N'MAIL_BODY', N'MultiString', N'', 10)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_CHECK_WEBSITE', N'MAIL_FROM', N'String', N'admin@mysite.com', 7)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_CHECK_WEBSITE', N'MAIL_SUBJECT', N'String', N'Web Site is unavailable', 9)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_CHECK_WEBSITE', N'MAIL_TO', N'String', N'admin@mysite.com', 8)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_CHECK_WEBSITE', N'PASSWORD', N'String', NULL, 3)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_CHECK_WEBSITE', N'RESPONSE_CONTAIN', N'String', NULL, 5)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_CHECK_WEBSITE', N'RESPONSE_DOESNT_CONTAIN', N'String', NULL, 6)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_CHECK_WEBSITE', N'RESPONSE_STATUS', N'String', N'500', 4)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_CHECK_WEBSITE', N'URL', N'String', N'http://', 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_CHECK_WEBSITE', N'USE_RESPONSE_CONTAIN', N'Boolean', N'false', 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_CHECK_WEBSITE', N'USE_RESPONSE_DOESNT_CONTAIN', N'Boolean', N'false', 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_CHECK_WEBSITE', N'USE_RESPONSE_STATUS', N'Boolean', N'false', 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_CHECK_WEBSITE', N'USERNAME', N'String', NULL, 2)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_FTP_FILES', N'FILE_PATH', N'String', N'\', 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_FTP_FILES', N'FTP_FOLDER', N'String', NULL, 5)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_FTP_FILES', N'FTP_PASSWORD', N'String', NULL, 4)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_FTP_FILES', N'FTP_SERVER', N'String', N'ftp.myserver.com', 2)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_FTP_FILES', N'FTP_USERNAME', N'String', NULL, 3)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_HOSTED_SOLUTION_REPORT', N'CRM_REPORT', N'Boolean', N'true', 6)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_HOSTED_SOLUTION_REPORT', N'EMAIL', N'String', NULL, 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_HOSTED_SOLUTION_REPORT', N'EXCHANGE_REPORT', N'Boolean', N'true', 2)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_HOSTED_SOLUTION_REPORT', N'LYNC_REPORT', N'Boolean', N'true', 4)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_HOSTED_SOLUTION_REPORT', N'SFB_REPORT', N'Boolean', N'true', 5)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_HOSTED_SOLUTION_REPORT', N'ORGANIZATION_REPORT', N'Boolean', N'true', 7)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_HOSTED_SOLUTION_REPORT', N'SHAREPOINT_REPORT', N'Boolean', N'true', 3)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_NOTIFY_OVERUSED_DATABASES', N'MSSQL_OVERUSED', N'Boolean', N'true', 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_NOTIFY_OVERUSED_DATABASES', N'MYSQL_OVERUSED', N'Boolean', N'true', 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_NOTIFY_OVERUSED_DATABASES', N'MARIADB_OVERUSED', N'Boolean', N'true', 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_NOTIFY_OVERUSED_DATABASES', N'OVERUSED_MAIL_BCC', N'String', N'', 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_NOTIFY_OVERUSED_DATABASES', N'OVERUSED_MAIL_BODY', N'String', N'', 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_NOTIFY_OVERUSED_DATABASES', N'OVERUSED_MAIL_FROM', N'String', N'', 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_NOTIFY_OVERUSED_DATABASES', N'OVERUSED_MAIL_SUBJECT', N'String', N'', 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_NOTIFY_OVERUSED_DATABASES', N'OVERUSED_USAGE_THRESHOLD', N'String', N'100', 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_NOTIFY_OVERUSED_DATABASES', N'SEND_OVERUSED_EMAIL', N'Boolean', N'true', 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_NOTIFY_OVERUSED_DATABASES', N'SEND_WARNING_EMAIL', N'Boolean', N'true', 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_NOTIFY_OVERUSED_DATABASES', N'WARNING_MAIL_BCC', N'String', N'', 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_NOTIFY_OVERUSED_DATABASES', N'WARNING_MAIL_BODY', N'String', N'', 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_NOTIFY_OVERUSED_DATABASES', N'WARNING_MAIL_FROM', N'String', N'', 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_NOTIFY_OVERUSED_DATABASES', N'WARNING_MAIL_SUBJECT', N'String', N'', 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_NOTIFY_OVERUSED_DATABASES', N'WARNING_USAGE_THRESHOLD', N'String', N'80', 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_RUN_SYSTEM_COMMAND', N'EXECUTABLE_PARAMS', N'String', N'', 3)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_RUN_SYSTEM_COMMAND', N'EXECUTABLE_PATH', N'String', N'Executable.exe', 2)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_RUN_SYSTEM_COMMAND', N'SERVER_NAME', N'String', NULL, 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_SEND_MAIL', N'MAIL_BODY', N'MultiString', NULL, 4)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_SEND_MAIL', N'MAIL_FROM', N'String', NULL, 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_SEND_MAIL', N'MAIL_SUBJECT', N'String', NULL, 3)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_SEND_MAIL', N'MAIL_TO', N'String', NULL, 2)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_SUSPEND_PACKAGES', N'BANDWIDTH_OVERUSED', N'Boolean', N'true', 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_SUSPEND_PACKAGES', N'DISKSPACE_OVERUSED', N'Boolean', N'true', 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_SUSPEND_PACKAGES', N'SEND_SUSPENSION_EMAIL', N'Boolean', N'true', 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_SUSPEND_PACKAGES', N'SEND_WARNING_EMAIL', N'Boolean', N'true', 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_SUSPEND_PACKAGES', N'SUSPEND_OVERUSED', N'Boolean', N'true', 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_SUSPEND_PACKAGES', N'SUSPENSION_MAIL_BCC', N'String', NULL, 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_SUSPEND_PACKAGES', N'SUSPENSION_MAIL_BODY', N'String', NULL, 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_SUSPEND_PACKAGES', N'SUSPENSION_MAIL_FROM', N'String', NULL, 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_SUSPEND_PACKAGES', N'SUSPENSION_MAIL_SUBJECT', N'String', NULL, 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_SUSPEND_PACKAGES', N'SUSPENSION_USAGE_THRESHOLD', N'String', N'100', 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_SUSPEND_PACKAGES', N'WARNING_MAIL_BCC', N'String', NULL, 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_SUSPEND_PACKAGES', N'WARNING_MAIL_BODY', N'String', NULL, 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_SUSPEND_PACKAGES', N'WARNING_MAIL_FROM', N'String', NULL, 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_SUSPEND_PACKAGES', N'WARNING_MAIL_SUBJECT', N'String', NULL, 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_SUSPEND_PACKAGES', N'WARNING_USAGE_THRESHOLD', N'String', N'80', 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_ZIP_FILES', N'FOLDER', N'String', NULL, 1)
GO
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_ZIP_FILES', N'ZIP_FILE', N'String', N'\archive.zip', 2)
GO
INSERT [dbo].[ScheduleTasks] ([TaskID], [TaskType], [RoleID]) VALUES (N'SCHEDULE_TASK_ACTIVATE_PAID_INVOICES', N'SolidCP.Ecommerce.EnterpriseServer.ActivatePaidInvoicesTask, SolidCP.EnterpriseServer', 0)
GO
INSERT [dbo].[ScheduleTasks] ([TaskID], [TaskType], [RoleID]) VALUES (N'SCHEDULE_TASK_BACKUP', N'SolidCP.EnterpriseServer.BackupTask, SolidCP.EnterpriseServer', 1)
GO
INSERT [dbo].[ScheduleTasks] ([TaskID], [TaskType], [RoleID]) VALUES (N'SCHEDULE_TASK_BACKUP_DATABASE', N'SolidCP.EnterpriseServer.BackupDatabaseTask, SolidCP.EnterpriseServer', 3)
GO
INSERT [dbo].[ScheduleTasks] ([TaskID], [TaskType], [RoleID]) VALUES (N'SCHEDULE_TASK_CALCULATE_EXCHANGE_DISKSPACE', N'SolidCP.EnterpriseServer.CalculateExchangeDiskspaceTask, SolidCP.EnterpriseServer', 2)
GO
INSERT [dbo].[ScheduleTasks] ([TaskID], [TaskType], [RoleID]) VALUES (N'SCHEDULE_TASK_CALCULATE_PACKAGES_BANDWIDTH', N'SolidCP.EnterpriseServer.CalculatePackagesBandwidthTask, SolidCP.EnterpriseServer', 1)
GO
INSERT [dbo].[ScheduleTasks] ([TaskID], [TaskType], [RoleID]) VALUES (N'SCHEDULE_TASK_CALCULATE_PACKAGES_DISKSPACE', N'SolidCP.EnterpriseServer.CalculatePackagesDiskspaceTask, SolidCP.EnterpriseServer', 1)
GO
INSERT [dbo].[ScheduleTasks] ([TaskID], [TaskType], [RoleID]) VALUES (N'SCHEDULE_TASK_CANCEL_OVERDUE_INVOICES', N'SolidCP.Ecommerce.EnterpriseServer.CancelOverdueInvoicesTask, SolidCP.EnterpriseServer', 0)
GO
INSERT [dbo].[ScheduleTasks] ([TaskID], [TaskType], [RoleID]) VALUES (N'SCHEDULE_TASK_CHECK_WEBSITE', N'SolidCP.EnterpriseServer.CheckWebSiteTask, SolidCP.EnterpriseServer', 3)
GO
INSERT [dbo].[ScheduleTasks] ([TaskID], [TaskType], [RoleID]) VALUES (N'SCHEDULE_TASK_FTP_FILES', N'SolidCP.EnterpriseServer.FTPFilesTask, SolidCP.EnterpriseServer', 3)
GO
INSERT [dbo].[ScheduleTasks] ([TaskID], [TaskType], [RoleID]) VALUES (N'SCHEDULE_TASK_GENERATE_INVOICES', N'SolidCP.Ecommerce.EnterpriseServer.GenerateInvoicesTask, SolidCP.EnterpriseServer', 0)
GO
INSERT [dbo].[ScheduleTasks] ([TaskID], [TaskType], [RoleID]) VALUES (N'SCHEDULE_TASK_HOSTED_SOLUTION_REPORT', N'SolidCP.EnterpriseServer.HostedSolutionReportTask, SolidCP.EnterpriseServer', 2)
GO
INSERT [dbo].[ScheduleTasks] ([TaskID], [TaskType], [RoleID]) VALUES (N'SCHEDULE_TASK_NOTIFY_OVERUSED_DATABASES', N'SolidCP.EnterpriseServer.NotifyOverusedDatabasesTask, SolidCP.EnterpriseServer', 2)
GO
INSERT [dbo].[ScheduleTasks] ([TaskID], [TaskType], [RoleID]) VALUES (N'SCHEDULE_TASK_RUN_PAYMENT_QUEUE', N'SolidCP.Ecommerce.EnterpriseServer.RunPaymentQueueTask, SolidCP.EnterpriseServer', 0)
GO
INSERT [dbo].[ScheduleTasks] ([TaskID], [TaskType], [RoleID]) VALUES (N'SCHEDULE_TASK_RUN_SYSTEM_COMMAND', N'SolidCP.EnterpriseServer.RunSystemCommandTask, SolidCP.EnterpriseServer', 1)
GO
INSERT [dbo].[ScheduleTasks] ([TaskID], [TaskType], [RoleID]) VALUES (N'SCHEDULE_TASK_SEND_MAIL', N'SolidCP.EnterpriseServer.SendMailNotificationTask, SolidCP.EnterpriseServer', 3)
GO
INSERT [dbo].[ScheduleTasks] ([TaskID], [TaskType], [RoleID]) VALUES (N'SCHEDULE_TASK_SUSPEND_OVERDUE_INVOICES', N'SolidCP.Ecommerce.EnterpriseServer.SuspendOverdueInvoicesTask, SolidCP.EnterpriseServer', 0)
GO
INSERT [dbo].[ScheduleTasks] ([TaskID], [TaskType], [RoleID]) VALUES (N'SCHEDULE_TASK_SUSPEND_PACKAGES', N'SolidCP.EnterpriseServer.SuspendOverusedPackagesTask, SolidCP.EnterpriseServer', 2)
GO
INSERT [dbo].[ScheduleTasks] ([TaskID], [TaskType], [RoleID]) VALUES (N'SCHEDULE_TASK_ZIP_FILES', N'SolidCP.EnterpriseServer.ZipFilesTask, SolidCP.EnterpriseServer', 3)
GO
INSERT [dbo].[ScheduleTaskViewConfiguration] ([TaskID], [ConfigurationID], [Environment], [Description]) VALUES (N'SCHEDULE_TASK_ACTIVATE_PAID_INVOICES', N'ASP_NET', N'ASP.NET', N'~/DesktopModules/SolidCP/ScheduleTaskControls/EmptyView.ascx')
GO
INSERT [dbo].[ScheduleTaskViewConfiguration] ([TaskID], [ConfigurationID], [Environment], [Description]) VALUES (N'SCHEDULE_TASK_BACKUP', N'ASP_NET', N'ASP.NET', N'~/DesktopModules/SolidCP/ScheduleTaskControls/Backup.ascx')
GO
INSERT [dbo].[ScheduleTaskViewConfiguration] ([TaskID], [ConfigurationID], [Environment], [Description]) VALUES (N'SCHEDULE_TASK_BACKUP_DATABASE', N'ASP_NET', N'ASP.NET', N'~/DesktopModules/SolidCP/ScheduleTaskControls/BackupDatabase.ascx')
GO
INSERT [dbo].[ScheduleTaskViewConfiguration] ([TaskID], [ConfigurationID], [Environment], [Description]) VALUES (N'SCHEDULE_TASK_CALCULATE_EXCHANGE_DISKSPACE', N'ASP_NET', N'ASP.NET', N'~/DesktopModules/SolidCP/ScheduleTaskControls/EmptyView.ascx')
GO
INSERT [dbo].[ScheduleTaskViewConfiguration] ([TaskID], [ConfigurationID], [Environment], [Description]) VALUES (N'SCHEDULE_TASK_CALCULATE_PACKAGES_BANDWIDTH', N'ASP_NET', N'ASP.NET', N'~/DesktopModules/SolidCP/ScheduleTaskControls/EmptyView.ascx')
GO
INSERT [dbo].[ScheduleTaskViewConfiguration] ([TaskID], [ConfigurationID], [Environment], [Description]) VALUES (N'SCHEDULE_TASK_CALCULATE_PACKAGES_DISKSPACE', N'ASP_NET', N'ASP.NET', N'~/DesktopModules/SolidCP/ScheduleTaskControls/EmptyView.ascx')
GO
INSERT [dbo].[ScheduleTaskViewConfiguration] ([TaskID], [ConfigurationID], [Environment], [Description]) VALUES (N'SCHEDULE_TASK_CANCEL_OVERDUE_INVOICES', N'ASP_NET', N'ASP.NET', N'~/DesktopModules/SolidCP/ScheduleTaskControls/EmptyView.ascx')
GO
INSERT [dbo].[ScheduleTaskViewConfiguration] ([TaskID], [ConfigurationID], [Environment], [Description]) VALUES (N'SCHEDULE_TASK_CHECK_WEBSITE', N'ASP_NET', N'ASP.NET', N'~/DesktopModules/SolidCP/ScheduleTaskControls/CheckWebsite.ascx')
GO
INSERT [dbo].[ScheduleTaskViewConfiguration] ([TaskID], [ConfigurationID], [Environment], [Description]) VALUES (N'SCHEDULE_TASK_FTP_FILES', N'ASP_NET', N'ASP.NET', N'~/DesktopModules/SolidCP/ScheduleTaskControls/SendFilesViaFtp.ascx')
GO
INSERT [dbo].[ScheduleTaskViewConfiguration] ([TaskID], [ConfigurationID], [Environment], [Description]) VALUES (N'SCHEDULE_TASK_GENERATE_INVOICES', N'ASP_NET', N'ASP.NET', N'~/DesktopModules/SolidCP/ScheduleTaskControls/EmptyView.ascx')
GO
INSERT [dbo].[ScheduleTaskViewConfiguration] ([TaskID], [ConfigurationID], [Environment], [Description]) VALUES (N'SCHEDULE_TASK_HOSTED_SOLUTION_REPORT', N'ASP_NET', N'ASP.NET', N'~/DesktopModules/SolidCP/ScheduleTaskControls/HostedSolutionReport.ascx')
GO
INSERT [dbo].[ScheduleTaskViewConfiguration] ([TaskID], [ConfigurationID], [Environment], [Description]) VALUES (N'SCHEDULE_TASK_NOTIFY_OVERUSED_DATABASES', N'ASP_NET', N'ASP.NET', N'~/DesktopModules/SolidCP/ScheduleTaskControls/NotifyOverusedDatabases.ascx')
GO
INSERT [dbo].[ScheduleTaskViewConfiguration] ([TaskID], [ConfigurationID], [Environment], [Description]) VALUES (N'SCHEDULE_TASK_RUN_PAYMENT_QUEUE', N'ASP_NET', N'ASP.NET', N'~/DesktopModules/SolidCP/ScheduleTaskControls/EmptyView.ascx')
GO
INSERT [dbo].[ScheduleTaskViewConfiguration] ([TaskID], [ConfigurationID], [Environment], [Description]) VALUES (N'SCHEDULE_TASK_RUN_SYSTEM_COMMAND', N'ASP_NET', N'ASP.NET', N'~/DesktopModules/SolidCP/ScheduleTaskControls/ExecuteSystemCommand.ascx')
GO
INSERT [dbo].[ScheduleTaskViewConfiguration] ([TaskID], [ConfigurationID], [Environment], [Description]) VALUES (N'SCHEDULE_TASK_SEND_MAIL', N'ASP_NET', N'ASP.NET', N'~/DesktopModules/SolidCP/ScheduleTaskControls/SendEmailNotification.ascx')
GO
INSERT [dbo].[ScheduleTaskViewConfiguration] ([TaskID], [ConfigurationID], [Environment], [Description]) VALUES (N'SCHEDULE_TASK_SUSPEND_OVERDUE_INVOICES', N'ASP_NET', N'ASP.NET', N'~/DesktopModules/SolidCP/ScheduleTaskControls/EmptyView.ascx')
GO
INSERT [dbo].[ScheduleTaskViewConfiguration] ([TaskID], [ConfigurationID], [Environment], [Description]) VALUES (N'SCHEDULE_TASK_SUSPEND_PACKAGES', N'ASP_NET', N'ASP.NET', N'~/DesktopModules/SolidCP/ScheduleTaskControls/SuspendOverusedSpaces.ascx')
GO
INSERT [dbo].[ScheduleTaskViewConfiguration] ([TaskID], [ConfigurationID], [Environment], [Description]) VALUES (N'SCHEDULE_TASK_ZIP_FILES', N'ASP_NET', N'ASP.NET', N'~/DesktopModules/SolidCP/ScheduleTaskControls/ZipFiles.ascx')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (1, N'UsersHome', N'%SYSTEMDRIVE%\HostingSpaces')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (2, N'AspNet11Path', N'%SYSTEMROOT%\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (2, N'AspNet11Pool', N'ASP.NET V1.1')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (2, N'AspNet20Path', N'%SYSTEMROOT%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (2, N'AspNet20Pool', N'ASP.NET V2.0')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (2, N'AspNet40Path', N'%SYSTEMROOT%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (2, N'AspNet40Pool', N'ASP.NET V4.0')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (2, N'AspPath', N'%SYSTEMROOT%\System32\InetSrv\asp.dll')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (2, N'CFFlashRemotingDirectory', N'C:\ColdFusion9\runtime\lib\wsconfig\1')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (2, N'CFScriptsDirectory', N'C:\Inetpub\wwwroot\CFIDE')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (2, N'ColdFusionPath', N'C:\ColdFusion9\runtime\lib\wsconfig\jrun_iis6.dll')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (2, N'GalleryXmlFeedUrl', N'')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (2, N'PerlPath', N'%SYSTEMDRIVE%\Perl\bin\Perl.exe')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (2, N'Php4Path', N'%PROGRAMFILES%\PHP\php.exe')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (2, N'Php5Path', N'%PROGRAMFILES%\PHP\php-cgi.exe')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (2, N'ProtectedAccessFile', N'.htaccess')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (2, N'ProtectedFoldersFile', N'.htfolders')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (2, N'ProtectedGroupsFile', N'.htgroup')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (2, N'ProtectedUsersFile', N'.htpasswd')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (2, N'PythonPath', N'%SYSTEMDRIVE%\Python\python.exe')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (2, N'SecuredFoldersFilterPath', N'%SYSTEMROOT%\System32\InetSrv\IISPasswordFilter.dll')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (2, N'WebGroupName', N'SCPWebUsers')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (3, N'FtpGroupName', N'SCPFtpUsers')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (3, N'SiteId', N'MSFTPSVC/1')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (5, N'DatabaseLocation', N'%SYSTEMDRIVE%\SQL2000Databases\[USER_NAME]')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (5, N'ExternalAddress', N'(local)')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (5, N'InternalAddress', N'(local)')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (5, N'SaLogin', N'sa')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (5, N'SaPassword', N'')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (5, N'UseDefaultDatabaseLocation', N'True')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (5, N'UseTrustedConnection', N'True')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (6, N'ExternalAddress', N'localhost')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (6, N'InstallFolder', N'%PROGRAMFILES%\MySQL\MySQL Server 4.1')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (6, N'InternalAddress', N'localhost,3306')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (6, N'RootLogin', N'root')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (6, N'RootPassword', N'')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (7, N'ExpireLimit', N'1209600')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (7, N'MinimumTTL', N'86400')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (7, N'NameServers', N'ns1.yourdomain.com;ns2.yourdomain.com')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (7, N'RefreshInterval', N'3600')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (7, N'ResponsiblePerson', N'hostmaster.[DOMAIN_NAME]')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (7, N'RetryDelay', N'600')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (8, N'AwStatsFolder', N'%SYSTEMDRIVE%\AWStats\wwwroot\cgi-bin')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (8, N'BatchFileName', N'UpdateStats.bat')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (8, N'BatchLineTemplate', N'%SYSTEMDRIVE%\perl\bin\perl.exe awstats.pl config=[DOMAIN_NAME] -update')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (8, N'ConfigFileName', N'awstats.[DOMAIN_NAME].conf')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (8, N'ConfigFileTemplate', N'LogFormat = "%time2 %other %other %other %method %url %other %other %logname %host %other %ua %other %referer %other %code %other %other %bytesd %other %other"
LogSeparator = " "
DNSLookup = 2
DirCgi = "/cgi-bin"
DirIcons = "/icon"
AllowFullYearView=3
AllowToUpdateStatsFromBrowser = 0
UseFramesWhenCGI = 1
ShowFlagLinks = "en fr de it nl es"
LogFile = "[LOGS_FOLDER]\ex%YY-3%MM-3%DD-3.log"
DirData = "%SYSTEMDRIVE%\AWStats\data"
SiteDomain = "[DOMAIN_NAME]"
HostAliases = [DOMAIN_ALIASES]')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (8, N'StatisticsURL', N'http://127.0.0.1/AWStats/cgi-bin/awstats.pl?config=[domain_name]')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (9, N'AdminLogin', N'Admin')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (9, N'ExpireLimit', N'1209600')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (9, N'MinimumTTL', N'86400')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (9, N'NameServers', N'ns1.yourdomain.com;ns2.yourdomain.com')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (9, N'RefreshInterval', N'3600')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (9, N'ResponsiblePerson', N'hostmaster.[DOMAIN_NAME]')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (9, N'RetryDelay', N'600')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (9, N'SimpleDnsUrl', N'http://127.0.0.1:8053')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (10, N'LogDeleteDays', N'0')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (10, N'LogFormat', N'W3Cex')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (10, N'LogWildcard', N'*.log')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (10, N'Password', N'')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (10, N'ServerID', N'1')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (10, N'SmarterLogDeleteMonths', N'0')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (10, N'SmarterLogsPath', N'%SYSTEMDRIVE%\SmarterLogs')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (10, N'SmarterUrl', N'http://127.0.0.1:9999/services')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (10, N'StatisticsURL', N'http://127.0.0.1:9999/Login.aspx?txtSiteID=[site_id]&txtUser=[username]&txtPass=[password]&shortcutLink=autologin')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (10, N'TimeZoneId', N'27')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (10, N'Username', N'Admin')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (11, N'AdminPassword', N'')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (11, N'AdminUsername', N'admin')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (11, N'DomainsPath', N'%SYSTEMDRIVE%\SmarterMail')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (11, N'ServerIPAddress', N'127.0.0.1;127.0.0.1')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (11, N'ServiceUrl', N'http://127.0.0.1:9998/services')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (12, N'InstallFolder', N'%PROGRAMFILES%\Gene6 FTP Server')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (12, N'LogsFolder', N'%PROGRAMFILES%\Gene6 FTP Server\Log')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (14, N'AdminPassword', N'')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (14, N'AdminUsername', N'admin')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (14, N'DomainsPath', N'%SYSTEMDRIVE%\SmarterMail')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (14, N'ServerIPAddress', N'127.0.0.1;127.0.0.1')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (14, N'ServiceUrl', N'http://127.0.0.1:9998/services')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (16, N'BrowseMethod', N'POST')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (16, N'BrowseParameters', N'ServerName=[SERVER]
Login=[USER]
Password=[PASSWORD]
Protocol=dbmssocn')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (16, N'BrowseURL', N'http://localhost/MLA/silentlogon.aspx')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (16, N'DatabaseLocation', N'%SYSTEMDRIVE%\SQL2005Databases\[USER_NAME]')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (16, N'ExternalAddress', N'(local)')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (16, N'InternalAddress', N'(local)')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (16, N'SaLogin', N'sa')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (16, N'SaPassword', N'')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (16, N'UseDefaultDatabaseLocation', N'True')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (16, N'UseTrustedConnection', N'True')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (17, N'ExternalAddress', N'localhost')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (17, N'InstallFolder', N'%PROGRAMFILES%\MySQL\MySQL Server 5.0')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (17, N'InternalAddress', N'localhost,3306')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (17, N'RootLogin', N'root')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (17, N'RootPassword', N'')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (22, N'AdminPassword', N'')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (22, N'AdminUsername', N'Administrator')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (24, N'BindConfigPath', N'c:\BIND\dns\etc\named.conf')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (24, N'BindReloadBatch', N'c:\BIND\dns\reload.bat')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (24, N'ExpireLimit', N'1209600')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (24, N'MinimumTTL', N'86400')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (24, N'NameServers', N'ns1.yourdomain.com;ns2.yourdomain.com')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (24, N'RefreshInterval', N'3600')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (24, N'ResponsiblePerson', N'hostmaster.[DOMAIN_NAME]')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (24, N'RetryDelay', N'600')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (24, N'ZoneFileNameTemplate', N'db.[domain_name].txt')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (24, N'ZonesFolderPath', N'c:\BIND\dns\zones')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (25, N'DomainId', N'1')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (27, N'KeepDeletedItemsDays', N'14')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (27, N'KeepDeletedMailboxesDays', N'30')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (27, N'MailboxDatabase', N'Hosted Exchange Database')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (27, N'RootOU', N'SCP Hosting')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (27, N'StorageGroup', N'Hosted Exchange Storage Group')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (27, N'TempDomain', N'my-temp-domain.com')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (28, N'AdminLogin', N'Admin')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (28, N'ExpireLimit', N'1209600')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (28, N'MinimumTTL', N'86400')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (28, N'NameServers', N'ns1.yourdomain.com;ns2.yourdomain.com')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (28, N'RefreshInterval', N'3600')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (28, N'ResponsiblePerson', N'hostmaster.[DOMAIN_NAME]')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (28, N'RetryDelay', N'600')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (28, N'SimpleDnsUrl', N'http://127.0.0.1:8053')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (29, N'AdminPassword', N' ')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (29, N'AdminUsername', N'admin')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (29, N'DomainsPath', N'%SYSTEMDRIVE%\SmarterMail')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (29, N'ServerIPAddress', N'127.0.0.1;127.0.0.1')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (29, N'ServiceUrl', N'http://localhost:9998/services/')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (30, N'ExternalAddress', N'localhost')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (30, N'InstallFolder', N'%PROGRAMFILES%\MySQL\MySQL Server 5.1')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (30, N'InternalAddress', N'localhost,3306')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (30, N'RootLogin', N'root')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (30, N'RootPassword', N'')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (31, N'LogDeleteDays', N'0')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (31, N'LogFormat', N'W3Cex')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (31, N'LogWildcard', N'*.log')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (31, N'Password', N'')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (31, N'ServerID', N'1')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (31, N'SmarterLogDeleteMonths', N'0')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (31, N'SmarterLogsPath', N'%SYSTEMDRIVE%\SmarterLogs')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (31, N'SmarterUrl', N'http://127.0.0.1:9999/services')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (31, N'StatisticsURL', N'http://127.0.0.1:9999/Login.aspx?txtSiteID=[site_id]&txtUser=[username]&txtPass=[password]&shortcutLink=autologin')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (31, N'TimeZoneId', N'27')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (31, N'Username', N'Admin')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (32, N'KeepDeletedItemsDays', N'14')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (32, N'KeepDeletedMailboxesDays', N'30')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (32, N'MailboxDatabase', N'Hosted Exchange Database')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (32, N'RootOU', N'SCP Hosting')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (32, N'TempDomain', N'my-temp-domain.com')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (56, N'ExpireLimit', N'1209600')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (56, N'MinimumTTL', N'86400')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (56, N'NameServers', N'ns1.yourdomain.com;ns2.yourdomain.com')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (56, N'PDNSDbName', N'pdnsdb')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (56, N'PDNSDbPort', N'3306')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (56, N'PDNSDbServer', N'localhost')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (56, N'PDNSDbUser', N'root')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (56, N'RefreshInterval', N'3600')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (56, N'ResponsiblePerson', N'hostmaster.[DOMAIN_NAME]')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (56, N'RetryDelay', N'600')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (60, N'AdminPassword', N' ')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (60, N'AdminUsername', N'admin')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (60, N'DomainsPath', N'%SYSTEMDRIVE%\SmarterMail')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (60, N'ServerIPAddress', N'127.0.0.1;127.0.0.1')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (60, N'ServiceUrl', N'http://localhost:9998/services/')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (62, N'LogDeleteDays', N'0')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (62, N'LogFormat', N'W3Cex')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (62, N'LogWildcard', N'*.log')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (62, N'Password', N'')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (62, N'ServerID', N'1')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (62, N'SmarterLogDeleteMonths', N'0')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (62, N'SmarterLogsPath', N'%SYSTEMDRIVE%\SmarterLogs')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (62, N'SmarterUrl', N'http://127.0.0.1:9999/services')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (62, N'StatisticsURL', N'http://127.0.0.1:9999/Login.aspx?txtSiteID=[site_id]&txtUser=[username]&txtPass=[password]&shortcutLink=autologin')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (62, N'TimeZoneId', N'27')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (62, N'Username', N'Admin')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (63, N'AdminPassword', N'')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (63, N'AdminUsername', N'Administrator')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (64, N'AdminPassword', N'')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (64, N'AdminUsername', N'admin')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (64, N'DomainsPath', N'%SYSTEMDRIVE%\SmarterMail')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (64, N'ServerIPAddress', N'127.0.0.1;127.0.0.1')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (64, N'ServiceUrl', N'http://localhost:9998/services/')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (65, N'AdminPassword', N'')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (65, N'AdminUsername', N'admin')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (65, N'DomainsPath', N'%SYSTEMDRIVE%\SmarterMail')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (65, N'ServerIPAddress', N'127.0.0.1;127.0.0.1')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (65, N'ServiceUrl', N'http://localhost:9998/services/')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (66, N'AdminPassword', N'')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (66, N'AdminUsername', N'admin')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (66, N'DomainsPath', N'%SYSTEMDRIVE%\SmarterMail')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (66, N'ServerIPAddress', N'127.0.0.1;127.0.0.1')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (66, N'ServiceUrl', N'http://localhost:9998/services/')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (100, N'UsersHome', N'%SYSTEMDRIVE%\HostingSpaces')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (101, N'AspNet11Pool', N'ASP.NET 1.1')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (101, N'AspNet40Path', N'%WINDIR%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (101, N'AspNet40x64Path', N'%WINDIR%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (101, N'AspNetBitnessMode', N'32')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (101, N'CFFlashRemotingDirectory', N'C:\ColdFusion9\runtime\lib\wsconfig\1')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (101, N'CFScriptsDirectory', N'C:\Inetpub\wwwroot\CFIDE')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (101, N'ClassicAspNet20Pool', N'ASP.NET 2.0 (Classic)')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (101, N'ClassicAspNet40Pool', N'ASP.NET 4.0 (Classic)')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (101, N'ColdFusionPath', N'C:\ColdFusion9\runtime\lib\wsconfig\jrun_iis6.dll')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (101, N'GalleryXmlFeedUrl', N'')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (101, N'IntegratedAspNet20Pool', N'ASP.NET 2.0 (Integrated)')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (101, N'IntegratedAspNet40Pool', N'ASP.NET 4.0 (Integrated)')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (101, N'PerlPath', N'%SYSTEMDRIVE%\Perl\bin\PerlEx30.dll')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (101, N'Php4Path', N'%PROGRAMFILES(x86)%\PHP\php.exe')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (101, N'PhpMode', N'FastCGI')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (101, N'PhpPath', N'%PROGRAMFILES(x86)%\PHP\php-cgi.exe')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (101, N'ProtectedGroupsFile', N'.htgroup')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (101, N'ProtectedUsersFile', N'.htpasswd')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (101, N'SecureFoldersModuleAssembly', N'SolidCP.IIsModules.SecureFolders, SolidCP.IIsModules, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=37f9c58a0aa32ff0')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (101, N'WebGroupName', N'SCP_IUSRS')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (101, N'WmSvc.CredentialsMode', N'WINDOWS')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (101, N'WmSvc.Port', N'8172')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (102, N'FtpGroupName', N'SCPFtpUsers')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (102, N'SiteId', N'Default FTP Site')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (104, N'UsersHome', N'%SYSTEMDRIVE%\HostingSpaces')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (105, N'AspNet11Pool', N'ASP.NET 1.1')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (105, N'AspNet40Path', N'%WINDIR%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (105, N'AspNet40x64Path', N'%WINDIR%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (105, N'AspNetBitnessMode', N'32')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (105, N'CFFlashRemotingDirectory', N'C:\ColdFusion9\runtime\lib\wsconfig\1')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (105, N'CFScriptsDirectory', N'C:\Inetpub\wwwroot\CFIDE')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (105, N'ClassicAspNet20Pool', N'ASP.NET 2.0 (Classic)')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (105, N'ClassicAspNet40Pool', N'ASP.NET 4.0 (Classic)')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (105, N'ColdFusionPath', N'C:\ColdFusion9\runtime\lib\wsconfig\jrun_iis6.dll')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (105, N'GalleryXmlFeedUrl', N'')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (105, N'IntegratedAspNet20Pool', N'ASP.NET 2.0 (Integrated)')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (105, N'IntegratedAspNet40Pool', N'ASP.NET 4.0 (Integrated)')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (105, N'PerlPath', N'%SYSTEMDRIVE%\Perl\bin\PerlEx30.dll')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (105, N'Php4Path', N'%PROGRAMFILES(x86)%\PHP\php.exe')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (105, N'PhpMode', N'FastCGI')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (105, N'PhpPath', N'%PROGRAMFILES(x86)%\PHP\php-cgi.exe')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (105, N'ProtectedGroupsFile', N'.htgroup')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (105, N'ProtectedUsersFile', N'.htpasswd')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (105, N'SecureFoldersModuleAssembly', N'SolidCP.IIsModules.SecureFolders, SolidCP.IIsModules, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=37f9c58a0aa32ff0')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (105, N'WebGroupName', N'SCP_IUSRS')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (105, N'WmSvc.CredentialsMode', N'WINDOWS')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (105, N'WmSvc.Port', N'8172')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (106, N'FtpGroupName', N'SCPFtpUsers')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (106, N'SiteId', N'Default FTP Site')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (106, N'sslusesni', N'False')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (111, N'UsersHome', N'%SYSTEMDRIVE%\HostingSpaces')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (112, N'AspNet11Pool', N'ASP.NET 1.1')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (112, N'AspNet40Path', N'%WINDIR%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (112, N'AspNet40x64Path', N'%WINDIR%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (112, N'AspNetBitnessMode', N'32')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (112, N'CFFlashRemotingDirectory', N'C:\ColdFusion9\runtime\lib\wsconfig\1')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (112, N'CFScriptsDirectory', N'C:\Inetpub\wwwroot\CFIDE')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (112, N'ClassicAspNet20Pool', N'ASP.NET 2.0 (Classic)')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (112, N'ClassicAspNet40Pool', N'ASP.NET 4.0 (Classic)')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (112, N'ColdFusionPath', N'C:\ColdFusion9\runtime\lib\wsconfig\jrun_iis6.dll')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (112, N'GalleryXmlFeedUrl', N'')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (112, N'IntegratedAspNet20Pool', N'ASP.NET 2.0 (Integrated)')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (112, N'IntegratedAspNet40Pool', N'ASP.NET 4.0 (Integrated)')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (112, N'PerlPath', N'%SYSTEMDRIVE%\Perl\bin\PerlEx30.dll')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (112, N'Php4Path', N'%PROGRAMFILES(x86)%\PHP\php.exe')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (112, N'PhpMode', N'FastCGI')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (112, N'PhpPath', N'%PROGRAMFILES(x86)%\PHP\php-cgi.exe')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (112, N'ProtectedGroupsFile', N'.htgroup')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (112, N'ProtectedUsersFile', N'.htpasswd')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (112, N'SecureFoldersModuleAssembly', N'SolidCP.IIsModules.SecureFolders, SolidCP.IIsModules, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=37f9c58a0aa32ff0')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (112, N'WebGroupName', N'SCP_IUSRS')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (112, N'WmSvc.CredentialsMode', N'WINDOWS')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (112, N'WmSvc.Port', N'8172')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (113, N'FtpGroupName', N'SCPFtpUsers')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (113, N'SiteId', N'Default FTP Site')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (113, N'sslusesni', N'False')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (200, N'RootWebApplicationIpAddress', N'')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (204, N'UserName', N'admin')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (204, N'UtilityPath', N'C:\Program Files\Research In Motion\BlackBerry Enterprise Server Resource Kit\BlackBerry Enterprise Server User Administration Tool')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (300, N'CpuLimit', N'100')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (300, N'CpuReserve', N'0')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (300, N'CpuWeight', N'100')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (300, N'DvdLibraryPath', N'C:\Hyper-V\Library')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (300, N'ExportedVpsPath', N'C:\Hyper-V\Exported')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (300, N'HostnamePattern', N'vps[user_id].hosterdomain.com')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (300, N'OsTemplatesPath', N'C:\Hyper-V\Templates')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (300, N'PrivateNetworkFormat', N'192.168.0.1/16')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (300, N'RootFolder', N'C:\Hyper-V\VirtualMachines\[VPS_HOSTNAME]')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (300, N'StartAction', N'start')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (300, N'StartupDelay', N'0')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (300, N'StopAction', N'shutDown')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (300, N'VirtualDiskType', N'dynamic')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (301, N'ExternalAddress', N'localhost')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (301, N'InstallFolder', N'%PROGRAMFILES%\MySQL\MySQL Server 5.5')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (301, N'InternalAddress', N'localhost,3306')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (301, N'RootLogin', N'root')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (301, N'RootPassword', N'')
GO
INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (1, 9, N'SharePointUser', N'SolidCP.Providers.OS.SystemUser, SolidCP.Providers.Base', 19, 0, 0, 1, 1, 1, 1, 1)
GO
INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (2, 1, N'HomeFolder', N'SolidCP.Providers.OS.HomeFolder, SolidCP.Providers.Base', 15, 1, 0, 0, 1, 0, 0, 1)
GO
INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (3, 9, N'SharePointGroup', N'SolidCP.Providers.OS.SystemGroup, SolidCP.Providers.Base', 20, 0, 0, 0, 1, 1, 1, 1)
GO
INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (5, 5, N'MsSQL2000Database', N'SolidCP.Providers.Database.SqlDatabase, SolidCP.Providers.Base', 9, 1, 0, 0, 1, 1, 1, 1)
GO
INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (6, 5, N'MsSQL2000User', N'SolidCP.Providers.Database.SqlUser, SolidCP.Providers.Base', 10, 0, 0, 1, 1, 1, 1, 1)
GO
INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (7, 6, N'MySQL4Database', N'SolidCP.Providers.Database.SqlDatabase, SolidCP.Providers.Base', 13, 1, 0, 0, 1, 1, 1, 1)
GO
INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (8, 6, N'MySQL4User', N'SolidCP.Providers.Database.SqlUser, SolidCP.Providers.Base', 14, 0, 0, 0, 1, 1, 1, 1)
GO
INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (9, 3, N'FTPAccount', N'SolidCP.Providers.FTP.FtpAccount, SolidCP.Providers.Base', 3, 0, 1, 1, 1, 1, 1, 1)
GO
INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (10, 2, N'WebSite', N'SolidCP.Providers.Web.WebSite, SolidCP.Providers.Base', 2, 1, 1, 1, 1, 1, 1, 1)
GO
INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (11, 4, N'MailDomain', N'SolidCP.Providers.Mail.MailDomain, SolidCP.Providers.Base', 8, 0, 1, 1, 1, 1, 1, 1)
GO
INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (12, 7, N'DNSZone', N'SolidCP.Providers.DNS.DnsZone, SolidCP.Providers.Base', 0, 0, 0, 1, 1, 0, 1, 1)
GO
INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (13, 1, N'Domain', N'SolidCP.Providers.OS.Domain, SolidCP.Providers.Base', 1, 0, 0, 0, 0, 1, 0, 0)
GO
INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (14, 8, N'StatisticsSite', N'SolidCP.Providers.Statistics.StatsSite, SolidCP.Providers.Base', 17, 0, 0, 0, 1, 1, 1, 1)
GO
INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (15, 4, N'MailAccount', N'SolidCP.Providers.Mail.MailAccount, SolidCP.Providers.Base', 4, 1, 0, 0, 0, 1, 0, 0)
GO
INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (16, 4, N'MailAlias', N'SolidCP.Providers.Mail.MailAlias, SolidCP.Providers.Base', 5, 0, 0, 0, 0, 1, 0, 0)
GO
INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (17, 4, N'MailList', N'SolidCP.Providers.Mail.MailList, SolidCP.Providers.Base', 7, 0, 0, 0, 0, 1, 0, 0)
GO
INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (18, 4, N'MailGroup', N'SolidCP.Providers.Mail.MailGroup, SolidCP.Providers.Base', 6, 0, 0, 0, 0, 1, 0, 0)
GO
INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (19, 9, N'SharePointSite', N'SolidCP.Providers.SharePoint.SharePointSite, SolidCP.Providers.Base', 18, 0, 0, 0, 1, 1, 0, 0)
GO
INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (20, 1, N'ODBCDSN', N'SolidCP.Providers.OS.SystemDSN, SolidCP.Providers.Base', 22, 0, 0, 0, 1, 1, 1, 1)
GO
INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (21, 10, N'MsSQL2005Database', N'SolidCP.Providers.Database.SqlDatabase, SolidCP.Providers.Base', 11, 1, 0, 0, 1, 1, 1, 1)
GO
INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (22, 10, N'MsSQL2005User', N'SolidCP.Providers.Database.SqlUser, SolidCP.Providers.Base', 12, 0, 0, 1, 1, 1, 1, 1)
GO
INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (23, 11, N'MySQL5Database', N'SolidCP.Providers.Database.SqlDatabase, SolidCP.Providers.Base', 15, 1, 0, 0, 1, 1, 1, 1)
GO
INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (24, 11, N'MySQL5User', N'SolidCP.Providers.Database.SqlUser, SolidCP.Providers.Base', 16, 0, 0, 0, 1, 1, 1, 1)
GO
INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (25, 2, N'SharedSSLFolder', N'SolidCP.Providers.Web.SharedSSLFolder, SolidCP.Providers.Base', 21, 0, 0, 0, 1, 1, 0, 1)
GO
INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (28, 7, N'SecondaryDNSZone', N'SolidCP.Providers.DNS.SecondaryDnsZone, SolidCP.Providers.Base', 0, 0, 0, 1, 1, 0, 0, 1)
GO
INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (29, 13, N'Organization', N'SolidCP.Providers.HostedSolution.Organization, SolidCP.Providers.Base', 1, 1, 0, 1, 1, 1, 0, 1)
GO
INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (30, 13, N'OrganizationDomain', N'SolidCP.Providers.HostedSolution.OrganizationDomain, SolidCP.Providers.Base', 1, NULL, NULL, NULL, NULL, NULL, 0, 1)
GO
INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (31, 22, N'MsSQL2008Database', N'SolidCP.Providers.Database.SqlDatabase, SolidCP.Providers.Base', 1, 1, 0, 0, 1, 1, 1, 1)
GO
INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (32, 22, N'MsSQL2008User', N'SolidCP.Providers.Database.SqlUser, SolidCP.Providers.Base', 1, 0, 0, 0, 1, 1, 1, 1)
GO
INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (33, 30, N'VirtualMachine', N'SolidCP.Providers.Virtualization.VirtualMachine, SolidCP.Providers.Base', 1, 0, 0, 1, 1, 1, 0, 0)
GO
INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (34, 30, N'VirtualSwitch', N'SolidCP.Providers.Virtualization.VirtualSwitch, SolidCP.Providers.Base', 2, 0, 0, 1, 1, 1, 0, 0)
GO
INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (35, 40, N'VMInfo', N'SolidCP.Providers.Virtualization.VMInfo, SolidCP.Providers.Base', 1, 0, 0, 1, 1, 1, 0, 0)
GO
INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (36, 40, N'VirtualSwitch', N'SolidCP.Providers.Virtualization.VirtualSwitch, SolidCP.Providers.Base', 2, 0, 0, 1, 1, 1, 0, 0)
GO
INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (37, 23, N'MsSQL2012Database', N'SolidCP.Providers.Database.SqlDatabase, SolidCP.Providers.Base', 1, 1, 0, 0, 1, 1, 1, 1)
GO
INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (38, 23, N'MsSQL2012User', N'SolidCP.Providers.Database.SqlUser, SolidCP.Providers.Base', 1, 0, 0, 0, 1, 1, 1, 1)
GO
INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (200, 20, N'SharePointSiteCollection', N'SolidCP.Providers.SharePoint.SharePointSiteCollection, SolidCP.Providers.Base', 25, 1, 0, 0, 1, 1, 1, 1)
GO
INSERT [dbo].[SystemSettings] ([SettingsName], [PropertyName], [PropertyValue]) VALUES (N'BackupSettings', N'BackupsPath', N'c:\HostingBackups')
GO
INSERT [dbo].[SystemSettings] ([SettingsName], [PropertyName], [PropertyValue]) VALUES (N'SmtpSettings', N'SmtpEnableSsl', N'False')
GO
INSERT [dbo].[SystemSettings] ([SettingsName], [PropertyName], [PropertyValue]) VALUES (N'SmtpSettings', N'SmtpPort', N'25')
GO
INSERT [dbo].[SystemSettings] ([SettingsName], [PropertyName], [PropertyValue]) VALUES (N'SmtpSettings', N'SmtpServer', N'127.0.0.1')
GO
INSERT [dbo].[SystemSettings] ([SettingsName], [PropertyName], [PropertyValue]) VALUES (N'SmtpSettings', N'SmtpUsername', N'postmaster')
GO
SET IDENTITY_INSERT [dbo].[Users] ON
GO
INSERT [dbo].[Users] ([UserID], [OwnerID], [RoleID], [StatusID], [IsDemo], [IsPeer], [Username], [Password], [FirstName], [LastName], [Email], [Created], [Changed], [Comments], [SecondaryEmail], [Address], [City], [State], [Country], [Zip], [PrimaryPhone], [SecondaryPhone], [Fax], [InstantMessenger], [HtmlMail], [CompanyName], [EcommerceEnabled], [AdditionalParams], [LoginStatusId], [FailedLogins], [SubscriberNumber]) VALUES (1, NULL, 1, 1, 0, 0, N'serveradmin', N'', N'Enterprise', N'Administrator', N'serveradmin@myhosting.com', CAST(0x00009DB500D45270 AS DateTime), CAST(0x00009DB500D45270 AS DateTime), N'', N'', N'', N'', N'', N'', N'', N'', N'', N'', N'', 1, NULL, 1, NULL, NULL, NULL, NULL)
GO
SET IDENTITY_INSERT [dbo].[Users] OFF
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'AccountSummaryLetter', N'CC', N'support@HostingCompany.com')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'AccountSummaryLetter', N'EnableLetter', N'False')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'AccountSummaryLetter', N'From', N'support@HostingCompany.com')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'AccountSummaryLetter', N'HtmlBody', N'<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Account Summary Information</title>
<style type="text/css">
.Summary { background-color: ##ffffff; padding: 5px; }
.Summary .Header { padding: 10px 0px 10px 10px; font-size: 16pt; background-color: ##E5F2FF; color: ##1F4978; border-bottom: solid 2px ##86B9F7; }
.Summary A { color: ##0153A4; }
.Summary { font-family: Tahoma; font-size: 9pt; }
.Summary H1 { font-size: 1.7em; color: ##1F4978; border-bottom: dotted 3px ##efefef; }
.Summary H2 { font-size: 1.3em; color: ##1F4978; }
.Summary TABLE { border: solid 1px ##e5e5e5; }
.Summary TH,
.Summary TD.Label { padding: 5px; font-size: 8pt; font-weight: bold; background-color: ##f5f5f5; }
.Summary TD { padding: 8px; font-size: 9pt; }
.Summary UL LI { font-size: 1.1em; font-weight: bold; }
.Summary UL UL LI { font-size: 0.9em; font-weight: normal; }
</style>
</head>
<body>
<div class="Summary">
<a name="top"></a>
<div class="Header">
Hosting Account Information
</div>
<ad:if test="#Signup#">
<p>
Hello #user.FirstName#,
</p>
<p>
New user account has been created and below you can find its summary information.
</p>
<h1>Control Panel URL</h1>
<table>
<thead>
<tr>
<th>Control Panel URL</th>
<th>Username</th>
<th>Password</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="http://panel.HostingCompany.com">http://panel.HostingCompany.com</a></td>
<td>#user.Username#</td>
<td>#user.Password#</td>
</tr>
</tbody>
</table>
</ad:if>
<h1>Hosting Spaces</h1>
<p>
The following hosting spaces have been created under your account:
</p>
<ad:foreach collection="#Spaces#" var="Space" index="i">
<h2>#Space.PackageName#</h2>
<table>
<tbody>
<tr>
<td class="Label">Hosting Plan:</td>
<td>
<ad:if test="#not(isnull(Plans[Space.PlanId]))#">#Plans[Space.PlanId].PlanName#<ad:else>System</ad:if>
</td>
</tr>
<ad:if test="#not(isnull(Plans[Space.PlanId]))#">
<tr>
<td class="Label">Purchase Date:</td>
<td>
#Space.PurchaseDate#
</td>
</tr>
<tr>
<td class="Label">Disk Space, MB:</td>
<td><ad:NumericQuota space="#SpaceContexts[Space.PackageId]#" quota="OS.Diskspace" /></td>
</tr>
<tr>
<td class="Label">Bandwidth, MB/Month:</td>
<td><ad:NumericQuota space="#SpaceContexts[Space.PackageId]#" quota="OS.Bandwidth" /></td>
</tr>
<tr>
<td class="Label">Maximum Number of Domains:</td>
<td><ad:NumericQuota space="#SpaceContexts[Space.PackageId]#" quota="OS.Domains" /></td>
</tr>
<tr>
<td class="Label">Maximum Number of Sub-Domains:</td>
<td><ad:NumericQuota space="#SpaceContexts[Space.PackageId]#" quota="OS.SubDomains" /></td>
</tr>
</ad:if>
</tbody>
</table>
</ad:foreach>
<ad:if test="#Signup#">
<p>
If you have any questions regarding your hosting account, feel free to contact our support department at any time.
</p>
<p>
Best regards,<br />
SolidCP.<br />
Web Site: <a href="https://solidcp.com">https://solidcp.com</a><br />
E-Mail: <a href="mailto:support@solidcp.com">support@solidcp.com</a>
</p>
</ad:if>
<ad:template name="NumericQuota">
<ad:if test="#space.Quotas.ContainsKey(quota)#">
<ad:if test="#space.Quotas[quota].QuotaAllocatedValue isnot -1#">#space.Quotas[quota].QuotaAllocatedValue#<ad:else>Unlimited</ad:if>
<ad:else>
0
</ad:if>
</ad:template>
</div>
</body>
</html>')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'AccountSummaryLetter', N'Priority', N'Normal')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'AccountSummaryLetter', N'Subject', N'<ad:if test="#Signup#">SolidCP account has been created for<ad:else>SolidCP account summary for</ad:if> #user.FirstName# #user.LastName#')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'AccountSummaryLetter', N'TextBody', N'=================================
Hosting Account Information
=================================
<ad:if test="#Signup#">Hello #user.FirstName#,
New user account has been created and below you can find its summary information.
Control Panel URL: https://panel.solidcp.com
Username: #user.Username#
Password: #user.Password#
</ad:if>
Hosting Spaces
==============
The following hosting spaces have been created under your account:
<ad:foreach collection="#Spaces#" var="Space" index="i">
=== #Space.PackageName# ===
Hosting Plan: <ad:if test="#not(isnull(Plans[Space.PlanId]))#">#Plans[Space.PlanId].PlanName#<ad:else>System</ad:if>
<ad:if test="#not(isnull(Plans[Space.PlanId]))#">Purchase Date: #Space.PurchaseDate#
Disk Space, MB: <ad:NumericQuota space="#SpaceContexts[Space.PackageId]#" quota="OS.Diskspace" />
Bandwidth, MB/Month: <ad:NumericQuota space="#SpaceContexts[Space.PackageId]#" quota="OS.Bandwidth" />
Maximum Number of Domains: <ad:NumericQuota space="#SpaceContexts[Space.PackageId]#" quota="OS.Domains" />
Maximum Number of Sub-Domains: <ad:NumericQuota space="#SpaceContexts[Space.PackageId]#" quota="OS.SubDomains" />
</ad:if>
</ad:foreach>
<ad:if test="#Signup#">If you have any questions regarding your hosting account, feel free to contact our support department at any time.
Best regards,
SolidCP.
Web Site: https://solidcp.com">
E-Mail: support@solidcp.com
</ad:if><ad:template name="NumericQuota"><ad:if test="#space.Quotas.ContainsKey(quota)#"><ad:if test="#space.Quotas[quota].QuotaAllocatedValue isnot -1#">#space.Quotas[quota].QuotaAllocatedValue#<ad:else>Unlimited</ad:if><ad:else>0</ad:if></ad:template>')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'DisplayPreferences', N'GridItems', N'10')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'ExchangePolicy', N'MailboxPasswordPolicy', N'True;8;20;0;2;0;True')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'FtpPolicy', N'UserNamePolicy', N'True;-;1;20;;;')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'FtpPolicy', N'UserPasswordPolicy', N'True;5;20;0;1;0;True')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'MailPolicy', N'AccountNamePolicy', N'True;;1;50;;;')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'MailPolicy', N'AccountPasswordPolicy', N'True;5;20;0;1;0;False')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'MailPolicy', N'CatchAllName', N'mail')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'MsSqlPolicy', N'DatabaseNamePolicy', N'True;-;1;120;;;')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'MsSqlPolicy', N'UserNamePolicy', N'True;-;1;120;;;')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'MsSqlPolicy', N'UserPasswordPolicy', N'True;5;20;0;1;0;True')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'MySqlPolicy', N'DatabaseNamePolicy', N'True;;1;40;;;')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'MySqlPolicy', N'UserNamePolicy', N'True;;1;16;;;')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'MySqlPolicy', N'UserPasswordPolicy', N'True;5;20;0;1;0;False')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'OsPolicy', N'DsnNamePolicy', N'True;-;2;40;;;')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'PackageSummaryLetter', N'CC', N'support@HostingCompany.com')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'PackageSummaryLetter', N'EnableLetter', N'True')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'PackageSummaryLetter', N'From', N'support@HostingCompany.com')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'PackageSummaryLetter', N'HtmlBody', N'<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Hosting Space Summary Information</title>
<style type="text/css">
.Summary { background-color: ##ffffff; padding: 5px; }
.Summary .Header { padding: 10px 0px 10px 10px; font-size: 16pt; background-color: ##E5F2FF; color: ##1F4978; border-bottom: solid 2px ##86B9F7; }
.Summary A { color: ##0153A4; }
.Summary { font-family: Tahoma; font-size: 9pt; }
.Summary H1 { font-size: 1.7em; color: ##1F4978; border-bottom: dotted 3px ##efefef; }
.Summary H2 { font-size: 1.2em; }
.Summary TABLE { border: solid 1px ##e5e5e5; }
.Summary TH,
.Summary TD.Label { padding: 5px; font-size: 8pt; font-weight: bold; background-color: ##f5f5f5; }
.Summary TD { padding: 8px; font-size: 9pt; }
.Summary UL LI { font-size: 1.1em; font-weight: bold; }
.Summary UL UL LI { font-size: 0.9em; font-weight: normal; }
</style>
</head>
<body>
<div class="Summary">
<a name="top"></a>
<div class="Header">
Hosting Space Information
</div>
<ad:if test="#Signup#">
<p>
Hello #user.FirstName#,
</p>
<p>
"#space.Package.PackageName#" hosting space has been created under your user account
and below is the summary information for its resources.
</p>
</ad:if>
<ul>
<ad:if test="#Signup#">
<li><a href="##cp">Control Panel URL</a></li>
</ad:if>
<li><a href="##overview">Hosting Space Overview</a></li>
<ad:if test="#space.Groups.ContainsKey("Web")#">
<li><a href="##web">Web</a></li>
<ul>
<li><a href="##weblimits">Limits</a></li>
<li><a href="##dns">Name Servers</a></li>
<li><a href="##sites">Web Sites</a></li>
<li><a href="##tempurl">Temporary URL</a></li>
<li><a href="##files">Files Location</a></li>
</ul>
</ad:if>
<ad:if test="#space.Groups.ContainsKey("FTP")#">
<li><a href="##ftp">FTP</a></li>
<ul>
<li><a href="##ftplimits">Limits</a></li>
<li><a href="##ftpserver">FTP Server</a></li>
<li><a href="##ftpaccounts">FTP Accounts</a></li>
</ul>
</ad:if>
<ad:if test="#space.Groups.ContainsKey("Mail")#">
<li><a href="##mail">Mail</a></li>
<ul>
<li><a href="##maillimits">Limits</a></li>
<li><a href="##smtp">SMTP/POP3 Server</a></li>
<li><a href="##mailaccounts">Mail Accounts</a></li>
</ul>
</ad:if>
<li><a href="##db">Databases</a></li>
<ul>
<ad:if test="#space.Groups.ContainsKey("MsSQL2000")#"><li><a href="##mssql2000">SQL Server 2000</a></li></ad:if>
<ad:if test="#space.Groups.ContainsKey("MsSQL2005")#"><li><a href="##mssql2005">SQL Server 2005</a></li></ad:if>
<ad:if test="#space.Groups.ContainsKey("MsSQL2008")#"><li><a href="##mssql2008">SQL Server 2008</a></li></ad:if>
<ad:if test="#space.Groups.ContainsKey("MsSQL2012")#"><li><a href="##mssql2012">SQL Server 2012</a></li></ad:if>
<ad:if test="#space.Groups.ContainsKey("MsSQL2014")#"><li><a href="##mssql2012">SQL Server 2014</a></li></ad:if>
<ad:if test="#space.Groups.ContainsKey("MsSQL2016")#"><li><a href="##mssql2012">SQL Server 2016</a></li></ad:if>
<ad:if test="#space.Groups.ContainsKey("MySQL4")#"><li><a href="##mysql4">My SQL 4.x</a></li></ad:if>
<ad:if test="#space.Groups.ContainsKey("MySQL5")#"><li><a href="##mysql5">My SQL 5.x</a></li></ad:if>
<ad:if test="#space.Groups.ContainsKey("MariaDB")#"><li><a href="##MariaDB">MariaDB</a></li></ad:if>
<li><a href="##msaccess">Microsoft Access</a></li>
</ul>
<ad:if test="#space.Groups.ContainsKey("Statistics")#"><li><a href="##stats">Statistics</a></li></ad:if>
<li><a href="##db">Virtual Machine</a></li>
<ul>
<ad:if test="#space.Groups.ContainsKey("VPSForPC")#"><li><a href="##VPSForPC">VPSForPC</a></li></ad:if>
<ad:if test="#space.Groups.ContainsKey("VPS2012")#"><li><a href="##vps2012">VPS2012</a></li></ad:if>
<ad:if test="#space.Groups.ContainsKey("PROXMOX")#"><li><a href="##proxmox">Proxmox</a></li></ad:if>
</ul>
</ul>
<ad:if test="#Signup#">
<a name="cp"></a>
<h1>Control Panel URL</h1>
<table>
<thead>
<tr>
<th>Control Panel URL</th>
<th>Username</th>
<th>Password</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="http://panel.HostingCompany.com">http://panel.HostingCompany.com</a></td>
<td>#user.Username#</td>
<td>#user.Password#</td>
</tr>
</tbody>
</table>
</ad:if>
<a name="overview"></a>
<h1>Hosting Space Overview</h1>
<p>
General hosting space limits:
</p>
<table>
<tr>
<td class="Label">Disk Space, MB:</td>
<td><ad:NumericQuota quota="OS.Diskspace" /></td>
</tr>
<tr>
<td class="Label">Bandwidth, MB/Month:</td>
<td><ad:NumericQuota quota="OS.Bandwidth" /></td>
</tr>
<tr>
<td class="Label">Maximum Number of Domains:</td>
<td><ad:NumericQuota quota="OS.Domains" /></td>
</tr>
<tr>
<td class="Label">Maximum Number of Sub-Domains:</td>
<td><ad:NumericQuota quota="OS.SubDomains" /></td>
</tr>
</table>
<ad:if test="#space.Groups.ContainsKey("Web")#">
<a name="web"></a>
<h1>Web</h1>
<a name="weblimits"></a>
<h2>
Limits
</h2>
<table>
<tr>
<td class="Label">Maximum Number of Web Sites:</td>
<td><ad:NumericQuota quota="Web.Sites" /></td>
</tr>
<tr>
<td class="Label">Web Application Gallery:</td>
<td><ad:BooleanQuota quota="Web.WebAppGallery" /></td>
</tr>
<tr>
<td class="Label">Classic ASP:</td>
<td><ad:BooleanQuota quota="Web.Asp" /></td>
</tr>
<tr>
<td class="Label">ASP.NET 1.1:</td>
<td><ad:BooleanQuota quota="Web.AspNet11" /></td>
</tr>
<tr>
<td class="Label">ASP.NET 2.0:</td>
<td><ad:BooleanQuota quota="Web.AspNet20" /></td>
</tr>
<tr>
<td class="Label">ASP.NET 4.0:</td>
<td><ad:BooleanQuota quota="Web.AspNet40" /></td>
</tr>
<tr>
<td class="Label">PHP 4:</td>
<td><ad:BooleanQuota quota="Web.Php4" /></td>
</tr>
<tr>
<td class="Label">PHP 5:</td>
<td><ad:BooleanQuota quota="Web.Php5" /></td>
</tr>
<tr>
<td class="Label">Perl:</td>
<td><ad:BooleanQuota quota="Web.Perl" /></td>
</tr>
<tr>
<td class="Label">CGI-BIN:</td>
<td><ad:BooleanQuota quota="Web.CgiBin" /></td>
</tr>
</table>
<a name="dns"></a>
<h2>Name Servers</h2>
<p>
In order to point your domain to the web site in this hosting space you should use the following Name Servers:
</p>
<table>
<ad:foreach collection="#NameServers#" var="NameServer" index="i">
<tr>
<td class="Label">#NameServer#</td>
</tr>
</ad:foreach>
</table>
<p>
You should change the name servers in domain registrar (Register.com, GoDaddy.com, etc.) control panel.
Please, study domain registrar's user manual for directions how to change name servers or contact your domain
registrar directly by e-mail or phone.
</p>
<p>
Please note, the changes in domain registrar database do not reflect immediately and sometimes it requires from
12 to 48 hours till the end of DNS propagation.
</p>
<a name="sites"></a>
<h2>Web Sites</h2>
<p>
The following web sites have been created under hosting space:
</p>
<table>
<ad:foreach collection="#WebSites#" var="WebSite">
<tr>
<td><a href="http://#WebSite.Name#" target="_blank">http://#WebSite.Name#</a></td>
</tr>
</ad:foreach>
</table>
<p>
* Please note, your web sites may not be accessible from 12 to 48 hours after you've changed name servers for their respective domains.
</p>
<ad:if test="#isnotempty(PreviewDomain)#">
<a name="tempurl"></a>
<h2>Temporary URL</h2>
<p>
You can access your web sites right now using their respective temporary URLs (instant aliases).
Temporary URL is a sub-domain of the form http://yourdomain.com.providerdomain.com where "yourdomain.com" is your
domain and "providerdomain.com" is the domain of your hosting provider.
</p>
<p>
You can use the following Temporary URL for all your web sites:
</p>
<table>
<tr>
<td>
http://YourDomain.com.<b>#PreviewDomain#</b>
</td>
</tr>
</table>
</ad:if>
<a name="files"></a>
<h2>Files Location</h2>
<p>
Sometimes it is required to know the physical location of the hosting space folder (absolute path).
Hosting space folder is the folder where all hosting space files such as web sites content, web logs, data files, etc. are located.
</p>
<p>
The root of your hosting space on our HDD is here:
</p>
<table>
<tr>
<td>
#PackageRootFolder#
</td>
</tr>
</table>
<p>
By default the root folder of any web site within your hosting space is built as following (you can change it anytime from the control panel):
</p>
<table>
<tr>
<td>
#PackageRootFolder#\YourDomain.com\wwwroot
</td>
</tr>
</table>
</ad:if>
<ad:if test="#space.Groups.ContainsKey("FTP")#">
<a name="ftp"></a>
<h1>FTP</h1>
<a name="ftplimits"></a>
<h2>Limits</h2>
<table>
<tr>
<td class="Label">Maximum Number of FTP Accounts:</td>
<td><ad:NumericQuota quota="FTP.Accounts" /></td>
</tr>
</table>
<a name="ftpserver"></a>
<h2>FTP Server</h2>
<p>
Your hosting space allows working with your files by FTP.
You can use the following FTP server to access your space files remotely:
</p>
<table>
<tr>
<td><a href="ftp://#FtpIP#">ftp://#FtpIP#</a></td>
</tr>
</table>
<p>
Also, you can use the following domain names to access your FTP server:
</p>
<table>
<tr>
<td>ftp://ftp.YourDomain.com</td>
</tr>
</table>
<ad:if test="#isnotempty(PreviewDomain)#">
<p>
During DNS propagation period (when domain name servers have been changed), similar to web sites, FTP server can be access with Temporary URL too:
</p>
<table>
<tr>
<td>ftp://ftp.YourDomain.com.<b>#PreviewDomain#</b></td>
</tr>
</table>
</ad:if>
<a name="ftpaccounts"></a>
<h2>FTP Accounts</h2>
<p>
The following FTP accounts have been created under your hosting space and can be used to access FTP server:
</p>
<table>
<thead>
<tr>
<th>Username</th>
<ad:if test="#Signup#">
<th>Password</th>
</ad:if>
<th>Folder</th>
</tr>
</thead>
<tbody>
<ad:foreach collection="#FtpAccounts#" var="FtpAcocunt" index="i">
<tr>
<td>#FtpAcocunt.Name#</td>
<ad:if test="#Signup#">
<td>
#FtpAcocunt.Password#
</td>
</ad:if>
<td>#FtpAcocunt.Folder#</td>
</tr>
</ad:foreach>
</tbody>
</table>
</ad:if>
<ad:if test="#space.Groups.ContainsKey("Mail")#">
<a name="mail"></a>
<h1>Mail</h1>
<a name="maillimits"></a>
<h2>Limits</h2>
<table>
<tr>
<td class="Label">Maximum Number of Mail Accounts:</td>
<td><ad:NumericQuota quota="Mail.Accounts" /></td>
</tr>
<tr>
<td class="Label">Maximum Number of Mail Forwardings:</td>
<td><ad:NumericQuota quota="Mail.Forwardings" /></td>
</tr>
<tr>
<td class="Label">Maximum Number of Mail Groups (Aliases):</td>
<td><ad:NumericQuota quota="Mail.Groups" /></td>
</tr>
<tr>
<td class="Label">Maximum Number of Mailing Lists:</td>
<td><ad:NumericQuota quota="Mail.Lists" /></td>
</tr>
</table>
<a name="smtp"></a>
<h2>SMTP/POP3 Server</h2>
<p>
Below is the IP address of your POP3/SMTP/IMAP server. You can always access your mailbox(es)
using this IP address instead of actual POP3/SMTP/IMAP servers name:
</p>
<table>
<tr>
<td>
#MailRecords[0].ExternalIP#
</td>
</tr>
</table>
<p>
Also, you can use the following domain names to access SMTP/POP3 server from your favourite e-mail client software:
</p>
<table>
<tr>
<td>mail.YourDomain.com</td>
</tr>
</table>
<ad:if test="#isnotempty(PreviewDomain)#">
<p>
During DNS propagation period (when domain name servers have been changed), similar to web sites, SMTP/POP3 server can be access with temporary domain too:
</p>
<table>
<tr>
<td>mail.YourDomain.com.<b>#PreviewDomain#</b></td>
</tr>
</table>
</ad:if>
<a name="mailaccounts"></a>
<h2>Mail Accounts</h2>
<p>
The following mail accounts have been created under your hosting space:
</p>
<table>
<thead>
<tr>
<th>E-mail</th>
<th>Username (for POP3/SMTP/IMAP/WebMail)</th>
<ad:if test="#Signup#">
<th>Password</th>
</ad:if>
</tr>
</thead>
<tbody>
<ad:foreach collection="#MailAccounts#" var="MailAccount">
<tr>
<td>#MailAccount.Name#</td>
<td>#MailAccount.Name#</td>
<ad:if test="#Signup#">
<td>
#MailAccount.Password#
</td>
</ad:if>
</tr>
</ad:foreach>
</tbody>
</table>
</ad:if>
<a name="db"></a>
<h1>Databases</h1>
<p>
You can create databases and database users on "Space Home -> Databases" screen in the control panel.
</p>
<ad:if test="#space.Groups.ContainsKey("MsSQL2000")#">
<a name="mssql2000"></a>
<h2>SQL Server 2000</h2>
<table>
<tr>
<td class="Label">Maximum Number of Databases:</td>
<td><ad:NumericQuota quota="MsSQL2000.Databases" /></td>
</tr>
<tr>
<td class="Label">Maximum Number of Users:</td>
<td><ad:NumericQuota quota="MsSQL2000.Users" /></td>
</tr>
</table>
<p>
In order to connect to SQL Server 2000 from Management Studio, Enterprise Manager, Query Analyzer
or other client software you can use the following SQL Server address:
</p>
<table>
<tr>
<td>#MsSQL2000Address#</td>
</tr>
</table>
<ad:MsSqlConnectionStrings server="#MsSQL2000Address#" />
</ad:if>
<ad:if test="#space.Groups.ContainsKey("MsSQL2005")#">
<a name="mssql2005"></a>
<h2>SQL Server 2005</h2>
<table>
<tr>
<td class="Label">Maximum Number of Databases:</td>
<td><ad:NumericQuota quota="MsSQL2005.Databases" /></td>
</tr>
<tr>
<td class="Label">Maximum Number of Users:</td>
<td><ad:NumericQuota quota="MsSQL2005.Users" /></td>
</tr>
</table>
<p>
In order to connect to SQL Server 2005 from Management Studio, Enterprise Manager, Query Analyzer
or other client software you can use the following SQL Server address:
</p>
<table>
<tr>
<td>#MsSQL2005Address#</td>
</tr>
</table>
<ad:MsSqlConnectionStrings server="#MsSQL2005Address#" />
</ad:if>
<ad:if test="#space.Groups.ContainsKey("MsSQL2008")#">
<a name="mssql2008"></a>
<h2>SQL Server 2008</h2>
<table>
<tr>
<td class="Label">Maximum Number of Databases:</td>
<td><ad:NumericQuota quota="MsSQL2008.Databases" /></td>
</tr>
<tr>
<td class="Label">Maximum Number of Users:</td>
<td><ad:NumericQuota quota="MsSQL2008.Users" /></td>
</tr>
</table>
<p>
In order to connect to SQL Server 2008 from Management Studio, Enterprise Manager, Query Analyzer
or other client software you can use the following SQL Server address:
</p>
<table>
<tr>
<td>#MsSQL2008Address#</td>
</tr>
</table>
<ad:MsSqlConnectionStrings server="#MsSQL2008Address#" />
</ad:if>
<ad:if test="#space.Groups.ContainsKey("MsSQL2012")#">
<a name="mssql2012"></a>
<h2>SQL Server 2012</h2>
<table>
<tr>
<td class="Label">Maximum Number of Databases:</td>
<td><ad:NumericQuota quota="MsSQL2012.Databases" /></td>
</tr>
<tr>
<td class="Label">Maximum Number of Users:</td>
<td><ad:NumericQuota quota="MsSQL2012.Users" /></td>
</tr>
</table>
<p>
In order to connect to SQL Server 2012 from Management Studio, Enterprise Manager, Query Analyzer
or other client software you can use the following SQL Server address:
</p>
<table>
<tr>
<td>#MsSQL2012Address#</td>
</tr>
</table>
<ad:MsSqlConnectionStrings server="#MsSQL2012Address#" />
</ad:if>
<ad:if test="#space.Groups.ContainsKey("MsSQL2014")#">
<a name="mssql2014"></a>
<h2>SQL Server 2014</h2>
<table>
<tr>
<td class="Label">Maximum Number of Databases:</td>
<td><ad:NumericQuota quota="MsSQL2014.Databases" /></td>
</tr>
<tr>
<td class="Label">Maximum Number of Users:</td>
<td><ad:NumericQuota quota="MsSQL2014.Users" /></td>
</tr>
</table>
<p>
In order to connect to SQL Server 2014 from Management Studio, Enterprise Manager, Query Analyzer
or other client software you can use the following SQL Server address:
</p>
<table>
<tr>
<td>#MsSQL2014Address#</td>
</tr>
</table>
<ad:MsSqlConnectionStrings server="#MsSQL2014Address#" />
</ad:if>
<ad:if test="#space.Groups.ContainsKey("MsSQL2016")#">
<a name="mssql2016"></a>
<h2>SQL Server 2016</h2>
<table>
<tr>
<td class="Label">Maximum Number of Databases:</td>
<td><ad:NumericQuota quota="MsSQL2016.Databases" /></td>
</tr>
<tr>
<td class="Label">Maximum Number of Users:</td>
<td><ad:NumericQuota quota="MsSQL2016.Users" /></td>
</tr>
</table>
<p>
In order to connect to SQL Server 2016 from Management Studio, Enterprise Manager, Query Analyzer
or other client software you can use the following SQL Server address:
</p>
<table>
<tr>
<td>#MsSQL2016Address#</td>
</tr>
</table>
<ad:MsSqlConnectionStrings server="#MsSQL2016Address#" />
</ad:if>
<ad:if test="#space.Groups.ContainsKey("MySQL4")#">
<a name="mysql4"></a>
<h2>MySQL 4.x</h2>
<table>
<tr>
<td class="Label">Maximum Number of Databases:</td>
<td><ad:NumericQuota quota="MySQL4.Databases" /></td>
</tr>
<tr>
<td class="Label">Maximum Number of Users:</td>
<td><ad:NumericQuota quota="MySQL4.Users" /></td>
</tr>
</table>
<p>
In order to connect to MySQL 4.x server you can use the following address:
</p>
<table>
<tr>
<td>#MySQL4Address#</td>
</tr>
</table>
</ad:if>
<ad:if test="#space.Groups.ContainsKey("MySQL5")#">
<a name="mysql5"></a>
<h2>MySQL 5.x</h2>
<table>
<tr>
<td class="Label">Maximum Number of Databases:</td>
<td><ad:NumericQuota quota="MySQL5.Databases" /></td>
</tr>
<tr>
<td class="Label">Maximum Number of Users:</td>
<td><ad:NumericQuota quota="MySQL5.Users" /></td>
</tr>
</table>
<p>
In order to connect to MySQL 5.x server you can use the following address:
</p>
<table>
<tr>
<td>#MySQL5Address#</td>
</tr>
</table>
</ad:if>
<ad:if test="#space.Groups.ContainsKey("MariaDB")#">
<a name="mysql5"></a>
<h2>MariaDB</h2>
<table>
<tr>
<td class="Label">Maximum Number of Databases:</td>
<td><ad:NumericQuota quota="MariaDB.Databases" /></td>
</tr>
<tr>
<td class="Label">Maximum Number of Users:</td>
<td><ad:NumericQuota quota="MariaDB.Users" /></td>
</tr>
</table>
<p>
In order to connect to MariaDB server you can use the following address:
</p>
<table>
<tr>
<td>#MariaDBAddress#</td>
</tr>
</table>
</ad:if>
<a name="msaccess"></a>
<h2>Microsoft Access</h2>
<p>
Microsoft Access database are automatically allowed in any hosting plan. You can create/upload any number of Access
database from File Manager in control panel.
</p>
<ad:if test="#space.Groups.ContainsKey("Statistics")#">
<a name="stats"></a>
<h1>Web Statistics</h1>
<table>
<tr>
<td class="Label">Maximum Number of Statistics Sites:</td>
<td><ad:NumericQuota quota="Stats.Sites" /></td>
</tr>
</table>
<p>
You can view advanced statistics from your domain using URL of the following form:
</p>
<table>
<tr>
<td>http://stats.YourDomain.com</td>
</tr>
</table>
<ad:if test="#isnotempty(PreviewDomain)#">
<p>
During DNS propagation period (when domain name servers have been changed), you can access web site statistics with Temporary URL:
</p>
<table>
<tr>
<td>http://stats.YourDomain.com.<b>#PreviewDomain#</b></td>
</tr>
</table>
</ad:if>
</ad:if>
<!-- Templates -->
<ad:template name="MsSqlConnectionStrings">
<p>
You may also use SQL Server address above in your application connection strings, for example:
</p>
<table>
<tr>
<td class="Label">Classic ASP (ADO Library)</td>
<td>Provider=SQLOLEDB;Data source=<b>#server#</b>;Initial catalog=databaseName;User Id=userName;Password=password;</td>
</tr>
<tr>
<td class="Label">ASP.NET (ADO.NET Library)</td>
<td>Server=<b>#server#</b>;Database=databaseName;Uid=userName;Password=password;</td>
</tr>
</table>
</ad:template>
<ad:template name="NumericQuota">
<ad:if test="#space.Quotas.ContainsKey(quota)#">
<ad:if test="#space.Quotas[quota].QuotaAllocatedValue isnot -1#">#space.Quotas[quota].QuotaAllocatedValue#<ad:else>Unlimited</ad:if>
<ad:else>
0
</ad:if>
</ad:template>
<ad:template name="BooleanQuota">
<ad:if test="#space.Quotas.ContainsKey(quota)#">
<ad:if test="#space.Quotas[quota].QuotaAllocatedValue isnot 0#">Enabled<ad:else>Disabled</ad:if>
<ad:else>
Disabled
</ad:if>
</ad:template>
<a name="vm"></a>
<h1>Virtual Machines</h1>
<ad:if test="#space.Groups.ContainsKey("VPSForPC")#">
<a name="VPSForPC"></a>
<h2>VPSForPC</h2>
<table>
<tr>
<td class="Label">CPUs: </td>
<td><ad:NumericQuota quota="VPSForPC.CpuNumber" /></td>
</tr>
<tr>
<td class="Label">RAM: </td>
<td><ad:NumericQuota quota="VPSForPC.Ram" /></td>
</tr>
<tr>
<td class="Label">HDD: </td>
<td><ad:NumericQuota quota="VPSForPC.Hdd" /></td>
</tr>
</table>
</ad:if>
<ad:if test="#space.Groups.ContainsKey("VPS2012")#">
<a name="vps2012"></a>
<h2>HyperV</h2>
<table>
<tr>
<td class="Label">CPUs: </td>
<td><ad:NumericQuota quota="VPS2012.CpuNumber" /></td>
</tr>
<tr>
<td class="Label">RAM: </td>
<td><ad:NumericQuota quota="VPS2012.Ram" /></td>
</tr>
<tr>
<td class="Label">HDD: </td>
<td><ad:NumericQuota quota="VPS2012.Hdd" /></td>
</tr>
</table>
</ad:if>
<ad:if test="#space.Groups.ContainsKey("PROXMOX")#">
<a name="proxmox"></a>
<h2>Proxmox</h2>
<table>
<tr>
<td class="Label">CPUs: </td>
<td><ad:NumericQuota quota="PROXMOX.CpuNumber" /></td>
</tr>
<tr>
<td class="Label">RAM: </td>
<td><ad:NumericQuota quota="PROXMOX.Ram" /></td>
</tr>
<tr>
<td class="Label">HDD: </td>
<td><ad:NumericQuota quota="PROXMOX.Hdd" /></td>
</tr>
</table>
</ad:if>
<ad:if test="#Signup#">
<p>
If you have any questions regarding your hosting account, feel free to contact our support department at any time.
</p>
<p>
Best regards,<br />
HostingCompany.<br />
Web Site: <a href="HostingCompany.com">HostingCompany.com</a><br />
E-Mail: <a href="mailto:support@HostingCompany.com">support@HostingCompany.com</a>
</p>
</ad:if>
</div>
</body>
</html>')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'PackageSummaryLetter', N'Priority', N'Normal')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'PackageSummaryLetter', N'Subject', N'"#space.Package.PackageName#" <ad:if test="#Signup#">hosting space has been created for<ad:else>hosting space summary for</ad:if> #user.FirstName# #user.LastName#')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'PackageSummaryLetter', N'TextBody', N'================================
Hosting Space Information
================================
<ad:if test="#Signup#">
Hello #user.FirstName#,
"#space.Package.PackageName#" hosting space has been created under your user account
and below is the summary information for its resources.
</ad:if>
Control Panel
=============
Control Panel URL: https://panel.HostingCompany.com
Username: #user.Username#
Password: #user.Password#
<ad:if test="#space.Groups.ContainsKey("OS")#">
Hosting Space Overview
======================
General hosting space limits:
Disk Space, MB: <ad:NumericQuota quota="OS.Diskspace" />
Bandwidth, MB/Month: <ad:NumericQuota quota="OS.Bandwidth" />
Maximum Number of Domains: <ad:NumericQuota quota="OS.Domains" />
Maximum Number of Sub-Domains: <ad:NumericQuota quota="OS.SubDomains" />
</ad:if>
<ad:if test="#space.Groups.ContainsKey("Web")#">Web
======
Limits
------
Maximum Number of Web Sites: <ad:NumericQuota quota="Web.Sites" />
Web Application Gallery: <ad:BooleanQuota quota="Web.WebAppGallery" />
Classic ASP: <ad:BooleanQuota quota="Web.Asp" />
ASP.NET 1.1: <ad:BooleanQuota quota="Web.AspNet11" />
ASP.NET 2.0: <ad:BooleanQuota quota="Web.AspNet20" />
ASP.NET 4.0: <ad:BooleanQuota quota="Web.AspNet40" />
PHP 4: <ad:BooleanQuota quota="Web.Php4" />
PHP 5: <ad:BooleanQuota quota="Web.Php5" />
Perl: <ad:BooleanQuota quota="Web.Perl" />
CGI-BIN: <ad:BooleanQuota quota="Web.CgiBin" />
Name Servers
------------
In order to point your domain to the web site in this hosting space you should use the following Name Servers:
<ad:foreach collection="#NameServers#" var="NameServer" index="i">
#NameServer#</ad:foreach>
You should change the name servers in domain registrar (Register.com, GoDaddy.com, etc.) control panel. Please, study domain registrar's user manual for directions how to change name servers or contact your domain registrar directly by e-mail or phone.
Please note, the changes in domain registrar database do not reflect immediately and sometimes it requires from 12 to 48 hours till the end of DNS propagation.
Web Sites
---------
The following web sites have been created under hosting space:
<ad:foreach collection="#WebSites#" var="WebSite">
http://#WebSite.Name#</ad:foreach>
* Please note, your web sites may not be accessible from 12 to 48 hours after you've changed name servers for their respective domains.
<ad:if test="#isnotempty(PreviewDomain)#">Temporary URL
-------------
You can access your web sites right now using their respective temporary URLs (Preview Domains). Temporary URL is a sub-domain of the form http://yourdomain.com.providerdomain.com where "yourdomain.com" is your domain and "providerdomain.com" is the domain of your hosting provider.
You can use the following Temporary URL for all your web sites:
http://YourDomain.com.#PreviewDomain#
</ad:if>
Files Location
--------------
Sometimes it is required to know the physical location of the hosting space folder (absolute path).
Hosting space folder is the folder where all hosting space files such as web sites content, web logs, data files, etc. are located.
The root of your hosting space on our HDD is here:
#PackageRootFolder#
By default the root folder of any web site within your hosting space is built as following (you can change it anytime from the control panel):
#PackageRootFolder#\YourDomain.com\wwwroot
</ad:if>
<ad:if test="#space.Groups.ContainsKey("FTP")#">FTP
=====
Limits
------
Maximum Number of FTP Accounts: <ad:NumericQuota quota="FTP.Accounts" />
FTP Server
----------
Your hosting space allows working with your files by FTP.
You can use the following FTP server to access your space files remotely:
ftp://#FtpIP#
Also, you can use the following domain names to access your FTP server:
ftp://ftp.YourDomain.com
<ad:if test="#isnotempty(PreviewDomain)#">During DNS propagation period (when domain name servers have been changed), similar to web sites, FTP server can be access with Temporary URL too:
ftp://ftp.YourDomain.com.#PreviewDomain#
</ad:if>
FTP Accounts
------------
The following FTP accounts have been created under your hosting space and can be used to access FTP server:
<ad:foreach collection="#FtpAccounts#" var="FtpAcocunt" index="i">Username: #FtpAcocunt.Name#
<ad:if test="#Signup#">Password: #FtpAcocunt.Password#
</ad:if>Folder: #FtpAcocunt.Folder#
</ad:foreach>
</ad:if>
<ad:if test="#space.Groups.ContainsKey("Mail")#">Mail
========
Limits
------
Maximum Number of Mail Accounts: <ad:NumericQuota quota="Mail.Accounts" />
Maximum Number of Mail Forwardings: <ad:NumericQuota quota="Mail.Forwardings" />
Maximum Number of Mail Groups (Aliases): <ad:NumericQuota quota="Mail.Groups" />
Maximum Number of Mailing Lists: <ad:NumericQuota quota="Mail.Lists" />
SMTP/POP3 Server
----------------
Below is the IP address of your POP3/SMTP/IMAP server. You can always access your mailbox(es) using this IP address instead of actual POP3/SMTP/IMAP servers name:
#MailRecords[0].ExternalIP#
Also, you can use the following domain names to access SMTP/POP3 server from your favourite e-mail client software:
mail.YourDomain.com
<ad:if test="#isnotempty(PreviewDomain)#">During DNS propagation period (when domain name servers have been changed), similar to web sites, SMTP/POP3 server can be access with temporary domain too:
mail.YourDomain.com.#PreviewDomain#
</ad:if>
Mail Accounts
-------------
The following mail accounts have been created under your hosting space:
<ad:foreach collection="#MailAccounts#" var="MailAccount">E-mail: #MailAccount.Name#
<ad:if test="#Signup#">Password: #MailAccount.Password#</ad:if>
</ad:foreach>
</ad:if>
Databases
=========
You can create databases and database users on "Space Home -> Databases" screen in the control panel.
<ad:if test="#space.Groups.ContainsKey("MsSQL2000")#">SQL Server 2000
---------------
Maximum Number of Databases: <ad:NumericQuota quota="MsSQL2000.Databases" />
Maximum Number of Users: <ad:NumericQuota quota="MsSQL2000.Users" />
In order to connect to SQL Server 2000 from Management Studio, Enterprise Manager, Query Analyzer or other client software you can use the following SQL Server address:
#MsSQL2000Address#
<ad:MsSqlConnectionStrings server="#MsSQL2000Address#" />
</ad:if>
<ad:if test="#space.Groups.ContainsKey("MsSQL2005")#">SQL Server 2005
---------------
Maximum Number of Databases: <ad:NumericQuota quota="MsSQL2005.Databases" />
Maximum Number of Users: <ad:NumericQuota quota="MsSQL2005.Users" />
In order to connect to SQL Server 2005 from Management Studio, Enterprise Manager, Query Analyzer or other client software you can use the following SQL Server address:
#MsSQL2005Address#
<ad:MsSqlConnectionStrings server="#MsSQL2005Address#" />
</ad:if>
<ad:if test="#space.Groups.ContainsKey("MsSQL2008")#">SQL Server 2008
---------------
Maximum Number of Databases: <ad:NumericQuota quota="MsSQL2008.Databases" />
Maximum Number of Users: <ad:NumericQuota quota="MsSQL2008.Users" />
In order to connect to SQL Server 2008 from Management Studio, Enterprise Manager, Query Analyzer or other client software you can use the following SQL Server address:
#MsSQL2008Address#
<ad:MsSqlConnectionStrings server="#MsSQL2008Address#" />
</ad:if>
<ad:if test="#space.Groups.ContainsKey("MsSQL2012")#">SQL Server 2012
---------------
Maximum Number of Databases: <ad:NumericQuota quota="MsSQL2012.Databases" />
Maximum Number of Users: <ad:NumericQuota quota="MsSQL2012.Users" />
In order to connect to SQL Server 2012 from Management Studio, Enterprise Manager, Query Analyzer or other client software you can use the following SQL Server address:
#MsSQL2012Address#
<ad:MsSqlConnectionStrings server="#MsSQL2012Address#" />
</ad:if>
<ad:if test="#space.Groups.ContainsKey("MsSQL2014")#">SQL Server 2014
---------------
Maximum Number of Databases: <ad:NumericQuota quota="MsSQL2014.Databases" />
Maximum Number of Users: <ad:NumericQuota quota="MsSQL2014.Users" />
In order to connect to SQL Server 2014 from Management Studio, Enterprise Manager, Query Analyzer or other client software you can use the following SQL Server address:
#MsSQL2014Address#
<ad:MsSqlConnectionStrings server="#MsSQL2014Address#" />
</ad:if>
<ad:if test="#space.Groups.ContainsKey("MsSQL2016")#">SQL Server 2016
---------------
Maximum Number of Databases: <ad:NumericQuota quota="MsSQL2016.Databases" />
Maximum Number of Users: <ad:NumericQuota quota="MsSQL2016.Users" />
In order to connect to SQL Server 2016 from Management Studio, Enterprise Manager, Query Analyzer or other client software you can use the following SQL Server address:
#MsSQL2016Address#
<ad:MsSqlConnectionStrings server="#MsSQL2016Address#" />
</ad:if>
<ad:if test="#space.Groups.ContainsKey("MySQL4")#">MySQL 4.x
---------
Maximum Number of Databases: <ad:NumericQuota quota="MySQL4.Databases" />
Maximum Number of Users: <ad:NumericQuota quota="MySQL4.Users" />
In order to connect to MySQL 4.x server you can use the following address:
#MySQL4Address#
</ad:if>
<ad:if test="#space.Groups.ContainsKey("MySQL5")#">MySQL 5.x
---------
Maximum Number of Databases: <ad:NumericQuota quota="MySQL5.Databases" />
Maximum Number of Users: <ad:NumericQuota quota="MySQL5.Users" />
In order to connect to MySQL 5.x server you can use the following address:
#MySQL5Address#
</ad:if>
<ad:if test="#space.Groups.ContainsKey("MariaDB")#">MariaDB
---------
Maximum Number of Databases: <ad:NumericQuota quota="MariaDB.Databases" />
Maximum Number of Users: <ad:NumericQuota quota="MariaDB.Users" />
</ad:if>
Microsoft Access
----------------
Microsoft Access database are automatically allowed in any hosting plan. You can create/upload any number of Access database from File Manager in control panel.
<ad:if test="#space.Groups.ContainsKey("Statistics")#">Web Statistics
==============
Maximum Number of Statistics Sites: <ad:NumericQuota quota="Stats.Sites" />
You can view advanced statistics from your domain using URL of the following form:
http://stats.YourDomain.com
<ad:if test="#isnotempty(PreviewDomain)#">
During DNS propagation period (when domain name servers have been changed), you can access web site statistics with Temporary URL:
http://stats.YourDomain.com.#PreviewDomain#
</ad:if>
</ad:if>
<ad:template name="MsSqlConnectionStrings">You may also use SQL Server address above in your application connection strings, for example:
Classic ASP (ADO Library): Provider=SQLOLEDB;Data source=#server#;Initial catalog=databaseName;User Id=userName;Password=password;
ASP.NET (ADO.NET Library): Server=#server#;Database=databaseName;Uid=userName;Password=password;
</ad:template>
<ad:template name="NumericQuota"><ad:if test="#space.Quotas.ContainsKey(quota)#"><ad:if test="#space.Quotas[quota].QuotaAllocatedValue isnot -1#">#space.Quotas[quota].QuotaAllocatedValue#<ad:else>Unlimited</ad:if><ad:else>0</ad:if></ad:template>
<ad:template name="BooleanQuota"><ad:if test="#space.Quotas.ContainsKey(quota)#"><ad:if test="#space.Quotas[quota].QuotaAllocatedValue isnot 0#">Enabled<ad:else>Disabled</ad:if><ad:else>Disabled</ad:if></ad:template>
<ad:if test="#space.Groups.ContainsKey("VPS2012")#">VPS2012
========
CPUs: <ad:NumericQuota quota="VPS2012.CpuNumber" />
RAM: <ad:NumericQuota quota="VPS2012.Ram" />
HDD: <ad:NumericQuota quota="VPS2012.Hdd" /></ad:if>
<ad:if test="#space.Groups.ContainsKey("VPSForPC")#">VPSForPC
========
CPUs: <ad:NumericQuota quota="VPSForPC.CpuNumber" />
RAM: <ad:NumericQuota quota="VPSForPC.Ram" />
HDD: <ad:NumericQuota quota="VPSForPC.Hdd" /></ad:if>
<ad:if test="#space.Groups.ContainsKey("PROXMOX")#">PROXMOX
========
CPUs: <ad:NumericQuota quota="PROXMOX.CpuNumber" />
RAM: <ad:NumericQuota quota="PROXMOX.Ram" />
HDD: <ad:NumericQuota quota="PROXMOX.Hdd" /></ad:if>
<ad:if test="#Signup#">If you have any questions regarding your hosting account, feel free to contact our support department at any time.
Best regards,
HostingCompany.
Web Site: https://HostingCompany.com"
E-Mail: support@HostingCompany.com
</ad:if>')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'PasswordReminderLetter', N'CC', N'')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'PasswordReminderLetter', N'From', N'support@HostingCompany.com')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'PasswordReminderLetter', N'HtmlBody', N'<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Account Summary Information</title>
<style type="text/css">
.Summary { background-color: ##ffffff; padding: 5px; }
.Summary .Header { padding: 10px 0px 10px 10px; font-size: 16pt; background-color: ##E5F2FF; color: ##1F4978; border-bottom: solid 2px ##86B9F7; }
.Summary A { color: ##0153A4; }
.Summary { font-family: Tahoma; font-size: 9pt; }
.Summary H1 { font-size: 1.7em; color: ##1F4978; border-bottom: dotted 3px ##efefef; }
.Summary H2 { font-size: 1.3em; color: ##1F4978; }
.Summary TABLE { border: solid 1px ##e5e5e5; }
.Summary TH,
.Summary TD.Label { padding: 5px; font-size: 8pt; font-weight: bold; background-color: ##f5f5f5; }
.Summary TD { padding: 8px; font-size: 9pt; }
.Summary UL LI { font-size: 1.1em; font-weight: bold; }
.Summary UL UL LI { font-size: 0.9em; font-weight: normal; }
</style>
</head>
<body>
<div class="Summary">
<a name="top"></a>
<div class="Header">
Hosting Account Information
</div>
<p>
Hello #user.FirstName#,
</p>
<p>
Please, find below details of your control panel account. The one time password was generated for you. You should change the password after login.
</p>
<h1>Control Panel URL</h1>
<table>
<thead>
<tr>
<th>Control Panel URL</th>
<th>Username</th>
<th>One Time Password</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="http://panel.HostingCompany.com">http://panel.HostingCompany.com</a></td>
<td>#user.Username#</td>
<td>#user.Password#</td>
</tr>
</tbody>
</table>
<p>
If you have any questions regarding your hosting account, feel free to contact our support department at any time.
</p>
<p>
Best regards,<br />
SolidCP.<br />
Web Site: <a href="https://solidcp.com">https://solidcp.com</a><br />
E-Mail: <a href="mailto:support@solidcp.com">support@solidcp.com</a>
</p>
</div>
</body>
</html>')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'PasswordReminderLetter', N'Priority', N'Normal')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'PasswordReminderLetter', N'Subject', N'Password reminder for #user.FirstName# #user.LastName#')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'PasswordReminderLetter', N'TextBody', N'=================================
Hosting Account Information
=================================
Hello #user.FirstName#,
Please, find below details of your control panel account. The one time password was generated for you. You should change the password after login.
Control Panel URL: https://panel.solidcp.com
Username: #user.Username#
One Time Password: #user.Password#
If you have any questions regarding your hosting account, feel free to contact our support department at any time.
Best regards,
SolidCP.
Web Site: https://solidcp.com"
E-Mail: support@solidcp.com')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'SharePointPolicy', N'GroupNamePolicy', N'True;-;1;20;;;')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'SharePointPolicy', N'UserNamePolicy', N'True;-;1;20;;;')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'SharePointPolicy', N'UserPasswordPolicy', N'True;5;20;0;1;0;True')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'WebPolicy', N'AddParkingPage', N'True')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'WebPolicy', N'AddRandomDomainString', N'False')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'WebPolicy', N'AnonymousAccountPolicy', N'True;;5;20;;_web;')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'WebPolicy', N'AspInstalled', N'True')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'WebPolicy', N'AspNetInstalled', N'2')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'WebPolicy', N'CgiBinInstalled', N'False')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'WebPolicy', N'DefaultDocuments', N'Default.htm,Default.asp,index.htm,Default.aspx')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'WebPolicy', N'EnableAnonymousAccess', N'True')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'WebPolicy', N'EnableBasicAuthentication', N'False')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'WebPolicy', N'EnableDedicatedPool', N'False')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'WebPolicy', N'EnableDirectoryBrowsing', N'False')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'WebPolicy', N'EnableParentPaths', N'False')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'WebPolicy', N'EnableParkingPageTokens', N'False')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'WebPolicy', N'EnableWindowsAuthentication', N'True')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'WebPolicy', N'EnableWritePermissions', N'False')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'WebPolicy', N'FrontPageAccountPolicy', N'True;;1;20;;;')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'WebPolicy', N'FrontPagePasswordPolicy', N'True;5;20;0;1;0;False')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'WebPolicy', N'ParkingPageContent', N'<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>The web site is under construction</title>
<style type="text/css">
H1 { font-size: 16pt; margin-bottom: 4px; }
H2 { font-size: 14pt; margin-bottom: 4px; font-weight: normal; }
</style>
</head>
<body>
<div id="PageOutline">
<h1>This web site has just been created from <a href="https://www.SolidCP.com">SolidCP </a> and it is still under construction.</h1>
<h2>The web site is hosted by <a href="https://solidcp.com">SolidCP</a>.</h2>
</div>
</body>
</html>')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'WebPolicy', N'ParkingPageName', N'default.aspx')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'WebPolicy', N'PerlInstalled', N'False')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'WebPolicy', N'PhpInstalled', N'')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'WebPolicy', N'PublishingProfile', N'<?xml version="1.0" encoding="utf-8"?>
<publishData>
<ad:if test="#WebSite.WebDeploySitePublishingEnabled#">
<publishProfile
profileName="#WebSite.Name# - Web Deploy"
publishMethod="MSDeploy"
publishUrl="#WebSite["WmSvcServiceUrl"]#:#WebSite["WmSvcServicePort"]#"
msdeploySite="#WebSite.Name#"
userName="#WebSite.WebDeployPublishingAccount#"
userPWD="#WebSite.WebDeployPublishingPassword#"
destinationAppUrl="http://#WebSite.Name#/"
<ad:if test="#Not(IsNull(MsSqlDatabase)) and Not(IsNull(MsSqlUser))#">SQLServerDBConnectionString="server=#MsSqlServerExternalAddress#;database=#MsSqlDatabase.Name#;uid=#MsSqlUser.Name#;pwd=#MsSqlUser.Password#"</ad:if>
<ad:if test="#Not(IsNull(MySqlDatabase)) and Not(IsNull(MySqlUser))#">mySQLDBConnectionString="server=#MySqlAddress#;database=#MySqlDatabase.Name#;uid=#MySqlUser.Name#;pwd=#MySqlUser.Password#"</ad:if>
<ad:if test="#Not(IsNull(MariaDBDatabase)) and Not(IsNull(MariaDBUser))#">MariaDBDBConnectionString="server=#MariaDBAddress#;database=#MariaDBDatabase.Name#;uid=#MariaDBUser.Name#;pwd=#MariaDBUser.Password#"</ad:if>
hostingProviderForumLink="https://solidcp.com/support"
controlPanelLink="https://panel.solidcp.com/"
/>
</ad:if>
<ad:if test="#IsDefined("FtpAccount")#">
<publishProfile
profileName="#WebSite.Name# - FTP"
publishMethod="FTP"
publishUrl="ftp://#FtpServiceAddress#"
ftpPassiveMode="True"
userName="#FtpAccount.Name#"
userPWD="#FtpAccount.Password#"
destinationAppUrl="http://#WebSite.Name#/"
<ad:if test="#Not(IsNull(MsSqlDatabase)) and Not(IsNull(MsSqlUser))#">SQLServerDBConnectionString="server=#MsSqlServerExternalAddress#;database=#MsSqlDatabase.Name#;uid=#MsSqlUser.Name#;pwd=#MsSqlUser.Password#"</ad:if>
<ad:if test="#Not(IsNull(MySqlDatabase)) and Not(IsNull(MySqlUser))#">mySQLDBConnectionString="server=#MySqlAddress#;database=#MySqlDatabase.Name#;uid=#MySqlUser.Name#;pwd=#MySqlUser.Password#"</ad:if>
<ad:if test="#Not(IsNull(MariaDBDatabase)) and Not(IsNull(MariaDBUser))#">MariaDBDBConnectionString="server=#MariaDBAddress#;database=#MariaDBDatabase.Name#;uid=#MariaDBUser.Name#;pwd=#MariaDBUser.Password#"</ad:if>
hostingProviderForumLink="https://solidcp.com/support"
controlPanelLink="https://panel.solidcp.com/"
/>
</ad:if>
</publishData>
<!--
Control Panel:
Username: #User.Username#
Password: #User.Password#
Technical Contact:
support@solidcp.com
-->')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'WebPolicy', N'PythonInstalled', N'False')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'WebPolicy', N'SecuredGroupNamePolicy', N'True;;1;20;;;')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'WebPolicy', N'SecuredUserNamePolicy', N'True;;1;20;;;')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'WebPolicy', N'SecuredUserPasswordPolicy', N'True;5;20;0;1;0;False')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'WebPolicy', N'VirtDirNamePolicy', N'True;-;3;50;;;')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'WebPolicy', N'WebDataFolder', N'\[DOMAIN_NAME]\data')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'WebPolicy', N'WebLogsFolder', N'\[DOMAIN_NAME]\logs')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'WebPolicy', N'WebRootFolder', N'\[DOMAIN_NAME]\wwwroot')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'SolidCPPolicy', N'DemoMessage', N'When user account is in demo mode the majority of operations are
disabled, especially those ones that modify or delete records.
You are welcome to ask your questions or place comments about
this demo on <a href="http://forum.SolidCP.net"
target="_blank">SolidCP Support Forum</a>')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'SolidCPPolicy', N'ForbiddenIP', N'')
GO
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'SolidCPPolicy', N'PasswordPolicy', N'True;6;20;0;1;0;True')
GO
INSERT [dbo].[Versions] ([DatabaseVersion], [BuildDate]) VALUES (N'1.0', CAST(0x00009D5400000000 AS DateTime))
GO
INSERT [dbo].[Versions] ([DatabaseVersion], [BuildDate]) VALUES (N'1.0.1.0', CAST(0x00009DB500D453BD AS DateTime))
GO
INSERT [dbo].[Versions] ([DatabaseVersion], [BuildDate]) VALUES (N'1.0.2.0', CAST(0x00009DE600000000 AS DateTime))
GO
INSERT [dbo].[Versions] ([DatabaseVersion], [BuildDate]) VALUES (N'1.1.0.9', CAST(0x00009E3000000000 AS DateTime))
GO
INSERT [dbo].[Versions] ([DatabaseVersion], [BuildDate]) VALUES (N'1.1.2.13', CAST(0x00009EC600000000 AS DateTime))
GO
INSERT [dbo].[Versions] ([DatabaseVersion], [BuildDate]) VALUES (N'1.2.0.38', CAST(0x00009F1F00000000 AS DateTime))
GO
INSERT [dbo].[Versions] ([DatabaseVersion], [BuildDate]) VALUES (N'1.2.1.6', CAST(0x0000A02300000000 AS DateTime))
GO
INSERT [dbo].[Versions] ([DatabaseVersion], [BuildDate]) VALUES (N'2.0.0.228', CAST(0x0000A12000000000 AS DateTime))
GO
SET ANSI_PADDING ON
GO
ALTER TABLE [dbo].[ecContracts] ADD CONSTRAINT [UQ_ecContracts_ContractID] UNIQUE NONCLUSTERED
(
[ContractID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
GO
SET ANSI_PADDING ON
GO
ALTER TABLE [dbo].[ecCustomersPayments] ADD CONSTRAINT [IX_ecCustomersPayments] UNIQUE NONCLUSTERED
(
[TransactionID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
GO
SET ANSI_PADDING ON
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_ecTaxations] ON [dbo].[ecTaxations]
(
[ResellerID] ASC,
[Country] ASC,
[State] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
GO
SET ANSI_PADDING ON
GO
ALTER TABLE [dbo].[ExchangeAccountEmailAddresses] ADD CONSTRAINT [IX_ExchangeAccountEmailAddresses_UniqueEmail] UNIQUE NONCLUSTERED
(
[EmailAddress] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
GO
SET ANSI_PADDING ON
GO
ALTER TABLE [dbo].[ExchangeAccounts] ADD CONSTRAINT [IX_ExchangeAccounts_UniqueAccountName] UNIQUE NONCLUSTERED
(
[AccountName] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
GO
ALTER TABLE [dbo].[ExchangeMailboxPlans] ADD CONSTRAINT [IX_ExchangeMailboxPlans] UNIQUE NONCLUSTERED
(
[MailboxPlanId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
GO
ALTER TABLE [dbo].[ExchangeOrganizationDomains] ADD CONSTRAINT [IX_ExchangeOrganizationDomains_UniqueDomain] UNIQUE NONCLUSTERED
(
[DomainID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
GO
SET ANSI_PADDING ON
GO
ALTER TABLE [dbo].[ExchangeOrganizations] ADD CONSTRAINT [IX_ExchangeOrganizations_UniqueOrg] UNIQUE NONCLUSTERED
(
[OrganizationID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
GO
ALTER TABLE [dbo].[LyncUserPlans] ADD CONSTRAINT [IX_LyncUserPlans] UNIQUE NONCLUSTERED
(
[LyncUserPlanId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
GO
SET ANSI_PADDING ON
GO
ALTER TABLE [dbo].[Users] ADD CONSTRAINT [IX_Users_Username] UNIQUE NONCLUSTERED
(
[Username] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
GO
ALTER TABLE [dbo].[BlackBerryUsers] ADD CONSTRAINT [DF_BlackBerryUsers_CreatedDate] DEFAULT (getdate()) FOR [CreatedDate]
GO
ALTER TABLE [dbo].[Comments] ADD CONSTRAINT [DF_Comments_CreatedDate] DEFAULT (getdate()) FOR [CreatedDate]
GO
ALTER TABLE [dbo].[CRMUsers] ADD CONSTRAINT [DF_Table_1_CreateDate] DEFAULT (getdate()) FOR [CreatedDate]
GO
ALTER TABLE [dbo].[CRMUsers] ADD CONSTRAINT [DF_CRMUsers_ChangedDate] DEFAULT (getdate()) FOR [ChangedDate]
GO
ALTER TABLE [dbo].[Domains] ADD CONSTRAINT [DF_Domains_AllowedForHosting] DEFAULT ((0)) FOR [HostingAllowed]
GO
ALTER TABLE [dbo].[Domains] ADD CONSTRAINT [DF_Domains_SubDomainID] DEFAULT ((0)) FOR [IsSubDomain]
GO
ALTER TABLE [dbo].[Domains] ADD CONSTRAINT [DF_Domains_IsInstantAlias] DEFAULT ((0)) FOR [IsInstantAlias]
GO
ALTER TABLE [dbo].[ecBillingCycles] ADD CONSTRAINT [DF_ecBillingCycles_Created] DEFAULT (getdate()) FOR [Created]
GO
ALTER TABLE [dbo].[ecCategory] ADD CONSTRAINT [DF_EC_Categories_Level] DEFAULT ((0)) FOR [Level]
GO
ALTER TABLE [dbo].[ecCategory] ADD CONSTRAINT [DF_ecCategory_Created] DEFAULT (getutcdate()) FOR [Created]
GO
ALTER TABLE [dbo].[ecCategory] ADD CONSTRAINT [DF_EC_Categories_CategoryOrder] DEFAULT ((0)) FOR [ItemOrder]
GO
ALTER TABLE [dbo].[ecContracts] ADD CONSTRAINT [DF__ecContrac__Opene__668030F6] DEFAULT (getdate()) FOR [OpenedDate]
GO
ALTER TABLE [dbo].[ecContracts] ADD CONSTRAINT [DF__ecContrac__Balan__6774552F] DEFAULT ((0)) FOR [Balance]
GO
ALTER TABLE [dbo].[ecCustomersPayments] ADD CONSTRAINT [DF_EC_Payments_PaymentDate] DEFAULT (getdate()) FOR [Created]
GO
ALTER TABLE [dbo].[ecCustomersPayments] ADD CONSTRAINT [DF_EC_Payments_GatewayID] DEFAULT ((0)) FOR [PluginID]
GO
ALTER TABLE [dbo].[ecHostingPlansBillingCycles] ADD CONSTRAINT [DF_ecPlanBillingCycles_SetupFee] DEFAULT ((0)) FOR [SetupFee]
GO
ALTER TABLE [dbo].[ecHostingPlansBillingCycles] ADD CONSTRAINT [DF_ecPlanBillingCycles_RecurringFee] DEFAULT ((0)) FOR [RecurringFee]
GO
ALTER TABLE [dbo].[ecInvoice] ADD CONSTRAINT [DF_EC_Invoices_CreatedDate] DEFAULT (getutcdate()) FOR [Created]
GO
ALTER TABLE [dbo].[ecInvoice] ADD CONSTRAINT [DF_ecInvoice_Total] DEFAULT ((0)) FOR [Total]
GO
ALTER TABLE [dbo].[ecInvoice] ADD CONSTRAINT [DF_ecInvoice_SubTotal] DEFAULT ((0)) FOR [SubTotal]
GO
ALTER TABLE [dbo].[ecInvoice] ADD CONSTRAINT [DF__ecInvoice__Taxat__4119A21D] DEFAULT ((0)) FOR [TaxationID]
GO
ALTER TABLE [dbo].[ecInvoiceItems] ADD CONSTRAINT [DF_ecInvoiceItems_Total] DEFAULT ((0)) FOR [Total]
GO
ALTER TABLE [dbo].[ecInvoiceItems] ADD CONSTRAINT [DF_ecInvoiceItems_SubTotal] DEFAULT ((0)) FOR [SubTotal]
GO
ALTER TABLE [dbo].[ecInvoiceItems] ADD CONSTRAINT [DF_ecInvoiceItems_UnitPrice] DEFAULT ((0)) FOR [UnitPrice]
GO
ALTER TABLE [dbo].[ecInvoiceItems] ADD CONSTRAINT [DF_ecInvoiceItems_Processed] DEFAULT ((0)) FOR [Processed]
GO
ALTER TABLE [dbo].[ecPaymentProfiles] ADD CONSTRAINT [DF_ecPaymentProfiles_Created] DEFAULT (getdate()) FOR [Created]
GO
ALTER TABLE [dbo].[ecProduct] ADD CONSTRAINT [DF_ecProduct_Created] DEFAULT (getutcdate()) FOR [Created]
GO
ALTER TABLE [dbo].[ecProductType] ADD CONSTRAINT [DF_ecProductType_Created] DEFAULT (getutcdate()) FOR [Created]
GO
ALTER TABLE [dbo].[ecService] ADD CONSTRAINT [DF_ecService_Status] DEFAULT ((0)) FOR [Status]
GO
ALTER TABLE [dbo].[ecService] ADD CONSTRAINT [DF_SpaceInstance_CreatedDate] DEFAULT (getutcdate()) FOR [Created]
GO
ALTER TABLE [dbo].[ecService] ADD CONSTRAINT [DF_SpaceInstance_ModifiedDate] DEFAULT (getutcdate()) FOR [Modified]
GO
ALTER TABLE [dbo].[ecServiceHandlersResponses] ADD CONSTRAINT [DF_ecServiceHandlerResponses_Received] DEFAULT (getdate()) FOR [Received]
GO
ALTER TABLE [dbo].[ecSupportedPluginLog] ADD CONSTRAINT [DF_ecSpacePluginLog_Created] DEFAULT (getdate()) FOR [Created]
GO
ALTER TABLE [dbo].[ecSystemTriggers] ADD CONSTRAINT [DF_ecSystemTriggers_TriggerID] DEFAULT (newid()) FOR [TriggerID]
GO
ALTER TABLE [dbo].[ExchangeAccounts] ADD CONSTRAINT [DF__ExchangeA__Creat__59B045BD] DEFAULT (getdate()) FOR [CreatedDate]
GO
ALTER TABLE [dbo].[ExchangeOrganizationDomains] ADD CONSTRAINT [DF_ExchangeOrganizationDomains_IsHost] DEFAULT ((0)) FOR [IsHost]
GO
ALTER TABLE [dbo].[ExchangeOrganizationDomains] ADD CONSTRAINT [DF_ExchangeOrganizationDomains_DomainTypeID] DEFAULT ((0)) FOR [DomainTypeID]
GO
ALTER TABLE [dbo].[LyncUsers] ADD CONSTRAINT [DF_LyncUsers_CreatedDate] DEFAULT (getdate()) FOR [CreatedDate]
GO
ALTER TABLE [dbo].[LyncUsers] ADD CONSTRAINT [DF_LyncUsers_ChangedDate] DEFAULT (getdate()) FOR [ModifiedDate]
GO
ALTER TABLE [dbo].[OCSUsers] ADD CONSTRAINT [DF_OCSUsers_CreatedDate] DEFAULT (getdate()) FOR [CreatedDate]
GO
ALTER TABLE [dbo].[OCSUsers] ADD CONSTRAINT [DF_OCSUsers_ChangedDate] DEFAULT (getdate()) FOR [ModifiedDate]
GO
ALTER TABLE [dbo].[Packages] ADD CONSTRAINT [DF_Packages_OverrideQuotas] DEFAULT ((0)) FOR [OverrideQuotas]
GO
ALTER TABLE [dbo].[Quotas] ADD CONSTRAINT [DF_ResourceGroupQuotas_QuotaOrder] DEFAULT ((1)) FOR [QuotaOrder]
GO
ALTER TABLE [dbo].[Quotas] ADD CONSTRAINT [DF_ResourceGroupQuotas_QuotaTypeID] DEFAULT ((2)) FOR [QuotaTypeID]
GO
ALTER TABLE [dbo].[Quotas] ADD CONSTRAINT [DF_Quotas_ServiceQuota] DEFAULT ((0)) FOR [ServiceQuota]
GO
ALTER TABLE [dbo].[ResourceGroupDnsRecords] ADD CONSTRAINT [DF_ResourceGroupDnsRecords_RecordOrder] DEFAULT ((1)) FOR [RecordOrder]
GO
ALTER TABLE [dbo].[ResourceGroups] ADD CONSTRAINT [DF_ResourceGroups_GroupOrder] DEFAULT ((1)) FOR [GroupOrder]
GO
ALTER TABLE [dbo].[ScheduleTaskParameters] ADD CONSTRAINT [DF_ScheduleTaskParameters_ParameterOrder] DEFAULT ((0)) FOR [ParameterOrder]
GO
ALTER TABLE [dbo].[Servers] ADD CONSTRAINT [DF_Servers_DisplayName] DEFAULT ('') FOR [ServerUrl]
GO
ALTER TABLE [dbo].[Servers] ADD CONSTRAINT [DF_Servers_VirtualServer] DEFAULT ((0)) FOR [VirtualServer]
GO
ALTER TABLE [dbo].[Servers] ADD CONSTRAINT [DF_Servers_ADEnabled] DEFAULT ((0)) FOR [ADEnabled]
GO
ALTER TABLE [dbo].[ServiceItemTypes] ADD CONSTRAINT [DF_ServiceItemTypes_TypeOrder] DEFAULT ((1)) FOR [TypeOrder]
GO
ALTER TABLE [dbo].[ServiceItemTypes] ADD CONSTRAINT [DF_ServiceItemTypes_Importable] DEFAULT ((1)) FOR [Importable]
GO
ALTER TABLE [dbo].[ServiceItemTypes] ADD CONSTRAINT [DF_ServiceItemTypes_Backup] DEFAULT ((1)) FOR [Backupable]
GO
ALTER TABLE [dbo].[Users] ADD CONSTRAINT [DF_Users_Demo] DEFAULT ((0)) FOR [IsDemo]
GO
ALTER TABLE [dbo].[Users] ADD CONSTRAINT [DF_Users_IsPeer] DEFAULT ((0)) FOR [IsPeer]
GO
ALTER TABLE [dbo].[Users] ADD CONSTRAINT [DF_Users_HtmlLetters] DEFAULT ((1)) FOR [HtmlMail]
GO
ALTER TABLE [dbo].[BlackBerryUsers] WITH CHECK ADD CONSTRAINT [FK_BlackBerryUsers_ExchangeAccounts] FOREIGN KEY([AccountId])
REFERENCES [dbo].[ExchangeAccounts] ([AccountID])
GO
ALTER TABLE [dbo].[BlackBerryUsers] CHECK CONSTRAINT [FK_BlackBerryUsers_ExchangeAccounts]
GO
ALTER TABLE [dbo].[Comments] WITH CHECK ADD CONSTRAINT [FK_Comments_Users] FOREIGN KEY([UserID])
REFERENCES [dbo].[Users] ([UserID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[Comments] CHECK CONSTRAINT [FK_Comments_Users]
GO
ALTER TABLE [dbo].[CRMUsers] WITH CHECK ADD CONSTRAINT [FK_CRMUsers_ExchangeAccounts] FOREIGN KEY([AccountID])
REFERENCES [dbo].[ExchangeAccounts] ([AccountID])
GO
ALTER TABLE [dbo].[CRMUsers] CHECK CONSTRAINT [FK_CRMUsers_ExchangeAccounts]
GO
ALTER TABLE [dbo].[Domains] WITH CHECK ADD CONSTRAINT [FK_Domains_Packages] FOREIGN KEY([PackageID])
REFERENCES [dbo].[Packages] ([PackageID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[Domains] CHECK CONSTRAINT [FK_Domains_Packages]
GO
ALTER TABLE [dbo].[Domains] WITH CHECK ADD CONSTRAINT [FK_Domains_ServiceItems_MailDomain] FOREIGN KEY([MailDomainID])
REFERENCES [dbo].[ServiceItems] ([ItemID])
GO
ALTER TABLE [dbo].[Domains] CHECK CONSTRAINT [FK_Domains_ServiceItems_MailDomain]
GO
ALTER TABLE [dbo].[Domains] WITH CHECK ADD CONSTRAINT [FK_Domains_ServiceItems_WebSite] FOREIGN KEY([WebSiteID])
REFERENCES [dbo].[ServiceItems] ([ItemID])
GO
ALTER TABLE [dbo].[Domains] CHECK CONSTRAINT [FK_Domains_ServiceItems_WebSite]
GO
ALTER TABLE [dbo].[Domains] WITH CHECK ADD CONSTRAINT [FK_Domains_ServiceItems_ZoneItem] FOREIGN KEY([ZoneItemID])
REFERENCES [dbo].[ServiceItems] ([ItemID])
GO
ALTER TABLE [dbo].[Domains] CHECK CONSTRAINT [FK_Domains_ServiceItems_ZoneItem]
GO
ALTER TABLE [dbo].[ecAddonProducts] WITH CHECK ADD CONSTRAINT [FK_ecAddonProducts_ecProduct] FOREIGN KEY([AddonID])
REFERENCES [dbo].[ecProduct] ([ProductID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ecAddonProducts] CHECK CONSTRAINT [FK_ecAddonProducts_ecProduct]
GO
ALTER TABLE [dbo].[ecCategory] WITH CHECK ADD CONSTRAINT [FK_ecCategory_ecCategory] FOREIGN KEY([ParentID])
REFERENCES [dbo].[ecCategory] ([CategoryID])
GO
ALTER TABLE [dbo].[ecCategory] CHECK CONSTRAINT [FK_ecCategory_ecCategory]
GO
ALTER TABLE [dbo].[ecDomainSvcs] WITH CHECK ADD CONSTRAINT [FK_ecDomainsSvcs_ecService] FOREIGN KEY([ServiceID])
REFERENCES [dbo].[ecService] ([ServiceID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ecDomainSvcs] CHECK CONSTRAINT [FK_ecDomainsSvcs_ecService]
GO
ALTER TABLE [dbo].[ecDomainSvcsCycles] WITH CHECK ADD CONSTRAINT [FK_ecDomainsSvcsCycles_ecService] FOREIGN KEY([ServiceID])
REFERENCES [dbo].[ecService] ([ServiceID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ecDomainSvcsCycles] CHECK CONSTRAINT [FK_ecDomainsSvcsCycles_ecService]
GO
ALTER TABLE [dbo].[ecHostingAddons] WITH CHECK ADD CONSTRAINT [FK_ecHostingAddons_ecProduct] FOREIGN KEY([ProductID])
REFERENCES [dbo].[ecProduct] ([ProductID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ecHostingAddons] CHECK CONSTRAINT [FK_ecHostingAddons_ecProduct]
GO
ALTER TABLE [dbo].[ecHostingAddonsCycles] WITH CHECK ADD CONSTRAINT [FK_ecHostingAddonsCycles_ecBillingCycles] FOREIGN KEY([CycleID])
REFERENCES [dbo].[ecBillingCycles] ([CycleID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ecHostingAddonsCycles] CHECK CONSTRAINT [FK_ecHostingAddonsCycles_ecBillingCycles]
GO
ALTER TABLE [dbo].[ecHostingAddonsCycles] WITH CHECK ADD CONSTRAINT [FK_ecHostingAddonsCycles_ecProduct] FOREIGN KEY([ProductID])
REFERENCES [dbo].[ecProduct] ([ProductID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ecHostingAddonsCycles] CHECK CONSTRAINT [FK_ecHostingAddonsCycles_ecProduct]
GO
ALTER TABLE [dbo].[ecHostingAddonSvcs] WITH CHECK ADD CONSTRAINT [FK_ecAddonPackagesSvcs_ecService] FOREIGN KEY([ServiceID])
REFERENCES [dbo].[ecService] ([ServiceID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ecHostingAddonSvcs] CHECK CONSTRAINT [FK_ecAddonPackagesSvcs_ecService]
GO
ALTER TABLE [dbo].[ecHostingAddonSvcsCycles] WITH CHECK ADD CONSTRAINT [FK_ecAddonPackagesSvcsCycles_ecService] FOREIGN KEY([ServiceID])
REFERENCES [dbo].[ecService] ([ServiceID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ecHostingAddonSvcsCycles] CHECK CONSTRAINT [FK_ecAddonPackagesSvcsCycles_ecService]
GO
ALTER TABLE [dbo].[ecHostingPackageSvcs] WITH CHECK ADD CONSTRAINT [FK_ecPackagesSvcs_ecService] FOREIGN KEY([ServiceID])
REFERENCES [dbo].[ecService] ([ServiceID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ecHostingPackageSvcs] CHECK CONSTRAINT [FK_ecPackagesSvcs_ecService]
GO
ALTER TABLE [dbo].[ecHostingPackageSvcsCycles] WITH CHECK ADD CONSTRAINT [FK_ecPackagesSvcsCycles_ecService] FOREIGN KEY([ServiceID])
REFERENCES [dbo].[ecService] ([ServiceID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ecHostingPackageSvcsCycles] CHECK CONSTRAINT [FK_ecPackagesSvcsCycles_ecService]
GO
ALTER TABLE [dbo].[ecHostingPlans] WITH CHECK ADD CONSTRAINT [FK_ecHostingPlans_ecProduct] FOREIGN KEY([ProductID])
REFERENCES [dbo].[ecProduct] ([ProductID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ecHostingPlans] CHECK CONSTRAINT [FK_ecHostingPlans_ecProduct]
GO
ALTER TABLE [dbo].[ecHostingPlansBillingCycles] WITH CHECK ADD CONSTRAINT [FK_ecHostingPlansBillingCycles_ecBillingCycles] FOREIGN KEY([CycleID])
REFERENCES [dbo].[ecBillingCycles] ([CycleID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ecHostingPlansBillingCycles] CHECK CONSTRAINT [FK_ecHostingPlansBillingCycles_ecBillingCycles]
GO
ALTER TABLE [dbo].[ecHostingPlansBillingCycles] WITH CHECK ADD CONSTRAINT [FK_ecHostingPlansBillingCycles_ecProduct] FOREIGN KEY([ProductID])
REFERENCES [dbo].[ecProduct] ([ProductID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ecHostingPlansBillingCycles] CHECK CONSTRAINT [FK_ecHostingPlansBillingCycles_ecProduct]
GO
ALTER TABLE [dbo].[ecInvoiceItems] WITH CHECK ADD CONSTRAINT [FK_ecInvoiceItems_ecInvoice] FOREIGN KEY([InvoiceID])
REFERENCES [dbo].[ecInvoice] ([InvoiceID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ecInvoiceItems] CHECK CONSTRAINT [FK_ecInvoiceItems_ecInvoice]
GO
ALTER TABLE [dbo].[ecPaymentMethods] WITH CHECK ADD CONSTRAINT [FK_ecPaymentMethods_ecSupportedPlugins] FOREIGN KEY([PluginID])
REFERENCES [dbo].[ecSupportedPlugins] ([PluginID])
GO
ALTER TABLE [dbo].[ecPaymentMethods] CHECK CONSTRAINT [FK_ecPaymentMethods_ecSupportedPlugins]
GO
ALTER TABLE [dbo].[ecProduct] WITH CHECK ADD CONSTRAINT [FK_ecProduct_ecProductType] FOREIGN KEY([TypeID])
REFERENCES [dbo].[ecProductType] ([TypeID])
GO
ALTER TABLE [dbo].[ecProduct] CHECK CONSTRAINT [FK_ecProduct_ecProductType]
GO
ALTER TABLE [dbo].[ecProductCategories] WITH CHECK ADD CONSTRAINT [FK_EC_ProductsToCategories_EC_Categories] FOREIGN KEY([CategoryID])
REFERENCES [dbo].[ecCategory] ([CategoryID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ecProductCategories] CHECK CONSTRAINT [FK_EC_ProductsToCategories_EC_Categories]
GO
ALTER TABLE [dbo].[ecProductCategories] WITH CHECK ADD CONSTRAINT [FK_EC_ProductsToCategories_EC_Products] FOREIGN KEY([ProductID])
REFERENCES [dbo].[ecProduct] ([ProductID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ecProductCategories] CHECK CONSTRAINT [FK_EC_ProductsToCategories_EC_Products]
GO
ALTER TABLE [dbo].[ecProductsHighlights] WITH CHECK ADD CONSTRAINT [FK_ecProductsHighlights_ecProduct] FOREIGN KEY([ProductID])
REFERENCES [dbo].[ecProduct] ([ProductID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ecProductsHighlights] CHECK CONSTRAINT [FK_ecProductsHighlights_ecProduct]
GO
ALTER TABLE [dbo].[ecService] WITH CHECK ADD CONSTRAINT [FK_ecService_ecProductType] FOREIGN KEY([TypeID])
REFERENCES [dbo].[ecProductType] ([TypeID])
GO
ALTER TABLE [dbo].[ecService] CHECK CONSTRAINT [FK_ecService_ecProductType]
GO
ALTER TABLE [dbo].[ecSvcsUsageLog] WITH CHECK ADD CONSTRAINT [FK_ecSvcsUsageLog_ecService] FOREIGN KEY([ServiceID])
REFERENCES [dbo].[ecService] ([ServiceID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ecSvcsUsageLog] CHECK CONSTRAINT [FK_ecSvcsUsageLog_ecService]
GO
ALTER TABLE [dbo].[ecTopLevelDomains] WITH CHECK ADD CONSTRAINT [FK_ecTopLevelDomains_ecProduct] FOREIGN KEY([ProductID])
REFERENCES [dbo].[ecProduct] ([ProductID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ecTopLevelDomains] CHECK CONSTRAINT [FK_ecTopLevelDomains_ecProduct]
GO
ALTER TABLE [dbo].[ecTopLevelDomainsCycles] WITH CHECK ADD CONSTRAINT [FK_ecTopLevelDomainsCycles_ecProduct] FOREIGN KEY([ProductID])
REFERENCES [dbo].[ecProduct] ([ProductID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ecTopLevelDomainsCycles] CHECK CONSTRAINT [FK_ecTopLevelDomainsCycles_ecProduct]
GO
ALTER TABLE [dbo].[ExchangeAccountEmailAddresses] WITH CHECK ADD CONSTRAINT [FK_ExchangeAccountEmailAddresses_ExchangeAccounts] FOREIGN KEY([AccountID])
REFERENCES [dbo].[ExchangeAccounts] ([AccountID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ExchangeAccountEmailAddresses] CHECK CONSTRAINT [FK_ExchangeAccountEmailAddresses_ExchangeAccounts]
GO
ALTER TABLE [dbo].[ExchangeAccounts] WITH CHECK ADD CONSTRAINT [FK_ExchangeAccounts_ExchangeMailboxPlans] FOREIGN KEY([MailboxPlanId])
REFERENCES [dbo].[ExchangeMailboxPlans] ([MailboxPlanId])
GO
ALTER TABLE [dbo].[ExchangeAccounts] CHECK CONSTRAINT [FK_ExchangeAccounts_ExchangeMailboxPlans]
GO
ALTER TABLE [dbo].[ExchangeAccounts] WITH CHECK ADD CONSTRAINT [FK_ExchangeAccounts_ServiceItems] FOREIGN KEY([ItemID])
REFERENCES [dbo].[ServiceItems] ([ItemID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ExchangeAccounts] CHECK CONSTRAINT [FK_ExchangeAccounts_ServiceItems]
GO
ALTER TABLE [dbo].[ExchangeMailboxPlans] WITH CHECK ADD CONSTRAINT [FK_ExchangeMailboxPlans_ExchangeOrganizations] FOREIGN KEY([ItemID])
REFERENCES [dbo].[ExchangeOrganizations] ([ItemID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ExchangeMailboxPlans] CHECK CONSTRAINT [FK_ExchangeMailboxPlans_ExchangeOrganizations]
GO
ALTER TABLE [dbo].[ExchangeOrganizationDomains] WITH CHECK ADD CONSTRAINT [FK_ExchangeOrganizationDomains_ServiceItems] FOREIGN KEY([ItemID])
REFERENCES [dbo].[ServiceItems] ([ItemID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ExchangeOrganizationDomains] CHECK CONSTRAINT [FK_ExchangeOrganizationDomains_ServiceItems]
GO
ALTER TABLE [dbo].[ExchangeOrganizations] WITH CHECK ADD CONSTRAINT [FK_ExchangeOrganizations_ServiceItems] FOREIGN KEY([ItemID])
REFERENCES [dbo].[ServiceItems] ([ItemID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ExchangeOrganizations] CHECK CONSTRAINT [FK_ExchangeOrganizations_ServiceItems]
GO
ALTER TABLE [dbo].[GlobalDnsRecords] WITH CHECK ADD CONSTRAINT [FK_GlobalDnsRecords_IPAddresses] FOREIGN KEY([IPAddressID])
REFERENCES [dbo].[IPAddresses] ([AddressID])
GO
ALTER TABLE [dbo].[GlobalDnsRecords] CHECK CONSTRAINT [FK_GlobalDnsRecords_IPAddresses]
GO
ALTER TABLE [dbo].[GlobalDnsRecords] WITH CHECK ADD CONSTRAINT [FK_GlobalDnsRecords_Packages] FOREIGN KEY([PackageID])
REFERENCES [dbo].[Packages] ([PackageID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[GlobalDnsRecords] CHECK CONSTRAINT [FK_GlobalDnsRecords_Packages]
GO
ALTER TABLE [dbo].[GlobalDnsRecords] WITH CHECK ADD CONSTRAINT [FK_GlobalDnsRecords_Servers] FOREIGN KEY([ServerID])
REFERENCES [dbo].[Servers] ([ServerID])
GO
ALTER TABLE [dbo].[GlobalDnsRecords] CHECK CONSTRAINT [FK_GlobalDnsRecords_Servers]
GO
ALTER TABLE [dbo].[GlobalDnsRecords] WITH CHECK ADD CONSTRAINT [FK_GlobalDnsRecords_Services] FOREIGN KEY([ServiceID])
REFERENCES [dbo].[Services] ([ServiceID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[GlobalDnsRecords] CHECK CONSTRAINT [FK_GlobalDnsRecords_Services]
GO
ALTER TABLE [dbo].[HostingPlanQuotas] WITH CHECK ADD CONSTRAINT [FK_HostingPlanQuotas_HostingPlans] FOREIGN KEY([PlanID])
REFERENCES [dbo].[HostingPlans] ([PlanID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[HostingPlanQuotas] CHECK CONSTRAINT [FK_HostingPlanQuotas_HostingPlans]
GO
ALTER TABLE [dbo].[HostingPlanQuotas] WITH CHECK ADD CONSTRAINT [FK_HostingPlanQuotas_Quotas] FOREIGN KEY([QuotaID])
REFERENCES [dbo].[Quotas] ([QuotaID])
GO
ALTER TABLE [dbo].[HostingPlanQuotas] CHECK CONSTRAINT [FK_HostingPlanQuotas_Quotas]
GO
ALTER TABLE [dbo].[HostingPlanResources] WITH CHECK ADD CONSTRAINT [FK_HostingPlanResources_HostingPlans] FOREIGN KEY([PlanID])
REFERENCES [dbo].[HostingPlans] ([PlanID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[HostingPlanResources] CHECK CONSTRAINT [FK_HostingPlanResources_HostingPlans]
GO
ALTER TABLE [dbo].[HostingPlanResources] WITH CHECK ADD CONSTRAINT [FK_HostingPlanResources_ResourceGroups] FOREIGN KEY([GroupID])
REFERENCES [dbo].[ResourceGroups] ([GroupID])
GO
ALTER TABLE [dbo].[HostingPlanResources] CHECK CONSTRAINT [FK_HostingPlanResources_ResourceGroups]
GO
ALTER TABLE [dbo].[HostingPlans] WITH CHECK ADD CONSTRAINT [FK_HostingPlans_Packages] FOREIGN KEY([PackageID])
REFERENCES [dbo].[Packages] ([PackageID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[HostingPlans] CHECK CONSTRAINT [FK_HostingPlans_Packages]
GO
ALTER TABLE [dbo].[HostingPlans] WITH CHECK ADD CONSTRAINT [FK_HostingPlans_Servers] FOREIGN KEY([ServerID])
REFERENCES [dbo].[Servers] ([ServerID])
GO
ALTER TABLE [dbo].[HostingPlans] CHECK CONSTRAINT [FK_HostingPlans_Servers]
GO
ALTER TABLE [dbo].[HostingPlans] WITH CHECK ADD CONSTRAINT [FK_HostingPlans_Users] FOREIGN KEY([UserID])
REFERENCES [dbo].[Users] ([UserID])
GO
ALTER TABLE [dbo].[HostingPlans] CHECK CONSTRAINT [FK_HostingPlans_Users]
GO
ALTER TABLE [dbo].[IPAddresses] WITH CHECK ADD CONSTRAINT [FK_IPAddresses_Servers] FOREIGN KEY([ServerID])
REFERENCES [dbo].[Servers] ([ServerID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[IPAddresses] CHECK CONSTRAINT [FK_IPAddresses_Servers]
GO
ALTER TABLE [dbo].[LyncUserPlans] WITH CHECK ADD CONSTRAINT [FK_LyncUserPlans_ExchangeOrganizations] FOREIGN KEY([ItemID])
REFERENCES [dbo].[ExchangeOrganizations] ([ItemID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[LyncUserPlans] CHECK CONSTRAINT [FK_LyncUserPlans_ExchangeOrganizations]
GO
ALTER TABLE [dbo].[LyncUsers] WITH CHECK ADD CONSTRAINT [FK_LyncUsers_LyncUserPlans] FOREIGN KEY([LyncUserPlanID])
REFERENCES [dbo].[LyncUserPlans] ([LyncUserPlanId])
GO
ALTER TABLE [dbo].[LyncUsers] CHECK CONSTRAINT [FK_LyncUsers_LyncUserPlans]
GO
ALTER TABLE [dbo].[PackageAddons] WITH CHECK ADD CONSTRAINT [FK_PackageAddons_HostingPlans] FOREIGN KEY([PlanID])
REFERENCES [dbo].[HostingPlans] ([PlanID])
GO
ALTER TABLE [dbo].[PackageAddons] CHECK CONSTRAINT [FK_PackageAddons_HostingPlans]
GO
ALTER TABLE [dbo].[PackageAddons] WITH CHECK ADD CONSTRAINT [FK_PackageAddons_Packages] FOREIGN KEY([PackageID])
REFERENCES [dbo].[Packages] ([PackageID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[PackageAddons] CHECK CONSTRAINT [FK_PackageAddons_Packages]
GO
ALTER TABLE [dbo].[PackageIPAddresses] WITH CHECK ADD CONSTRAINT [FK_PackageIPAddresses_IPAddresses] FOREIGN KEY([AddressID])
REFERENCES [dbo].[IPAddresses] ([AddressID])
GO
ALTER TABLE [dbo].[PackageIPAddresses] CHECK CONSTRAINT [FK_PackageIPAddresses_IPAddresses]
GO
ALTER TABLE [dbo].[PackageIPAddresses] WITH CHECK ADD CONSTRAINT [FK_PackageIPAddresses_Packages] FOREIGN KEY([PackageID])
REFERENCES [dbo].[Packages] ([PackageID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[PackageIPAddresses] CHECK CONSTRAINT [FK_PackageIPAddresses_Packages]
GO
ALTER TABLE [dbo].[PackageIPAddresses] WITH CHECK ADD CONSTRAINT [FK_PackageIPAddresses_ServiceItems] FOREIGN KEY([ItemID])
REFERENCES [dbo].[ServiceItems] ([ItemID])
GO
ALTER TABLE [dbo].[PackageIPAddresses] CHECK CONSTRAINT [FK_PackageIPAddresses_ServiceItems]
GO
ALTER TABLE [dbo].[PackageQuotas] WITH CHECK ADD CONSTRAINT [FK_PackageQuotas_Packages] FOREIGN KEY([PackageID])
REFERENCES [dbo].[Packages] ([PackageID])
GO
ALTER TABLE [dbo].[PackageQuotas] CHECK CONSTRAINT [FK_PackageQuotas_Packages]
GO
ALTER TABLE [dbo].[PackageQuotas] WITH CHECK ADD CONSTRAINT [FK_PackageQuotas_Quotas] FOREIGN KEY([QuotaID])
REFERENCES [dbo].[Quotas] ([QuotaID])
GO
ALTER TABLE [dbo].[PackageQuotas] CHECK CONSTRAINT [FK_PackageQuotas_Quotas]
GO
ALTER TABLE [dbo].[PackageResources] WITH CHECK ADD CONSTRAINT [FK_PackageResources_Packages] FOREIGN KEY([PackageID])
REFERENCES [dbo].[Packages] ([PackageID])
GO
ALTER TABLE [dbo].[PackageResources] CHECK CONSTRAINT [FK_PackageResources_Packages]
GO
ALTER TABLE [dbo].[PackageResources] WITH CHECK ADD CONSTRAINT [FK_PackageResources_ResourceGroups] FOREIGN KEY([GroupID])
REFERENCES [dbo].[ResourceGroups] ([GroupID])
GO
ALTER TABLE [dbo].[PackageResources] CHECK CONSTRAINT [FK_PackageResources_ResourceGroups]
GO
ALTER TABLE [dbo].[Packages] WITH CHECK ADD CONSTRAINT [FK_Packages_HostingPlans] FOREIGN KEY([PlanID])
REFERENCES [dbo].[HostingPlans] ([PlanID])
GO
ALTER TABLE [dbo].[Packages] CHECK CONSTRAINT [FK_Packages_HostingPlans]
GO
ALTER TABLE [dbo].[Packages] WITH CHECK ADD CONSTRAINT [FK_Packages_Packages] FOREIGN KEY([ParentPackageID])
REFERENCES [dbo].[Packages] ([PackageID])
GO
ALTER TABLE [dbo].[Packages] CHECK CONSTRAINT [FK_Packages_Packages]
GO
ALTER TABLE [dbo].[Packages] WITH CHECK ADD CONSTRAINT [FK_Packages_Servers] FOREIGN KEY([ServerID])
REFERENCES [dbo].[Servers] ([ServerID])
GO
ALTER TABLE [dbo].[Packages] CHECK CONSTRAINT [FK_Packages_Servers]
GO
ALTER TABLE [dbo].[Packages] WITH CHECK ADD CONSTRAINT [FK_Packages_Users] FOREIGN KEY([UserID])
REFERENCES [dbo].[Users] ([UserID])
GO
ALTER TABLE [dbo].[Packages] CHECK CONSTRAINT [FK_Packages_Users]
GO
ALTER TABLE [dbo].[PackagesBandwidth] WITH CHECK ADD CONSTRAINT [FK_PackagesBandwidth_Packages] FOREIGN KEY([PackageID])
REFERENCES [dbo].[Packages] ([PackageID])
GO
ALTER TABLE [dbo].[PackagesBandwidth] CHECK CONSTRAINT [FK_PackagesBandwidth_Packages]
GO
ALTER TABLE [dbo].[PackagesBandwidth] WITH CHECK ADD CONSTRAINT [FK_PackagesBandwidth_ResourceGroups] FOREIGN KEY([GroupID])
REFERENCES [dbo].[ResourceGroups] ([GroupID])
GO
ALTER TABLE [dbo].[PackagesBandwidth] CHECK CONSTRAINT [FK_PackagesBandwidth_ResourceGroups]
GO
ALTER TABLE [dbo].[PackagesDiskspace] WITH CHECK ADD CONSTRAINT [FK_PackagesDiskspace_Packages] FOREIGN KEY([PackageID])
REFERENCES [dbo].[Packages] ([PackageID])
GO
ALTER TABLE [dbo].[PackagesDiskspace] CHECK CONSTRAINT [FK_PackagesDiskspace_Packages]
GO
ALTER TABLE [dbo].[PackagesDiskspace] WITH CHECK ADD CONSTRAINT [FK_PackagesDiskspace_ResourceGroups] FOREIGN KEY([GroupID])
REFERENCES [dbo].[ResourceGroups] ([GroupID])
GO
ALTER TABLE [dbo].[PackagesDiskspace] CHECK CONSTRAINT [FK_PackagesDiskspace_ResourceGroups]
GO
ALTER TABLE [dbo].[PackageServices] WITH CHECK ADD CONSTRAINT [FK_PackageServices_Packages] FOREIGN KEY([PackageID])
REFERENCES [dbo].[Packages] ([PackageID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[PackageServices] CHECK CONSTRAINT [FK_PackageServices_Packages]
GO
ALTER TABLE [dbo].[PackageServices] WITH CHECK ADD CONSTRAINT [FK_PackageServices_Services] FOREIGN KEY([ServiceID])
REFERENCES [dbo].[Services] ([ServiceID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[PackageServices] CHECK CONSTRAINT [FK_PackageServices_Services]
GO
ALTER TABLE [dbo].[PackagesTreeCache] WITH CHECK ADD CONSTRAINT [FK_PackagesTreeCache_Packages] FOREIGN KEY([ParentPackageID])
REFERENCES [dbo].[Packages] ([PackageID])
GO
ALTER TABLE [dbo].[PackagesTreeCache] CHECK CONSTRAINT [FK_PackagesTreeCache_Packages]
GO
ALTER TABLE [dbo].[PackagesTreeCache] WITH CHECK ADD CONSTRAINT [FK_PackagesTreeCache_Packages1] FOREIGN KEY([PackageID])
REFERENCES [dbo].[Packages] ([PackageID])
GO
ALTER TABLE [dbo].[PackagesTreeCache] CHECK CONSTRAINT [FK_PackagesTreeCache_Packages1]
GO
ALTER TABLE [dbo].[PrivateIPAddresses] WITH CHECK ADD CONSTRAINT [FK_PrivateIPAddresses_ServiceItems] FOREIGN KEY([ItemID])
REFERENCES [dbo].[ServiceItems] ([ItemID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[PrivateIPAddresses] CHECK CONSTRAINT [FK_PrivateIPAddresses_ServiceItems]
GO
ALTER TABLE [dbo].[Providers] WITH CHECK ADD CONSTRAINT [FK_Providers_ResourceGroups] FOREIGN KEY([GroupID])
REFERENCES [dbo].[ResourceGroups] ([GroupID])
GO
ALTER TABLE [dbo].[Providers] CHECK CONSTRAINT [FK_Providers_ResourceGroups]
GO
ALTER TABLE [dbo].[Quotas] WITH CHECK ADD CONSTRAINT [FK_Quotas_ResourceGroups] FOREIGN KEY([GroupID])
REFERENCES [dbo].[ResourceGroups] ([GroupID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[Quotas] CHECK CONSTRAINT [FK_Quotas_ResourceGroups]
GO
ALTER TABLE [dbo].[Quotas] WITH CHECK ADD CONSTRAINT [FK_Quotas_ServiceItemTypes] FOREIGN KEY([ItemTypeID])
REFERENCES [dbo].[ServiceItemTypes] ([ItemTypeID])
GO
ALTER TABLE [dbo].[Quotas] CHECK CONSTRAINT [FK_Quotas_ServiceItemTypes]
GO
ALTER TABLE [dbo].[ResourceGroupDnsRecords] WITH CHECK ADD CONSTRAINT [FK_ResourceGroupDnsRecords_ResourceGroups] FOREIGN KEY([GroupID])
REFERENCES [dbo].[ResourceGroups] ([GroupID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ResourceGroupDnsRecords] CHECK CONSTRAINT [FK_ResourceGroupDnsRecords_ResourceGroups]
GO
ALTER TABLE [dbo].[Schedule] WITH CHECK ADD CONSTRAINT [FK_Schedule_Packages] FOREIGN KEY([PackageID])
REFERENCES [dbo].[Packages] ([PackageID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[Schedule] CHECK CONSTRAINT [FK_Schedule_Packages]
GO
ALTER TABLE [dbo].[Schedule] WITH CHECK ADD CONSTRAINT [FK_Schedule_ScheduleTasks] FOREIGN KEY([TaskID])
REFERENCES [dbo].[ScheduleTasks] ([TaskID])
GO
ALTER TABLE [dbo].[Schedule] CHECK CONSTRAINT [FK_Schedule_ScheduleTasks]
GO
ALTER TABLE [dbo].[ScheduleParameters] WITH CHECK ADD CONSTRAINT [FK_ScheduleParameters_Schedule] FOREIGN KEY([ScheduleID])
REFERENCES [dbo].[Schedule] ([ScheduleID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ScheduleParameters] CHECK CONSTRAINT [FK_ScheduleParameters_Schedule]
GO
ALTER TABLE [dbo].[ScheduleTaskParameters] WITH CHECK ADD CONSTRAINT [FK_ScheduleTaskParameters_ScheduleTasks] FOREIGN KEY([TaskID])
REFERENCES [dbo].[ScheduleTasks] ([TaskID])
GO
ALTER TABLE [dbo].[ScheduleTaskParameters] CHECK CONSTRAINT [FK_ScheduleTaskParameters_ScheduleTasks]
GO
ALTER TABLE [dbo].[ScheduleTaskViewConfiguration] WITH CHECK ADD CONSTRAINT [FK_ScheduleTaskViewConfiguration_ScheduleTaskViewConfiguration] FOREIGN KEY([TaskID])
REFERENCES [dbo].[ScheduleTasks] ([TaskID])
GO
ALTER TABLE [dbo].[ScheduleTaskViewConfiguration] CHECK CONSTRAINT [FK_ScheduleTaskViewConfiguration_ScheduleTaskViewConfiguration]
GO
ALTER TABLE [dbo].[Servers] WITH CHECK ADD CONSTRAINT [FK_Servers_ResourceGroups] FOREIGN KEY([PrimaryGroupID])
REFERENCES [dbo].[ResourceGroups] ([GroupID])
GO
ALTER TABLE [dbo].[Servers] CHECK CONSTRAINT [FK_Servers_ResourceGroups]
GO
ALTER TABLE [dbo].[ServiceDefaultProperties] WITH CHECK ADD CONSTRAINT [FK_ServiceDefaultProperties_Providers] FOREIGN KEY([ProviderID])
REFERENCES [dbo].[Providers] ([ProviderID])
GO
ALTER TABLE [dbo].[ServiceDefaultProperties] CHECK CONSTRAINT [FK_ServiceDefaultProperties_Providers]
GO
ALTER TABLE [dbo].[ServiceItemProperties] WITH CHECK ADD CONSTRAINT [FK_ServiceItemProperties_ServiceItems] FOREIGN KEY([ItemID])
REFERENCES [dbo].[ServiceItems] ([ItemID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ServiceItemProperties] CHECK CONSTRAINT [FK_ServiceItemProperties_ServiceItems]
GO
ALTER TABLE [dbo].[ServiceItems] WITH CHECK ADD CONSTRAINT [FK_ServiceItems_Packages] FOREIGN KEY([PackageID])
REFERENCES [dbo].[Packages] ([PackageID])
GO
ALTER TABLE [dbo].[ServiceItems] CHECK CONSTRAINT [FK_ServiceItems_Packages]
GO
ALTER TABLE [dbo].[ServiceItems] WITH CHECK ADD CONSTRAINT [FK_ServiceItems_ServiceItemTypes] FOREIGN KEY([ItemTypeID])
REFERENCES [dbo].[ServiceItemTypes] ([ItemTypeID])
GO
ALTER TABLE [dbo].[ServiceItems] CHECK CONSTRAINT [FK_ServiceItems_ServiceItemTypes]
GO
ALTER TABLE [dbo].[ServiceItems] WITH CHECK ADD CONSTRAINT [FK_ServiceItems_Services] FOREIGN KEY([ServiceID])
REFERENCES [dbo].[Services] ([ServiceID])
GO
ALTER TABLE [dbo].[ServiceItems] CHECK CONSTRAINT [FK_ServiceItems_Services]
GO
ALTER TABLE [dbo].[ServiceItemTypes] WITH CHECK ADD CONSTRAINT [FK_ServiceItemTypes_ResourceGroups] FOREIGN KEY([GroupID])
REFERENCES [dbo].[ResourceGroups] ([GroupID])
GO
ALTER TABLE [dbo].[ServiceItemTypes] CHECK CONSTRAINT [FK_ServiceItemTypes_ResourceGroups]
GO
ALTER TABLE [dbo].[ServiceProperties] WITH CHECK ADD CONSTRAINT [FK_ServiceProperties_Services] FOREIGN KEY([ServiceID])
REFERENCES [dbo].[Services] ([ServiceID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ServiceProperties] CHECK CONSTRAINT [FK_ServiceProperties_Services]
GO
ALTER TABLE [dbo].[Services] WITH CHECK ADD CONSTRAINT [FK_Services_Clusters] FOREIGN KEY([ClusterID])
REFERENCES [dbo].[Clusters] ([ClusterID])
GO
ALTER TABLE [dbo].[Services] CHECK CONSTRAINT [FK_Services_Clusters]
GO
ALTER TABLE [dbo].[Services] WITH CHECK ADD CONSTRAINT [FK_Services_Providers] FOREIGN KEY([ProviderID])
REFERENCES [dbo].[Providers] ([ProviderID])
GO
ALTER TABLE [dbo].[Services] CHECK CONSTRAINT [FK_Services_Providers]
GO
ALTER TABLE [dbo].[Services] WITH CHECK ADD CONSTRAINT [FK_Services_Servers] FOREIGN KEY([ServerID])
REFERENCES [dbo].[Servers] ([ServerID])
GO
ALTER TABLE [dbo].[Services] CHECK CONSTRAINT [FK_Services_Servers]
GO
ALTER TABLE [dbo].[Users] WITH CHECK ADD CONSTRAINT [FK_Users_Users] FOREIGN KEY([OwnerID])
REFERENCES [dbo].[Users] ([UserID])
GO
ALTER TABLE [dbo].[Users] CHECK CONSTRAINT [FK_Users_Users]
GO
ALTER TABLE [dbo].[UserSettings] WITH CHECK ADD CONSTRAINT [FK_UserSettings_Users] FOREIGN KEY([UserID])
REFERENCES [dbo].[Users] ([UserID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[UserSettings] CHECK CONSTRAINT [FK_UserSettings_Users]
GO
ALTER TABLE [dbo].[VirtualGroups] WITH CHECK ADD CONSTRAINT [FK_VirtualGroups_ResourceGroups] FOREIGN KEY([GroupID])
REFERENCES [dbo].[ResourceGroups] ([GroupID])
GO
ALTER TABLE [dbo].[VirtualGroups] CHECK CONSTRAINT [FK_VirtualGroups_ResourceGroups]
GO
ALTER TABLE [dbo].[VirtualGroups] WITH CHECK ADD CONSTRAINT [FK_VirtualGroups_Servers] FOREIGN KEY([ServerID])
REFERENCES [dbo].[Servers] ([ServerID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[VirtualGroups] CHECK CONSTRAINT [FK_VirtualGroups_Servers]
GO
ALTER TABLE [dbo].[VirtualServices] WITH CHECK ADD CONSTRAINT [FK_VirtualServices_Servers] FOREIGN KEY([ServerID])
REFERENCES [dbo].[Servers] ([ServerID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[VirtualServices] CHECK CONSTRAINT [FK_VirtualServices_Servers]
GO
ALTER TABLE [dbo].[VirtualServices] WITH CHECK ADD CONSTRAINT [FK_VirtualServices_Services] FOREIGN KEY([ServiceID])
REFERENCES [dbo].[Services] ([ServiceID])
GO
ALTER TABLE [dbo].[VirtualServices] CHECK CONSTRAINT [FK_VirtualServices_Services]
GO
/****** Object: StoredProcedure [dbo].[GetSearchObject] Script Date: 07.09.2015 15:29:17 ******/
DROP PROCEDURE [dbo].[GetSearchObject]
GO
/****** Object: StoredProcedure [dbo].[GetSearchObject] Script Date: 07.09.2015 15:29:17 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetSearchObject]
(
@ActorID int,
@UserID int,
@FilterColumn nvarchar(50) = '',
@FilterValue nvarchar(50) = '',
@StatusID int,
@RoleID int,
@SortColumn nvarchar(50),
@StartRow int,
@MaximumRows int = 0,
@Recursive bit,
@ColType nvarchar(500) = '',
@FullType nvarchar(50) = '',
@OnlyFind bit
)
AS
IF @ColType IS NULL
SET @ColType = ''
DECLARE @HasUserRights bit
SET @HasUserRights = dbo.CheckActorUserRights(@ActorID, @UserID)
IF @HasUserRights = 0
RAISERROR('You are not allowed to access this account', 16, 1)
DECLARE @curAll CURSOR
DECLARE @curUsers CURSOR
DECLARE @ItemID int
DECLARE @TextSearch nvarchar(500)
DECLARE @ColumnType nvarchar(50)
DECLARE @FullTypeAll nvarchar(50)
DECLARE @PackageID int
DECLARE @AccountID int
DECLARE @Username nvarchar(50)
DECLARE @Fullname nvarchar(50)
DECLARE @ItemsAll TABLE
(
ItemID int,
TextSearch nvarchar(500),
ColumnType nvarchar(50),
FullType nvarchar(50),
PackageID int,
AccountID int,
Username nvarchar(100),
Fullname nvarchar(100)
)
DECLARE @sql nvarchar(4000)
/*------------------------------------------------Users---------------------------------------------------------------*/
DECLARE @columnUsername nvarchar(20)
SET @columnUsername = 'Username'
DECLARE @columnEmail nvarchar(20)
SET @columnEmail = 'Email'
DECLARE @columnCompanyName nvarchar(20)
SET @columnCompanyName = 'CompanyName'
DECLARE @columnFullName nvarchar(20)
SET @columnFullName = 'FullName'
IF @FilterColumn = '' AND @FilterValue <> ''
SET @FilterColumn = 'TextSearch'
SET @sql = '
DECLARE @Users TABLE
(
ItemPosition int IDENTITY(0,1),
UserID int,
Username nvarchar(100),
Fullname nvarchar(100)
)
INSERT INTO @Users (UserID, Username, Fullname)
SELECT
U.UserID,
U.Username,
U.FirstName + '' '' + U.LastName as Fullname
FROM UsersDetailed AS U
WHERE
U.UserID <> @UserID AND U.IsPeer = 0 AND
(
(@Recursive = 0 AND OwnerID = @UserID) OR
(@Recursive = 1 AND dbo.CheckUserParent(@UserID, U.UserID) = 1)
)
AND ((@StatusID = 0) OR (@StatusID > 0 AND U.StatusID = @StatusID))
AND ((@RoleID = 0) OR (@RoleID > 0 AND U.RoleID = @RoleID))
AND ' + CAST((@HasUserRights) AS varchar(12)) + ' = 1
SET @curValue = cursor local for
SELECT '
IF @OnlyFind = 1
SET @sql = @sql + 'TOP ' + CAST(@MaximumRows AS varchar(12)) + ' '
SET @sql = @sql + 'U.ItemID,
U.TextSearch,
U.ColumnType,
''AccountHome'' as FullType,
0 as PackageID,
0 as AccountID,
TU.Username,
TU.Fullname
FROM @Users AS TU
INNER JOIN
(
SELECT ItemID, TextSearch, ColumnType
FROM(
SELECT U0.UserID as ItemID, U0.Username as TextSearch, @columnUsername as ColumnType
FROM dbo.Users AS U0
UNION
SELECT U1.UserID as ItemID, U1.Email as TextSearch, @columnEmail as ColumnType
FROM dbo.Users AS U1
UNION
SELECT U2.UserID as ItemID, U2.CompanyName as TextSearch, @columnCompanyName as ColumnType
FROM dbo.Users AS U2
UNION
SELECT U3.UserID as ItemID, U3.FirstName + '' '' + U3.LastName as TextSearch, @columnFullName as ColumnType
FROM dbo.Users AS U3) as U
WHERE TextSearch<>'' '' OR ISNULL(TextSearch, 0) > 0
)
AS U ON TU.UserID = U.ItemID'
IF @FilterValue <> ''
SET @sql = @sql + ' WHERE TextSearch LIKE ''' + @FilterValue + ''''
SET @sql = @sql + ' ORDER BY TextSearch'
SET @sql = @sql + ';open @curValue'
exec sp_executesql @sql, N'@UserID int, @FilterValue nvarchar(50), @Recursive bit, @StatusID int, @RoleID int, @columnUsername nvarchar(20), @columnEmail nvarchar(20), @columnCompanyName nvarchar(20), @columnFullName nvarchar(20), @curValue cursor output',
@UserID, @FilterValue, @Recursive, @StatusID, @RoleID, @columnUsername, @columnEmail, @columnCompanyName, @columnFullName, @curUsers output
/*--------------------------------------------Space----------------------------------------------------------*/
DECLARE @sqlNameAccountType nvarchar(4000)
SET @sqlNameAccountType = '
WHEN 1 THEN ''Mailbox''
WHEN 2 THEN ''Contact''
WHEN 3 THEN ''DistributionList''
WHEN 4 THEN ''PublicFolder''
WHEN 5 THEN ''Room''
WHEN 6 THEN ''Equipment''
WHEN 7 THEN ''User''
WHEN 8 THEN ''SecurityGroup''
WHEN 9 THEN ''DefaultSecurityGroup''
WHEN 10 THEN ''SharedMailbox''
WHEN 11 THEN ''DeletedUser''
'
SET @sql = '
DECLARE @ItemsService TABLE
(
ItemID int,
Username nvarchar(100),
Fullname nvarchar(100)
)
INSERT INTO @ItemsService (ItemID, Username, Fullname)
SELECT
SI.ItemID,
U.Username,
U.FirstName + '' '' + U.LastName as Fullname
FROM ServiceItems AS SI
INNER JOIN Packages AS P ON P.PackageID = SI.PackageID
INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID
WHERE
dbo.CheckUserParent(@UserID, P.UserID) = 1
DECLARE @ItemsDomain TABLE
(
ItemID int,
Username nvarchar(100),
Fullname nvarchar(100)
)
INSERT INTO @ItemsDomain (ItemID, Username, Fullname)
SELECT
D.DomainID,
U.Username,
U.FirstName + '' '' + U.LastName as Fullname
FROM Domains AS D
INNER JOIN Packages AS P ON P.PackageID = D.PackageID
INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID
WHERE
dbo.CheckUserParent(@UserID, P.UserID) = 1
SET @curValue = cursor local for
SELECT '
IF @OnlyFind = 1
SET @sql = @sql + 'TOP ' + CAST(@MaximumRows AS varchar(12)) + ' '
SET @sql = @sql + '
SI.ItemID as ItemID,
SI.ItemName as TextSearch,
STYPE.DisplayName as ColumnType,
STYPE.DisplayName as FullType,
SI.PackageID as PackageID,
0 as AccountID,
I.Username,
I.Fullname
FROM @ItemsService AS I
INNER JOIN ServiceItems AS SI ON I.ItemID = SI.ItemID
INNER JOIN ServiceItemTypes AS STYPE ON SI.ItemTypeID = STYPE.ItemTypeID
WHERE (STYPE.Searchable = 1
AND STYPE.ItemTypeID <> 200 AND STYPE.ItemTypeID <> 201)'
IF @FilterValue <> ''
SET @sql = @sql + ' AND (SI.ItemName LIKE ''' + @FilterValue + ''')'
SET @sql = @sql + '
UNION (
SELECT '
IF @OnlyFind = 1
SET @sql = @sql + 'TOP ' + CAST(@MaximumRows AS varchar(12)) + ' '
SET @sql = @sql + '
D.DomainID AS ItemID,
D.DomainName as TextSearch,
''Domain'' as ColumnType,
''Domains'' as FullType,
D.PackageID as PackageID,
0 as AccountID,
I.Username,
I.Fullname
FROM @ItemsDomain AS I
INNER JOIN Domains AS D ON I.ItemID = D.DomainID
WHERE (D.IsDomainPointer=0)'
IF @FilterValue <> ''
SET @sql = @sql + ' AND (D.DomainName LIKE ''' + @FilterValue + ''')'
SET @sql = @sql + '
UNION
SELECT '
IF @OnlyFind = 1
SET @sql = @sql + 'TOP ' + CAST(@MaximumRows AS varchar(12)) + ' '
SET @sql = @sql + '
EA.ItemID AS ItemID,
EA.DisplayName as TextSearch,
''ExchangeAccount'' as ColumnType,
FullType = CASE EA.AccountType ' + @sqlNameAccountType + ' ELSE CAST(EA.AccountType AS varchar(12)) END,
SI2.PackageID as PackageID,
EA.AccountID as AccountID,
I2.Username,
I2.Fullname
FROM @ItemsService AS I2
INNER JOIN ServiceItems AS SI2 ON I2.ItemID = SI2.ItemID
INNER JOIN ExchangeAccounts AS EA ON I2.ItemID = EA.ItemID'
IF @FilterValue <> ''
SET @sql = @sql + ' WHERE (EA.DisplayName LIKE ''' + @FilterValue + ''')'
SET @sql = @sql + '
UNION
SELECT '
IF @OnlyFind = 1
SET @sql = @sql + 'TOP ' + CAST(@MaximumRows AS varchar(12)) + ' '
SET @sql = @sql + '
EA4.ItemID AS ItemID,
EA4.PrimaryEmailAddress as TextSearch,
''ExchangeAccount'' as ColumnType,
FullType = CASE EA4.AccountType ' + @sqlNameAccountType + ' ELSE CAST(EA4.AccountType AS varchar(12)) END,
SI4.PackageID as PackageID,
EA4.AccountID as AccountID,
I4.Username,
I4.Fullname
FROM @ItemsService AS I4
INNER JOIN ServiceItems AS SI4 ON I4.ItemID = SI4.ItemID
INNER JOIN ExchangeAccounts AS EA4 ON I4.ItemID = EA4.ItemID'
IF @FilterValue <> ''
SET @sql = @sql + ' WHERE (EA4.PrimaryEmailAddress LIKE ''' + @FilterValue + ''')'
SET @sql = @sql + '
UNION
SELECT '
IF @OnlyFind = 1
SET @sql = @sql + 'TOP ' + CAST(@MaximumRows AS varchar(12)) + ' '
SET @sql = @sql + '
I3.ItemID AS ItemID,
EAEA.EmailAddress as TextSearch,
''ExchangeAccount'' as ColumnType,
''Mailbox'' as FullType,
SI3.PackageID as PackageID,
EAEA.AccountID as AccountID,
I3.Username,
I3.Fullname
FROM @ItemsService AS I3
INNER JOIN ServiceItems AS SI3 ON I3.ItemID = SI3.ItemID
INNER JOIN ExchangeAccountEmailAddresses AS EAEA ON I3.ItemID = EAEA.AccountID'
IF @FilterValue <> ''
SET @sql = @sql + ' WHERE (EAEA.EmailAddress LIKE ''' + @FilterValue + ''')'
SET @sql = @sql + ')'
IF @OnlyFind = 1
SET @sql = @sql + ' ORDER BY TextSearch';
SET @sql = @sql + ';open @curValue'
exec sp_executesql @sql, N'@UserID int, @FilterValue nvarchar(50), @curValue cursor output',
@UserID, @FilterValue, @curAll output
FETCH NEXT FROM @curAll INTO @ItemID, @TextSearch, @ColumnType, @FullTypeAll, @PackageID, @AccountID, @Username, @Fullname
WHILE @@FETCH_STATUS = 0
BEGIN
INSERT INTO @ItemsAll(ItemID, TextSearch, ColumnType, FullType, PackageID, AccountID, Username, Fullname)
VALUES(@ItemID, @TextSearch, @ColumnType, @FullTypeAll, @PackageID, @AccountID, @Username, @Fullname)
FETCH NEXT FROM @curAll INTO @ItemID, @TextSearch, @ColumnType, @FullTypeAll, @PackageID, @AccountID, @Username, @Fullname
END
/*-------------------------------------------Lync-----------------------------------------------------*/
DECLARE @IsAdmin bit
SET @IsAdmin = dbo.CheckIsUserAdmin(@ActorID)
SET @sql = '
SET @curValue = cursor local for
SELECT '
IF @OnlyFind = 1
SET @sql = @sql + 'TOP ' + CAST(@MaximumRows AS varchar(12)) + ' '
SET @sql = @sql + '
SI.ItemID as ItemID,
ea.AccountName as TextSearch,
''LyncAccount'' as ColumnType,
''LyncUsers'' as FullType,
SI.PackageID as PackageID,
ea.AccountID as AccountID,
U.Username,
U.FirstName + '' '' + U.LastName as Fullname
FROM
ExchangeAccounts as ea
INNER JOIN
LyncUsers as LU
INNER JOIN
LyncUserPlans as lp
ON
LU.LyncUserPlanId = lp.LyncUserPlanId
ON
ea.AccountID = LU.AccountID
INNER JOIN
ServiceItems AS SI ON ea.ItemID = SI.ItemID
INNER JOIN
Packages AS P ON SI.PackageID = P.PackageID
INNER JOIN
Users AS U ON U.UserID = P.UserID
WHERE ' + CAST((@HasUserRights) AS varchar(12)) + ' = 1
AND (' + CAST((@IsAdmin) AS varchar(12)) + ' = 1 OR P.UserID = @UserID)'
IF @FilterValue <> ''
SET @sql = @sql + ' AND ea.AccountName LIKE ''' + @FilterValue + ''''
IF @OnlyFind = 1
SET @sql = @sql + ' ORDER BY TextSearch'
SET @sql = @sql + ' ;open @curValue'
CLOSE @curAll
DEALLOCATE @curAll
exec sp_executesql @sql, N'@UserID int, @curValue cursor output', @UserID, @curAll output
FETCH NEXT FROM @curAll INTO @ItemID, @TextSearch, @ColumnType, @FullTypeAll, @PackageID, @AccountID, @Username, @Fullname
WHILE @@FETCH_STATUS = 0
BEGIN
INSERT INTO @ItemsAll(ItemID, TextSearch, ColumnType, FullType, PackageID, AccountID, Username, Fullname)
VALUES(@ItemID, @TextSearch, @ColumnType, @FullTypeAll, @PackageID, @AccountID, @Username, @Fullname)
FETCH NEXT FROM @curAll INTO @ItemID, @TextSearch, @ColumnType, @FullTypeAll, @PackageID, @AccountID, @Username, @Fullname
END
/*------------------------------------RDS------------------------------------------------*/
IF @IsAdmin = 1
BEGIN
SET @sql = '
SET @curValue = cursor local for
SELECT '
IF @OnlyFind = 1
SET @sql = @sql + 'TOP ' + CAST(@MaximumRows AS varchar(12)) + ' '
SET @sql = @sql + '
RDSCol.ItemID as ItemID,
RDSCol.Name as TextSearch,
''RDSCollection'' as ColumnType,
''RDSCollections'' as FullType,
P.PackageID as PackageID,
RDSCol.ID as AccountID,
U.Username,
U.FirstName + '' '' + U.LastName as Fullname
FROM
RDSCollections AS RDSCol
INNER JOIN
ServiceItems AS SI ON RDSCol.ItemID = SI.ItemID
INNER JOIN
Packages AS P ON SI.PackageID = P.PackageID
INNER JOIN
Users AS U ON U.UserID = P.UserID
WHERE ' + CAST((@HasUserRights) AS varchar(12)) + ' = 1
AND (' + CAST((@IsAdmin) AS varchar(12)) + ' = 1 OR P.UserID = @UserID)'
IF @FilterValue <> ''
SET @sql = @sql + ' AND RDSCol.Name LIKE ''' + @FilterValue + ''''
IF @OnlyFind = 1
SET @sql = @sql + ' ORDER BY TextSearch'
SET @sql = @sql + ' ;open @curValue'
CLOSE @curAll
DEALLOCATE @curAll
exec sp_executesql @sql, N'@UserID int, @curValue cursor output', @UserID, @curAll output
FETCH NEXT FROM @curAll INTO @ItemID, @TextSearch, @ColumnType, @FullTypeAll, @PackageID, @AccountID, @Username, @Fullname
WHILE @@FETCH_STATUS = 0
BEGIN
INSERT INTO @ItemsAll(ItemID, TextSearch, ColumnType, FullType, PackageID, AccountID, Username, Fullname)
VALUES(@ItemID, @TextSearch, @ColumnType, @FullTypeAll, @PackageID, @AccountID, @Username, @Fullname)
FETCH NEXT FROM @curAll INTO @ItemID, @TextSearch, @ColumnType, @FullTypeAll, @PackageID, @AccountID, @Username, @Fullname
END
END
/*------------------------------------CRM------------------------------------------------*/
SET @sql = '
SET @curValue = cursor local for
SELECT '
IF @OnlyFind = 1
SET @sql = @sql + 'TOP ' + CAST(@MaximumRows AS varchar(12)) + ' '
SET @sql = @sql + '
@UserID as ItemID,
ea.AccountName as TextSearch,
''CRMSite'' as ColumnType,
''CRMSites'' as FullType,
SI.PackageID as PackageID,
ea.AccountID as AccountID,
U.Username,
U.FirstName + '' '' + U.LastName as Fullname
FROM
ExchangeAccounts as ea
INNER JOIN
CRMUsers AS CRMU ON ea.AccountID = CRMU.AccountID
INNER JOIN
ServiceItems AS SI ON ea.ItemID = SI.ItemID
INNER JOIN
Packages AS P ON SI.PackageID = P.PackageID
INNER JOIN
Users AS U ON U.UserID = P.UserID
WHERE ' + CAST((@HasUserRights) AS varchar(12)) + ' = 1
AND (' + CAST((@IsAdmin) AS varchar(12)) + ' = 1 OR P.UserID = @UserID)'
IF @FilterValue <> ''
SET @sql = @sql + ' AND ea.AccountName LIKE ''' + @FilterValue + ''''
IF @OnlyFind = 1
SET @sql = @sql + ' ORDER BY TextSearch'
SET @sql = @sql + ' ;open @curValue'
CLOSE @curAll
DEALLOCATE @curAll
exec sp_executesql @sql, N'@UserID int, @curValue cursor output', @UserID, @curAll output
FETCH NEXT FROM @curAll INTO @ItemID, @TextSearch, @ColumnType, @FullTypeAll, @PackageID, @AccountID, @Username, @Fullname
WHILE @@FETCH_STATUS = 0
BEGIN
INSERT INTO @ItemsAll(ItemID, TextSearch, ColumnType, FullType, PackageID, AccountID, Username, Fullname)
VALUES(@ItemID, @TextSearch, @ColumnType, @FullTypeAll, @PackageID, @AccountID, @Username, @Fullname)
FETCH NEXT FROM @curAll INTO @ItemID, @TextSearch, @ColumnType, @FullTypeAll, @PackageID, @AccountID, @Username, @Fullname
END
/*------------------------------------VirtualServer------------------------------------------------*/
IF @IsAdmin = 1
BEGIN
SET @sql = '
SET @curValue = cursor local for
SELECT '
IF @OnlyFind = 1
SET @sql = @sql + 'TOP ' + CAST(@MaximumRows AS varchar(12)) + ' '
SET @sql = @sql + '
@UserID as ItemID,
S.ServerName as TextSearch,
''VirtualServer'' as ColumnType,
''VirtualServers'' as FullType,
(SELECT MIN(PackageID) FROM Packages WHERE UserID = @UserID) as PackageID,
0 as AccountID,
U.Username,
U.FirstName + '' '' + U.LastName as Fullname
FROM
Servers AS S
INNER JOIN
Packages AS P ON P.ServerID = S.ServerID
INNER JOIN
Users AS U ON U.UserID = P.UserID
WHERE
VirtualServer = 1'
IF @FilterValue <> ''
SET @sql = @sql + ' AND S.ServerName LIKE ''' + @FilterValue + ''''
IF @OnlyFind = 1
SET @sql = @sql + ' ORDER BY TextSearch'
SET @sql = @sql + ' ;open @curValue'
CLOSE @curAll
DEALLOCATE @curAll
exec sp_executesql @sql, N'@UserID int, @curValue cursor output', @UserID, @curAll output
FETCH NEXT FROM @curAll INTO @ItemID, @TextSearch, @ColumnType, @FullTypeAll, @PackageID, @AccountID, @Username, @Fullname
WHILE @@FETCH_STATUS = 0
BEGIN
INSERT INTO @ItemsAll(ItemID, TextSearch, ColumnType, FullType, PackageID, AccountID, Username, Fullname)
VALUES(@ItemID, @TextSearch, @ColumnType, @FullTypeAll, @PackageID, @AccountID, @Username, @Fullname)
FETCH NEXT FROM @curAll INTO @ItemID, @TextSearch, @ColumnType, @FullTypeAll, @PackageID, @AccountID, @Username, @Fullname
END
END
/*------------------------------------WebDAVFolder------------------------------------------------*/
SET @sql = '
SET @curValue = cursor local for
SELECT '
IF @OnlyFind = 1
SET @sql = @sql + 'TOP ' + CAST(@MaximumRows AS varchar(12)) + ' '
SET @sql = @sql + '
EF.ItemID as ItemID,
EF.FolderName as TextSearch,
''WebDAVFolder'' as ColumnType,
''Folders'' as FullType,
P.PackageID as PackageID,
EF.EnterpriseFolderID as AccountID,
U.Username,
U.FirstName + '' '' + U.LastName as Fullname
FROM
EnterpriseFolders as EF
INNER JOIN
ServiceItems AS SI ON EF.ItemID = SI.ItemID
INNER JOIN
Packages AS P ON SI.PackageID = P.PackageID
INNER JOIN
Users AS U ON U.UserID = P.UserID
WHERE ' + CAST((@HasUserRights) AS varchar(12)) + ' = 1
AND (' + CAST((@IsAdmin) AS varchar(12)) + ' = 1 OR P.UserID = @UserID)'
IF @FilterValue <> ''
SET @sql = @sql + ' AND EF.FolderName LIKE ''' + @FilterValue + ''''
IF @OnlyFind = 1
SET @sql = @sql + ' ORDER BY TextSearch'
SET @sql = @sql + ';open @curValue'
CLOSE @curAll
DEALLOCATE @curAll
exec sp_executesql @sql, N'@UserID int, @curValue cursor output', @UserID, @curAll output
FETCH NEXT FROM @curAll INTO @ItemID, @TextSearch, @ColumnType, @FullTypeAll, @PackageID, @AccountID, @Username, @Fullname
WHILE @@FETCH_STATUS = 0
BEGIN
INSERT INTO @ItemsAll(ItemID, TextSearch, ColumnType, FullType, PackageID, AccountID, Username, Fullname)
VALUES(@ItemID, @TextSearch, @ColumnType, @FullTypeAll, @PackageID, @AccountID, @Username, @Fullname)
FETCH NEXT FROM @curAll INTO @ItemID, @TextSearch, @ColumnType, @FullTypeAll, @PackageID, @AccountID, @Username, @Fullname
END
/*------------------------------------SharePoint------------------------------------------------*/
SET @sql = '
SET @curValue = cursor local for
SELECT '
IF @OnlyFind = 1
SET @sql = @sql + 'TOP ' + CAST(@MaximumRows AS varchar(12)) + ' '
SET @sql = @sql + '
SIP.PropertyValue as ItemID,
T.PropertyValue as TextSearch,
SIT.DisplayName as ColumnType,
''SharePointSiteCollections'' as FullType,
P.PackageID as PackageID,
SI.ItemID as AccountID,
U.Username,
U.FirstName + '' '' + U.LastName as Fullname
FROM ServiceItems AS SI
INNER JOIN ServiceItemTypes AS SIT ON SI.ItemTypeID = SIT.ItemTypeID
INNER JOIN Packages AS P ON SI.PackageID = P.PackageID
INNER JOIN Users AS U ON U.UserID = P.UserID
INNER JOIN ServiceItemProperties AS SIP ON SIP.ItemID = SI.ItemID
RIGHT JOIN ServiceItemProperties AS T ON T.ItemID = SIP.ItemID
WHERE ' + CAST((@HasUserRights) AS varchar(12)) + ' = 1
AND (' + CAST((@IsAdmin) AS varchar(12)) + ' = 1 OR P.UserID = @UserID)
AND (SIT.DisplayName = ''SharePointFoundationSiteCollection''
OR SIT.DisplayName = ''SharePointEnterpriseSiteCollection'')
AND SIP.PropertyName = ''OrganizationId''
AND T.PropertyName = ''PhysicalAddress'''
IF @FilterValue <> ''
SET @sql = @sql + ' AND T.PropertyValue LIKE ''' + @FilterValue + ''''
IF @OnlyFind = 1
SET @sql = @sql + ' ORDER BY TextSearch'
SET @sql = @sql + ';open @curValue'
CLOSE @curAll
DEALLOCATE @curAll
exec sp_executesql @sql, N'@UserID int, @curValue cursor output', @UserID, @curAll output
FETCH NEXT FROM @curAll INTO @ItemID, @TextSearch, @ColumnType, @FullTypeAll, @PackageID, @AccountID, @Username, @Fullname
WHILE @@FETCH_STATUS = 0
BEGIN
INSERT INTO @ItemsAll(ItemID, TextSearch, ColumnType, FullType, PackageID, AccountID, Username, Fullname)
VALUES(@ItemID, @TextSearch, @ColumnType, @FullTypeAll, @PackageID, @AccountID, @Username, @Fullname)
FETCH NEXT FROM @curAll INTO @ItemID, @TextSearch, @ColumnType, @FullTypeAll, @PackageID, @AccountID, @Username, @Fullname
END
/*-------------------------------------------@curAll-------------------------------------------------------*/
CLOSE @curAll
DEALLOCATE @curAll
SET @curAll = CURSOR LOCAL FOR
SELECT
ItemID,
TextSearch,
ColumnType,
FullType,
PackageID,
AccountID,
Username,
Fullname
FROM @ItemsAll
OPEN @curAll
/*-------------------------------------------Return-------------------------------------------------------*/
IF @SortColumn = ''
SET @SortColumn = 'TextSearch'
SET @sql = '
DECLARE @ItemID int
DECLARE @TextSearch nvarchar(500)
DECLARE @ColumnType nvarchar(50)
DECLARE @FullType nvarchar(50)
DECLARE @PackageID int
DECLARE @AccountID int
DECLARE @EndRow int
DECLARE @Username nvarchar(100)
DECLARE @Fullname nvarchar(100)
SET @EndRow = @StartRow + @MaximumRows'
IF (@ColType = '' OR @ColType IN ('AccountHome'))
BEGIN
SET @sql = @sql + '
DECLARE @ItemsUser TABLE
(
ItemID int,
TextSearch nvarchar(500),
ColumnType nvarchar(50),
FullType nvarchar(50),
PackageID int,
AccountID int,
Username nvarchar(100),
Fullname nvarchar(100)
)
FETCH NEXT FROM @curUsersValue INTO @ItemID, @TextSearch, @ColumnType, @FullType, @PackageID, @AccountID, @Username, @Fullname
WHILE @@FETCH_STATUS = 0
BEGIN
IF (1 = 1)'
IF @FullType <> ''
SET @sql = @sql + ' AND @FullType = ''' + @FullType + '''';
SET @sql = @sql + '
BEGIN
INSERT INTO @ItemsUser(ItemID, TextSearch, ColumnType, FullType, PackageID, AccountID, Username, Fullname)
VALUES(@ItemID, @TextSearch, @ColumnType, @FullType, @PackageID, @AccountID, @Username, @Fullname)
END
FETCH NEXT FROM @curUsersValue INTO @ItemID, @TextSearch, @ColumnType, @FullType, @PackageID, @AccountID, @Username, @Fullname
END'
END
SET @sql = @sql + '
DECLARE @ItemsFilter TABLE
(
ItemID int,
TextSearch nvarchar(500),
ColumnType nvarchar(50),
FullType nvarchar(50),
PackageID int,
AccountID int,
Username nvarchar(100),
Fullname nvarchar(100)
)
FETCH NEXT FROM @curAllValue INTO @ItemID, @TextSearch, @ColumnType, @FullType, @PackageID, @AccountID, @Username, @Fullname
WHILE @@FETCH_STATUS = 0
BEGIN
IF (1 = 1)'
IF @ColType <> ''
SET @sql = @sql + ' AND @ColumnType in ( ' + @ColType + ' ) ';
IF @FullType <> ''
SET @sql = @sql + ' AND @FullType = ''' + @FullType + '''';
SET @sql = @sql + '
BEGIN
INSERT INTO @ItemsFilter(ItemID, TextSearch, ColumnType, FullType, PackageID, AccountID, Username, Fullname)
VALUES(@ItemID, @TextSearch, @ColumnType, @FullType, @PackageID, @AccountID, @Username, @Fullname)
END
FETCH NEXT FROM @curAllValue INTO @ItemID, @TextSearch, @ColumnType, @FullType, @PackageID, @AccountID, @Username, @Fullname
END
DECLARE @ItemsReturn TABLE
(
ItemPosition int IDENTITY(1,1),
ItemID int,
TextSearch nvarchar(500),
ColumnType nvarchar(50),
FullType nvarchar(50),
PackageID int,
AccountID int,
Username nvarchar(100),
Fullname nvarchar(100)
)'
IF (@ColType = '' OR @ColType IN ('AccountHome'))
BEGIN
SET @sql = @sql + '
INSERT INTO '
IF @SortColumn = 'TextSearch'
SET @sql = @sql + '@ItemsReturn'
ELSE
SET @sql = @sql + '@ItemsFilter'
SET @sql = @sql + ' (ItemID, TextSearch, ColumnType, FullType, PackageID, AccountID, Username, Fullname)
SELECT ItemID, TextSearch, ColumnType, FullType, PackageID, AccountID, Username, Fullname
FROM @ItemsUser'
END
SET @sql = @sql + '
INSERT INTO @ItemsReturn(ItemID, TextSearch, ColumnType, FullType, PackageID, AccountID, Username, Fullname)
SELECT
ItemID,
TextSearch,
ColumnType,
FullType,
PackageID,
AccountID,
Username,
Fullname
FROM @ItemsFilter'
SET @sql = @sql + ' ORDER BY ' + @SortColumn
SET @sql = @sql + ';
SELECT COUNT(ItemID) FROM @ItemsReturn;
SELECT DISTINCT(ColumnType) FROM @ItemsReturn';
IF @FullType <> ''
SET @sql = @sql + ' WHERE FullType = ''' + @FullType + '''';
SET @sql = @sql + ';
SELECT ItemPosition, ItemID, TextSearch, ColumnType, FullType, PackageID, AccountID, Username, Fullname
FROM @ItemsReturn AS IR'
IF @MaximumRows > 0
SET @sql = @sql + ' WHERE IR.ItemPosition BETWEEN @StartRow AND @EndRow';
exec sp_executesql @sql, N'@StartRow int, @MaximumRows int, @FilterValue nvarchar(50), @curUsersValue cursor, @curAllValue cursor',
@StartRow, @MaximumRows, @FilterValue, @curUsers, @curAll
CLOSE @curAll
DEALLOCATE @curAll
RETURN
GO | the_stack |
DELETE FROM AD_Menu WHERE (ad_window_id)=(207);
DELETE FROM ad_wf_node WHERE (ad_window_id)=(207);
-- 2019-09-18T15:48:51.493Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Window_ID=207
;
-- 2019-09-18T15:48:51.493Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Window_Trl WHERE AD_Window_ID=207
;
-- 2019-09-18T15:48:51.496Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Window WHERE AD_Window_ID=207
;
-- 2019-09-18T15:50:02.002Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Table_Trl WHERE AD_Table_ID=429
;
-- 2019-09-18T15:50:02.009Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Table WHERE AD_Table_ID=429
;
-- 2019-09-18T15:50:47.591Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Table_Trl WHERE AD_Table_ID=431
;
-- 2019-09-18T15:50:47.599Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Table WHERE AD_Table_ID=431
;
-----------
DELETE FROM AD_Menu WHERE (ad_window_id)=(210);
DELETE FROM ad_wf_node WHERE (ad_window_id)=(210);
--C_CommissionRun-- 2019-09-18T15:53:13.434Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Window_ID=210
;
-- 2019-09-18T15:53:13.434Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Window_Trl WHERE AD_Window_ID=210
;
-- 2019-09-18T15:53:13.438Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Window WHERE AD_Window_ID=210
;
-- 2019-09-18T15:53:30.948Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Table_Trl WHERE AD_Table_ID=436
;
-- 2019-09-18T15:53:30.956Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Table WHERE AD_Table_ID=436
;
-- 2019-09-18T15:54:05.006Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Table_Trl WHERE AD_Table_ID=430
;
-- 2019-09-18T15:54:05.014Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Table WHERE AD_Table_ID=430
;
-- 2019-09-18T15:54:30.928Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Table_Trl WHERE AD_Table_ID=437
;
-- 2019-09-18T15:54:30.931Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Table WHERE AD_Table_ID=437
;
-- 2019-09-18T15:54:45.360Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table SET AD_Window_ID=540702,Updated=TO_TIMESTAMP('2019-09-18 17:54:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=541407
;
DROP VIEW rv_commissionrundetail;
DROP TABLE C_CommissionDetail;
DROP TABLE C_CommissionAmt;
DROP TABLE C_CommissionRun;
DROP TABLE C_CommissionLine;
DROP TABLE C_Commission;
-- 2019-09-18T16:00:18.007Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Process_Trl WHERE AD_Process_ID=123
;
-- 2019-09-18T16:00:18.014Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Process WHERE AD_Process_ID=123
;
-- 2019-09-18T16:00:40.838Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Process_Trl WHERE AD_Process_ID=165
;
-- 2019-09-18T16:00:40.843Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Process WHERE AD_Process_ID=165
;
-- 2019-09-18T16:01:07.313Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Process_Trl WHERE AD_Process_ID=166
;
-- 2019-09-18T16:01:07.319Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Process WHERE AD_Process_ID=166
;
-- 2019-09-19T12:51:23.166Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_ElementGroup WHERE AD_UI_ElementGroup_ID=540924
;
-- 2019-09-19T12:52:06.416Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET Name='DocType',Updated=TO_TIMESTAMP('2019-09-19 14:52:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=1000001
;
-- 2019-09-19T12:52:43.228Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,ColumnDisplayLength,Created,CreatedBy,DisplayLength,EntityType,IncludedTabHeight,IsActive,IsDisplayed,IsDisplayedGrid,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SeqNoGrid,SortNo,SpanX,SpanY,Updated,UpdatedBy) VALUES (0,568785,586847,0,186,0,TO_TIMESTAMP('2019-09-19 14:52:43','YYYY-MM-DD HH24:MI:SS'),100,0,'D',0,'Y','Y','Y','N','N','N','N','N','Vertriebspartner',660,640,0,1,1,TO_TIMESTAMP('2019-09-19 14:52:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-09-19T12:52:43.232Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Field_ID=586847 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2019-09-19T12:52:43.247Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(541357)
;
-- 2019-09-19T12:52:43.255Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=586847
;
-- 2019-09-19T12:52:43.256Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(586847)
;
-- 2019-09-19T12:53:07.971Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,586847,0,186,1000001,562100,'F',TO_TIMESTAMP('2019-09-19 14:53:07','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'C_BPartner_SalesRep_ID',50,0,0,TO_TIMESTAMP('2019-09-19 14:53:07','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-09-19T12:56:43.782Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,ColumnDisplayLength,Created,CreatedBy,DisplayLength,EntityType,IncludedTabHeight,IsActive,IsDisplayed,IsDisplayedGrid,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SeqNoGrid,SortNo,SpanX,SpanY,Updated,UpdatedBy) VALUES (0,568741,586848,0,540279,0,TO_TIMESTAMP('2019-09-19 14:56:43','YYYY-MM-DD HH24:MI:SS'),100,0,'de.metas.invoicecandidate',0,'Y','Y','Y','N','N','N','N','N','Vertriebspartner',1130,490,0,1,1,TO_TIMESTAMP('2019-09-19 14:56:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-09-19T12:56:43.787Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Field_ID=586848 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2019-09-19T12:56:43.801Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(541357)
;
-- 2019-09-19T12:56:43.805Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=586848
;
-- 2019-09-19T12:56:43.806Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(586848)
;
-- 2019-09-19T12:56:48.715Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsReadOnly='Y',Updated=TO_TIMESTAMP('2019-09-19 14:56:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=586848
;
-- 2019-09-19T12:59:30.874Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=80,Updated=TO_TIMESTAMP('2019-09-19 14:59:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541083
;
-- 2019-09-19T12:59:33.538Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=70,Updated=TO_TIMESTAMP('2019-09-19 14:59:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541082
;
-- 2019-09-19T12:59:35.833Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=60,Updated=TO_TIMESTAMP('2019-09-19 14:59:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541081
;
-- 2019-09-19T12:59:38.306Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=50,Updated=TO_TIMESTAMP('2019-09-19 14:59:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=553823
;
-- 2019-09-19T12:59:45.367Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=40,Updated=TO_TIMESTAMP('2019-09-19 14:59:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=553822
;
-- 2019-09-19T13:00:02.079Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,586848,0,540279,540057,562101,'F',TO_TIMESTAMP('2019-09-19 15:00:01','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'C_BPartner_SalesRep_ID',30,0,0,TO_TIMESTAMP('2019-09-19 15:00:01','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-09-19T13:00:53.699Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET DisplayLogic='@C_BPartner_SalesRep_ID/0@!0',Updated=TO_TIMESTAMP('2019-09-19 15:00:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=586848
;
-- 2019-09-19T13:09:19.601Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,9626,0,220,1000011,562102,'F',TO_TIMESTAMP('2019-09-19 15:09:19','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'IsSalesRep',90,0,0,TO_TIMESTAMP('2019-09-19 15:09:19','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-09-19T13:09:57.159Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y', Name='Sales partner', PrintName='Sales partner',Updated=TO_TIMESTAMP('2019-09-19 15:09:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=409 AND AD_Language='en_GB'
;
-- 2019-09-19T13:09:57.166Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(409,'en_GB')
;
-- 2019-09-19T13:10:08.993Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y', Name='Vertriebspartner', PrintName='Vertriebspartner',Updated=TO_TIMESTAMP('2019-09-19 15:10:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=409 AND AD_Language='de_CH'
;
-- 2019-09-19T13:10:08.994Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(409,'de_CH')
;
-- 2019-09-19T13:10:15.771Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Name='Sales partner', PrintName='Sales partner',Updated=TO_TIMESTAMP('2019-09-19 15:10:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=409 AND AD_Language='en_US'
;
-- 2019-09-19T13:10:15.772Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(409,'en_US')
;
-- 2019-09-19T13:10:26.375Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y', Name='Vertriebspartner', PrintName='Vertriebspartner',Updated=TO_TIMESTAMP('2019-09-19 15:10:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=409 AND AD_Language='de_DE'
;
-- 2019-09-19T13:10:26.376Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(409,'de_DE')
;
-- 2019-09-19T13:10:26.386Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(409,'de_DE')
;
-- 2019-09-19T13:10:26.388Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='IsSalesRep', Name='Vertriebspartner', Description='Indicates if the business partner is a sales representative or company agent', Help='The Sales Rep checkbox indicates if this business partner is a sales representative. A sales representative may also be an emplyee, but does not need to be.' WHERE AD_Element_ID=409
;
-- 2019-09-19T13:10:26.390Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='IsSalesRep', Name='Vertriebspartner', Description='Indicates if the business partner is a sales representative or company agent', Help='The Sales Rep checkbox indicates if this business partner is a sales representative. A sales representative may also be an emplyee, but does not need to be.', AD_Element_ID=409 WHERE UPPER(ColumnName)='ISSALESREP' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2019-09-19T13:10:26.391Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='IsSalesRep', Name='Vertriebspartner', Description='Indicates if the business partner is a sales representative or company agent', Help='The Sales Rep checkbox indicates if this business partner is a sales representative. A sales representative may also be an emplyee, but does not need to be.' WHERE AD_Element_ID=409 AND IsCentrallyMaintained='Y'
;
-- 2019-09-19T13:10:26.393Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Vertriebspartner', Description='Indicates if the business partner is a sales representative or company agent', Help='The Sales Rep checkbox indicates if this business partner is a sales representative. A sales representative may also be an emplyee, but does not need to be.' WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=409) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 409)
;
-- 2019-09-19T13:10:26.411Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Vertriebspartner', Name='Vertriebspartner' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=409)
;
-- 2019-09-19T13:10:26.413Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Vertriebspartner', Description='Indicates if the business partner is a sales representative or company agent', Help='The Sales Rep checkbox indicates if this business partner is a sales representative. A sales representative may also be an emplyee, but does not need to be.', CommitWarning = NULL WHERE AD_Element_ID = 409
;
-- 2019-09-19T13:10:26.415Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Vertriebspartner', Description='Indicates if the business partner is a sales representative or company agent', Help='The Sales Rep checkbox indicates if this business partner is a sales representative. A sales representative may also be an emplyee, but does not need to be.' WHERE AD_Element_ID = 409
;
-- 2019-09-19T13:10:26.416Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name = 'Vertriebspartner', Description = 'Indicates if the business partner is a sales representative or company agent', WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 409
;
-- 2019-09-19T13:10:38.427Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET DefaultValue='N',Updated=TO_TIMESTAMP('2019-09-19 15:10:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=2929
;
-- 2019-09-19T13:10:41.628Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
ALTER TABLE C_BPartner ALTER COLUMN IsSalesRep SET DEFAULT 'N';
-- 2019-09-19T13:10:42.483Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE C_BPartner SET IsSalesRep='N' WHERE IsSalesRep IS NULL
;
-- 2019-09-19T13:12:47.409Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_Table SET AD_Display=NULL,Updated=TO_TIMESTAMP('2019-09-19 15:12:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=353
;
-- 2019-09-19T13:13:49.208Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Val_Rule (AD_Client_ID,AD_Org_ID,AD_Val_Rule_ID,Code,Created,CreatedBy,Description,EntityType,IsActive,Name,Type,Updated,UpdatedBy) VALUES (0,0,540451,'C_BPartner.IsSalesRep=''Y''',TO_TIMESTAMP('2019-09-19 15:13:49','YYYY-MM-DD HH24:MI:SS'),100,'','D','Y','C_BPartner SalesRep','S',TO_TIMESTAMP('2019-09-19 15:13:49','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-09-19T13:14:40.442Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_Value_ID=138, AD_Val_Rule_ID=540451,Updated=TO_TIMESTAMP('2019-09-19 15:14:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=568785
;
-- 2019-09-19T13:15:19.971Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_Value_ID=138, AD_Val_Rule_ID=540451,Updated=TO_TIMESTAMP('2019-09-19 15:15:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=14095
;
-- 2019-09-19T13:16:14.186Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_Value_ID=138, AD_Val_Rule_ID=540451,Updated=TO_TIMESTAMP('2019-09-19 15:16:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=568741
;
-- 2019-09-19T13:16:40.295Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_Value_ID=138, AD_Val_Rule_ID=540451,Updated=TO_TIMESTAMP('2019-09-19 15:16:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=568764
;
-- 2019-09-19T13:17:29.453Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Reference_Trl WHERE AD_Reference_ID=353
;
-- 2019-09-19T13:17:29.459Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Reference WHERE AD_Reference_ID=353
;
-- 2019-09-19T13:47:02.907Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Val_Rule (AD_Client_ID,AD_Org_ID,AD_Val_Rule_ID,Code,Created,CreatedBy,Description,EntityType,IsActive,Name,Type,Updated,UpdatedBy) VALUES (0,0,540452,'C_BPartner.IsSalesRep=''Y'' AND C_BPartner.C_BPartner_ID!=@Bill_BPartner_ID/-1@',TO_TIMESTAMP('2019-09-19 15:47:02','YYYY-MM-DD HH24:MI:SS'),100,'','D','Y','C_BPartner SalesRep and NOT BiIl_Partner','S',TO_TIMESTAMP('2019-09-19 15:47:02','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-09-19T13:47:24.756Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Val_Rule_ID=540452,Updated=TO_TIMESTAMP('2019-09-19 15:47:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=568785
;
-- 2019-09-19T13:54:15.976Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO t_alter_column values('c_commission_instance','C_Order_ID','NUMERIC(10)',null,null)
;
-- 2019-09-19T13:54:45.151Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_Value_ID=138,Updated=TO_TIMESTAMP('2019-09-19 15:54:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=568789
;
-- 2019-09-19T13:54:46.801Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ SELECT public.db_alter_table('C_Commission_Instance','ALTER TABLE public.C_Commission_Instance ADD COLUMN Bill_BPartner_ID NUMERIC(10)')
;
-- 2019-09-19T13:54:46.808Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
ALTER TABLE C_Commission_Instance ADD CONSTRAINT BillBPartner_CCommissionInstance FOREIGN KEY (Bill_BPartner_ID) REFERENCES public.C_BPartner DEFERRABLE INITIALLY DEFERRED
;
CREATE INDEX c_commission_instance_c_order_id
ON public.c_commission_instance (c_order_id);
CREATE INDEX c_commission_instance_bill_bpartner_id
ON public.c_commission_instance (bill_bpartner_id);
CREATE INDEX c_commission_share_c_bpartner_salesrep_id
ON public.c_commission_share (c_bpartner_salesrep_id);
DROP INDEX IF EXISTS public.c_commission_share_c_commission_instance_id;
CREATE INDEX c_commission_share_c_commission_instance_id
ON public.c_commission_share (c_commission_instance_id);
-- 2019-09-19T14:20:59.525Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_Table SET AD_Display=NULL,Updated=TO_TIMESTAMP('2019-09-19 16:20:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=540100
;
-- 2019-09-19T14:21:10.578Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Reference SET EntityType='D',Updated=TO_TIMESTAMP('2019-09-19 16:21:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=540100
;
-- 2019-09-19T14:21:14.625Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_Value_ID=540100,Updated=TO_TIMESTAMP('2019-09-19 16:21:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=568790
; | the_stack |
--
---- check datatype for range partitionkey
--
--/* int2 */: sucess
create table test_range_datatype_int2(a int2)
partition by range(a)
(
partition test_range_datatype_int2_p1 values less than (1),
partition test_range_datatype_int2_p2 values less than (2)
);
select c.relname, a.attname, t.typname from pg_class as c , pg_attribute as a , pg_type as t
where a.attrelid = c.oid and a.atttypid = t.oid and a.attnum > 0 and c.relname in('test_range_datatype_int2') order by 1, 2, 3;
--/* int4 */: sucess
create table test_range_datatype_int4(a int)
partition by range(a)
(
partition test_range_datatype_int4_p1 values less than (1),
partition test_range_datatype_int4_p2 values less than (2)
);
select c.relname, a.attname, t.typname from pg_class as c , pg_attribute as a , pg_type as t
where a.attrelid = c.oid and a.atttypid = t.oid and a.attnum > 0 and c.relname in('test_range_datatype_int4') order by 1, 2, 3;
--/* int8 */: sucess
create table test_range_datatype_int8(a int8)
partition by range(a)
(
partition test_range_datatype_int8_p1 values less than (1),
partition test_range_datatype_int8_p2 values less than (2)
);
select c.relname, a.attname, t.typname from pg_class as c , pg_attribute as a , pg_type as t
where a.attrelid = c.oid and a.atttypid = t.oid and a.attnum > 0 and c.relname in('test_range_datatype_int8') order by 1, 2, 3;
--/* decimal */: sucess
create table test_range_datatype_decimal(a decimal)
partition by range(a)
(
partition test_range_datatype_decimal_p1 values less than (7.1),
partition test_range_datatype_decimal_p2 values less than (8.4)
);
select c.relname, a.attname, t.typname from pg_class as c , pg_attribute as a , pg_type as t
where a.attrelid = c.oid and a.atttypid = t.oid and a.attnum > 0 and c.relname in('test_range_datatype_decimal') order by 1, 2, 3;
--/* numeric */: sucess
create table test_range_datatype_numeric(a numeric(9,2))
partition by range(a)
(
partition test_range_datatype_numeric_p1 values less than (7.1),
partition test_range_datatype_numeric_p2 values less than (8.4)
);
select c.relname, a.attname, t.typname from pg_class as c , pg_attribute as a , pg_type as t
where a.attrelid = c.oid and a.atttypid = t.oid and a.attnum > 0 and c.relname in('test_range_datatype_numeric') order by 1, 2, 3;
--/* real */: sucess
create table test_range_datatype_real(a REAL)
partition by range(a)
(
partition test_range_datatype_real_p1 values less than (7.1),
partition test_range_datatype_real_p2 values less than (8.4)
);
select c.relname, a.attname, t.typname from pg_class as c , pg_attribute as a , pg_type as t
where a.attrelid = c.oid and a.atttypid = t.oid and a.attnum > 0 and c.relname in('test_range_datatype_real') order by 1, 2, 3;
--/* double precision */: sucess
create table test_range_datatype_doubleprecision(a double precision)
partition by range(a)
(
partition test_range_datatype_doubleprecision_p1 values less than (7.1),
partition test_range_datatype_doubleprecision_p2 values less than (8.4)
);
select c.relname, a.attname, t.typname from pg_class as c , pg_attribute as a , pg_type as t
where a.attrelid = c.oid and a.atttypid = t.oid and a.attnum > 0 and c.relname in('test_range_datatype_doubleprecision') order by 1, 2, 3;
--/* char */: sucess
create table test_range_datatype_char(a char)
partition by range(a)
(
partition test_range_datatype_char_p1 values less than ('A'),
partition test_range_datatype_char_p2 values less than ('B')
);
select c.relname, a.attname, t.typname from pg_class as c , pg_attribute as a , pg_type as t
where a.attrelid = c.oid and a.atttypid = t.oid and a.attnum > 0 and c.relname in('test_range_datatype_char') order by 1, 2, 3;
--/* varchar(n) */: sucess
create table test_range_datatype_varcharn(a varchar(3))
partition by range(a)
(
partition test_range_datatype_varcharn_p1 values less than ('A'),
partition test_range_datatype_varcharn_p2 values less than ('B')
);
select c.relname, a.attname, t.typname from pg_class as c , pg_attribute as a , pg_type as t
where a.attrelid = c.oid and a.atttypid = t.oid and a.attnum > 0 and c.relname in('test_range_datatype_varcharn') order by 1, 2, 3;
--/* varchar */: sucess
create table test_range_datatype_varchar(a varchar)
partition by range(a)
(
partition test_range_datatype_varchar_p1 values less than ('A'),
partition test_range_datatype_varchar_p2 values less than ('B')
);
select c.relname, a.attname, t.typname from pg_class as c , pg_attribute as a , pg_type as t
where a.attrelid = c.oid and a.atttypid = t.oid and a.attnum > 0 and c.relname in('test_range_datatype_varchar') order by 1, 2, 3;
--/* char(n) */: sucess
create table test_range_datatype_charn(a char(3))
partition by range(a)
(
partition test_range_datatype_charn_p1 values less than ('A'),
partition test_range_datatype_charn_p2 values less than ('B')
);
select c.relname, a.attname, t.typname from pg_class as c , pg_attribute as a , pg_type as t
where a.attrelid = c.oid and a.atttypid = t.oid and a.attnum > 0 and c.relname in('test_range_datatype_charn') order by 1, 2, 3;
--/* character(n) */: sucess
create table test_range_datatype_charactern(a character(3))
partition by range(a)
(
partition test_range_datatype_charactern_p1 values less than ('A'),
partition test_range_datatype_charactern_p2 values less than ('B')
);
select c.relname, a.attname, t.typname from pg_class as c , pg_attribute as a , pg_type as t
where a.attrelid = c.oid and a.atttypid = t.oid and a.attnum > 0 and c.relname in('test_range_datatype_charactern') order by 1, 2, 3;
--/* text */: sucess
create table test_range_datatype_text(a text)
partition by range(a)
(
partition test_range_datatype_text_p1 values less than ('A'),
partition test_range_datatype_text_p2 values less than ('B')
);
select c.relname, a.attname, t.typname from pg_class as c , pg_attribute as a , pg_type as t
where a.attrelid = c.oid and a.atttypid = t.oid and a.attnum > 0 and c.relname in('test_range_datatype_text') order by 1, 2, 3;
--/* nvarchar2 */: sucess
create table test_range_datatype_nvarchar2(a nvarchar2)
partition by range(a)
(
partition test_range_datatype_nvarchar2_p1 values less than ('A'),
partition test_range_datatype_nvarchar2_p2 values less than ('B')
);
select c.relname, a.attname, t.typname from pg_class as c , pg_attribute as a , pg_type as t
where a.attrelid = c.oid and a.atttypid = t.oid and a.attnum > 0 and c.relname in('test_range_datatype_nvarchar2') order by 1, 2, 3;
--/* date */: sucess
create table test_range_datatype_date(a date)
partition by range(a)
(
partition test_range_datatype_date_p1 values less than (to_date('2012-11-12','YYYY-MM-DD')),
partition test_range_datatype_date_p2 values less than (to_date('2012-11-13','YYYY-MM-DD'))
);
create table test_range_cast_date(a date)
partition by range(a)
(
partition test_range_cast_date_p1 values less than ('2012-12-26'),
partition test_range_cast_date_p2 values less than ('2013-12-26')
);
select c.relname, a.attname, t.typname from pg_class as c , pg_attribute as a , pg_type as t
where a.attrelid = c.oid and a.atttypid = t.oid and a.attnum > 0 and c.relname in('test_range_datatype_date', 'test_range_cast_date') order by 1, 2, 3;
--/* timestamp */: sucess
create table test_range_datatype_timestamp(a timestamp)
partition by range(a)
(
partition test_range_datatype_timestamp_p1 values less than (to_timestamp('2012-11-12','YYYY-MM-DD'))
);
create table test_range_cast_timestamp(a timestamp)
partition by range(a)
(
partition test_range_cast_timestamp_p1 values less than ('2012-12-26'),
partition test_range_cast_timestamp_p2 values less than ('2013-12-26')
);
select c.relname, a.attname, t.typname from pg_class as c , pg_attribute as a , pg_type as t
where a.attrelid = c.oid and a.atttypid = t.oid and a.attnum > 0 and c.relname in('test_range_datatype_timestamp', 'test_range_cast_timestamp') order by 1;
--/* timestamptz */: sucess
create table test_range_datatype_timestamptz(a timestamptz)
partition by range(a)
(
partition test_range_datatype_timestamptz_p1 values less than (current_timestamp)
);
create table test_range_cast_timestamptz(a timestamptz)
partition by range(a)
(
partition test_range_cast_timestamptz_p1 values less than ('2012-12-26'),
partition test_range_cast_timestamptz_p2 values less than ('2013-12-26')
);
select c.relname, a.attname, t.typname from pg_class as c , pg_attribute as a , pg_type as t
where a.attrelid = c.oid and a.atttypid = t.oid and a.attnum > 0 and c.relname in('test_range_datatype_timestamptz', 'test_range_cast_timestamptz') order by 1, 2, 3;
--/* name */: sucess
create table test_range_datatype_name(a name)
partition by range(a)
(
partition test_range_datatype_name_p1 values less than ('CBY'),
partition test_range_datatype_name_p2 values less than ('JYH')
);
select c.relname, a.attname, t.typname from pg_class as c , pg_attribute as a , pg_type as t
where a.attrelid = c.oid and a.atttypid = t.oid and a.attnum > 0 and c.relname in('test_range_datatype_name') order by 1, 2, 3;
--/* bpchar */: sucess
create table test_range_datatype_bpchar(a bpchar)
partition by range(a)
(
partition test_range_datatype_bpchar_p1 values less than ('C'),
partition test_range_datatype_bpchar_p2 values less than ('Z')
);
select c.relname, a.attname, t.typname from pg_class as c , pg_attribute as a , pg_type as t
where a.attrelid = c.oid and a.atttypid = t.oid and a.attnum > 0 and c.relname in('test_range_datatype_bpchar') order by 1, 2, 3;
--/* bool */: fail
create table test_range_datatype_bool(a bool)
partition by range(a)
(
partition test_range_datatype_bool_p1 values less than (false),
partition test_range_datatype_bool_p2 values less than (true)
);
--clean up
drop table test_range_datatype_bpchar;
drop table test_range_datatype_char;
drop table test_range_datatype_charactern;
drop table test_range_datatype_charn;
drop table test_range_datatype_doubleprecision;
drop table test_range_datatype_int4;
drop table test_range_datatype_int2;
drop table test_range_datatype_int8;
drop table test_range_datatype_name;
drop table test_range_datatype_numeric;
drop table test_range_datatype_nvarchar2;
drop table test_range_datatype_real;
drop table test_range_datatype_text;
drop table test_range_datatype_timestamp;
drop table test_range_cast_timestamp;
drop table test_range_datatype_varchar;
drop table test_range_datatype_varcharn;
drop table test_range_datatype_date;
drop table test_range_cast_date;
drop table test_range_datatype_decimal;
drop table test_range_datatype_timestamptz;
drop table test_range_cast_timestamptz; | the_stack |
/*
Post-Deployment Script Template
--------------------------------------------------------------------------------------
This file contains SQL statements that will be appended to the build script.
Use SQLCMD syntax to include a file in the post-deployment script.
Example: :r .\myfile.sql
Use SQLCMD syntax to reference a variable in the post-deployment script.
Example: :setvar TableName MyTable
SELECT * FROM [$(TableName)]
--------------------------------------------------------------------------------------
*/
--------------------------------------------------------------------------------------
-- load default reports
--------------------------------------------------------------------------------------
set identity_insert [dbo].[sqlwatch_config_report] on;
disable trigger dbo.trg_sqlwatch_config_report_updated_U on [dbo].[sqlwatch_config_report];
--Indexes with high fragmentation
exec [dbo].[usp_sqlwatch_config_add_report]
@report_id = -1
,@report_title = 'Indexes with high fragmentation'
,@report_description = 'Lisf ot indexes where the fragmentation is above 30% and page count greater than 1000.
Index fragmentation can impact performance and should be minimum. You should be running index maintenance often.
A very good and free index maintenance solution is Ola Hallengren''s Maintenance Solution'
,@report_definition = 'SELECT [Table] = s.[name] +''.''+t.[name]
,[Index] = i.NAME
,[Type] = index_type_desc
,[Fragmentation] = convert(decimal(10,2),avg_fragmentation_in_percent)
,[Records] = record_count
,[Pages] = page_count
FROM sys.dm_db_index_physical_stats(DB_ID(), NULL, NULL, NULL, ''SAMPLED'') ips
INNER JOIN sys.tables t on t.[object_id] = ips.[object_id]
INNER JOIN sys.schemas s on t.[schema_id] = s.[schema_id]
INNER JOIN sys.indexes i ON (ips.object_id = i.object_id) AND (ips.index_id = i.index_id)
WHERE avg_fragmentation_in_percent > 30
and page_count > 1000'
,@report_definition_type = 'Table'
,@report_action_id = -1
--Agent Jobs failed in the last 5 minutes
exec [dbo].[usp_sqlwatch_config_add_report]
@report_id = -2
,@report_title = 'Agent Job failures'
,@report_description = 'List of SQL Server Agent Jobs that are enabled and have failed recently.'
,@report_definition = ';with cte_failed_jobs as (
select
[Job] = sj.name,
[Step] = sjs.step_name,
[Message] = sjh.[message],
[Run Time] = msdb.dbo.agent_datetime(sjh.run_date, sjh.run_time)
FROM msdb.dbo.sysjobhistory sjh
inner join msdb.dbo.sysjobs sj
on sjh.job_id = sj.job_id
inner join msdb.dbo.sysjobsteps sjs
on sjs.job_id = sj.job_id
and sjh.step_id = sjs.step_id
where sjh.step_id > 0
and msdb.dbo.agent_datetime(sjh.run_date, sjh.run_time) >= isnull((
select dateadd(second,-1,last_check_date)
from [dbo].[sqlwatch_meta_check]
where check_id = -1
and sql_instance = @@SERVERNAME
),getdate())
and sjh.run_status = 0
)
select @output=(select +
''<h3>JOB: '' + c1.[Job] + ''</h3>'' +
( select char(10) + ''<p>Step: '' + c2.[Step] + '' executed on: '' + convert(varchar(23),c2.[Run Time],121) + char(10) + ''<br>Message: <span style="color:red;">'' + c2.[Message] + ''</span></p>''
from cte_failed_jobs c2
where c1.[Job] = c2.[Job]
order by [Run Time]
for xml path(''''), type).value(''.'', ''nvarchar(MAX)'')
t
from cte_failed_jobs c1
group by c1.[Job]
for xml path(''''), type).value(''.'', ''nvarchar(MAX)'')'
,@report_definition_type = 'Template'
,@report_action_id = -1
--Blocked Processes in the last 5 minutes
exec [dbo].[usp_sqlwatch_config_add_report]
@report_id = -3
,@report_title = 'Blocked Processes'
,@report_description = 'List of blocking chains captured in the last minute.'
,@report_definition = ';with cte_blocking as (
SELECT *, rn=ROW_NUMBER() over (order by blocking_start_time)
FROM [dbo].[vw_sqlwatch_report_fact_xes_blockers] b
WHERE snapshot_time >= isnull((
select last_check_date
from [dbo].[sqlwatch_meta_check]
where check_id = -2
and sql_instance = @@SERVERNAME
),getdate())
)
select @output=(select
''<hr>
<h3>Blocking SPID: '' + convert(varchar(10),c1.blocking_spid) + ''</h3>
Database Name: <b>['' + c1.[database_name] + '']</b>
<br>Blocking App: <b>'' + + c1.blocking_client_app_name + ''</b>
<br>Blocking Host: <b>'' + c1.blocking_client_hostname + ''</b>
<br>Blocking SQL: <table cellpadding="10" border=0 width="100%" style="background:#ddd; margin-top:1em;white-space: pre;"><tr><td><pre>'' + c1.blocking_sql + ''</pre></td></tr></table></p>
'' +
( select char(10) + ''<table border=0 cellpadding="10" width="100%"><tr><td style="width:25px;"></td><td style="background:red;">
Blocking start time: '' + convert(varchar(23),c2.[blocking_start_time],121) + char(10) + ''
<br>Blocked SPID: <b>'' + convert(varchar(10),c2.blocked_spid) + ''</b>
<br>Blocked for: '' + convert(varchar,dateadd(ms,c2.blocking_duration_ms,0),114) + ''
<br>Blocked SQL: <table cellpadding="10" border=0 width="100%" style="background:#ddd; white-space: pre;"><tr><td><pre>'' + c2.[blocked_sql] + ''</pre></td></tr></table></td></tr></table>''
from cte_blocking c2
where c1.rn = c2.rn
order by rn
for xml path(''''), type).value(''.'', ''nvarchar(MAX)'')
t
from cte_blocking c1
group by c1.blocking_spid, c1.[database_name], c1.blocking_client_app_name, c1.blocking_client_hostname, c1.blocking_sql, rn
order by rn
for xml path(''''), type).value(''.'', ''nvarchar(MAX)'')'
,@report_definition_type = 'Template'
,@report_action_id = -1
--Disk utilisation report
exec [dbo].[usp_sqlwatch_config_add_report]
@report_id = -4
,@report_title = 'Disk Utilisation Report'
,@report_description = ''
,@report_definition = 'select [Volume]=[volume_name]
,[Days Until Full] = [days_until_full]
,[Total Space] = [total_space_formatted]
,[Free Space] = [free_space_formatted] + '' ('' + [free_space_percentage_formatted] + '')''
,[Growth] = [growth_bytes_per_day_formatted]
from [dbo].[vw_sqlwatch_report_dim_os_volume]
where sql_instance = @@SERVERNAME'
,@report_definition_type = 'Table'
,@report_action_id = -1;
exec [dbo].[usp_sqlwatch_config_add_report]
@report_id = -5
,@report_title = 'Backup Report'
,@report_description = ''
,@report_definition = 'SELECT
[Database] = d.name
,[Recovery Model] = d.recovery_model_desc
,[Last Backup Date] = convert(varchar(23),max(bs.backup_finish_date),121)
,[Last FULL Backup] = convert(varchar(23),max(case when bs.type =''D'' then bs.backup_finish_date else null end),121)
,[Last DIFF Backup] = convert(varchar(23),max(case when bs.type =''I'' then bs.backup_finish_date else null end),121)
,[Last LOG Backup] = case when d.recovery_model_desc = ''SIMPLE'' then ''N/A'' else convert(varchar(23),max(case when bs.type =''L'' then bs.backup_finish_date else null end),121) end
,[Minutes Since Last Log Backup] = convert(varchar(10),case when bs.type =''L'' then datediff(minute,(max(bs.backup_finish_Date)),getdate()) else null end)
,[Days Since Last Data Backup] = convert(varchar(10),datediff(day,(max(bs.backup_finish_Date)),getdate()))
from sys.databases d
left join msdb.dbo.backupset AS bs
on bs.database_name = d.name
group by
d.name
, d.recovery_model_desc
, bs.type
order by [Database]'
,@report_definition_type = 'Table'
,@report_action_id = -1;
exec [dbo].[usp_sqlwatch_config_add_report]
@report_id = -6
,@report_title = 'Out of Date Log Backup Report'
,@report_description = 'Report showing databases with out of date log backups.
This report can only be triggered from check as it contains check related variables.'
,@report_definition = 'select * from (
select
[Database] = d.name
,[Recovery Model] = d.recovery_model_desc
,[Last LOG Backup] = isnull(convert(varchar(23),max(bs.backup_finish_date),121),''--'')
,[Minutes Since Last Log Backup] = isnull(convert(varchar(10),datediff(minute,(max(bs.backup_finish_Date)),getdate())),'''')
from sys.databases d
left join msdb.dbo.backupset AS bs
on bs.database_name = d.name
and bs.type = ''L''
where d.recovery_model_desc <> ''SIMPLE''
and d.name not in (''tempdb'')
group by
d.name
, d.recovery_model_desc
, bs.type
) t
where (datediff(minute,replace([Last LOG Backup],''--'',''''),getdate()) {THRESHOLD})
and [Last LOG Backup] <> ''--'''
,@report_definition_type = 'Table'
,@report_action_id = -1;
exec [dbo].[usp_sqlwatch_config_add_report]
@report_id = -7
,@report_title = 'Out of Date Data Backup Report'
,@report_description = 'Report showing databases with out of date data backups.
This report can only be triggered from check as it contains check related variables.'
,@report_definition = 'select * from (
select
[Database] = d.name
,[Last Backup Date] = isnull(convert(varchar(23),max(bs.backup_finish_date),121),''--'')
,[Days Since Last Data Backup] = isnull(convert(varchar(10),datediff(day,(max(bs.backup_finish_Date)),getdate())),'''')
from sys.databases d
left join msdb.dbo.backupset AS bs
on bs.database_name = d.name
and bs.type <> ''L''
where d.name not in (''tempdb'')
group by
d.name
, d.recovery_model_desc
, bs.type
) t
where (datediff(day,replace([Last Backup Date],''--'',''''),getdate()) {THRESHOLD})
and [Last Backup Date] <> ''--'''
,@report_definition_type = 'Table'
,@report_action_id = -1;
exec [dbo].[usp_sqlwatch_config_add_report]
@report_id = -8
,@report_title = 'Missing Data Backup Report'
,@report_description = 'Report showing databases with no data backups.
This report can only be triggered from check as it contains check related variables.'
,@report_definition = 'select
[Database] = d.name
,[Last Backup Date] = isnull(convert(varchar(23),max(bs.backup_finish_date),121),''--'')
from sys.databases d
left join msdb.dbo.backupset AS bs
on bs.database_name = d.name
and bs.type <> ''L''
where d.name not in (''tempdb'')
and bs.backup_finish_date is null
group by
d.name
, d.recovery_model_desc
, bs.type'
,@report_definition_type = 'Table'
,@report_action_id = -1;
exec [dbo].[usp_sqlwatch_config_add_report]
@report_id = -9
,@report_title = 'Missing Log Backup Report'
,@report_description = 'Report showing databases with missing log backups.
This report can only be triggered from check as it contains check related variables.'
,@report_definition = 'select
[Database] = d.name
,[Recovery Model] = d.recovery_model_desc
,[Last LOG Backup] = isnull(convert(varchar(23),max(bs.backup_finish_date),121),''--'')
from sys.databases d
left join msdb.dbo.backupset AS bs
on bs.database_name = d.name
and bs.type = ''L''
where d.recovery_model_desc <> ''SIMPLE''
and d.name not in (''tempdb'')
and bs.backup_finish_date is null
group by
d.name
, d.recovery_model_desc
, bs.type'
,@report_definition_type = 'Table'
,@report_action_id = -1;
exec [dbo].[usp_sqlwatch_config_add_report]
@report_id = -10
,@report_title = 'Long Open Transactions'
,@report_description = 'Report showing open transactions and assosiated requests.
This report can only be triggered from check as it contains check related variables.'
,@report_definition = 'with cte_open_tran as (
select st.session_id, st.transaction_id, at.name, at.transaction_begin_time, s.login_name
, r.start_time as request_start_time
, r.[status] as requst_status
, r.total_elapsed_time as request_total_elapsed_time
, request_database_name = DB_NAME(r.database_id)
, r.last_wait_type
, t.[text]
, [statement] = SUBSTRING(
t.[text], r.statement_start_offset / 2,
( CASE WHEN r.statement_end_offset = -1 THEN DATALENGTH (t.[text])
ELSE r.statement_end_offset
END - r.statement_start_offset ) / 2
)
from sys.dm_tran_active_transactions at
inner join sys.dm_tran_session_transactions st
on at.transaction_id = st.transaction_id
left join sys.dm_exec_requests r
on r.session_id = st.session_id
left join sys.dm_exec_sessions s
on s.session_id = st.session_id
cross apply sys.dm_exec_sql_text(r.sql_handle) AS t
cross apply sys.dm_exec_query_plan(r.plan_handle) AS p
where st.session_id <> @@SPID
and st.session_id > 50
and datediff(second,at.transaction_begin_time,getdate()) {THRESHOLD}
and r.last_wait_type not in (''BROKER_RECEIVE_WAITFOR'')
)
select @output=(select ''<hr>
<h3>'' + c1.name + '' '' + convert(nvarchar(50),c1.transaction_id) + ''</h3>
<table>
<tr><td>Session ID</td><td> </td><td>'' + convert(nvarchar(10),c1.session_id) + ''</td></tr>
<tr><td>Session Login Name</td><td></td><td>'' + convert(nvarchar(255),c1.login_name) + ''</td></tr>
<tr><td>Transaction Databases</td><td></td><td><table>'' + (select ''<tr><td>'' + isnull(DB_NAME(c2.database_id),c2.database_id) + ''</td></tr>''
from sys.dm_tran_database_transactions c2
where c1.transaction_id = c2.transaction_id
for xml path (''''), type).value(''.'', ''nvarchar(MAX)'') + ''</table></td></tr>
<tr><td>Transaction Begin Time</td><td></td><td>'' + convert(nvarchar(23),c1.transaction_begin_time,121) + ''</td></tr>
<tr><td>Request Start Time</td><td></td><td>'' + convert(varchar(23),request_start_time,121) + ''</td></tr>
<tr><td>Request Status</td><td></td><td>'' + requst_status + ''</td></tr>
<tr><td>Request Database</td><td></td><td>'' + request_database_name + ''</td></tr>
<tr><td>Request Last Wait Type</td><td></td><td>'' + last_wait_type + ''</td></tr>
<tr><td>Request Elspased Time</td><td></td><td>'' + convert(nvarchar, (request_total_elapsed_time / 1000 / 86400)) + '' '' + convert(nvarchar, DATEADD(ss, request_total_elapsed_time / 1000, 0), 108) + ''</td></tr></table>
<p>Request Statement:<p>
<table cellpadding="10" border=0 width="100%" style="background:#ddd; white-space: pre;"><tr><td><pre>'' + [statement] + ''</pre></td></tr></table>
<p>Request Batch:<p>
<table cellpadding="10" border=0 width="100%" style="background:#ddd; white-space: pre;"><tr><td><pre>'' + [text] + ''</pre></td></tr></table>''
from cte_open_tran c1
for xml path(''''), type).value(''.'', ''nvarchar(MAX)'')'
,@report_definition_type = 'Template'
,@report_action_id = -1;
exec [dbo].[usp_sqlwatch_config_add_report]
@report_id = -11
,@report_title = 'SQLWATCH_Performance_Counters'
,@report_description = 'Extract for Azure Log Monitor'
,@report_definition = 'select mpc.sql_instance, mpc.[object_name], mpc.counter_name, pc.instance_name, pc.cntr_value_calculated, pc.snapshot_time
from [dbo].[sqlwatch_logger_perf_os_performance_counters] pc
inner join [dbo].[sqlwatch_meta_performance_counter] mpc
on pc.performance_counter_id = mpc.performance_counter_id
and mpc.sql_instance = pc.sql_instance
where snapshot_time > ''{REPORT_LAST_RUN_DATE}''
and snapshot_time <= ''{REPORT_CURRENT_RUN_DATE_UTC}'''
,@report_definition_type = 'Query'
,@report_action_id = -16
,@report_batch_id = 'AzureLogMonitor-1'
exec [dbo].[usp_sqlwatch_config_add_report]
@report_id = -12
,@report_title = 'SQLWATCH_OS_Volume'
,@report_description = 'Extract for Azure Log Monitor'
,@report_definition = 'select * from [dbo].[vw_sqlwatch_report_dim_os_volume]'
,@report_definition_type = 'Query'
,@report_action_id = -16
,@report_batch_id = 'AzureLogMonitor-1'
exec [dbo].[usp_sqlwatch_config_add_report]
@report_id = -13
,@report_title = 'SQLWATCH_Checks'
,@report_description = 'Extract for Azure Log Monitor'
,@report_definition = 'select d.[sql_instance], d.[snapshot_time], mc.check_name, d.[check_value], d.[check_status], d.status_change
from dbo.sqlwatch_logger_check d
inner join [dbo].[sqlwatch_meta_check] mc
on mc.sql_instance = d.sql_instance
and mc.check_id = d.check_id
where snapshot_time > ''{REPORT_LAST_RUN_DATE}''
and snapshot_time <= ''{REPORT_CURRENT_RUN_DATE_UTC}'''
,@report_definition_type = 'Query'
,@report_action_id = -16
,@report_batch_id = 'AzureLogMonitor-1'
exec [dbo].[usp_sqlwatch_config_add_report]
@report_id = -14
,@report_title = 'SQLWATCH_File_Stats'
,@report_description = 'Extract for Azure Log Monitor'
,@report_definition = 'select [database_name],[file_name],[file_type_desc],[file_physical_name],[size_on_disk_bytes]
,[sql_instance],[num_of_reads_delta],[num_of_bytes_read_delta],[io_stall_read_ms_delta],[num_of_writes_delta]
,[num_of_bytes_written_delta],[io_stall_write_ms_delta],[size_on_disk_bytes_delta],[io_latency_read]
,[io_latency_write],[bytes_written_per_second],[bytes_read_per_second],[snapshot_time]
from [dbo].[vw_sqlwatch_report_fact_perf_file_stats]
where snapshot_time > ''{REPORT_LAST_RUN_DATE}''
and snapshot_time <= ''{REPORT_CURRENT_RUN_DATE_UTC}'''
,@report_definition_type = 'Query'
,@report_action_id = -16
,@report_batch_id = 'AzureLogMonitor-1'
exec [dbo].[usp_sqlwatch_config_add_report]
@report_id = -15
,@report_title = 'SQLWATCH_Wait_Stats'
,@report_description = 'Extract for Azure Log Monitor'
,@report_definition = 'select [sql_instance],[wait_type],[waiting_tasks_count_delta],[wait_time_ms_delta]
,[max_wait_time_ms_delta],[signal_wait_time_ms_delta],[wait_category],[snapshot_time]
from [dbo].[vw_sqlwatch_report_fact_perf_os_wait_stats]
where snapshot_time > ''{REPORT_LAST_RUN_DATE}''
and snapshot_time <= ''{REPORT_CURRENT_RUN_DATE_UTC}'''
,@report_definition_type = 'Query'
,@report_action_id = -16
,@report_batch_id = 'AzureLogMonitor-1'
exec [dbo].[usp_sqlwatch_config_add_report]
@report_id = -16
,@report_title = 'SQLWATCH_Instance'
,@report_description = 'Extract for Azure Log Monitor'
,@report_definition = 'select sql_instance=[servername],[service_name],[local_net_address],[local_tcp_port],[utc_offset_minutes],[sql_version] from [dbo].[sqlwatch_meta_server]'
,@report_definition_type = 'Query'
,@report_action_id = -16
,@report_batch_id = 'AzureLogMonitor-1'
exec [dbo].[usp_sqlwatch_config_add_report]
@report_id = -17
,@report_title = 'SQLWATCH_Agent_History'
,@report_description = 'Extract for Azure Log Monitor'
,@report_definition = 'select [sql_instance],[job_name],[step_name],[run_duration_s],[run_date],[run_status_desc],[end_date],[snapshot_time]
from [dbo].[vw_sqlwatch_report_fact_agent_job_history]
where run_date > ''{REPORT_LAST_RUN_DATE}''
and run_date <= ''{REPORT_CURRENT_RUN_DATE_UTC}'''
,@report_definition_type = 'Query'
,@report_action_id = -16
,@report_batch_id = 'AzureLogMonitor-1'
/* Azure adds a lot of overhead to the data we push and seems like normalisation on local side makes very little difference to the overall row size.
For example, the below denormalised and normalised performance counters:
SQLWATCH_Performance_Counters_CL Table Entries: 800 Table Size: 693.033 KiB Size per Entry: 887.08 B ==> 2.9939GB per Month
SQLWATCH_Performance_Counters_Data_CL Table Entries: 800 Table Size: 631.559 KiB Size per Entry: 808.40 B ==> 2.7283GB per Month
But with the denormalised set we are not having to send meta data every so often and we are not having to join in Azure Log which also saves
on the number of transactions
*/
--exec [dbo].[usp_sqlwatch_user_add_report]
-- @report_id = -18
-- ,@report_title = 'SQLWATCH_Performance_Counters_Data'
-- ,@report_description = 'Extract for Azure Log Monitor'
-- ,@report_definition = 'select [performance_counter_id],[instance_name],[snapshot_time],[sql_instance],[cntr_value_calculated]
--from [dbo].[sqlwatch_logger_perf_os_performance_counters]
--where [snapshot_time] > ''{REPORT_LAST_RUN_DATE}''
--and [snapshot_time] <= ''{REPORT_CURRENT_RUN_DATE_UTC}'''
-- ,@report_definition_type = 'Query'
-- ,@report_action_id = -16
-- ,@report_batch_id = 'AzureLogMonitor-1'
set identity_insert [dbo].[sqlwatch_config_report] off;
enable trigger dbo.trg_sqlwatch_config_report_updated_U on [dbo].[sqlwatch_config_report]; | the_stack |
CREATE TABLE simpleErrorTable (a varchar(15) UNIQUE NOT NULL, b nvarchar(25), c int PRIMARY KEY, d char(15) DEFAULT 'Whoops!', e nchar(25), f datetime, g numeric(4,1) CHECK (g >= 103.5))
GO
-- setup for "data out of range for datetime" error
CREATE TABLE t517_1(a datetime);
GO
-- setup for "A SELECT statement that assigns a value to a variable must not be combined with data-retrieval operations" error
CREATE TABLE t141_1(c1 int, c2 int);
GO
-- setup for "column \"%s\" of relation \"%s\" is a generated column"
CREATE TABLE t1752_1(c1 INT, c2 INT, c3 as c1*c2)
GO
if @@trancount > 0 commit tran;
GO
-- Error: duplicate key value violates unique constraint
-- simple batch
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
INSERT INTO simpleErrorTable VALUES ('Apple', N'blue', 2, 'Chennai', N'Neutral😐', '2006-11-11 22:47:23.128', 512.4);
declare @err int = @@error; if @err = 0 select 0 else select 1;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
GO
select * from simpleErrorTable ORDER BY c
GO
truncate table simpleErrorTable
GO
-- Error: duplicate key value violates unique constraint
-- simple batch with commit transaction
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
INSERT INTO simpleErrorTable VALUES ('Apple', N'blue', 2, 'Chennai', N'Neutral😐', '2006-11-11 22:47:23.128', 512.4);
declare @err int = @@error; if @err = 0 select 0 else select 1;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
commit tran;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
truncate table simpleErrorTable
GO
-- Error: duplicate key value violates unique constraint
-- simple batch with rollback transaction
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
INSERT INTO simpleErrorTable VALUES ('Apple', N'blue', 2, 'Chennai', N'Neutral😐', '2006-11-11 22:47:23.128', 512.4);
declare @err int = @@error; if @err = 0 select 0 else select 1;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
rollback tran;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
truncate table simpleErrorTable
GO
-- Error: duplicate key value violates unique constraint
-- simple batch with rollback transaction and rollback to savepoint
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
save tran sp1;
INSERT INTO simpleErrorTable VALUES ('Apple', N'blue', 2, 'Chennai', N'Neutral😐', '2006-11-11 22:47:23.128', 512.4);
declare @err int = @@error; if @err = 0 select 0 else select 1;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
rollback tran sp1
rollback tran;
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
truncate table simpleErrorTable
GO
-- Error: duplicate key value violates unique constraint
-- simple procedure
create procedure simpleErrorProc1
as
begin
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
INSERT INTO simpleErrorTable VALUES ('Apple', N'blue', 2, 'Chennai', N'Neutral😐', '2006-11-11 22:47:23.128', 512.4);
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
end
GO
exec simpleErrorProc1
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
drop procedure simpleErrorProc1
GO
truncate table simpleErrorTable
GO
-- Error: duplicate key value violates unique constraint
-- simple batch with nested transaction
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'blue', 2, 'Chennai', N'Neutral😐', '2006-11-11 22:47:23.128', 512.4);
commit tran;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
commit tran;
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
truncate table simpleErrorTable
GO
-- Error: duplicate key value violates unique constraint
-- simple procedure with transaction
create procedure simpleErrorProc1
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'blue', 2, 'Chennai', N'Neutral😐', '2006-11-11 22:47:23.128', 512.4);
commit tran;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
commit tran;
end
GO
exec simpleErrorProc1
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
drop procedure simpleErrorProc1
GO
truncate table simpleErrorTable
GO
-- Error: duplicate key value violates unique constraint
-- simple procedure with transaction started inside procedure but ended outside procedure
create procedure simpleErrorProc1
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
INSERT INTO simpleErrorTable VALUES ('Apple', N'blue', 2, 'Chennai', N'Neutral😐', '2006-11-11 22:47:23.128', 512.4);
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
end
GO
exec simpleErrorProc1
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
commit tran
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
drop procedure simpleErrorProc1
GO
truncate table simpleErrorTable
GO
-- Error: duplicate key value violates unique constraint
-- simple procedure with transaction started outside procedure but ended inside procedure through commit
create procedure simpleErrorProc1
as
begin
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
INSERT INTO simpleErrorTable VALUES ('Apple', N'blue', 2, 'Chennai', N'Neutral😐', '2006-11-11 22:47:23.128', 512.4);
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
commit tran;
end
GO
begin tran
GO
exec simpleErrorProc1
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
drop procedure simpleErrorProc1
GO
truncate table simpleErrorTable
GO
-- Error: duplicate key value violates unique constraint
-- simple procedure with transaction started outside procedure but ended inside procedure through rollback
create procedure simpleErrorProc1
as
begin
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
INSERT INTO simpleErrorTable VALUES ('Apple', N'blue', 2, 'Chennai', N'Neutral😐', '2006-11-11 22:47:23.128', 512.4);
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
rollback tran;
end
GO
begin tran
GO
exec simpleErrorProc1
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
drop procedure simpleErrorProc1
GO
truncate table simpleErrorTable
GO
-- Error: duplicate key value violates unique constraint
-- nested procedure (level 2)
create procedure simpleErrorProc1
as
begin
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
INSERT INTO simpleErrorTable VALUES ('Apple', N'blue', 2, 'Chennai', N'Neutral😐', '2006-11-11 22:47:23.128', 512.4);
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
end
GO
create procedure simpleErrorProc2
as
begin
INSERT INTO simpleErrorTable VALUES ('Pineapple', N'pink', 7, 'Surat', N'Frown😠', '2000-12-13 12:58:23.123', 123.1);
exec simpleErrorProc1;
INSERT INTO simpleErrorTable VALUES ('Cherry', N'indigo', 8, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
end
GO
exec simpleErrorProc2
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
drop procedure simpleErrorProc1
GO
drop procedure simpleErrorProc2
GO
truncate table simpleErrorTable
GO
-- Error: duplicate key value violates unique constraint
-- nested procedure (level 3)
create procedure simpleErrorProc1
as
begin
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
INSERT INTO simpleErrorTable VALUES ('Apple', N'blue', 2, 'Chennai', N'Neutral😐', '2006-11-11 22:47:23.128', 512.4);
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
end
GO
create procedure simpleErrorProc2
as
begin
INSERT INTO simpleErrorTable VALUES ('Pineapple', N'pink', 7, 'Surat', N'Frown😠', '2000-12-13 12:58:23.123', 123.1);
exec simpleErrorProc1;
INSERT INTO simpleErrorTable VALUES ('Cherry', N'indigo', 8, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
end
GO
create procedure simpleErrorProc3
as
begin
SELECT 1;
exec simpleErrorProc2;
SELECT 2;
end
GO
exec simpleErrorProc3
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
drop procedure simpleErrorProc1
GO
drop procedure simpleErrorProc2
GO
drop procedure simpleErrorProc3
GO
truncate table simpleErrorTable
GO
-- Error: duplicate key value violates unique constraint
-- nested procedure with commit transaction
create procedure simpleErrorProc1
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
INSERT INTO simpleErrorTable VALUES ('Apple', N'blue', 2, 'Chennai', N'Neutral😐', '2006-11-11 22:47:23.128', 512.4);
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
commit tran;
end
GO
create procedure simpleErrorProc2
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Pineapple', N'pink', 7, 'Surat', N'Frown😠', '2000-12-13 12:58:23.123', 123.1);
exec simpleErrorProc1;
INSERT INTO simpleErrorTable VALUES ('Cherry', N'indigo', 8, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
commit tran;
end
GO
exec simpleErrorProc2
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
drop procedure simpleErrorProc1
GO
drop procedure simpleErrorProc2
GO
truncate table simpleErrorTable
GO
-- Error: duplicate key value violates unique constraint
-- nested procedure with rollback transaction
create procedure simpleErrorProc1
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
INSERT INTO simpleErrorTable VALUES ('Apple', N'blue', 2, 'Chennai', N'Neutral😐', '2006-11-11 22:47:23.128', 512.4);
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
rollback tran;
end
GO
create procedure simpleErrorProc2
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Pineapple', N'pink', 7, 'Surat', N'Frown😠', '2000-12-13 12:58:23.123', 123.1);
exec simpleErrorProc1;
INSERT INTO simpleErrorTable VALUES ('Cherry', N'indigo', 8, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
rollback tran;
end
GO
exec simpleErrorProc2
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
drop procedure simpleErrorProc1
GO
drop procedure simpleErrorProc2
GO
truncate table simpleErrorTable
GO
-- Error: data out of range for datetime
-- simple batch
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
INSERT INTO t517_1 VALUES (DATEADD(YY,-300,getdate()));
declare @err int = @@error; if @err = 0 select 0 else select 1;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
GO
select * from simpleErrorTable ORDER BY c
GO
truncate table simpleErrorTable
GO
-- Error: data out of range for datetime
-- simple batch with commit transaction
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
INSERT INTO t517_1 VALUES (DATEADD(YY,-300,getdate()));
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
commit tran;
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
truncate table simpleErrorTable
GO
-- Error: data out of range for datetime
-- simple batch with rollback transaction
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
INSERT INTO t517_1 VALUES (DATEADD(YY,-300,getdate()));
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
rollback tran;
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
truncate table simpleErrorTable
GO
-- Error: data out of range for datetime
-- simple batch with rollback transaction and rollback to savepoint
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
save tran sp1;
INSERT INTO t517_1 VALUES (DATEADD(YY,-300,getdate()));
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
rollback tran sp1;
rollback tran;
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
truncate table simpleErrorTable
GO
-- Error: data out of range for datetime
-- simple procedure
create procedure simpleErrorProc1
as
begin
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
INSERT INTO t517_1 VALUES (DATEADD(YY,-300,getdate()));
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
end
GO
exec simpleErrorProc1
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
drop procedure simpleErrorProc1
GO
truncate table simpleErrorTable
GO
-- Error: data out of range for datetime
-- simple batch with nested transaction
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
begin tran;
INSERT INTO t517_1 VALUES (DATEADD(YY,-300,getdate()));
declare @err int = @@error; if @err = 0 select 0 else select 1;
commit tran;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
commit tran;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
truncate table simpleErrorTable
GO
-- Error: data out of range for datetime
-- simple procedure with transaction
create procedure simpleErrorProc1
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
begin tran;
INSERT INTO t517_1 VALUES (DATEADD(YY,-300,getdate()));
commit tran;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
commit tran;
end
GO
exec simpleErrorProc1
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
drop procedure simpleErrorProc1
GO
truncate table simpleErrorTable
GO
-- Error: data out of range for datetime
-- simple procedure with transaction started inside procedure but ended outside procedure
create procedure simpleErrorProc1
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
INSERT INTO t517_1 VALUES (DATEADD(YY,-300,getdate()));
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
end
GO
exec simpleErrorProc1
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
commit tran
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
drop procedure simpleErrorProc1
GO
truncate table simpleErrorTable
GO
-- Error: data out of range for datetime
-- simple procedure with transaction started outside procedure but ended inside procedure through commit
create procedure simpleErrorProc1
as
begin
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
INSERT INTO t517_1 VALUES (DATEADD(YY,-300,getdate()));
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
commit tran;
end
GO
begin tran
GO
exec simpleErrorProc1
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
drop procedure simpleErrorProc1
GO
truncate table simpleErrorTable
GO
-- Error: data out of range for datetime
-- simple procedure with transaction started outside procedure but ended inside procedure through rollback
create procedure simpleErrorProc1
as
begin
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
INSERT INTO t517_1 VALUES (DATEADD(YY,-300,getdate()));
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
rollback tran;
end
GO
begin tran
GO
exec simpleErrorProc1
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
drop procedure simpleErrorProc1
GO
truncate table simpleErrorTable
GO
-- Error: data out of range for datetime
-- nested procedure (level 2)
create procedure simpleErrorProc1
as
begin
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
INSERT INTO t517_1 VALUES (DATEADD(YY,-300,getdate()));
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
end
GO
create procedure simpleErrorProc2
as
begin
INSERT INTO simpleErrorTable VALUES ('Pineapple', N'pink', 7, 'Surat', N'Frown😠', '2000-12-13 12:58:23.123', 123.1);
exec simpleErrorProc1;
INSERT INTO simpleErrorTable VALUES ('Cherry', N'indigo', 8, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
end
GO
exec simpleErrorProc2
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
drop procedure simpleErrorProc1
GO
drop procedure simpleErrorProc2
GO
truncate table simpleErrorTable
GO
-- Error: data out of range for datetime
-- nested procedure (level 3)
create procedure simpleErrorProc1
as
begin
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
INSERT INTO t517_1 VALUES (DATEADD(YY,-300,getdate()));
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
end
GO
create procedure simpleErrorProc2
as
begin
INSERT INTO simpleErrorTable VALUES ('Pineapple', N'pink', 7, 'Surat', N'Frown😠', '2000-12-13 12:58:23.123', 123.1);
exec simpleErrorProc1;
INSERT INTO simpleErrorTable VALUES ('Cherry', N'indigo', 8, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
end
GO
create procedure simpleErrorProc3
as
begin
SELECT 1;
exec simpleErrorProc2;
SELECT 2;
end
GO
exec simpleErrorProc3
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
drop procedure simpleErrorProc1
GO
drop procedure simpleErrorProc2
GO
drop procedure simpleErrorProc3
GO
truncate table simpleErrorTable
GO
-- Error: data out of range for datetime
-- nested procedure with commit transaction
create procedure simpleErrorProc1
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
INSERT INTO t517_1 VALUES (DATEADD(YY,-300,getdate()));
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
commit tran;
end
GO
create procedure simpleErrorProc2
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Pineapple', N'pink', 7, 'Surat', N'Frown😠', '2000-12-13 12:58:23.123', 123.1);
exec simpleErrorProc1;
INSERT INTO simpleErrorTable VALUES ('Cherry', N'indigo', 8, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
commit tran;
end
GO
exec simpleErrorProc2
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
drop procedure simpleErrorProc1
GO
drop procedure simpleErrorProc2
GO
truncate table simpleErrorTable
GO
-- Error: data out of range for datetime
-- nested procedure with rollback transaction
create procedure simpleErrorProc1
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
INSERT INTO t517_1 VALUES (DATEADD(YY,-300,getdate()));
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
rollback tran;
end
GO
create procedure simpleErrorProc2
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Pineapple', N'pink', 7, 'Surat', N'Frown😠', '2000-12-13 12:58:23.123', 123.1);
exec simpleErrorProc1;
INSERT INTO simpleErrorTable VALUES ('Cherry', N'indigo', 8, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
rollback tran;
end
GO
exec simpleErrorProc2
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
drop procedure simpleErrorProc1
GO
drop procedure simpleErrorProc2
GO
truncate table simpleErrorTable
GO
-- Error: not null constraint violation
-- simple batch
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
UPDATE simpleErrorTable SET c = NULL WHERE c = 1;
declare @err int = @@error; if @err = 0 select 0 else select 1;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
GO
select * from simpleErrorTable ORDER BY c
GO
truncate table simpleErrorTable
GO
-- Error: not null constraint violation
-- simple batch with commit transaction
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
UPDATE simpleErrorTable SET c = NULL WHERE c = 1;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
declare @err int = @@error; if @err = 0 select 0 else select 1;
commit tran;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
truncate table simpleErrorTable
GO
-- Error: not null constraint violation
-- simple batch with rollback transaction
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
UPDATE simpleErrorTable SET c = NULL WHERE c = 1;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
declare @err int = @@error; if @err = 0 select 0 else select 1;
rollback tran;
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
truncate table simpleErrorTable
GO
-- Error: not null constraint violation
-- simple batch with rollback transaction and rollback to savepoint
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
save tran sp1;
UPDATE simpleErrorTable SET c = NULL WHERE c = 1;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
declare @err int = @@error; if @err = 0 select 0 else select 1;
rollback tran sp1;
rollback tran;
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
truncate table simpleErrorTable
GO
-- Error: not null constraint violation
-- simple procedure
create procedure simpleErrorProc1
as
begin
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
UPDATE simpleErrorTable SET c = NULL WHERE c = 1;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
end
GO
exec simpleErrorProc1
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
drop procedure simpleErrorProc1
GO
truncate table simpleErrorTable
GO
-- Error: not null constraint violation
-- simple batch with nested transaction
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
begin tran;
UPDATE simpleErrorTable SET c = NULL WHERE c = 1;
commit tran;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
declare @err int = @@error; if @err = 0 select 0 else select 1;
commit tran;
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
truncate table simpleErrorTable
GO
-- Error: not null constraint violation
-- simple procedure with transaction
create procedure simpleErrorProc1
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
begin tran;
UPDATE simpleErrorTable SET c = NULL WHERE c = 1;
commit tran;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
commit tran;
end
GO
exec simpleErrorProc1
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
drop procedure simpleErrorProc1
GO
truncate table simpleErrorTable
GO
-- Error: not null constraint violation
-- simple procedure with transaction started inside procedure but ended outside procedure
create procedure simpleErrorProc1
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
UPDATE simpleErrorTable SET c = NULL WHERE c = 1;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
end
GO
exec simpleErrorProc1
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
commit tran
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
drop procedure simpleErrorProc1
GO
truncate table simpleErrorTable
GO
-- Error: not null constraint violation
-- simple procedure with transaction started outside procedure but ended inside procedure through commit
create procedure simpleErrorProc1
as
begin
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
UPDATE simpleErrorTable SET c = NULL WHERE c = 1;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
commit tran;
end
GO
begin tran
GO
exec simpleErrorProc1
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
drop procedure simpleErrorProc1
GO
truncate table simpleErrorTable
GO
-- Error: not null constraint violation
-- simple procedure with transaction started outside procedure but ended inside procedure through rollback
create procedure simpleErrorProc1
as
begin
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
UPDATE simpleErrorTable SET c = NULL WHERE c = 1;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
rollback tran;
end
GO
begin tran
GO
exec simpleErrorProc1
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
drop procedure simpleErrorProc1
GO
truncate table simpleErrorTable
GO
-- Error: not null constraint violation
-- nested procedure (level 2)
create procedure simpleErrorProc1
as
begin
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
UPDATE simpleErrorTable SET c = NULL WHERE c = 1;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
end
GO
create procedure simpleErrorProc2
as
begin
INSERT INTO simpleErrorTable VALUES ('Pineapple', N'pink', 7, 'Surat', N'Frown😠', '2000-12-13 12:58:23.123', 123.1);
exec simpleErrorProc1;
INSERT INTO simpleErrorTable VALUES ('Cherry', N'indigo', 8, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
end
GO
exec simpleErrorProc2
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
drop procedure simpleErrorProc1
GO
drop procedure simpleErrorProc2
GO
truncate table simpleErrorTable
GO
-- Error: not null constraint violation
-- nested procedure (level 3)
create procedure simpleErrorProc1
as
begin
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
UPDATE simpleErrorTable SET c = NULL WHERE c = 1;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
end
GO
create procedure simpleErrorProc2
as
begin
INSERT INTO simpleErrorTable VALUES ('Pineapple', N'pink', 7, 'Surat', N'Frown😠', '2000-12-13 12:58:23.123', 123.1);
exec simpleErrorProc1;
INSERT INTO simpleErrorTable VALUES ('Cherry', N'indigo', 8, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
end
GO
create procedure simpleErrorProc3
as
begin
SELECT 1;
exec simpleErrorProc2;
SELECT 2;
end
GO
exec simpleErrorProc3
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
drop procedure simpleErrorProc1
GO
drop procedure simpleErrorProc2
GO
drop procedure simpleErrorProc3
GO
truncate table simpleErrorTable
GO
-- Error: not null constraint violation
-- nested procedure with commit transaction
create procedure simpleErrorProc1
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
UPDATE simpleErrorTable SET c = NULL WHERE c = 1;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
commit tran;
end
GO
create procedure simpleErrorProc2
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Pineapple', N'pink', 7, 'Surat', N'Frown😠', '2000-12-13 12:58:23.123', 123.1);
exec simpleErrorProc1;
INSERT INTO simpleErrorTable VALUES ('Cherry', N'indigo', 8, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
commit tran;
end
GO
exec simpleErrorProc2
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
drop procedure simpleErrorProc1
GO
drop procedure simpleErrorProc2
GO
truncate table simpleErrorTable
GO
-- Error: not null constraint violation
-- nested procedure with rollback transaction
create procedure simpleErrorProc1
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
UPDATE simpleErrorTable SET c = NULL WHERE c = 1;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
rollback tran;
end
GO
create procedure simpleErrorProc2
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Pineapple', N'pink', 7, 'Surat', N'Frown😠', '2000-12-13 12:58:23.123', 123.1);
exec simpleErrorProc1;
INSERT INTO simpleErrorTable VALUES ('Cherry', N'indigo', 8, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
rollback tran;
end
GO
exec simpleErrorProc2
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
drop procedure simpleErrorProc1
GO
drop procedure simpleErrorProc2
GO
truncate table simpleErrorTable
GO
-- Error: creating an existing table
-- simple batch
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
CREATE TABLE simpleErrorTable (a int);
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
truncate table simpleErrorTable
GO
-- Error: creating an existing table
-- simple batch with commit transaction
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
CREATE TABLE simpleErrorTable (a int);
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
GO
commit tran;
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
truncate table simpleErrorTable
GO
-- Error: creating an existing table
-- simple batch with rollback transaction
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
CREATE TABLE simpleErrorTable (a int);
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
GO
rollback tran;
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
truncate table simpleErrorTable
GO
-- Error: creating an existing table
-- simple batch with rollback transaction and rollback to savepoint
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
save tran sp1;
CREATE TABLE simpleErrorTable (a int);
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
GO
rollback tran sp1;
GO
rollback tran;
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
truncate table simpleErrorTable
GO
-- Error: creating an existing table
-- simple procedure
create procedure simpleErrorProc1
as
begin
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
CREATE TABLE simpleErrorTable (a int);
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
end
GO
exec simpleErrorProc1
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
drop procedure simpleErrorProc1
GO
truncate table simpleErrorTable
GO
-- Error: creating an existing table
-- simple batch with nested transaction
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
begin tran;
CREATE TABLE simpleErrorTable (a int);
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
commit tran;
GO
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
GO
commit tran;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
truncate table simpleErrorTable
GO
-- Error: creating an existing table
-- simple procedure with transaction
create procedure simpleErrorProc1
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
begin tran;
CREATE TABLE simpleErrorTable (a int);
commit tran;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
commit tran;
end
GO
exec simpleErrorProc1
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
drop procedure simpleErrorProc1
GO
truncate table simpleErrorTable
GO
-- Error: creating an existing table
-- simple procedure with transaction started inside procedure but ended outside procedure
create procedure simpleErrorProc1
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
CREATE TABLE simpleErrorTable (a int);
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
end
GO
exec simpleErrorProc1
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
commit tran
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
drop procedure simpleErrorProc1
GO
truncate table simpleErrorTable
GO
-- Error: creating an existing table
-- simple procedure with transaction started outside procedure but ended inside procedure through commit
create procedure simpleErrorProc1
as
begin
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
CREATE TABLE simpleErrorTable (a int);
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
commit tran;
end
GO
begin tran
GO
exec simpleErrorProc1
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
drop procedure simpleErrorProc1
GO
truncate table simpleErrorTable
GO
-- Error: creating an existing table
-- simple procedure with transaction started outside procedure but ended inside procedure through rollback
create procedure simpleErrorProc1
as
begin
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
CREATE TABLE simpleErrorTable (a int);
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
rollback tran;
end
GO
begin tran
GO
exec simpleErrorProc1
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
drop procedure simpleErrorProc1
GO
truncate table simpleErrorTable
GO
-- Error: creating an existing table
-- nested procedure (level 2)
create procedure simpleErrorProc1
as
begin
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
CREATE TABLE simpleErrorTable (a int);
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
end
GO
create procedure simpleErrorProc2
as
begin
INSERT INTO simpleErrorTable VALUES ('Pineapple', N'pink', 7, 'Surat', N'Frown😠', '2000-12-13 12:58:23.123', 123.1);
exec simpleErrorProc1;
INSERT INTO simpleErrorTable VALUES ('Cherry', N'indigo', 8, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
end
GO
exec simpleErrorProc2
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
drop procedure simpleErrorProc1
GO
drop procedure simpleErrorProc2
GO
truncate table simpleErrorTable
GO
-- Error: creating an existing table
-- nested procedure (level 3)
create procedure simpleErrorProc1
as
begin
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
CREATE TABLE simpleErrorTable (a int);
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
end
GO
create procedure simpleErrorProc2
as
begin
INSERT INTO simpleErrorTable VALUES ('Pineapple', N'pink', 7, 'Surat', N'Frown😠', '2000-12-13 12:58:23.123', 123.1);
exec simpleErrorProc1;
INSERT INTO simpleErrorTable VALUES ('Cherry', N'indigo', 8, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
end
GO
create procedure simpleErrorProc3
as
begin
SELECT 1;
exec simpleErrorProc2;
SELECT 2;
end
GO
exec simpleErrorProc3
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
drop procedure simpleErrorProc1
GO
drop procedure simpleErrorProc2
GO
drop procedure simpleErrorProc3
GO
truncate table simpleErrorTable
GO
-- Error: creating an existing table
-- nested procedure with commit transaction
create procedure simpleErrorProc1
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
CREATE TABLE simpleErrorTable (a int);
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
commit tran;
end
GO
create procedure simpleErrorProc2
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Pineapple', N'pink', 7, 'Surat', N'Frown😠', '2000-12-13 12:58:23.123', 123.1);
exec simpleErrorProc1;
INSERT INTO simpleErrorTable VALUES ('Cherry', N'indigo', 8, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
commit tran;
end
GO
exec simpleErrorProc2
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
drop procedure simpleErrorProc1
GO
drop procedure simpleErrorProc2
GO
truncate table simpleErrorTable
GO
-- Error: creating an existing table
-- nested procedure with rollback transaction
create procedure simpleErrorProc1
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
CREATE TABLE simpleErrorTable (a int);
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
rollback tran;
end
GO
create procedure simpleErrorProc2
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Pineapple', N'pink', 7, 'Surat', N'Frown😠', '2000-12-13 12:58:23.123', 123.1);
exec simpleErrorProc1;
INSERT INTO simpleErrorTable VALUES ('Cherry', N'indigo', 8, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
rollback tran;
end
GO
exec simpleErrorProc2
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
drop procedure simpleErrorProc1
GO
drop procedure simpleErrorProc2
GO
truncate table simpleErrorTable
GO
-- Error: "column \"%s\" of relation \"%s\" is a generated column"
-- simple batch
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
ALTER TABLE t1752_1 ADD CONSTRAINT constraint1752 DEFAULT 'test' FOR c3;
declare @err int = @@error; if @err = 0 select 0 else select 1;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
GO
GO
select * from simpleErrorTable ORDER BY c
GO
truncate table simpleErrorTable
GO
-- Error: "column \"%s\" of relation \"%s\" is a generated column"
-- simple batch with commit transaction
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
ALTER TABLE t1752_1 ADD CONSTRAINT constraint1752 DEFAULT 'test' FOR c3;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
commit tran;
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
commit tran
GO
select @@trancount
GO
truncate table simpleErrorTable
GO
-- Error: "column \"%s\" of relation \"%s\" is a generated column"
-- simple batch with rollback transaction
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
ALTER TABLE t1752_1 ADD CONSTRAINT constraint1752 DEFAULT 'test' FOR c3;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
rollback tran;
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
commit tran
GO
select @@trancount
GO
truncate table simpleErrorTable
GO
-- Error: "column \"%s\" of relation \"%s\" is a generated column"
-- simple batch with rollback transaction and rollback to savepoint
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
save tran sp1;
ALTER TABLE t1752_1 ADD CONSTRAINT constraint1752 DEFAULT 'test' FOR c3;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
rollback tran sp1;
rollback tran;
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
commit tran
GO
select @@trancount
GO
truncate table simpleErrorTable
GO
-- Error: "column \"%s\" of relation \"%s\" is a generated column"
-- simple procedure
create procedure simpleErrorProc1
as
begin
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
ALTER TABLE t1752_1 ADD CONSTRAINT constraint1752 DEFAULT 'test' FOR c3;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
end
GO
exec simpleErrorProc1
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
drop procedure simpleErrorProc1
GO
truncate table simpleErrorTable
GO
-- Error: "column \"%s\" of relation \"%s\" is a generated column"
-- simple batch with nested transaction
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
begin tran;
ALTER TABLE t1752_1 ADD CONSTRAINT constraint1752 DEFAULT 'test' FOR c3;
commit tran;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
commit tran;
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
commit tran
GO
select @@trancount
GO
commit tran
GO
select @@trancount
GO
truncate table simpleErrorTable
GO
-- Error: "column \"%s\" of relation \"%s\" is a generated column"
-- simple procedure with transaction
create procedure simpleErrorProc1
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
begin tran;
ALTER TABLE t1752_1 ADD CONSTRAINT constraint1752 DEFAULT 'test' FOR c3;
commit tran;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
commit tran;
end
GO
exec simpleErrorProc1
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
commit tran
GO
select @@trancount
GO
commit tran
GO
select @@trancount
GO
drop procedure simpleErrorProc1
GO
truncate table simpleErrorTable
GO
-- Error: "column \"%s\" of relation \"%s\" is a generated column"
-- simple procedure with transaction started inside procedure but ended outside procedure
create procedure simpleErrorProc1
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
ALTER TABLE t1752_1 ADD CONSTRAINT constraint1752 DEFAULT 'test' FOR c3;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
end
GO
exec simpleErrorProc1
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
commit tran
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
drop procedure simpleErrorProc1
GO
truncate table simpleErrorTable
GO
-- Error: "column \"%s\" of relation \"%s\" is a generated column"
-- simple procedure with transaction started outside procedure but ended inside procedure through commit
create procedure simpleErrorProc1
as
begin
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
ALTER TABLE t1752_1 ADD CONSTRAINT constraint1752 DEFAULT 'test' FOR c3;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
commit tran;
end
GO
begin tran
GO
exec simpleErrorProc1
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
commit tran
GO
select @@trancount
GO
drop procedure simpleErrorProc1
GO
truncate table simpleErrorTable
GO
-- Error: "column \"%s\" of relation \"%s\" is a generated column"
-- simple procedure with transaction started outside procedure but ended inside procedure through rollback
create procedure simpleErrorProc1
as
begin
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
ALTER TABLE t1752_1 ADD CONSTRAINT constraint1752 DEFAULT 'test' FOR c3;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
rollback tran;
end
GO
begin tran
GO
exec simpleErrorProc1
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
commit tran
GO
select @@trancount
GO
drop procedure simpleErrorProc1
GO
truncate table simpleErrorTable
GO
-- Error: "column \"%s\" of relation \"%s\" is a generated column"
-- nested procedure (level 2)
create procedure simpleErrorProc1
as
begin
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
ALTER TABLE t1752_1 ADD CONSTRAINT constraint1752 DEFAULT 'test' FOR c3;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
end
GO
create procedure simpleErrorProc2
as
begin
INSERT INTO simpleErrorTable VALUES ('Pineapple', N'pink', 7, 'Surat', N'Frown😠', '2000-12-13 12:58:23.123', 123.1);
exec simpleErrorProc1;
INSERT INTO simpleErrorTable VALUES ('Cherry', N'indigo', 8, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
end
GO
exec simpleErrorProc2
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
drop procedure simpleErrorProc1
GO
drop procedure simpleErrorProc2
GO
truncate table simpleErrorTable
GO
-- Error: "column \"%s\" of relation \"%s\" is a generated column"
-- nested procedure (level 3)
create procedure simpleErrorProc1
as
begin
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
ALTER TABLE t1752_1 ADD CONSTRAINT constraint1752 DEFAULT 'test' FOR c3;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
end
GO
create procedure simpleErrorProc2
as
begin
INSERT INTO simpleErrorTable VALUES ('Pineapple', N'pink', 7, 'Surat', N'Frown😠', '2000-12-13 12:58:23.123', 123.1);
exec simpleErrorProc1;
INSERT INTO simpleErrorTable VALUES ('Cherry', N'indigo', 8, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
end
GO
create procedure simpleErrorProc3
as
begin
SELECT 1;
exec simpleErrorProc2;
SELECT 2;
end
GO
exec simpleErrorProc3
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
drop procedure simpleErrorProc1
GO
drop procedure simpleErrorProc2
GO
drop procedure simpleErrorProc3
GO
truncate table simpleErrorTable
GO
-- Error: "column \"%s\" of relation \"%s\" is a generated column"
-- nested procedure with commit transaction
create procedure simpleErrorProc1
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
ALTER TABLE t1752_1 ADD CONSTRAINT constraint1752 DEFAULT 'test' FOR c3;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
commit tran;
end
GO
create procedure simpleErrorProc2
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Pineapple', N'pink', 7, 'Surat', N'Frown😠', '2000-12-13 12:58:23.123', 123.1);
exec simpleErrorProc1;
INSERT INTO simpleErrorTable VALUES ('Cherry', N'indigo', 8, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
commit tran;
end
GO
exec simpleErrorProc2
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
commit tran
GO
select @@trancount
GO
drop procedure simpleErrorProc1
GO
drop procedure simpleErrorProc2
GO
truncate table simpleErrorTable
GO
-- Error: "column \"%s\" of relation \"%s\" is a generated column"
-- nested procedure with rollback transaction
create procedure simpleErrorProc1
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
ALTER TABLE t1752_1 ADD CONSTRAINT constraint1752 DEFAULT 'test' FOR c3;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
rollback tran;
end
GO
create procedure simpleErrorProc2
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Pineapple', N'pink', 7, 'Surat', N'Frown😠', '2000-12-13 12:58:23.123', 123.1);
exec simpleErrorProc1;
INSERT INTO simpleErrorTable VALUES ('Cherry', N'indigo', 8, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
rollback tran;
end
GO
exec simpleErrorProc2
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
commit tran
GO
select @@trancount
GO
drop procedure simpleErrorProc1
GO
drop procedure simpleErrorProc2
GO
truncate table simpleErrorTable
GO
-- Error: "A SELECT statement that assigns a value to a variable must not be
-- combined with data-retrieval operations"
-- simple batch
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
DECLARE @a int; SELECT @a = c1, c2 FROM t141_1;
declare @err int = @@error; if @err = 0 select 0 else select 1;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
GO
select * from simpleErrorTable ORDER BY c
GO
truncate table simpleErrorTable
GO
-- Error: "A SELECT statement that assigns a value to a variable must not be
-- combined with data-retrieval operations"
-- simple batch with commit transaction
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
DECLARE @a int; SELECT @a = c1, c2 FROM t141_1;
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
commit tran;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
truncate table simpleErrorTable
GO
-- Error: "A SELECT statement that assigns a value to a variable must not be
-- combined with data-retrieval operations"
-- simple batch with rollback transaction
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
DECLARE @a int; SELECT @a = c1, c2 FROM t141_1;
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
rollback tran;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
truncate table simpleErrorTable
GO
-- Error: "A SELECT statement that assigns a value to a variable must not be
-- combined with data-retrieval operations"
-- simple batch with rollback transaction and rollback to savepoint
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
save tran sp1;
DECLARE @a int; SELECT @a = c1, c2 FROM t141_1;
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
rollback tran sp1;
GO
rollback tran;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
truncate table simpleErrorTable
GO
-- Error: "A SELECT statement that assigns a value to a variable must not be
-- combined with data-retrieval operations"
-- simple procedure with transaction started outside procedure but ended inside procedure through commit
create procedure simpleErrorProc1
as
begin
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
DECLARE @a int; SELECT @a = c1, c2 FROM t141_1;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
commit tran;
end
GO
begin tran
GO
DECLARE @a tinyint = 1000;
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
commit tran
GO
select @@trancount
GO
drop procedure simpleErrorProc1
GO
truncate table simpleErrorTable
GO
-- Error: "A SELECT statement that assigns a value to a variable must not be
-- combined with data-retrieval operations"
-- simple procedure with transaction started outside procedure but ended inside procedure through rollback
create procedure simpleErrorProc1
as
begin
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
DECLARE @a int; SELECT @a = c1, c2 FROM t141_1;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
rollback tran;
end
GO
begin tran
GO
DECLARE @a tinyint = 1000;
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
commit tran
GO
select @@trancount
GO
drop procedure simpleErrorProc1
GO
truncate table simpleErrorTable
GO
-- Error: "A SELECT statement that assigns a value to a variable must not be
-- combined with data-retrieval operations"
-- nested procedure (level 2)
create procedure simpleErrorProc1
as
begin
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
DECLARE @a int; SELECT @a = c1, c2 FROM t141_1;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
end
GO
create procedure simpleErrorProc2
as
begin
INSERT INTO simpleErrorTable VALUES ('Pineapple', N'pink', 7, 'Surat', N'Frown😠', '2000-12-13 12:58:23.123', 123.1);
DECLARE @a tinyint = 1000;
INSERT INTO simpleErrorTable VALUES ('Cherry', N'indigo', 8, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
end
GO
exec simpleErrorProc2
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
drop procedure simpleErrorProc2
GO
truncate table simpleErrorTable
GO
-- Error: "A SELECT statement that assigns a value to a variable must not be
-- combined with data-retrieval operations"
-- nested procedure (level 3)
create procedure simpleErrorProc1
as
begin
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
DECLARE @a int; SELECT @a = c1, c2 FROM t141_1;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
end
GO
create procedure simpleErrorProc2
as
begin
INSERT INTO simpleErrorTable VALUES ('Pineapple', N'pink', 7, 'Surat', N'Frown😠', '2000-12-13 12:58:23.123', 123.1);
DECLARE @a tinyint = 1000;
INSERT INTO simpleErrorTable VALUES ('Cherry', N'indigo', 8, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
end
GO
create procedure simpleErrorProc3
as
begin
SELECT 1;
exec simpleErrorProc2;
SELECT 2;
end
GO
exec simpleErrorProc3
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
drop procedure simpleErrorProc2
GO
drop procedure simpleErrorProc3
GO
truncate table simpleErrorTable
GO
-- Error: "A SELECT statement that assigns a value to a variable must not be
-- combined with data-retrieval operations"
-- nested procedure with commit transaction
create procedure simpleErrorProc1
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
DECLARE @a int; SELECT @a = c1, c2 FROM t141_1;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
commit tran;
end
GO
create procedure simpleErrorProc2
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Pineapple', N'pink', 7, 'Surat', N'Frown😠', '2000-12-13 12:58:23.123', 123.1);
DECLARE @a tinyint = 1000;
INSERT INTO simpleErrorTable VALUES ('Cherry', N'indigo', 8, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
commit tran;
end
GO
exec simpleErrorProc2
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
drop procedure simpleErrorProc2
GO
truncate table simpleErrorTable
GO
-- Error: "A SELECT statement that assigns a value to a variable must not be
-- combined with data-retrieval operations"
-- nested procedure with rollback transaction
create procedure simpleErrorProc1
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
DECLARE @a int; SELECT @a = c1, c2 FROM t141_1;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
rollback tran;
end
GO
create procedure simpleErrorProc2
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Pineapple', N'pink', 7, 'Surat', N'Frown😠', '2000-12-13 12:58:23.123', 123.1);
DECLARE @a tinyint = 1000;
INSERT INTO simpleErrorTable VALUES ('Cherry', N'indigo', 8, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
rollback tran;
end
GO
exec simpleErrorProc2
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
drop procedure simpleErrorProc2
GO
truncate table simpleErrorTable
GO
select @@trancount;
GO
if @@trancount > 0 commit tran;
GO
-- Error: value for domain tinyint violates check constraint "tinyint_check"
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
DECLARE @a tinyint = 1000;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
drop procedure simpleErrorProc1
GO
truncate table simpleErrorTable
GO
-- Error: conversion error and executing stored procedure using sp_executesql
-- simple batch
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
EXECUTE sp_executesql N'UPDATE simpleErrorTable SET a = convert(int, ''abc'') WHERE c = 1;';
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
truncate table simpleErrorTable
GO
-- Error: conversion error and executing stored procedure using sp_executesql
-- simple batch with commit transaction
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
EXECUTE sp_executesql N'UPDATE simpleErrorTable SET a = convert(int, ''abc'') WHERE c = 1;';
GO
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
commit tran;
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
truncate table simpleErrorTable
GO
-- Error: conversion error and executing stored procedure using sp_executesql
-- simple batch with rollback transaction
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
EXECUTE sp_executesql N'UPDATE simpleErrorTable SET a = convert(int, ''abc'') WHERE c = 1;';
GO
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
rollback tran;
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
truncate table simpleErrorTable
GO
-- Error: conversion error and executing stored procedure using sp_executesql
-- simple batch with rollback transaction and rollback to savepoint
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
save tran sp1;
EXECUTE sp_executesql N'UPDATE simpleErrorTable SET a = convert(int, ''abc'') WHERE c = 1;';
GO
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
rollback tran sp1;
GO
rollback tran;
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
truncate table simpleErrorTable
GO
-- Error: conversion error and executing stored procedure using sp_executesql
-- simple procedure
create procedure simpleErrorProc1
as
begin
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
EXECUTE sp_executesql N'UPDATE simpleErrorTable SET a = convert(int, ''abc'') WHERE c = 1;';
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
end
GO
exec simpleErrorProc1
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
drop procedure simpleErrorProc1
GO
truncate table simpleErrorTable
GO
-- Error: conversion error and executing stored procedure using sp_executesql
-- simple batch with nested transaction
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
begin tran;
EXECUTE sp_executesql N'UPDATE simpleErrorTable SET a = convert(int, ''abc'') WHERE c = 1;';
GO
commit tran;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
GO
commit tran;
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
truncate table simpleErrorTable
GO
-- Error: conversion error and executing stored procedure using sp_executesql
-- simple procedure with transaction
create procedure simpleErrorProc1
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
begin tran;
EXECUTE sp_executesql N'UPDATE simpleErrorTable SET a = convert(int, ''abc'') WHERE c = 1;';
commit tran;
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
commit tran;
end
GO
exec simpleErrorProc1
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
drop procedure simpleErrorProc1
GO
truncate table simpleErrorTable
GO
-- Error: conversion error and executing stored procedure using sp_executesql
-- simple procedure with transaction started inside procedure but ended outside procedure
create procedure simpleErrorProc1
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
EXECUTE sp_executesql N'UPDATE simpleErrorTable SET a = convert(int, ''abc'') WHERE c = 1;';
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
end
GO
exec simpleErrorProc1
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
commit tran
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
drop procedure simpleErrorProc1
GO
truncate table simpleErrorTable
GO
-- Error: conversion error and executing stored procedure using sp_executesql
-- simple procedure with transaction started outside procedure but ended inside procedure through commit
create procedure simpleErrorProc1
as
begin
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
EXECUTE sp_executesql N'UPDATE simpleErrorTable SET a = convert(int, ''abc'') WHERE c = 1;';
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
commit tran;
end
GO
begin tran
GO
exec simpleErrorProc1
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
drop procedure simpleErrorProc1
GO
truncate table simpleErrorTable
GO
-- Error: conversion error and executing stored procedure using sp_executesql
-- simple procedure with transaction started outside procedure but ended inside procedure through rollback
create procedure simpleErrorProc1
as
begin
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
EXECUTE sp_executesql N'UPDATE simpleErrorTable SET a = convert(int, ''abc'') WHERE c = 1;';
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
rollback tran;
end
GO
begin tran
GO
exec simpleErrorProc1
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
drop procedure simpleErrorProc1
GO
truncate table simpleErrorTable
GO
-- Error: conversion error and executing stored procedure using sp_executesql
-- nested procedure (level 2)
create procedure simpleErrorProc1
as
begin
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
EXECUTE sp_executesql N'UPDATE simpleErrorTable SET a = convert(int, ''abc'') WHERE c = 1;';
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
end
GO
create procedure simpleErrorProc2
as
begin
INSERT INTO simpleErrorTable VALUES ('Pineapple', N'pink', 7, 'Surat', N'Frown😠', '2000-12-13 12:58:23.123', 123.1);
exec simpleErrorProc1;
INSERT INTO simpleErrorTable VALUES ('Cherry', N'indigo', 8, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
end
GO
exec simpleErrorProc2
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
drop procedure simpleErrorProc1
GO
drop procedure simpleErrorProc2
GO
truncate table simpleErrorTable
GO
-- Error: conversion error and executing stored procedure using sp_executesql
-- nested procedure (level 3)
create procedure simpleErrorProc1
as
begin
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
EXECUTE sp_executesql N'UPDATE simpleErrorTable SET a = convert(int, ''abc'') WHERE c = 1;';
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
end
GO
create procedure simpleErrorProc2
as
begin
INSERT INTO simpleErrorTable VALUES ('Pineapple', N'pink', 7, 'Surat', N'Frown😠', '2000-12-13 12:58:23.123', 123.1);
exec simpleErrorProc1;
INSERT INTO simpleErrorTable VALUES ('Cherry', N'indigo', 8, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
end
GO
create procedure simpleErrorProc3
as
begin
SELECT 1;
exec simpleErrorProc2;
SELECT 2;
end
GO
exec simpleErrorProc2
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
drop procedure simpleErrorProc1
GO
drop procedure simpleErrorProc2
GO
drop procedure simpleErrorProc3
GO
truncate table simpleErrorTable
GO
-- Error: conversion error and executing stored procedure using sp_executesql
-- nested procedure with commit transaction
create procedure simpleErrorProc1
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
EXECUTE sp_executesql N'UPDATE simpleErrorTable SET a = convert(int, ''abc'') WHERE c = 1;';
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
commit tran;
end
GO
create procedure simpleErrorProc2
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Pineapple', N'pink', 7, 'Surat', N'Frown😠', '2000-12-13 12:58:23.123', 123.1);
exec simpleErrorProc1;
INSERT INTO simpleErrorTable VALUES ('Cherry', N'indigo', 8, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
commit tran;
end
GO
exec simpleErrorProc2
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
drop procedure simpleErrorProc1
GO
drop procedure simpleErrorProc2
GO
truncate table simpleErrorTable
GO
-- Error: conversion error and executing stored procedure using sp_executesql
-- nested procedure with rollback transaction
create procedure simpleErrorProc1
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Apple', N'red', 1, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
EXECUTE sp_executesql N'UPDATE simpleErrorTable SET a = convert(int, ''abc'') WHERE c = 1;';
INSERT INTO simpleErrorTable(a, b, c, e, f, g) VALUES ('Orange', NULL, 3, N'Happy😀', '1900-02-28 23:59:59.989', 342.5);
rollback tran;
end
GO
create procedure simpleErrorProc2
as
begin
begin tran;
INSERT INTO simpleErrorTable VALUES ('Pineapple', N'pink', 7, 'Surat', N'Frown😠', '2000-12-13 12:58:23.123', 123.1);
exec simpleErrorProc1;
INSERT INTO simpleErrorTable VALUES ('Cherry', N'indigo', 8, 'Delhi', N'Sad😞', '2000-12-13 12:58:23.123', 123.1);
rollback tran;
end
GO
exec simpleErrorProc2
GO
declare @err int = @@error; if @err = 0 select 0 else select 1;
GO
select * from simpleErrorTable ORDER BY c
GO
select @@trancount
GO
drop procedure simpleErrorProc1
GO
drop procedure simpleErrorProc2
GO
truncate table simpleErrorTable
GO
-- cleanup for "data out of range for datetime" error
DROP TABLE t517_1;
GO
-- clean up for "A SELECT statement that assigns a value to a variable must not
-- be combined with data-retrieval operations" error
DROP TABLE t141_1;
GO
-- setup for "column \"%s\" of relation \"%s\" is a generated column"
DROP TABLE t1752_1;
GO
drop table simpleErrorTable
GO
while (@@trancount > 0) commit tran;
GO | the_stack |
-- This query generated by script/generate_corr_queries.py and should probably not be
-- modified manually. Instead, make changes to that script and rerun it.
WITH
raw_effect_sizes AS (
SELECT
COUNT(1) AS campaign_count,
state_user_v_peer_open
,business_type
-- The following is the slope of the regression line. Note that CORR (which is the Pearson's correlation
-- coefficient is symmetric in its arguments, but since STDDEV_POP(open_rate_su) appears in the
-- numerator this is the slope of the regression line considering STDDEV_POP(open_rate_su) to be
-- the "y variable" and uses_small_subject_line to be the "x variable" in terms of the regression line.
,SAFE_DIVIDE(SAFE_MULTIPLY(CORR(open_rate_su, uses_small_subject_line), STDDEV_POP(open_rate_su)), STDDEV_POP(uses_small_subject_line)) AS open_uses_small_subject_line
-- The following is the slope of the regression line. Note that CORR (which is the Pearson's correlation
-- coefficient is symmetric in its arguments, but since STDDEV_POP(open_rate_su) appears in the
-- numerator this is the slope of the regression line considering STDDEV_POP(open_rate_su) to be
-- the "y variable" and uses_personal_subject to be the "x variable" in terms of the regression line.
,SAFE_DIVIDE(SAFE_MULTIPLY(CORR(open_rate_su, uses_personal_subject), STDDEV_POP(open_rate_su)), STDDEV_POP(uses_personal_subject)) AS open_uses_personal_subject
-- The following is the slope of the regression line. Note that CORR (which is the Pearson's correlation
-- coefficient is symmetric in its arguments, but since STDDEV_POP(open_rate_su) appears in the
-- numerator this is the slope of the regression line considering STDDEV_POP(open_rate_su) to be
-- the "y variable" and uses_timewarp to be the "x variable" in terms of the regression line.
,SAFE_DIVIDE(SAFE_MULTIPLY(CORR(open_rate_su, uses_timewarp), STDDEV_POP(open_rate_su)), STDDEV_POP(uses_timewarp)) AS open_uses_timewarp
-- The following is the slope of the regression line. Note that CORR (which is the Pearson's correlation
-- coefficient is symmetric in its arguments, but since STDDEV_POP(open_rate_su) appears in the
-- numerator this is the slope of the regression line considering STDDEV_POP(open_rate_su) to be
-- the "y variable" and uses_small_preview to be the "x variable" in terms of the regression line.
,SAFE_DIVIDE(SAFE_MULTIPLY(CORR(open_rate_su, uses_small_preview), STDDEV_POP(open_rate_su)), STDDEV_POP(uses_small_preview)) AS open_uses_small_preview
-- The following is the slope of the regression line. Note that CORR (which is the Pearson's correlation
-- coefficient is symmetric in its arguments, but since STDDEV_POP(open_rate_su) appears in the
-- numerator this is the slope of the regression line considering STDDEV_POP(open_rate_su) to be
-- the "y variable" and uses_personal_to to be the "x variable" in terms of the regression line.
,SAFE_DIVIDE(SAFE_MULTIPLY(CORR(open_rate_su, uses_personal_to), STDDEV_POP(open_rate_su)), STDDEV_POP(uses_personal_to)) AS open_uses_personal_to
-- The following is the slope of the regression line. Note that CORR (which is the Pearson's correlation
-- coefficient is symmetric in its arguments, but since STDDEV_POP(open_rate_su) appears in the
-- numerator this is the slope of the regression line considering STDDEV_POP(open_rate_su) to be
-- the "y variable" and uses_ab_test_subject to be the "x variable" in terms of the regression line.
,SAFE_DIVIDE(SAFE_MULTIPLY(CORR(open_rate_su, uses_ab_test_subject), STDDEV_POP(open_rate_su)), STDDEV_POP(uses_ab_test_subject)) AS open_uses_ab_test_subject
-- The following is the slope of the regression line. Note that CORR (which is the Pearson's correlation
-- coefficient is symmetric in its arguments, but since STDDEV_POP(open_rate_su) appears in the
-- numerator this is the slope of the regression line considering STDDEV_POP(open_rate_su) to be
-- the "y variable" and uses_ab_test_content to be the "x variable" in terms of the regression line.
,SAFE_DIVIDE(SAFE_MULTIPLY(CORR(open_rate_su, uses_ab_test_content), STDDEV_POP(open_rate_su)), STDDEV_POP(uses_ab_test_content)) AS open_uses_ab_test_content
-- The following is the slope of the regression line. Note that CORR (which is the Pearson's correlation
-- coefficient is symmetric in its arguments, but since STDDEV_POP(open_rate_su) appears in the
-- numerator this is the slope of the regression line considering STDDEV_POP(open_rate_su) to be
-- the "y variable" and uses_preview_text to be the "x variable" in terms of the regression line.
,SAFE_DIVIDE(SAFE_MULTIPLY(CORR(open_rate_su, uses_preview_text), STDDEV_POP(open_rate_su)), STDDEV_POP(uses_preview_text)) AS open_uses_preview_text
-- The following is the slope of the regression line. Note that CORR (which is the Pearson's correlation
-- coefficient is symmetric in its arguments, but since STDDEV_POP(open_rate_su) appears in the
-- numerator this is the slope of the regression line considering STDDEV_POP(open_rate_su) to be
-- the "y variable" and uses_sto to be the "x variable" in terms of the regression line.
,SAFE_DIVIDE(SAFE_MULTIPLY(CORR(open_rate_su, uses_sto), STDDEV_POP(open_rate_su)), STDDEV_POP(uses_sto)) AS open_uses_sto
-- The following is the slope of the regression line. Note that CORR (which is the Pearson's correlation
-- coefficient is symmetric in its arguments, but since STDDEV_POP(open_rate_su) appears in the
-- numerator this is the slope of the regression line considering STDDEV_POP(open_rate_su) to be
-- the "y variable" and uses_freemail_from to be the "x variable" in terms of the regression line.
,SAFE_DIVIDE(SAFE_MULTIPLY(CORR(open_rate_su, uses_freemail_from), STDDEV_POP(open_rate_su)), STDDEV_POP(uses_freemail_from)) AS open_uses_freemail_from
-- The following is the slope of the regression line. Note that CORR (which is the Pearson's correlation
-- coefficient is symmetric in its arguments, but since STDDEV_POP(open_rate_su) appears in the
-- numerator this is the slope of the regression line considering STDDEV_POP(open_rate_su) to be
-- the "y variable" and uses_resend_non_openers to be the "x variable" in terms of the regression line.
,SAFE_DIVIDE(SAFE_MULTIPLY(CORR(open_rate_su, uses_resend_non_openers), STDDEV_POP(open_rate_su)), STDDEV_POP(uses_resend_non_openers)) AS open_uses_resend_non_openers
-- The following is the slope of the regression line. Note that CORR (which is the Pearson's correlation
-- coefficient is symmetric in its arguments, but since STDDEV_POP(open_rate_su) appears in the
-- numerator this is the slope of the regression line considering STDDEV_POP(open_rate_su) to be
-- the "y variable" and uses_promo_code to be the "x variable" in terms of the regression line.
,SAFE_DIVIDE(SAFE_MULTIPLY(CORR(open_rate_su, uses_promo_code), STDDEV_POP(open_rate_su)), STDDEV_POP(uses_promo_code)) AS open_uses_promo_code
-- The following is the slope of the regression line. Note that CORR (which is the Pearson's correlation
-- coefficient is symmetric in its arguments, but since STDDEV_POP(open_rate_su) appears in the
-- numerator this is the slope of the regression line considering STDDEV_POP(open_rate_su) to be
-- the "y variable" and uses_prex to be the "x variable" in terms of the regression line.
,SAFE_DIVIDE(SAFE_MULTIPLY(CORR(open_rate_su, uses_prex), STDDEV_POP(open_rate_su)), STDDEV_POP(uses_prex)) AS open_uses_prex
-- The following is the slope of the regression line. Note that CORR (which is the Pearson's correlation
-- coefficient is symmetric in its arguments, but since STDDEV_POP(open_rate_su) appears in the
-- numerator this is the slope of the regression line considering STDDEV_POP(open_rate_su) to be
-- the "y variable" and uses_ab_test_from to be the "x variable" in terms of the regression line.
,SAFE_DIVIDE(SAFE_MULTIPLY(CORR(open_rate_su, uses_ab_test_from), STDDEV_POP(open_rate_su)), STDDEV_POP(uses_ab_test_from)) AS open_uses_ab_test_from
FROM
`{{gcp_project}}.{{dataset}}.global_actions_states`
GROUP BY
state_user_v_peer_open
,business_type),
imputed_effect_sizes AS (
SELECT
campaign_count,
state_user_v_peer_open
,business_type
-- We now impute the value of the effect size to 0 if it was NaN or NULL. This is to
-- take into account states where all campaigns either did or did not perform an
-- action. In these cases, we assume that campaign outcome is uncorrelated with
-- the action because we do not have evidence otherwise.
,COALESCE(IF(IS_NAN(open_uses_small_subject_line), 0, open_uses_small_subject_line), 0) AS open_uses_small_subject_line
-- We now impute the value of the effect size to 0 if it was NaN or NULL. This is to
-- take into account states where all campaigns either did or did not perform an
-- action. In these cases, we assume that campaign outcome is uncorrelated with
-- the action because we do not have evidence otherwise.
,COALESCE(IF(IS_NAN(open_uses_personal_subject), 0, open_uses_personal_subject), 0) AS open_uses_personal_subject
-- We now impute the value of the effect size to 0 if it was NaN or NULL. This is to
-- take into account states where all campaigns either did or did not perform an
-- action. In these cases, we assume that campaign outcome is uncorrelated with
-- the action because we do not have evidence otherwise.
,COALESCE(IF(IS_NAN(open_uses_timewarp), 0, open_uses_timewarp), 0) AS open_uses_timewarp
-- We now impute the value of the effect size to 0 if it was NaN or NULL. This is to
-- take into account states where all campaigns either did or did not perform an
-- action. In these cases, we assume that campaign outcome is uncorrelated with
-- the action because we do not have evidence otherwise.
,COALESCE(IF(IS_NAN(open_uses_small_preview), 0, open_uses_small_preview), 0) AS open_uses_small_preview
-- We now impute the value of the effect size to 0 if it was NaN or NULL. This is to
-- take into account states where all campaigns either did or did not perform an
-- action. In these cases, we assume that campaign outcome is uncorrelated with
-- the action because we do not have evidence otherwise.
,COALESCE(IF(IS_NAN(open_uses_personal_to), 0, open_uses_personal_to), 0) AS open_uses_personal_to
-- We now impute the value of the effect size to 0 if it was NaN or NULL. This is to
-- take into account states where all campaigns either did or did not perform an
-- action. In these cases, we assume that campaign outcome is uncorrelated with
-- the action because we do not have evidence otherwise.
,COALESCE(IF(IS_NAN(open_uses_ab_test_subject), 0, open_uses_ab_test_subject), 0) AS open_uses_ab_test_subject
-- We now impute the value of the effect size to 0 if it was NaN or NULL. This is to
-- take into account states where all campaigns either did or did not perform an
-- action. In these cases, we assume that campaign outcome is uncorrelated with
-- the action because we do not have evidence otherwise.
,COALESCE(IF(IS_NAN(open_uses_ab_test_content), 0, open_uses_ab_test_content), 0) AS open_uses_ab_test_content
-- We now impute the value of the effect size to 0 if it was NaN or NULL. This is to
-- take into account states where all campaigns either did or did not perform an
-- action. In these cases, we assume that campaign outcome is uncorrelated with
-- the action because we do not have evidence otherwise.
,COALESCE(IF(IS_NAN(open_uses_preview_text), 0, open_uses_preview_text), 0) AS open_uses_preview_text
-- We now impute the value of the effect size to 0 if it was NaN or NULL. This is to
-- take into account states where all campaigns either did or did not perform an
-- action. In these cases, we assume that campaign outcome is uncorrelated with
-- the action because we do not have evidence otherwise.
,COALESCE(IF(IS_NAN(open_uses_sto), 0, open_uses_sto), 0) AS open_uses_sto
-- We now impute the value of the effect size to 0 if it was NaN or NULL. This is to
-- take into account states where all campaigns either did or did not perform an
-- action. In these cases, we assume that campaign outcome is uncorrelated with
-- the action because we do not have evidence otherwise.
,COALESCE(IF(IS_NAN(open_uses_freemail_from), 0, open_uses_freemail_from), 0) AS open_uses_freemail_from
-- We now impute the value of the effect size to 0 if it was NaN or NULL. This is to
-- take into account states where all campaigns either did or did not perform an
-- action. In these cases, we assume that campaign outcome is uncorrelated with
-- the action because we do not have evidence otherwise.
,COALESCE(IF(IS_NAN(open_uses_resend_non_openers), 0, open_uses_resend_non_openers), 0) AS open_uses_resend_non_openers
-- We now impute the value of the effect size to 0 if it was NaN or NULL. This is to
-- take into account states where all campaigns either did or did not perform an
-- action. In these cases, we assume that campaign outcome is uncorrelated with
-- the action because we do not have evidence otherwise.
,COALESCE(IF(IS_NAN(open_uses_promo_code), 0, open_uses_promo_code), 0) AS open_uses_promo_code
-- We now impute the value of the effect size to 0 if it was NaN or NULL. This is to
-- take into account states where all campaigns either did or did not perform an
-- action. In these cases, we assume that campaign outcome is uncorrelated with
-- the action because we do not have evidence otherwise.
,COALESCE(IF(IS_NAN(open_uses_prex), 0, open_uses_prex), 0) AS open_uses_prex
-- We now impute the value of the effect size to 0 if it was NaN or NULL. This is to
-- take into account states where all campaigns either did or did not perform an
-- action. In these cases, we assume that campaign outcome is uncorrelated with
-- the action because we do not have evidence otherwise.
,COALESCE(IF(IS_NAN(open_uses_ab_test_from), 0, open_uses_ab_test_from), 0) AS open_uses_ab_test_from
FROM
raw_effect_sizes
),
action_states AS (
SELECT
has_used_small_subject_line
,has_used_personal_subject
,has_used_timewarp
,has_used_small_preview
,has_used_personal_to
,has_used_ab_test_subject
,has_used_ab_test_content
,has_used_preview_text
,has_used_sto
,has_used_freemail_from
,has_used_resend_non_openers
,has_used_promo_code
,has_used_prex
,has_used_ab_test_from
FROM `{{gcp_project}}.{{dataset}}.global_state_space`
GROUP BY has_used_small_subject_line
,has_used_personal_subject
,has_used_timewarp
,has_used_small_preview
,has_used_personal_to
,has_used_ab_test_subject
,has_used_ab_test_content
,has_used_preview_text
,has_used_sto
,has_used_freemail_from
,has_used_resend_non_openers
,has_used_promo_code
,has_used_prex
,has_used_ab_test_from)
SELECT
imputed_effect_sizes.*,
has_used_small_subject_line
,has_used_personal_subject
,has_used_timewarp
,has_used_small_preview
,has_used_personal_to
,has_used_ab_test_subject
,has_used_ab_test_content
,has_used_preview_text
,has_used_sto
,has_used_freemail_from
,has_used_resend_non_openers
,has_used_promo_code
,has_used_prex
,has_used_ab_test_from
FROM
imputed_effect_sizes
CROSS JOIN action_states
ORDER BY campaign_count DESC | the_stack |
SELECT SourceServer
, SourceDB
, [Status]
, Beta
, SSISInstanceID AS SSISIID
, LoadStageDBStartDate
, LoadStageDBEndDate
, CONVERT(VARCHAR(12), DATEADD(ms, DATEDIFF(ms, LoadStageDBStartDate, LoadStageDBEndDate), 0), 114) AS StageLoadTime
, LoadReportDBStartDate
, LoadReportDBEndDate
, CONVERT(VARCHAR(12), DATEADD(ms, DATEDIFF(ms, LoadReportDBStartDate, LoadReportDBEndDate), 0), 114) AS ReportLoadTime
FROM ClientConnection
GROUP BY Beta, Status, SSISInstanceID, SourceDB, LoadStageDBStartDate, LoadStageDBEndDate, LoadReportDBStartDate, LoadReportDBEndDate, SourceServer
ORDER BY SourceDB, Status ASC, Beta ASC, SSISInstanceID ASC, LoadStageDBStartDate ASC, SourceServer
-------------------------------------------
SELECT ClientID
, Status
, Beta
, SourceServer
, SourceDB
, CDCReportServer
, CDCReportDB
, LSNPrevious
, LSNMax
, LSNFromPrevious
, LSNFrom
, StartTimeExtract
, EndTimeExtract
, LoanCurrentStartDate
, LoanCurrentEndDate
, LoanMasterStartDate
, LoanMasterEndDate
, LoanSecondaryStartDate
, LoanSecondaryEndDate
FROM ClientConnection_test
ORDER BY Beta, SourceDB
--SELECT *
--FROM dbo.ClientConnection_test
----------------------------------------------
SELECT * FROM DMartLogging
WHERE DATEPART(day, ErrorDateTime) = DATEPART(day, GETDATE())
AND DATEPART(month, ErrorDateTime) = DATEPART(month, GETDATE())
AND DATEPART(year, ErrorDateTime) = DATEPART(year, GETDATE())
ORDER BY ErrorDateTime DESC
----------------------------------------------
/*
UPDATE ClientConnection
SET Beta = '1'
--WHERE SourceDB IN ( 'DMartTemplate' )
WHERE SourceDB IN ('Lockheed32')
--America First
Chevron
ENT
ORNL (CU Community)
Patelco
PADemoDU
PATrain
RLC
UPDATE ClientConnection
SET Status = 2
WHERE Beta = 1
UPDATE ClientConnection
SET Beta = '5', SSISInstanceID = '5'
WHERE SourceDB = 'DMartTemplate'
UPDATE ClientConnection
SET Status = '2'
where SourceDB = 'Bethpage40'
*/
SELECT CASE WHEN SSISInstanceID IS NULL THEN 'Total' ELSE SSISInstanceID END SSISInstanceID
, SUM(Status0) AS Status0
, SUM(Status1) AS Status1
, SUM(Status2) AS Status2
, SUM(Status3) AS Status3
, SUM(Status4) AS Status4
FROM
(
SELECT CONVERT(VARCHAR, SSISInstanceID) AS SSISInstanceID,
COUNT( CASE WHEN Status = 0 THEN Status ELSE NULL END ) AS Status0
, COUNT( CASE WHEN Status = 1 THEN Status ELSE NULL END ) AS Status1
, COUNT( CASE WHEN Status = 2 THEN Status ELSE NULL END ) AS Status2
, COUNT( CASE WHEN Status = 3 THEN Status ELSE NULL END ) AS Status3
, COUNT( CASE WHEN Status = 4 THEN Status ELSE NULL END ) AS Status4
FROM dbo.ClientConnectionCDC
GROUP BY SSISInstanceID
) AS StatusMatrix
GROUP BY SSISInstanceID
----------------------------------------------
-- Sum of clients in each status by Beta number
SELECT CASE WHEN SSISInstanceID IS NULL THEN 'Total' ELSE SSISInstanceID END SSISInstanceID
, SUM(Status0) AS Status0
, SUM(Status1) AS Status1
, SUM(Status2) AS Status2
, SUM(Status3) AS Status3
, SUM(Status4) AS Status4
FROM
(
SELECT CONVERT(VARCHAR, SSISInstanceID) AS SSISInstanceID,
COUNT( CASE WHEN Status = 0 THEN Status ELSE NULL END ) AS Status0
, COUNT( CASE WHEN Status = 1 THEN Status ELSE NULL END ) AS Status1
, COUNT( CASE WHEN Status = 2 THEN Status ELSE NULL END ) AS Status2
, COUNT( CASE WHEN Status = 3 THEN Status ELSE NULL END ) AS Status3
, COUNT( CASE WHEN Status = 4 THEN Status ELSE NULL END ) AS Status4
FROM dbo.ClientConnection
GROUP BY SSISInstanceID
) AS StatusMatrix
GROUP BY SSISInstanceID
----------------------------------------------
SELECT CASE WHEN InstanceID IS NULL THEN 'Total' ELSE InstanceID END InstanceID
, SUM(OldStatus4) AS OldStatus4
, SUM(Status0) AS Status0
, SUM(Status1) AS Status1
, SUM(Status2) AS Status2
, SUM(Status3) AS Status3
, SUM(Status4) AS Status4
, SUM(OldStatus4 + Status0 + Status1 + Status2 + Status3 + Status4) AS InstanceTotal
FROM
(
SELECT CONVERT(VARCHAR, SSISInstanceID) AS InstanceID,
COUNT( CASE WHEN Status = 4 AND
CONVERT(DATE, EndTimeExtract) < CONVERT(DATE, GETDATE()) THEN Status ELSE NULL END ) AS OldStatus4
, COUNT( CASE WHEN Status = 0 THEN Status ELSE NULL END ) AS Status0
, COUNT( CASE WHEN Status = 1 THEN Status ELSE NULL END ) AS Status1
, COUNT( CASE WHEN Status = 2 THEN Status ELSE NULL END ) AS Status2
, COUNT( CASE WHEN Status = 3 THEN Status ELSE NULL END ) AS Status3,
COUNT( CASE WHEN Status = 4 AND
DATEPART(DAY, EndTimeExtract) = DATEPART(DAY, GETDATE()) THEN Status ELSE NULL END ) AS Status4
FROM dbo.ClientConnectionCDC
GROUP BY SSISInstanceID
) AS StatusMatrix
GROUP BY InstanceID
----------------------------------------------
SELECT CASE WHEN InstanceID IS NULL THEN 'Total' ELSE InstanceID END InstanceID
, SUM(OldStatus4) AS OldStatus4
, SUM(Status0) AS Status0
, SUM(Status1) AS Status1
, SUM(Status2) AS Status2
, SUM(Status3) AS Status3
, SUM(Status4) AS Status4
, SUM(OldStatus4 + Status0 + Status1 + Status2 + Status3 + Status4) AS InstanceTotal
FROM
(
SELECT CONVERT(VARCHAR, SSISInstanceID) AS InstanceID,
COUNT( CASE WHEN Status = 4
AND CONVERT(DATE, LoadReportDBEndDate) < CONVERT(DATE, GETDATE()) THEN Status ELSE NULL END ) AS OldStatus4
, COUNT( CASE WHEN Status = 0 THEN Status ELSE NULL END ) AS Status0
, COUNT( CASE WHEN Status = 1 THEN Status ELSE NULL END ) AS Status1
, COUNT( CASE WHEN Status = 2 THEN Status ELSE NULL END ) AS Status2
, COUNT( CASE WHEN Status = 3 THEN Status ELSE NULL END ) AS Status3,
COUNT( CASE WHEN Status = 4
AND DATEPART(DAY, LoadReportDBEndDate) = DATEPART(DAY, GETDATE()) THEN Status ELSE NULL END ) AS Status4
FROM dbo.ClientConnection
GROUP BY SSISInstanceID
) AS StatusMatrix
GROUP BY InstanceID;
/*
TRUNCATE TABLE DMartLogging
*/
SELECT * FROM DMartLogging
WHERE TaskName NOT LIKE '%Kill%Active%'
ORDER BY ErrorDateTime desc
SELECT * FROM DMartLogging
WHERE DATEPART(day, ErrorDateTime) = DATEPART(day, GETDATE())
AND DATEPART(month, ErrorDateTime) = DATEPART(month, GETDATE())
AND DATEPART(year, ErrorDateTime) = DATEPART(year, GETDATE())
ORDER BY ErrorDateTime DESC
-------------------------------------------
SELECT * FROM dbo.DMartComponentLogging
WHERE DATEPART(day, ErrorDateTime) = DATEPART(day, GETDATE())
AND DATEPART(month, ErrorDateTime) = DATEPART(month, GETDATE())
AND DATEPART(year, ErrorDateTime) = DATEPART(year, GETDATE())
--AND TaskName = 'Data Flow Task br_liability'
GROUP BY TaskName, ErrorDateTime, PackageName, DestDB, DestServer, SourceDB, SourceServer, ID, ClientId, ErrorMessage
ORDER BY ErrorDateTime DESC
-------------------------------------------
-------------------------------------------
UPDATE ClientConnection
SET LoadStageDBStartDate = '@3AM' , LoadStageDBEndDate = '@3AM' , LoadReportDBStartDate = '@3AM', LoadReportDBEndDate = '@3AM', Status = 4
WHERE Beta = '1'
----------------------------------------------
SELECT Client_id
, SourceServer
, SourceDB
, Status
, Beta
, StageServer
, StageDB
, ReportServer
, ReportDB
, LoadStageDBStartDate
, LoadStageDBEndDate
, CONVERT(varchar(12), DATEADD(ms, DATEDIFF(ms, LoadStageDBStartDate, LoadStageDBEndDate), 0), 114) AS StageLoadTime
, LoadReportDBStartDate
, LoadReportDBEndDate
, CONVERT(varchar(12), DATEADD(ms, DATEDIFF(ms, LoadReportDBStartDate, LoadReportDBEndDate), 0), 114) AS ReportLoadTime
FROM ClientConnection
--WHERE ReportServer = 'PSQLRPT22'
--WHERE SourceServer = 'STGSQL511'
--WHERE Beta = 2
ORDER BY Beta,3
----------------------------------------------
-- EliLillyFCU STGSQL615 10086
-- PeoplesBank STGSQL613 10090
-- Solarity STGSQL615 10091
SELECT * FROM OPSINFO_ops_dbo.clients
WHERE client_name LIKE '%Royal%'
UPDATE dbo.ClientConnectionCDC
SET CDCReportDB = 'Dmart_OrangeCountyCDC_Data'
WHERE CDCReportDB = 'Dmart_OrangeCounty32CDC_Data'
----------------------------------------------
----------------------------------------------
SELECT SUM(StageLoadTime) AS TotalStageLoadTime, SUM(ReportLoadTime) AS TotalReportLoadTime
FROM
(
SELECT Client_ID,
SourceDB,
[Status],
Beta,
LoadStageDBStartDate,
LoadStageDBEndDate,
DATEDIFF(minute, LoadStageDBStartDate, LoadStageDBEndDate) AS StageLoadTime,
LoadReportDBStartDate,
LoadReportDBEndDate,
DATEDIFF(minute, LoadReportDBStartDate, LoadReportDBEndDate) AS ReportLoadTime
FROM ClientConnection
WHERE Beta != '2'
) AS t
----------------------------------------------
SELECT SUM(DataLoadTime) AS TotalStageLoadTime
--, SUM(ReportLoadTime) AS TotalReportLoadTime FROM
(
SELECT ClientID,
[dbo].[ClientConnectionCDC].[CDCExtractDB]
, [Status]
, Beta
, [dbo].[ClientConnectionCDC].[StartTimeExtract]
, [dbo].[ClientConnectionCDC].[EndTimeExtract],
DATEDIFF(minute, StartTimeExtract, EndTimeExtract) AS DataLoadTime
--, LoadReportDBStartDate
--, LoadReportDBEndDate
--, DATEDIFF(minute, LoadReportDBStartDate,
-- LoadReportDBEndDate) AS ReportLoadTime
FROM ClientConnectionCDC
--WHERE Beta != '2'
WHERE Status != 0
) AS t
----------------------------------------------
select * from clientconnection
order by ssisinstanceid
UPDATE dbo.ClientConnection
SET SSISinstanceID = CASE SourceServer
WHEN 'PSQLDLS30' THEN 0
WHEN 'PSQLDLS31' THEN 1
WHEN 'PSQLDLS32' THEN 2
WHEN 'PSQLDLS33' THEN 3
WHEN 'PSQLDLS34' THEN 4
WHEN 'PSQLDLS35' THEN 5
WHEN 'PSQLRPT24' THEN 5 -- DMart Template
END
SELECT * FROM dbo.ClientConnection
WHERE SourceDB LIKE 'Royal%'
UPDATE dbo.ClientConnection
SET Beta = 0 WHERE SourceDB = 'RoyalCU' | the_stack |
--We need to drop the logged actions view before altering the database tables
DROP VIEW v_logged_actions;
ALTER TABLE logged_actions
ALTER COLUMN id TYPE BIGINT,
ALTER COLUMN user_id TYPE BIGINT,
ALTER COLUMN action_context_id TYPE BIGINT,
ALTER COLUMN user_id SET NOT NULL,
ALTER COLUMN action SET NOT NULL,
ALTER COLUMN action_context SET NOT NULL,
ALTER COLUMN action_context_id SET NOT NULL,
ALTER COLUMN new_state SET NOT NULL,
ALTER COLUMN old_state SET NOT NULL;
ALTER TABLE notifications
ALTER COLUMN message_args SET NOT NULL;
ALTER TABLE project_api_keys
ALTER COLUMN project_id SET NOT NULL;
ALTER TABLE project_channels
ALTER COLUMN id TYPE BIGINT;
ALTER TABLE project_flags
ALTER COLUMN id TYPE BIGINT,
ALTER COLUMN resolved_by TYPE BIGINT,
ALTER COLUMN comment SET NOT NULL;
ALTER TABLE project_pages
ALTER COLUMN id TYPE BIGINT,
ALTER COLUMN parent_id DROP NOT NULL,
ALTER COLUMN parent_id DROP DEFAULT;
UPDATE project_pages SET parent_id = NULL WHERE parent_id = -1;
ALTER TABLE project_settings
ALTER COLUMN forum_sync SET NOT NULL;
ALTER TABLE project_tags
ALTER COLUMN id TYPE BIGINT,
ALTER COLUMN version_ids SET NOT NULL,
ALTER COLUMN name SET NOT NULL,
ALTER COLUMN data SET NOT NULL,
ALTER COLUMN color SET NOT NULL;
ALTER TABLE project_version_downloads
ALTER COLUMN id TYPE BIGINT,
ALTER COLUMN created_at SET NOT NULL;
ALTER TABLE project_version_reviews
ALTER COLUMN id TYPE BIGINT,
ALTER COLUMN version_id TYPE BIGINT,
ALTER COLUMN user_id TYPE BIGINT,
ALTER COLUMN comment SET NOT NULL;
ALTER TABLE project_version_visibility_changes
ALTER COLUMN id TYPE BIGINT,
ALTER COLUMN created_by TYPE BIGINT,
ALTER COLUMN version_id TYPE BIGINT,
ALTER COLUMN resolved_by TYPE BIGINT,
ALTER COLUMN comment SET NOT NULL,
ALTER COLUMN visibility SET NOT NULL;
UPDATE project_versions SET reviewer_id = NULL WHERE reviewer_id = -1;
ALTER TABLE project_versions
ALTER COLUMN id TYPE BIGINT,
ALTER COLUMN tags TYPE BIGINT [],
ALTER COLUMN author_id DROP DEFAULT,
ALTER COLUMN author_id SET NOT NULL,
ALTER COLUMN reviewer_id DROP DEFAULT,
ALTER COLUMN tags SET NOT NULL,
ALTER COLUMN is_non_reviewed SET NOT NULL;
ALTER TABLE project_views
ALTER COLUMN id TYPE BIGINT,
ALTER COLUMN created_at SET NOT NULL;
ALTER TABLE project_visibility_changes
ALTER COLUMN id TYPE BIGINT,
ALTER COLUMN created_by TYPE BIGINT,
ALTER COLUMN project_id TYPE BIGINT,
ALTER COLUMN resolved_by TYPE BIGINT,
ALTER COLUMN comment SET NOT NULL,
ALTER COLUMN visibility SET NOT NULL;
UPDATE projects SET topic_id = NULL WHERE topic_id = -1;
UPDATE projects SET post_id = NULL WHERE post_id = -1;
ALTER TABLE projects
ALTER COLUMN id TYPE BIGINT,
ALTER COLUMN topic_id TYPE INTEGER,
ALTER COLUMN post_id TYPE INTEGER,
ALTER COLUMN topic_id DROP DEFAULT,
ALTER COLUMN post_id DROP DEFAULT,
ALTER COLUMN is_topic_dirty SET NOT NULL;
ALTER TABLE user_project_roles
ALTER COLUMN id TYPE BIGINT,
ALTER COLUMN project_id SET NOT NULL;
ALTER TABLE USERS
ALTER COLUMN is_locked SET NOT NULL;
--We add the logged actions view back. This query was generated by IntelliJ
create view v_logged_actions as
SELECT a.id,
a.created_at,
a.user_id,
a.address,
a.action,
a.action_context,
a.action_context_id,
a.new_state,
a.old_state,
u.id AS u_id,
u.name AS u_name,
p.id AS p_id,
p.plugin_id AS p_plugin_id,
p.slug AS p_slug,
p.owner_name AS p_owner_name,
pv.id AS pv_id,
pv.version_string AS pv_version_string,
pp.id AS pp_id,
pp.name AS pp_name,
pp.slug AS pp_slug,
s.id AS s_id,
s.name AS s_name,
CASE
WHEN (a.action_context = 0) THEN (a.action_context_id) :: bigint
WHEN (a.action_context = 1) THEN COALESCE(pv.project_id, ('-1' :: integer) :: bigint)
WHEN (a.action_context = 2) THEN COALESCE(pp.project_id, ('-1' :: integer) :: bigint)
ELSE ('-1' :: integer) :: bigint
END AS filter_project,
CASE
WHEN (a.action_context = 1) THEN COALESCE(pv.id, a.action_context_id)
ELSE '-1' :: integer
END AS filter_version,
CASE
WHEN (a.action_context = 2) THEN COALESCE(pp.id, '-1' :: integer)
ELSE '-1' :: integer
END AS filter_page,
CASE
WHEN (a.action_context = 3) THEN a.action_context_id
WHEN (a.action_context = 4) THEN a.action_context_id
ELSE '-1' :: integer
END AS filter_subject,
a.action AS filter_action
FROM (((((logged_actions a
LEFT JOIN users u ON ((a.user_id = u.id)))
LEFT JOIN projects p ON ((
CASE
WHEN ((a.action_context = 0) AND (a.action_context_id = p.id))
THEN 1
WHEN ((a.action_context = 1) AND
((SELECT pvin.project_id FROM project_versions pvin WHERE (pvin.id = a.action_context_id)) = p.id))
THEN 1
WHEN ((a.action_context = 2) AND
((SELECT ppin.project_id FROM project_pages ppin WHERE (ppin.id = a.action_context_id)) = p.id))
THEN 1
ELSE 0
END = 1)))
LEFT JOIN project_versions pv ON (((a.action_context = 1) AND (a.action_context_id = pv.id))))
LEFT JOIN project_pages pp ON (((a.action_context = 2) AND (a.action_context_id = pp.id))))
LEFT JOIN users s ON ((
CASE
WHEN ((a.action_context = 3) AND (a.action_context_id = s.id))
THEN 1
WHEN ((a.action_context = 4) AND (a.action_context_id = s.id))
THEN 1
ELSE 0
END = 1)));
# --- !Downs
DROP VIEW v_logged_actions;
ALTER TABLE logged_actions
ALTER COLUMN id TYPE INTEGER,
ALTER COLUMN user_id TYPE INTEGER,
ALTER COLUMN action_context_id TYPE INTEGER,
ALTER COLUMN user_id DROP NOT NULL,
ALTER COLUMN action DROP NOT NULL,
ALTER COLUMN action_context DROP NOT NULL,
ALTER COLUMN action_context_id DROP NOT NULL,
ALTER COLUMN new_state DROP NOT NULL,
ALTER COLUMN old_state DROP NOT NULL;
ALTER TABLE notifications
ALTER COLUMN message_args DROP NOT NULL;
ALTER TABLE project_api_keys
ALTER COLUMN project_id DROP NOT NULL;
ALTER TABLE project_channels
ALTER COLUMN id TYPE INTEGER;
ALTER TABLE project_flags
ALTER COLUMN id TYPE INTEGER,
ALTER COLUMN resolved_by TYPE INTEGER,
ALTER COLUMN comment DROP NOT NULL;
UPDATE project_pages SET parent_id = -1 WHERE parent_id IS NULL;
ALTER TABLE project_pages
ALTER COLUMN id TYPE INTEGER,
ALTER COLUMN parent_id SET DEFAULT -1,
ALTER COLUMN parent_id SET NOT NULL;
ALTER TABLE project_settings
ALTER COLUMN forum_sync DROP NOT NULL;
ALTER TABLE project_tags
ALTER COLUMN id TYPE INTEGER,
ALTER COLUMN version_ids DROP NOT NULL,
ALTER COLUMN name DROP NOT NULL,
ALTER COLUMN data DROP NOT NULL,
ALTER COLUMN color DROP NOT NULL;
ALTER TABLE project_version_downloads
ALTER COLUMN id TYPE INTEGER,
ALTER COLUMN created_at DROP NOT NULL;
ALTER TABLE project_version_reviews
ALTER COLUMN id TYPE INTEGER,
ALTER COLUMN version_id TYPE INTEGER,
ALTER COLUMN user_id TYPE INTEGER,
ALTER COLUMN comment DROP NOT NULL;
ALTER TABLE project_version_visibility_changes
ALTER COLUMN id TYPE INTEGER,
ALTER COLUMN created_by TYPE INTEGER,
ALTER COLUMN version_id TYPE INTEGER,
ALTER COLUMN resolved_by TYPE INTEGER,
ALTER COLUMN comment DROP NOT NULL,
ALTER COLUMN visibility DROP NOT NULL;
UPDATE project_versions SET reviewer_id = -1 WHERE reviewer_id IS NULL;
ALTER TABLE project_versions
ALTER COLUMN id TYPE INTEGER,
ALTER COLUMN tags TYPE INTEGER [],
ALTER COLUMN author_id SET DEFAULT -1,
ALTER COLUMN author_id DROP NOT NULL,
ALTER COLUMN reviewer_id SET DEFAULT -1,
ALTER COLUMN tags DROP NOT NULL,
ALTER COLUMN is_non_reviewed DROP NOT NULL;
ALTER TABLE project_views
ALTER COLUMN id TYPE INTEGER,
ALTER COLUMN created_at DROP NOT NULL;
ALTER TABLE project_visibility_changes
ALTER COLUMN id TYPE INTEGER,
ALTER COLUMN created_by TYPE INTEGER,
ALTER COLUMN project_id TYPE INTEGER,
ALTER COLUMN resolved_by TYPE INTEGER,
ALTER COLUMN comment DROP NOT NULL,
ALTER COLUMN visibility DROP NOT NULL;
UPDATE projects SET topic_id = -1 WHERE topic_id IS NULL;
UPDATE projects SET post_id = -1 WHERE post_id IS NULL ;
ALTER TABLE projects
ALTER COLUMN id TYPE INTEGER,
ALTER COLUMN topic_id TYPE BIGINT,
ALTER COLUMN post_id TYPE BIGINT,
ALTER COLUMN topic_id SET DEFAULT -1,
ALTER COLUMN post_id SET DEFAULT -1,
ALTER COLUMN is_topic_dirty DROP NOT NULL;
ALTER TABLE user_project_roles
ALTER COLUMN id TYPE INTEGER,
ALTER COLUMN project_id DROP NOT NULL;
ALTER TABLE USERS
ALTER COLUMN is_locked DROP NOT NULL;
--Generated from IntelliJ
create view v_logged_actions as
SELECT a.id,
a.created_at,
a.user_id,
a.address,
a.action,
a.action_context,
a.action_context_id,
a.new_state,
a.old_state,
u.id AS u_id,
u.name AS u_name,
p.id AS p_id,
p.plugin_id AS p_plugin_id,
p.slug AS p_slug,
p.owner_name AS p_owner_name,
pv.id AS pv_id,
pv.version_string AS pv_version_string,
pp.id AS pp_id,
pp.name AS pp_name,
pp.slug AS pp_slug,
s.id AS s_id,
s.name AS s_name,
CASE
WHEN (a.action_context = 0) THEN (a.action_context_id) :: bigint
WHEN (a.action_context = 1) THEN COALESCE(pv.project_id, ('-1' :: integer) :: bigint)
WHEN (a.action_context = 2) THEN COALESCE(pp.project_id, ('-1' :: integer) :: bigint)
ELSE ('-1' :: integer) :: bigint
END AS filter_project,
CASE
WHEN (a.action_context = 1) THEN COALESCE(pv.id, a.action_context_id)
ELSE '-1' :: integer
END AS filter_version,
CASE
WHEN (a.action_context = 2) THEN COALESCE(pp.id, '-1' :: integer)
ELSE '-1' :: integer
END AS filter_page,
CASE
WHEN (a.action_context = 3) THEN a.action_context_id
WHEN (a.action_context = 4) THEN a.action_context_id
ELSE '-1' :: integer
END AS filter_subject,
a.action AS filter_action
FROM (((((logged_actions a
LEFT JOIN users u ON ((a.user_id = u.id)))
LEFT JOIN projects p ON ((
CASE
WHEN ((a.action_context = 0) AND (a.action_context_id = p.id))
THEN 1
WHEN ((a.action_context = 1) AND
((SELECT pvin.project_id FROM project_versions pvin WHERE (pvin.id = a.action_context_id)) = p.id))
THEN 1
WHEN ((a.action_context = 2) AND
((SELECT ppin.project_id FROM project_pages ppin WHERE (ppin.id = a.action_context_id)) = p.id))
THEN 1
ELSE 0
END = 1)))
LEFT JOIN project_versions pv ON (((a.action_context = 1) AND (a.action_context_id = pv.id))))
LEFT JOIN project_pages pp ON (((a.action_context = 2) AND (a.action_context_id = pp.id))))
LEFT JOIN users s ON ((
CASE
WHEN ((a.action_context = 3) AND (a.action_context_id = s.id))
THEN 1
WHEN ((a.action_context = 4) AND (a.action_context_id = s.id))
THEN 1
ELSE 0
END = 1))); | the_stack |
DROP TABLE IF EXISTS material CASCADE;
CREATE TABLE material (materialid SERIAL PRIMARY KEY, name TEXT,
mat_col_r DOUBLE PRECISION, mat_col_g DOUBLE PRECISION, mat_col_b DOUBLE PRECISION,
is_metal BOOLEAN NOT NULL, shade_normal BOOLEAN NOT NULL, mirror_frac DOUBLE PRECISION NOT NULL,
is_dielectric BOOLEAN NOT NULL, eta DOUBLE PRECISION NOT NULL DEFAULT 1.0);
INSERT INTO material (name, mat_col_r, mat_col_g, mat_col_b, is_metal, shade_normal, mirror_frac, is_dielectric, eta) VALUES
('dark', 0.1, 0.1, 0.1, FALSE, FALSE, 0.1, FALSE, 1.0),
('red', 0.95, 0.0, 0.0, FALSE, TRUE, 0.5, FALSE, 1.0),
('green', 0.0, 0.95, 0.0, FALSE, TRUE, 0.5, FALSE, 1.0),
('blue', 0.0, 0.0, 0.95, TRUE, TRUE, 0.5, FALSE, 1.0),
('grey', 0.1, 0.1, 0.1, FALSE, FALSE, 0.5, FALSE, 1.0),
('bright', 1.0, 1.0, 1.0, TRUE, TRUE, 0.5, FALSE, 1.0),
('mirror', NULL, NULL, NULL, TRUE, FALSE, 0.99, FALSE, 1.0),
('bluemirror', 0.0, 0.0, 0.3, TRUE, FALSE, 0.9, FALSE, 1.0),
('greenmirror', 0.0, 0.2, 0.0, TRUE, FALSE, 0.9, FALSE, 1.0),
('glass', NULL, NULL, NULL, FALSE, FALSE, 0.95, TRUE, 1.5),
('greenglass', 0.0, 0.2, 0.0, FALSE, FALSE, 0.8, TRUE, 1.5),
('diamond', NULL, NULL, NULL, FALSE, FALSE, 0.99, TRUE, 2.4),
('antiglass', NULL, NULL, NULL, FALSE, FALSE, 0.99, TRUE, 0.2)
;
DROP TABLE IF EXISTS scene CASCADE;
CREATE TABLE IF NOT EXISTS scene (sceneid SERIAL PRIMARY KEY,
scenename TEXT UNIQUE NOT NULL);
INSERT INTO scene (scenename) VALUES ('dielectricparty'),
('oneglassball'),
('onediamondball'),
('oneantiglassball'),
('onegreyball'),
('onegreenball'),
('twomirrorballs'),
('twodiffuseballs'),
('onemirrorball'),
('reflectiontest'),
('threemirrors'),
('adjacentballs'),
('busyday');
DROP TABLE IF EXISTS sphere CASCADE;
CREATE TABLE sphere (sphereid SERIAL, sceneid INTEGER NOT NULL REFERENCES scene(sceneid),
cx DOUBLE PRECISION NOT NULL, cy DOUBLE PRECISION NOT NULL, cz DOUBLE PRECISION NOT NULL,
radius DOUBLE PRECISION, radius2 DOUBLE PRECISION, materialid INTEGER NOT NULL REFERENCES material(materialid) DEFERRABLE,
vel_x DOUBLE PRECISION NOT NULL DEFAULT 0.0, vel_y DOUBLE PRECISION NOT NULL DEFAULT 0.0, vel_z DOUBLE PRECISION NOT NULL DEFAULT 0.0,
coefficient_of_restitution DOUBLE PRECISION NOT NULL DEFAULT 1.0);
INSERT INTO sphere (cx, cy, cz, radius, materialid, sceneid) VALUES
(0, 24, -10, 5,
(SELECT materialid FROM material WHERE name='bright'), (SELECT sceneid FROM scene WHERE scenename='reflectiontest')),
(0, 5, 0, 5,
(SELECT materialid FROM material WHERE name='red'), (SELECT sceneid FROM scene WHERE scenename='reflectiontest')),
(-17, 15, -30, 15,
(SELECT materialid FROM material WHERE name='bluemirror'), (SELECT sceneid FROM scene WHERE scenename='reflectiontest')),
(24, 23, 10, 23,
(SELECT materialid FROM material WHERE name='greenmirror'), (SELECT sceneid FROM scene WHERE scenename='reflectiontest')),
(0, -1250, 0, 1250,
(SELECT materialid FROM material WHERE name='grey'), (SELECT sceneid FROM scene WHERE scenename='twomirrorballs')),
(20, 25, -30, 25,
(SELECT materialid FROM material WHERE name='greenmirror'), (SELECT sceneid FROM scene WHERE scenename='twomirrorballs')),
(-20, 25, 0, 25,
(SELECT materialid FROM material WHERE name='mirror'), (SELECT sceneid FROM scene WHERE scenename='twomirrorballs')),
(0, -1250, 0, 1250,
(SELECT materialid FROM material WHERE name='grey'), (SELECT sceneid FROM scene WHERE scenename='twodiffuseballs')),
(20, 25, -30, 25,
(SELECT materialid FROM material WHERE name='dark'), (SELECT sceneid FROM scene WHERE scenename='twodiffuseballs')),
(-20, 25, 0, 25,
(SELECT materialid FROM material WHERE name='green'), (SELECT sceneid FROM scene WHERE scenename='twodiffuseballs')),
(0, -1250, 0, 1250,
(SELECT materialid FROM material WHERE name='grey'), (SELECT sceneid FROM scene WHERE scenename='onemirrorball')),
(-20, 25, 0, 25,
(SELECT materialid FROM material WHERE name='mirror'), (SELECT sceneid FROM scene WHERE scenename='onemirrorball')),
(0, -1250, 0, 1250,
(SELECT materialid FROM material WHERE name='grey'), (SELECT sceneid FROM scene WHERE scenename='oneglassball')),
(0, 25, -10, 25,
(SELECT materialid FROM material WHERE name='glass'), (SELECT sceneid FROM scene WHERE scenename='oneglassball')),
(10, 25, 40, 25,
(SELECT materialid FROM material WHERE name='red'), (SELECT sceneid FROM scene WHERE scenename='oneglassball')),
(0, -1250, 0, 1250,
(SELECT materialid FROM material WHERE name='grey'), (SELECT sceneid FROM scene WHERE scenename='onediamondball')),
(0, 25, -10, 25,
(SELECT materialid FROM material WHERE name='diamond'), (SELECT sceneid FROM scene WHERE scenename='onediamondball')),
(10, 25, 40, 25,
(SELECT materialid FROM material WHERE name='red'), (SELECT sceneid FROM scene WHERE scenename='onediamondball')),
(0, -1250, 0, 1250,
(SELECT materialid FROM material WHERE name='grey'), (SELECT sceneid FROM scene WHERE scenename='oneantiglassball')),
(0, 25, -10, 25,
(SELECT materialid FROM material WHERE name='antiglass'), (SELECT sceneid FROM scene WHERE scenename='oneantiglassball')),
(10, 25, 40, 25,
(SELECT materialid FROM material WHERE name='red'), (SELECT sceneid FROM scene WHERE scenename='oneantiglassball')),
(0, -1250, 0, 1250,
(SELECT materialid FROM material WHERE name='grey'), (SELECT sceneid FROM scene WHERE scenename='dielectricparty')),
(0, 12, 0, NULL,
(SELECT materialid FROM material WHERE name='glass'), (SELECT sceneid FROM scene WHERE scenename='dielectricparty')),
(25, 12, 0, NULL,
(SELECT materialid FROM material WHERE name='antiglass'), (SELECT sceneid FROM scene WHERE scenename='dielectricparty')),
(-25, 12, 0, NULL,
(SELECT materialid FROM material WHERE name='diamond'), (SELECT sceneid FROM scene WHERE scenename='dielectricparty')),
(15, 10, 20, NULL,
(SELECT materialid FROM material WHERE name='red'), (SELECT sceneid FROM scene WHERE scenename='dielectricparty')),
(-5, 10, 30, NULL,
(SELECT materialid FROM material WHERE name='green'), (SELECT sceneid FROM scene WHERE scenename='dielectricparty')),
(0, -1250, 0, 1250,
(SELECT materialid FROM material WHERE name='green'), (SELECT sceneid FROM scene WHERE scenename='adjacentballs')),
(-24, 12, 0, 12,
(SELECT materialid FROM material WHERE name='red'), (SELECT sceneid FROM scene WHERE scenename='adjacentballs')),
(0, 12, 0, 12,
(SELECT materialid FROM material WHERE name='mirror'), (SELECT sceneid FROM scene WHERE scenename='adjacentballs')),
(24, 12, 0, 12,
(SELECT materialid FROM material WHERE name='bright'), (SELECT sceneid FROM scene WHERE scenename='adjacentballs')),
(0, -1250, 0, 1250,
(SELECT materialid FROM material WHERE name='grey'), (SELECT sceneid FROM scene WHERE scenename='onegreyball')),
(20, 25, 0, 25,
(SELECT materialid FROM material WHERE name='grey'), (SELECT sceneid FROM scene WHERE scenename='onegreyball')),
(0, -1250, 0, 1250,
(SELECT materialid FROM material WHERE name='grey'), (SELECT sceneid FROM scene WHERE scenename='onegreenball')),
(20, 25, 0, 25,
(SELECT materialid FROM material WHERE name='green'), (SELECT sceneid FROM scene WHERE scenename='onegreenball')),
(-20, 15, -15, 22,
(SELECT materialid FROM material WHERE name='mirror'), (SELECT sceneid FROM scene WHERE scenename='threemirrors')),
(0, 0, 0, 5,
(SELECT materialid FROM material WHERE name='mirror'), (SELECT sceneid FROM scene WHERE scenename='threemirrors')),
(30, -15, 0, 25,
(SELECT materialid FROM material WHERE name='mirror'), (SELECT sceneid FROM scene WHERE scenename='threemirrors')),
(0, -1250, 0, 1250,
(SELECT materialid FROM material WHERE name='grey'), (SELECT sceneid FROM scene WHERE scenename='busyday'))
;
INSERT INTO sphere (cx, cy, cz, radius, materialid, sceneid, coefficient_of_restitution)
SELECT (RANDOM()-0.5) * 100, 50 + RANDOM() * 20, (RANDOM()-0.5) * 100, RANDOM() * 15,
1+CAST((RANDOM()*(SELECT MAX(materialid)-1 FROM material)) AS INTEGER), (SELECT sceneid FROM scene WHERE scenename='busyday'),
0.5*RANDOM()+0.5
FROM generate_series(1, 30)
GROUP BY generate_series;
UPDATE sphere SET radius = cy WHERE radius IS NULL;
UPDATE sphere SET radius2 = radius*radius WHERE radius2 IS NULL;
DROP TABLE IF EXISTS camera CASCADE;
CREATE TABLE camera (cameraid INTEGER PRIMARY KEY, sceneid INTEGER NOT NULL REFERENCES scene(sceneid),
x DOUBLE PRECISION NOT NULL, y DOUBLE PRECISION NOT NULL, z DOUBLE PRECISION NOT NULL,
rot_x DOUBLE PRECISION NOT NULL, rot_y DOUBLE PRECISION NOT NULL, rot_z DOUBLE PRECISION NOT NULL,
fov_rad_x DOUBLE PRECISION NOT NULL, fov_rad_y DOUBLE PRECISION NOT NULL,
max_ray_depth INTEGER NOT NULL, samples_per_px INTEGER NOT NULL);
INSERT INTO camera (cameraid, x, y, z, rot_x, rot_y, rot_z, fov_rad_x, fov_rad_y, max_ray_depth, samples_per_px, sceneid)
VALUES (1.0, 0.0, 65.0, -120.0, -0.34, 0.0, 0.0, PI()/3.0, PI()/3.0,
40, 30, (SELECT sceneid FROM scene WHERE scenename='busyday'));
DROP TABLE IF EXISTS img CASCADE;
CREATE TABLE img (res_x INTEGER NOT NULL, res_y INTEGER NOT NULL, gamma DOUBLE PRECISION);
INSERT INTO img (res_x, res_y, gamma)
VALUES (650, 650, 1.0);
CREATE OR REPLACE FUNCTION animate_spheres()
RETURNS TRIGGER
LANGUAGE PLPGSQL
AS $$
BEGIN
UPDATE sphere SET vel_x = vel_x + NEW.grav_x*NEW.dt,
vel_y = vel_y + NEW.grav_y*NEW.dt,
vel_z = vel_z + NEW.grav_z*NEW.dt
WHERE sceneid=(SELECT sceneid FROM camera) AND cy>0;
UPDATE sphere SET vel_y = -vel_y*coefficient_of_restitution WHERE radius>cy
AND sceneid=(SELECT sceneid FROM camera);
UPDATE sphere SET cx=cx+vel_x*NEW.dt,
cy=cy+vel_y*NEW.dt,
cz=cz+vel_z*NEW.dt
WHERE sceneid=(SELECT sceneid FROM camera);
RETURN NEW;
END;
$$ ;
DROP VIEW IF EXISTS updateworld;
CREATE VIEW updateworld AS (SELECT 0.0 AS dt, 0.0 AS grav_x, 0.0 AS grav_y, 0.0 AS grav_z);
CREATE TRIGGER trig_update_world INSTEAD OF INSERT ON updateworld FOR EACH ROW
EXECUTE PROCEDURE animate_spheres();
-- INSERT INTO updateworld (dt, grav_x, grav_y, grav_z) VALUES (0.1, 0.0, -9.8, 0.0);
-- select cx, cy, cz, vel_x, vel_y, vel_z from sphere
-- where sceneid=(SELECT sceneid FROM scene WHERE scenename='busyday'); | the_stack |
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Applications](
[ApplicationName] [nvarchar](235) NOT NULL,
[ApplicationId] [uniqueidentifier] NOT NULL,
[Description] [nvarchar](256) NULL,
PRIMARY KEY CLUSTERED
(
[ApplicationId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[Memberships] Script Date: 5/19/2013 4:25:22 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Memberships](
[ApplicationId] [uniqueidentifier] NOT NULL,
[UserId] [uniqueidentifier] NOT NULL,
[Password] [nvarchar](128) NOT NULL,
[PasswordFormat] [int] NOT NULL,
[PasswordSalt] [nvarchar](128) NOT NULL,
[Email] [nvarchar](256) NULL,
[PasswordQuestion] [nvarchar](256) NULL,
[PasswordAnswer] [nvarchar](128) NULL,
[IsApproved] [bit] NOT NULL,
[IsLockedOut] [bit] NOT NULL,
[CreateDate] [datetime] NOT NULL,
[LastLoginDate] [datetime] NOT NULL,
[LastPasswordChangedDate] [datetime] NOT NULL,
[LastLockoutDate] [datetime] NOT NULL,
[FailedPasswordAttemptCount] [int] NOT NULL,
[FailedPasswordAttemptWindowStart] [datetime] NOT NULL,
[FailedPasswordAnswerAttemptCount] [int] NOT NULL,
[FailedPasswordAnswerAttemptWindowsStart] [datetime] NOT NULL,
[Comment] [nvarchar](256) NULL,
PRIMARY KEY CLUSTERED
(
[UserId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[Profiles] Script Date: 5/19/2013 4:25:22 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Profiles](
[UserId] [uniqueidentifier] NOT NULL,
[PropertyNames] [nvarchar](4000) NOT NULL,
[PropertyValueStrings] [nvarchar](4000) NOT NULL,
[PropertyValueBinary] [image] NOT NULL,
[LastUpdatedDate] [datetime] NOT NULL,
PRIMARY KEY CLUSTERED
(
[UserId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[Roles] Script Date: 5/19/2013 4:25:22 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Roles](
[ApplicationId] [uniqueidentifier] NOT NULL,
[RoleId] [uniqueidentifier] NOT NULL,
[RoleName] [nvarchar](256) NOT NULL,
[Description] [nvarchar](256) NULL,
PRIMARY KEY CLUSTERED
(
[RoleId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[Users] Script Date: 5/19/2013 4:25:22 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Users](
[ApplicationId] [uniqueidentifier] NOT NULL,
[UserId] [uniqueidentifier] NOT NULL,
[UserName] [nvarchar](50) NOT NULL,
[IsAnonymous] [bit] NOT NULL,
[LastActivityDate] [datetime] NOT NULL,
PRIMARY KEY CLUSTERED
(
[UserId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object: Table [dbo].[UsersInRoles] Script Date: 5/19/2013 4:25:22 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[UsersInRoles](
[UserId] [uniqueidentifier] NOT NULL,
[RoleId] [uniqueidentifier] NOT NULL,
PRIMARY KEY CLUSTERED
(
[UserId] ASC,
[RoleId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
ALTER TABLE [dbo].[Memberships] WITH CHECK ADD CONSTRAINT [MembershipApplication] FOREIGN KEY([ApplicationId])
REFERENCES [dbo].[Applications] ([ApplicationId])
GO
ALTER TABLE [dbo].[Memberships] CHECK CONSTRAINT [MembershipApplication]
GO
ALTER TABLE [dbo].[Memberships] WITH CHECK ADD CONSTRAINT [MembershipUser] FOREIGN KEY([UserId])
REFERENCES [dbo].[Users] ([UserId])
GO
ALTER TABLE [dbo].[Memberships] CHECK CONSTRAINT [MembershipUser]
GO
ALTER TABLE [dbo].[Profiles] WITH CHECK ADD CONSTRAINT [UserProfile] FOREIGN KEY([UserId])
REFERENCES [dbo].[Users] ([UserId])
GO
ALTER TABLE [dbo].[Profiles] CHECK CONSTRAINT [UserProfile]
GO
ALTER TABLE [dbo].[Roles] WITH CHECK ADD CONSTRAINT [RoleApplication] FOREIGN KEY([ApplicationId])
REFERENCES [dbo].[Applications] ([ApplicationId])
GO
ALTER TABLE [dbo].[Roles] CHECK CONSTRAINT [RoleApplication]
GO
ALTER TABLE [dbo].[Users] WITH CHECK ADD CONSTRAINT [UserApplication] FOREIGN KEY([ApplicationId])
REFERENCES [dbo].[Applications] ([ApplicationId])
GO
ALTER TABLE [dbo].[Users] CHECK CONSTRAINT [UserApplication]
GO
ALTER TABLE [dbo].[UsersInRoles] WITH CHECK ADD CONSTRAINT [UsersInRoleRole] FOREIGN KEY([RoleId])
REFERENCES [dbo].[Roles] ([RoleId])
GO
ALTER TABLE [dbo].[UsersInRoles] CHECK CONSTRAINT [UsersInRoleRole]
GO
ALTER TABLE [dbo].[UsersInRoles] WITH CHECK ADD CONSTRAINT [UsersInRoleUser] FOREIGN KEY([UserId])
REFERENCES [dbo].[Users] ([UserId])
GO
ALTER TABLE [dbo].[UsersInRoles] CHECK CONSTRAINT [UsersInRoleUser]
GO
INSERT INTO dbo.Applications (ApplicationName, ApplicationId, Description)
SELECT ApplicationName, ApplicationId, Description FROM dbo.aspnet_Applications
GO
INSERT INTO dbo.Roles (ApplicationId, RoleId, RoleName, Description)
SELECT ApplicationId, RoleId, RoleName, Description FROM dbo.aspnet_Roles
GO
INSERT INTO dbo.Users (ApplicationId, UserId, UserName, IsAnonymous, LastActivityDate)
SELECT ApplicationId, UserId, cast(UserName as nvarchar(50)), IsAnonymous, LastActivityDate FROM dbo.aspnet_Users
GO
INSERT INTO dbo.Memberships (ApplicationId, UserId, Password,
PasswordFormat, PasswordSalt, Email, PasswordQuestion, PasswordAnswer,
IsApproved, IsLockedOut, CreateDate, LastLoginDate, LastPasswordChangedDate,
LastLockoutDate, FailedPasswordAttemptCount,
FailedPasswordAttemptWindowStart, FailedPasswordAnswerAttemptCount,
FailedPasswordAnswerAttemptWindowsStart, Comment)
SELECT ApplicationId, UserId, Password,
1, PasswordSalt, Email, NULL, NULL,
IsApproved, IsLockedOut, CreateDate, LastLoginDate, LastPasswordChangedDate,
LastLockoutDate, FailedPasswordAttemptCount,
FailedPasswordAttemptWindowStart, FailedPasswordAnswerAttemptCount,
FailedPasswordAnswerAttemptWindowStart, Comment FROM dbo.aspnet_Membership
GO
INSERT INTO dbo.UsersInRoles SELECT * FROM dbo.aspnet_UsersInRoles
GO
PRINT N'Altering [dbo].[BugNet_UserProfiles]...';
GO
ALTER TABLE [dbo].[BugNet_UserProfiles]
ADD [PasswordVerificationToken] NVARCHAR (128) NULL,
[PasswordVerificationTokenExpirationDate] DATETIME NULL;
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[BugNet_User_GetUserNameByPasswordResetToken]
@Token NVARCHAR(255),
@UserName NVARCHAR(255) OUTPUT
AS
SET NOCOUNT ON
SELECT @UserName = UserName
FROM BugNet_UserProfiles
WHERE PasswordVerificationToken = @Token
GO
-- Begin Upgrade BugNET Tables to Universal Providers
PRINT N'Dropping FK_BugNet_Queries_aspnet_Users...';
GO
ALTER TABLE [dbo].[BugNet_Queries] DROP CONSTRAINT [FK_BugNet_Queries_aspnet_Users];
GO
PRINT N'Dropping FK_BugNet_UserProjects_aspnet_Users...';
GO
ALTER TABLE [dbo].[BugNet_UserProjects] DROP CONSTRAINT [FK_BugNet_UserProjects_aspnet_Users];
GO
PRINT N'Dropping FK_BugNet_DefaultValues_aspnet_Users...';
GO
ALTER TABLE [dbo].[BugNet_DefaultValues] DROP CONSTRAINT [FK_BugNet_DefaultValues_aspnet_Users];
GO
PRINT N'Dropping FK_BugNet_DefaultValues_aspnet_Users1...';
GO
ALTER TABLE [dbo].[BugNet_DefaultValues] DROP CONSTRAINT [FK_BugNet_DefaultValues_aspnet_Users1];
GO
PRINT N'Dropping FK_BugNet_UserRoles_aspnet_Users...';
GO
ALTER TABLE [dbo].[BugNet_UserRoles] DROP CONSTRAINT [FK_BugNet_UserRoles_aspnet_Users];
GO
PRINT N'Dropping FK_BugNet_ProjectMailBoxes_aspnet_Users...';
GO
ALTER TABLE [dbo].[BugNet_ProjectMailBoxes] DROP CONSTRAINT [FK_BugNet_ProjectMailBoxes_aspnet_Users];
GO
PRINT N'Dropping FK_BugNet_Issues_aspnet_Users...';
GO
ALTER TABLE [dbo].[BugNet_Issues] DROP CONSTRAINT [FK_BugNet_Issues_aspnet_Users];
GO
PRINT N'Dropping FK_BugNet_Issues_aspnet_Users1...';
GO
ALTER TABLE [dbo].[BugNet_Issues] DROP CONSTRAINT [FK_BugNet_Issues_aspnet_Users1];
GO
PRINT N'Dropping FK_BugNet_Issues_aspnet_Users2...';
GO
ALTER TABLE [dbo].[BugNet_Issues] DROP CONSTRAINT [FK_BugNet_Issues_aspnet_Users2];
GO
PRINT N'Dropping FK_BugNet_Issues_aspnet_Users3...';
GO
ALTER TABLE [dbo].[BugNet_Issues] DROP CONSTRAINT [FK_BugNet_Issues_aspnet_Users3];
GO
PRINT N'Dropping FK_BugNet_IssueNotifications_aspnet_Users...';
GO
ALTER TABLE [dbo].[BugNet_IssueNotifications] DROP CONSTRAINT [FK_BugNet_IssueNotifications_aspnet_Users];
GO
PRINT N'Dropping FK_BugNet_IssueWorkReports_aspnet_Users...';
GO
ALTER TABLE [dbo].[BugNet_IssueWorkReports] DROP CONSTRAINT [FK_BugNet_IssueWorkReports_aspnet_Users];
GO
PRINT N'Dropping FK_BugNet_IssueAttachments_aspnet_Users...';
GO
ALTER TABLE [dbo].[BugNet_IssueAttachments] DROP CONSTRAINT [FK_BugNet_IssueAttachments_aspnet_Users];
GO
PRINT N'Dropping FK_BugNet_IssueHistory_aspnet_Users...';
GO
ALTER TABLE [dbo].[BugNet_IssueHistory] DROP CONSTRAINT [FK_BugNet_IssueHistory_aspnet_Users];
GO
PRINT N'Dropping FK_BugNet_IssueComments_aspnet_Users...';
GO
ALTER TABLE [dbo].[BugNet_IssueComments] DROP CONSTRAINT [FK_BugNet_IssueComments_aspnet_Users];
GO
PRINT N'Dropping FK_BugNet_IssueVotes_aspnet_Users...';
GO
ALTER TABLE [dbo].[BugNet_IssueVotes] DROP CONSTRAINT [FK_BugNet_IssueVotes_aspnet_Users];
GO
PRINT N'Dropping FK_BugNet_Projects_aspnet_Users...';
GO
ALTER TABLE [dbo].[BugNet_Projects] DROP CONSTRAINT [FK_BugNet_Projects_aspnet_Users];
GO
PRINT N'Dropping FK_BugNet_Projects_aspnet_Users1...';
GO
ALTER TABLE [dbo].[BugNet_Projects] DROP CONSTRAINT [FK_BugNet_Projects_aspnet_Users1];
GO
PRINT N'Dropping FK_BugNet_ProjectNotifications_aspnet_Users...';
GO
ALTER TABLE [dbo].[BugNet_ProjectNotifications] DROP CONSTRAINT [FK_BugNet_ProjectNotifications_aspnet_Users];
GO
PRINT N'Creating PK_BugNet_RelatedIssues...';
GO
ALTER TABLE [dbo].[BugNet_RelatedIssues]
ADD CONSTRAINT [PK_BugNet_RelatedIssues] PRIMARY KEY CLUSTERED ([PrimaryIssueId] ASC, [SecondaryIssueId] ASC);
GO
PRINT N'Creating FK_BugNet_DefaultValues_Users...';
GO
ALTER TABLE [dbo].[BugNet_DefaultValues] WITH NOCHECK
ADD CONSTRAINT [FK_BugNet_DefaultValues_Users] FOREIGN KEY ([IssueOwnerUserId]) REFERENCES [dbo].[Users] ([UserId]) ON DELETE CASCADE;
GO
PRINT N'Creating FK_BugNet_DefaultValues_Users1...';
GO
ALTER TABLE [dbo].[BugNet_DefaultValues] WITH NOCHECK
ADD CONSTRAINT [FK_BugNet_DefaultValues_Users1] FOREIGN KEY ([IssueAssignedUserId]) REFERENCES [dbo].[Users] ([UserId]);
GO
PRINT N'Creating FK_BugNet_IssueAttachments_Users...';
GO
ALTER TABLE [dbo].[BugNet_IssueAttachments] WITH NOCHECK
ADD CONSTRAINT [FK_BugNet_IssueAttachments_Users] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Users] ([UserId]);
GO
PRINT N'Creating FK_BugNet_IssueComments_Users...';
GO
ALTER TABLE [dbo].[BugNet_IssueComments] WITH NOCHECK
ADD CONSTRAINT [FK_BugNet_IssueComments_Users] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Users] ([UserId]) ON DELETE CASCADE;
GO
PRINT N'Creating FK_BugNet_IssueHistory_Users...';
GO
ALTER TABLE [dbo].[BugNet_IssueHistory] WITH NOCHECK
ADD CONSTRAINT [FK_BugNet_IssueHistory_Users] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Users] ([UserId]) ON DELETE CASCADE;
GO
PRINT N'Creating FK_BugNet_IssueNotifications_Users...';
GO
ALTER TABLE [dbo].[BugNet_IssueNotifications] WITH NOCHECK
ADD CONSTRAINT [FK_BugNet_IssueNotifications_Users] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Users] ([UserId]) ON DELETE CASCADE;
GO
PRINT N'Creating FK_BugNet_Issues_Users...';
GO
ALTER TABLE [dbo].[BugNet_Issues] WITH NOCHECK
ADD CONSTRAINT [FK_BugNet_Issues_Users] FOREIGN KEY ([IssueAssignedUserId]) REFERENCES [dbo].[Users] ([UserId]);
GO
PRINT N'Creating FK_BugNet_Issues_Users1...';
GO
ALTER TABLE [dbo].[BugNet_Issues] WITH NOCHECK
ADD CONSTRAINT [FK_BugNet_Issues_Users1] FOREIGN KEY ([IssueOwnerUserId]) REFERENCES [dbo].[Users] ([UserId]);
GO
PRINT N'Creating FK_BugNet_Issues_Users2...';
GO
ALTER TABLE [dbo].[BugNet_Issues] WITH NOCHECK
ADD CONSTRAINT [FK_BugNet_Issues_Users2] FOREIGN KEY ([LastUpdateUserId]) REFERENCES [dbo].[Users] ([UserId]);
GO
PRINT N'Creating FK_BugNet_Issues_Users3...';
GO
ALTER TABLE [dbo].[BugNet_Issues] WITH NOCHECK
ADD CONSTRAINT [FK_BugNet_Issues_Users3] FOREIGN KEY ([IssueCreatorUserId]) REFERENCES [dbo].[Users] ([UserId]);
GO
PRINT N'Creating FK_BugNet_IssueVotes_Users...';
GO
ALTER TABLE [dbo].[BugNet_IssueVotes] WITH NOCHECK
ADD CONSTRAINT [FK_BugNet_IssueVotes_Users] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Users] ([UserId]);
GO
PRINT N'Creating FK_BugNet_IssueWorkReports_Users...';
GO
ALTER TABLE [dbo].[BugNet_IssueWorkReports] WITH NOCHECK
ADD CONSTRAINT [FK_BugNet_IssueWorkReports_Users] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Users] ([UserId]);
GO
PRINT N'Creating FK_BugNet_ProjectMailBoxes_Users...';
GO
ALTER TABLE [dbo].[BugNet_ProjectMailBoxes] WITH NOCHECK
ADD CONSTRAINT [FK_BugNet_ProjectMailBoxes_Users] FOREIGN KEY ([AssignToUserId]) REFERENCES [dbo].[Users] ([UserId]);
GO
PRINT N'Creating FK_BugNet_ProjectNotifications_Users...';
GO
ALTER TABLE [dbo].[BugNet_ProjectNotifications] WITH NOCHECK
ADD CONSTRAINT [FK_BugNet_ProjectNotifications_Users] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Users] ([UserId]) ON DELETE CASCADE;
GO
PRINT N'Creating FK_BugNet_Projects_Users...';
GO
ALTER TABLE [dbo].[BugNet_Projects] WITH NOCHECK
ADD CONSTRAINT [FK_BugNet_Projects_Users] FOREIGN KEY ([ProjectCreatorUserId]) REFERENCES [dbo].[Users] ([UserId]);
GO
PRINT N'Creating FK_BugNet_Projects_Users1...';
GO
ALTER TABLE [dbo].[BugNet_Projects] WITH NOCHECK
ADD CONSTRAINT [FK_BugNet_Projects_Users1] FOREIGN KEY ([ProjectManagerUserId]) REFERENCES [dbo].[Users] ([UserId]);
GO
PRINT N'Creating FK_BugNet_Queries_Users...';
GO
ALTER TABLE [dbo].[BugNet_Queries] WITH NOCHECK
ADD CONSTRAINT [FK_BugNet_Queries_Users] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Users] ([UserId]);
GO
PRINT N'Creating FK_BugNet_UserProjects_Users...';
GO
ALTER TABLE [dbo].[BugNet_UserProjects] WITH NOCHECK
ADD CONSTRAINT [FK_BugNet_UserProjects_Users] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Users] ([UserId]) ON DELETE CASCADE;
GO
PRINT N'Creating FK_BugNet_UserRoles_Users...';
GO
ALTER TABLE [dbo].[BugNet_UserRoles] WITH NOCHECK
ADD CONSTRAINT [FK_BugNet_UserRoles_Users] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Users] ([UserId]) ON DELETE CASCADE;
GO
PRINT N'Altering [dbo].[BugNet_DefaultValView]...';
GO
ALTER VIEW [dbo].[BugNet_DefaultValView]
AS
SELECT dbo.BugNet_DefaultValues.DefaultType, dbo.BugNet_DefaultValues.StatusId, dbo.BugNet_DefaultValues.IssueOwnerUserId,
dbo.BugNet_DefaultValues.IssuePriorityId, dbo.BugNet_DefaultValues.IssueAffectedMilestoneId, dbo.BugNet_DefaultValues.ProjectId,
ISNULL(OwnerUsers.UserName, N'none') AS OwnerUserName, ISNULL(OwnerUsersProfile.DisplayName, N'none') AS OwnerDisplayName,
ISNULL(AssignedUsers.UserName, N'none') AS AssignedUserName, ISNULL(AssignedUsersProfile.DisplayName, N'none') AS AssignedDisplayName,
dbo.BugNet_DefaultValues.IssueAssignedUserId, dbo.BugNet_DefaultValues.IssueCategoryId, dbo.BugNet_DefaultValues.IssueVisibility,
dbo.BugNet_DefaultValues.IssueDueDate, dbo.BugNet_DefaultValues.IssueProgress, dbo.BugNet_DefaultValues.IssueMilestoneId,
dbo.BugNet_DefaultValues.IssueEstimation, dbo.BugNet_DefaultValues.IssueResolutionId, dbo.BugNet_DefaultValuesVisibility.StatusVisibility,
dbo.BugNet_DefaultValuesVisibility.PriorityVisibility, dbo.BugNet_DefaultValuesVisibility.OwnedByVisibility,
dbo.BugNet_DefaultValuesVisibility.AssignedToVisibility, dbo.BugNet_DefaultValuesVisibility.PrivateVisibility,
dbo.BugNet_DefaultValuesVisibility.CategoryVisibility, dbo.BugNet_DefaultValuesVisibility.DueDateVisibility,
dbo.BugNet_DefaultValuesVisibility.TypeVisibility, dbo.BugNet_DefaultValuesVisibility.PercentCompleteVisibility,
dbo.BugNet_DefaultValuesVisibility.MilestoneVisibility, dbo.BugNet_DefaultValuesVisibility.ResolutionVisibility,
dbo.BugNet_DefaultValuesVisibility.EstimationVisibility, dbo.BugNet_DefaultValuesVisibility.AffectedMilestoneVisibility,
dbo.BugNet_DefaultValues.OwnedByNotify, dbo.BugNet_DefaultValues.AssignedToNotify
FROM dbo.BugNet_DefaultValues LEFT OUTER JOIN
dbo.Users AS OwnerUsers ON dbo.BugNet_DefaultValues.IssueOwnerUserId = OwnerUsers.UserId LEFT OUTER JOIN
dbo.Users AS AssignedUsers ON dbo.BugNet_DefaultValues.IssueAssignedUserId = AssignedUsers.UserId LEFT OUTER JOIN
dbo.BugNet_UserProfiles AS AssignedUsersProfile ON AssignedUsers.UserName = AssignedUsersProfile.UserName LEFT OUTER JOIN
dbo.BugNet_UserProfiles AS OwnerUsersProfile ON OwnerUsers.UserName = OwnerUsersProfile.UserName LEFT OUTER JOIN
dbo.BugNet_DefaultValuesVisibility ON dbo.BugNet_DefaultValues.ProjectId = dbo.BugNet_DefaultValuesVisibility.ProjectId
GO
PRINT N'Altering [dbo].[BugNet_GetIssuesByProjectIdAndCustomFieldView]...';
GO
ALTER VIEW [dbo].[BugNet_GetIssuesByProjectIdAndCustomFieldView]
AS
SELECT
dbo.BugNet_Issues.IssueId,
dbo.BugNet_Issues.Disabled,
dbo.BugNet_Issues.IssueTitle,
dbo.BugNet_Issues.IssueDescription,
dbo.BugNet_Issues.IssueStatusId,
dbo.BugNet_Issues.IssuePriorityId,
dbo.BugNet_Issues.IssueTypeId,
dbo.BugNet_Issues.IssueCategoryId,
dbo.BugNet_Issues.ProjectId,
dbo.BugNet_Issues.IssueResolutionId,
dbo.BugNet_Issues.IssueCreatorUserId,
dbo.BugNet_Issues.IssueAssignedUserId,
dbo.BugNet_Issues.IssueAffectedMilestoneId,
dbo.BugNet_Issues.IssueOwnerUserId,
dbo.BugNet_Issues.IssueDueDate,
dbo.BugNet_Issues.IssueMilestoneId,
dbo.BugNet_Issues.IssueVisibility,
dbo.BugNet_Issues.IssueEstimation,
dbo.BugNet_Issues.DateCreated,
dbo.BugNet_Issues.LastUpdate,
dbo.BugNet_Issues.LastUpdateUserId,
dbo.BugNet_Projects.ProjectName,
dbo.BugNet_Projects.ProjectCode,
ISNULL(dbo.BugNet_ProjectPriorities.PriorityName, N'none') AS PriorityName,
ISNULL(dbo.BugNet_ProjectIssueTypes.IssueTypeName,N'none') AS IssueTypeName,
ISNULL(dbo.BugNet_ProjectCategories.CategoryName, N'none') AS CategoryName,
ISNULL(dbo.BugNet_ProjectStatus.StatusName, N'none') AS StatusName ,
ISNULL(dbo.BugNet_ProjectMilestones.MilestoneName, N'none') AS MilestoneName,
ISNULL(AffectedMilestone.MilestoneName, N'none') AS AffectedMilestoneName,
ISNULL(dbo.BugNet_ProjectResolutions.ResolutionName, 'none') AS ResolutionName,
LastUpdateUsers.UserName AS LastUpdateUserName,
ISNULL(AssignedUsers.UserName, N'none') AS AssignedUserName,
ISNULL(AssignedUsersProfile.DisplayName, N'none') AS AssignedDisplayName,
CreatorUsers.UserName AS CreatorUserName,
ISNULL(CreatorUsersProfile.DisplayName, N'none') AS CreatorDisplayName,
ISNULL(OwnerUsers.UserName, 'none') AS OwnerUserName,
ISNULL(OwnerUsersProfile.DisplayName, N'none') AS OwnerDisplayName,
ISNULL(LastUpdateUsersProfile.DisplayName, 'none') AS LastUpdateDisplayName,
ISNULL(dbo.BugNet_ProjectPriorities.PriorityImageUrl, '') AS PriorityImageUrl,
ISNULL(dbo.BugNet_ProjectIssueTypes.IssueTypeImageUrl, '') AS IssueTypeImageUrl,
ISNULL(dbo.BugNet_ProjectStatus.StatusImageUrl, '') AS StatusImageUrl,
ISNULL(dbo.BugNet_ProjectMilestones.MilestoneImageUrl, '') AS MilestoneImageUrl,
ISNULL(dbo.BugNet_ProjectResolutions.ResolutionImageUrl, '') AS ResolutionImageUrl,
ISNULL(AffectedMilestone.MilestoneImageUrl, '')
AS AffectedMilestoneImageUrl, ISNULL
((SELECT SUM(Duration) AS Expr1
FROM dbo.BugNet_IssueWorkReports AS WR
WHERE (IssueId = dbo.BugNet_Issues.IssueId)), 0.00) AS TimeLogged, ISNULL
((SELECT COUNT(IssueId) AS Expr1
FROM dbo.BugNet_IssueVotes AS V
WHERE (IssueId = dbo.BugNet_Issues.IssueId)), 0) AS IssueVotes,
dbo.BugNet_ProjectCustomFields.CustomFieldName,
dbo.BugNet_ProjectCustomFieldValues.CustomFieldValue,
dbo.BugNet_Issues.IssueProgress,
dbo.BugNet_ProjectMilestones.MilestoneDueDate,
dbo.BugNet_Projects.ProjectDisabled,
CAST(COALESCE (dbo.BugNet_ProjectStatus.IsClosedState, 0) AS BIT) AS IsClosed
FROM
dbo.BugNet_ProjectCustomFields
INNER JOIN
dbo.BugNet_ProjectCustomFieldValues ON dbo.BugNet_ProjectCustomFields.CustomFieldId = dbo.BugNet_ProjectCustomFieldValues.CustomFieldId
RIGHT OUTER JOIN
dbo.BugNet_Issues ON dbo.BugNet_ProjectCustomFieldValues.IssueId = dbo.BugNet_Issues.IssueId
LEFT OUTER JOIN
dbo.BugNet_ProjectIssueTypes ON dbo.BugNet_Issues.IssueTypeId = dbo.BugNet_ProjectIssueTypes.IssueTypeId
LEFT OUTER JOIN
dbo.BugNet_ProjectPriorities ON dbo.BugNet_Issues.IssuePriorityId = dbo.BugNet_ProjectPriorities.PriorityId
LEFT OUTER JOIN
dbo.BugNet_ProjectCategories ON dbo.BugNet_Issues.IssueCategoryId = dbo.BugNet_ProjectCategories.CategoryId
LEFT OUTER JOIN
dbo.BugNet_ProjectStatus ON dbo.BugNet_Issues.IssueStatusId = dbo.BugNet_ProjectStatus.StatusId
LEFT OUTER JOIN
dbo.BugNet_ProjectMilestones AS AffectedMilestone ON dbo.BugNet_Issues.IssueAffectedMilestoneId = AffectedMilestone.MilestoneId
LEFT OUTER JOIN
dbo.BugNet_ProjectMilestones ON dbo.BugNet_Issues.IssueMilestoneId = dbo.BugNet_ProjectMilestones.MilestoneId
LEFT OUTER JOIN
dbo.BugNet_ProjectResolutions ON dbo.BugNet_Issues.IssueResolutionId = dbo.BugNet_ProjectResolutions.ResolutionId
LEFT OUTER JOIN
dbo.Users AS AssignedUsers ON dbo.BugNet_Issues.IssueAssignedUserId = AssignedUsers.UserId
LEFT OUTER JOIN
dbo.Users AS LastUpdateUsers ON dbo.BugNet_Issues.LastUpdateUserId = LastUpdateUsers.UserId
LEFT OUTER JOIN
dbo.Users AS CreatorUsers ON dbo.BugNet_Issues.IssueCreatorUserId = CreatorUsers.UserId
LEFT OUTER JOIN
dbo.Users AS OwnerUsers ON dbo.BugNet_Issues.IssueOwnerUserId = OwnerUsers.UserId
LEFT OUTER JOIN
dbo.BugNet_UserProfiles AS CreatorUsersProfile ON CreatorUsers.UserName = CreatorUsersProfile.UserName
LEFT OUTER JOIN
dbo.BugNet_UserProfiles AS AssignedUsersProfile ON AssignedUsers.UserName = AssignedUsersProfile.UserName
LEFT OUTER JOIN
dbo.BugNet_UserProfiles AS OwnerUsersProfile ON OwnerUsers.UserName = OwnerUsersProfile.UserName
LEFT OUTER JOIN
dbo.BugNet_UserProfiles AS LastUpdateUsersProfile ON LastUpdateUsers.UserName = LastUpdateUsersProfile.UserName
LEFT OUTER JOIN
dbo.BugNet_Projects ON dbo.BugNet_Issues.ProjectId = dbo.BugNet_Projects.ProjectId
GO
PRINT N'Altering [dbo].[BugNet_IssuesView]...';
GO
ALTER VIEW [dbo].[BugNet_IssuesView]
AS
SELECT dbo.BugNet_Issues.IssueId, dbo.BugNet_Issues.IssueTitle, dbo.BugNet_Issues.IssueDescription, dbo.BugNet_Issues.IssueStatusId,
dbo.BugNet_Issues.IssuePriorityId, dbo.BugNet_Issues.IssueTypeId, dbo.BugNet_Issues.IssueCategoryId, dbo.BugNet_Issues.ProjectId,
dbo.BugNet_Issues.IssueResolutionId, dbo.BugNet_Issues.IssueCreatorUserId, dbo.BugNet_Issues.IssueAssignedUserId, dbo.BugNet_Issues.IssueOwnerUserId,
dbo.BugNet_Issues.IssueDueDate, dbo.BugNet_Issues.IssueMilestoneId, dbo.BugNet_Issues.IssueAffectedMilestoneId, dbo.BugNet_Issues.IssueVisibility,
dbo.BugNet_Issues.IssueEstimation, dbo.BugNet_Issues.DateCreated, dbo.BugNet_Issues.LastUpdate, dbo.BugNet_Issues.LastUpdateUserId,
dbo.BugNet_Projects.ProjectName, dbo.BugNet_Projects.ProjectCode, ISNULL(dbo.BugNet_ProjectPriorities.PriorityName, N'Unassigned') AS PriorityName,
ISNULL(dbo.BugNet_ProjectIssueTypes.IssueTypeName, N'Unassigned') AS IssueTypeName, ISNULL(dbo.BugNet_ProjectCategories.CategoryName, N'Unassigned')
AS CategoryName, ISNULL(dbo.BugNet_ProjectStatus.StatusName, N'Unassigned') AS StatusName, ISNULL(dbo.BugNet_ProjectMilestones.MilestoneName,
N'Unassigned') AS MilestoneName, ISNULL(AffectedMilestone.MilestoneName, N'Unassigned') AS AffectedMilestoneName,
ISNULL(dbo.BugNet_ProjectResolutions.ResolutionName, 'Unassigned') AS ResolutionName, LastUpdateUsers.UserName AS LastUpdateUserName,
ISNULL(AssignedUsers.UserName, N'Unassigned') AS AssignedUserName, ISNULL(AssignedUsersProfile.DisplayName, N'Unassigned') AS AssignedDisplayName,
CreatorUsers.UserName AS CreatorUserName, ISNULL(CreatorUsersProfile.DisplayName, N'Unassigned') AS CreatorDisplayName, ISNULL(OwnerUsers.UserName,
'Unassigned') AS OwnerUserName, ISNULL(OwnerUsersProfile.DisplayName, N'Unassigned') AS OwnerDisplayName, ISNULL(LastUpdateUsersProfile.DisplayName,
'Unassigned') AS LastUpdateDisplayName, ISNULL(dbo.BugNet_ProjectPriorities.PriorityImageUrl, '') AS PriorityImageUrl,
ISNULL(dbo.BugNet_ProjectIssueTypes.IssueTypeImageUrl, '') AS IssueTypeImageUrl, ISNULL(dbo.BugNet_ProjectStatus.StatusImageUrl, '') AS StatusImageUrl,
ISNULL(dbo.BugNet_ProjectMilestones.MilestoneImageUrl, '') AS MilestoneImageUrl, ISNULL(dbo.BugNet_ProjectResolutions.ResolutionImageUrl, '')
AS ResolutionImageUrl, ISNULL(AffectedMilestone.MilestoneImageUrl, '') AS AffectedMilestoneImageUrl, ISNULL
((SELECT SUM(Duration) AS Expr1
FROM dbo.BugNet_IssueWorkReports AS WR
WHERE (IssueId = dbo.BugNet_Issues.IssueId)), 0.00) AS TimeLogged, ISNULL
((SELECT COUNT(IssueId) AS Expr1
FROM dbo.BugNet_IssueVotes AS V
WHERE (IssueId = dbo.BugNet_Issues.IssueId)), 0) AS IssueVotes, dbo.BugNet_Issues.Disabled, dbo.BugNet_Issues.IssueProgress,
dbo.BugNet_ProjectMilestones.MilestoneDueDate, dbo.BugNet_Projects.ProjectDisabled, CAST(COALESCE (dbo.BugNet_ProjectStatus.IsClosedState, 0) AS BIT)
AS IsClosed, CAST(CONVERT(VARCHAR(8), dbo.BugNet_Issues.LastUpdate, 112) AS DATETIME) AS LastUpdateAsDate, CAST(CONVERT(VARCHAR(8), dbo.BugNet_Issues.DateCreated, 112) AS DATETIME) AS DateCreatedAsDate
FROM dbo.BugNet_Issues LEFT OUTER JOIN
dbo.BugNet_ProjectIssueTypes ON dbo.BugNet_Issues.IssueTypeId = dbo.BugNet_ProjectIssueTypes.IssueTypeId LEFT OUTER JOIN
dbo.BugNet_ProjectPriorities ON dbo.BugNet_Issues.IssuePriorityId = dbo.BugNet_ProjectPriorities.PriorityId LEFT OUTER JOIN
dbo.BugNet_ProjectCategories ON dbo.BugNet_Issues.IssueCategoryId = dbo.BugNet_ProjectCategories.CategoryId LEFT OUTER JOIN
dbo.BugNet_ProjectStatus ON dbo.BugNet_Issues.IssueStatusId = dbo.BugNet_ProjectStatus.StatusId LEFT OUTER JOIN
dbo.BugNet_ProjectMilestones AS AffectedMilestone ON dbo.BugNet_Issues.IssueAffectedMilestoneId = AffectedMilestone.MilestoneId LEFT OUTER JOIN
dbo.BugNet_ProjectMilestones ON dbo.BugNet_Issues.IssueMilestoneId = dbo.BugNet_ProjectMilestones.MilestoneId LEFT OUTER JOIN
dbo.BugNet_ProjectResolutions ON dbo.BugNet_Issues.IssueResolutionId = dbo.BugNet_ProjectResolutions.ResolutionId LEFT OUTER JOIN
dbo.Users AS AssignedUsers ON dbo.BugNet_Issues.IssueAssignedUserId = AssignedUsers.UserId LEFT OUTER JOIN
dbo.Users AS LastUpdateUsers ON dbo.BugNet_Issues.LastUpdateUserId = LastUpdateUsers.UserId LEFT OUTER JOIN
dbo.Users AS CreatorUsers ON dbo.BugNet_Issues.IssueCreatorUserId = CreatorUsers.UserId LEFT OUTER JOIN
dbo.Users AS OwnerUsers ON dbo.BugNet_Issues.IssueOwnerUserId = OwnerUsers.UserId LEFT OUTER JOIN
dbo.BugNet_UserProfiles AS CreatorUsersProfile ON CreatorUsers.UserName = CreatorUsersProfile.UserName LEFT OUTER JOIN
dbo.BugNet_UserProfiles AS AssignedUsersProfile ON AssignedUsers.UserName = AssignedUsersProfile.UserName LEFT OUTER JOIN
dbo.BugNet_UserProfiles AS OwnerUsersProfile ON OwnerUsers.UserName = OwnerUsersProfile.UserName LEFT OUTER JOIN
dbo.BugNet_UserProfiles AS LastUpdateUsersProfile ON LastUpdateUsers.UserName = LastUpdateUsersProfile.UserName LEFT OUTER JOIN
dbo.BugNet_Projects ON dbo.BugNet_Issues.ProjectId = dbo.BugNet_Projects.ProjectId
GO
PRINT N'Altering [dbo].[BugNet_ProjectsView]...';
GO
ALTER VIEW [dbo].[BugNet_ProjectsView]
AS
SELECT TOP (100) PERCENT dbo.BugNet_Projects.ProjectId, dbo.BugNet_Projects.ProjectName, dbo.BugNet_Projects.ProjectCode, dbo.BugNet_Projects.ProjectDescription,
dbo.BugNet_Projects.AttachmentUploadPath, dbo.BugNet_Projects.ProjectManagerUserId, dbo.BugNet_Projects.ProjectCreatorUserId,
dbo.BugNet_Projects.DateCreated, dbo.BugNet_Projects.ProjectDisabled, dbo.BugNet_Projects.ProjectAccessType, Managers.UserName AS ManagerUserName,
ISNULL(ManagerUsersProfile.DisplayName, N'none') AS ManagerDisplayName, Creators.UserName AS CreatorUserName, ISNULL(CreatorUsersProfile.DisplayName,
N'none') AS CreatorDisplayName, dbo.BugNet_Projects.AllowAttachments, dbo.BugNet_Projects.AttachmentStorageType, dbo.BugNet_Projects.SvnRepositoryUrl,
dbo.BugNet_Projects.AllowIssueVoting
FROM dbo.BugNet_Projects INNER JOIN
dbo.Users AS Managers ON Managers.UserId = dbo.BugNet_Projects.ProjectManagerUserId INNER JOIN
dbo.Users AS Creators ON Creators.UserId = dbo.BugNet_Projects.ProjectCreatorUserId LEFT OUTER JOIN
dbo.BugNet_UserProfiles AS CreatorUsersProfile ON Creators.UserName = CreatorUsersProfile.UserName LEFT OUTER JOIN
dbo.BugNet_UserProfiles AS ManagerUsersProfile ON Managers.UserName = ManagerUsersProfile.UserName
ORDER BY dbo.BugNet_Projects.ProjectName
GO
PRINT N'Altering [dbo].[BugNet_UserView]...';
GO
ALTER VIEW [dbo].[BugNet_UserView]
AS
SELECT dbo.Users.UserId, dbo.BugNet_UserProfiles.FirstName, dbo.BugNet_UserProfiles.LastName, dbo.BugNet_UserProfiles.DisplayName,
dbo.Users.UserName, dbo.Memberships.Email,
dbo.Memberships.IsApproved, dbo.Memberships.IsLockedOut, dbo.Users.IsAnonymous,
dbo.Users.LastActivityDate, dbo.BugNet_UserProfiles.IssuesPageSize, dbo.BugNet_UserProfiles.PreferredLocale
FROM dbo.Users INNER JOIN
dbo.Memberships ON dbo.Users.UserId = dbo.Memberships.UserId INNER JOIN
dbo.BugNet_UserProfiles ON dbo.Users.UserName = dbo.BugNet_UserProfiles.UserName
GROUP BY dbo.Users.UserId, dbo.Users.UserName, dbo.Memberships.Email, dbo.Memberships.IsApproved, dbo.Memberships.IsLockedOut, dbo.Users.IsAnonymous,
dbo.Users.LastActivityDate, dbo.BugNet_UserProfiles.FirstName, dbo.BugNet_UserProfiles.LastName, dbo.BugNet_UserProfiles.DisplayName,
dbo.BugNet_UserProfiles.IssuesPageSize, dbo.BugNet_UserProfiles.PreferredLocale
GO
PRINT N'Refreshing [dbo].[BugNet_Issue_IssueTypeCountView]...';
GO
EXECUTE sp_refreshsqlmodule N'[dbo].[BugNet_Issue_IssueTypeCountView]';
GO
PRINT N'Refreshing [dbo].[BugNet_IssueAssignedToCountView]...';
GO
EXECUTE sp_refreshsqlmodule N'[dbo].[BugNet_IssueAssignedToCountView]';
GO
PRINT N'Refreshing [dbo].[BugNet_IssueCommentsView]...';
GO
EXECUTE sp_refreshsqlmodule N'[dbo].[BugNet_IssueCommentsView]';
GO
PRINT N'Refreshing [dbo].[BugNet_IssueMilestoneCountView]...';
GO
EXECUTE sp_refreshsqlmodule N'[dbo].[BugNet_IssueMilestoneCountView]';
GO
PRINT N'Refreshing [dbo].[BugNet_IssuePriorityCountView]...';
GO
EXECUTE sp_refreshsqlmodule N'[dbo].[BugNet_IssuePriorityCountView]';
GO
PRINT N'Refreshing [dbo].[BugNet_IssueStatusCountView]...';
GO
EXECUTE sp_refreshsqlmodule N'[dbo].[BugNet_IssueStatusCountView]';
GO
PRINT N'Altering [dbo].[BugNet_IssueAttachment_GetIssueAttachmentById]...';
GO
ALTER PROCEDURE [dbo].[BugNet_IssueAttachment_GetIssueAttachmentById]
@IssueAttachmentId INT
AS
SELECT
IssueAttachmentId,
IssueId,
FileSize,
Description,
Attachment,
ContentType,
U.UserName CreatorUserName,
IsNull(DisplayName,'') CreatorDisplayName,
FileName,
DateCreated
FROM
BugNet_IssueAttachments
INNER JOIN Users U ON BugNet_IssueAttachments.UserId = U.UserId
LEFT OUTER JOIN BugNet_UserProfiles ON U.UserName = BugNet_UserProfiles.UserName
WHERE
IssueAttachmentId = @IssueAttachmentId
GO
PRINT N'Altering [dbo].[BugNet_IssueAttachment_GetIssueAttachmentsByIssueId]...';
GO
ALTER PROCEDURE [dbo].[BugNet_IssueAttachment_GetIssueAttachmentsByIssueId]
@IssueId Int
AS
SELECT
IssueAttachmentId,
IssueId,
FileSize,
Description,
Attachment,
ContentType,
U.UserName CreatorUserName,
IsNull(DisplayName,'') CreatorDisplayName,
FileName,
DateCreated
FROM
BugNet_IssueAttachments
INNER JOIN Users U ON BugNet_IssueAttachments.UserId = U.UserId
LEFT OUTER JOIN BugNet_UserProfiles ON U.UserName = BugNet_UserProfiles.UserName
WHERE
IssueId = @IssueId
ORDER BY
DateCreated DESC
GO
PRINT N'Altering [dbo].[BugNet_IssueComment_GetIssueCommentById]...';
GO
ALTER PROCEDURE [dbo].[BugNet_IssueComment_GetIssueCommentById]
@IssueCommentId INT
AS
SELECT
IssueCommentId,
IssueId,
Comment,
U.UserId CreatorUserId,
U.UserName CreatorUserName,
IsNull(DisplayName,'') CreatorDisplayName,
DateCreated
FROM
BugNet_IssueComments
INNER JOIN Users U ON BugNet_IssueComments.UserId = U.UserId
LEFT OUTER JOIN BugNet_UserProfiles ON U.UserName = BugNet_UserProfiles.UserName
WHERE
IssueCommentId = @IssueCommentId
GO
PRINT N'Altering [dbo].[BugNet_IssueComment_GetIssueCommentsByIssueId]...';
GO
ALTER PROCEDURE [dbo].[BugNet_IssueComment_GetIssueCommentsByIssueId]
@IssueId Int
AS
SELECT
IssueCommentId,
IssueId,
Comment,
U.UserId CreatorUserId,
U.UserName CreatorUserName,
IsNull(DisplayName,'') CreatorDisplayName,
DateCreated
FROM
BugNet_IssueComments
INNER JOIN Users U ON BugNet_IssueComments.UserId = U.UserId
LEFT OUTER JOIN BugNet_UserProfiles ON U.UserName = BugNet_UserProfiles.UserName
WHERE
IssueId = @IssueId
ORDER BY
DateCreated DESC
GO
PRINT N'Altering [dbo].[BugNet_IssueHistory_GetIssueHistoryByIssueId]...';
GO
ALTER PROCEDURE [dbo].[BugNet_IssueHistory_GetIssueHistoryByIssueId]
@IssueId int
AS
SELECT
IssueHistoryId,
IssueId,
U.UserName CreatorUserName,
IsNull(DisplayName,'') CreatorDisplayName,
FieldChanged,
OldValue,
NewValue,
DateCreated
FROM
BugNet_IssueHistory
INNER JOIN Users U ON BugNet_IssueHistory.UserId = U.UserId
LEFT OUTER JOIN BugNet_UserProfiles ON U.UserName = BugNet_UserProfiles.UserName
WHERE
IssueId = @IssueId
ORDER BY
DateCreated DESC
GO
PRINT N'Altering [dbo].[BugNet_IssueNotification_GetIssueNotificationsByIssueId]...';
GO
ALTER PROCEDURE [dbo].[BugNet_IssueNotification_GetIssueNotificationsByIssueId]
@IssueId Int
AS
SET NOCOUNT ON
DECLARE @DefaultCulture NVARCHAR(50)
SET @DefaultCulture = (SELECT ISNULL(SettingValue, 'en-US') FROM BugNet_HostSettings WHERE SettingName = 'ApplicationDefaultLanguage')
DECLARE @tmpTable TABLE (IssueNotificationId int, IssueId int,NotificationUserId uniqueidentifier, NotificationUserName nvarchar(50), NotificationDisplayName nvarchar(50), NotificationEmail nvarchar(50), NotificationCulture NVARCHAR(50))
INSERT @tmpTable
SELECT
IssueNotificationId,
IssueId,
U.UserId NotificationUserId,
U.UserName NotificationUserName,
IsNull(DisplayName,'') NotificationDisplayName,
M.Email NotificationEmail,
ISNULL(UP.PreferredLocale, @DefaultCulture) AS NotificationCulture
FROM
BugNet_IssueNotifications
INNER JOIN Users U ON BugNet_IssueNotifications.UserId = U.UserId
INNER JOIN Memberships M ON BugNet_IssueNotifications.UserId = M.UserId
LEFT OUTER JOIN BugNet_UserProfiles UP ON U.UserName = UP.UserName
WHERE
IssueId = @IssueId
ORDER BY
DisplayName
-- get all people on the project who want to be notified
INSERT @tmpTable
SELECT
ProjectNotificationId,
IssueId = @IssueId,
u.UserId NotificationUserId,
u.UserName NotificationUserName,
IsNull(DisplayName,'') NotificationDisplayName,
m.Email NotificationEmail,
ISNULL(UP.PreferredLocale, @DefaultCulture) AS NotificationCulture
FROM
BugNet_ProjectNotifications p,
BugNet_Issues i,
Users u,
Memberships m ,
BugNet_UserProfiles up
WHERE
IssueId = @IssueId
AND p.ProjectId = i.ProjectId
AND u.UserId = p.UserId
AND u.UserId = m.UserId
AND u.UserName = up.UserName
SELECT DISTINCT IssueId,NotificationUserId, NotificationUserName, NotificationDisplayName, NotificationEmail, NotificationCulture FROM @tmpTable ORDER BY NotificationDisplayName
GO
PRINT N'Altering [dbo].[BugNet_IssueWorkReport_GetIssueWorkReportsByIssueId]...';
GO
ALTER PROCEDURE [dbo].[BugNet_IssueWorkReport_GetIssueWorkReportsByIssueId]
@IssueId INT
AS
SELECT
IssueWorkReportId,
BugNet_IssueWorkReports.IssueId,
WorkDate,
Duration,
BugNet_IssueWorkReports.IssueCommentId,
BugNet_IssueWorkReports.UserId CreatorUserId,
U.UserName CreatorUserName,
IsNull(DisplayName,'') CreatorDisplayName,
ISNULL(BugNet_IssueComments.Comment, '') Comment
FROM
BugNet_IssueWorkReports
INNER JOIN Users U ON BugNet_IssueWorkReports.UserId = U.UserId
LEFT OUTER JOIN BugNet_UserProfiles ON U.UserName = BugNet_UserProfiles.UserName
LEFT OUTER JOIN BugNet_IssueComments ON BugNet_IssueComments.IssueCommentId = BugNet_IssueWorkReports.IssueCommentId
WHERE
BugNet_IssueWorkReports.IssueId = @IssueId
ORDER BY WorkDate DESC
GO
PRINT N'Altering [dbo].[BugNet_Project_GetMemberRolesByProjectId]...';
GO
ALTER PROCEDURE [dbo].[BugNet_Project_GetMemberRolesByProjectId]
@ProjectId Int
AS
SELECT ISNULL(UsersProfile.DisplayName, Users.UserName) as DisplayName, BugNet_Roles.RoleName
FROM
Users INNER JOIN
BugNet_UserProjects ON Users.UserId = BugNet_UserProjects.UserId INNER JOIN
BugNet_UserRoles ON Users.UserId = BugNet_UserRoles.UserId INNER JOIN
BugNet_Roles ON BugNet_UserRoles.RoleId = BugNet_Roles.RoleId LEFT OUTER JOIN
BugNet_UserProfiles AS UsersProfile ON Users.UserName = UsersProfile.UserName
WHERE
BugNet_UserProjects.ProjectId = @ProjectId
ORDER BY DisplayName, RoleName ASC
GO
PRINT N'Altering [dbo].[BugNet_ProjectMailbox_GetMailboxById]...';
GO
ALTER PROCEDURE [dbo].[BugNet_ProjectMailbox_GetMailboxById]
@ProjectMailboxId int
AS
SET NOCOUNT ON
SELECT
BugNet_ProjectMailboxes.*,
u.UserName AssignToUserName,
p.DisplayName AssignToDisplayName,
BugNet_ProjectIssueTypes.IssueTypeName
FROM
BugNet_ProjectMailBoxes
INNER JOIN Users u ON u.UserId = AssignToUserId
INNER JOIN BugNet_UserProfiles p ON u.UserName = p.UserName
INNER JOIN BugNet_ProjectIssueTypes ON BugNet_ProjectIssueTypes.IssueTypeId = BugNet_ProjectMailboxes.IssueTypeId
WHERE
BugNet_ProjectMailBoxes.ProjectMailboxId = @ProjectMailboxId
GO
PRINT N'Altering [dbo].[BugNet_ProjectMailbox_GetMailboxByProjectId]...';
GO
ALTER PROCEDURE [dbo].[BugNet_ProjectMailbox_GetMailboxByProjectId]
@ProjectId int
AS
SET NOCOUNT ON
SELECT
BugNet_ProjectMailboxes.*,
u.UserName AssignToUserName,
p.DisplayName AssignToDisplayName,
pit.IssueTypeName
FROM
BugNet_ProjectMailBoxes
INNER JOIN Users u ON u.UserId = AssignToUserId
INNER JOIN BugNet_UserProfiles p ON u.UserName = p.UserName
INNER JOIN BugNet_ProjectIssueTypes pit ON pit.IssueTypeId = BugNet_ProjectMailboxes.IssueTypeId
WHERE
BugNet_ProjectMailBoxes.ProjectId = @ProjectId
GO
PRINT N'Altering [dbo].[BugNet_ProjectMailbox_GetProjectByMailbox]...';
GO
ALTER PROCEDURE [dbo].[BugNet_ProjectMailbox_GetProjectByMailbox]
@mailbox nvarchar(100)
AS
SET NOCOUNT ON
SELECT
BugNet_ProjectMailboxes.*,
u.UserName AssignToUserName,
p.DisplayName AssignToDisplayName,
pit.IssueTypeName
FROM
BugNet_ProjectMailBoxes
INNER JOIN Users u ON u.UserId = AssignToUserId
INNER JOIN BugNet_UserProfiles p ON u.UserName = p.UserName
INNER JOIN BugNet_ProjectIssueTypes pit ON pit.IssueTypeId = BugNet_ProjectMailboxes.IssueTypeId
WHERE
BugNet_ProjectMailBoxes.MailBox = @mailbox
GO
PRINT N'Altering [dbo].[BugNet_ProjectNotification_GetProjectNotificationsByProjectId]...';
GO
ALTER PROCEDURE [dbo].[BugNet_ProjectNotification_GetProjectNotificationsByProjectId]
@ProjectId Int
AS
SELECT
ProjectNotificationId,
P.ProjectId,
ProjectName,
U.UserId NotificationUserId,
U.UserName NotificationUserName,
IsNull(DisplayName,'') NotificationDisplayName,
M.Email NotificationEmail
FROM
BugNet_ProjectNotifications
INNER JOIN Users U ON BugNet_ProjectNotifications.UserId = U.UserId
INNER JOIN Memberships M ON BugNet_ProjectNotifications.UserId = M.UserId
INNER JOIN BugNet_Projects P ON BugNet_ProjectNotifications.ProjectId = P.ProjectId
LEFT OUTER JOIN BugNet_UserProfiles ON U.UserName = BugNet_UserProfiles.UserName
WHERE
P.ProjectId = @ProjectId
ORDER BY
DisplayName
GO
PRINT N'Altering [dbo].[BugNet_ProjectNotification_GetProjectNotificationsByUserName]...';
GO
ALTER PROCEDURE [dbo].[BugNet_ProjectNotification_GetProjectNotificationsByUserName]
@UserName nvarchar(255)
AS
DECLARE @UserId UniqueIdentifier
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
SELECT
ProjectNotificationId,
P.ProjectId,
ProjectName,
U.UserId NotificationUserId,
U.UserName NotificationUserName,
IsNull(DisplayName,'') NotificationDisplayName,
M.Email NotificationEmail
FROM
BugNet_ProjectNotifications
INNER JOIN Users U ON BugNet_ProjectNotifications.UserId = U.UserId
INNER JOIN Memberships M ON BugNet_ProjectNotifications.UserId = M.UserId
INNER JOIN BugNet_Projects P ON BugNet_ProjectNotifications.ProjectId = P.ProjectId
LEFT OUTER JOIN BugNet_UserProfiles ON U.UserName = BugNet_UserProfiles.UserName
WHERE
U.UserId = @UserId
ORDER BY
DisplayName
GO
PRINT N'Altering [dbo].[BugNet_Query_GetQueriesByUserName]...';
GO
ALTER PROCEDURE [dbo].[BugNet_Query_GetQueriesByUserName]
@UserName NVarChar(255),
@ProjectId Int
AS
DECLARE @UserId UNIQUEIDENTIFIER
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
SELECT
QueryId,
QueryName + ' (' + BugNet_UserProfiles.DisplayName + ')' AS QueryName,
IsPublic
FROM
BugNet_Queries INNER JOIN
Users M ON BugNet_Queries.UserId = M.UserId JOIN
BugNet_UserProfiles ON M.UserName = BugNet_UserProfiles.UserName
WHERE
IsPublic = 1 AND ProjectId = @ProjectId
UNION
SELECT
QueryId,
QueryName,
IsPublic
FROM
BugNet_Queries
WHERE
UserId = @UserId
AND ProjectId = @ProjectId
AND IsPublic = 0
ORDER BY
QueryName
GO
PRINT N'Altering [dbo].[BugNet_User_GetUsersByProjectId]...';
GO
ALTER PROCEDURE [dbo].[BugNet_User_GetUsersByProjectId]
@ProjectId Int,
@ExcludeReadonlyUsers bit
AS
SELECT DISTINCT U.UserId, U.UserName, FirstName, LastName, DisplayName FROM
Users U
JOIN BugNet_UserProjects
ON U.UserId = BugNet_UserProjects.UserId
JOIN BugNet_UserProfiles
ON U.UserName = BugNet_UserProfiles.UserName
JOIN Memberships M
ON U.UserId = M.UserId
JOIN BugNet_UserRoles UR
ON U.UserId = UR.UserId
JOIN BugNet_Roles R
ON UR.RoleId = R.RoleId
WHERE
BugNet_UserProjects.ProjectId = @ProjectId
AND M.IsApproved = 1 AND (@ExcludeReadonlyUsers = 0 OR @ExcludeReadonlyUsers = 1 AND R.RoleName != 'Read Only')
ORDER BY DisplayName ASC
GO
PRINT N'Altering [dbo].[BugNet_Issue_GetIssuesByAssignedUserName]...';
GO
ALTER PROCEDURE [dbo].[BugNet_Issue_GetIssuesByAssignedUserName]
@ProjectId Int,
@UserName NVarChar(255)
AS
DECLARE @UserId UniqueIdentifier
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
SELECT
*
FROM
BugNet_IssuesView
WHERE
ProjectId = @ProjectId
AND Disabled = 0
AND IssueAssignedUserId = @UserId
ORDER BY
IssueId Desc
GO
PRINT N'Altering [dbo].[BugNet_Issue_GetIssuesByCreatorUserName]...';
GO
ALTER PROCEDURE [dbo].[BugNet_Issue_GetIssuesByCreatorUserName]
@ProjectId Int,
@UserName NVarChar(255)
AS
DECLARE @CreatorId UniqueIdentifier
SELECT @CreatorId = UserId FROM Users WHERE UserName = @UserName
SELECT
*
FROM
BugNet_IssuesView
WHERE
ProjectId = @ProjectId
AND Disabled = 0
AND IssueCreatorUserId = @CreatorId
ORDER BY
IssueId Desc
GO
PRINT N'Altering [dbo].[BugNet_Issue_GetIssuesByOwnerUserName]...';
GO
ALTER PROCEDURE [dbo].[BugNet_Issue_GetIssuesByOwnerUserName]
@ProjectId Int,
@UserName NVarChar(255)
AS
DECLARE @UserId UniqueIdentifier
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
SELECT
*
FROM
BugNet_IssuesView
WHERE
ProjectId = @ProjectId
AND Disabled = 0
AND IssueOwnerUserId = @UserId
ORDER BY
IssueId Desc
GO
PRINT N'Altering [dbo].[BugNet_Issue_GetIssuesByRelevancy]...';
GO
ALTER PROCEDURE [dbo].[BugNet_Issue_GetIssuesByRelevancy]
@ProjectId int,
@UserName NVarChar(255)
AS
DECLARE @UserId UniqueIdentifier
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
SELECT
*
FROM
BugNet_IssuesView
WHERE
ProjectId = @ProjectId
AND Disabled = 0
AND (IssueCreatorUserId = @UserId OR IssueAssignedUserId = @UserId OR IssueOwnerUserId = @UserId)
ORDER BY
IssueId Desc
GO
PRINT N'Altering [dbo].[BugNet_Project_GetProjectsByMemberUserName]...';
GO
ALTER PROCEDURE [dbo].[BugNet_Project_GetProjectsByMemberUserName]
@UserName nvarchar(255),
@ActiveOnly bit
AS
DECLARE @Disabled bit
SET @Disabled = 1
DECLARE @UserId UNIQUEIDENTIFIER
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
IF @ActiveOnly = 1
BEGIN
SET @Disabled = 0
END
SELECT DISTINCT
[BugNet_ProjectsView].ProjectId,
ProjectName,
ProjectCode,
ProjectDescription,
AttachmentUploadPath,
ProjectManagerUserId,
ProjectCreatorUserId,
[BugNet_ProjectsView].DateCreated,
ProjectDisabled,
ProjectAccessType,
ManagerUserName,
ManagerDisplayName,
CreatorUserName,
CreatorDisplayName,
AllowAttachments,
AllowAttachments,
AttachmentStorageType,
SvnRepositoryUrl,
AllowIssueVoting
FROM [BugNet_ProjectsView]
Left JOIN BugNet_UserProjects UP ON UP.ProjectId = [BugNet_ProjectsView].ProjectId
WHERE
(ProjectAccessType = 1 AND ProjectDisabled = @Disabled) OR
(ProjectAccessType = 2 AND ProjectDisabled = @Disabled AND (UP.UserId = @UserId or ProjectManagerUserId=@UserId ))
ORDER BY ProjectName ASC
GO
PRINT N'Altering [dbo].[BugNet_DefaultValues_Set]...';
GO
ALTER PROCEDURE [dbo].[BugNet_DefaultValues_Set]
@Type nvarchar(50),
@ProjectId Int,
@StatusId Int,
@IssueOwnerUserName NVarChar(255),
@IssuePriorityId Int,
@IssueAssignedUserName NVarChar(255),
@IssueVisibility int,
@IssueCategoryId Int,
@IssueAffectedMilestoneId Int,
@IssueDueDate int,
@IssueProgress Int,
@IssueMilestoneId Int,
@IssueEstimation decimal(5,2),
@IssueResolutionId Int,
@StatusVisibility Bit,
@OwnedByVisibility Bit,
@PriorityVisibility Bit,
@AssignedToVisibility Bit,
@PrivateVisibility Bit,
@CategoryVisibility Bit,
@DueDateVisibility Bit,
@TypeVisibility Bit,
@PercentCompleteVisibility Bit,
@MilestoneVisibility Bit,
@EstimationVisibility Bit,
@ResolutionVisibility Bit,
@AffectedMilestoneVisibility Bit,
@OwnedByNotify Bit,
@AssignedToNotify Bit
AS
DECLARE @IssueAssignedUserId UNIQUEIDENTIFIER
DECLARE @IssueOwnerUserId UNIQUEIDENTIFIER
SELECT @IssueOwnerUserId = UserId FROM Users WHERE UserName = @IssueOwnerUserName
SELECT @IssueAssignedUserId = UserId FROM Users WHERE UserName = @IssueAssignedUserName
BEGIN
BEGIN TRAN
DECLARE @defVisExists int
SELECT @defVisExists = COUNT(*)
FROM BugNet_DefaultValuesVisibility
WHERE BugNet_DefaultValuesVisibility.ProjectId = @ProjectId
IF(@defVisExists>0)
BEGIN
UPDATE BugNet_DefaultValuesVisibility
SET
StatusVisibility = @StatusVisibility,
OwnedByVisibility = @OwnedByVisibility,
PriorityVisibility = @PriorityVisibility,
AssignedToVisibility = @AssignedToVisibility,
PrivateVisibility= @PrivateVisibility,
CategoryVisibility= @CategoryVisibility,
DueDateVisibility= @DueDateVisibility,
TypeVisibility = @TypeVisibility,
PercentCompleteVisibility = @PercentCompleteVisibility,
MilestoneVisibility = @MilestoneVisibility,
EstimationVisibility = @EstimationVisibility,
ResolutionVisibility = @ResolutionVisibility,
AffectedMilestoneVisibility = @AffectedMilestoneVisibility
WHERE ProjectId = @ProjectId
END
ELSE
BEGIN
INSERT INTO BugNet_DefaultValuesVisibility
VALUES
(
@ProjectId ,
@StatusVisibility ,
@OwnedByVisibility ,
@PriorityVisibility ,
@AssignedToVisibility ,
@PrivateVisibility ,
@CategoryVisibility ,
@DueDateVisibility ,
@TypeVisibility ,
@PercentCompleteVisibility,
@MilestoneVisibility ,
@EstimationVisibility ,
@ResolutionVisibility ,
@AffectedMilestoneVisibility
)
END
DECLARE @defExists int
SELECT @defExists = COUNT(*)
FROM BugNet_DefaultValues
WHERE BugNet_DefaultValues.ProjectId = @ProjectId
IF (@defExists > 0)
BEGIN
UPDATE BugNet_DefaultValues
SET DefaultType = @Type,
StatusId = @StatusId,
IssueOwnerUserId = @IssueOwnerUserId,
IssuePriorityId = @IssuePriorityId,
IssueAffectedMilestoneId = @IssueAffectedMilestoneId,
IssueAssignedUserId = @IssueAssignedUserId,
IssueVisibility = @IssueVisibility,
IssueCategoryId = @IssueCategoryId,
IssueDueDate = @IssueDueDate,
IssueProgress = @IssueProgress,
IssueMilestoneId = @IssueMilestoneId,
IssueEstimation = @IssueEstimation,
IssueResolutionId = @IssueResolutionId,
OwnedByNotify = @OwnedByNotify,
AssignedToNotify = @AssignedToNotify
WHERE ProjectId = @ProjectId
END
ELSE
BEGIN
INSERT INTO BugNet_DefaultValues
VALUES (
@ProjectId,
@Type,
@StatusId,
@IssueOwnerUserId,
@IssuePriorityId,
@IssueAffectedMilestoneId,
@IssueAssignedUserId,
@IssueVisibility,
@IssueCategoryId,
@IssueDueDate,
@IssueProgress,
@IssueMilestoneId,
@IssueEstimation,
@IssueResolutionId,
@OwnedByNotify,
@AssignedToNotify
)
END
COMMIT TRAN
END
GO
PRINT N'Altering [dbo].[BugNet_GetProjectSelectedColumnsWithUserIdAndProjectId]...';
GO
ALTER PROCEDURE [dbo].[BugNet_GetProjectSelectedColumnsWithUserIdAndProjectId]
@UserName nvarchar(255),
@ProjectId int,
@ReturnValue nvarchar(255) OUT
AS
DECLARE
@UserId UNIQUEIDENTIFIER
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SET @ReturnValue = (SELECT [SelectedIssueColumns] FROM BugNet_UserProjects WHERE UserId = @UserId AND ProjectId = @ProjectId);
END
GO
PRINT N'Altering [dbo].[BugNet_Issue_CreateNewIssue]...';
GO
ALTER PROCEDURE [dbo].[BugNet_Issue_CreateNewIssue]
@IssueTitle nvarchar(500),
@IssueDescription nvarchar(max),
@ProjectId Int,
@IssueCategoryId Int,
@IssueStatusId Int,
@IssuePriorityId Int,
@IssueMilestoneId Int,
@IssueAffectedMilestoneId Int,
@IssueTypeId Int,
@IssueResolutionId Int,
@IssueAssignedUserName NVarChar(255),
@IssueCreatorUserName NVarChar(255),
@IssueOwnerUserName NVarChar(255),
@IssueDueDate datetime,
@IssueVisibility int,
@IssueEstimation decimal(5,2),
@IssueProgress int
AS
DECLARE @IssueAssignedUserId UNIQUEIDENTIFIER
DECLARE @IssueCreatorUserId UNIQUEIDENTIFIER
DECLARE @IssueOwnerUserId UNIQUEIDENTIFIER
SELECT @IssueAssignedUserId = UserId FROM Users WHERE UserName = @IssueAssignedUserName
SELECT @IssueCreatorUserId = UserId FROM Users WHERE UserName = @IssueCreatorUserName
SELECT @IssueOwnerUserId = UserId FROM Users WHERE UserName = @IssueOwnerUserName
INSERT BugNet_Issues
(
IssueTitle,
IssueDescription,
IssueCreatorUserId,
DateCreated,
IssueStatusId,
IssuePriorityId,
IssueTypeId,
IssueCategoryId,
IssueAssignedUserId,
ProjectId,
IssueResolutionId,
IssueMilestoneId,
IssueAffectedMilestoneId,
LastUpdateUserId,
LastUpdate,
IssueDueDate,
IssueVisibility,
IssueEstimation,
IssueProgress,
IssueOwnerUserId
)
VALUES
(
@IssueTitle,
@IssueDescription,
@IssueCreatorUserId,
GetDate(),
@IssueStatusId,
@IssuePriorityId,
@IssueTypeId,
@IssueCategoryId,
@IssueAssignedUserId,
@ProjectId,
@IssueResolutionId,
@IssueMilestoneId,
@IssueAffectedMilestoneId,
@IssueCreatorUserId,
GetDate(),
@IssueDueDate,
@IssueVisibility,
@IssueEstimation,
@IssueProgress,
@IssueOwnerUserId
)
RETURN scope_identity()
GO
PRINT N'Altering [dbo].[BugNet_Issue_UpdateIssue]...';
GO
ALTER PROCEDURE [dbo].[BugNet_Issue_UpdateIssue]
@IssueId Int,
@IssueTitle nvarchar(500),
@IssueDescription nvarchar(max),
@ProjectId Int,
@IssueCategoryId Int,
@IssueStatusId Int,
@IssuePriorityId Int,
@IssueMilestoneId Int,
@IssueAffectedMilestoneId Int,
@IssueTypeId Int,
@IssueResolutionId Int,
@IssueAssignedUserName NVarChar(255),
@IssueCreatorUserName NVarChar(255),
@IssueOwnerUserName NVarChar(255),
@LastUpdateUserName NVarChar(255),
@IssueDueDate datetime,
@IssueVisibility int,
@IssueEstimation decimal(5,2),
@IssueProgress int
AS
DECLARE @IssueAssignedUserId UNIQUEIDENTIFIER
DECLARE @IssueCreatorUserId UNIQUEIDENTIFIER
DECLARE @IssueOwnerUserId UNIQUEIDENTIFIER
DECLARE @LastUpdateUserId UNIQUEIDENTIFIER
SELECT @IssueAssignedUserId = UserId FROM Users WHERE UserName = @IssueAssignedUserName
SELECT @IssueCreatorUserId = UserId FROM Users WHERE UserName = @IssueCreatorUserName
SELECT @IssueOwnerUserId = UserId FROM Users WHERE UserName = @IssueOwnerUserName
SELECT @LastUpdateUserId = UserId FROM Users WHERE UserName = @LastUpdateUserName
BEGIN TRAN
UPDATE BugNet_Issues SET
IssueTitle = @IssueTitle,
IssueCategoryId = @IssueCategoryId,
ProjectId = @ProjectId,
IssueStatusId = @IssueStatusId,
IssuePriorityId = @IssuePriorityId,
IssueMilestoneId = @IssueMilestoneId,
IssueAffectedMilestoneId = @IssueAffectedMilestoneId,
IssueAssignedUserId = @IssueAssignedUserId,
IssueOwnerUserId = @IssueOwnerUserId,
IssueTypeId = @IssueTypeId,
IssueResolutionId = @IssueResolutionId,
IssueDueDate = @IssueDueDate,
IssueVisibility = @IssueVisibility,
IssueEstimation = @IssueEstimation,
IssueProgress = @IssueProgress,
IssueDescription = @IssueDescription,
LastUpdateUserId = @LastUpdateUserId,
LastUpdate = GetDate()
WHERE
IssueId = @IssueId
/*EXEC BugNet_IssueHistory_CreateNewHistory @IssueId, @IssueCreatorId*/
COMMIT TRAN
GO
PRINT N'Altering [dbo].[BugNet_Issue_UpdateLastUpdated]...';
GO
ALTER PROCEDURE [dbo].[BugNet_Issue_UpdateLastUpdated]
@IssueId Int,
@LastUpdateUserName NVARCHAR(255)
AS
SET NOCOUNT ON
DECLARE @LastUpdateUserId UNIQUEIDENTIFIER
SELECT @LastUpdateUserId = UserId FROM Users WHERE UserName = @LastUpdateUserName
BEGIN TRAN
UPDATE BugNet_Issues SET
LastUpdateUserId = @LastUpdateUserId,
LastUpdate = GetDate()
WHERE
IssueId = @IssueId
COMMIT TRAN
GO
PRINT N'Altering [dbo].[BugNet_IssueAttachment_CreateNewIssueAttachment]...';
GO
ALTER PROCEDURE [dbo].[BugNet_IssueAttachment_CreateNewIssueAttachment]
@IssueId int,
@FileName nvarchar(100),
@FileSize Int,
@ContentType nvarchar(50),
@CreatorUserName nvarchar(255),
@Description nvarchar(80),
@Attachment Image
AS
-- Get Uploaded UserID
DECLARE @UserId UniqueIdentifier
SELECT @UserId = UserId FROM Users WHERE UserName = @CreatorUserName
INSERT BugNet_IssueAttachments
(
IssueId,
FileName,
Description,
FileSize,
ContentType,
DateCreated,
UserId,
Attachment
)
VALUES
(
@IssueId,
@FileName,
@Description,
@FileSize,
@ContentType,
GetDate(),
@UserId,
@Attachment
)
RETURN scope_identity()
GO
PRINT N'Altering [dbo].[BugNet_IssueComment_CreateNewIssueComment]...';
GO
ALTER PROCEDURE [dbo].[BugNet_IssueComment_CreateNewIssueComment]
@IssueId int,
@CreatorUserName NVarChar(255),
@Comment ntext
AS
-- Get Last Update UserID
DECLARE @UserId uniqueidentifier
SELECT @UserId = UserId FROM Users WHERE UserName = @CreatorUserName
INSERT BugNet_IssueComments
(
IssueId,
UserId,
DateCreated,
Comment
)
VALUES
(
@IssueId,
@UserId,
GetDate(),
@Comment
)
/* Update the LastUpdate fields of this bug*/
UPDATE BugNet_Issues SET LastUpdate = GetDate(),LastUpdateUserId = @UserId WHERE IssueId = @IssueId
RETURN scope_identity()
GO
PRINT N'Altering [dbo].[BugNet_IssueComment_UpdateIssueComment]...';
GO
ALTER PROCEDURE [dbo].[BugNet_IssueComment_UpdateIssueComment]
@IssueCommentId int,
@IssueId int,
@CreatorUserName nvarchar(255),
@Comment ntext
AS
DECLARE @UserId uniqueidentifier
SELECT @UserId = UserId FROM Users WHERE UserName = @CreatorUserName
UPDATE BugNet_IssueComments SET
IssueId = @IssueId,
UserId = @UserId,
Comment = @Comment
WHERE IssueCommentId= @IssueCommentId
GO
PRINT N'Altering [dbo].[BugNet_IssueHistory_CreateNewIssueHistory]...';
GO
ALTER PROCEDURE [dbo].[BugNet_IssueHistory_CreateNewIssueHistory]
@IssueId int,
@CreatedUserName nvarchar(255),
@FieldChanged nvarchar(50),
@OldValue nvarchar(50),
@NewValue nvarchar(50)
AS
DECLARE @UserId UniqueIdentifier
SELECT @UserId = UserId FROM Users WHERE UserName = @CreatedUserName
INSERT BugNet_IssueHistory
(
IssueId,
UserId,
FieldChanged,
OldValue,
NewValue,
DateCreated
)
VALUES
(
@IssueId,
@UserId,
@FieldChanged,
@OldValue,
@NewValue,
GetDate()
)
RETURN scope_identity()
GO
PRINT N'Altering [dbo].[BugNet_IssueNotification_CreateNewIssueNotification]...';
GO
ALTER PROCEDURE [dbo].[BugNet_IssueNotification_CreateNewIssueNotification]
@IssueId Int,
@NotificationUserName NVarChar(255)
AS
DECLARE @UserId UniqueIdentifier
SELECT @UserId = UserId FROM Users WHERE UserName = @NotificationUserName
IF (NOT EXISTS(SELECT IssueNotificationId FROM BugNet_IssueNotifications WHERE UserId = @UserId AND IssueId = @IssueId) AND @UserId IS NOT NULL)
BEGIN
INSERT BugNet_IssueNotifications
(
IssueId,
UserId
)
VALUES
(
@IssueId,
@UserId
)
RETURN scope_identity()
END
GO
PRINT N'Altering [dbo].[BugNet_IssueNotification_DeleteIssueNotification]...';
GO
ALTER PROCEDURE [dbo].[BugNet_IssueNotification_DeleteIssueNotification]
@IssueId Int,
@UserName NVarChar(255)
AS
DECLARE @UserId uniqueidentifier
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
DELETE
BugNet_IssueNotifications
WHERE
IssueId = @IssueId
AND UserId = @UserId
GO
PRINT N'Altering [dbo].[BugNet_IssueVote_CreateNewIssueVote]...';
GO
ALTER PROCEDURE [dbo].[BugNet_IssueVote_CreateNewIssueVote]
@IssueId Int,
@VoteUserName NVarChar(255)
AS
DECLARE @UserId UniqueIdentifier
SELECT @UserId = UserId FROM Users WHERE UserName = @VoteUserName
IF NOT EXISTS( SELECT IssueVoteId FROM BugNet_IssueVotes WHERE UserId = @UserId AND IssueId = @IssueId)
BEGIN
INSERT BugNet_IssueVotes
(
IssueId,
UserId,
DateCreated
)
VALUES
(
@IssueId,
@UserId,
GETDATE()
)
RETURN scope_identity()
END
GO
PRINT N'Altering [dbo].[BugNet_IssueVote_HasUserVoted]...';
GO
ALTER PROCEDURE [dbo].[BugNet_IssueVote_HasUserVoted]
@IssueId Int,
@VoteUserName NVarChar(255)
AS
DECLARE @UserId UniqueIdentifier
SELECT @UserId = UserId FROM Users WHERE UserName = @VoteUserName
BEGIN
IF EXISTS(SELECT IssueVoteId FROM BugNet_IssueVotes WHERE UserId = @UserId AND IssueId = @IssueId)
RETURN(1)
ELSE
RETURN(0)
END
GO
PRINT N'Altering [dbo].[BugNet_IssueWorkReport_CreateNewIssueWorkReport]...';
GO
ALTER PROCEDURE [dbo].[BugNet_IssueWorkReport_CreateNewIssueWorkReport]
@IssueId int,
@CreatorUserName nvarchar(255),
@WorkDate datetime ,
@Duration decimal(4,2),
@IssueCommentId int
AS
-- Get Last Update UserID
DECLARE @CreatorUserId uniqueidentifier
SELECT @CreatorUserId = UserId FROM Users WHERE UserName = @CreatorUserName
INSERT BugNet_IssueWorkReports
(
IssueId,
UserId,
WorkDate,
Duration,
IssueCommentId
)
VALUES
(
@IssueId,
@CreatorUserId,
@WorkDate,
@Duration,
@IssueCommentId
)
RETURN scope_identity()
GO
PRINT N'Altering [dbo].[BugNet_Project_AddUserToProject]...';
GO
ALTER PROCEDURE [dbo].[BugNet_Project_AddUserToProject]
@UserName nvarchar(255),
@ProjectId int
AS
DECLARE @UserId UNIQUEIDENTIFIER
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
IF NOT EXISTS (SELECT UserId FROM BugNet_UserProjects WHERE UserId = @UserId AND ProjectId = @ProjectId)
BEGIN
INSERT BugNet_UserProjects
(
UserId,
ProjectId,
DateCreated
)
VALUES
(
@UserId,
@ProjectId,
getdate()
)
END
GO
PRINT N'Altering [dbo].[BugNet_Role_AddUserToRole]...';
GO
ALTER PROCEDURE [dbo].[BugNet_Role_AddUserToRole]
@UserName nvarchar(256),
@RoleId int
AS
DECLARE @ProjectId int
DECLARE @UserId UNIQUEIDENTIFIER
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
SELECT @ProjectId = ProjectId FROM BugNet_Roles WHERE RoleId = @RoleId
IF NOT EXISTS (SELECT UserId FROM BugNet_UserProjects WHERE UserId = @UserId AND ProjectId = @ProjectId) AND @RoleId <> 1
BEGIN
EXEC BugNet_Project_AddUserToProject @UserName, @ProjectId
END
IF NOT EXISTS (SELECT UserId FROM BugNet_UserRoles WHERE UserId = @UserId AND RoleId = @RoleId)
BEGIN
INSERT BugNet_UserRoles
(
UserId,
RoleId
)
VALUES
(
@UserId,
@RoleId
)
END
GO
PRINT N'Altering [dbo].[BugNet_Project_CreateNewProject]...';
GO
ALTER PROCEDURE [dbo].[BugNet_Project_CreateNewProject]
@ProjectName nvarchar(50),
@ProjectCode nvarchar(50),
@ProjectDescription nvarchar(1000),
@ProjectManagerUserName nvarchar(255),
@AttachmentUploadPath nvarchar(80),
@ProjectAccessType int,
@ProjectCreatorUserName nvarchar(255),
@AllowAttachments int,
@AttachmentStorageType int,
@SvnRepositoryUrl nvarchar(255),
@AllowIssueVoting bit,
@ProjectImageFileContent varbinary(max),
@ProjectImageFileName nvarchar(150),
@ProjectImageContentType nvarchar(50),
@ProjectImageFileSize bigint
AS
IF NOT EXISTS( SELECT ProjectId,ProjectCode FROM BugNet_Projects WHERE LOWER(ProjectName) = LOWER(@ProjectName) OR LOWER(ProjectCode) = LOWER(@ProjectCode) )
BEGIN
DECLARE @ProjectManagerUserId UNIQUEIDENTIFIER
DECLARE @ProjectCreatorUserId UNIQUEIDENTIFIER
SELECT @ProjectManagerUserId = UserId FROM Users WHERE UserName = @ProjectManagerUserName
SELECT @ProjectCreatorUserId = UserId FROM Users WHERE UserName = @ProjectCreatorUserName
INSERT BugNet_Projects
(
ProjectName,
ProjectCode,
ProjectDescription,
AttachmentUploadPath,
ProjectManagerUserId,
DateCreated,
ProjectCreatorUserId,
ProjectAccessType,
AllowAttachments,
AttachmentStorageType,
SvnRepositoryUrl,
AllowIssueVoting,
ProjectImageFileContent,
ProjectImageFileName,
ProjectImageContentType,
ProjectImageFileSize
)
VALUES
(
@ProjectName,
@ProjectCode,
@ProjectDescription,
@AttachmentUploadPath,
@ProjectManagerUserId ,
GetDate(),
@ProjectCreatorUserId,
@ProjectAccessType,
@AllowAttachments,
@AttachmentStorageType,
@SvnRepositoryUrl,
@AllowIssueVoting,
@ProjectImageFileContent,
@ProjectImageFileName,
@ProjectImageContentType,
@ProjectImageFileSize
)
RETURN scope_identity()
END
ELSE
RETURN 0
GO
PRINT N'Altering [dbo].[BugNet_Project_GetProjectMembers]...';
GO
ALTER PROCEDURE [dbo].[BugNet_Project_GetProjectMembers]
@ProjectId Int
AS
SELECT UserName
FROM
Users
LEFT OUTER JOIN
BugNet_UserProjects
ON
Users.UserId = BugNet_UserProjects.UserId
WHERE
BugNet_UserProjects.ProjectId = @ProjectId
ORDER BY UserName ASC
GO
PRINT N'Altering [dbo].[BugNet_Project_IsUserProjectMember]...';
GO
ALTER PROCEDURE [dbo].[BugNet_Project_IsUserProjectMember]
@UserName nvarchar(255),
@ProjectId int
AS
DECLARE @UserId UNIQUEIDENTIFIER
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
IF EXISTS( SELECT UserId FROM BugNet_UserProjects WHERE UserId = @UserId AND ProjectId = @ProjectId)
RETURN 0
ELSE
RETURN -1
GO
PRINT N'Altering [dbo].[BugNet_Project_RemoveUserFromProject]...';
GO
ALTER PROCEDURE [dbo].[BugNet_Project_RemoveUserFromProject]
@UserName nvarchar(255),
@ProjectId Int
AS
DECLARE @UserId UNIQUEIDENTIFIER
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
DELETE
BugNet_UserProjects
WHERE
UserId = @UserId AND ProjectId = @ProjectId
GO
PRINT N'Altering [dbo].[BugNet_Project_UpdateProject]...';
GO
ALTER PROCEDURE [dbo].[BugNet_Project_UpdateProject]
@ProjectId int,
@ProjectName nvarchar(50),
@ProjectCode nvarchar(50),
@ProjectDescription nvarchar(1000),
@ProjectManagerUserName nvarchar(255),
@AttachmentUploadPath nvarchar(80),
@ProjectAccessType int,
@ProjectDisabled int,
@AllowAttachments bit,
@AttachmentStorageType int,
@SvnRepositoryUrl nvarchar(255),
@AllowIssueVoting bit,
@ProjectImageFileContent varbinary(max),
@ProjectImageFileName nvarchar(150),
@ProjectImageContentType nvarchar(50),
@ProjectImageFileSize bigint
AS
DECLARE @ProjectManagerUserId UNIQUEIDENTIFIER
SELECT @ProjectManagerUserId = UserId FROM Users WHERE UserName = @ProjectManagerUserName
IF @ProjectImageFileContent IS NULL
UPDATE BugNet_Projects SET
ProjectName = @ProjectName,
ProjectCode = @ProjectCode,
ProjectDescription = @ProjectDescription,
ProjectManagerUserId = @ProjectManagerUserId,
AttachmentUploadPath = @AttachmentUploadPath,
ProjectAccessType = @ProjectAccessType,
ProjectDisabled = @ProjectDisabled,
AllowAttachments = @AllowAttachments,
AttachmentStorageType = @AttachmentStorageType,
SvnRepositoryUrl = @SvnRepositoryUrl,
AllowIssueVoting = @AllowIssueVoting
WHERE
ProjectId = @ProjectId
ELSE
UPDATE BugNet_Projects SET
ProjectName = @ProjectName,
ProjectCode = @ProjectCode,
ProjectDescription = @ProjectDescription,
ProjectManagerUserId = @ProjectManagerUserId,
AttachmentUploadPath = @AttachmentUploadPath,
ProjectAccessType = @ProjectAccessType,
ProjectDisabled = @ProjectDisabled,
AllowAttachments = @AllowAttachments,
AttachmentStorageType = @AttachmentStorageType,
SvnRepositoryUrl = @SvnRepositoryUrl,
ProjectImageFileContent = @ProjectImageFileContent,
ProjectImageFileName = @ProjectImageFileName,
ProjectImageContentType = @ProjectImageContentType,
ProjectImageFileSize = @ProjectImageFileSize,
AllowIssueVoting = @AllowIssueVoting
WHERE
ProjectId = @ProjectId
GO
PRINT N'Altering [dbo].[BugNet_ProjectMailbox_CreateProjectMailbox]...';
GO
ALTER PROCEDURE [dbo].[BugNet_ProjectMailbox_CreateProjectMailbox]
@MailBox nvarchar (100),
@ProjectId int,
@AssignToUserName nvarchar(255),
@IssueTypeId int
AS
DECLARE @AssignToUserId UNIQUEIDENTIFIER
SELECT @AssignToUserId = UserId FROM Users WHERE UserName = @AssignToUserName
INSERT BugNet_ProjectMailBoxes
(
MailBox,
ProjectId,
AssignToUserId,
IssueTypeId
)
VALUES
(
@MailBox,
@ProjectId,
@AssignToUserId,
@IssueTypeId
)
RETURN scope_identity()
GO
PRINT N'Altering [dbo].[BugNet_ProjectMailbox_UpdateProjectMailbox]...';
GO
ALTER PROCEDURE [dbo].[BugNet_ProjectMailbox_UpdateProjectMailbox]
@ProjectMailboxId int,
@MailBoxEmailAddress nvarchar (100),
@ProjectId int,
@AssignToUserName nvarchar(255),
@IssueTypeId int
AS
DECLARE @AssignToUserId UNIQUEIDENTIFIER
SELECT @AssignToUserId = UserId FROM Users WHERE UserName = @AssignToUserName
UPDATE BugNet_ProjectMailBoxes SET
MailBox = @MailBoxEmailAddress,
ProjectId = @ProjectId,
AssignToUserId = @AssignToUserId,
IssueTypeId = @IssueTypeId
WHERE ProjectMailboxId = @ProjectMailboxId
GO
PRINT N'Altering [dbo].[BugNet_ProjectNotification_CreateNewProjectNotification]...';
GO
ALTER PROCEDURE [dbo].[BugNet_ProjectNotification_CreateNewProjectNotification]
@ProjectId Int,
@NotificationUserName NVarChar(255)
AS
DECLARE @UserId UniqueIdentifier
SELECT @UserId = UserId FROM Users WHERE UserName = @NotificationUserName
IF NOT EXISTS( SELECT ProjectNotificationId FROM BugNet_ProjectNotifications WHERE UserId = @UserId AND ProjectId = @ProjectId)
BEGIN
INSERT BugNet_ProjectNotifications
(
ProjectId,
UserId
)
VALUES
(
@ProjectId,
@UserId
)
RETURN scope_identity()
END
GO
PRINT N'Altering [dbo].[BugNet_ProjectNotification_DeleteProjectNotification]...';
GO
ALTER PROCEDURE [dbo].[BugNet_ProjectNotification_DeleteProjectNotification]
@ProjectId Int,
@UserName NVarChar(255)
AS
DECLARE @UserId uniqueidentifier
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
DELETE
BugNet_ProjectNotifications
WHERE
ProjectId = @ProjectId
AND UserId = @UserId
GO
PRINT N'Altering [dbo].[BugNet_Query_SaveQuery]...';
GO
ALTER PROCEDURE [dbo].[BugNet_Query_SaveQuery]
@UserName NVarChar(255),
@ProjectId Int,
@QueryName NVarChar(50),
@IsPublic bit
AS
-- Get UserID
DECLARE @UserId UNIQUEIDENTIFIER
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
IF EXISTS(SELECT QueryName FROM BugNet_Queries WHERE QueryName = @QueryName AND UserId = @UserId AND ProjectId = @ProjectId)
BEGIN
RETURN 0
END
INSERT BugNet_Queries
(
UserId,
ProjectId,
QueryName,
IsPublic
)
VALUES
(
@UserId,
@ProjectId,
@QueryName,
@IsPublic
)
RETURN scope_identity()
GO
PRINT N'Altering [dbo].[BugNet_Query_UpdateQuery]...';
GO
ALTER PROCEDURE [dbo].[BugNet_Query_UpdateQuery]
@QueryId Int,
@UserName NVarChar(255),
@ProjectId Int,
@QueryName NVarChar(50),
@IsPublic bit
AS
-- Get UserID
DECLARE @UserId UNIQUEIDENTIFIER
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
UPDATE
BugNet_Queries
SET
UserId = @UserId,
ProjectId = @ProjectId,
QueryName = @QueryName,
IsPublic = @IsPublic
WHERE
QueryId = @QueryId
DELETE FROM BugNet_QueryClauses WHERE QueryId = @QueryId
GO
PRINT N'Altering [dbo].[BugNet_Role_GetProjectRolesByUser]...';
GO
ALTER procedure [dbo].[BugNet_Role_GetProjectRolesByUser]
@UserName nvarchar(256),
@ProjectId int
AS
DECLARE @UserId UNIQUEIDENTIFIER
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
SELECT R.RoleName,
R.ProjectId,
R.RoleDescription,
R.RoleId,
R.AutoAssign
FROM BugNet_UserRoles
INNER JOIN Users ON BugNet_UserRoles.UserId = Users.UserId
INNER JOIN BugNet_Roles R ON BugNet_UserRoles.RoleId = R.RoleId
WHERE Users.UserId = @UserId
AND (R.ProjectId IS NULL OR R.ProjectId = @ProjectId)
GO
PRINT N'Altering [dbo].[BugNet_Role_GetRolesByUser]...';
GO
ALTER procedure [dbo].[BugNet_Role_GetRolesByUser]
@UserName nvarchar(256)
AS
DECLARE @UserId UNIQUEIDENTIFIER
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
SELECT BugNet_Roles.RoleName,
BugNet_Roles.ProjectId,
BugNet_Roles.RoleDescription,
BugNet_Roles.RoleId,
BugNet_Roles.AutoAssign
FROM BugNet_UserRoles
INNER JOIN Users ON BugNet_UserRoles.UserId = Users.UserId
INNER JOIN BugNet_Roles ON BugNet_UserRoles.RoleId = BugNet_Roles.RoleId
WHERE Users.UserId = @UserId
GO
PRINT N'Altering [dbo].[BugNet_Role_IsUserInRole]...';
GO
ALTER procedure [dbo].[BugNet_Role_IsUserInRole]
@UserName nvarchar(256),
@RoleId int,
@ProjectId int
AS
DECLARE @UserId UNIQUEIDENTIFIER
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
SELECT UR.UserId,
UR.RoleId
FROM BugNet_UserRoles UR
INNER JOIN BugNet_Roles R ON UR.RoleId = R.RoleId
WHERE UR.UserId = @UserId
AND UR.RoleId = @RoleId
AND R.ProjectId = @ProjectId
GO
PRINT N'Altering [dbo].[BugNet_Role_RemoveUserFromRole]...';
GO
ALTER PROCEDURE [dbo].[BugNet_Role_RemoveUserFromRole]
@UserName nvarchar(256),
@RoleId Int
AS
DECLARE @UserId UNIQUEIDENTIFIER
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
DELETE BugNet_UserRoles WHERE UserId = @UserId AND RoleId = @RoleId
GO
PRINT N'Altering [dbo].[BugNet_SetProjectSelectedColumnsWithUserIdAndProjectId]...';
GO
ALTER PROCEDURE [dbo].[BugNet_SetProjectSelectedColumnsWithUserIdAndProjectId]
@UserName nvarchar(255),
@ProjectId int,
@Columns nvarchar(255)
AS
DECLARE
@UserId UNIQUEIDENTIFIER
SELECT @UserId = UserId FROM Users WHERE UserName = @UserName
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
UPDATE BugNet_UserProjects
SET [SelectedIssueColumns] = @Columns
WHERE UserId = @UserId AND ProjectId = @ProjectId;
END
GO
PRINT N'Altering [dbo].[BugNet_User_GetUserIdByUserName]...';
GO
ALTER PROCEDURE [dbo].[BugNet_User_GetUserIdByUserName]
@UserName NVARCHAR(75),
@UserId UNIQUEIDENTIFIER OUTPUT
AS
SET NOCOUNT ON
SELECT @UserId = UserId
FROM Users
WHERE UserName = @UserName
GO
PRINT N'Refreshing [dbo].[BugNet_User_GetUserNameByPasswordResetToken]...';
GO
EXECUTE sp_refreshsqlmodule N'[dbo].[BugNet_User_GetUserNameByPasswordResetToken]';
GO
PRINT N'Refreshing [dbo].[BugNet_DefaultValues_GetByProjectId]...';
GO
EXECUTE sp_refreshsqlmodule N'[dbo].[BugNet_DefaultValues_GetByProjectId]';
GO
PRINT N'Refreshing [dbo].[BugNet_Issue_GetIssueById]...';
GO
EXECUTE sp_refreshsqlmodule N'[dbo].[BugNet_Issue_GetIssueById]';
GO
PRINT N'Refreshing [dbo].[BugNet_Issue_GetIssueCategoryCountByProject]...';
GO
EXECUTE sp_refreshsqlmodule N'[dbo].[BugNet_Issue_GetIssueCategoryCountByProject]';
GO
PRINT N'Refreshing [dbo].[BugNet_Issue_GetIssuesByProjectId]...';
GO
EXECUTE sp_refreshsqlmodule N'[dbo].[BugNet_Issue_GetIssuesByProjectId]';
GO
PRINT N'Refreshing [dbo].[BugNet_Issue_GetOpenIssues]...';
GO
EXECUTE sp_refreshsqlmodule N'[dbo].[BugNet_Issue_GetOpenIssues]';
GO
PRINT N'Refreshing [dbo].[BugNet_Project_GetRoadMapProgress]...';
GO
EXECUTE sp_refreshsqlmodule N'[dbo].[BugNet_Project_GetRoadMapProgress]';
GO
PRINT N'Refreshing [dbo].[BugNet_ProjectCategories_GetCategoriesByProjectId]...';
GO
EXECUTE sp_refreshsqlmodule N'[dbo].[BugNet_ProjectCategories_GetCategoriesByProjectId]';
GO
PRINT N'Refreshing [dbo].[BugNet_ProjectCategories_GetCategoryById]...';
GO
EXECUTE sp_refreshsqlmodule N'[dbo].[BugNet_ProjectCategories_GetCategoryById]';
GO
PRINT N'Refreshing [dbo].[BugNet_ProjectCategories_GetChildCategoriesByCategoryId]...';
GO
EXECUTE sp_refreshsqlmodule N'[dbo].[BugNet_ProjectCategories_GetChildCategoriesByCategoryId]';
GO
PRINT N'Refreshing [dbo].[BugNet_ProjectCategories_GetRootCategoriesByProjectId]...';
GO
EXECUTE sp_refreshsqlmodule N'[dbo].[BugNet_ProjectCategories_GetRootCategoriesByProjectId]';
GO
PRINT N'Refreshing [dbo].[BugNet_Project_GetAllProjects]...';
GO
EXECUTE sp_refreshsqlmodule N'[dbo].[BugNet_Project_GetAllProjects]';
GO
PRINT N'Refreshing [dbo].[BugNet_Project_GetProjectByCode]...';
GO
EXECUTE sp_refreshsqlmodule N'[dbo].[BugNet_Project_GetProjectByCode]';
GO
PRINT N'Refreshing [dbo].[BugNet_Project_GetProjectById]...';
GO
EXECUTE sp_refreshsqlmodule N'[dbo].[BugNet_Project_GetProjectById]';
GO
PRINT N'Refreshing [dbo].[BugNet_Project_GetPublicProjects]...';
GO
EXECUTE sp_refreshsqlmodule N'[dbo].[BugNet_Project_GetPublicProjects]';
GO
PRINT N'Refreshing [dbo].[BugNet_Issue_GetIssueTypeCountByProject]...';
GO
EXECUTE sp_refreshsqlmodule N'[dbo].[BugNet_Issue_GetIssueTypeCountByProject]';
GO
PRINT N'Refreshing [dbo].[BugNet_Issue_GetIssueUserCountByProject]...';
GO
EXECUTE sp_refreshsqlmodule N'[dbo].[BugNet_Issue_GetIssueUserCountByProject]';
GO
PRINT N'Refreshing [dbo].[BugNet_Issue_GetIssueMilestoneCountByProject]...';
GO
EXECUTE sp_refreshsqlmodule N'[dbo].[BugNet_Issue_GetIssueMilestoneCountByProject]';
GO
PRINT N'Refreshing [dbo].[BugNet_Issue_GetIssuePriorityCountByProject]...';
GO
EXECUTE sp_refreshsqlmodule N'[dbo].[BugNet_Issue_GetIssuePriorityCountByProject]';
GO
PRINT N'Refreshing [dbo].[BugNet_Issue_GetIssueStatusCountByProject]...';
GO
EXECUTE sp_refreshsqlmodule N'[dbo].[BugNet_Issue_GetIssueStatusCountByProject]';
GO
PRINT N'Refreshing [dbo].[BugNet_Project_CloneProject]...';
GO
EXECUTE sp_refreshsqlmodule N'[dbo].[BugNet_Project_CloneProject]';
GO
PRINT N'Refreshing [dbo].[BugNet_Issue_GetMonitoredIssuesByUserName]...';
GO
EXECUTE sp_refreshsqlmodule N'[dbo].[BugNet_Issue_GetMonitoredIssuesByUserName]';
GO
PRINT N'Refreshing [dbo].[BugNet_IssueAttachment_ValidateDownload]...';
GO
EXECUTE sp_refreshsqlmodule N'[dbo].[BugNet_IssueAttachment_ValidateDownload]';
GO
PRINT N'Checking existing data against newly created constraints';
GO
ALTER TABLE [dbo].[BugNet_DefaultValues] WITH CHECK CHECK CONSTRAINT [FK_BugNet_DefaultValues_Users];
ALTER TABLE [dbo].[BugNet_DefaultValues] WITH CHECK CHECK CONSTRAINT [FK_BugNet_DefaultValues_Users1];
ALTER TABLE [dbo].[BugNet_IssueAttachments] WITH CHECK CHECK CONSTRAINT [FK_BugNet_IssueAttachments_Users];
ALTER TABLE [dbo].[BugNet_IssueComments] WITH CHECK CHECK CONSTRAINT [FK_BugNet_IssueComments_Users];
ALTER TABLE [dbo].[BugNet_IssueHistory] WITH CHECK CHECK CONSTRAINT [FK_BugNet_IssueHistory_Users];
ALTER TABLE [dbo].[BugNet_IssueNotifications] WITH CHECK CHECK CONSTRAINT [FK_BugNet_IssueNotifications_Users];
ALTER TABLE [dbo].[BugNet_Issues] WITH CHECK CHECK CONSTRAINT [FK_BugNet_Issues_Users];
ALTER TABLE [dbo].[BugNet_Issues] WITH CHECK CHECK CONSTRAINT [FK_BugNet_Issues_Users1];
ALTER TABLE [dbo].[BugNet_Issues] WITH CHECK CHECK CONSTRAINT [FK_BugNet_Issues_Users2];
ALTER TABLE [dbo].[BugNet_Issues] WITH CHECK CHECK CONSTRAINT [FK_BugNet_Issues_Users3];
ALTER TABLE [dbo].[BugNet_IssueVotes] WITH CHECK CHECK CONSTRAINT [FK_BugNet_IssueVotes_Users];
ALTER TABLE [dbo].[BugNet_IssueWorkReports] WITH CHECK CHECK CONSTRAINT [FK_BugNet_IssueWorkReports_Users];
ALTER TABLE [dbo].[BugNet_ProjectMailBoxes] WITH CHECK CHECK CONSTRAINT [FK_BugNet_ProjectMailBoxes_Users];
ALTER TABLE [dbo].[BugNet_ProjectNotifications] WITH CHECK CHECK CONSTRAINT [FK_BugNet_ProjectNotifications_Users];
ALTER TABLE [dbo].[BugNet_Projects] WITH CHECK CHECK CONSTRAINT [FK_BugNet_Projects_Users];
ALTER TABLE [dbo].[BugNet_Projects] WITH CHECK CHECK CONSTRAINT [FK_BugNet_Projects_Users1];
ALTER TABLE [dbo].[BugNet_Queries] WITH CHECK CHECK CONSTRAINT [FK_BugNet_Queries_Users];
ALTER TABLE [dbo].[BugNet_UserProjects] WITH CHECK CHECK CONSTRAINT [FK_BugNet_UserProjects_Users];
ALTER TABLE [dbo].[BugNet_UserRoles] WITH CHECK CHECK CONSTRAINT [FK_BugNet_UserRoles_Users];
GO
-- Removes all objects (in the correct order) added to
-- SQL Server by the stock ASP.NET membership provider
drop table aspnet_Profile
drop table aspnet_SchemaVersions
drop table aspnet_UsersInRoles
drop table aspnet_Membership
drop table aspnet_Roles
drop table aspnet_Users
drop table aspnet_Applications
drop view vw_aspnet_Applications
drop view vw_aspnet_MembershipUsers
drop view vw_aspnet_Profiles
drop view vw_aspnet_Roles
drop view vw_aspnet_Users
drop view vw_aspnet_UsersInRoles
drop procedure aspnet_AnyDataInTables
drop procedure aspnet_Applications_CreateApplication
drop procedure aspnet_CheckSchemaVersion
drop procedure aspnet_Membership_ChangePasswordQuestionAndAnswer
drop procedure aspnet_Membership_CreateUser
drop procedure aspnet_Membership_FindUsersByEmail
drop procedure aspnet_Membership_FindUsersByName
drop procedure aspnet_Membership_GetAllUsers
drop procedure aspnet_Membership_GetNumberOfUsersOnline
drop procedure aspnet_Membership_GetPassword
drop procedure aspnet_Membership_GetPasswordWithFormat
drop procedure aspnet_Membership_GetUserByEmail
drop procedure aspnet_Membership_GetUserByName
drop procedure aspnet_Membership_GetUserByUserId
drop procedure aspnet_Membership_ResetPassword
drop procedure aspnet_Membership_SetPassword
drop procedure aspnet_Membership_UnlockUser
drop procedure aspnet_Membership_UpdateUser
drop procedure aspnet_Membership_UpdateUserInfo
drop procedure aspnet_Profile_DeleteInactiveProfiles
drop procedure aspnet_Profile_DeleteProfiles
drop procedure aspnet_Profile_GetNumberOfInactiveProfiles
drop procedure aspnet_Profile_GetProfiles
drop procedure aspnet_Profile_GetProperties
drop procedure aspnet_Profile_SetProperties
drop procedure aspnet_RegisterSchemaVersion
drop procedure aspnet_Roles_CreateRole
drop procedure aspnet_Roles_DeleteRole
drop procedure aspnet_Roles_GetAllRoles
drop procedure aspnet_Roles_RoleExists
drop procedure aspnet_Setup_RemoveAllRoleMembers
drop procedure aspnet_Setup_RestorePermissions
drop procedure aspnet_UnRegisterSchemaVersion
drop procedure aspnet_Users_CreateUser
drop procedure aspnet_Users_DeleteUser
drop procedure aspnet_UsersInRoles_AddUsersToRoles
drop procedure aspnet_UsersInRoles_FindUsersInRole
drop procedure aspnet_UsersInRoles_GetRolesForUser
drop procedure aspnet_UsersInRoles_GetUsersInRoles
drop procedure aspnet_UsersInRoles_IsUserInRole
drop procedure aspnet_UsersInRoles_RemoveUsersFromRoles
drop schema aspnet_Membership_FullAccess
drop schema aspnet_Membership_BasicAccess
drop schema aspnet_Membership_ReportingAccess
drop schema aspnet_Profile_BasicAccess
drop schema aspnet_Profile_FullAccess
drop schema aspnet_Profile_ReportingAccess
drop schema aspnet_Roles_BasicAccess
drop schema aspnet_Roles_FullAccess
drop schema aspnet_Roles_ReportingAccess
drop role aspnet_Membership_FullAccess
drop role aspnet_Membership_BasicAccess
drop role aspnet_Membership_ReportingAccess
drop role aspnet_Profile_FullAccess
drop role aspnet_Profile_BasicAccess
drop role aspnet_Profile_ReportingAccess
drop role aspnet_Roles_FullAccess
drop role aspnet_Roles_BasicAccess
drop role aspnet_Roles_ReportingAccess
PRINT N'Update complete.';
GO | the_stack |
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for biz_article
-- ----------------------------
DROP TABLE IF EXISTS `biz_article`;
CREATE TABLE `biz_article` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '文章标题',
`user_id` bigint(20) UNSIGNED NOT NULL COMMENT '用户ID',
`cover_image` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '文章封面图片',
`qrcode_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '文章专属二维码地址',
`is_markdown` tinyint(1) UNSIGNED NULL DEFAULT 1,
`content` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '文章内容',
`content_md` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT 'markdown版的文章内容',
`top` tinyint(1) NULL DEFAULT 0 COMMENT '是否置顶',
`type_id` bigint(20) UNSIGNED NOT NULL COMMENT '类型',
`status` tinyint(1) UNSIGNED NULL DEFAULT NULL COMMENT '状态',
`recommended` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '是否推荐',
`original` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '是否原创',
`description` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '文章简介,最多200字',
`keywords` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '文章关键字,优化搜索',
`comment` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '是否开启评论',
`create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
`update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 0 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for biz_article_look
-- ----------------------------
DROP TABLE IF EXISTS `biz_article_look`;
CREATE TABLE `biz_article_look` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`article_id` bigint(20) UNSIGNED NOT NULL COMMENT '文章ID',
`user_id` bigint(20) UNSIGNED NULL DEFAULT NULL COMMENT '已登录用户ID',
`user_ip` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户IP',
`look_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '浏览时间',
`create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
`update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 0 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for biz_article_love
-- ----------------------------
DROP TABLE IF EXISTS `biz_article_love`;
CREATE TABLE `biz_article_love` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`article_id` bigint(20) UNSIGNED NOT NULL COMMENT '文章ID',
`user_id` bigint(20) UNSIGNED NULL DEFAULT NULL COMMENT '已登录用户ID',
`user_ip` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户IP',
`love_time` datetime(0) NULL DEFAULT NULL COMMENT '浏览时间',
`create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
`update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 0 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for biz_article_tags
-- ----------------------------
DROP TABLE IF EXISTS `biz_article_tags`;
CREATE TABLE `biz_article_tags` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`tag_id` bigint(20) UNSIGNED NOT NULL COMMENT '标签表主键',
`article_id` bigint(20) UNSIGNED NOT NULL COMMENT '文章ID',
`create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
`update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 0 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for biz_comment
-- ----------------------------
DROP TABLE IF EXISTS `biz_comment`;
CREATE TABLE `biz_comment` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`sid` bigint(20) NULL DEFAULT NULL COMMENT '被评论的文章或者页面的ID',
`user_id` bigint(20) UNSIGNED NULL DEFAULT NULL COMMENT '评论人的ID',
`pid` bigint(20) UNSIGNED NULL DEFAULT NULL COMMENT '父级评论的id',
`qq` varchar(13) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '评论人的QQ(未登录用户)',
`nickname` varchar(13) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '评论人的昵称(未登录用户)',
`avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '评论人的头像地址',
`email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '评论人的邮箱地址(未登录用户)',
`url` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '评论人的网站地址(未登录用户)',
`status` enum('VERIFYING','APPROVED','REJECT','DELETED') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT 'VERIFYING' COMMENT '评论的状态',
`ip` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '评论时的ip',
`lng` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '经度',
`lat` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '纬度',
`address` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '评论时的地址',
`os` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '评论时的系统类型',
`os_short_name` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '评论时的系统的简称',
`browser` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '评论时的浏览器类型',
`browser_short_name` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '评论时的浏览器的简称',
`content` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '评论的内容',
`remark` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注(审核不通过时添加)',
`support` int(10) UNSIGNED NULL DEFAULT 0 COMMENT '支持(赞)',
`oppose` int(10) UNSIGNED NULL DEFAULT 0 COMMENT '反对(踩)',
`create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
`update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 0 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for biz_tags
-- ----------------------------
DROP TABLE IF EXISTS `biz_tags`;
CREATE TABLE `biz_tags` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '书签名',
`description` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '描述',
`create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
`update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 0 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for biz_type
-- ----------------------------
DROP TABLE IF EXISTS `biz_type`;
CREATE TABLE `biz_type` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`pid` bigint(20) UNSIGNED NULL DEFAULT NULL,
`name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文章类型名',
`description` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '类型介绍',
`sort` int(10) NULL DEFAULT NULL COMMENT '排序',
`icon` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图标',
`available` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '是否可用',
`create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
`update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 0 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for sys_config
-- ----------------------------
DROP TABLE IF EXISTS `sys_config`;
CREATE TABLE `sys_config` (
`id` int(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`config_key` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '配置关键字',
`config_value` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '配置项内容',
`create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
`update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 0 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for sys_link
-- ----------------------------
DROP TABLE IF EXISTS `sys_link`;
CREATE TABLE `sys_link` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`url` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '链接地址',
`name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '链接名',
`description` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '链接介绍',
`email` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '友链站长邮箱',
`qq` varchar(13) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '友链站长QQ',
`favicon` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '状态',
`home_page_display` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '是否首页显示',
`remark` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
`source` enum('ADMIN','AUTOMATIC') CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'ADMIN' COMMENT '来源:管理员添加、自动申请',
`create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
`update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 0 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for sys_log
-- ----------------------------
DROP TABLE IF EXISTS `sys_log`;
CREATE TABLE `sys_log` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) UNSIGNED NULL DEFAULT NULL COMMENT '已登录用户ID',
`type` enum('SYSTEM','VISIT','ERROR') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'SYSTEM' COMMENT '日志类型(系统操作日志,用户访问日志,异常记录日志)',
`log_level` enum('ERROR','WARN','INFO') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'INFO' COMMENT '日志级别',
`content` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '日志内容(业务操作)',
`params` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '请求参数(业务操作)',
`spider_type` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '爬虫类型(当访问者被鉴定为爬虫时该字段表示爬虫的类型)',
`ip` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '操作用户的ip',
`ua` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '操作用户的user_agent',
`os` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '评论时的系统类型',
`browser` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '评论时的浏览器类型',
`request_url` varchar(3000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '请求的路径',
`referer` varchar(3000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '请求来源地址',
`create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
`update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 0 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for sys_notice
-- ----------------------------
DROP TABLE IF EXISTS `sys_notice`;
CREATE TABLE `sys_notice` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) UNSIGNED NOT NULL COMMENT '被通知的用户ID',
`status` enum('RELEASE','NOT_RELEASE') CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'NOT_RELEASE' COMMENT '通知状态',
`title` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '通知的标题',
`content` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '通知的内容',
`create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
`update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 0 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for sys_resources
-- ----------------------------
DROP TABLE IF EXISTS `sys_resources`;
CREATE TABLE `sys_resources` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`type` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`url` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`permission` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`parent_id` bigint(20) UNSIGNED NULL DEFAULT 0,
`sort` int(10) UNSIGNED NULL DEFAULT NULL,
`external` tinyint(1) UNSIGNED NULL DEFAULT NULL COMMENT '是否外部链接',
`available` tinyint(1) UNSIGNED NULL DEFAULT 0,
`icon` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '菜单图标',
`create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
`update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_sys_resource_parent_id`(`parent_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 0 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for sys_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '角色名',
`description` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`available` tinyint(1) NULL DEFAULT 0,
`create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
`update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 0 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for sys_role_resources
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_resources`;
CREATE TABLE `sys_role_resources` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`role_id` bigint(20) UNSIGNED NOT NULL,
`resources_id` bigint(20) UNSIGNED NOT NULL,
`create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
`update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 0 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for sys_template
-- ----------------------------
DROP TABLE IF EXISTS `sys_template`;
CREATE TABLE `sys_template` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`ref_key` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '键',
`ref_value` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '模板内容',
`create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
`update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 0 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for sys_update_recorde
-- ----------------------------
DROP TABLE IF EXISTS `sys_update_recorde`;
CREATE TABLE `sys_update_recorde` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`version` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '更新版本',
`description` varchar(2500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '更新记录备注',
`recorde_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '项目更新时间',
`create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
`update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 0 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`username` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`password` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '登录密码',
`nickname` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '昵称',
`mobile` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '手机号',
`email` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '邮箱地址',
`qq` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'QQ',
`birthday` date NULL DEFAULT NULL COMMENT '生日',
`gender` smallint(2) NULL DEFAULT NULL COMMENT '性别',
`avatar` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '头像地址',
`user_type` enum('ROOT','ADMIN','USER') CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'ADMIN' COMMENT '超级管理员、管理员、普通用户',
`company` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '公司',
`blog` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '个人博客地址',
`location` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '地址',
`source` enum('GITHUB','GITEE','WEIBO','DINGTALK','BAIDU','CSDN','CODING','OSCHINA','TENCENT_CLOUD','ALIPAY','TAOBAO','QQ','WECHAT','GOOGLE','FACEBOOK') CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户来源',
`uuid` varchar(50) NULL COMMENT '用户唯一表示(第三方网站)',
`privacy` tinyint(2) NULL DEFAULT NULL COMMENT '隐私(1:公开,0:不公开)',
`notification` tinyint(2) UNSIGNED NULL DEFAULT NULL COMMENT '通知:(1:通知显示消息详情,2:通知不显示详情)',
`score` int(10) UNSIGNED NULL DEFAULT 0 COMMENT '金币值',
`experience` int(10) UNSIGNED NULL DEFAULT 0 COMMENT '经验值',
`reg_ip` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '注册IP',
`last_login_ip` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '最近登录IP',
`last_login_time` datetime(0) NULL DEFAULT NULL COMMENT '最近登录时间',
`login_count` int(10) UNSIGNED NULL DEFAULT 0 COMMENT '登录次数',
`remark` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户备注',
`status` int(1) UNSIGNED NULL DEFAULT NULL COMMENT '用户状态',
`create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '注册时间',
`update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 0 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for sys_user_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_role`;
CREATE TABLE `sys_user_role` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) UNSIGNED NOT NULL,
`role_id` bigint(20) UNSIGNED NOT NULL,
`create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
`update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 0 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for biz_file
-- ----------------------------
DROP TABLE IF EXISTS `biz_file`;
CREATE TABLE `biz_file` (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` int(11) UNSIGNED NULL DEFAULT NULL,
`storage_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`original_file_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`size` bigint(20) UNSIGNED NULL DEFAULT NULL,
`suffix` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`width` int(10) UNSIGNED NULL DEFAULT NULL,
`height` int(10) UNSIGNED NULL DEFAULT NULL,
`file_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`full_file_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`file_hash` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`upload_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`upload_start_time` datetime(0) NULL DEFAULT NULL,
`upload_end_time` datetime(0) NULL DEFAULT NULL,
`create_time` datetime(0) NULL DEFAULT NULL,
`update_time` datetime(0) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 0 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Compact;
SET FOREIGN_KEY_CHECKS = 1; | the_stack |
USE [master]
GO
CREATE DATABASE [DeviceStats];
GO
ALTER DATABASE [DeviceStats] SET ANSI_NULL_DEFAULT OFF
GO
ALTER DATABASE [DeviceStats] SET ANSI_NULLS OFF
GO
ALTER DATABASE [DeviceStats] SET ANSI_PADDING OFF
GO
ALTER DATABASE [DeviceStats] SET ANSI_WARNINGS OFF
GO
ALTER DATABASE [DeviceStats] SET ARITHABORT OFF
GO
ALTER DATABASE [DeviceStats] SET AUTO_CLOSE OFF
GO
ALTER DATABASE [DeviceStats] SET AUTO_CREATE_STATISTICS ON
GO
ALTER DATABASE [DeviceStats] SET AUTO_SHRINK OFF
GO
ALTER DATABASE [DeviceStats] SET AUTO_UPDATE_STATISTICS ON
GO
ALTER DATABASE [DeviceStats] SET CURSOR_CLOSE_ON_COMMIT OFF
GO
ALTER DATABASE [DeviceStats] SET CURSOR_DEFAULT GLOBAL
GO
ALTER DATABASE [DeviceStats] SET CONCAT_NULL_YIELDS_NULL OFF
GO
ALTER DATABASE [DeviceStats] SET NUMERIC_ROUNDABORT OFF
GO
ALTER DATABASE [DeviceStats] SET QUOTED_IDENTIFIER OFF
GO
ALTER DATABASE [DeviceStats] SET RECURSIVE_TRIGGERS OFF
GO
ALTER DATABASE [DeviceStats] SET ENABLE_BROKER
GO
ALTER DATABASE [DeviceStats] SET AUTO_UPDATE_STATISTICS_ASYNC OFF
GO
ALTER DATABASE [DeviceStats] SET DATE_CORRELATION_OPTIMIZATION OFF
GO
ALTER DATABASE [DeviceStats] SET TRUSTWORTHY OFF
GO
ALTER DATABASE [DeviceStats] SET ALLOW_SNAPSHOT_ISOLATION OFF
GO
ALTER DATABASE [DeviceStats] SET PARAMETERIZATION SIMPLE
GO
ALTER DATABASE [DeviceStats] SET READ_WRITE
GO
ALTER DATABASE [DeviceStats] SET RECOVERY SIMPLE
GO
ALTER DATABASE [DeviceStats] SET MULTI_USER
GO
ALTER DATABASE [DeviceStats] SET PAGE_VERIFY CHECKSUM
GO
ALTER DATABASE [DeviceStats] SET DB_CHAINING OFF
GO
USE [DeviceStats]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DailyStats](
[DeviceID] [int] NOT NULL,
[Timestamp] [date] NOT NULL,
[ReceivedCount] [int] NOT NULL,
[DataErrorCount] [int] NOT NULL,
[TimeErrorCount] [int] NOT NULL,
[MinLatency] [int] NULL,
[MaxLatency] [int] NULL,
[AvgLatency] [int] NULL,
CONSTRAINT [PK_DailyStats] PRIMARY KEY CLUSTERED
(
[DeviceID] ASC,
[Timestamp] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Device](
[ID] [int] IDENTITY(1,1) NOT NULL,
[UniqueID] [uniqueidentifier] NOT NULL,
[Name] [varchar](200) NULL,
[NameWISP] [varchar](200) NULL,
[NamePMU] [varchar](200) NULL,
[NamePDC] [varchar](200) NULL,
[SubstationID] [int] NULL,
[Acronym] [varchar](200) NOT NULL,
[ParentAcronym] [varchar](200) NULL,
[Protocol] [varchar](200) NULL,
[Longitude] [decimal](9, 6) NULL,
[Latitude] [decimal](9, 6) NULL,
[FramesPerSecond] [int] NOT NULL,
CONSTRAINT [PK_Device] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[MinuteStats](
[DeviceID] [int] NOT NULL,
[Timestamp] [smalldatetime] NOT NULL,
[ReceivedCount] [smallint] NOT NULL,
[DataErrorCount] [smallint] NOT NULL,
[TimeErrorCount] [smallint] NOT NULL,
[MinLatency] [int] NULL,
[MaxLatency] [int] NULL,
[AvgLatency] [int] NULL,
CONSTRAINT [PK_MinuteStats14] PRIMARY KEY CLUSTERED
(
[DeviceID] ASC,
[Timestamp] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[PMULines](
[NameEMS] [nvarchar](50) NOT NULL,
[NameEMSClean] [nvarchar](50) NULL,
[NameLong] [nvarchar](100) NOT NULL,
[FromSubstationID] [int] NULL,
[ToSubstationID] [int] NULL,
[NominalVoltage] [float] NOT NULL
) ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Substation](
[ID] [int] IDENTITY(1,1) NOT NULL,
[Name] [varchar](200) NOT NULL,
[NameShort] [varchar](200) NOT NULL,
[NameEMS] [varchar](200) NOT NULL,
[PMUPrefix] [varchar](200) NOT NULL,
[Longitude] [decimal](9, 6) NOT NULL,
[Latitude] [decimal](9, 6) NOT NULL,
[HasPMUs] [bit] NOT NULL,
CONSTRAINT [PK_Substation] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Device] ADD CONSTRAINT [DF__Device__FramesPerSec] DEFAULT ((30)) FOR [FramesPerSecond]
GO
ALTER TABLE [dbo].[MinuteStats] ADD CONSTRAINT [DF_MinuteStats_DataErrorCount] DEFAULT ((0)) FOR [DataErrorCount]
GO
ALTER TABLE [dbo].[MinuteStats] ADD CONSTRAINT [DF_MinuteStats_TimeErrorCount] DEFAULT ((0)) FOR [TimeErrorCount]
GO
ALTER TABLE [dbo].[DailyStats] WITH CHECK ADD CONSTRAINT [FK_DailyStats_Device] FOREIGN KEY([DeviceID])
REFERENCES [dbo].[Device] ([ID])
GO
ALTER TABLE [dbo].[DailyStats] CHECK CONSTRAINT [FK_DailyStats_Device]
GO
ALTER TABLE [dbo].[Device] WITH CHECK ADD CONSTRAINT [FK_Device_Substation] FOREIGN KEY([SubstationID])
REFERENCES [dbo].[Substation] ([ID])
GO
ALTER TABLE [dbo].[Device] CHECK CONSTRAINT [FK_Device_Substation]
GO
ALTER TABLE [dbo].[PMULines] WITH CHECK ADD CONSTRAINT [FK_PMULines__From_Substation] FOREIGN KEY([FromSubstationID])
REFERENCES [dbo].[Substation] ([ID])
GO
ALTER TABLE [dbo].[PMULines] CHECK CONSTRAINT [FK_PMULines__From_Substation]
GO
ALTER TABLE [dbo].[PMULines] WITH CHECK ADD CONSTRAINT [FK_PMULines_To_Substation] FOREIGN KEY([ToSubstationID])
REFERENCES [dbo].[Substation] ([ID])
GO
ALTER TABLE [dbo].[PMULines] CHECK CONSTRAINT [FK_PMULines_To_Substation]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/********************************/
/* STEP 3 */
/* Create new stored procedures */
/********************************/
CREATE PROCEDURE [dbo].[InsertMissingMinuteStats]
AS
BEGIN
DECLARE @StartTimestamp SMALLDATETIME;
DECLARE @EndTimestamp SMALLDATETIME;
SELECT @StartTimeStamp = MIN(Timestamp) FROM MinuteStats;
SELECT @EndTimestamp = DATEADD(MINUTE, -2, GETDATE());
;WITH MinutesCTE (Timestamp) AS
(
SELECT @StartTimestamp UNION ALL
SELECT DateAdd(MINUTE, 1, Timestamp)
FROM MinutesCTE WHERE Timestamp < @EndTimestamp
)
INSERT MinuteStats (DeviceID, Timestamp, ReceivedCount, DataErrorCount, TimeErrorCount)
SELECT d.ID, m.Timestamp, 0, 0, 0
FROM MinutesCTE m
JOIN Device d ON 1=1
LEFT OUTER JOIN MinuteStats mm ON mm.DeviceID=d.ID AND mm.Timestamp=m.Timestamp
WHERE m.Timestamp < @EndTimestamp AND mm.DeviceID IS NULL
ORDER BY 1,2
OPTION (MaxRecursion 0)
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[QueryPDCDailyStats] (@PDC varchar(20), @FromMS BIGINT, @ToMS BIGINT)
AS
BEGIN
DECLARE @DeviceID int;
SELECT @DeviceID=MIN(ID) FROM Device WHERE COALESCE(ParentAcronym, Acronym) = @PDC;
SELECT DATEDIFF(SECOND, '1970-01-01', [Timestamp]) AS time
, (ds.ReceivedCount / (d.FramesPerSecond * 86400.0) * 100.0) as value
, @PDC as metric
FROM [DailyStats] ds
JOIN [Device] d on d.ID=ds.DeviceID
WHERE [DeviceID] = @DeviceID
AND DATEDIFF(SECOND, '1970-01-01', [Timestamp]) BETWEEN @FromMS/1000 AND @ToMS/1000
ORDER BY [Timestamp];
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[QueryPDCMinuteStats] (@PDC varchar(20), @From DATETIME, @To DATETIME)
AS
BEGIN
DECLARE @DeviceID int;
SELECT @DeviceID=MIN(ID) FROM Device WHERE COALESCE(ParentAcronym,Acronym) = @PDC;
SELECT DATEDIFF(second, '1970-01-01', [Timestamp]) AS time, [ReceivedCount] as value, @PDC as metric
FROM [MinuteStats]
WHERE [DeviceID] = @DeviceID
AND [Timestamp] BETWEEN @From AND @To
ORDER BY [Timestamp];
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[QueryPDCNames]
AS
BEGIN
SET NOCOUNT ON;
-- Find all PDCs with valid DailyStats data in the last month
SELECT DISTINCT COALESCE(ParentAcronym, Acronym) PDC
FROM Device d
JOIN DailyStats s on s.DeviceID=d.ID
WHERE [Timestamp]>DATEADD(MONTH, -1, CONVERT(date,GETUTCDATE()))
ORDER BY 1
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[QueryPMUDataErrors] (@ToMS BIGINT, @NumMinutes INT, @Filter varchar(max), @Substation varchar(max))
AS
BEGIN
DECLARE @Last SMALLDATETIME;
DECLARE @To SMALLDATETIME;
DECLARE @From SMALLDATETIME;
SELECT @Last=MAX(Timestamp) FROM MinuteStats WHERE AvgLatency IS NOT NULL;
SELECT @To=DATEADD(s, @ToMS/1000, '1970-01-01');
IF (@To > @Last) SELECT @To=@LAST
SELECT @From=DATEADD(MINUTE, -@NumMinutes, @To)
SELECT COALESCE(Acronym, ParentAcronym) PMU,
MAX(Timestamp) LastTimestamp,
AVG(ReceivedCount) ReceivedCount,
AVG(DataErrorCount) DataErrorCount,
AVG(TimeErrorCount) TimeErrorCount,
MAX(s.Name) Substation
FROM MinuteStats ms
JOIN Device d on d.ID=ms.DeviceID
JOIN Substation s on s.ID=d.SubstationID
WHERE [Timestamp] BETWEEN @From AND DATEADD(MINUTE, -1, @To)
AND (@Filter='all' OR DataErrorCount>0)
AND (@Substation='' OR s.Name=@Substation)
GROUP BY COALESCE(Acronym, ParentAcronym)
ORDER BY 1, 2
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[QuerySubstationNames]
AS
BEGIN
SET NOCOUNT ON;
-- Find all Substations with valid DailyStats data in the last month
SELECT DISTINCT s.Name AS Substation --COALESCE(ParentAcronym, Acronym) PDC
FROM Device d
JOIN DailyStats ds on ds.DeviceID=d.ID
JOIN Substation s on s.ID=d.SubstationID
WHERE [Timestamp]>DATEADD(MONTH, -1, CONVERT(date,GETUTCDATE()))
ORDER BY 1
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[UpdateDailyDeviceStats]
AS
BEGIN
SET NOCOUNT ON;
SET ANSI_WARNINGS OFF
DELETE FROM dbo.MinuteStats WHERE Timestamp < DATEADD(YEAR, -1, GETDATE());
-- Insert dummy (empty) missing MinuteStats records for any active devices on days with zero records in MinuteStats
EXEC [dbo].[InsertMissingMinuteStats];
INSERT INTO DailyStats (DeviceID, Timestamp, ReceivedCount, DataErrorCount, TimeErrorCount, MaxLatency, MinLatency, AvgLatency)
SELECT m.DeviceID,
CONVERT(date, m.Timestamp),
SUM(m.[ReceivedCount]),
SUM(m.[DataErrorCount]),
SUM(m.[TimeErrorCount]),
MAX(m.[MaxLatency]),
MIN(m.[MinLatency]),
CAST(AVG(CAST(m.[AvgLatency] AS FLOAT)) AS INT)
FROM MinuteStats m
LEFT OUTER JOIN DailyStats dd on dd.DeviceID=m.DeviceID AND dd.Timestamp=CONVERT(date, m.Timestamp)
WHERE CONVERT(date, m.Timestamp) < CONVERT(date, getdate()) AND dd.DeviceID IS NULL
GROUP BY m.DeviceID, CONVERT(date, m.Timestamp);
SET ANSI_WARNINGS ON
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[DailyStatsDetail]
AS
SELECT dbo.Device.Acronym AS PMU, dbo.Device.ParentAcronym AS PDC, dbo.DailyStats.ReceivedCount, dbo.DailyStats.DataErrorCount, dbo.DailyStats.TimeErrorCount
FROM dbo.DailyStats INNER JOIN
dbo.Device ON dbo.DailyStats.DeviceID = dbo.Device.ID
WHERE dbo.DailyStats.Timestamp = (SELECT MAX(Timestamp) AS MaxTime FROM dbo.DailyStats)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[MinuteStatsDetail]
AS
SELECT D.Acronym AS PMU, D.ParentAcronym AS PDC, MS.ReceivedCount AS Received, MS.DataErrorCount AS DataErrors, MS.TimeErrorCount AS TimeErrors
FROM dbo.MinuteStats AS MS INNER JOIN
dbo.Device AS D ON MS.DeviceID = D.ID
WHERE MS.Timestamp = (SELECT MAX(Timestamp) AS MaxTime FROM dbo.MinuteStats) | the_stack |
--
---- test temporary table
--
--sucess
create table test_syntax_temp_1(a int)
partition by range(a)
(
partition test_syntax_temp_1_p1 values less than (1),
partition test_syntax_temp_1_p2 values less than (2),
partition test_syntax_temp_1_p3 values less than (3)
);
--fail
create temporary table test_syntax_temp_2(a int)
partition by range(a)
(
partition test_syntax_temp_2_p1 values less than (1),
partition test_syntax_temp_2_p2 values less than (2)
);
--fail
create global temporary table test_syntax_temp_3(a int)
partition by range(a)
(
partition p1 values less than (1),
partition p2 values less than (2)
);
--fail
create local temporary table test_syntax_temp_4(a int)
partition by range(a)
(
partition test_syntax_temp_4_p1 values less than (1),
partition test_syntax_temp_4_p2 values less than (2)
);
--
---- test unlogged
--
--fail
create unlogged table test_syntax_unlogged_1(a int)
partition by range(a)
(
partition test_syntax_unlogged_1_p1 values less than (1),
partition test_syntax_unlogged_1_p2 values less than (2)
);
--
----test column constraint and collate
--
--sucess
create table test_syntax_col_con_1(a int not null)
partition by range(a)
(
partition test_syntax_col_con_1_p1 values less than (1),
partition test_syntax_col_con_1_p2 values less than (2)
);
--sucess
create table test_syntax_col_con_2(a int constraint con_2 not null)
partition by range(a)
(
partition test_syntax_col_con_2_p1 values less than (1),
partition test_syntax_col_con_2_p2 values less than (2)
);
--sucess
create table test_syntax_col_con_3(a int null)
partition by range(a)
(
partition test_syntax_col_con_3_p1 values less than (1),
partition test_syntax_col_con_3_p2 values less than (2)
);
--sucess
create table test_syntax_col_con_4(a int constraint con_4 null)
partition by range(a)
(
partition test_syntax_col_con_4_p1 values less than (1),
partition test_syntax_col_con_4_p2 values less than (2)
);
--sucess
create table test_syntax_col_con_5(a int default 0)
partition by range(a)
(
partition test_syntax_col_con_5_p1 values less than (1),
partition test_syntax_col_con_5_p2 values less than (2)
);
--sucess
create table test_syntax_col_con_6(a int constraint con_6 default 0)
partition by range(a)
(
partition test_syntax_col_con_6_p1 values less than (1),
partition test_syntax_col_con_6_p2 values less than (2)
);
--sucess
create table test_syntax_col_con_7(a int check(a > 0))
partition by range(a)
(
partition test_syntax_col_con_7_p1 values less than (1),
partition test_syntax_col_con_7_p2 values less than (2)
);
--sucess
create table test_syntax_col_con_8(a int constraint con_8 check(a > 0))
partition by range(a)
(
partition test_syntax_col_con_8_p1 values less than (1),
partition test_syntax_col_con_8_p2 values less than (2)
);
--fail
create table test_syntax_col_con_9(a int unique)
partition by range(a)
(
partition test_syntax_col_con_9_p1 values less than (1),
partition test_syntax_col_con_9_p2 values less than (2)
);
--fail
create table test_syntax_col_con_10(a int primary key )
partition by range(a)
(
partition test_syntax_col_con_10_p1 values less than (1),
partition test_syntax_col_con_10_p2 values less than (2)
);
--fail
create table test_syntax_col_con_11(a int check (a > 0) no inherit)
partition by range(a)
(
partition test_syntax_col_con_11_p1 values less than (1),
partition test_syntax_col_con_11_p2 values less than (2)
);
--sucess
create table test_syntax_col_con_12(a int , b text collate "C")
partition by range(a)
(
partition test_syntax_col_con_12_p1 values less than (1),
partition test_syntax_col_con_12_p2 values less than (2)
);
drop table test_syntax_temp_1;
drop table test_syntax_col_con_1;
drop table test_syntax_col_con_2;
drop table test_syntax_col_con_3;
drop table test_syntax_col_con_4;
drop table test_syntax_col_con_5;
drop table test_syntax_col_con_6;
drop table test_syntax_col_con_7;
drop table test_syntax_col_con_8;
drop table test_syntax_col_con_9;
drop table test_syntax_col_con_10;
drop table test_syntax_col_con_11;
drop table test_syntax_col_con_12;
--
----test table constraint
--
--
----test table constraint
--
--sucess
create table test_syntax_tab_con_1(a int, check(a > 0))
partition by range(a)
(
partition test_syntax_tab_con_1_p1 values less than (1),
partition test_syntax_tab_con_1_p2 values less than (2)
);
--fail
create table test_syntax_tab_con_2(a int, check(a > 0) NO INHERIT)
partition by range(a)
(
partition test_syntax_tab_con_2_p1 values less than (1),
partition test_syntax_tab_con_2_p2 values less than (2)
);
--fail
create table test_syntax_tab_con_3(a int, unique(a))
partition by range(a)
(
partition test_syntax_tab_con_3_p1 values less than (1),
partition test_syntax_tab_con_3_p2 values less than (2)
);
--fail
create table test_syntax_tab_con_4(a int, primary key (a))
partition by range(a)
(
partition test_syntax_tab_con_4_p1 values less than (1),
partition test_syntax_tab_con_4_p2 values less than (2)
);
--clean up
drop table test_syntax_tab_con_1;
drop table test_syntax_tab_con_2;
drop table test_syntax_tab_con_3;
drop table test_syntax_tab_con_4;
--
---- test like clause
--
--fail
create table test_syntax_like(b int);
create table test_syntax_like_1(a int, like test_syntax_like)
partition by range(a)
(
partition test_syntax_like_p1 values less than (1),
partition test_syntax_like_p2 values less than (2)
);
--clean up
drop table test_syntax_like;
drop table IF EXISTS test_syntax_like_1;
--
----test inherit clause
--
--fail
create table test_syntax_inherit(a int);
create table test_syntax_inherit_1() inherits (test_syntax_inherit)
partition by range(a)
(
partition test_syntax_inherit_p1 values less than (1),
partition test_syntax_inherit_p2 values less than (2)
);
--clean up
drop table test_syntax_inherit;
--
----test with option
--
--fail
create table test_syntax_with_1(a int) without oids
partition by range(a)
(
partition test_syntax_with_1_p1 values less than (1),
partition test_syntax_with_1_p2 values less than (2)
);
--fail
create table test_syntax_with_2(a int) with oids
partition by range(a)
(
partition test_syntax_with_2_p1 values less than (1),
partition test_syntax_with_2_p2 values less than (2)
);
--sucess
create table test_syntax_with_3(a int) WITH (fillfactor=70)
partition by range(a)
(
partition test_syntax_with_3_p1 values less than (1),
partition test_syntax_with_3_p2 values less than (2)
);
--clean up
drop table test_syntax_with_3;
--
----test on commit
--
--fail
create table test_syntax_commit_1(a int) on commit drop
partition by range(a)
(
partition test_syntax_commit_1_p1 values less than (1),
partition test_syntax_commit_1_p2 values less than (2)
);
--fail
create table test_syntax_commit_2(a int) on commit delete rows
partition by range(a)
(
partition test_syntax_commit_2_p1 values less than (1),
partition test_syntax_commit_2_p2 values less than (2)
);
--fail
create table test_syntax_commit_3(a int) on commit preserve rows
partition by range(a)
(
partition test_syntax_commit_3_p1 values less than (1),
partition test_syntax_commit_3_p2 values less than (2)
);
--
--duplicate partition name
--
--fail
create table test_duplicate_partition_name(a bpchar)
partition by range(a)
(
partition test_duplicate_partition_name_p1 values less than ('H'),
partition test_duplicate_partition_name_p1 values less than ('Z')
);
--
--undefined partitionkey
--
--fail
create table test_undefined_partitionkey(a int)
partition by range(b)
(
partition test_undefined_partitionkey_p1 values less than (2),
partition test_undefined_partitionkey_p2 values less than (4)
);
--
--duplicate partitionkey
--
--fail
create table test_undefined_partitionkey(a int, b int)
partition by range(a, a)
(
partition test_undefined_partitionkey_p1 values less than (1, 2),
partition test_undefined_partitionkey_p2 values less than (2, 1)
);
--
--null for partitionvalue
--
--fail
create table test_null_partition_value(a int, b int)
partition by range(a, b)
(
partition test_null_partition_value_p1 values less than (1, 2),
partition test_null_partition_value_p2 values less than (2, null)
);
--
--a correct case
--
--sucess
create table test_syntax_correct(a int)
partition by range(a)
(
partition test_syntax_correct_p1 values less than (1),
partition test_syntax_correct_p2 values less than (2),
partition test_syntax_correct_p3 values less than (3)
);
insert into test_syntax_correct values (1),(2);
select * from test_syntax_correct order by 1;
select relname,parttype,rangenum,intervalnum,partstrategy,partkey,boundaries,interval,transit from pg_partition
where parentid = (select oid from pg_class where relname = 'test_syntax_correct')
order by 1, 2, 3;
drop table test_syntax_correct;
create table test__partition_name_length(a int)
partition by range (a)
(
partition par_123456789_123456789_123456789_123456789_123456789_123456789 values less than (0),--length = 63
partition part_123456789_123456789_123456789_123456789_123456789_123456789 values less than (10),--length = 64: truncate to NAMEDATALEN - 1
partition partition_123456789_123456789_123456789_123456789_123456789_123456789 values less than (20)--length = 69: truncate to NAMEDATALEN - 1
);
select relname from pg_partition
where parentid = (select oid from pg_class where relname = 'test__partition_name_length')
order by relname;
--clean up
drop table test__partition_name_length;
--failed
create table stu_info1(sn int, name name)
partition by range (sn)
(
partition stu_info1_p1 values less than('a' like 'a')
);
drop table if exists stu_info1;
--success
create table stu_info2(sn int, name name)
partition by range (sn)
(
partition stu_info2_p1 values less than(int4pl(1,2))
);
drop table if exists stu_info2;
--failed
create table stu_info3(sn int, name name)
partition by range (sn)
(
partition stu_info3_p1 values less than(to_date('2012-02-01', 'YYYY-MM-DD'))
);
drop table if exists stu_info3;
--failed
create table stu_info4(sn int, name name)
partition by range (sn)
(
partition stu_info4_p1 values less than(10)
);
drop table if exists stu_info4;
--success
create table stu_info5(sn int, name name)
partition by range (sn)
(
partition stu_info5_p1 values less than(10)
);
drop table if exists stu_info5;
--success
create table stu_info6(sn int, name name)
partition by range (sn)
(
partition stu_info6_p1 values less than(10)
);
drop table if exists stu_info6;
--failed
create table stu_info7(sn int, name name)
partition by range (sn)
(
partition stu_info7_p1 values less than(10)
);
drop table if exists stu_info7;
--10--------------------------------------------------------------------
--test the row movement syntax
--row movement default values is false
create table hw_partition_syntax_rowmovement_table
(
c1 int ,
c2 int
)
partition by range (c1)
(
partition hw_partition_syntax_rowmovement_table_p0 values less than (50),
partition hw_partition_syntax_rowmovement_table_p1 values less than (100),
partition hw_partition_syntax_rowmovement_table_p2 values less than (150)
);
select relname, relrowmovement from pg_class where relname = 'hw_partition_syntax_rowmovement_table' order by 1, 2;
-- relrowmovement = false
drop table hw_partition_syntax_rowmovement_table;
--enable the row movement
create table hw_partition_syntax_rowmovement_table
(
c1 int ,
c2 int
)
partition by range (c1)
(
partition hw_partition_syntax_rowmovement_table_p0 values less than (50),
partition hw_partition_syntax_rowmovement_table_p1 values less than (100),
partition hw_partition_syntax_rowmovement_table_p2 values less than (150)
)enable row movement;
select relname, relrowmovement from pg_class where relname = 'hw_partition_syntax_rowmovement_table';
-- relrowmovement = true
drop table hw_partition_syntax_rowmovement_table;
--disable the rowmovement
create table hw_partition_syntax_rowmovement_table
(
c1 int ,
c2 int
)
partition by range (c1)
(
partition hw_partition_syntax_rowmovement_table_p0 values less than (50),
partition hw_partition_syntax_rowmovement_table_p1 values less than (100),
partition hw_partition_syntax_rowmovement_table_p2 values less than (150)
)disable row movement;
select relname, relrowmovement from pg_class where relname = 'hw_partition_syntax_rowmovement_table';
-- relrowmovement = false
drop table hw_partition_syntax_rowmovement_table;
--test the "movement" keyword ,use the "movement" key word as table name and column name
create table movement
(
movement int
);
--create table succeed
drop table movement;
---------------------------------------------------------------------- | the_stack |
-- 2021-08-10T12:33:21.603Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,541376,TO_TIMESTAMP('2021-08-10 15:33:21','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N','UseScalePrice',TO_TIMESTAMP('2021-08-10 15:33:21','YYYY-MM-DD HH24:MI:SS'),100,'L')
;
-- 2021-08-10T12:33:21.611Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y') AND t.AD_Reference_ID=541376 AND NOT EXISTS (SELECT 1 FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID)
;
-- 2021-08-10T12:36:38.995Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,Description,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541376,542840,TO_TIMESTAMP('2021-08-10 15:36:38','YYYY-MM-DD HH24:MI:SS'),100,'Use scale price, fallback to product price','D','Y','Use scale price, fallback to product price',TO_TIMESTAMP('2021-08-10 15:36:38','YYYY-MM-DD HH24:MI:SS'),100,'Y','Use scale price, fallback to product price')
;
-- 2021-08-10T12:36:38.997Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y') AND t.AD_Ref_List_ID=542840 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2021-08-10T12:36:53.846Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,Description,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541376,542841,TO_TIMESTAMP('2021-08-10 15:36:53','YYYY-MM-DD HH24:MI:SS'),100,'Don''t use scale price','D','Y','Don''t use scale price',TO_TIMESTAMP('2021-08-10 15:36:53','YYYY-MM-DD HH24:MI:SS'),100,'N','Don''t use scale price')
;
-- 2021-08-10T12:36:53.847Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y') AND t.AD_Ref_List_ID=542841 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2021-08-10T12:37:14.490Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,Description,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541376,542842,TO_TIMESTAMP('2021-08-10 15:37:14','YYYY-MM-DD HH24:MI:SS'),100,'Use scale price (strict)','D','Y','Use scale price (strict)',TO_TIMESTAMP('2021-08-10 15:37:14','YYYY-MM-DD HH24:MI:SS'),100,'S','Use scale price (strict)')
;
-- 2021-08-10T12:37:14.491Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y') AND t.AD_Ref_List_ID=542842 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2021-08-10T12:37:34.554Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=541376, IsExcludeFromZoomTargets='Y',Updated=TO_TIMESTAMP('2021-08-10 15:37:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=500041
;
-- drop Y/N validation
ALTER TABLE m_productprice DROP CONSTRAINT m_productprice_usescaleprice_check
;
-- 2021-08-11T06:46:59.764Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET Name='Staffelpreis nicht verwenden',Updated=TO_TIMESTAMP('2021-08-11 09:46:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_CH' AND AD_Ref_List_ID=542841
;
-- 2021-08-11T06:47:02.034Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET Name='Staffelpreis nicht verwenden',Updated=TO_TIMESTAMP('2021-08-11 09:47:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='nl_NL' AND AD_Ref_List_ID=542841
;
-- 2021-08-11T06:47:03.296Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET Name='Staffelpreis nicht verwenden',Updated=TO_TIMESTAMP('2021-08-11 09:47:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Ref_List_ID=542841
;
-- 2021-08-11T06:47:05.307Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2021-08-11 09:47:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_US' AND AD_Ref_List_ID=542841
;
-- 2021-08-11T06:47:08.091Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET Description='',Updated=TO_TIMESTAMP('2021-08-11 09:47:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_CH' AND AD_Ref_List_ID=542841
;
-- 2021-08-11T06:47:12.038Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET Description='',Updated=TO_TIMESTAMP('2021-08-11 09:47:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='nl_NL' AND AD_Ref_List_ID=542841
;
-- 2021-08-11T06:47:13.234Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET Description='',Updated=TO_TIMESTAMP('2021-08-11 09:47:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_US' AND AD_Ref_List_ID=542841
;
-- 2021-08-11T06:47:16.307Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET Description='',Updated=TO_TIMESTAMP('2021-08-11 09:47:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Ref_List_ID=542841
;
-- 2021-08-11T06:47:44.515Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET Name='Staffelpreis verwenden (streng)',Updated=TO_TIMESTAMP('2021-08-11 09:47:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Ref_List_ID=542842
;
-- 2021-08-11T06:47:46.052Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET Name='Staffelpreis verwenden (streng)',Updated=TO_TIMESTAMP('2021-08-11 09:47:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='nl_NL' AND AD_Ref_List_ID=542842
;
-- 2021-08-11T06:47:50.578Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET Description='', Name='Staffelpreis verwenden (streng)',Updated=TO_TIMESTAMP('2021-08-11 09:47:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_CH' AND AD_Ref_List_ID=542842
;
-- 2021-08-11T06:47:53.167Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET Description='',Updated=TO_TIMESTAMP('2021-08-11 09:47:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='nl_NL' AND AD_Ref_List_ID=542842
;
-- 2021-08-11T06:47:56.911Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET Description='', IsTranslated='Y',Updated=TO_TIMESTAMP('2021-08-11 09:47:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_US' AND AD_Ref_List_ID=542842
;
-- 2021-08-11T06:48:01.067Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET Description='',Updated=TO_TIMESTAMP('2021-08-11 09:48:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Ref_List_ID=542842
;
-- 2021-08-11T06:48:19.264Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET Description='', Name='Staffelpreis verwenden, auf Produktpreis zurückgreifen',Updated=TO_TIMESTAMP('2021-08-11 09:48:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Ref_List_ID=542840
;
-- 2021-08-11T06:48:24.365Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET Description='', Name='Staffelpreis verwenden, auf Produktpreis zurückgreifen',Updated=TO_TIMESTAMP('2021-08-11 09:48:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='nl_NL' AND AD_Ref_List_ID=542840
;
-- 2021-08-11T06:48:30.252Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET Description='', Name='Staffelpreis verwenden, auf Produktpreis zurückgreifen',Updated=TO_TIMESTAMP('2021-08-11 09:48:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_CH' AND AD_Ref_List_ID=542840
;
-- 2021-08-11T06:48:34.388Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List_Trl SET Description='', IsTranslated='Y',Updated=TO_TIMESTAMP('2021-08-11 09:48:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_US' AND AD_Ref_List_ID=542840
;
-- 2021-08-11T08:01:14.660Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,545051,0,TO_TIMESTAMP('2021-08-11 11:01:14','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Es wurde kein Staffelpreis für die Menge {0} definiert.','E',TO_TIMESTAMP('2021-08-11 11:01:14','YYYY-MM-DD HH24:MI:SS'),100,'NoScalePrice')
;
-- 2021-08-11T08:01:14.665Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Message t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y') AND t.AD_Message_ID=545051 AND NOT EXISTS (SELECT 1 FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
;
-- 2021-08-11T08:05:52.118Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Message_Trl SET IsTranslated='Y', MsgText='No Scale Price defined for quantity: {0}.',Updated=TO_TIMESTAMP('2021-08-11 11:05:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_US' AND AD_Message_ID=545051
; | the_stack |
Metadata Schema Version Change Log
----------------------------------
* 1.0.1 - Initial version with support for InnoDB Clusters based on Group
Replication technology.
* 2.0.0 - Added support for ReplicaSets and a public interface for
components like MySQL Router. Cleanup and removal of unused items.
Description
-----------
All the tables that contain information about the topology of MySQL servers
in a MySQL InnoDB Cluster setup are stored in the
mysql_innodb_cluster_metadata database.
Consumers of the metadata (i.e. MySQL Router) are required to query the
public interface items (VIEWs and STORED PROCEDUREs) instead of querying the
actual metadata tables. The public interface items are prefixed with the
corresponding major version of the metadata, e.g. 'v2_clusters'.
*/
CREATE DATABASE IF NOT EXISTS mysql_innodb_cluster_metadata DEFAULT CHARACTER SET utf8mb4;
USE mysql_innodb_cluster_metadata;
SET names utf8mb4;
-- Metadata Schema Version
-- -----------------------
/*
View that holds the current version of the metadata schema.
PLEASE NOTE:
During the upgrade process of the metadata schema the schema_version is
set to 0, 0, 0. This behavior is used for other components to detect a
schema upgrade process and hold back metadata refreshes during upgrades.
*/
DROP VIEW IF EXISTS schema_version;
CREATE SQL SECURITY INVOKER VIEW schema_version (major, minor, patch) AS SELECT 2, 0, 0;
-- GR Cluster Tables
-- -----------------
/*
Basic information about clusters in general.
Both InnoDB clusters and replicasets are represented as clusters in
this table, with different cluster_type values.
*/
CREATE TABLE IF NOT EXISTS clusters (
/*
unique ID used to distinguish the cluster from other clusters
*/
`cluster_id` CHAR(36) CHARACTER SET ascii COLLATE ascii_general_ci,
/*
user specified name for the cluster. cluster_name must be unique
*/
`cluster_name` VARCHAR(40) NOT NULL,
/*
Brief description of the cluster.
*/
`description` TEXT,
/*
Cluster options explicitly set by the user from the Shell.
*/
`options` JSON,
/*
Contain attributes assigned to each cluster.
The attributes can be used to tag the clusters with custom attributes.
{
group_replication_group_name: "254616cc-fb47-11e5-aac5"
}
*/
`attributes` JSON,
/*
Whether this is a GR or AR "cluster" (that is, an InnoDB cluster or an
Async ReplicaSet).
*/
`cluster_type` ENUM('gr', 'ar') NOT NULL,
/*
Specifies the type of topology of a cluster as last known by the shell.
This is just a snapshot of the GR configuration and should be automatically
refreshed by the shell.
*/
`primary_mode` ENUM('pm', 'mm') NOT NULL DEFAULT 'pm',
/*
Default options for Routers.
*/
`router_options` JSON,
PRIMARY KEY(cluster_id)
) ENGINE = InnoDB CHARSET = utf8mb4 ROW_FORMAT = DYNAMIC;
/*
Managed MySQL server instances and basic information about them.
*/
CREATE TABLE IF NOT EXISTS instances (
/*
The ID of the server instance and is a unique identifier of the server
instance.
*/
`instance_id` INT UNSIGNED AUTO_INCREMENT,
/*
Cluster ID that the server belongs to.
*/
`cluster_id` CHAR(36) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL,
/*
network address of the host of the instance.
Taken from @@report_host or @@hostname
*/
`address` VARCHAR(265) CHARACTER SET ascii COLLATE ascii_general_ci,
/*
MySQL generated server_uuid for the instance
*/
`mysql_server_uuid` CHAR(36) CHARACTER SET ascii COLLATE ascii_general_ci
NOT NULL,
/*
Unique, user specified name for the server.
Default is address:port (must fit at least 255 chars of address + port)
*/
`instance_name` VARCHAR(265) NOT NULL,
/*
A JSON document with the addresses available for the server instance. The
protocols and addresses are further described in the Protocol section below.
{
mysqlClassic: "host.foo.com:3306",
mysqlX: "host.foo.com:33060",
grLocal: "host.foo.com:49213"
}
*/
`addresses` JSON NOT NULL,
/*
Contain attributes assigned to the server and is a JSON data type with
key-value pair. The attributes can be used to tag the servers with custom
attributes.
*/
`attributes` JSON,
/*
An optional brief description of the group.
*/
`description` TEXT,
PRIMARY KEY(instance_id, cluster_id),
FOREIGN KEY (cluster_id) REFERENCES clusters(cluster_id)
) ENGINE = InnoDB CHARSET = utf8mb4 ROW_FORMAT = DYNAMIC;
-- AR ReplicaSet Tables
-- ---------------------
/*
A "view" of the topology of a replicaset at a given point in time.
Every time topology of the replicaset changes (added and removed instances
and failovers), a new record is added here (and in async_cluster_members).
The most current view will be the one with the highest view_id.
This table maintains a history of replicaset configurations, but older
records may get deleted.
*/
CREATE TABLE IF NOT EXISTS async_cluster_views (
`cluster_id` CHAR(36) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL,
`view_id` INT UNSIGNED NOT NULL,
/*
The type of the glboal topology between clusters.
Changing the topology_type is not currently supported, so this value
must always be copied when a view changes.
*/
`topology_type` ENUM('SINGLE-PRIMARY-TREE'),
/*
What caused the view change. Possible values are pre-defined by the shell.
*/
`view_change_reason` VARCHAR(32) NOT NULL,
/*
Timestamp of the change.
*/
`view_change_time` TIMESTAMP(6) NOT NULL,
/*
Information about the cause for a view change.
*/
`view_change_info` JSON NOT NULL,
`attributes` JSON NOT NULL,
PRIMARY KEY (cluster_id, view_id),
INDEX (view_id),
FOREIGN KEY (cluster_id)
REFERENCES clusters (cluster_id)
) ENGINE = InnoDB CHARSET = utf8mb4 ROW_FORMAT = DYNAMIC;
/*
The instances that are part of a given view, along with their replication
master. The PRIMARY will have a NULL master.
*/
CREATE TABLE IF NOT EXISTS async_cluster_members (
`cluster_id` CHAR(36) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL,
`view_id` INT UNSIGNED NOT NULL,
/*
Reference to an instance in the instances table.
This reference may become invalid for older views, for instances that are
removed from the replicaset.
*/
`instance_id` INT UNSIGNED NOT NULL,
/*
id of the master of this instance. NULL if this is the PRIMARY.
*/
`master_instance_id` INT UNSIGNED,
/*
TRUE if this is the PRIMARY of the replicaset.
*/
`primary_master` BOOL NOT NULL,
`attributes` JSON NOT NULL,
PRIMARY KEY (cluster_id, view_id, instance_id),
INDEX (view_id),
INDEX (instance_id),
FOREIGN KEY (cluster_id, view_id)
REFERENCES async_cluster_views (cluster_id, view_id)
) ENGINE = InnoDB CHARSET = utf8mb4 ROW_FORMAT = DYNAMIC;
/*
This table contain a list of all router instances that are tracked by the
cluster.
*/
CREATE TABLE IF NOT EXISTS routers (
/*
The ID of the router instance and is a unique identifier of the server
instance.
*/
`router_id` INT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
/*
A user specified name for an instance of the router.
Should default to address:port, where port is the RW port for classic
protocol.
*/
`router_name` VARCHAR(265) NOT NULL,
/*
The product name of the routing component, e.g. 'MySQL Router'
*/
`product_name` VARCHAR(128) NOT NULL,
/*
network address of the host the Router is running on.
*/
`address` VARCHAR(256) CHARACTER SET ascii COLLATE ascii_general_ci,
/*
The version of the router instance. Updated on bootstrap and each startup
of the router instance. Format: x.y.z, 3 digits for each component.
Managed by Router.
*/
`version` VARCHAR(12) DEFAULT NULL,
/*
A timestamp updated by the router every hour with the current time. This
timestamp is used to detect routers that are no longer used or stalled.
Managed by Router.
*/
`last_check_in` TIMESTAMP NULL DEFAULT NULL,
/*
Router specific custom attributes.
Managed by Router.
*/
`attributes` JSON,
/*
The ID of the cluster this router instance is routing to.
(implicit foreign key to avoid trouble when deleting a cluster).
For backwards compatibility, if NULL, assumes there's a single cluster
in the metadata.
*/
`cluster_id` CHAR(36) CHARACTER SET ascii COLLATE ascii_general_ci
DEFAULT NULL,
/*
Router instance specific configuration options.
Managed by Shell.
*/
`options` JSON DEFAULT NULL,
UNIQUE KEY (address, router_name)
) ENGINE = InnoDB CHARSET = utf8mb4 ROW_FORMAT = DYNAMIC;
/*
This table contains a list of all REST user accounts that are granted
access to the routers REST interface. These are managed by the shell
per cluster.
*/
CREATE TABLE IF NOT EXISTS router_rest_accounts (
/*
The ID of the cluster this router account applies to.
(implicit foreign key to avoid trouble when deleting a cluster).
*/
`cluster_id` CHAR(36) CHARACTER SET ascii COLLATE ascii_general_ci
NOT NULL,
/*
The name of the user account.
*/
`user` VARCHAR(256) NOT NULL,
/*
The authentication method used.
*/
`authentication_method` VARCHAR(64) NOT NULL DEFAULT 'modular_crypt_format',
/*
The authentication string of the user account. The password is stored
hashed, salted, multiple-rounds.
*/
`authentication_string` TEXT CHARACTER SET ascii COLLATE ascii_general_ci
DEFAULT NULL,
/*
A short description of the user account.
*/
`description` VARCHAR(255) DEFAULT NULL,
/*
Stores the users privileges in a JSON document. Example:
{readPriv: "Y", updatePriv: "N"}
*/
`privileges` JSON,
/*
Additional attributes for the user account
*/
`attributes` JSON DEFAULT NULL,
PRIMARY KEY (cluster_id, user)
) ENGINE = InnoDB CHARSET = utf8mb4 ROW_FORMAT = DYNAMIC;
-- Public Interface Views
-- ----------------------
/*
These views will remain backwards compatible even if the internal schema
change. No existing columns will have their types changed or removed,
although new columns may be added in the future.
*/
DROP VIEW IF EXISTS v2_clusters;
CREATE SQL SECURITY INVOKER VIEW v2_clusters AS
SELECT
c.cluster_type,
c.primary_mode,
c.cluster_id,
c.cluster_name,
c.router_options
FROM clusters c;
DROP VIEW IF EXISTS v2_gr_clusters;
CREATE SQL SECURITY INVOKER VIEW v2_gr_clusters AS
SELECT
c.cluster_type,
c.primary_mode,
c.cluster_id as cluster_id,
c.cluster_name as cluster_name,
c.attributes->>'$.group_replication_group_name' as group_name,
c.attributes,
c.options,
c.router_options,
c.description as description,
NULL as replicated_cluster_id
FROM clusters c
WHERE c.cluster_type = 'gr';
DROP VIEW IF EXISTS v2_instances;
CREATE SQL SECURITY INVOKER VIEW v2_instances AS
SELECT i.instance_id,
i.cluster_id,
i.instance_name as label,
i.mysql_server_uuid,
i.address,
i.addresses->>'$.mysqlClassic' as endpoint,
i.addresses->>'$.mysqlX' as xendpoint,
i.attributes
FROM instances i;
DROP VIEW IF EXISTS v2_ar_clusters;
CREATE SQL SECURITY INVOKER VIEW v2_ar_clusters AS
SELECT
acv.view_id,
c.cluster_type,
c.primary_mode,
acv.topology_type as async_topology_type,
c.cluster_id,
c.cluster_name,
c.attributes,
c.options,
c.router_options,
c.description
FROM clusters c
JOIN async_cluster_views acv
ON c.cluster_id = acv.cluster_id
WHERE acv.view_id = (SELECT max(view_id)
FROM async_cluster_views
WHERE c.cluster_id = cluster_id)
AND c.cluster_type = 'ar';
DROP VIEW IF EXISTS v2_ar_members;
CREATE SQL SECURITY INVOKER VIEW v2_ar_members AS
SELECT
acm.view_id,
i.cluster_id,
i.instance_id,
i.instance_name as label,
i.mysql_server_uuid as member_id,
IF(acm.primary_master, 'PRIMARY', 'SECONDARY') as member_role,
acm.master_instance_id as master_instance_id,
mi.mysql_server_uuid as master_member_id
FROM instances i
LEFT JOIN async_cluster_members acm
ON acm.cluster_id = i.cluster_id AND acm.instance_id = i.instance_id
LEFT JOIN instances mi
ON mi.instance_id = acm.master_instance_id
WHERE acm.view_id = (SELECT max(view_id)
FROM async_cluster_views WHERE i.cluster_id = cluster_id);
/*
Returns information about the InnoDB cluster or replicaset the server
being queried is part of.
*/
DROP VIEW IF EXISTS v2_this_instance;
CREATE SQL SECURITY INVOKER VIEW v2_this_instance AS
SELECT i.cluster_id,
i.instance_id,
c.cluster_name,
c.cluster_type
FROM v2_instances i
JOIN clusters c ON i.cluster_id = c.cluster_id
WHERE i.mysql_server_uuid = (SELECT convert(variable_value using ascii)
FROM performance_schema.global_variables
WHERE variable_name = 'server_uuid');
/*
List of registered router instances. New routers will do inserts into this
VIEW during bootstrap. They will also update the version, last_check_in and
attributes field during runtime.
*/
DROP VIEW IF EXISTS v2_routers;
CREATE SQL SECURITY INVOKER VIEW v2_routers AS
SELECT r.router_id,
r.cluster_id,
r.router_name,
r.product_name,
r.address,
r.version,
r.last_check_in,
r.attributes,
r.options
FROM routers r;
/*
List of REST user accounts that are granted access to the routers REST
interface. These are managed by the shell per cluster and consumed by the
router.
*/
DROP VIEW IF EXISTS v2_router_rest_accounts;
CREATE SQL SECURITY INVOKER VIEW v2_router_rest_accounts AS
SELECT a.cluster_id,
a.user,
a.authentication_method,
a.authentication_string,
a.description,
a.privileges,
a.attributes
FROM router_rest_accounts a; | the_stack |
set enable_global_stats = true;
--01--------------------------------------------------------------------
--syntax test , base update command
create table cstore_update_table
(
c1 int ,
c2 int
)with(orientation = column)
partition by range (c1)
(
partition cstore_update_table_p0 values less than (5),
partition cstore_update_table_p1 values less than (10),
partition cstore_update_table_p2 values less than (15)
);
create index on cstore_update_table(c1,c2)local;
insert into cstore_update_table select generate_series(0,10), generate_series(0,10);
select * from cstore_update_table order by c1;
--10 rows 1---10
update cstore_update_table set c2 = c2 + 10;
select * from cstore_update_table order by c1;
--10 rows 10---20
drop table cstore_update_table;
--02--------------------------------------------------------------------
--where clause
create table cstore_update_table
(
c1 int ,
c2 int
)with(orientation = column)
partition by range (c1)
(
partition cstore_update_table_p0 values less than (5),
partition cstore_update_table_p1 values less than (10),
partition cstore_update_table_p2 values less than (15)
);
create index on cstore_update_table(c1,c2)local;
insert into cstore_update_table select generate_series(0,10), generate_series(0,10);
select * from cstore_update_table order by c1;
--10 rows 1---10
update cstore_update_table set c2 = c2 + 10 where c2 > 5;
select * from cstore_update_table order by 1, 2;
--10 rows 1-5 16-20
drop table cstore_update_table;
--05--------------------------------------------------------------------
--update the non partition key column
create table cstore_update_table
(
c1 int ,
c2 int ,
c3 int
)with(orientation = column)
partition by range (c1, c2)
(
partition cstore_update_table_p0 values less than (5,5),
partition cstore_update_table_p1 values less than (10,10),
partition cstore_update_table_p2 values less than (15,15)
);
create index on cstore_update_table(c1,c2)local;
insert into cstore_update_table select generate_series(0,10), generate_series(0,10), generate_series(0,10);
update cstore_update_table set c3 = 0 ;
select * from cstore_update_table order by 1, 2, 3;
-- 11 rows , all 0
drop table cstore_update_table;
--06--------------------------------------------------------------------
--update the partition key ,but no row movenment
create table cstore_update_table
(
c1 int ,
c2 int ,
c3 int
)with(orientation = column)
partition by range (c1, c2 )
(
partition cstore_update_table_p0 values less than (10,0),
partition cstore_update_table_p1 values less than (20,0),
partition cstore_update_table_p2 values less than (30,0)
);
create index on cstore_update_table(c1,c2)local;
insert into cstore_update_table select generate_series(0,29), generate_series(0,29), generate_series(0,29);
update cstore_update_table set c3 = 0 where c1 < 10 ;
select * from cstore_update_table order by 1, 2, 3;
-- 30 rows , c1 = 0 in first 10 rows
drop table cstore_update_table;
--07--------------------------------------------------------------------
--row movement ,but no interval partition been created
create table cstore_update_table
(
c1 int ,
c2 int ,
c3 int
)with(orientation = column)
partition by range (c1, c2 )
(
partition cstore_update_table_p0 values less than (10,0),
partition cstore_update_table_p1 values less than (20,0),
partition cstore_update_table_p2 values less than (30,0)
)enable row movement;
create index on cstore_update_table(c1, c2)local;
insert into cstore_update_table select generate_series(0,29), generate_series(0,29), generate_series(0,29);
update cstore_update_table set c3 = c3 + 5 where c1 < 10 ;
select * from cstore_update_table order by c1;
-- 30 rows , c1 = 0 in first 10 rows
drop table cstore_update_table;
--08--------------------------------------------------------------------
--update the partition key , has row movement ,and a new interval partition been created because of row movement
create table cstore_update_table
(
c1 int ,
c2 int ,
c3 int
)with(orientation = column)
partition by range (c1)
(
partition cstore_update_table_p0 values less than (10),
partition cstore_update_table_p1 values less than (20),
partition cstore_update_table_p2 values less than (30)
)enable row movement;
create index on cstore_update_table(c1,c2)local;
insert into cstore_update_table select generate_series(0,29), generate_series(0,29), generate_series(0,29);
update cstore_update_table set c3 = c3 + 5 where c1 < 30 ;
select * from cstore_update_table order by c1;
-- 30 rows , c1 = 0 in first 10 rows
drop table cstore_update_table;
--09--------------------------------------------------------------------
--update the partition key column , and set null to the column
create table cstore_update_table
(
c1 int ,
c2 int ,
c3 int
)with(orientation = column)
partition by range (c1, c2 )
(
partition cstore_update_table_p0 values less than (10,0),
partition cstore_update_table_p1 values less than (20,0),
partition cstore_update_table_p2 values less than (30,0)
);
create index on cstore_update_table(c1,c2)local;
insert into cstore_update_table select generate_series(0,29), generate_series(0,29), generate_series(0,29);
update cstore_update_table set c3 = NULL where c3 < 30 ;
select * from cstore_update_table order by 1, 2, 3;
-- 30 rows , c1 = 0 in first 10 rows
drop table cstore_update_table;
--12--------------------------------------------------------------------
--syntax test ,with clause
create table cstore_update_table1
(
c1 int ,
c2 int
)with(orientation = column);
insert into cstore_update_table1 select generate_series(0,9), generate_series(0,9);
create table cstore_update_table
(
c1 int ,
c2 int ,
c3 int
)with(orientation = column)
partition by range (c1 )
(
partition cstore_update_table_p0 values less than (10),
partition cstore_update_table_p1 values less than (20),
partition cstore_update_table_p2 values less than (30)
)
;
create index on cstore_update_table(c1,c2)local;
insert into cstore_update_table select generate_series(0,29), generate_series(0,29), generate_series(0,29);
select * from cstore_update_table order by 1, 2, 3;
with tmp as (select c1 from cstore_update_table1)
update cstore_update_table set c2 = 0 where cstore_update_table.c1 in (select u.c1 from tmp t , cstore_update_table u where t.c1 = u.c1);
select * from cstore_update_table order by 1, 2, 3;
drop table cstore_update_table;
drop table cstore_update_table1;
--16--------------------------------------------------------------------
--give a large value to create interval partition
create table cstore_update_table
(
c1 int ,
c2 int
)with(orientation = column)
partition by range (c1)
(
partition cstore_update_table_p0 values less than (50),
partition cstore_update_table_p1 values less than (100),
partition cstore_update_table_p2 values less than (150)
)enable row movement
;
create index on cstore_update_table(c1,c2)local;
insert into cstore_update_table values (1,1);
update cstore_update_table set c2 = 999999999 where c1 = 1;
--error the sequnece number is too large for range table
select c2 from cstore_update_table;
drop table cstore_update_table;
--17--------------------------------------------------------------------
--update with from clause
create table cstore_update_table
(
c1 int ,
c2 int
)with(orientation = column)
partition by range (c1)
(
partition cstore_update_table_p0 values less than (50),
partition cstore_update_table_p1 values less than (100),
partition cstore_update_table_p2 values less than (150)
)enable row movement
;
create table cstore_update_table1
(
c1 int ,
c2 int
)with(orientation = column)
partition by range (c1)
(
partition cstore_update_table1_p0 values less than (50),
partition cstore_update_table1_p1 values less than (100),
partition cstore_update_table1_p2 values less than (150)
)enable row movement
;
create index on cstore_update_table(c1,c2)local;
insert into cstore_update_table select generate_series(144,146),generate_series(4,6);
insert into cstore_update_table1 select generate_series(144,146),generate_series(7,9);
select * from cstore_update_table order by 1, 2;
select * from cstore_update_table1 order by 1, 2;
select * from cstore_update_table, cstore_update_table1 order by 1, 2, 3, 4;
update cstore_update_table set c2 = cstore_update_table1.c2 from cstore_update_table1 where cstore_update_table.c1 = cstore_update_table1.c1;
select * from cstore_update_table order by 1, 2;
drop table cstore_update_table;
drop table cstore_update_table1;
--18--------------------------------------------------------------------
--not null constraint
create table cstore_update_table
(
c1 int ,
c2 int not null,
c3 int
)with(orientation = column)
partition by range (c1,c2)
(
partition cstore_update_table_p0 values less than (50,0),
partition cstore_update_table_p1 values less than (100,0),
partition cstore_update_table_p2 values less than (150,0)
)enable row movement
;
create index on cstore_update_table(c1,c2)local;
insert into cstore_update_table values(99,null);
--error
insert into cstore_update_table values(99,0);
update cstore_update_table set c2 = null where c2 = 0;
--error
drop table cstore_update_table;
--19--------------------------------------------------------------------
create table cstore_update_table
(
c1 int,
c2 int
)with(orientation = column)
partition by range (c2)
(
partition cstore_update_table_p0 values less than (10),
partition cstore_update_table_p1 values less than (20),
partition cstore_update_table_p2 values less than (30)
)enable row movement;
create index on cstore_update_table(c1,c2)local;
insert into cstore_update_table values (0, 5);
select * from cstore_update_table partition (cstore_update_table_p0);
update cstore_update_table set c2=15 where c2=5;
select * from cstore_update_table partition (cstore_update_table_p0);
select * from cstore_update_table partition (cstore_update_table_p1);
drop table cstore_update_table;
CREATE TABLE hw_partition_update_tt(c_id int NOT NULL,c_first varchar(16) NOT NULL,c_data varchar(500))
with(orientation = column)
partition by range(c_id)
(
partition hw_partition_update_tt_p1 values less than (11),
partition hw_partition_update_tt_p2 values less than (31)
) ENABLE ROW MOVEMENT;
insert into hw_partition_update_tt values(1,'aaaaaaaaaaaaaaaa','aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
insert into hw_partition_update_tt values(3,'aaaaaaaaaaaaaaaa','aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
insert into hw_partition_update_tt values(5,'aaaaaaaaaaaaaaaa','aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
insert into hw_partition_update_tt values(7,'aaaaaaaaaaaaaaaa','aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
insert into hw_partition_update_tt values(10,'aaaaaaaaaaaaaaaa','aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
insert into hw_partition_update_tt values(15,'aaaaaaaaaaaaaaaa','aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
insert into hw_partition_update_tt values(18,'aaaaaaaaaaaaaaaa','aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
insert into hw_partition_update_tt values(24,'aaaaaaaaaaaaaaaa','aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
insert into hw_partition_update_tt values(28,'aaaaaaaaaaaaaaaa','aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
START TRANSACTION ISOLATION LEVEL READ COMMITTED;
UPDATE hw_partition_update_tt SET (c_first,c_data) = ('aaaaa','aaaaa') where c_id > 10 and c_id <= 20;
SELECT distinct c_first,c_data,count(c_first) FROM hw_partition_update_tt where c_id > 10 and c_id <= 20 GROUP BY c_first,c_data order by c_first;
-- /* skip the case for pgxc */
--SELECT RELNAME FROM PG_PARTITION WHERE PARENTID IN (SELECT OID FROM PG_CLASS WHERE RELNAME IN ('hw_partition_update_tt')) order by RELNAME;
--PRAGMA AUTONOMOUS_TRANSACTION;
--UPDATE hw_partition_update_tt SET (c_id,c_first,c_data) = (c_id + 10000,'aaaaa','aaaaa') where c_id > 20;
--SELECT RELNAME FROM PG_PARTITION WHERE PARENTID IN (SELECT OID FROM PG_CLASS WHERE RELNAME IN ('hw_partition_update_tt')) order by RELNAME;
--SELECT distinct c_first,c_data,count(c_first) FROM hw_partition_update_tt where c_id > 10000 GROUP BY c_first,c_data order by c_first;
--ROLLBACK;
SELECT distinct c_first,c_data,count(c_first) FROM hw_partition_update_tt where c_id > 10 and c_id <= 20 GROUP BY c_first,c_data order by c_first;
SELECT count(c_first) FROM hw_partition_update_tt;
COMMIT;
DROP TABLE hw_partition_update_tt;
create table test_update_rowmovement (a int, b int)
with(orientation = column)
partition by range (b)
(
partition test_update_rowmovement_p1 values less than (10)
) enable row movement;
insert into test_update_rowmovement values (-1, 5);
update test_update_rowmovement set b=16;
drop table test_update_rowmovement; | the_stack |
-- Copyright (c) 2007-2018 Carnegie Mellon University. All Rights Reserved. See COPYRIGHT file for details.
CREATE TABLE IF NOT EXISTS CcsmMetrics (
File TEXT KEY,
Func TEXT,
FileCnt INTEGER,
FileSize INTEGER,
FuncCnt INTEGER,
KwIfCnt INTEGER,
RawKwIfCnt INTEGER,
KwElseCnt INTEGER,
RawKwElseCnt INTEGER,
KwForCnt INTEGER,
RawKwForCnt INTEGER,
KwReturnCnt INTEGER,
RawKwReturnCnt INTEGER,
KwDoCnt INTEGER,
RawKwDoCnt INTEGER,
KwWhileCnt INTEGER,
RawKwWhileCnt INTEGER,
KwSwitchCnt INTEGER,
RawKwSwitchCnt INTEGER,
KwCaseCnt INTEGER,
RawKwCaseCnt INTEGER,
KwBreakCnt INTEGER,
RawKwBreakCnt INTEGER,
KwDefaultCnt INTEGER,
RawKwDefaultCnt INTEGER,
KwGotoCnt INTEGER,
RawKwGotoCnt INTEGER,
KwAutoCnt INTEGER,
RawKwAutoCnt INTEGER,
KwVolatileCnt INTEGER,
KwCumVolatileCnt INTEGER,
RawKwVolatileCnt INTEGER,
RawKwCumVolatileCnt INTEGER,
KwConstCnt INTEGER,
KwCumConstCnt INTEGER,
RawKwConstCnt INTEGER,
RawKwCumConstCntRaw INTEGER,
KwBodyConstCnt INTEGER,
RawKwBodyConstCnt INTEGER,
KwTypedefCnt INTEGER,
KwCumTypedefCnt INTEGER,
RawKwTypedefCnt INTEGER,
RawKwCumTypedefCnt INTEGER,
KwContinueCnt INTEGER,
RawKwContinueCnt INTEGER,
KwUnionCnt INTEGER,
KwCumUnionCnt INTEGER,
KwBodyUnionCnt INTEGER,
RawKwUnionCnt INTEGER,
RawKwCumUnionCnt INTEGER,
RawKwBodyUnionCnt INTEGER,
KwStructCnt INTEGER,
KwCumStructCnt INTEGER,
KwBodyStructCnt INTEGER,
RawKwStructCnt INTEGER,
RawKwCumStructCnt INTEGER,
RawKwBodyStructCnt INTEGER,
KwEnumCnt INTEGER,
KwCumEnumCnt INTEGER,
KwBodyEnumCnt INTEGER,
RawKwEnumCnt INTEGER,
RawKwCumEnumCnt INTEGER,
RawKwBodyEnumCnt INTEGER,
KwCharCnt INTEGER,
KwCumCharCnt INTEGER,
KwBodyCharCnt INTEGER,
RawKwCharCnt INTEGER,
RawKwCumCharCnt INTEGER,
RawKwBodyCharCnt INTEGER,
KwUnsignedCnt INTEGER,
KwCumUnsignedCnt INTEGER,
KwBodyUnsignedCnt INTEGER,
RawKwUnsignedCnt INTEGER,
RawKwCumUnsignedCnt INTEGER,
RawKwBodyUnsignedCnt INTEGER,
KwSignedCnt INTEGER,
KwCumSignedCnt INTEGER,
KwBodySignedCnt INTEGER,
RawKwSignedCnt INTEGER,
RawKwCumSignedCnt INTEGER,
RawKwBodySignedCnt INTEGER,
KwDoubleCnt INTEGER,
KwCumDoubleCnt INTEGER,
KwBodyDoubleCnt INTEGER,
RawKwDoubleCnt INTEGER,
RawKwCumDoubleCnt INTEGER,
RawKwBodyDoubleCnt INTEGER,
KwFloatCnt INTEGER,
KwCumFloatCnt INTEGER,
KwBodyFloatCnt INTEGER,
RawKwFloatCnt INTEGER,
RawKwCumFloatCnt INTEGER,
RawKwBodyFloatCnt INTEGER,
KwIntCnt INTEGER,
KwCumIntCnt INTEGER,
KwBodyIntCnt INTEGER,
RawKwIntCnt INTEGER,
RawKwCumIntCnt INTEGER,
RawKwBodyIntCnt INTEGER,
KwLongCnt INTEGER,
KwCumLongCnt INTEGER,
KwBodyLongCnt INTEGER,
RawKwLongCnt INTEGER,
RawKwCumLongCnt INTEGER,
RawKwBodyLongCnt INTEGER,
KwShortCnt INTEGER,
KwCumShortCnt INTEGER,
KwBodyShortCnt INTEGER,
RawKwShortCnt INTEGER,
RawKwCumShortCnt INTEGER,
RawKwBodyShortCnt INTEGER,
KwStaticCnt INTEGER,
KwCumStaticCnt INTEGER,
KwBodyStaticCnt INTEGER,
RawKwStaticCnt INTEGER,
RawKwCumStaticCnt INTEGER,
RawKwBodyStaticCnt INTEGER,
KwExternCnt INTEGER,
KwCumExternCnt INTEGER,
RawKwExternCnt INTEGER,
RawKwCumExternCnt INTEGER,
KwRegisterCnt INTEGER,
KwCumRegisterCnt INTEGER,
RawKwRegisterCnt INTEGER,
RawKwCumRegisterCnt INTEGER,
KwVoidCnt INTEGER,
KwCumVoidCnt INTEGER,
KwBodyVoidCnt INTEGER,
RawKwVoidCnt INTEGER,
RawKwCumVoidCnt INTEGER,
RawKwBodyVoidCnt INTEGER,
KwSizeofCnt INTEGER,
KwCumSizeofCnt INTEGER,
RawKwSizeofCnt INTEGER,
RawKwCumSizeofCnt INTEGER,
KwCnt INTEGER,
KwCumCnt INTEGER,
KwTypesCnt INTEGER,
KwCumTypesCnt INTEGER,
IdentLabelCnt INTEGER,
RawIdentLabelCnt INTEGER,
NumericConstCnt INTEGER,
NumericConstCntCum INTEGER,
NumericConstUniq INTEGER,
NumericConstUniqCum INTEGER,
RawNumericConstCnt INTEGER,
RawNumericConstCntCum INTEGER,
RawNumericConstUniq INTEGER,
RawNumericConstUniqCum INTEGER,
StringLiterals INTEGER,
StringLiteralsCum INTEGER,
StringLiteralsUniq INTEGER,
StringLiteralsUniqCum INTEGER,
RawStringLiterals INTEGER,
RawStringLiteralsCum INTEGER,
RawStringLiteralsUniq INTEGER,
RawStringLiteralsUniqCum INTEGER,
CharConsts INTEGER,
CharConstsUniq INTEGER,
RawCharConsts INTEGER,
RawCharConstsUniq INTEGER,
UnreservedIdentifiers INTEGER,
UnreservedIdentifiersUniq INTEGER,
BodyUnreservedIdentifiers INTEGER,
BodyUnreservedIdentifiersUniq INTEGER,
RawUnreservedIdentifiers INTEGER,
RawUnreservedIdentifiersUniq INTEGER,
VarFileLocCnt INTEGER,
VarFileLocStaticCnt INTEGER,
VarFileExtCnt INTEGER,
VarFileVolatileCnt INTEGER,
VarFileConstCnt INTEGER,
VarFnLocCnt INTEGER,
VarFnLocStaticCnt INTEGER,
VarFnLocConstCnt INTEGER,
VarFnLocVolatileCnt INTEGER,
VarFnLocRegCnt INTEGER,
VarFnLocAutoCnt INTEGER,
VarFnExtCnt INTEGER,
ReturnPointCnt INTEGER,
StmtCnt INTEGER,
StmtCumCnt INTEGER,
RawStmtCnt INTEGER,
RawStmtCumCnt INTEGER,
CommentHisComf Float,
CommentByteCnt INTEGER,
CommentCnt INTEGER,
Mccabe INTEGER,
MccabeMod INTEGER,
RawMccabe INTEGER,
RawMccabeMod INTEGER,
FuncLocalCnt INTEGER,
FuncExternExplCnt INTEGER,
FuncExternExplCumCnt INTEGER,
FuncExternImplCnt INTEGER,
FuncExternImplCumCnt INTEGER,
FuncInlineCnt INTEGER,
FuncCalledByLocal INTEGER,
FuncCalledByExtern INTEGER,
OpFnCallCnt INTEGER,
FuncPaths INTEGER,
OpFnCallUniqueCnt INTEGER,
LocalFnCallCnt INTEGER,
FileLineCnt INTEGER,
FuncDefinitionLineCnt INTEGER,
FuncBodyLineCnt INTEGER,
StmtHisParam INTEGER,
DecisionsTodo INTEGER,
LoopsTodo INTEGER,
FuncNesting INTEGER,
HisVocf Float,
OpAssignCnt INTEGER,
OpAddCnt INTEGER,
OpAddAssignCnt INTEGER,
OpSubCnt INTEGER,
OpSubAssignCnt INTEGER,
OpUnaryPlusCnt INTEGER,
OpUnaryMinusCnt INTEGER,
OpMultCnt INTEGER,
OpMultAssignCnt INTEGER,
OpDivCnt INTEGER,
OpDivAssignCnt INTEGER,
OpModCnt INTEGER,
OpModAssignCnt INTEGER,
OpIncPreCnt INTEGER,
OpIncPostCnt INTEGER,
OpDecPreCnt INTEGER,
OpDecPostCnt INTEGER,
OpShftLeftCnt INTEGER,
OpShftLeftAssignCnt INTEGER,
OpShftRghtCnt INTEGER,
OpShftRghtAssignCnt INTEGER,
OpCmpLtCnt INTEGER,
OpCmpGtCnt INTEGER,
OpCmpLtEqCnt INTEGER,
OpCmpGtEqCnt INTEGER,
OpCmpEqCnt INTEGER,
OpCmpNeqCnt INTEGER,
OpCommaCnt INTEGER,
OpTernaryCnt INTEGER,
OpLogAndCnt INTEGER,
OpLogOrCnt INTEGER,
OpLogNitCnt INTEGER,
OpBitwiseAndCnt INTEGER,
OpBitwiseAndAssignCnt INTEGER,
OpBitwiseOrCnt INTEGER,
OpBitwiseOrAssignCnt INTEGER,
OpBitwiseXorCnt INTEGER,
OpBitwiseXorAssignCnt INTEGER,
OpBitwiseNotCnt INTEGER,
OpPtrToMemberDirectCnt INTEGER,
OpPtrToMemberIndirectCnt INTEGER,
OpAddrOfCnt INTEGER,
OpDerefCnt INTEGER,
OpArraySubscriptCnt INTEGER,
OpMemberAccessDirectCnt INTEGER,
OpMemberAccessPointerCnt INTEGER,
OpAlignofCnt INTEGER,
OpCastCnt INTEGER,
OpTypesCnt INTEGER,
OpTypesCntCum INTEGER,
OpCnt INTEGER,
OpCntCum INTEGER,
HalsteadOperatorUniqueCnt INTEGER,
HalsteadOperatorCnt INTEGER,
HalsteadOperandUniqueCnt INTEGER,
HalsteadOperandCnt INTEGER,
HalsteadVocabulary INTEGER,
HalsteadLength INTEGER,
HalsteadCalcLength REAL,
HalsteadVolume REAL,
HalsteadDifficulty REAL,
TokBool INTEGER,
TokInline INTEGER,
TokVirtual INTEGER,
TokMutable INTEGER,
TokFriend INTEGER,
TokAsm INTEGER,
TokClass INTEGER,
TokDelete INTEGER,
TokNew INTEGER,
TokOperator INTEGER,
TokPrivate INTEGER,
TokProtected INTEGER,
TokPublic INTEGER,
TokThis INTEGER,
TokNamespace INTEGER,
TokUsing INTEGER,
TokTry INTEGER,
TokCatch INTEGER,
TokThrow INTEGER,
TokTypeid INTEGER,
TokTemplate INTEGER,
TokExplicit INTEGER,
TokTrue INTEGER,
TokFalse INTEGER,
TokTypename INTEGER,
TokNot INTEGER,
TokNotEqual INTEGER,
TokModulo INTEGER,
TokModuloAssign INTEGER,
TokAmp INTEGER,
TokAmpamp INTEGER,
TokPipepipe INTEGER,
TokAndAssign INTEGER,
TokLparen INTEGER,
TokRparen INTEGER,
TokAsterisk INTEGER,
TokAsteriskAssign INTEGER,
TokPlus INTEGER,
TokPlusplus INTEGER,
TokPlusAssign INTEGER,
TokComma INTEGER,
TokMinus INTEGER,
TokMinusminus INTEGER,
TokMinusAssign INTEGER,
TokMemberPtr INTEGER,
TokMemberRef INTEGER,
TokEllipsis INTEGER,
TokSlash INTEGER,
TokSlashAssign INTEGER,
TokColon INTEGER,
TokColoncolon INTEGER,
TokLess INTEGER,
TokLessless INTEGER,
TokLesslessAssign INTEGER,
TokLessEqual INTEGER,
TokAssign INTEGER,
TokComparison INTEGER,
TokMore INTEGER,
TokMoremore INTEGER,
TokMoremoreAssign INTEGER,
TokMoreEqual INTEGER,
TokLsquare INTEGER,
TokRsquare INTEGER,
TokLbrace INTEGER,
TokRbrace INTEGER,
TokQuestion INTEGER,
TokCaret INTEGER,
TokCaretAssign INTEGER,
TokPipe INTEGER,
TokPipeAssign INTEGER,
TokTilde INTEGER,
HisCalling INTEGER
); | the_stack |
-- 2019-09-19T10:57:58.554Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process (AccessLevel,AD_Client_ID,AD_Org_ID,AD_Process_ID,AllowProcessReRun,Classname,CopyFromProcess,Created,CreatedBy,EntityType,IsActive,IsApplySecuritySettings,IsBetaFunctionality,IsDirectPrint,IsOneInstanceOnly,IsReport,IsServerProcess,IsTranslateExcelHeaders,IsUseBPartnerLanguage,LockWaitTimeout,Name,RefreshAllAfterExecution,ShowHelp,Type,Updated,UpdatedBy,Value) VALUES ('3',0,0,541196,'N','de.metas.banking.process.paymentdocumentform.WEBUI_Import_Payment_Request_For_Purchase_Invoice','N',TO_TIMESTAMP('2019-09-19 13:57:58','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.ui.web','Y','N','N','N','N','N','N','Y','Y',0,'Import Payment Request for Purchase Invoice','N','Y','Java',TO_TIMESTAMP('2019-09-19 13:57:58','YYYY-MM-DD HH24:MI:SS'),100,'WEBUI_Import_Payment_Request_For_Purchase_Invoice')
;
-- 2019-09-19T10:57:58.568Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Trl (AD_Language,AD_Process_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Process_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Process_ID=541196 AND NOT EXISTS (SELECT 1 FROM AD_Process_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_ID=t.AD_Process_ID)
;
-- 2019-09-19T10:58:40.997Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2019-09-19 13:58:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_US' AND AD_Process_ID=541196
;
-- 2019-09-19T11:01:41.545Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Name='Imported Payment String', PrintName='Imported Payment String',Updated=TO_TIMESTAMP('2019-09-19 14:01:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=543079 AND AD_Language='en_US'
;
-- 2019-09-19T11:01:41.594Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(543079,'en_US')
;
-- 2019-09-19T11:02:54.998Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,543079,0,541196,541588,10,'FullPaymentString',TO_TIMESTAMP('2019-09-19 14:02:54','YYYY-MM-DD HH24:MI:SS'),100,'Im Fall von ESR oder anderen von Zahlschein gelesenen Zahlungsaufforderungen ist dies der komplette vom Schein eingelesene String','de.metas.payment',0,'Y','N','Y','N','N','N','Eingelesene Zeichenkette',10,TO_TIMESTAMP('2019-09-19 14:02:54','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-09-19T11:02:55.001Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Process_Para_ID=541588 AND NOT EXISTS (SELECT 1 FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 2019-09-19T11:05:51.999Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Table_Process (AD_Client_ID,AD_Org_ID,AD_Process_ID,AD_Table_ID,AD_Table_Process_ID,AD_Window_ID,Created,CreatedBy,EntityType,IsActive,Updated,UpdatedBy,WEBUI_DocumentAction,WEBUI_IncludedTabTopAction,WEBUI_ViewAction,WEBUI_ViewQuickAction,WEBUI_ViewQuickAction_Default) VALUES (0,0,541196,318,540749,183,TO_TIMESTAMP('2019-09-19 14:05:51','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.ui.web','Y',TO_TIMESTAMP('2019-09-19 14:05:51','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N')
;
-- 2019-09-19T11:32:52.486Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,187,0,541196,541589,18,'C_BPartner_ID',TO_TIMESTAMP('2019-09-19 14:32:52','YYYY-MM-DD HH24:MI:SS'),100,'Bezeichnet einen Geschäftspartner','de.metas.ui.web',0,'Ein Geschäftspartner ist jemand, mit dem Sie interagieren. Dies kann Lieferanten, Kunden, Mitarbeiter oder Handelsvertreter umfassen.','Y','N','Y','N','N','N','Geschäftspartner',20,TO_TIMESTAMP('2019-09-19 14:32:52','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-09-19T11:32:52.492Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Process_Para_ID=541589 AND NOT EXISTS (SELECT 1 FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 2019-09-19T11:38:42.198Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,837,0,541196,541590,17,'C_BP_BankAccount_ID',TO_TIMESTAMP('2019-09-19 14:38:42','YYYY-MM-DD HH24:MI:SS'),100,'Bankverbindung des Geschäftspartners','de.metas.ui.web',0,'Y','N','Y','N','N','N','Bankverbindung',30,TO_TIMESTAMP('2019-09-19 14:38:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-09-19T11:38:42.200Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Process_Para_ID=541590 AND NOT EXISTS (SELECT 1 FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 2019-09-19T11:41:43.104Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,1367,0,541196,541591,22,'Amount',TO_TIMESTAMP('2019-09-19 14:41:42','YYYY-MM-DD HH24:MI:SS'),100,'Betrag in einer definierten Währung','de.metas.ui.web',0,'"Betrag" gibt den Betrag für diese Dokumentenposition an','Y','N','Y','N','N','N','Betrag',40,TO_TIMESTAMP('2019-09-19 14:41:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-09-19T11:41:43.107Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Process_Para_ID=541591 AND NOT EXISTS (SELECT 1 FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 2019-09-19T11:43:27.633Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET AD_Element_ID=2091, ColumnName='BankAccountNo', Description='Bank Account Number', Name='Bank Account No',Updated=TO_TIMESTAMP('2019-09-19 14:43:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541590
;
-- 2019-09-19T11:44:30.235Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET AD_Reference_ID=30,Updated=TO_TIMESTAMP('2019-09-19 14:44:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541589
;
-- 2019-09-19T11:44:32.334Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET IsAutocomplete='Y',Updated=TO_TIMESTAMP('2019-09-19 14:44:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541589
;
-- 2019-09-19T12:21:48.228Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET AD_Element_ID=837, AD_Reference_ID=18, ColumnName='C_BP_BankAccount_ID', Description='Bankverbindung des Geschäftspartners', Name='Bankverbindung',Updated=TO_TIMESTAMP('2019-09-19 15:21:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541590
;
-- 2019-09-19T12:23:04.519Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET AD_Val_Rule_ID=269,Updated=TO_TIMESTAMP('2019-09-19 15:23:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541590
;
-- 2019-09-19T12:24:33.364Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Val_Rule SET Code='C_BP_BankAccount.C_BPartner_ID=@C_BPartner_ID/-1@',Updated=TO_TIMESTAMP('2019-09-19 15:24:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=269
;
-- 2019-09-19T12:26:20.666Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2019-09-19 15:26:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=837 AND AD_Language='de_DE'
;
-- 2019-09-19T12:26:20.671Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(837,'de_DE')
;
-- 2019-09-19T12:26:20.741Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(837,'de_DE')
; | the_stack |
-- 2020-06-08T13:00:41.288Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process (AccessLevel,AD_Client_ID,AD_Org_ID,AD_Process_ID,AllowProcessReRun,Classname,CopyFromProcess,Created,CreatedBy,EntityType,IsActive,IsApplySecuritySettings,IsBetaFunctionality,IsDirectPrint,IsNotifyUserAfterExecution,IsOneInstanceOnly,IsReport,IsServerProcess,IsTranslateExcelHeaders,IsUseBPartnerLanguage,LockWaitTimeout,Name,RefreshAllAfterExecution,ShowHelp,Type,Updated,UpdatedBy,Value) VALUES ('3',0,0,584710,'Y','de.metas.ui.web.picking.husToPick.process.WEBUI_HUsToPick_Weight','N',TO_TIMESTAMP('2020-06-08 16:00:41','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.picking','Y','N','N','N','N','N','N','N','Y','Y',0,'Weight','N','N','Java',TO_TIMESTAMP('2020-06-08 16:00:41','YYYY-MM-DD HH24:MI:SS'),100,'WEBUI_HUsToPick_Weight')
;
-- 2020-06-08T13:00:41.317Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Trl (AD_Language,AD_Process_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Process_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Process_ID=584710 AND NOT EXISTS (SELECT 1 FROM AD_Process_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_ID=t.AD_Process_ID)
;
-- 2020-06-16T12:58:50.087Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,577763,0,'WeightGross',TO_TIMESTAMP('2020-06-16 15:58:49','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Gewicht Brutto kg','Gewicht Brutto kg',TO_TIMESTAMP('2020-06-16 15:58:49','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2020-06-16T12:58:50.230Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, CommitWarning,Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName,WEBUI_NameBrowse,WEBUI_NameNew,WEBUI_NameNewBreadcrumb, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Element_ID, t.CommitWarning,t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName,t.WEBUI_NameBrowse,t.WEBUI_NameNew,t.WEBUI_NameNewBreadcrumb, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' OR l.IsBaseLanguage='Y') AND t.AD_Element_ID=577763 AND NOT EXISTS (SELECT 1 FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 2020-06-16T12:58:53.447Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2020-06-16 15:58:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577763 AND AD_Language='de_CH'
;
-- 2020-06-16T12:58:53.603Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577763,'de_CH')
;
-- 2020-06-16T12:58:55.353Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2020-06-16 15:58:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577763 AND AD_Language='de_DE'
;
-- 2020-06-16T12:58:55.356Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577763,'de_DE')
;
-- 2020-06-16T12:58:55.407Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(577763,'de_DE')
;
-- 2020-06-16T12:59:55.058Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y', Name='Gross Weight', PrintName='Gross Weight',Updated=TO_TIMESTAMP('2020-06-16 15:59:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577763 AND AD_Language='en_US'
;
-- 2020-06-16T12:59:55.063Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577763,'en_US')
;
-- 2020-06-16T13:00:29.025Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,577764,0,'WeightNet',TO_TIMESTAMP('2020-06-16 16:00:28','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Gewicht Netto','Gewicht Netto',TO_TIMESTAMP('2020-06-16 16:00:28','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2020-06-16T13:00:29.030Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, CommitWarning,Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName,WEBUI_NameBrowse,WEBUI_NameNew,WEBUI_NameNewBreadcrumb, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Element_ID, t.CommitWarning,t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName,t.WEBUI_NameBrowse,t.WEBUI_NameNew,t.WEBUI_NameNewBreadcrumb, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' OR l.IsBaseLanguage='Y') AND t.AD_Element_ID=577764 AND NOT EXISTS (SELECT 1 FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 2020-06-16T13:00:37.702Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y', Name='Net Weight', PrintName='Net Weight',Updated=TO_TIMESTAMP('2020-06-16 16:00:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577764 AND AD_Language='en_US'
;
-- 2020-06-16T13:00:37.704Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577764,'en_US')
;
-- 2020-06-16T13:00:42.153Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2020-06-16 16:00:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577764 AND AD_Language='de_DE'
;
-- 2020-06-16T13:00:42.155Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577764,'de_DE')
;
-- 2020-06-16T13:00:42.175Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(577764,'de_DE')
;
-- 2020-06-16T13:00:43.496Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2020-06-16 16:00:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577764 AND AD_Language='de_CH'
;
-- 2020-06-16T13:00:43.498Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577764,'de_CH')
;
-- 2020-06-16T13:01:03.985Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,577765,0,'WeightTare',TO_TIMESTAMP('2020-06-16 16:01:03','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Gewicht Tara','Gewicht Tara',TO_TIMESTAMP('2020-06-16 16:01:03','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2020-06-16T13:01:04.009Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, CommitWarning,Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName,WEBUI_NameBrowse,WEBUI_NameNew,WEBUI_NameNewBreadcrumb, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Element_ID, t.CommitWarning,t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName,t.WEBUI_NameBrowse,t.WEBUI_NameNew,t.WEBUI_NameNewBreadcrumb, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' OR l.IsBaseLanguage='Y') AND t.AD_Element_ID=577765 AND NOT EXISTS (SELECT 1 FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 2020-06-16T13:01:07.563Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2020-06-16 16:01:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577765 AND AD_Language='de_DE'
;
-- 2020-06-16T13:01:07.566Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577765,'de_DE')
;
-- 2020-06-16T13:01:07.579Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(577765,'de_DE')
;
-- 2020-06-16T13:01:29.151Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y', Name='Tara Weight', PrintName='Tara Weight',Updated=TO_TIMESTAMP('2020-06-16 16:01:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577765 AND AD_Language='en_US'
;
-- 2020-06-16T13:01:29.155Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577765,'en_US')
;
-- 2020-06-16T13:02:02.538Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,577766,0,'WeightTareAdjust',TO_TIMESTAMP('2020-06-16 16:02:02','YYYY-MM-DD HH24:MI:SS'),100,'','U','Y','Tara anpassen','Tara anpassen',TO_TIMESTAMP('2020-06-16 16:02:02','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2020-06-16T13:02:02.546Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, CommitWarning,Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName,WEBUI_NameBrowse,WEBUI_NameNew,WEBUI_NameNewBreadcrumb, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Element_ID, t.CommitWarning,t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName,t.WEBUI_NameBrowse,t.WEBUI_NameNew,t.WEBUI_NameNewBreadcrumb, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' OR l.IsBaseLanguage='Y') AND t.AD_Element_ID=577766 AND NOT EXISTS (SELECT 1 FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 2020-06-16T13:02:05.501Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element SET EntityType='D',Updated=TO_TIMESTAMP('2020-06-16 16:02:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577766
;
-- 2020-06-16T13:02:16.355Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y', Name='Tare adjust', PrintName='Tare adjust',Updated=TO_TIMESTAMP('2020-06-16 16:02:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577766 AND AD_Language='en_US'
;
-- 2020-06-16T13:02:16.358Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577766,'en_US')
;
-- 2020-06-16T13:02:18.663Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2020-06-16 16:02:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577766 AND AD_Language='de_DE'
;
-- 2020-06-16T13:02:18.668Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577766,'de_DE')
;
-- 2020-06-16T13:02:18.687Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(577766,'de_DE')
;
-- 2020-06-16T13:02:20.217Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2020-06-16 16:02:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577766 AND AD_Language='de_CH'
;
-- 2020-06-16T13:02:20.222Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577766,'de_CH')
;
-- 2020-06-16T13:03:30.513Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,577767,0,'WeightGrossInitial',TO_TIMESTAMP('2020-06-16 16:03:30','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Gewicht Brutto kg (initial)','Gewicht Brutto kg (initial)',TO_TIMESTAMP('2020-06-16 16:03:30','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2020-06-16T13:03:30.532Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, CommitWarning,Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName,WEBUI_NameBrowse,WEBUI_NameNew,WEBUI_NameNewBreadcrumb, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Element_ID, t.CommitWarning,t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName,t.WEBUI_NameBrowse,t.WEBUI_NameNew,t.WEBUI_NameNewBreadcrumb, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' OR l.IsBaseLanguage='Y') AND t.AD_Element_ID=577767 AND NOT EXISTS (SELECT 1 FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 2020-06-16T13:03:45.985Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2020-06-16 16:03:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577767 AND AD_Language='de_CH'
;
-- 2020-06-16T13:03:45.989Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577767,'de_CH')
;
-- 2020-06-16T13:03:47.669Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2020-06-16 16:03:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577767 AND AD_Language='de_DE'
;
-- 2020-06-16T13:03:47.673Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577767,'de_DE')
;
-- 2020-06-16T13:03:47.695Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(577767,'de_DE')
;
-- 2020-06-16T13:03:56.075Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y', Name='Gross Weight (initial)', PrintName='Gross Weight (initial)',Updated=TO_TIMESTAMP('2020-06-16 16:03:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577767 AND AD_Language='en_US'
;
-- 2020-06-16T13:03:56.078Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577767,'en_US')
;
-- 2020-06-16T13:05:35.671Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,ReadOnlyLogic,SeqNo,Updated,UpdatedBy) VALUES (0,577767,0,584710,541827,29,'WeightGrossInitial',TO_TIMESTAMP('2020-06-16 16:05:35','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.picking',0,'Y','N','Y','N','N','N','Gewicht Brutto kg (initial)','1=2',10,TO_TIMESTAMP('2020-06-16 16:05:35','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2020-06-16T13:05:35.678Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Process_Para_ID=541827 AND NOT EXISTS (SELECT 1 FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 2020-06-16T13:05:58.984Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,577763,0,584710,541828,29,'WeightGross',TO_TIMESTAMP('2020-06-16 16:05:58','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.picking',0,'Y','N','Y','N','N','N','Gewicht Brutto kg',20,TO_TIMESTAMP('2020-06-16 16:05:58','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2020-06-16T13:05:58.988Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Process_Para_ID=541828 AND NOT EXISTS (SELECT 1 FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 2020-06-17T07:25:39.353Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,ReadOnlyLogic,SeqNo,Updated,UpdatedBy) VALUES (0,577765,0,584710,541829,29,'WeightTare',TO_TIMESTAMP('2020-06-17 10:25:39','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.picking',0,'Y','N','Y','N','N','N','Gewicht Tara','1=2',30,TO_TIMESTAMP('2020-06-17 10:25:39','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2020-06-17T07:25:39.394Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Process_Para_ID=541829 AND NOT EXISTS (SELECT 1 FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 2020-06-17T07:26:12.310Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,577766,0,584710,541830,29,'WeightTareAdjust',TO_TIMESTAMP('2020-06-17 10:26:12','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.picking',0,'Y','N','Y','N','N','N','Tara anpassen',40,TO_TIMESTAMP('2020-06-17 10:26:12','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2020-06-17T07:26:12.311Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Process_Para_ID=541830 AND NOT EXISTS (SELECT 1 FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 2020-06-17T07:26:28.646Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,ReadOnlyLogic,SeqNo,Updated,UpdatedBy) VALUES (0,577764,0,584710,541831,29,'WeightNet',TO_TIMESTAMP('2020-06-17 10:26:28','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.picking',0,'Y','N','Y','N','N','N','Gewicht Netto','1=2',50,TO_TIMESTAMP('2020-06-17 10:26:28','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2020-06-17T07:26:28.649Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Process_Para_ID=541831 AND NOT EXISTS (SELECT 1 FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 2020-06-25T10:23:14.156Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ReadOnlyLogic='1=1',Updated=TO_TIMESTAMP('2020-06-25 13:23:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541827
;
-- 2020-06-25T10:23:17.435Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ReadOnlyLogic='1=1',Updated=TO_TIMESTAMP('2020-06-25 13:23:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541829
;
-- 2020-06-25T10:23:21.337Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ReadOnlyLogic='1=1',Updated=TO_TIMESTAMP('2020-06-25 13:23:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541831
; | the_stack |
CREATE TABLE IF NOT EXISTS zeroex.view_0x_api_fills (
tx_hash bytea,
evt_index integer,
contract_address bytea,
block_time timestamptz,
maker bytea,
taker bytea,
taker_token bytea,
maker_token bytea,
taker_token_amount float,
taker_token_amount_raw numeric,
maker_token_amount float,
maker_token_amount_raw numeric,
"type" text,
affiliate_address bytea,
swap_flag boolean,
matcha_limit_order_flag boolean,
volume_usd float
);
CREATE OR REPLACE FUNCTION zeroex.insert_0x_api_fills (start_ts timestamptz, end_ts timestamptz=now()) RETURNS integer
LANGUAGE plpgsql AS $function$
DECLARE r integer;
BEGIN
WITH zeroex_tx_raw AS (
SELECT DISTINCT
v3.evt_tx_hash AS tx_hash
, case when "takerAddress" = '\x63305728359c088a52b0b0eeec235db4d31a67fc'::BYTEA then "takerAddress"
else null
end as affiliate_address
FROM zeroex_v3."Exchange_evt_Fill" v3
WHERE
-- nuo
v3."takerAddress" = '\x63305728359c088a52b0b0eeec235db4d31a67fc'::BYTEA
OR
-- contains a bridge order
(v3."feeRecipientAddress" = '\x1000000000000000000000000000000000000011'::BYTEA
AND SUBSTRING(v3."makerAssetData",1,4) = '\xdc1600f3'::bytea)
AND evt_block_time >= start_ts AND evt_block_time < end_ts
UNION
SELECT
tx_hash
, affiliate_address as affiliate_address
from zeroex."view_api_affiliate_data"
WHERE block_time >= start_ts AND block_time < end_ts
),
zeroex_tx AS (
SELECT
tx_hash
, MAX(affiliate_address::text)::bytea as affiliate_address
from zeroex_tx_raw
GROUP BY 1
),
v3_fills_no_bridge AS (
SELECT fills.evt_tx_hash AS tx_hash
, fills.evt_index
, fills.contract_address
, evt_block_time AS block_time
, fills."makerAddress" AS maker
, fills."takerAddress" AS taker
, SUBSTRING(fills."takerAssetData",17,20) AS taker_token
, SUBSTRING(fills."makerAssetData",17,20) AS maker_token
, fills."takerAssetFilledAmount" AS taker_token_amount_raw
, fills."makerAssetFilledAmount" AS maker_token_amount_raw
, 'Native Fill v3' as type
, COALESCE(zeroex_tx.affiliate_address, fills."feeRecipientAddress") as affiliate_address
, (zeroex_tx.tx_hash IS NOT NULL) AS swap_flag
, (fills."feeRecipientAddress" = '\x86003b044f70dac0abc80ac8957305b6370893ed'::bytea) AS matcha_limit_order_flag
FROM zeroex_v3."Exchange_evt_Fill" fills
LEFT join zeroex_tx on zeroex_tx.tx_hash = fills.evt_tx_hash
WHERE
(SUBSTRING("makerAssetData",1,4) != '\xdc1600f3'::BYTEA)
AND (
zeroex_tx.tx_hash IS NOT NULL
OR fills."feeRecipientAddress" = '\x86003b044f70dac0abc80ac8957305b6370893ed'::bytea
)
AND evt_block_time >= start_ts AND evt_block_time < end_ts
),
v4_rfq_fills_no_bridge AS (
SELECT fills.evt_tx_hash AS tx_hash
, fills.evt_index
, fills.contract_address
, fills.evt_block_time AS block_time
, fills.maker AS maker
, fills.taker AS taker
, fills."takerToken" AS taker_token
, fills."makerToken" AS maker_token
, fills."takerTokenFilledAmount" AS taker_token_amount_raw
, fills."makerTokenFilledAmount" AS maker_token_amount_raw
, 'Native Fill v4' as type
, zeroex_tx.affiliate_address as affiliate_address
, (zeroex_tx.tx_hash IS NOT NULL) AS swap_flag
, FALSE AS matcha_limit_order_flag
FROM zeroex."ExchangeProxy_evt_RfqOrderFilled" fills
LEFT join zeroex_tx on zeroex_tx.tx_hash = fills.evt_tx_hash
AND evt_block_time >= start_ts AND evt_block_time < end_ts
),
v4_limit_fills_no_bridge AS (
SELECT fills.evt_tx_hash AS tx_hash
, fills.evt_index
, fills.contract_address
, fills.evt_block_time AS block_time
, fills.maker AS maker
, fills.taker AS taker
, fills."takerToken" AS taker_token
, fills."makerToken" AS maker_token
, fills."takerTokenFilledAmount" AS taker_token_amount_raw
, fills."makerTokenFilledAmount" AS maker_token_amount_raw
, 'Native Fill v4' as type
, COALESCE(zeroex_tx.affiliate_address, fills."feeRecipient") as affiliate_address
, (zeroex_tx.tx_hash IS NOT NULL) AS swap_flag
, (fills."feeRecipient" = '\x86003b044f70dac0abc80ac8957305b6370893ed'::bytea) AS matcha_limit_order_flag
FROM zeroex."ExchangeProxy_evt_LimitOrderFilled" fills
LEFT join zeroex_tx on zeroex_tx.tx_hash = fills.evt_tx_hash
AND evt_block_time >= start_ts AND evt_block_time < end_ts
),
-- bridge fills
ERC20BridgeTransfer AS (
SELECT logs.tx_hash,
INDEX AS evt_index,
logs.contract_address,
block_time AS block_time,
substring(DATA,141,20) AS maker,
substring(DATA,173,20) AS taker,
substring(DATA,13,20) AS taker_token,
substring(DATA,45,20) AS maker_token,
bytea2numericpy(substring(DATA,77,20)) AS taker_token_amount_raw,
bytea2numericpy(substring(DATA,109,20)) AS maker_token_amount_raw,
'Bridge Fill' AS type,
zeroex_tx.affiliate_address as affiliate_address,
TRUE AS swap_flag,
FALSE AS matcha_limit_order_flag
FROM ethereum."logs" logs
join zeroex_tx on zeroex_tx.tx_hash = logs.tx_hash
WHERE topic1 = '\x349fc08071558d8e3aa92dec9396e4e9f2dfecd6bb9065759d1932e7da43b8a9'::bytea
AND block_time >= start_ts AND block_time < end_ts
),
BridgeFill AS (
SELECT logs.tx_hash,
INDEX AS evt_index,
logs.contract_address,
block_time AS block_time,
substring(DATA,13,20) AS maker,
'\xdef1c0ded9bec7f1a1670819833240f027b25eff'::bytea AS taker,
substring(DATA,45,20) AS taker_token,
substring(DATA,77,20) AS maker_token,
bytea2numericpy(substring(DATA,109,20)) AS taker_token_amount_raw,
bytea2numericpy(substring(DATA,141,20)) AS maker_token_amount_raw,
'Bridge Fill' AS type,
zeroex_tx.affiliate_address as affiliate_address,
TRUE AS swap_flag,
FALSE AS matcha_limit_order_flag
FROM ethereum."logs" logs
join zeroex_tx on zeroex_tx.tx_hash = logs.tx_hash
WHERE topic1 = '\xff3bc5e46464411f331d1b093e1587d2d1aa667f5618f98a95afc4132709d3a9'::bytea
AND block_time >= start_ts AND block_time < end_ts
),
NewBridgeFill AS (
SELECT logs.tx_hash,
INDEX AS evt_index,
logs.contract_address,
block_time AS block_time,
substring(DATA,13,20) AS maker,
'\xdef1c0ded9bec7f1a1670819833240f027b25eff'::bytea AS taker,
substring(DATA,45,20) AS taker_token,
substring(DATA,77,20) AS maker_token,
bytea2numeric(substring(DATA,109,20)) AS taker_token_amount_raw,
bytea2numeric(substring(DATA,141,20)) AS maker_token_amount_raw,
'Bridge Fill' AS type,
zeroex_tx.affiliate_address as affiliate_address,
TRUE AS swap_flag,
FALSE AS matcha_limit_order_flag
FROM ethereum."logs" logs
join zeroex_tx on zeroex_tx.tx_hash = logs.tx_hash
WHERE topic1 = '\xe59e71a14fe90157eedc866c4f8c767d3943d6b6b2e8cd64dddcc92ab4c55af8'::bytea
and contract_address = '\x22f9dcf4647084d6c31b2765f6910cd85c178c18'::bytea
AND block_time >= start_ts AND block_time < end_ts
),
direct_PLP AS (
SELECT plp.evt_tx_hash,
plp.evt_index AS evt_index,
plp.contract_address,
plp.evt_block_time AS block_time,
provider AS maker,
recipient AS taker,
"inputToken" AS taker_token,
"outputToken" AS maker_token,
"inputTokenAmount" AS taker_token_amount_raw,
"outputTokenAmount" AS maker_token_amount_raw,
'PLP Direct' AS type,
zeroex_tx.affiliate_address as affiliate_address,
TRUE AS swap_flag,
FALSE AS matcha_limit_order_flag
FROM zeroex."ExchangeProxy_evt_LiquidityProviderSwap" plp
join zeroex_tx on zeroex_tx.tx_hash = plp.evt_tx_hash
WHERE evt_block_time >= start_ts AND evt_block_time < end_ts
),
direct_uniswapv2 AS (
SELECT swap.evt_tx_hash AS tx_hash,
swap.evt_index,
swap.contract_address,
swap.evt_block_time AS block_time,
swap.contract_address AS maker,
LAST_VALUE(swap."to") OVER (PARTITION BY swap.evt_tx_hash ORDER BY swap.evt_index) AS taker,
CASE
WHEN swap."amount0In" > swap."amount1In" THEN pair.token0
ELSE pair.token1
END AS taker_token,
CASE
WHEN swap."amount0In" > swap."amount1In" THEN pair.token1
ELSE pair.token0
END AS maker_token,
CASE
WHEN swap."amount0In" > swap."amount1In" THEN swap."amount0In"
ELSE swap."amount1In"
END AS taker_token_amount_raw,
CASE
WHEN swap."amount0In" > swap."amount1In" THEN swap."amount1Out"
ELSE swap."amount0Out"
END AS maker_token_amount_raw,
'UniswapV2 Direct' AS type,
zeroex_tx.affiliate_address as affiliate_address,
TRUE AS swap_flag,
FALSE AS matcha_limit_order_flag
FROM uniswap_v2."Pair_evt_Swap" swap
LEFT JOIN uniswap_v2."Factory_evt_PairCreated" pair ON pair.pair = swap.contract_address
join zeroex_tx on zeroex_tx.tx_hash = swap.evt_tx_hash
WHERE sender = '\xdef1c0ded9bec7f1a1670819833240f027b25eff'::BYTEA
AND swap.evt_block_time >= start_ts AND swap.evt_block_time < end_ts
),
direct_sushiswap AS (
SELECT swap.evt_tx_hash AS tx_hash,
swap.evt_index,
swap.contract_address,
swap.evt_block_time AS block_time,
swap.contract_address AS maker,
LAST_VALUE(swap."to") OVER (PARTITION BY swap.evt_tx_hash ORDER BY swap.evt_index) AS taker,
CASE
WHEN swap."amount0In" > swap."amount1In" THEN pair.token0
ELSE pair.token1
END AS taker_token,
CASE
WHEN swap."amount0In" > swap."amount1In" THEN pair.token1
ELSE pair.token0
END AS maker_token,
CASE
WHEN swap."amount0In" > swap."amount1In" THEN swap."amount0In"
ELSE swap."amount1In"
END AS taker_token_amount_raw,
CASE
WHEN swap."amount0In" > swap."amount1In" THEN swap."amount1Out"
ELSE swap."amount0Out"
END AS maker_token_amount_raw,
'Sushiswap Direct' AS type,
zeroex_tx.affiliate_address as affiliate_address,
TRUE AS swap_flag,
FALSE AS matcha_limit_order_flag
FROM sushi."Pair_evt_Swap" swap
LEFT JOIN sushi."Factory_evt_PairCreated" pair ON pair.pair = swap.contract_address
join zeroex_tx on zeroex_tx.tx_hash = swap.evt_tx_hash
WHERE sender = '\xdef1c0ded9bec7f1a1670819833240f027b25eff'::BYTEA
AND swap.evt_block_time >= start_ts AND swap.evt_block_time < end_ts
),
direct_uniswapv3 AS (
SELECT swap.evt_tx_hash AS tx_hash,
swap.evt_index,
swap.contract_address,
swap.evt_block_time AS block_time,
swap.contract_address AS maker,
LAST_VALUE(swap."recipient") OVER (PARTITION BY swap.evt_tx_hash ORDER BY swap.evt_index) AS taker,
pair.token1 AS taker_token,
pair.token0 AS maker_token,
abs(swap."amount1") AS taker_token_amount_raw,
abs(swap."amount0") AS maker_token_amount_raw,
'UniswapV3 Direct' AS type,
zeroex_tx.affiliate_address as affiliate_address,
TRUE AS swap_flag,
FALSE AS matcha_limit_order_flag
FROM uniswap_v3."Pair_evt_Swap" swap
LEFT JOIN uniswap_v3."Factory_evt_PoolCreated" pair ON pair.pool = swap.contract_address
join zeroex_tx on zeroex_tx.tx_hash = swap.evt_tx_hash
WHERE sender = '\xdef1c0ded9bec7f1a1670819833240f027b25eff'::BYTEA
AND swap.evt_block_time >= start_ts AND swap.evt_block_time < end_ts
),
all_tx AS (
SELECT * FROM direct_uniswapv2
UNION ALL
SELECT * FROM direct_uniswapv3
UNION ALL
SELECT * FROM direct_sushiswap
UNION ALL
SELECT * FROM direct_PLP
UNION ALL
SELECT * FROM ERC20BridgeTransfer
UNION ALL
SELECT * FROM BridgeFill
UNION ALL
SELECT * FROM NewBridgeFill
UNION ALL
SELECT * FROM v3_fills_no_bridge
UNION ALL
SELECT * FROM v4_rfq_fills_no_bridge
UNION ALL
SELECT * FROM v4_limit_fills_no_bridge
),
total_volume AS (
SELECT all_tx.tx_hash,
all_tx.evt_index,
all_tx.contract_address,
all_tx.block_time,
maker,
case when taker = '\xdef1c0ded9bec7f1a1670819833240f027b25eff'::bytea then tx."from" else taker end as taker, -- fix the user masked by ProxyContract issue
taker_token,
maker_token,
taker_token_amount_raw / (10^tt.decimals) AS taker_token_amount,
taker_token_amount_raw,
maker_token_amount_raw / (10^mt.decimals) AS maker_token_amount,
maker_token_amount_raw,
all_tx.type,
affiliate_address,
swap_flag,
matcha_limit_order_flag,
CASE
WHEN tp.symbol = 'USDC' THEN (all_tx.taker_token_amount_raw / 1e6)--don't multiply by anything as these assets are USD
WHEN mp.symbol = 'USDC' THEN (all_tx.maker_token_amount_raw / 1e6)--don't multiply by anything as these assets are USD
WHEN tp.symbol = 'TUSD' THEN (all_tx.taker_token_amount_raw / 1e18)--don't multiply by anything as these assets are USD
WHEN mp.symbol = 'TUSD' THEN (all_tx.maker_token_amount_raw / 1e18)--don't multiply by anything as these assets are USD
WHEN tp.symbol = 'USDT' THEN (all_tx.taker_token_amount_raw / 1e6) * tp.price
WHEN mp.symbol = 'USDT' THEN (all_tx.maker_token_amount_raw / 1e6) * mp.price
WHEN tp.symbol = 'DAI' THEN (all_tx.taker_token_amount_raw / 1e18) * tp.price
WHEN mp.symbol = 'DAI' THEN (all_tx.maker_token_amount_raw / 1e18) * mp.price
WHEN tp.symbol = 'WETH' THEN (all_tx.taker_token_amount_raw / 1e18) * tp.price
WHEN mp.symbol = 'WETH' THEN (all_tx.maker_token_amount_raw / 1e18) * mp.price
ELSE COALESCE((all_tx.maker_token_amount_raw / (10^mt.decimals))*mp.price,(all_tx.taker_token_amount_raw / (10^tt.decimals))*tp.price)
END AS volume_usd
FROM all_tx
INNER JOIN ethereum.transactions tx
ON all_tx.tx_hash = tx.hash
AND tx.block_time >= start_ts
AND tx.block_time < end_ts
-- AND tx.block_number >= start_block
-- AND tx.block_number < end_block
LEFT JOIN prices.usd tp ON date_trunc('minute', all_tx.block_time) = tp.minute
AND all_tx.taker_token = tp.contract_address
AND tp.minute >= start_ts
AND tp.minute < end_ts
LEFT JOIN prices.usd mp ON DATE_TRUNC('minute', all_tx.block_time) = mp.minute
AND all_tx.maker_token = mp.contract_address
AND mp.minute >= start_ts
AND mp.minute < end_ts
LEFT JOIN erc20.tokens mt ON mt.contract_address = all_tx.maker_token
LEFT JOIN erc20.tokens tt ON tt.contract_address = all_tx.taker_token
-- WHERE all_tx.block_time >= start_ts AND all_tx.block_time < end_ts
),
rows AS (
INSERT INTO zeroex.view_0x_api_fills (
tx_hash,
evt_index,
contract_address,
block_time,
maker,
taker,
taker_token,
maker_token,
taker_token_amount,
taker_token_amount_raw,
maker_token_amount,
maker_token_amount_raw,
"type",
affiliate_address,
swap_flag,
matcha_limit_order_flag,
volume_usd
)
SELECT
tx_hash,
evt_index,
contract_address,
block_time,
maker,
taker,
taker_token,
maker_token,
taker_token_amount,
taker_token_amount_raw,
maker_token_amount,
maker_token_amount_raw,
"type",
affiliate_address,
swap_flag,
matcha_limit_order_flag,
volume_usd
FROM total_volume
ON CONFLICT DO NOTHING
RETURNING 1
)
SELECT count(*) INTO r from rows;
RETURN r;
END
$function$;
CREATE UNIQUE INDEX IF NOT EXISTS zeroex_api_fills_unique ON zeroex.view_0x_api_fills (tx_hash, evt_index);
CREATE INDEX IF NOT EXISTS zeroex_api_fills_time_index ON zeroex.view_0x_api_fills (block_time);
--backfill
SELECT zeroex.insert_0x_api_fills('2020-01-29', (SELECT now() - interval '20 minutes')) WHERE NOT EXISTS (SELECT * FROM zeroex.view_0x_api_fills LIMIT 1);
INSERT INTO cron.job (schedule, command)
VALUES ('15 * * * *', $$SELECT zeroex.insert_0x_api_fills((SELECT max(block_time) - interval '2 days' FROM zeroex.view_0x_api_fills), (SELECT now() - interval '20 minutes'));$$)
ON CONFLICT (command) DO UPDATE SET schedule=EXCLUDED.schedule; | the_stack |
--------------------------------------------------------------------------------
-- Name: Sample Collections
-- Copyright (c) 2012, 2021 Oracle and/or its affiliates.
-- Licensed under the Universal Permissive License v 1.0
-- as shown at https://oss.oracle.com/licenses/upl/
--------------------------------------------------------------------------------
prompt --application/set_environment
set define off verify off feedback off
--------------------------------------------------------------------------------
--
-- ORACLE Application Express (APEX) export file
--
-- You should run the script connected to SQL*Plus as the Oracle user
-- APEX_210100 or as the owner (parsing schema) of the application.
--
-- NOTE: Calls to apex_application_install override the defaults below.
--
--------------------------------------------------------------------------------
begin
wwv_flow_api.import_begin (
p_version_yyyy_mm_dd=>'2021.04.15'
,p_release=>'21.1.0-14'
,p_default_workspace_id=>20
,p_default_application_id=>7940
,p_default_id_offset=>0
,p_default_owner=>'ORACLE'
);
end;
/
prompt APPLICATION 7940 - Sample Collections
--
-- Application Export:
-- Application: 7940
-- Name: Sample Collections
-- Date and Time: 08:17 Friday May 21, 2021
-- Exported By: ALLAN
-- Flashback: 0
-- Export Type: Application Export
-- Pages: 14
-- Items: 41
-- Validations: 1
-- Processes: 25
-- Regions: 56
-- Buttons: 29
-- Dynamic Actions: 3
-- Shared Components:
-- Logic:
-- Items: 1
-- Processes: 1
-- Navigation:
-- Lists: 4
-- Breadcrumbs: 1
-- Entries: 11
-- NavBar Entries: 3
-- Security:
-- Authentication: 1
-- User Interface:
-- Themes: 1
-- Templates:
-- Page: 9
-- Region: 18
-- Label: 7
-- List: 13
-- Popup LOV: 1
-- Calendar: 1
-- Breadcrumb: 1
-- Button: 3
-- Report: 12
-- LOVs: 3
-- Plug-ins: 2
-- Globalization:
-- Reports:
-- E-Mail:
-- Supporting Objects: Included
-- Install scripts: 4
-- Version: 21.1.0-14
-- Instance ID: 203745984637177
--
prompt --application/delete_application
begin
wwv_flow_api.remove_flow(wwv_flow.g_flow_id);
end;
/
prompt --application/create_application
begin
wwv_flow_api.create_flow(
p_id=>wwv_flow.g_flow_id
,p_owner=>nvl(wwv_flow_application_install.get_schema,'ORACLE')
,p_name=>nvl(wwv_flow_application_install.get_application_name,'Sample Collections')
,p_alias=>nvl(wwv_flow_application_install.get_application_alias,'7940')
,p_application_group=>wwv_flow_api.id(1268170835711543)
,p_application_group_name=>'21.1 Sample Apps'
,p_page_view_logging=>'YES'
,p_page_protection_enabled_y_n=>'Y'
,p_checksum_salt=>'331CD6399D33CD96A6007D2415FB5EE98A177CF94572CD735F4CCCA4C30BC184'
,p_checksum_salt_last_reset=>'20150102075944'
,p_bookmark_checksum_function=>'SH1'
,p_compatibility_mode=>'19.2'
,p_flow_language=>'en'
,p_flow_language_derived_from=>'BROWSER'
,p_date_format=>'DS'
,p_direction_right_to_left=>'N'
,p_flow_image_prefix => nvl(wwv_flow_application_install.get_image_prefix,'')
,p_documentation_banner=>wwv_flow_string.join(wwv_flow_t_varchar2(
'1.0.2 -> 1.0.3: Added "SQL Source" show/hide region to "Collection on EMP" page.',
'1.0.3 -> 1.0.4: Changed Authentication scheme to use new "ORA_WWV_PACKAGED_APPLICATIONS" cookie'))
,p_authentication=>'PLUGIN'
,p_authentication_id=>wwv_flow_api.id(8706951165162370193)
,p_application_tab_set=>1
,p_logo_type=>'T'
,p_logo_text=>'Sample Collections'
,p_favicons=>'<link rel="shortcut icon" href="#IMAGE_PREFIX#apex_ui/img/favicons/app-sample-collections.ico"><link rel="icon" sizes="16x16" href="#IMAGE_PREFIX#apex_ui/img/favicons/app-sample-collections-16x16.png"><link rel="icon" sizes="32x32" href="#IMAGE_PREFI'
||'X#apex_ui/img/favicons/app-sample-collections-32x32.png"><link rel="apple-touch-icon" sizes="180x180" href="#IMAGE_PREFIX#apex_ui/img/favicons/app-sample-collections.png">'
,p_public_user=>'APEX_PUBLIC_USER'
,p_proxy_server=>nvl(wwv_flow_application_install.get_proxy,'')
,p_no_proxy_domains=>nvl(wwv_flow_application_install.get_no_proxy_domains,'')
,p_flow_version=>'1.2.2'
,p_flow_status=>'AVAILABLE_W_EDIT_LINK'
,p_flow_unavailable_text=>'This application is currently unavailable.'
,p_exact_substitutions_only=>'Y'
,p_deep_linking=>'Y'
,p_runtime_api_usage=>'T'
,p_authorize_public_pages_yn=>'Y'
,p_rejoin_existing_sessions=>'P'
,p_csv_encoding=>'N'
,p_auto_time_zone=>'N'
,p_substitution_string_01=>'APPLICATION_ICON'
,p_substitution_value_01=>'oracle_platform_white.gif'
,p_substitution_string_02=>'APP_NAME'
,p_substitution_value_02=>'Sample Collections'
,p_last_updated_by=>'ALLAN'
,p_last_upd_yyyymmddhh24miss=>'20210513082320'
,p_file_prefix => nvl(wwv_flow_application_install.get_static_app_file_prefix,'')
,p_ui_type_name => null
,p_print_server_type=>'INSTANCE'
);
end;
/
prompt --application/shared_components/navigation/lists/admin_options
begin
wwv_flow_api.create_list(
p_id=>wwv_flow_api.id(1318661468097158837)
,p_name=>'admin options'
,p_list_status=>'PUBLIC'
);
wwv_flow_api.create_list_item(
p_id=>wwv_flow_api.id(1318661664831158842)
,p_list_item_display_sequence=>10
,p_list_item_link_text=>'Reset Data'
,p_list_item_link_target=>'f?p=&APP_ID.:39:&SESSION.::&DEBUG.::::'
,p_list_item_icon=>'fa-refresh'
,p_list_text_01=>'This application uses the sample EBA_DEMO_CS_EMP table, use this link to reset the table to the original specification.'
,p_list_text_02=>'formIcon'
,p_list_item_current_type=>'TARGET_PAGE'
);
wwv_flow_api.create_list_item(
p_id=>wwv_flow_api.id(1318661958760158843)
,p_list_item_display_sequence=>20
,p_list_item_link_text=>'Remove Collections'
,p_list_item_link_target=>'f?p=&APP_ID.:36:&SESSION.::&DEBUG.::::'
,p_list_item_icon=>'fa-ban'
,p_list_text_01=>'This application creates Oracle APEX collections. Use this link to drop all collections resetting this application to factory defaults.'
,p_list_text_02=>'formIcon'
,p_list_item_current_type=>'TARGET_PAGE'
);
wwv_flow_api.create_list_item(
p_id=>wwv_flow_api.id(2127159634688274903)
,p_list_item_display_sequence=>30
,p_list_item_link_text=>'Theme Style'
,p_list_item_link_target=>'f?p=&APP_ID.:5:&SESSION.::&DEBUG.::::'
,p_list_item_icon=>'fa-desktop'
,p_list_text_01=>'Change user interface theme style for all users.'
,p_list_item_current_type=>'TARGET_PAGE'
);
end;
/
prompt --application/shared_components/navigation/lists/collection_examples
begin
wwv_flow_api.create_list(
p_id=>wwv_flow_api.id(1318669864821271501)
,p_name=>'Collection Examples'
,p_list_status=>'PUBLIC'
);
wwv_flow_api.create_list_item(
p_id=>wwv_flow_api.id(1318670061576271501)
,p_list_item_display_sequence=>10
,p_list_item_link_text=>'Basic Collections'
,p_list_item_link_target=>'f?p=&APP_ID.:1:&SESSION.::&DEBUG.::::'
,p_list_item_icon=>'fa-archive'
,p_list_text_01=>'Creating a Basic Collection. Create a user defined collection name on a simple Employee table structure.'
,p_list_item_current_type=>'TARGET_PAGE'
);
wwv_flow_api.create_list_item(
p_id=>wwv_flow_api.id(1318670359600271501)
,p_list_item_display_sequence=>20
,p_list_item_link_text=>'Data Synchronization'
,p_list_item_link_target=>'f?p=&APP_ID.:6:&SESSION.::&DEBUG.::::'
,p_list_item_icon=>'fa-spinner'
,p_list_text_01=>'Populate a collection from a sample Employees table, update the collection, and then synchronize the data in the collection with the base table.'
,p_list_item_current_type=>'TARGET_PAGE'
);
wwv_flow_api.create_list_item(
p_id=>wwv_flow_api.id(1318675155373332093)
,p_list_item_display_sequence=>22
,p_list_item_link_text=>'API Examples'
,p_list_item_link_target=>'f?p=&APP_ID.:12:&SESSION.::&DEBUG.:RP:::'
,p_list_item_icon=>'fa-keyboard-o'
,p_list_text_01=>'View Oracle APEX API examples which you can use in your own application.'
,p_list_item_current_type=>'TARGET_PAGE'
);
end;
/
prompt --application/shared_components/navigation/lists/navigation_menu
begin
wwv_flow_api.create_list(
p_id=>wwv_flow_api.id(1774925232189944037)
,p_name=>'Navigation Menu'
,p_list_status=>'PUBLIC'
);
wwv_flow_api.create_list_item(
p_id=>wwv_flow_api.id(1774925298543944041)
,p_list_item_display_sequence=>1
,p_list_item_link_text=>'Home'
,p_list_item_link_target=>'f?p=&APP_ID.:100:&SESSION.::&DEBUG.::::'
,p_list_item_icon=>'fa-home'
,p_list_item_current_type=>'COLON_DELIMITED_PAGE_LIST'
,p_list_item_current_for_pages=>'8,100'
);
wwv_flow_api.create_list_item(
p_id=>wwv_flow_api.id(1774925410865944041)
,p_list_item_display_sequence=>2
,p_list_item_link_text=>'Basic Collections'
,p_list_item_link_target=>'f?p=&APP_ID.:1:&SESSION.::&DEBUG.::::'
,p_list_item_icon=>'fa-archive'
,p_list_item_current_type=>'COLON_DELIMITED_PAGE_LIST'
,p_list_item_current_for_pages=>'1,3'
);
wwv_flow_api.create_list_item(
p_id=>wwv_flow_api.id(1774925826204944041)
,p_list_item_display_sequence=>6
,p_list_item_link_text=>'Data Synchronization'
,p_list_item_link_target=>'f?p=&APP_ID.:6:&SESSION.::&DEBUG.::::'
,p_list_item_icon=>'fa-spinner'
,p_list_item_current_type=>'COLON_DELIMITED_PAGE_LIST'
,p_list_item_current_for_pages=>'6,7'
);
wwv_flow_api.create_list_item(
p_id=>wwv_flow_api.id(1774926108884944042)
,p_list_item_display_sequence=>9
,p_list_item_link_text=>'API Examples'
,p_list_item_link_target=>'f?p=&APP_ID.:12:&SESSION.::&DEBUG.::::'
,p_list_item_icon=>'fa-keyboard-o'
,p_list_item_current_type=>'COLON_DELIMITED_PAGE_LIST'
,p_list_item_current_for_pages=>'12'
);
wwv_flow_api.create_list_item(
p_id=>wwv_flow_api.id(1804162716668792099)
,p_list_item_display_sequence=>19
,p_list_item_link_text=>'Administration'
,p_list_item_link_target=>'f?p=&APP_ID.:35:&SESSION.::&DEBUG.::::'
,p_list_item_icon=>'fa-gear'
,p_list_item_current_type=>'COLON_DELIMITED_PAGE_LIST'
,p_list_item_current_for_pages=>'5,35,36,39'
);
end;
/
prompt --application/shared_components/navigation/lists/navigation_bar_top
begin
wwv_flow_api.create_list(
p_id=>wwv_flow_api.id(1774964515238991205)
,p_name=>'Navigation Bar (Top)'
,p_list_status=>'PUBLIC'
);
wwv_flow_api.create_list_item(
p_id=>wwv_flow_api.id(1774964701732991212)
,p_list_item_display_sequence=>20
,p_list_item_link_text=>'Help'
,p_list_item_link_target=>'f?p=&APP_ID.:HELP:&SESSION.::&DEBUG.::::'
,p_list_item_icon=>'fa-question-circle-o'
,p_list_item_current_type=>'TARGET_PAGE'
);
wwv_flow_api.create_list_item(
p_id=>wwv_flow_api.id(1774965153530991218)
,p_list_item_display_sequence=>30
,p_list_item_link_text=>'&APP_USER.'
,p_list_item_link_target=>'#'
,p_list_item_icon=>'fa-user'
,p_list_text_02=>'has-username'
,p_list_item_current_type=>'TARGET_PAGE'
);
wwv_flow_api.create_list_item(
p_id=>wwv_flow_api.id(1774965545554991219)
,p_list_item_display_sequence=>50
,p_list_item_link_text=>'Sign Out'
,p_list_item_link_target=>'&LOGOUT_URL.'
,p_parent_list_item_id=>wwv_flow_api.id(1774965153530991218)
,p_list_item_current_type=>'TARGET_PAGE'
);
end;
/
prompt --application/plugin_settings
begin
wwv_flow_api.create_plugin_setting(
p_id=>wwv_flow_api.id(1570154313527921)
,p_plugin_type=>'ITEM TYPE'
,p_plugin=>'NATIVE_STAR_RATING'
,p_attribute_01=>'fa-star'
,p_attribute_04=>'#VALUE#'
);
wwv_flow_api.create_plugin_setting(
p_id=>wwv_flow_api.id(8291916482297196)
,p_plugin_type=>'REGION TYPE'
,p_plugin=>'NATIVE_CSS_CALENDAR'
);
wwv_flow_api.create_plugin_setting(
p_id=>wwv_flow_api.id(94519253593251789)
,p_plugin_type=>'ITEM TYPE'
,p_plugin=>'NATIVE_RICH_TEXT_EDITOR'
,p_attribute_01=>'N'
);
wwv_flow_api.create_plugin_setting(
p_id=>wwv_flow_api.id(176131710446506821)
,p_plugin_type=>'ITEM TYPE'
,p_plugin=>'NATIVE_SINGLE_CHECKBOX'
,p_attribute_01=>'Y'
,p_attribute_02=>'N'
);
wwv_flow_api.create_plugin_setting(
p_id=>wwv_flow_api.id(592238585449709448)
,p_plugin_type=>'ITEM TYPE'
,p_plugin=>'NATIVE_DATE_PICKER_JET'
,p_attribute_01=>'MONTH-PICKER:YEAR-PICKER'
,p_attribute_02=>'VISIBLE'
,p_attribute_03=>'15'
,p_attribute_04=>'Y'
);
wwv_flow_api.create_plugin_setting(
p_id=>wwv_flow_api.id(1121389972842511367)
,p_plugin_type=>'ITEM TYPE'
,p_plugin=>'NATIVE_YES_NO'
,p_attribute_01=>'Y'
,p_attribute_03=>'N'
,p_attribute_05=>'SWITCH'
);
wwv_flow_api.create_plugin_setting(
p_id=>wwv_flow_api.id(1767595167303391411)
,p_plugin_type=>'REGION TYPE'
,p_plugin=>'NATIVE_DISPLAY_SELECTOR'
,p_attribute_01=>'N'
);
wwv_flow_api.create_plugin_setting(
p_id=>wwv_flow_api.id(1834295217471673515)
,p_plugin_type=>'REGION TYPE'
,p_plugin=>'NATIVE_IR'
,p_attribute_01=>'IG'
);
wwv_flow_api.create_plugin_setting(
p_id=>wwv_flow_api.id(1920205876179619540)
,p_plugin_type=>'ITEM TYPE'
,p_plugin=>'NATIVE_COLOR_PICKER'
,p_attribute_01=>'FULL'
,p_attribute_02=>'POPUP'
);
end;
/
prompt --application/shared_components/navigation/navigation_bar
begin
wwv_flow_api.create_icon_bar_item(
p_id=>wwv_flow_api.id(1318661357678148710)
,p_icon_sequence=>10
,p_icon_subtext=>'Administration'
,p_icon_target=>'f?p=&APP_ID.:35:&SESSION.::&DEBUG.::::'
,p_nav_entry_is_feedback_yn=>'N'
,p_begins_on_new_line=>'NO'
,p_cell_colspan=>1
);
wwv_flow_api.create_icon_bar_item(
p_id=>wwv_flow_api.id(8792689833218283540)
,p_icon_sequence=>20
,p_icon_subtext=>'Help'
,p_icon_target=>'f?p=&APP_ID.:8:&SESSION.::&DEBUG.::::'
,p_nav_entry_is_feedback_yn=>'N'
,p_icon_bar_disp_cond=>'101'
,p_icon_bar_disp_cond_type=>'CURRENT_PAGE_NOT_EQUAL_CONDITION'
,p_begins_on_new_line=>'NO'
,p_cell_colspan=>1
);
wwv_flow_api.create_icon_bar_item(
p_id=>wwv_flow_api.id(8792690547763287654)
,p_icon_sequence=>30
,p_icon_subtext=>'Logout'
,p_icon_target=>'&LOGOUT_URL.'
,p_nav_entry_is_feedback_yn=>'N'
,p_icon_bar_disp_cond=>'101'
,p_icon_bar_disp_cond_type=>'CURRENT_PAGE_NOT_EQUAL_CONDITION'
,p_begins_on_new_line=>'NO'
,p_cell_colspan=>1
);
end;
/
prompt --application/shared_components/logic/application_processes/trim_all_page_items
begin
wwv_flow_api.create_flow_process(
p_id=>wwv_flow_api.id(1555479170503645333)
,p_process_sequence=>1
,p_process_point=>'ON_SUBMIT_BEFORE_COMPUTATION'
,p_process_type=>'NATIVE_PLSQL'
,p_process_name=>'Trim All Page Items'
,p_process_sql_clob=>wwv_flow_string.join(wwv_flow_t_varchar2(
'begin',
' for c1 in (select item_name',
' from apex_application_page_items',
' where application_id = :APP_ID',
' and page_id = :APP_PAGE_ID',
' and display_as_code in (''NATIVE_TEXT_FIELD'',',
' ''NATIVE_TEXTAREA'',',
' ''NATIVE_NUMBER_FIELD'') ) loop',
' apex_util.set_session_state( c1.item_name,',
' regexp_replace(apex_util.get_session_state( c1.item_name ),',
' ''^[[:space:]]*(.*?)[[:space:]]*$'', ''\1''',
' )',
' );',
' end loop;',
'end;'))
,p_process_clob_language=>'PLSQL'
,p_error_display_location=>'INLINE_IN_NOTIFICATION'
);
end;
/
prompt --application/shared_components/logic/application_items/fsp_after_login_url
begin
wwv_flow_api.create_flow_item(
p_id=>wwv_flow_api.id(8704708522041200368)
,p_name=>'FSP_AFTER_LOGIN_URL'
,p_escape_on_http_output=>'N'
);
end;
/
prompt --application/shared_components/logic/application_settings
begin
null;
end;
/
prompt --application/shared_components/navigation/tabs/standard
begin
null;
end;
/
prompt --application/shared_components/navigation/tabs/parent
begin
null;
end;
/
prompt --application/shared_components/user_interface/lovs/deptno_lov
begin
wwv_flow_api.create_list_of_values(
p_id=>wwv_flow_api.id(1330743265602235146)
,p_lov_name=>'DEPTNO LOV'
,p_lov_query=>wwv_flow_string.join(wwv_flow_t_varchar2(
'select distinct deptno d, deptno r',
' from eba_demo_cs_emp',
' order by 1'))
,p_source_type=>'LEGACY_SQL'
,p_location=>'LOCAL'
);
end;
/
prompt --application/shared_components/user_interface/lovs/job_lov
begin
wwv_flow_api.create_list_of_values(
p_id=>wwv_flow_api.id(1330749159564237929)
,p_lov_name=>'JOB LOV'
,p_lov_query=>wwv_flow_string.join(wwv_flow_t_varchar2(
'select distinct job d, job r',
' from eba_demo_cs_emp',
' order by 1'))
,p_source_type=>'LEGACY_SQL'
,p_location=>'LOCAL'
);
end;
/
prompt --application/shared_components/user_interface/lovs/status_lov
begin
wwv_flow_api.create_list_of_values(
p_id=>wwv_flow_api.id(1330719884636063179)
,p_lov_name=>'STATUS LOV'
,p_lov_query=>'.'||wwv_flow_api.id(1330719884636063179)||'.'
,p_location=>'STATIC'
);
wwv_flow_api.create_static_lov_data(
p_id=>wwv_flow_api.id(1330720159522063179)
,p_lov_disp_sequence=>1
,p_lov_disp_value=>'Deleted'
,p_lov_return_value=>'D'
);
wwv_flow_api.create_static_lov_data(
p_id=>wwv_flow_api.id(1330720456248063182)
,p_lov_disp_sequence=>2
,p_lov_disp_value=>'New'
,p_lov_return_value=>'N'
);
wwv_flow_api.create_static_lov_data(
p_id=>wwv_flow_api.id(1330720757688063182)
,p_lov_disp_sequence=>3
,p_lov_disp_value=>'Original'
,p_lov_return_value=>'O'
);
wwv_flow_api.create_static_lov_data(
p_id=>wwv_flow_api.id(1330721074163063182)
,p_lov_disp_sequence=>4
,p_lov_disp_value=>'Updated'
,p_lov_return_value=>'U'
);
end;
/
prompt --application/pages/page_groups
begin
null;
end;
/
prompt --application/comments
begin
null;
end;
/
prompt --application/shared_components/navigation/breadcrumbs/breadcrumbs
begin
wwv_flow_api.create_menu(
p_id=>wwv_flow_api.id(1318675881153380306)
,p_name=>'breadcrumbs'
);
wwv_flow_api.create_menu_option(
p_id=>wwv_flow_api.id(1318676266481382465)
,p_parent_id=>0
,p_short_name=>'Basic Collections'
,p_link=>'f?p=&APP_ID.:1:&SESSION.::&DEBUG.:::'
,p_page_id=>1
);
wwv_flow_api.create_menu_option(
p_id=>wwv_flow_api.id(1318676652269384290)
,p_short_name=>'Home'
,p_link=>'f?p=&FLOW_ID.:100:&SESSION.'
,p_page_id=>100
);
wwv_flow_api.create_menu_option(
p_id=>wwv_flow_api.id(1318677376398387629)
,p_parent_id=>wwv_flow_api.id(1318676266481382465)
,p_short_name=>'Modify Collection'
,p_link=>'f?p=&FLOW_ID.:3:&SESSION.'
,p_page_id=>3
);
wwv_flow_api.create_menu_option(
p_id=>wwv_flow_api.id(1318677755387389868)
,p_parent_id=>wwv_flow_api.id(1318676266481382465)
,p_short_name=>'Create Collection'
,p_link=>'f?p=&FLOW_ID.:2:&SESSION.'
,p_page_id=>2
);
wwv_flow_api.create_menu_option(
p_id=>wwv_flow_api.id(1318678260345392434)
,p_parent_id=>0
,p_short_name=>'Data Synchronization'
,p_link=>'f?p=&APP_ID.:6:&SESSION.::&DEBUG.:::'
,p_page_id=>6
);
wwv_flow_api.create_menu_option(
p_id=>wwv_flow_api.id(1318678659118394461)
,p_parent_id=>wwv_flow_api.id(1318678260345392434)
,p_short_name=>'Add/Edit Collection Member'
,p_link=>'f?p=&FLOW_ID.:7:&SESSION.'
,p_page_id=>7
);
wwv_flow_api.create_menu_option(
p_id=>wwv_flow_api.id(1318679572741398959)
,p_short_name=>'API Examples'
,p_link=>'f?p=&APP_ID.:12:&SESSION.::&DEBUG.:::'
,p_page_id=>12
);
wwv_flow_api.create_menu_option(
p_id=>wwv_flow_api.id(1318681558562411746)
,p_parent_id=>wwv_flow_api.id(1318682253032415084)
,p_short_name=>'Reset Data'
,p_link=>'f?p=&APP_ID.:39:&SESSION.::&DEBUG.:::'
,p_page_id=>39
);
wwv_flow_api.create_menu_option(
p_id=>wwv_flow_api.id(1318682253032415084)
,p_short_name=>'Administration'
,p_link=>'f?p=&FLOW_ID.:35:&SESSION.'
,p_page_id=>35
);
wwv_flow_api.create_menu_option(
p_id=>wwv_flow_api.id(1850843065443002597)
,p_parent_id=>wwv_flow_api.id(1318682253032415084)
,p_short_name=>'Remove Collections'
,p_link=>'f?p=&APP_ID.:36:&SESSION.::&DEBUG.:::'
,p_page_id=>36
);
wwv_flow_api.create_menu_option(
p_id=>wwv_flow_api.id(2127153303359260920)
,p_parent_id=>wwv_flow_api.id(1318682253032415084)
,p_short_name=>'Application Theme Style'
,p_link=>'f?p=&APP_ID.:5:&SESSION.'
,p_page_id=>5
);
end;
/
prompt --application/shared_components/navigation/breadcrumbentry
begin
null;
end;
/
prompt --application/shared_components/user_interface/templates/page/left_side_column
begin
wwv_flow_api.create_template(
p_id=>wwv_flow_api.id(1774825962588936426)
,p_theme_id=>42
,p_name=>'Left Side Column'
,p_internal_name=>'LEFT_SIDE_COLUMN'
,p_is_popup=>false
,p_javascript_code_onload=>'apex.theme42.initializePage.leftSideCol();'
,p_header_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<!DOCTYPE html>',
'<html class="no-js #RTL_CLASS# page-&APP_PAGE_ID. app-&APP_ALIAS." lang="&BROWSER_LANGUAGE." #TEXT_DIRECTION#>',
'<head>',
' <meta http-equiv="x-ua-compatible" content="IE=edge" />',
' <meta charset="utf-8">',
' <title>#TITLE#</title>',
' #APEX_CSS#',
' #THEME_CSS#',
' #TEMPLATE_CSS#',
' #THEME_STYLE_CSS#',
' #APPLICATION_CSS#',
' #PAGE_CSS#',
' #FAVICONS#',
' #HEAD#',
' <meta name="viewport" content="width=device-width, initial-scale=1.0" />',
'</head>',
'<body class="t-PageBody t-PageBody--showLeft t-PageBody--hideActions no-anim t-PageTemplate--leftCol #PAGE_CSS_CLASSES#" #TEXT_DIRECTION# #ONLOAD# id="t_PageBody">',
'<a href="#main" id="t_Body_skipToContent">&APP_TEXT$UI_PAGE_SKIP_TO_CONTENT.</a>',
'#FORM_OPEN#',
'<header class="t-Header" id="t_Header" role="banner">',
' #REGION_POSITION_07#',
' <div class="t-Header-branding">',
' <div class="t-Header-controls">',
' <button class="t-Button t-Button--icon t-Button--header t-Button--headerTree" aria-label="#EXPAND_COLLAPSE_NAV_LABEL#" title="#EXPAND_COLLAPSE_NAV_LABEL#" id="t_Button_navControl" type="button"><span class="t-Header-controlsIcon" aria-hidden="t'
||'rue"></span></button>',
' </div>',
' <div class="t-Header-logo">',
' <a href="#HOME_LINK#" class="t-Header-logo-link">#LOGO#</a>',
' </div>',
' <div class="t-Header-navBar">#NAVIGATION_BAR#</div>',
' </div>',
' <div class="t-Header-nav">#TOP_GLOBAL_NAVIGATION_LIST##REGION_POSITION_06#</div>',
'</header>',
''))
,p_box=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Body">',
' #SIDE_GLOBAL_NAVIGATION_LIST#',
' <div class="t-Body-main">',
' <div class="t-Body-title" id="t_Body_title">#REGION_POSITION_01#</div>',
' <div class="t-Body-side" id="t_Body_side">#REGION_POSITION_02#</div>',
' <div class="t-Body-content" id="t_Body_content">',
' <main class="t-Body-mainContent" id="main">',
' #SUCCESS_MESSAGE##NOTIFICATION_MESSAGE##GLOBAL_NOTIFICATION#',
' <div class="t-Body-fullContent">#REGION_POSITION_08#</div>',
' <div class="t-Body-contentInner">#BODY#</div>',
' </main>',
' <footer class="t-Footer" id="t_Footer" role="contentinfo">',
' <div class="t-Footer-body">',
' <div class="t-Footer-content">#REGION_POSITION_05#</div>',
' <div class="t-Footer-apex">',
' <div class="t-Footer-version">#APP_VERSION#</div>',
' <div class="t-Footer-customize">#CUSTOMIZE#</div>',
' #BUILT_WITH_LOVE_USING_APEX#',
' </div>',
' </div>',
' <div class="t-Footer-top">',
' <a href="#top" class="t-Footer-topButton" id="t_Footer_topButton"><span class="a-Icon icon-up-chevron"></span></a>',
' </div>',
' </footer>',
' </div>',
' </div>',
'</div>',
'<div class="t-Body-inlineDialogs" id="t_Body_inlineDialogs">#REGION_POSITION_04#</div>'))
,p_footer_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'#FORM_CLOSE#',
'#DEVELOPER_TOOLBAR#',
'#APEX_JAVASCRIPT#',
'#GENERATED_CSS#',
'#THEME_JAVASCRIPT#',
'#TEMPLATE_JAVASCRIPT#',
'#APPLICATION_JAVASCRIPT#',
'#PAGE_JAVASCRIPT# ',
'#GENERATED_JAVASCRIPT#',
'</body>',
'</html>'))
,p_success_message=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Body-alert">',
' <div class="t-Alert t-Alert--defaultIcons t-Alert--success t-Alert--horizontal t-Alert--page t-Alert--colorBG" id="t_Alert_Success" role="alert">',
' <div class="t-Alert-wrap">',
' <div class="t-Alert-icon">',
' <span class="t-Icon"></span>',
' </div>',
' <div class="t-Alert-content">',
' <div class="t-Alert-header">',
' <h2 class="t-Alert-title">#SUCCESS_MESSAGE#</h2>',
' </div>',
' </div>',
' <div class="t-Alert-buttons">',
' <button class="t-Button t-Button--noUI t-Button--icon t-Button--closeAlert" onclick="apex.jQuery(''#t_Alert_Success'').remove();" type="button" title="#CLOSE_NOTIFICATION#"><span class="t-Icon icon-close"></span></button>',
' </div>',
' </div>',
' </div>',
'</div>'))
,p_notification_message=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Body-alert">',
' <div class="t-Alert t-Alert--defaultIcons t-Alert--warning t-Alert--horizontal t-Alert--page t-Alert--colorBG" id="t_Alert_Notification" role="alert">',
' <div class="t-Alert-wrap">',
' <div class="t-Alert-icon">',
' <span class="t-Icon"></span>',
' </div>',
' <div class="t-Alert-content">',
' <div class="t-Alert-body">#MESSAGE#</div>',
' </div>',
' <div class="t-Alert-buttons">',
' <button class="t-Button t-Button--noUI t-Button--icon t-Button--closeAlert" onclick="apex.jQuery(''#t_Alert_Notification'').remove();" type="button" title="#CLOSE_NOTIFICATION#"><span class="t-Icon icon-close"></span></button>',
' </div>',
' </div>',
' </div>',
'</div>'))
,p_navigation_bar=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<ul class="t-NavigationBar" data-mode="classic">',
' <li class="t-NavigationBar-item">',
' <span class="t-Button t-Button--icon t-Button--noUI t-Button--header t-Button--navBar t-Button--headerUser">',
' <span class="t-Icon a-Icon icon-user"></span>',
' <span class="t-Button-label">&APP_USER.</span>',
' </span>',
' </li>#BAR_BODY#',
'</ul>'))
,p_navbar_entry=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li class="t-NavigationBar-item">',
' <a class="t-Button t-Button--icon t-Button--header t-Button--navBar" href="#LINK#">',
' <span class="t-Icon #IMAGE#"></span>',
' <span class="t-Button-label">#TEXT#</span>',
' </a>',
'</li>'))
,p_region_table_cattributes=>' summary="" cellpadding="0" border="0" cellspacing="0" width="100%"'
,p_breadcrumb_def_reg_pos=>'REGION_POSITION_01'
,p_theme_class_id=>17
,p_error_page_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Alert t-Alert--danger t-Alert--wizard t-Alert--defaultIcons">',
' <div class="t-Alert-wrap">',
' <div class="t-Alert-icon">',
' <span class="t-Icon"></span>',
' </div>',
' <div class="t-Alert-content">',
' <div class="t-Alert-body">',
' <h3>#MESSAGE#</h3>',
' <p>#ADDITIONAL_INFO#</p>',
' <div class="t-Alert-inset">#TECHNICAL_INFO#</div>',
' </div>',
' </div>',
' <div class="t-Alert-buttons">',
' <button onclick="#BACK_LINK#" class="t-Button t-Button--hot w50p t-Button--large" type="button">#OK#</button>',
' </div>',
' </div>',
'</div>'))
,p_grid_type=>'FIXED'
,p_grid_max_columns=>12
,p_grid_always_use_max_columns=>true
,p_grid_has_column_span=>true
,p_grid_always_emit=>false
,p_grid_emit_empty_leading_cols=>true
,p_grid_emit_empty_trail_cols=>false
,p_grid_default_label_col_span=>2
,p_grid_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="container">',
'#ROWS#',
'</div>'))
,p_grid_row_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="row #CSS_CLASSES#">',
'#COLUMNS#',
'</div>'))
,p_grid_column_template=>'<div class="col col-#COLUMN_SPAN_NUMBER# #CSS_CLASSES#" #ATTRIBUTES#>#CONTENT#</div>'
,p_grid_first_column_attributes=>'alpha'
,p_grid_last_column_attributes=>'omega'
,p_dialog_js_init_code=>'apex.navigation.dialog(#PAGE_URL#,{title:#TITLE#,height:#DIALOG_HEIGHT#,width:#DIALOG_WIDTH#,maxWidth:#DIALOG_MAX_WIDTH#,modal:#IS_MODAL#,dialog:#DIALOG#,#DIALOG_ATTRIBUTES#},#DIALOG_CSS_CLASSES#,#TRIGGERING_ELEMENT#);'
,p_dialog_js_close_code=>'apex.navigation.dialog.close(#IS_MODAL#,#TARGET#);'
,p_dialog_js_cancel_code=>'apex.navigation.dialog.cancel(#IS_MODAL#);'
,p_dialog_browser_frame=>'MODAL'
,p_reference_id=>2525196570560608698
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804637956601800252)
,p_page_template_id=>wwv_flow_api.id(1774825962588936426)
,p_name=>'Content Body'
,p_placeholder=>'BODY'
,p_has_grid_support=>true
,p_glv_new_row=>true
,p_max_fixed_grid_columns=>8
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804638464860800252)
,p_page_template_id=>wwv_flow_api.id(1774825962588936426)
,p_name=>'Breadcrumb Bar'
,p_placeholder=>'REGION_POSITION_01'
,p_has_grid_support=>false
,p_glv_new_row=>true
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804638983232800253)
,p_page_template_id=>wwv_flow_api.id(1774825962588936426)
,p_name=>'Left Column'
,p_placeholder=>'REGION_POSITION_02'
,p_has_grid_support=>false
,p_glv_new_row=>true
,p_max_fixed_grid_columns=>4
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804639485042800253)
,p_page_template_id=>wwv_flow_api.id(1774825962588936426)
,p_name=>'Inline Dialogs'
,p_placeholder=>'REGION_POSITION_04'
,p_has_grid_support=>true
,p_glv_new_row=>true
,p_max_fixed_grid_columns=>12
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804639973149800253)
,p_page_template_id=>wwv_flow_api.id(1774825962588936426)
,p_name=>'Footer'
,p_placeholder=>'REGION_POSITION_05'
,p_has_grid_support=>true
,p_glv_new_row=>true
,p_max_fixed_grid_columns=>8
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804640455789800253)
,p_page_template_id=>wwv_flow_api.id(1774825962588936426)
,p_name=>'Page Navigation'
,p_placeholder=>'REGION_POSITION_06'
,p_has_grid_support=>false
,p_glv_new_row=>true
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804640954317800254)
,p_page_template_id=>wwv_flow_api.id(1774825962588936426)
,p_name=>'Page Header'
,p_placeholder=>'REGION_POSITION_07'
,p_has_grid_support=>false
,p_glv_new_row=>true
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804641490939800254)
,p_page_template_id=>wwv_flow_api.id(1774825962588936426)
,p_name=>'Before Content Body'
,p_placeholder=>'REGION_POSITION_08'
,p_has_grid_support=>true
,p_glv_new_row=>false
,p_max_fixed_grid_columns=>8
);
end;
/
prompt --application/shared_components/user_interface/templates/page/left_and_right_side_columns
begin
wwv_flow_api.create_template(
p_id=>wwv_flow_api.id(1774828232547936431)
,p_theme_id=>42
,p_name=>'Left and Right Side Columns'
,p_internal_name=>'LEFT_AND_RIGHT_SIDE_COLUMNS'
,p_is_popup=>false
,p_javascript_code_onload=>'apex.theme42.initializePage.bothSideCols();'
,p_header_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<!DOCTYPE html>',
'<html class="no-js #RTL_CLASS# page-&APP_PAGE_ID. app-&APP_ALIAS." lang="&BROWSER_LANGUAGE." #TEXT_DIRECTION#>',
'<head>',
' <meta http-equiv="x-ua-compatible" content="IE=edge" />',
' <meta charset="utf-8"> ',
' <title>#TITLE#</title>',
' #APEX_CSS#',
' #THEME_CSS#',
' #TEMPLATE_CSS#',
' #THEME_STYLE_CSS#',
' #APPLICATION_CSS#',
' #PAGE_CSS#',
' #FAVICONS#',
' #HEAD#',
' <meta name="viewport" content="width=device-width, initial-scale=1.0"/>',
'</head>',
'<body class="t-PageBody t-PageBody--showLeft no-anim t-PageTemplate--leftRightCol #PAGE_CSS_CLASSES#" #TEXT_DIRECTION# #ONLOAD# id="t_PageBody">',
'<a href="#main" id="t_Body_skipToContent">&APP_TEXT$UI_PAGE_SKIP_TO_CONTENT.</a>',
'#FORM_OPEN#',
'<header class="t-Header" id="t_Header" role="banner">',
' #REGION_POSITION_07#',
' <div class="t-Header-branding">',
' <div class="t-Header-controls">',
' <button class="t-Button t-Button--icon t-Button--header t-Button--headerTree" aria-label="#EXPAND_COLLAPSE_NAV_LABEL#" title="#EXPAND_COLLAPSE_NAV_LABEL#" id="t_Button_navControl" type="button"><span class="t-Header-controlsIcon" aria-hidden="t'
||'rue"></span></button>',
' </div>',
' <div class="t-Header-logo">',
' <a href="#HOME_LINK#" class="t-Header-logo-link">#LOGO#</a>',
' </div>',
' <div class="t-Header-navBar">#NAVIGATION_BAR#</div>',
' </div>',
' <div class="t-Header-nav">#TOP_GLOBAL_NAVIGATION_LIST##REGION_POSITION_06#</div>',
'</header>',
''))
,p_box=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Body">',
' #SIDE_GLOBAL_NAVIGATION_LIST#',
' <div class="t-Body-main">',
' <div class="t-Body-title" id="t_Body_title">#REGION_POSITION_01#</div>',
' <div class="t-Body-side" id="t_Body_side">#REGION_POSITION_02#</div>',
' <div class="t-Body-content" id="t_Body_content">',
' <main id="main" class="t-Body-mainContent">',
' #SUCCESS_MESSAGE##NOTIFICATION_MESSAGE##GLOBAL_NOTIFICATION#',
' <div class="t-Body-fullContent">#REGION_POSITION_08#</div>',
' <div class="t-Body-contentInner">#BODY#</div>',
' </main>',
' <footer class="t-Footer" id="t_Footer" role="contentinfo">',
' <div class="t-Footer-body">',
' <div class="t-Footer-content">#REGION_POSITION_05#</div>',
' <div class="t-Footer-apex">',
' <div class="t-Footer-version">#APP_VERSION#</div>',
' <div class="t-Footer-customize">#CUSTOMIZE#</div>',
' #BUILT_WITH_LOVE_USING_APEX#',
' </div>',
' </div>',
' <div class="t-Footer-top">',
' <a href="#top" class="t-Footer-topButton" id="t_Footer_topButton"><span class="a-Icon icon-up-chevron"></span></a>',
' </div>',
' </footer>',
' </div>',
' </div>',
' <div class="t-Body-actions" id="t_Body_actions">',
' <button class="t-Body-actionsToggle" title="#EXPAND_COLLAPSE_SIDE_COL_LABEL#" id="t_Button_rightControlButton" type="button"><span class="t-Body-actionsControlsIcon" aria-hidden="true"></span></button>',
' <div class="t-Body-actionsContent" role="complementary">#REGION_POSITION_03#</div>',
' </div>',
'</div>',
'<div class="t-Body-inlineDialogs" id="t_Body_inlineDialogs">#REGION_POSITION_04#</div>'))
,p_footer_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'#FORM_CLOSE#',
'#DEVELOPER_TOOLBAR#',
'#APEX_JAVASCRIPT#',
'#GENERATED_CSS#',
'#THEME_JAVASCRIPT#',
'#TEMPLATE_JAVASCRIPT#',
'#APPLICATION_JAVASCRIPT#',
'#PAGE_JAVASCRIPT# ',
'#GENERATED_JAVASCRIPT#',
'</body>',
'</html>'))
,p_success_message=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Body-alert">',
' <div class="t-Alert t-Alert--defaultIcons t-Alert--success t-Alert--horizontal t-Alert--page t-Alert--colorBG" id="t_Alert_Success" role="alert">',
' <div class="t-Alert-wrap">',
' <div class="t-Alert-icon">',
' <span class="t-Icon"></span>',
' </div>',
' <div class="t-Alert-content">',
' <div class="t-Alert-header">',
' <h2 class="t-Alert-title">#SUCCESS_MESSAGE#</h2>',
' </div>',
' </div>',
' <div class="t-Alert-buttons">',
' <button class="t-Button t-Button--noUI t-Button--icon t-Button--closeAlert" onclick="apex.jQuery(''#t_Alert_Success'').remove();" type="button" title="#CLOSE_NOTIFICATION#"><span class="t-Icon icon-close"></span></button>',
' </div>',
' </div>',
' </div>',
'</div>'))
,p_notification_message=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Body-alert">',
' <div class="t-Alert t-Alert--defaultIcons t-Alert--warning t-Alert--horizontal t-Alert--page t-Alert--colorBG" id="t_Alert_Notification" role="alert">',
' <div class="t-Alert-wrap">',
' <div class="t-Alert-icon">',
' <span class="t-Icon"></span>',
' </div>',
' <div class="t-Alert-content">',
' <div class="t-Alert-body">#MESSAGE#</div>',
' </div>',
' <div class="t-Alert-buttons">',
' <button class="t-Button t-Button--noUI t-Button--icon t-Button--closeAlert" onclick="apex.jQuery(''#t_Alert_Notification'').remove();" type="button" title="#CLOSE_NOTIFICATION#"><span class="t-Icon icon-close"></span></button>',
' </div>',
' </div>',
' </div>',
'</div>'))
,p_navigation_bar=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<ul class="t-NavigationBar" data-mode="classic">',
' <li class="t-NavigationBar-item">',
' <span class="t-Button t-Button--icon t-Button--noUI t-Button--header t-Button--navBar t-Button--headerUser">',
' <span class="t-Icon a-Icon icon-user"></span>',
' <span class="t-Button-label">&APP_USER.</span>',
' </span>',
' </li>#BAR_BODY#',
'</ul>'))
,p_navbar_entry=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li class="t-NavigationBar-item">',
' <a class="t-Button t-Button--icon t-Button--header t-Button--navBar" href="#LINK#">',
' <span class="t-Icon #IMAGE#"></span>',
' <span class="t-Button-label">#TEXT#</span>',
' </a>',
'</li>'))
,p_region_table_cattributes=>' summary="" cellpadding="0" border="0" cellspacing="0" width="100%"'
,p_sidebar_def_reg_pos=>'REGION_POSITION_03'
,p_breadcrumb_def_reg_pos=>'REGION_POSITION_01'
,p_theme_class_id=>17
,p_error_page_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Alert t-Alert--danger t-Alert--wizard t-Alert--defaultIcons">',
' <div class="t-Alert-wrap">',
' <div class="t-Alert-icon">',
' <span class="t-Icon"></span>',
' </div>',
' <div class="t-Alert-content">',
' <div class="t-Alert-body">',
' <h3>#MESSAGE#</h3>',
' <p>#ADDITIONAL_INFO#</p>',
' <div class="t-Alert-inset">#TECHNICAL_INFO#</div>',
' </div>',
' </div>',
' <div class="t-Alert-buttons">',
' <button onclick="#BACK_LINK#" class="t-Button t-Button--hot w50p t-Button--large" type="button">#OK#</button>',
' </div>',
' </div>',
'</div>'))
,p_grid_type=>'FIXED'
,p_grid_max_columns=>12
,p_grid_always_use_max_columns=>true
,p_grid_has_column_span=>true
,p_grid_always_emit=>false
,p_grid_emit_empty_leading_cols=>true
,p_grid_emit_empty_trail_cols=>false
,p_grid_default_label_col_span=>2
,p_grid_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="container">',
'#ROWS#',
'</div>'))
,p_grid_row_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="row #CSS_CLASSES#">',
'#COLUMNS#',
'</div>'))
,p_grid_column_template=>'<div class="col col-#COLUMN_SPAN_NUMBER# #CSS_CLASSES#" #ATTRIBUTES#>#CONTENT#</div>'
,p_grid_first_column_attributes=>'alpha'
,p_grid_last_column_attributes=>'omega'
,p_dialog_js_init_code=>'apex.navigation.dialog(#PAGE_URL#,{title:#TITLE#,height:#DIALOG_HEIGHT#,width:#DIALOG_WIDTH#,maxWidth:#DIALOG_MAX_WIDTH#,modal:#IS_MODAL#,dialog:#DIALOG#,#DIALOG_ATTRIBUTES#},#DIALOG_CSS_CLASSES#,#TRIGGERING_ELEMENT#);'
,p_dialog_js_close_code=>'apex.navigation.dialog.close(#IS_MODAL#,#TARGET#);'
,p_dialog_js_cancel_code=>'apex.navigation.dialog.cancel(#IS_MODAL#);'
,p_dialog_browser_frame=>'MODAL'
,p_reference_id=>2525203692562657055
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804646127656800259)
,p_page_template_id=>wwv_flow_api.id(1774828232547936431)
,p_name=>'Content Body'
,p_placeholder=>'BODY'
,p_has_grid_support=>true
,p_glv_new_row=>true
,p_max_fixed_grid_columns=>6
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804646624926800259)
,p_page_template_id=>wwv_flow_api.id(1774828232547936431)
,p_name=>'Breadcrumb Bar'
,p_placeholder=>'REGION_POSITION_01'
,p_has_grid_support=>false
,p_glv_new_row=>true
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804647171270800259)
,p_page_template_id=>wwv_flow_api.id(1774828232547936431)
,p_name=>'Left Column'
,p_placeholder=>'REGION_POSITION_02'
,p_has_grid_support=>false
,p_glv_new_row=>true
,p_max_fixed_grid_columns=>3
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804647683483800260)
,p_page_template_id=>wwv_flow_api.id(1774828232547936431)
,p_name=>'Right Column'
,p_placeholder=>'REGION_POSITION_03'
,p_has_grid_support=>false
,p_glv_new_row=>false
,p_max_fixed_grid_columns=>3
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804648126139800260)
,p_page_template_id=>wwv_flow_api.id(1774828232547936431)
,p_name=>'Inline Dialogs'
,p_placeholder=>'REGION_POSITION_04'
,p_has_grid_support=>true
,p_glv_new_row=>true
,p_max_fixed_grid_columns=>12
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804648674243800260)
,p_page_template_id=>wwv_flow_api.id(1774828232547936431)
,p_name=>'Footer'
,p_placeholder=>'REGION_POSITION_05'
,p_has_grid_support=>true
,p_glv_new_row=>true
,p_max_fixed_grid_columns=>6
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804649179215800260)
,p_page_template_id=>wwv_flow_api.id(1774828232547936431)
,p_name=>'Page Navigation'
,p_placeholder=>'REGION_POSITION_06'
,p_has_grid_support=>false
,p_glv_new_row=>true
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804649695321800261)
,p_page_template_id=>wwv_flow_api.id(1774828232547936431)
,p_name=>'Page Header'
,p_placeholder=>'REGION_POSITION_07'
,p_has_grid_support=>false
,p_glv_new_row=>true
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804650158294800261)
,p_page_template_id=>wwv_flow_api.id(1774828232547936431)
,p_name=>'Before Content Body'
,p_placeholder=>'REGION_POSITION_08'
,p_has_grid_support=>true
,p_glv_new_row=>false
,p_max_fixed_grid_columns=>6
);
end;
/
prompt --application/shared_components/user_interface/templates/page/login
begin
wwv_flow_api.create_template(
p_id=>wwv_flow_api.id(1774830836871936435)
,p_theme_id=>42
,p_name=>'Login'
,p_internal_name=>'LOGIN'
,p_is_popup=>false
,p_javascript_code_onload=>'apex.theme42.initializePage.appLogin();'
,p_header_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<!DOCTYPE html>',
'<html class="no-js #RTL_CLASS# page-&APP_PAGE_ID. app-&APP_ALIAS." lang="&BROWSER_LANGUAGE." #TEXT_DIRECTION#>',
'<head>',
' <meta http-equiv="x-ua-compatible" content="IE=edge" />',
' <meta charset="utf-8">',
' <title>#TITLE#</title>',
' #APEX_CSS#',
' #THEME_CSS#',
' #TEMPLATE_CSS#',
' #THEME_STYLE_CSS#',
' #APPLICATION_CSS#',
' #PAGE_CSS#',
' #FAVICONS#',
' #HEAD#',
' <meta name="viewport" content="width=device-width, initial-scale=1.0" />',
'</head>',
'<body class="t-PageBody--login t-PageTemplate--login no-anim #PAGE_CSS_CLASSES#" #TEXT_DIRECTION# #ONLOAD#>',
'#FORM_OPEN#'))
,p_box=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Login-container">',
' <header class="t-Login-containerHeader">#REGION_POSITION_01#</header>',
' <main class="t-Login-containerBody" id="main">#SUCCESS_MESSAGE##NOTIFICATION_MESSAGE##GLOBAL_NOTIFICATION##BODY#</main>',
' <footer class="t-Login-containerFooter">#REGION_POSITION_02#</footer>',
'</div>',
''))
,p_footer_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'#FORM_CLOSE#',
'#DEVELOPER_TOOLBAR#',
'#APEX_JAVASCRIPT#',
'#GENERATED_CSS#',
'#THEME_JAVASCRIPT#',
'#TEMPLATE_JAVASCRIPT#',
'#APPLICATION_JAVASCRIPT#',
'#PAGE_JAVASCRIPT#',
'#GENERATED_JAVASCRIPT#',
'</body>',
'</html>'))
,p_success_message=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Body-alert">',
' <div class="t-Alert t-Alert--defaultIcons t-Alert--success t-Alert--horizontal t-Alert--page t-Alert--colorBG" id="t_Alert_Success" role="alert">',
' <div class="t-Alert-wrap">',
' <div class="t-Alert-icon">',
' <span class="t-Icon"></span>',
' </div>',
' <div class="t-Alert-content">',
' <div class="t-Alert-header">',
' <h2 class="t-Alert-title">#SUCCESS_MESSAGE#</h2>',
' </div>',
' </div>',
' <div class="t-Alert-buttons">',
' <button class="t-Button t-Button--noUI t-Button--icon t-Button--closeAlert" onclick="apex.jQuery(''#t_Alert_Success'').remove();" type="button" title="#CLOSE_NOTIFICATION#"><span class="t-Icon icon-close"></span></button>',
' </div>',
' </div>',
' </div>',
'</div>'))
,p_notification_message=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Body-alert">',
' <div class="t-Alert t-Alert--defaultIcons t-Alert--warning t-Alert--horizontal t-Alert--page t-Alert--colorBG" id="t_Alert_Notification" role="alert">',
' <div class="t-Alert-wrap">',
' <div class="t-Alert-icon">',
' <span class="t-Icon"></span>',
' </div>',
' <div class="t-Alert-content">',
' <div class="t-Alert-body">#MESSAGE#</div>',
' </div>',
' <div class="t-Alert-buttons">',
' <button class="t-Button t-Button--noUI t-Button--icon t-Button--closeAlert" onclick="apex.jQuery(''#t_Alert_Notification'').remove();" type="button" title="#CLOSE_NOTIFICATION#"><span class="t-Icon icon-close"></span></button>',
' </div>',
' </div>',
' </div>',
'</div>'))
,p_region_table_cattributes=>' summary="" cellpadding="0" border="0" cellspacing="0" width="100%"'
,p_breadcrumb_def_reg_pos=>'REGION_POSITION_01'
,p_theme_class_id=>6
,p_error_page_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Alert t-Alert--danger t-Alert--wizard t-Alert--defaultIcons">',
' <div class="t-Alert-wrap">',
' <div class="t-Alert-icon">',
' <span class="t-Icon"></span>',
' </div>',
' <div class="t-Alert-content">',
' <div class="t-Alert-body">',
' <h3>#MESSAGE#</h3>',
' <p>#ADDITIONAL_INFO#</p>',
' <div class="t-Alert-inset">#TECHNICAL_INFO#</div>',
' </div>',
' </div>',
' <div class="t-Alert-buttons">',
' <button onclick="#BACK_LINK#" class="t-Button t-Button--hot w50p t-Button--large" type="button">#OK#</button>',
' </div>',
' </div>',
'</div>'))
,p_grid_type=>'FIXED'
,p_grid_max_columns=>12
,p_grid_always_use_max_columns=>true
,p_grid_has_column_span=>true
,p_grid_always_emit=>false
,p_grid_emit_empty_leading_cols=>true
,p_grid_emit_empty_trail_cols=>false
,p_grid_default_label_col_span=>2
,p_grid_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="container">',
'#ROWS#',
'</div>'))
,p_grid_row_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="row #CSS_CLASSES#">',
'#COLUMNS#',
'</div>'))
,p_grid_column_template=>'<div class="col col-#COLUMN_SPAN_NUMBER# #CSS_CLASSES#" #ATTRIBUTES#>#CONTENT#</div>'
,p_grid_first_column_attributes=>'alpha'
,p_grid_last_column_attributes=>'omega'
,p_dialog_js_init_code=>'apex.navigation.dialog(#PAGE_URL#,{title:#TITLE#,height:#DIALOG_HEIGHT#,width:#DIALOG_WIDTH#,maxWidth:#DIALOG_MAX_WIDTH#,modal:#IS_MODAL#,dialog:#DIALOG#,#DIALOG_ATTRIBUTES#},#DIALOG_CSS_CLASSES#,#TRIGGERING_ELEMENT#);'
,p_dialog_js_close_code=>'apex.navigation.dialog.close(#IS_MODAL#,#TARGET#);'
,p_dialog_js_cancel_code=>'apex.navigation.dialog.cancel(#IS_MODAL#);'
,p_dialog_browser_frame=>'MODAL'
,p_reference_id=>2099711150063350616
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804652440304800263)
,p_page_template_id=>wwv_flow_api.id(1774830836871936435)
,p_name=>'Content Body'
,p_placeholder=>'BODY'
,p_has_grid_support=>true
,p_glv_new_row=>true
,p_max_fixed_grid_columns=>12
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804652971309800263)
,p_page_template_id=>wwv_flow_api.id(1774830836871936435)
,p_name=>'Body Header'
,p_placeholder=>'REGION_POSITION_01'
,p_has_grid_support=>false
,p_glv_new_row=>true
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804653441386800263)
,p_page_template_id=>wwv_flow_api.id(1774830836871936435)
,p_name=>'Body Footer'
,p_placeholder=>'REGION_POSITION_02'
,p_has_grid_support=>false
,p_glv_new_row=>true
);
end;
/
prompt --application/shared_components/user_interface/templates/page/master_detail
begin
wwv_flow_api.create_template(
p_id=>wwv_flow_api.id(1774833450290936439)
,p_theme_id=>42
,p_name=>'Marquee'
,p_internal_name=>'MASTER_DETAIL'
,p_is_popup=>false
,p_javascript_file_urls=>wwv_flow_string.join(wwv_flow_t_varchar2(
'#IMAGE_PREFIX#libraries/apex/#MIN_DIRECTORY#widget.stickyTableHeader#MIN#.js?v=#APEX_VERSION#',
'#IMAGE_PREFIX#libraries/apex/#MIN_DIRECTORY#widget.apexTabs#MIN#.js?v=#APEX_VERSION#'))
,p_javascript_code_onload=>'apex.theme42.initializePage.masterDetail();'
,p_header_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<!DOCTYPE html>',
'<html class="no-js #RTL_CLASS# page-&APP_PAGE_ID. app-&APP_ALIAS." lang="&BROWSER_LANGUAGE." #TEXT_DIRECTION#>',
'<head>',
' <meta http-equiv="x-ua-compatible" content="IE=edge" />',
' <meta charset="utf-8">',
' <title>#TITLE#</title>',
' #APEX_CSS#',
' #THEME_CSS#',
' #TEMPLATE_CSS#',
' #THEME_STYLE_CSS#',
' #APPLICATION_CSS#',
' #PAGE_CSS#',
' #FAVICONS#',
' #HEAD#',
' <meta name="viewport" content="width=device-width, initial-scale=1.0" />',
'</head>',
'<body class="t-PageBody t-PageBody--masterDetail t-PageBody--hideLeft no-anim t-PageTemplate--marquee #PAGE_CSS_CLASSES#" #TEXT_DIRECTION# #ONLOAD# id="t_PageBody">',
'<a href="#main" id="t_Body_skipToContent">&APP_TEXT$UI_PAGE_SKIP_TO_CONTENT.</a>',
'#FORM_OPEN#',
'<header class="t-Header" id="t_Header" role="banner">',
' #REGION_POSITION_07#',
' <div class="t-Header-branding">',
' <div class="t-Header-controls">',
' <button class="t-Button t-Button--icon t-Button--header t-Button--headerTree" aria-label="#EXPAND_COLLAPSE_NAV_LABEL#" title="#EXPAND_COLLAPSE_NAV_LABEL#" id="t_Button_navControl" type="button"><span class="t-Header-controlsIcon" aria-hidden="t'
||'rue"></span></button>',
' </div>',
' <div class="t-Header-logo">',
' <a href="#HOME_LINK#" class="t-Header-logo-link">#LOGO#</a>',
' </div>',
' <div class="t-Header-navBar">#NAVIGATION_BAR#</div>',
' </div>',
' <div class="t-Header-nav">#TOP_GLOBAL_NAVIGATION_LIST##REGION_POSITION_06#</div>',
'</header>'))
,p_box=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Body">',
' #SIDE_GLOBAL_NAVIGATION_LIST#',
' <div class="t-Body-main">',
' <div class="t-Body-title" id="t_Body_title">#REGION_POSITION_01#</div>',
' <div class="t-Body-content" id="t_Body_content">',
' <main id="main" class="t-Body-mainContent">',
' #SUCCESS_MESSAGE##NOTIFICATION_MESSAGE##GLOBAL_NOTIFICATION#',
' <div class="t-Body-fullContent">#REGION_POSITION_08#</div>',
' <div class="t-Body-info" id="t_Body_info">#REGION_POSITION_02#</div>',
' <div class="t-Body-contentInner" role="main">#BODY#</div>',
' </main>',
' <footer class="t-Footer" id="t_Footer" role="contentinfo">',
' <div class="t-Footer-body">',
' <div class="t-Footer-content">#REGION_POSITION_05#</div>',
' <div class="t-Footer-apex">',
' <div class="t-Footer-version">#APP_VERSION#</div>',
' <div class="t-Footer-customize">#CUSTOMIZE#</div>',
' #BUILT_WITH_LOVE_USING_APEX#',
' </div>',
' </div>',
' <div class="t-Footer-top">',
' <a href="#top" class="t-Footer-topButton" id="t_Footer_topButton"><span class="a-Icon icon-up-chevron"></span></a>',
' </div>',
' </footer>',
' </div>',
' </div>',
' <div class="t-Body-actions" id="t_Body_actions">',
' <button class="t-Body-actionsToggle" title="#EXPAND_COLLAPSE_SIDE_COL_LABEL#" id="t_Button_rightControlButton" type="button"><span class="t-Body-actionsControlsIcon" aria-hidden="true"></span></button>',
' <div class="t-Body-actionsContent" role="complementary">#REGION_POSITION_03#</div>',
' </div>',
'</div>',
'<div class="t-Body-inlineDialogs" id="t_Body_inlineDialogs">#REGION_POSITION_04#</div>'))
,p_footer_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'#FORM_CLOSE#',
'#DEVELOPER_TOOLBAR#',
'#APEX_JAVASCRIPT#',
'#GENERATED_CSS#',
'#THEME_JAVASCRIPT#',
'#TEMPLATE_JAVASCRIPT#',
'#APPLICATION_JAVASCRIPT#',
'#PAGE_JAVASCRIPT# ',
'#GENERATED_JAVASCRIPT#',
'</body>',
'</html>'))
,p_success_message=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Body-alert">',
' <div class="t-Alert t-Alert--defaultIcons t-Alert--success t-Alert--horizontal t-Alert--page t-Alert--colorBG" id="t_Alert_Success" role="alert">',
' <div class="t-Alert-wrap">',
' <div class="t-Alert-icon">',
' <span class="t-Icon"></span>',
' </div>',
' <div class="t-Alert-content">',
' <div class="t-Alert-header">',
' <h2 class="t-Alert-title">#SUCCESS_MESSAGE#</h2>',
' </div>',
' </div>',
' <div class="t-Alert-buttons">',
' <button class="t-Button t-Button--noUI t-Button--icon t-Button--closeAlert" onclick="apex.jQuery(''#t_Alert_Success'').remove();" type="button" title="#CLOSE_NOTIFICATION#"><span class="t-Icon icon-close"></span></button>',
' </div>',
' </div>',
' </div>',
'</div>'))
,p_notification_message=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Body-alert">',
' <div class="t-Alert t-Alert--defaultIcons t-Alert--warning t-Alert--horizontal t-Alert--page t-Alert--colorBG" id="t_Alert_Notification" role="alert">',
' <div class="t-Alert-wrap">',
' <div class="t-Alert-icon">',
' <span class="t-Icon"></span>',
' </div>',
' <div class="t-Alert-content">',
' <div class="t-Alert-body">#MESSAGE#</div>',
' </div>',
' <div class="t-Alert-buttons">',
' <button class="t-Button t-Button--noUI t-Button--icon t-Button--closeAlert" onclick="apex.jQuery(''#t_Alert_Notification'').remove();" type="button" title="#CLOSE_NOTIFICATION#"><span class="t-Icon icon-close"></span></button>',
' </div>',
' </div>',
' </div>',
'</div>'))
,p_navigation_bar=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<ul class="t-NavigationBar" data-mode="classic">',
' <li class="t-NavigationBar-item">',
' <span class="t-Button t-Button--icon t-Button--noUI t-Button--header t-Button--navBar t-Button--headerUser">',
' <span class="t-Icon a-Icon icon-user"></span>',
' <span class="t-Button-label">&APP_USER.</span>',
' </span>',
' </li>#BAR_BODY#',
'</ul>'))
,p_navbar_entry=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li class="t-NavigationBar-item">',
' <a class="t-Button t-Button--icon t-Button--header t-Button--navBar" href="#LINK#">',
' <span class="t-Icon #IMAGE#"></span>',
' <span class="t-Button-label">#TEXT#</span>',
' </a>',
'</li>'))
,p_region_table_cattributes=>' summary="" cellpadding="0" border="0" cellspacing="0" width="100%"'
,p_sidebar_def_reg_pos=>'REGION_POSITION_03'
,p_breadcrumb_def_reg_pos=>'REGION_POSITION_01'
,p_theme_class_id=>17
,p_error_page_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Alert t-Alert--danger t-Alert--wizard t-Alert--defaultIcons">',
' <div class="t-Alert-wrap">',
' <div class="t-Alert-icon">',
' <span class="t-Icon"></span>',
' </div>',
' <div class="t-Alert-content">',
' <div class="t-Alert-body">',
' <h3>#MESSAGE#</h3>',
' <p>#ADDITIONAL_INFO#</p>',
' <div class="t-Alert-inset">#TECHNICAL_INFO#</div>',
' </div>',
' </div>',
' <div class="t-Alert-buttons">',
' <button onclick="#BACK_LINK#" class="t-Button t-Button--hot w50p t-Button--large" type="button">#OK#</button>',
' </div>',
' </div>',
'</div>'))
,p_grid_type=>'FIXED'
,p_grid_max_columns=>12
,p_grid_always_use_max_columns=>true
,p_grid_has_column_span=>true
,p_grid_always_emit=>false
,p_grid_emit_empty_leading_cols=>true
,p_grid_emit_empty_trail_cols=>false
,p_grid_default_label_col_span=>2
,p_grid_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="container">',
'#ROWS#',
'</div>'))
,p_grid_row_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="row #CSS_CLASSES#">',
'#COLUMNS#',
'</div>'))
,p_grid_column_template=>'<div class="col col-#COLUMN_SPAN_NUMBER# #CSS_CLASSES#" #ATTRIBUTES#>#CONTENT#</div>'
,p_grid_first_column_attributes=>'alpha'
,p_grid_last_column_attributes=>'omega'
,p_dialog_js_init_code=>'apex.navigation.dialog(#PAGE_URL#,{title:#TITLE#,height:#DIALOG_HEIGHT#,width:#DIALOG_WIDTH#,maxWidth:#DIALOG_MAX_WIDTH#,modal:#IS_MODAL#,dialog:#DIALOG#,#DIALOG_ATTRIBUTES#},#DIALOG_CSS_CLASSES#,#TRIGGERING_ELEMENT#);'
,p_dialog_js_close_code=>'apex.navigation.dialog.close(#IS_MODAL#,#TARGET#);'
,p_dialog_js_cancel_code=>'apex.navigation.dialog.cancel(#IS_MODAL#);'
,p_dialog_browser_frame=>'MODAL'
,p_reference_id=>1996914646461572319
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804660233006800274)
,p_page_template_id=>wwv_flow_api.id(1774833450290936439)
,p_name=>'Content Body'
,p_placeholder=>'BODY'
,p_has_grid_support=>true
,p_glv_new_row=>true
,p_max_fixed_grid_columns=>8
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804660724955800275)
,p_page_template_id=>wwv_flow_api.id(1774833450290936439)
,p_name=>'Breadcrumb Bar'
,p_placeholder=>'REGION_POSITION_01'
,p_has_grid_support=>false
,p_glv_new_row=>true
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804661265232800275)
,p_page_template_id=>wwv_flow_api.id(1774833450290936439)
,p_name=>'Master Detail'
,p_placeholder=>'REGION_POSITION_02'
,p_has_grid_support=>true
,p_glv_new_row=>true
,p_max_fixed_grid_columns=>8
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804661754061800275)
,p_page_template_id=>wwv_flow_api.id(1774833450290936439)
,p_name=>'Right Side Column'
,p_placeholder=>'REGION_POSITION_03'
,p_has_grid_support=>false
,p_glv_new_row=>false
,p_max_fixed_grid_columns=>4
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804662200347800275)
,p_page_template_id=>wwv_flow_api.id(1774833450290936439)
,p_name=>'Inline Dialogs'
,p_placeholder=>'REGION_POSITION_04'
,p_has_grid_support=>true
,p_glv_new_row=>true
,p_max_fixed_grid_columns=>12
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804662764911800276)
,p_page_template_id=>wwv_flow_api.id(1774833450290936439)
,p_name=>'Footer'
,p_placeholder=>'REGION_POSITION_05'
,p_has_grid_support=>true
,p_glv_new_row=>true
,p_max_fixed_grid_columns=>8
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804663210742800276)
,p_page_template_id=>wwv_flow_api.id(1774833450290936439)
,p_name=>'Page Navigation'
,p_placeholder=>'REGION_POSITION_06'
,p_has_grid_support=>false
,p_glv_new_row=>true
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804663774696800276)
,p_page_template_id=>wwv_flow_api.id(1774833450290936439)
,p_name=>'Page Header'
,p_placeholder=>'REGION_POSITION_07'
,p_has_grid_support=>false
,p_glv_new_row=>true
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804664279727800276)
,p_page_template_id=>wwv_flow_api.id(1774833450290936439)
,p_name=>'Before Content Body'
,p_placeholder=>'REGION_POSITION_08'
,p_has_grid_support=>true
,p_glv_new_row=>true
,p_max_fixed_grid_columns=>8
);
end;
/
prompt --application/shared_components/user_interface/templates/page/minimal_no_navigation
begin
wwv_flow_api.create_template(
p_id=>wwv_flow_api.id(1774836276815936445)
,p_theme_id=>42
,p_name=>'Minimal (No Navigation)'
,p_internal_name=>'MINIMAL_NO_NAVIGATION'
,p_is_popup=>false
,p_javascript_code_onload=>'apex.theme42.initializePage.noSideCol();'
,p_header_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<!DOCTYPE html>',
'<html class="no-js #RTL_CLASS# page-&APP_PAGE_ID. app-&APP_ALIAS." lang="&BROWSER_LANGUAGE." #TEXT_DIRECTION#>',
'<head>',
' <meta http-equiv="x-ua-compatible" content="IE=edge" />',
' <meta charset="utf-8">',
' <title>#TITLE#</title>',
' #APEX_CSS#',
' #THEME_CSS#',
' #TEMPLATE_CSS#',
' #THEME_STYLE_CSS#',
' #APPLICATION_CSS#',
' #PAGE_CSS# ',
' #FAVICONS#',
' #HEAD#',
' <meta name="viewport" content="width=device-width, initial-scale=1.0" />',
'</head>',
'<body class="t-PageBody t-PageBody--hideLeft t-PageBody--hideActions no-anim #PAGE_CSS_CLASSES# t-PageBody--noNav t-PageTemplate--minimal" #TEXT_DIRECTION# #ONLOAD# id="t_PageBody">',
'<a href="#main" id="t_Body_skipToContent">&APP_TEXT$UI_PAGE_SKIP_TO_CONTENT.</a>',
'#FORM_OPEN#',
'<header class="t-Header" id="t_Header" role="banner">',
' #REGION_POSITION_07#',
' <div class="t-Header-branding">',
' <div class="t-Header-controls">',
' <button class="t-Button t-Button--icon t-Button--header t-Button--headerTree" aria-label="#EXPAND_COLLAPSE_NAV_LABEL#" title="#EXPAND_COLLAPSE_NAV_LABEL#" id="t_Button_navControl" type="button"><span class="t-Icon fa fa-bars" aria-hidden="true"'
||'></span></button>',
' </div>',
' <div class="t-Header-logo">',
' <a href="#HOME_LINK#" class="t-Header-logo-link">#LOGO#</a>',
' </div>',
' <div class="t-Header-navBar">#NAVIGATION_BAR#</div>',
' </div>',
'</header>',
' '))
,p_box=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Body">',
' <div class="t-Body-main">',
' <div class="t-Body-title" id="t_Body_title">#REGION_POSITION_01#</div>',
' <div class="t-Body-content" id="t_Body_content">',
' <main id="main" class="t-Body-mainContent">',
' #SUCCESS_MESSAGE##NOTIFICATION_MESSAGE##GLOBAL_NOTIFICATION#',
' <div class="t-Body-fullContent">#REGION_POSITION_08#</div>',
' <div class="t-Body-contentInner">#BODY#</div>',
' </main>',
' <footer class="t-Footer" id="t_Footer" role="contentinfo">',
' <div class="t-Footer-body">',
' <div class="t-Footer-content">#REGION_POSITION_05#</div>',
' <div class="t-Footer-apex">',
' <div class="t-Footer-version">#APP_VERSION#</div>',
' <div class="t-Footer-customize">#CUSTOMIZE#</div>',
' #BUILT_WITH_LOVE_USING_APEX#',
' </div>',
' </div>',
' <div class="t-Footer-top">',
' <a href="#top" class="t-Footer-topButton" id="t_Footer_topButton"><span class="a-Icon icon-up-chevron"></span></a>',
' </div>',
' </footer>',
' </div>',
' </div>',
'</div>',
'<div class="t-Body-inlineDialogs" id="t_Body_inlineDialogs">#REGION_POSITION_04#</div>'))
,p_footer_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'#FORM_CLOSE#',
'#DEVELOPER_TOOLBAR#',
'#APEX_JAVASCRIPT#',
'#GENERATED_CSS#',
'#THEME_JAVASCRIPT#',
'#TEMPLATE_JAVASCRIPT#',
'#APPLICATION_JAVASCRIPT#',
'#PAGE_JAVASCRIPT# ',
'#GENERATED_JAVASCRIPT#',
'</body>',
'</html>',
''))
,p_success_message=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Body-alert">',
' <div class="t-Alert t-Alert--defaultIcons t-Alert--success t-Alert--horizontal t-Alert--page t-Alert--colorBG" id="t_Alert_Success" role="alert">',
' <div class="t-Alert-wrap">',
' <div class="t-Alert-icon">',
' <span class="t-Icon"></span>',
' </div>',
' <div class="t-Alert-content">',
' <div class="t-Alert-header">',
' <h2 class="t-Alert-title">#SUCCESS_MESSAGE#</h2>',
' </div>',
' </div>',
' <div class="t-Alert-buttons">',
' <button class="t-Button t-Button--noUI t-Button--icon t-Button--closeAlert" type="button" title="#CLOSE_NOTIFICATION#"><span class="t-Icon icon-close"></span></button>',
' </div>',
' </div>',
' </div>',
'</div>'))
,p_notification_message=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Body-alert">',
' <div class="t-Alert t-Alert--defaultIcons t-Alert--warning t-Alert--horizontal t-Alert--page t-Alert--colorBG" id="t_Alert_Notification" role="alert">',
' <div class="t-Alert-wrap">',
' <div class="t-Alert-icon">',
' <span class="t-Icon"></span>',
' </div>',
' <div class="t-Alert-content">',
' <div class="t-Alert-body">#MESSAGE#</div>',
' </div>',
' <div class="t-Alert-buttons">',
' <button class="t-Button t-Button--noUI t-Button--icon t-Button--closeAlert" type="button" title="#CLOSE_NOTIFICATION#"><span class="t-Icon icon-close"></span></button>',
' </div>',
' </div>',
' </div>',
'</div>'))
,p_navigation_bar=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<ul class="t-NavigationBar t-NavigationBar--classic" data-mode="classic">',
' <li class="t-NavigationBar-item">',
' <span class="t-Button t-Button--icon t-Button--noUI t-Button--header t-Button--navBar t-Button--headerUser">',
' <span class="t-Icon a-Icon icon-user"></span>',
' <span class="t-Button-label">&APP_USER.</span>',
' </span>',
' </li>#BAR_BODY#',
'</ul>'))
,p_navbar_entry=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li class="t-NavigationBar-item">',
' <a class="t-Button t-Button--icon t-Button--header" href="#LINK#">',
' <span class="t-Icon #IMAGE#"></span>',
' <span class="t-Button-label">#TEXT#</span>',
' </a>',
'</li>'))
,p_region_table_cattributes=>' summary="" cellpadding="0" border="0" cellspacing="0" width="100%"'
,p_breadcrumb_def_reg_pos=>'REGION_POSITION_01'
,p_theme_class_id=>4
,p_error_page_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Alert t-Alert--danger t-Alert--wizard t-Alert--defaultIcons">',
' <div class="t-Alert-wrap">',
' <div class="t-Alert-icon">',
' <span class="t-Icon"></span>',
' </div>',
' <div class="t-Alert-content">',
' <div class="t-Alert-body">',
' <h3>#MESSAGE#</h3>',
' <p>#ADDITIONAL_INFO#</p>',
' <div class="t-Alert-inset">#TECHNICAL_INFO#</div>',
' </div>',
' </div>',
' <div class="t-Alert-buttons">',
' <button onclick="#BACK_LINK#" class="t-Button t-Button--hot w50p t-Button--large" type="button">#OK#</button>',
' </div>',
' </div>',
'</div>'))
,p_grid_type=>'FIXED'
,p_grid_max_columns=>12
,p_grid_always_use_max_columns=>true
,p_grid_has_column_span=>true
,p_grid_always_emit=>false
,p_grid_emit_empty_leading_cols=>true
,p_grid_emit_empty_trail_cols=>false
,p_grid_default_label_col_span=>2
,p_grid_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="container">',
'#ROWS#',
'</div>'))
,p_grid_row_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="row #CSS_CLASSES#">',
'#COLUMNS#',
'</div>'))
,p_grid_column_template=>'<div class="col col-#COLUMN_SPAN_NUMBER# #CSS_CLASSES#" #ATTRIBUTES#>#CONTENT#</div>'
,p_grid_first_column_attributes=>'alpha'
,p_grid_last_column_attributes=>'omega'
,p_dialog_js_init_code=>'apex.navigation.dialog(#PAGE_URL#,{title:#TITLE#,height:#DIALOG_HEIGHT#,width:#DIALOG_WIDTH#,maxWidth:#DIALOG_MAX_WIDTH#,modal:#IS_MODAL#,dialog:#DIALOG#,#DIALOG_ATTRIBUTES#},#DIALOG_CSS_CLASSES#,#TRIGGERING_ELEMENT#);'
,p_dialog_js_close_code=>'apex.navigation.dialog.close(#IS_MODAL#,#TARGET#);'
,p_dialog_js_cancel_code=>'apex.navigation.dialog.cancel(#IS_MODAL#);'
,p_dialog_browser_frame=>'MODAL'
,p_reference_id=>2977628563533209425
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804668189879800281)
,p_page_template_id=>wwv_flow_api.id(1774836276815936445)
,p_name=>'Content Body'
,p_placeholder=>'BODY'
,p_has_grid_support=>true
,p_glv_new_row=>true
,p_max_fixed_grid_columns=>12
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804668695460800281)
,p_page_template_id=>wwv_flow_api.id(1774836276815936445)
,p_name=>'Breadcrumb Bar'
,p_placeholder=>'REGION_POSITION_01'
,p_has_grid_support=>false
,p_glv_new_row=>true
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804669127523800281)
,p_page_template_id=>wwv_flow_api.id(1774836276815936445)
,p_name=>'Inline Dialogs'
,p_placeholder=>'REGION_POSITION_04'
,p_has_grid_support=>true
,p_glv_new_row=>true
,p_max_fixed_grid_columns=>12
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804669645308800282)
,p_page_template_id=>wwv_flow_api.id(1774836276815936445)
,p_name=>'Footer'
,p_placeholder=>'REGION_POSITION_05'
,p_has_grid_support=>true
,p_glv_new_row=>true
,p_max_fixed_grid_columns=>12
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804670166457800282)
,p_page_template_id=>wwv_flow_api.id(1774836276815936445)
,p_name=>'Page Navigation'
,p_placeholder=>'REGION_POSITION_06'
,p_has_grid_support=>false
,p_glv_new_row=>true
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804670671637800282)
,p_page_template_id=>wwv_flow_api.id(1774836276815936445)
,p_name=>'Page Header'
,p_placeholder=>'REGION_POSITION_07'
,p_has_grid_support=>false
,p_glv_new_row=>true
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804671103108800282)
,p_page_template_id=>wwv_flow_api.id(1774836276815936445)
,p_name=>'Before Content Body'
,p_placeholder=>'REGION_POSITION_08'
,p_has_grid_support=>true
,p_glv_new_row=>true
,p_max_fixed_grid_columns=>12
);
end;
/
prompt --application/shared_components/user_interface/templates/page/modal_dialog
begin
wwv_flow_api.create_template(
p_id=>wwv_flow_api.id(1774838326496936449)
,p_theme_id=>42
,p_name=>'Modal Dialog'
,p_internal_name=>'MODAL_DIALOG'
,p_is_popup=>true
,p_javascript_code_onload=>'apex.theme42.initializePage.modalDialog();'
,p_header_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<!DOCTYPE html>',
'<html class="no-js #RTL_CLASS# page-&APP_PAGE_ID. app-&APP_ALIAS." lang="&BROWSER_LANGUAGE." #TEXT_DIRECTION#>',
'<head>',
' <meta http-equiv="x-ua-compatible" content="IE=edge" />',
' <meta charset="utf-8">',
' <title>#TITLE#</title>',
' #APEX_CSS#',
' #THEME_CSS#',
' #TEMPLATE_CSS#',
' #THEME_STYLE_CSS#',
' #APPLICATION_CSS#',
' #PAGE_CSS#',
' #FAVICONS#',
' #HEAD#',
' <meta name="viewport" content="width=device-width, initial-scale=1.0" />',
'</head>',
'<body class="t-Dialog-page t-Dialog-page--standard t-PageTemplate--dialog #DIALOG_CSS_CLASSES# #PAGE_CSS_CLASSES#" #TEXT_DIRECTION# #ONLOAD#>',
'#FORM_OPEN#'))
,p_box=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Dialog" role="dialog" aria-label="#TITLE#">',
' <div class="t-Dialog-header">#REGION_POSITION_01#</div>',
' <div class="t-Dialog-bodyWrapperOut">',
' <div class="t-Dialog-bodyWrapperIn">',
' <div class="t-Dialog-body" role="main">#SUCCESS_MESSAGE##NOTIFICATION_MESSAGE##GLOBAL_NOTIFICATION##BODY#</div>',
' </div>',
' </div>',
' <div class="t-Dialog-footer">#REGION_POSITION_03#</div>',
'</div>'))
,p_footer_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'#FORM_CLOSE#',
'#DEVELOPER_TOOLBAR#',
'#APEX_JAVASCRIPT#',
'#GENERATED_CSS#',
'#THEME_JAVASCRIPT#',
'#TEMPLATE_JAVASCRIPT#',
'#APPLICATION_JAVASCRIPT#',
'#PAGE_JAVASCRIPT# ',
'#GENERATED_JAVASCRIPT#',
'</body>',
'</html>'))
,p_success_message=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Body-alert">',
' <div class="t-Alert t-Alert--defaultIcons t-Alert--success t-Alert--horizontal t-Alert--page t-Alert--colorBG" id="t_Alert_Success" role="alert">',
' <div class="t-Alert-wrap">',
' <div class="t-Alert-icon">',
' <span class="t-Icon"></span>',
' </div>',
' <div class="t-Alert-content">',
' <div class="t-Alert-header">',
' <h2 class="t-Alert-title">#SUCCESS_MESSAGE#</h2>',
' </div>',
' </div>',
' <div class="t-Alert-buttons">',
' <button class="t-Button t-Button--noUI t-Button--icon t-Button--closeAlert" onclick="apex.jQuery(''#t_Alert_Success'').remove();" type="button" title="#CLOSE_NOTIFICATION#"><span class="t-Icon icon-close"></span></button>',
' </div>',
' </div>',
' </div>',
'</div>'))
,p_notification_message=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Body-alert">',
' <div class="t-Alert t-Alert--defaultIcons t-Alert--warning t-Alert--horizontal t-Alert--page t-Alert--colorBG" id="t_Alert_Notification" role="alert">',
' <div class="t-Alert-wrap">',
' <div class="t-Alert-icon">',
' <span class="t-Icon"></span>',
' </div>',
' <div class="t-Alert-content">',
' <div class="t-Alert-body">#MESSAGE#</div>',
' </div>',
' <div class="t-Alert-buttons">',
' <button class="t-Button t-Button--noUI t-Button--icon t-Button--closeAlert" onclick="apex.jQuery(''#t_Alert_Notification'').remove();" type="button" title="#CLOSE_NOTIFICATION#"><span class="t-Icon icon-close"></span></button>',
' </div>',
' </div>',
' </div>',
'</div>'))
,p_region_table_cattributes=>' summary="" cellpadding="0" border="0" cellspacing="0" width="100%"'
,p_breadcrumb_def_reg_pos=>'REGION_POSITION_01'
,p_theme_class_id=>3
,p_error_page_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Alert t-Alert--danger t-Alert--wizard t-Alert--defaultIcons">',
' <div class="t-Alert-wrap">',
' <div class="t-Alert-icon">',
' <span class="t-Icon"></span>',
' </div>',
' <div class="t-Alert-content">',
' <div class="t-Alert-body">',
' <h3>#MESSAGE#</h3>',
' <p>#ADDITIONAL_INFO#</p>',
' <div class="t-Alert-inset">#TECHNICAL_INFO#</div>',
' </div>',
' </div>',
' <div class="t-Alert-buttons">',
' <button onclick="#BACK_LINK#" class="t-Button t-Button--hot w50p t-Button--large" type="button">#OK#</button>',
' </div>',
' </div>',
'</div>'))
,p_grid_type=>'FIXED'
,p_grid_max_columns=>12
,p_grid_always_use_max_columns=>true
,p_grid_has_column_span=>true
,p_grid_always_emit=>false
,p_grid_emit_empty_leading_cols=>true
,p_grid_emit_empty_trail_cols=>false
,p_grid_default_label_col_span=>2
,p_grid_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="container">',
'#ROWS#',
'</div>'))
,p_grid_row_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="row #CSS_CLASSES#">',
'#COLUMNS#',
'</div>'))
,p_grid_column_template=>'<div class="col col-#COLUMN_SPAN_NUMBER# #CSS_CLASSES#" #ATTRIBUTES#>#CONTENT#</div>'
,p_grid_first_column_attributes=>'alpha'
,p_grid_last_column_attributes=>'omega'
,p_dialog_js_init_code=>'apex.navigation.dialog(#PAGE_URL#,{title:#TITLE#,height:#DIALOG_HEIGHT#,width:#DIALOG_WIDTH#,maxWidth:#DIALOG_MAX_WIDTH#,modal:#IS_MODAL#,dialog:#DIALOG#,#DIALOG_ATTRIBUTES#},''t-Dialog-page--standard ''+#DIALOG_CSS_CLASSES#,#TRIGGERING_ELEMENT#);'
,p_dialog_js_close_code=>'apex.navigation.dialog.close(#IS_MODAL#,#TARGET#);'
,p_dialog_js_cancel_code=>'apex.navigation.dialog.cancel(#IS_MODAL#);'
,p_dialog_height=>'auto'
,p_dialog_width=>'720'
,p_dialog_max_width=>'960'
,p_dialog_browser_frame=>'MODAL'
,p_reference_id=>2098960803539086924
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804673470452800284)
,p_page_template_id=>wwv_flow_api.id(1774838326496936449)
,p_name=>'Content Body'
,p_placeholder=>'BODY'
,p_has_grid_support=>true
,p_glv_new_row=>true
,p_max_fixed_grid_columns=>12
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804673954214800284)
,p_page_template_id=>wwv_flow_api.id(1774838326496936449)
,p_name=>'Dialog Header'
,p_placeholder=>'REGION_POSITION_01'
,p_has_grid_support=>false
,p_glv_new_row=>true
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804674422799800285)
,p_page_template_id=>wwv_flow_api.id(1774838326496936449)
,p_name=>'Dialog Footer'
,p_placeholder=>'REGION_POSITION_03'
,p_has_grid_support=>false
,p_glv_new_row=>true
);
end;
/
prompt --application/shared_components/user_interface/templates/page/right_side_column
begin
wwv_flow_api.create_template(
p_id=>wwv_flow_api.id(1774842030261936456)
,p_theme_id=>42
,p_name=>'Right Side Column'
,p_internal_name=>'RIGHT_SIDE_COLUMN'
,p_is_popup=>false
,p_javascript_code_onload=>'apex.theme42.initializePage.rightSideCol();'
,p_header_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<!DOCTYPE html>',
'<html class="no-js #RTL_CLASS# page-&APP_PAGE_ID. app-&APP_ALIAS." lang="&BROWSER_LANGUAGE." #TEXT_DIRECTION#>',
'<head>',
' <meta http-equiv="x-ua-compatible" content="IE=edge" />',
' <meta charset="utf-8"> ',
' <title>#TITLE#</title>',
' #APEX_CSS#',
' #THEME_CSS#',
' #TEMPLATE_CSS#',
' #THEME_STYLE_CSS#',
' #APPLICATION_CSS#',
' #PAGE_CSS#',
' #FAVICONS#',
' #HEAD#',
' <meta name="viewport" content="width=device-width, initial-scale=1.0" />',
'</head>',
'<body class="t-PageBody t-PageBody--hideLeft no-anim t-PageTemplate--rightSideCol #PAGE_CSS_CLASSES#" #TEXT_DIRECTION# #ONLOAD# id="t_PageBody">',
'<a href="#main" id="t_Body_skipToContent">&APP_TEXT$UI_PAGE_SKIP_TO_CONTENT.</a>',
'#FORM_OPEN#',
'<header class="t-Header" id="t_Header" role="banner">',
' #REGION_POSITION_07#',
' <div class="t-Header-branding">',
' <div class="t-Header-controls">',
' <button class="t-Button t-Button--icon t-Button--header t-Button--headerTree" aria-label="#EXPAND_COLLAPSE_NAV_LABEL#" title="#EXPAND_COLLAPSE_NAV_LABEL#" id="t_Button_navControl" type="button"><span class="t-Header-controlsIcon" aria-hidden="t'
||'rue"></span></button>',
' </div>',
' <div class="t-Header-logo">',
' <a href="#HOME_LINK#" class="t-Header-logo-link">#LOGO#</a>',
' </div>',
' <div class="t-Header-navBar">#NAVIGATION_BAR#</div>',
' </div>',
' <div class="t-Header-nav">#TOP_GLOBAL_NAVIGATION_LIST##REGION_POSITION_06#</div>',
'</header>'))
,p_box=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Body">',
' #SIDE_GLOBAL_NAVIGATION_LIST#',
' <div class="t-Body-main">',
' <div class="t-Body-title" id="t_Body_title">#REGION_POSITION_01#</div>',
' <div class="t-Body-content" id="t_Body_content">',
' <main id="main" class="t-Body-mainContent">',
' #SUCCESS_MESSAGE##NOTIFICATION_MESSAGE##GLOBAL_NOTIFICATION#',
' <div class="t-Body-fullContent">#REGION_POSITION_08#</div>',
' <div class="t-Body-contentInner">#BODY#</div>',
' </main>',
' <footer class="t-Footer" id="t_Footer" role="contentinfo">',
' <div class="t-Footer-body">',
' <div class="t-Footer-content">#REGION_POSITION_05#</div>',
' <div class="t-Footer-apex">',
' <div class="t-Footer-version">#APP_VERSION#</div>',
' <div class="t-Footer-customize">#CUSTOMIZE#</div>',
' #BUILT_WITH_LOVE_USING_APEX#',
' </div>',
' </div>',
' <div class="t-Footer-top">',
' <a href="#top" class="t-Footer-topButton" id="t_Footer_topButton"><span class="a-Icon icon-up-chevron"></span></a>',
' </div>',
' </footer>',
' </div>',
' </div>',
' <div class="t-Body-actions" id="t_Body_actions">',
' <button class="t-Body-actionsToggle" aria-label="#EXPAND_COLLAPSE_SIDE_COL_LABEL#" title="#EXPAND_COLLAPSE_SIDE_COL_LABEL#" id="t_Button_rightControlButton" type="button"><span class="t-Body-actionsControlsIcon" aria-hidden="true"></span></button'
||'>',
' <div class="t-Body-actionsContent" role="complementary">#REGION_POSITION_03#</div>',
' </div>',
'</div>',
'<div class="t-Body-inlineDialogs" id="t_Body_inlineDialogs">#REGION_POSITION_04#</div>'))
,p_footer_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'#FORM_CLOSE#',
'#DEVELOPER_TOOLBAR#',
'#APEX_JAVASCRIPT#',
'#GENERATED_CSS#',
'#THEME_JAVASCRIPT#',
'#TEMPLATE_JAVASCRIPT#',
'#APPLICATION_JAVASCRIPT#',
'#PAGE_JAVASCRIPT# ',
'#GENERATED_JAVASCRIPT#',
'</body>',
'</html>'))
,p_success_message=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Body-alert">',
' <div class="t-Alert t-Alert--defaultIcons t-Alert--success t-Alert--horizontal t-Alert--page t-Alert--colorBG" id="t_Alert_Success" role="alert">',
' <div class="t-Alert-wrap">',
' <div class="t-Alert-icon">',
' <span class="t-Icon"></span>',
' </div>',
' <div class="t-Alert-content">',
' <div class="t-Alert-header">',
' <h2 class="t-Alert-title">#SUCCESS_MESSAGE#</h2>',
' </div>',
' </div>',
' <div class="t-Alert-buttons">',
' <button class="t-Button t-Button--noUI t-Button--icon t-Button--closeAlert" onclick="apex.jQuery(''#t_Alert_Success'').remove();" type="button" title="#CLOSE_NOTIFICATION#"><span class="t-Icon icon-close"></span></button>',
' </div>',
' </div>',
' </div>',
'</div>'))
,p_notification_message=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Body-alert">',
' <div class="t-Alert t-Alert--defaultIcons t-Alert--warning t-Alert--horizontal t-Alert--page t-Alert--colorBG" id="t_Alert_Notification" role="alert">',
' <div class="t-Alert-wrap">',
' <div class="t-Alert-icon">',
' <span class="t-Icon"></span>',
' </div>',
' <div class="t-Alert-content">',
' <div class="t-Alert-body">#MESSAGE#</div>',
' </div>',
' <div class="t-Alert-buttons">',
' <button class="t-Button t-Button--noUI t-Button--icon t-Button--closeAlert" onclick="apex.jQuery(''#t_Alert_Notification'').remove();" type="button" title="#CLOSE_NOTIFICATION#"><span class="t-Icon icon-close"></span></button>',
' </div>',
' </div>',
' </div>',
'</div>'))
,p_navigation_bar=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<ul class="t-NavigationBar" data-mode="classic">',
' <li class="t-NavigationBar-item">',
' <span class="t-Button t-Button--icon t-Button--noUI t-Button--header t-Button--navBar t-Button--headerUser">',
' <span class="t-Icon a-Icon icon-user"></span>',
' <span class="t-Button-label">&APP_USER.</span>',
' </span>',
' </li>#BAR_BODY#',
'</ul>'))
,p_navbar_entry=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li class="t-NavigationBar-item">',
' <a class="t-Button t-Button--icon t-Button--header t-Button--navBar" href="#LINK#">',
' <span class="t-Icon #IMAGE#"></span>',
' <span class="t-Button-label">#TEXT#</span>',
' </a>',
'</li>'))
,p_region_table_cattributes=>' summary="" cellpadding="0" border="0" cellspacing="0" width="100%"'
,p_sidebar_def_reg_pos=>'REGION_POSITION_03'
,p_breadcrumb_def_reg_pos=>'REGION_POSITION_01'
,p_theme_class_id=>17
,p_error_page_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Alert t-Alert--danger t-Alert--wizard t-Alert--defaultIcons">',
' <div class="t-Alert-wrap">',
' <div class="t-Alert-icon">',
' <span class="t-Icon"></span>',
' </div>',
' <div class="t-Alert-content">',
' <div class="t-Alert-body">',
' <h3>#MESSAGE#</h3>',
' <p>#ADDITIONAL_INFO#</p>',
' <div class="t-Alert-inset">#TECHNICAL_INFO#</div>',
' </div>',
' </div>',
' <div class="t-Alert-buttons">',
' <button onclick="#BACK_LINK#" class="t-Button t-Button--hot w50p t-Button--large" type="button">#OK#</button>',
' </div>',
' </div>',
'</div>'))
,p_grid_type=>'FIXED'
,p_grid_max_columns=>12
,p_grid_always_use_max_columns=>true
,p_grid_has_column_span=>true
,p_grid_always_emit=>false
,p_grid_emit_empty_leading_cols=>true
,p_grid_emit_empty_trail_cols=>false
,p_grid_default_label_col_span=>2
,p_grid_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="container">',
'#ROWS#',
'</div>'))
,p_grid_row_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="row #CSS_CLASSES#">',
'#COLUMNS#',
'</div>'))
,p_grid_column_template=>'<div class="col col-#COLUMN_SPAN_NUMBER# #CSS_CLASSES#" #ATTRIBUTES#>#CONTENT#</div>'
,p_grid_first_column_attributes=>'alpha'
,p_grid_last_column_attributes=>'omega'
,p_dialog_js_init_code=>'apex.navigation.dialog(#PAGE_URL#,{title:#TITLE#,height:#DIALOG_HEIGHT#,width:#DIALOG_WIDTH#,maxWidth:#DIALOG_MAX_WIDTH#,modal:#IS_MODAL#,dialog:#DIALOG#,#DIALOG_ATTRIBUTES#},#DIALOG_CSS_CLASSES#,#TRIGGERING_ELEMENT#);'
,p_dialog_js_close_code=>'apex.navigation.dialog.close(#IS_MODAL#,#TARGET#);'
,p_dialog_js_cancel_code=>'apex.navigation.dialog.cancel(#IS_MODAL#);'
,p_dialog_browser_frame=>'MODAL'
,p_reference_id=>2525200116240651575
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804679614135800288)
,p_page_template_id=>wwv_flow_api.id(1774842030261936456)
,p_name=>'Content Body'
,p_placeholder=>'BODY'
,p_has_grid_support=>true
,p_glv_new_row=>true
,p_max_fixed_grid_columns=>8
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804680130833800289)
,p_page_template_id=>wwv_flow_api.id(1774842030261936456)
,p_name=>'Breadcrumb Bar'
,p_placeholder=>'REGION_POSITION_01'
,p_has_grid_support=>false
,p_glv_new_row=>true
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804680647095800289)
,p_page_template_id=>wwv_flow_api.id(1774842030261936456)
,p_name=>'Right Column'
,p_placeholder=>'REGION_POSITION_03'
,p_has_grid_support=>false
,p_glv_new_row=>false
,p_max_fixed_grid_columns=>4
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804681100821800289)
,p_page_template_id=>wwv_flow_api.id(1774842030261936456)
,p_name=>'Inline Dialogs'
,p_placeholder=>'REGION_POSITION_04'
,p_has_grid_support=>true
,p_glv_new_row=>true
,p_max_fixed_grid_columns=>12
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804681651732800289)
,p_page_template_id=>wwv_flow_api.id(1774842030261936456)
,p_name=>'Footer'
,p_placeholder=>'REGION_POSITION_05'
,p_has_grid_support=>true
,p_glv_new_row=>true
,p_max_fixed_grid_columns=>8
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804682129943800290)
,p_page_template_id=>wwv_flow_api.id(1774842030261936456)
,p_name=>'Page Navigation'
,p_placeholder=>'REGION_POSITION_06'
,p_has_grid_support=>false
,p_glv_new_row=>true
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804682605855800290)
,p_page_template_id=>wwv_flow_api.id(1774842030261936456)
,p_name=>'Page Header'
,p_placeholder=>'REGION_POSITION_07'
,p_has_grid_support=>false
,p_glv_new_row=>true
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804683121194800290)
,p_page_template_id=>wwv_flow_api.id(1774842030261936456)
,p_name=>'Before Content Body'
,p_placeholder=>'REGION_POSITION_08'
,p_has_grid_support=>true
,p_glv_new_row=>true
,p_max_fixed_grid_columns=>8
);
end;
/
prompt --application/shared_components/user_interface/templates/page/standard
begin
wwv_flow_api.create_template(
p_id=>wwv_flow_api.id(1774844326834936459)
,p_theme_id=>42
,p_name=>'Standard'
,p_internal_name=>'STANDARD'
,p_is_popup=>false
,p_javascript_code_onload=>'apex.theme42.initializePage.noSideCol();'
,p_header_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<!DOCTYPE html>',
'<html class="no-js #RTL_CLASS# page-&APP_PAGE_ID. app-&APP_ALIAS." lang="&BROWSER_LANGUAGE." #TEXT_DIRECTION#>',
'<head>',
' <meta http-equiv="x-ua-compatible" content="IE=edge" />',
' <meta charset="utf-8">',
' <title>#TITLE#</title>',
' #APEX_CSS#',
' #THEME_CSS#',
' #TEMPLATE_CSS#',
' #THEME_STYLE_CSS#',
' #APPLICATION_CSS#',
' #PAGE_CSS#',
' #FAVICONS#',
' #HEAD#',
' <meta name="viewport" content="width=device-width, initial-scale=1.0" />',
'</head>',
'<body class="t-PageBody t-PageBody--hideLeft t-PageBody--hideActions no-anim t-PageTemplate--standard #PAGE_CSS_CLASSES#" #TEXT_DIRECTION# #ONLOAD# id="t_PageBody">',
'<a href="#main" id="t_Body_skipToContent">&APP_TEXT$UI_PAGE_SKIP_TO_CONTENT.</a>',
'#FORM_OPEN#',
'<header class="t-Header" id="t_Header" role="banner">',
' #REGION_POSITION_07#',
' <div class="t-Header-branding">',
' <div class="t-Header-controls">',
' <button class="t-Button t-Button--icon t-Button--header t-Button--headerTree" aria-label="#EXPAND_COLLAPSE_NAV_LABEL#" title="#EXPAND_COLLAPSE_NAV_LABEL#" id="t_Button_navControl" type="button"><span class="t-Header-controlsIcon" aria-hidden="t'
||'rue"></span></button>',
' </div>',
' <div class="t-Header-logo">',
' <a href="#HOME_LINK#" class="t-Header-logo-link">#LOGO#</a>',
' </div>',
' <div class="t-Header-navBar">#NAVIGATION_BAR#</div>',
' </div>',
' <div class="t-Header-nav">#TOP_GLOBAL_NAVIGATION_LIST##REGION_POSITION_06#</div>',
'</header>',
''))
,p_box=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Body">',
' #SIDE_GLOBAL_NAVIGATION_LIST#',
' <div class="t-Body-main">',
' <div class="t-Body-title" id="t_Body_title">#REGION_POSITION_01#</div>',
' <div class="t-Body-content" id="t_Body_content">',
' <main id="main" class="t-Body-mainContent">',
' #SUCCESS_MESSAGE##NOTIFICATION_MESSAGE##GLOBAL_NOTIFICATION#',
' <div class="t-Body-fullContent">#REGION_POSITION_08#</div>',
' <div class="t-Body-contentInner">#BODY#</div>',
' </main>',
' <footer class="t-Footer" id="t_Footer" role="contentinfo">',
' <div class="t-Footer-body">',
' <div class="t-Footer-content">#REGION_POSITION_05#</div>',
' <div class="t-Footer-apex">',
' <div class="t-Footer-version">#APP_VERSION#</div>',
' <div class="t-Footer-customize">#CUSTOMIZE#</div>',
' #BUILT_WITH_LOVE_USING_APEX#',
' </div>',
' </div>',
' <div class="t-Footer-top">',
' <a href="#top" class="t-Footer-topButton" id="t_Footer_topButton"><span class="a-Icon icon-up-chevron"></span></a>',
' </div>',
' </footer>',
' </div>',
' </div>',
'</div>',
'<div class="t-Body-inlineDialogs" id="t_Body_inlineDialogs">#REGION_POSITION_04#</div>'))
,p_footer_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'#FORM_CLOSE#',
'#DEVELOPER_TOOLBAR#',
'#APEX_JAVASCRIPT#',
'#GENERATED_CSS#',
'#THEME_JAVASCRIPT#',
'#TEMPLATE_JAVASCRIPT#',
'#APPLICATION_JAVASCRIPT#',
'#PAGE_JAVASCRIPT# ',
'#GENERATED_JAVASCRIPT#',
'</body>',
'</html>',
''))
,p_success_message=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Body-alert">',
' <div class="t-Alert t-Alert--defaultIcons t-Alert--success t-Alert--horizontal t-Alert--page t-Alert--colorBG" id="t_Alert_Success" role="alert">',
' <div class="t-Alert-wrap">',
' <div class="t-Alert-icon">',
' <span class="t-Icon"></span>',
' </div>',
' <div class="t-Alert-content">',
' <div class="t-Alert-header">',
' <h2 class="t-Alert-title">#SUCCESS_MESSAGE#</h2>',
' </div>',
' </div>',
' <div class="t-Alert-buttons">',
' <button class="t-Button t-Button--noUI t-Button--icon t-Button--closeAlert" type="button" title="#CLOSE_NOTIFICATION#"><span class="t-Icon icon-close"></span></button>',
' </div>',
' </div>',
' </div>',
'</div>'))
,p_notification_message=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Body-alert">',
' <div class="t-Alert t-Alert--defaultIcons t-Alert--warning t-Alert--horizontal t-Alert--page t-Alert--colorBG" id="t_Alert_Notification" role="alert">',
' <div class="t-Alert-wrap">',
' <div class="t-Alert-icon">',
' <span class="t-Icon"></span>',
' </div>',
' <div class="t-Alert-content">',
' <div class="t-Alert-body">#MESSAGE#</div>',
' </div>',
' <div class="t-Alert-buttons">',
' <button class="t-Button t-Button--noUI t-Button--icon t-Button--closeAlert" type="button" title="#CLOSE_NOTIFICATION#"><span class="t-Icon icon-close"></span></button>',
' </div>',
' </div>',
' </div>',
'</div>'))
,p_navigation_bar=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<ul class="t-NavigationBar t-NavigationBar--classic" data-mode="classic">',
' <li class="t-NavigationBar-item">',
' <span class="t-Button t-Button--icon t-Button--noUI t-Button--header t-Button--navBar t-Button--headerUser">',
' <span class="t-Icon a-Icon icon-user"></span>',
' <span class="t-Button-label">&APP_USER.</span>',
' </span>',
' </li>#BAR_BODY#',
'</ul>'))
,p_navbar_entry=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li class="t-NavigationBar-item">',
' <a class="t-Button t-Button--icon t-Button--header" href="#LINK#">',
' <span class="t-Icon #IMAGE#"></span>',
' <span class="t-Button-label">#TEXT#</span>',
' </a>',
'</li>'))
,p_region_table_cattributes=>' summary="" cellpadding="0" border="0" cellspacing="0" width="100%"'
,p_breadcrumb_def_reg_pos=>'REGION_POSITION_01'
,p_theme_class_id=>1
,p_error_page_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Alert t-Alert--danger t-Alert--wizard t-Alert--defaultIcons">',
' <div class="t-Alert-wrap">',
' <div class="t-Alert-icon">',
' <span class="t-Icon"></span>',
' </div>',
' <div class="t-Alert-content">',
' <div class="t-Alert-body">',
' <h3>#MESSAGE#</h3>',
' <p>#ADDITIONAL_INFO#</p>',
' <div class="t-Alert-inset">#TECHNICAL_INFO#</div>',
' </div>',
' </div>',
' <div class="t-Alert-buttons">',
' <button onclick="#BACK_LINK#" class="t-Button t-Button--hot w50p t-Button--large" type="button">#OK#</button>',
' </div>',
' </div>',
'</div>'))
,p_grid_type=>'FIXED'
,p_grid_max_columns=>12
,p_grid_always_use_max_columns=>true
,p_grid_has_column_span=>true
,p_grid_always_emit=>false
,p_grid_emit_empty_leading_cols=>true
,p_grid_emit_empty_trail_cols=>false
,p_grid_default_label_col_span=>2
,p_grid_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="container">',
'#ROWS#',
'</div>'))
,p_grid_row_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="row #CSS_CLASSES#">',
'#COLUMNS#',
'</div>'))
,p_grid_column_template=>'<div class="col col-#COLUMN_SPAN_NUMBER# #CSS_CLASSES#" #ATTRIBUTES#>#CONTENT#</div>'
,p_grid_first_column_attributes=>'alpha'
,p_grid_last_column_attributes=>'omega'
,p_dialog_js_init_code=>'apex.navigation.dialog(#PAGE_URL#,{title:#TITLE#,height:#DIALOG_HEIGHT#,width:#DIALOG_WIDTH#,maxWidth:#DIALOG_MAX_WIDTH#,modal:#IS_MODAL#,dialog:#DIALOG#,#DIALOG_ATTRIBUTES#},#DIALOG_CSS_CLASSES#,#TRIGGERING_ELEMENT#);'
,p_dialog_js_close_code=>'apex.navigation.dialog.close(#IS_MODAL#,#TARGET#);'
,p_dialog_js_cancel_code=>'apex.navigation.dialog.cancel(#IS_MODAL#);'
,p_dialog_browser_frame=>'MODAL'
,p_reference_id=>4070909157481059304
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804687011010800295)
,p_page_template_id=>wwv_flow_api.id(1774844326834936459)
,p_name=>'Content Body'
,p_placeholder=>'BODY'
,p_has_grid_support=>true
,p_glv_new_row=>true
,p_max_fixed_grid_columns=>12
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804687583261800295)
,p_page_template_id=>wwv_flow_api.id(1774844326834936459)
,p_name=>'Breadcrumb Bar'
,p_placeholder=>'REGION_POSITION_01'
,p_has_grid_support=>false
,p_glv_new_row=>true
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804688060862800295)
,p_page_template_id=>wwv_flow_api.id(1774844326834936459)
,p_name=>'Inline Dialogs'
,p_placeholder=>'REGION_POSITION_04'
,p_has_grid_support=>true
,p_glv_new_row=>true
,p_max_fixed_grid_columns=>12
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804688533725800296)
,p_page_template_id=>wwv_flow_api.id(1774844326834936459)
,p_name=>'Footer'
,p_placeholder=>'REGION_POSITION_05'
,p_has_grid_support=>true
,p_glv_new_row=>true
,p_max_fixed_grid_columns=>12
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804689050988800296)
,p_page_template_id=>wwv_flow_api.id(1774844326834936459)
,p_name=>'Page Navigation'
,p_placeholder=>'REGION_POSITION_06'
,p_has_grid_support=>false
,p_glv_new_row=>true
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804689563292800296)
,p_page_template_id=>wwv_flow_api.id(1774844326834936459)
,p_name=>'Page Header'
,p_placeholder=>'REGION_POSITION_07'
,p_has_grid_support=>false
,p_glv_new_row=>true
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804690069915800299)
,p_page_template_id=>wwv_flow_api.id(1774844326834936459)
,p_name=>'Before Content Body'
,p_placeholder=>'REGION_POSITION_08'
,p_has_grid_support=>true
,p_glv_new_row=>true
,p_max_fixed_grid_columns=>12
);
end;
/
prompt --application/shared_components/user_interface/templates/page/wizard_modal_dialog
begin
wwv_flow_api.create_template(
p_id=>wwv_flow_api.id(1774846340824936463)
,p_theme_id=>42
,p_name=>'Wizard Modal Dialog'
,p_internal_name=>'WIZARD_MODAL_DIALOG'
,p_is_popup=>true
,p_javascript_code_onload=>'apex.theme42.initializePage.wizardModal();'
,p_header_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<!DOCTYPE html>',
'<html class="no-js #RTL_CLASS# page-&APP_PAGE_ID. app-&APP_ALIAS." lang="&BROWSER_LANGUAGE." #TEXT_DIRECTION#>',
'<head>',
' <meta http-equiv="x-ua-compatible" content="IE=edge" />',
' <meta charset="utf-8">',
' <title>#TITLE#</title>',
' #APEX_CSS#',
' #THEME_CSS#',
' #TEMPLATE_CSS#',
' #THEME_STYLE_CSS#',
' #APPLICATION_CSS#',
' #PAGE_CSS#',
' #FAVICONS#',
' #HEAD#',
' <meta name="viewport" content="width=device-width, initial-scale=1.0" />',
'</head>',
'<body class="t-Dialog-page t-Dialog-page--wizard t-PageTemplate--wizard #DIALOG_CSS_CLASSES# #PAGE_CSS_CLASSES#" #TEXT_DIRECTION# #ONLOAD#>',
'#FORM_OPEN#'))
,p_box=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Dialog" role="dialog" aria-label="#TITLE#">',
' <div class="t-Dialog-header">#REGION_POSITION_01#</div>',
' <div class="t-Dialog-bodyWrapperOut">',
' <div class="t-Dialog-bodyWrapperIn">',
' <div class="t-Dialog-body" role="main">#SUCCESS_MESSAGE##NOTIFICATION_MESSAGE##GLOBAL_NOTIFICATION##BODY#</div>',
' </div>',
' </div>',
' <div class="t-Dialog-footer">#REGION_POSITION_03#</div>',
'</div>'))
,p_footer_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'#FORM_CLOSE#',
'#DEVELOPER_TOOLBAR#',
'#APEX_JAVASCRIPT#',
'#GENERATED_CSS#',
'#THEME_JAVASCRIPT#',
'#TEMPLATE_JAVASCRIPT#',
'#APPLICATION_JAVASCRIPT#',
'#PAGE_JAVASCRIPT# ',
'#GENERATED_JAVASCRIPT#',
'</body>',
'</html>'))
,p_success_message=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Body-alert">',
' <div class="t-Alert t-Alert--defaultIcons t-Alert--success t-Alert--horizontal t-Alert--page t-Alert--colorBG" id="t_Alert_Success" role="alert">',
' <div class="t-Alert-wrap">',
' <div class="t-Alert-icon">',
' <span class="t-Icon"></span>',
' </div>',
' <div class="t-Alert-content">',
' <div class="t-Alert-header">',
' <h2 class="t-Alert-title">#SUCCESS_MESSAGE#</h2>',
' </div>',
' </div>',
' <div class="t-Alert-buttons">',
' <button class="t-Button t-Button--noUI t-Button--icon t-Button--closeAlert" onclick="apex.jQuery(''#t_Alert_Success'').remove();" type="button" title="#CLOSE_NOTIFICATION#"><span class="t-Icon icon-close"></span></button>',
' </div>',
' </div>',
' </div>',
'</div>'))
,p_notification_message=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Body-alert">',
' <div class="t-Alert t-Alert--defaultIcons t-Alert--warning t-Alert--horizontal t-Alert--page t-Alert--colorBG" id="t_Alert_Notification" role="alert">',
' <div class="t-Alert-wrap">',
' <div class="t-Alert-icon">',
' <span class="t-Icon"></span>',
' </div>',
' <div class="t-Alert-content">',
' <div class="t-Alert-body">#MESSAGE#</div>',
' </div>',
' <div class="t-Alert-buttons">',
' <button class="t-Button t-Button--noUI t-Button--icon t-Button--closeAlert" onclick="apex.jQuery(''#t_Alert_Notification'').remove();" type="button" title="#CLOSE_NOTIFICATION#"><span class="t-Icon icon-close"></span></button>',
' </div>',
' </div>',
' </div>',
'</div>'))
,p_region_table_cattributes=>' summary="" cellpadding="0" border="0" cellspacing="0" width="100%"'
,p_theme_class_id=>3
,p_error_page_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Alert t-Alert--danger t-Alert--wizard t-Alert--defaultIcons">',
' <div class="t-Alert-wrap">',
' <div class="t-Alert-icon">',
' <span class="t-Icon"></span>',
' </div>',
' <div class="t-Alert-content">',
' <div class="t-Alert-body">',
' <h3>#MESSAGE#</h3>',
' <p>#ADDITIONAL_INFO#</p>',
' <div class="t-Alert-inset">#TECHNICAL_INFO#</div>',
' </div>',
' </div>',
' <div class="t-Alert-buttons">',
' <button onclick="#BACK_LINK#" class="t-Button t-Button--hot w50p t-Button--large" type="button">#OK#</button>',
' </div>',
' </div>',
'</div>'))
,p_grid_type=>'FIXED'
,p_grid_max_columns=>12
,p_grid_always_use_max_columns=>true
,p_grid_has_column_span=>true
,p_grid_always_emit=>false
,p_grid_emit_empty_leading_cols=>true
,p_grid_emit_empty_trail_cols=>false
,p_grid_default_label_col_span=>2
,p_grid_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="container">',
'#ROWS#',
'</div>'))
,p_grid_row_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="row #CSS_CLASSES#">',
'#COLUMNS#',
'</div>'))
,p_grid_column_template=>'<div class="col col-#COLUMN_SPAN_NUMBER# #CSS_CLASSES#" #ATTRIBUTES#>#CONTENT#</div>'
,p_grid_first_column_attributes=>'alpha'
,p_grid_last_column_attributes=>'omega'
,p_dialog_js_init_code=>'apex.navigation.dialog(#PAGE_URL#,{title:#TITLE#,height:#DIALOG_HEIGHT#,width:#DIALOG_WIDTH#,maxWidth:#DIALOG_MAX_WIDTH#,modal:#IS_MODAL#,dialog:#DIALOG#,#DIALOG_ATTRIBUTES#},''t-Dialog-page--wizard ''+#DIALOG_CSS_CLASSES#,#TRIGGERING_ELEMENT#);'
,p_dialog_js_close_code=>'apex.navigation.dialog.close(#IS_MODAL#,#TARGET#);'
,p_dialog_js_cancel_code=>'apex.navigation.dialog.cancel(#IS_MODAL#);'
,p_dialog_height=>'auto'
,p_dialog_width=>'720'
,p_dialog_max_width=>'960'
,p_dialog_browser_frame=>'MODAL'
,p_reference_id=>2120348229686426515
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804692320224800301)
,p_page_template_id=>wwv_flow_api.id(1774846340824936463)
,p_name=>'Wizard Body'
,p_placeholder=>'BODY'
,p_has_grid_support=>true
,p_glv_new_row=>true
,p_max_fixed_grid_columns=>12
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804692816918800301)
,p_page_template_id=>wwv_flow_api.id(1774846340824936463)
,p_name=>'Wizard Progress Bar'
,p_placeholder=>'REGION_POSITION_01'
,p_has_grid_support=>false
,p_glv_new_row=>true
);
wwv_flow_api.create_page_tmpl_display_point(
p_id=>wwv_flow_api.id(804693383901800301)
,p_page_template_id=>wwv_flow_api.id(1774846340824936463)
,p_name=>'Wizard Buttons'
,p_placeholder=>'REGION_POSITION_03'
,p_has_grid_support=>false
,p_glv_new_row=>true
);
end;
/
prompt --application/shared_components/user_interface/templates/button/icon
begin
wwv_flow_api.create_button_templates(
p_id=>wwv_flow_api.id(1774882633017936576)
,p_template_name=>'Icon'
,p_internal_name=>'ICON'
,p_template=>'<button class="t-Button t-Button--noLabel t-Button--icon #BUTTON_CSS_CLASSES#" #BUTTON_ATTRIBUTES# onclick="#JAVASCRIPT#" type="button" id="#BUTTON_ID#" title="#LABEL!ATTR#" aria-label="#LABEL!ATTR#"><span class="t-Icon #ICON_CSS_CLASSES#" aria-hidde'
||'n="true"></span></button>'
,p_hot_template=>'<button class="t-Button t-Button--noLabel t-Button--icon #BUTTON_CSS_CLASSES# t-Button--hot" #BUTTON_ATTRIBUTES# onclick="#JAVASCRIPT#" type="button" id="#BUTTON_ID#" title="#LABEL!ATTR#" aria-label="#LABEL!ATTR#"><span class="t-Icon #ICON_CSS_CLASSE'
||'S#" aria-hidden="true"></span></button>'
,p_reference_id=>2347660919680321258
,p_translate_this_template=>'N'
,p_theme_class_id=>5
,p_theme_id=>42
);
end;
/
prompt --application/shared_components/user_interface/templates/button/text_with_icon
begin
wwv_flow_api.create_button_templates(
p_id=>wwv_flow_api.id(1774882711901936578)
,p_template_name=>'Text with Icon'
,p_internal_name=>'TEXT_WITH_ICON'
,p_template=>'<button class="t-Button t-Button--icon #BUTTON_CSS_CLASSES#" #BUTTON_ATTRIBUTES# onclick="#JAVASCRIPT#" type="button" id="#BUTTON_ID#"><span class="t-Icon t-Icon--left #ICON_CSS_CLASSES#" aria-hidden="true"></span><span class="t-Button-label">#LABEL#'
||'</span><span class="t-Icon t-Icon--right #ICON_CSS_CLASSES#" aria-hidden="true"></span></button>'
,p_hot_template=>'<button class="t-Button t-Button--icon #BUTTON_CSS_CLASSES# t-Button--hot" #BUTTON_ATTRIBUTES# onclick="#JAVASCRIPT#" type="button" id="#BUTTON_ID#"><span class="t-Icon t-Icon--left #ICON_CSS_CLASSES#" aria-hidden="true"></span><span class="t-Button-'
||'label">#LABEL#</span><span class="t-Icon t-Icon--right #ICON_CSS_CLASSES#" aria-hidden="true"></span></button>'
,p_reference_id=>2081382742158699622
,p_translate_this_template=>'N'
,p_theme_class_id=>4
,p_preset_template_options=>'t-Button--iconRight'
,p_theme_id=>42
);
end;
/
prompt --application/shared_components/user_interface/templates/button/text
begin
wwv_flow_api.create_button_templates(
p_id=>wwv_flow_api.id(1774883187200936581)
,p_template_name=>'Text'
,p_internal_name=>'TEXT'
,p_template=>'<button onclick="#JAVASCRIPT#" class="t-Button #BUTTON_CSS_CLASSES#" type="button" #BUTTON_ATTRIBUTES# id="#BUTTON_ID#"><span class="t-Button-label">#LABEL#</span></button>'
,p_hot_template=>'<button onclick="#JAVASCRIPT#" class="t-Button t-Button--hot #BUTTON_CSS_CLASSES#" type="button" #BUTTON_ATTRIBUTES# id="#BUTTON_ID#"><span class="t-Button-label">#LABEL#</span></button>'
,p_reference_id=>4070916158035059322
,p_translate_this_template=>'N'
,p_theme_class_id=>1
,p_theme_id=>42
);
end;
/
prompt --application/shared_components/user_interface/templates/region/inline_popup
begin
wwv_flow_api.create_plug_template(
p_id=>wwv_flow_api.id(136453395504065000)
,p_layout=>'TABLE'
,p_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div id="#REGION_STATIC_ID#_parent">',
'<div id="#REGION_STATIC_ID#" class="t-DialogRegion #REGION_CSS_CLASSES# js-regionPopup" #REGION_ATTRIBUTES# style="display:none" title="#TITLE!ATTR#">',
' <div class="t-DialogRegion-wrap">',
' <div class="t-DialogRegion-bodyWrapperOut"><div class="t-DialogRegion-bodyWrapperIn"><div class="t-DialogRegion-body">#BODY#</div></div></div>',
' <div class="t-DialogRegion-buttons">',
' <div class="t-ButtonRegion t-ButtonRegion--dialogRegion">',
' <div class="t-ButtonRegion-wrap">',
' <div class="t-ButtonRegion-col t-ButtonRegion-col--left"><div class="t-ButtonRegion-buttons">#PREVIOUS##DELETE##CLOSE#</div></div>',
' <div class="t-ButtonRegion-col t-ButtonRegion-col--right"><div class="t-ButtonRegion-buttons">#EDIT##CREATE##NEXT#</div></div>',
' </div>',
' </div>',
' </div>',
' </div>',
'</div>',
'</div>'))
,p_page_plug_template_name=>'Inline Popup'
,p_internal_name=>'INLINE_POPUP'
,p_theme_id=>42
,p_theme_class_id=>24
,p_preset_template_options=>'js-dialog-size600x400'
,p_default_label_alignment=>'RIGHT'
,p_default_field_alignment=>'LEFT'
,p_reference_id=>1483922538999385230
,p_translate_this_template=>'N'
);
wwv_flow_api.create_plug_tmpl_display_point(
p_id=>wwv_flow_api.id(804770763368800419)
,p_plug_template_id=>wwv_flow_api.id(136453395504065000)
,p_name=>'Region Body'
,p_placeholder=>'BODY'
,p_has_grid_support=>true
,p_glv_new_row=>true
);
end;
/
prompt --application/shared_components/user_interface/templates/region/cards_container
begin
wwv_flow_api.create_plug_template(
p_id=>wwv_flow_api.id(703424774023554648)
,p_layout=>'TABLE'
,p_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div role="region" aria-label="#TITLE!ATTR#" class="t-CardsRegion #REGION_CSS_CLASSES#" id="#REGION_STATIC_ID#" #REGION_ATTRIBUTES#>',
' <h2 class="u-VisuallyHidden" id="#REGION_STATIC_ID#_heading" data-apex-heading>#TITLE#</h2>',
' #BODY##SUB_REGIONS#',
'</div>'))
,p_page_plug_template_name=>'Cards Container'
,p_internal_name=>'CARDS_CONTAINER'
,p_theme_id=>42
,p_theme_class_id=>21
,p_default_template_options=>'u-colors'
,p_default_label_alignment=>'RIGHT'
,p_default_field_alignment=>'LEFT'
,p_reference_id=>2071277712695139743
,p_translate_this_template=>'N'
);
end;
/
prompt --application/shared_components/user_interface/templates/region/content_block
begin
wwv_flow_api.create_plug_template(
p_id=>wwv_flow_api.id(1124325436919460426)
,p_layout=>'TABLE'
,p_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div role="region" aria-label="#TITLE!ATTR#" class="t-ContentBlock #REGION_CSS_CLASSES#" id="#REGION_STATIC_ID#" #REGION_ATTRIBUTES#>',
' <div class="t-ContentBlock-header">',
' <div class="t-ContentBlock-headerItems t-ContentBlock-headerItems--title">',
' <span class="t-ContentBlock-headerIcon"><span class="t-Icon #ICON_CSS_CLASSES#" aria-hidden="true"></span></span>',
' <h1 class="t-ContentBlock-title" id="#REGION_STATIC_ID#_heading" data-apex-heading>#TITLE#</h1>',
' #EDIT#',
' </div>',
' <div class="t-ContentBlock-headerItems t-ContentBlock-headerItems--buttons">#CHANGE#</div>',
' </div>',
' <div class="t-ContentBlock-body">#BODY#</div>',
' <div class="t-ContentBlock-buttons">#PREVIOUS##NEXT#</div>',
'</div>',
''))
,p_page_plug_template_name=>'Content Block'
,p_internal_name=>'CONTENT_BLOCK'
,p_theme_id=>42
,p_theme_class_id=>21
,p_preset_template_options=>'t-ContentBlock--h1'
,p_default_label_alignment=>'RIGHT'
,p_default_field_alignment=>'LEFT'
,p_reference_id=>2320668864738842174
,p_translate_this_template=>'N'
);
end;
/
prompt --application/shared_components/user_interface/templates/region/alert
begin
wwv_flow_api.create_plug_template(
p_id=>wwv_flow_api.id(1774847460117936466)
,p_layout=>'TABLE'
,p_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div role="region" aria-label="#TITLE!ATTR#" class="t-Alert #REGION_CSS_CLASSES#" id="#REGION_STATIC_ID#" #REGION_ATTRIBUTES#>',
' <div class="t-Alert-wrap">',
' <div class="t-Alert-icon">',
' <span class="t-Icon #ICON_CSS_CLASSES#"></span>',
' </div>',
' <div class="t-Alert-content">',
' <div class="t-Alert-header">',
' <h2 class="t-Alert-title" id="#REGION_STATIC_ID#_heading" data-apex-heading>#TITLE#</h2>',
' </div>',
' <div class="t-Alert-body">#BODY#</div>',
' </div>',
' <div class="t-Alert-buttons">#PREVIOUS##CLOSE##CREATE##NEXT#</div>',
' </div>',
'</div>'))
,p_page_plug_template_name=>'Alert'
,p_internal_name=>'ALERT'
,p_plug_table_bgcolor=>'#ffffff'
,p_theme_id=>42
,p_theme_class_id=>21
,p_preset_template_options=>'t-Alert--horizontal:t-Alert--defaultIcons:t-Alert--warning'
,p_plug_heading_bgcolor=>'#ffffff'
,p_plug_font_size=>'-1'
,p_default_label_alignment=>'RIGHT'
,p_default_field_alignment=>'LEFT'
,p_reference_id=>2039236646100190748
,p_translate_this_template=>'N'
,p_template_comment=>'Red Theme'
);
wwv_flow_api.create_plug_tmpl_display_point(
p_id=>wwv_flow_api.id(804695756084800307)
,p_plug_template_id=>wwv_flow_api.id(1774847460117936466)
,p_name=>'Region Body'
,p_placeholder=>'BODY'
,p_has_grid_support=>true
,p_glv_new_row=>true
,p_max_fixed_grid_columns=>12
);
end;
/
prompt --application/shared_components/user_interface/templates/region/blank_with_attributes
begin
wwv_flow_api.create_plug_template(
p_id=>wwv_flow_api.id(1774849216241936469)
,p_layout=>'TABLE'
,p_template=>'<div id="#REGION_STATIC_ID#" #REGION_ATTRIBUTES# class="#REGION_CSS_CLASSES#">#PREVIOUS##BODY##SUB_REGIONS##NEXT#</div>'
,p_page_plug_template_name=>'Blank with Attributes'
,p_internal_name=>'BLANK_WITH_ATTRIBUTES'
,p_theme_id=>42
,p_theme_class_id=>7
,p_default_label_alignment=>'RIGHT'
,p_default_field_alignment=>'LEFT'
,p_reference_id=>4499993862448380551
,p_translate_this_template=>'N'
);
end;
/
prompt --application/shared_components/user_interface/templates/region/buttons_container
begin
wwv_flow_api.create_plug_template(
p_id=>wwv_flow_api.id(1774849395965936471)
,p_layout=>'TABLE'
,p_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-ButtonRegion t-Form--floatLeft #REGION_CSS_CLASSES#" id="#REGION_STATIC_ID#" #REGION_ATTRIBUTES#>',
' <div class="t-ButtonRegion-wrap">',
' <div class="t-ButtonRegion-col t-ButtonRegion-col--left"><div class="t-ButtonRegion-buttons">#PREVIOUS##CLOSE##DELETE#</div></div>',
' <div class="t-ButtonRegion-col t-ButtonRegion-col--content">',
' <h2 class="t-ButtonRegion-title" id="#REGION_STATIC_ID#_heading" data-apex-heading>#TITLE#</h2>',
' #BODY#',
' <div class="t-ButtonRegion-buttons">#CHANGE#</div>',
' </div>',
' <div class="t-ButtonRegion-col t-ButtonRegion-col--right"><div class="t-ButtonRegion-buttons">#EDIT##CREATE##NEXT#</div></div>',
' </div>',
'</div>'))
,p_page_plug_template_name=>'Buttons Container'
,p_internal_name=>'BUTTONS_CONTAINER'
,p_plug_table_bgcolor=>'#ffffff'
,p_theme_id=>42
,p_theme_class_id=>17
,p_plug_heading_bgcolor=>'#ffffff'
,p_plug_font_size=>'-1'
,p_default_label_alignment=>'RIGHT'
,p_default_field_alignment=>'LEFT'
,p_reference_id=>2124982336649579661
,p_translate_this_template=>'N'
,p_template_comment=>'Red Theme'
);
wwv_flow_api.create_plug_tmpl_display_point(
p_id=>wwv_flow_api.id(804706572640800322)
,p_plug_template_id=>wwv_flow_api.id(1774849395965936471)
,p_name=>'Region Body'
,p_placeholder=>'BODY'
,p_has_grid_support=>true
,p_glv_new_row=>true
,p_max_fixed_grid_columns=>12
);
wwv_flow_api.create_plug_tmpl_display_point(
p_id=>wwv_flow_api.id(804707071608800322)
,p_plug_template_id=>wwv_flow_api.id(1774849395965936471)
,p_name=>'Sub Regions'
,p_placeholder=>'SUB_REGIONS'
,p_has_grid_support=>true
,p_glv_new_row=>true
,p_max_fixed_grid_columns=>12
);
end;
/
prompt --application/shared_components/user_interface/templates/region/carousel_container
begin
wwv_flow_api.create_plug_template(
p_id=>wwv_flow_api.id(1774851103376936475)
,p_layout=>'TABLE'
,p_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div role="region" aria-label="#TITLE!ATTR#" class="t-Region t-Region--carousel #REGION_CSS_CLASSES#" id="#REGION_STATIC_ID#" #REGION_ATTRIBUTES#>',
' <div class="t-Region-header">',
' <div class="t-Region-headerItems t-Region-headerItems--title">',
' <span class="t-Region-headerIcon"><span class="t-Icon #ICON_CSS_CLASSES#" aria-hidden="true"></span></span>',
' <h2 class="t-Region-title" id="#REGION_STATIC_ID#_heading" data-apex-heading>#TITLE#</h2>',
' </div>',
' <div class="t-Region-headerItems t-Region-headerItems--buttons">#COPY##EDIT#<span class="js-maximizeButtonContainer"></span></div>',
' </div>',
' <div role="region" aria-label="#TITLE#" class="t-Region-bodyWrap">',
' <div class="t-Region-buttons t-Region-buttons--top">',
' <div class="t-Region-buttons-left">#PREVIOUS#</div>',
' <div class="t-Region-buttons-right">#NEXT#</div>',
' </div>',
' <div class="t-Region-body">',
' #BODY#',
' <div class="t-Region-carouselRegions">#SUB_REGIONS#</div>',
' </div>',
' <div class="t-Region-buttons t-Region-buttons--bottom">',
' <div class="t-Region-buttons-left">#CLOSE##HELP#</div>',
' <div class="t-Region-buttons-right">#DELETE##CHANGE##CREATE#</div>',
' </div>',
' </div>',
'</div>'))
,p_sub_plug_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div data-label="#SUB_REGION_TITLE#" id="SR_#SUB_REGION_ID#">',
' #SUB_REGION#',
'</div>'))
,p_page_plug_template_name=>'Carousel Container'
,p_internal_name=>'CAROUSEL_CONTAINER'
,p_javascript_file_urls=>wwv_flow_string.join(wwv_flow_t_varchar2(
'#IMAGE_PREFIX#libraries/apex/#MIN_DIRECTORY#widget.apexTabs#MIN#.js?v=#APEX_VERSION#',
'#IMAGE_PREFIX#plugins/com.oracle.apex.carousel/1.1/com.oracle.apex.carousel#MIN#.js?v=#APEX_VERSION#'))
,p_plug_table_bgcolor=>'#ffffff'
,p_theme_id=>42
,p_theme_class_id=>5
,p_default_template_options=>'t-Region--showCarouselControls'
,p_preset_template_options=>'t-Region--hiddenOverflow'
,p_plug_heading_bgcolor=>'#ffffff'
,p_plug_font_size=>'-1'
,p_default_label_alignment=>'RIGHT'
,p_default_field_alignment=>'LEFT'
,p_reference_id=>2865840475322558786
,p_translate_this_template=>'N'
);
wwv_flow_api.create_plug_tmpl_display_point(
p_id=>wwv_flow_api.id(804713731906800328)
,p_plug_template_id=>wwv_flow_api.id(1774851103376936475)
,p_name=>'Region Body'
,p_placeholder=>'BODY'
,p_has_grid_support=>true
,p_glv_new_row=>true
,p_max_fixed_grid_columns=>12
);
wwv_flow_api.create_plug_tmpl_display_point(
p_id=>wwv_flow_api.id(804714292524800328)
,p_plug_template_id=>wwv_flow_api.id(1774851103376936475)
,p_name=>'Slides'
,p_placeholder=>'SUB_REGIONS'
,p_has_grid_support=>true
,p_glv_new_row=>true
,p_max_fixed_grid_columns=>12
);
end;
/
prompt --application/shared_components/user_interface/templates/region/hero
begin
wwv_flow_api.create_plug_template(
p_id=>wwv_flow_api.id(1774855340336936480)
,p_layout=>'TABLE'
,p_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div role="region" aria-label="#TITLE!ATTR#" class="t-HeroRegion #REGION_CSS_CLASSES#" id="#REGION_STATIC_ID#" #REGION_ATTRIBUTES#>',
' <div class="t-HeroRegion-wrap">',
' <div class="t-HeroRegion-col t-HeroRegion-col--left"><span class="t-HeroRegion-icon t-Icon #ICON_CSS_CLASSES#"></span></div>',
' <div class="t-HeroRegion-col t-HeroRegion-col--content">',
' <h1 class="t-HeroRegion-title" data-apex-heading>#TITLE#</h1>',
' #BODY#',
' </div>',
' <div class="t-HeroRegion-col t-HeroRegion-col--right"><div class="t-HeroRegion-form">#SUB_REGIONS#</div><div class="t-HeroRegion-buttons">#NEXT#</div></div>',
' </div>',
'</div>'))
,p_page_plug_template_name=>'Hero'
,p_internal_name=>'HERO'
,p_theme_id=>42
,p_theme_class_id=>22
,p_default_label_alignment=>'RIGHT'
,p_default_field_alignment=>'LEFT'
,p_reference_id=>2672571031438297268
,p_translate_this_template=>'N'
);
wwv_flow_api.create_plug_tmpl_display_point(
p_id=>wwv_flow_api.id(804760559334800406)
,p_plug_template_id=>wwv_flow_api.id(1774855340336936480)
,p_name=>'Region Body'
,p_placeholder=>'#BODY#'
,p_has_grid_support=>false
,p_glv_new_row=>false
);
end;
/
prompt --application/shared_components/user_interface/templates/region/collapsible
begin
wwv_flow_api.create_plug_template(
p_id=>wwv_flow_api.id(1774855849259936482)
,p_layout=>'TABLE'
,p_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div role="region" aria-label="#TITLE!HTML#" class="t-Region t-Region--hideShow #REGION_CSS_CLASSES#" id="#REGION_STATIC_ID#" #REGION_ATTRIBUTES#>',
' <div class="t-Region-header">',
' <div class="t-Region-headerItems t-Region-headerItems--controls"><button class="t-Button t-Button--icon t-Button--hideShow" type="button"></button></div>',
' <div class="t-Region-headerItems t-Region-headerItems--title">',
' <h2 class="t-Region-title" data-apex-heading>#TITLE#</h2>',
' </div>',
' <div class="t-Region-headerItems t-Region-headerItems--buttons">#EDIT#</div>',
' </div>',
' <div class="t-Region-bodyWrap">',
' <div class="t-Region-buttons t-Region-buttons--top">',
' <div class="t-Region-buttons-left">#CLOSE#</div>',
' <div class="t-Region-buttons-right">#CREATE#</div>',
' </div>',
' <div class="t-Region-body">',
' #COPY#',
' #BODY#',
' #SUB_REGIONS#',
' #CHANGE#',
' </div>',
' <div class="t-Region-buttons t-Region-buttons--bottom">',
' <div class="t-Region-buttons-left">#PREVIOUS#</div>',
' <div class="t-Region-buttons-right">#NEXT#</div>',
' </div>',
' </div>',
'</div>'))
,p_page_plug_template_name=>'Collapsible'
,p_internal_name=>'COLLAPSIBLE'
,p_plug_table_bgcolor=>'#ffffff'
,p_theme_id=>42
,p_theme_class_id=>1
,p_preset_template_options=>'is-expanded:t-Region--scrollBody'
,p_plug_heading_bgcolor=>'#ffffff'
,p_plug_font_size=>'-1'
,p_default_label_alignment=>'RIGHT'
,p_default_field_alignment=>'LEFT'
,p_reference_id=>2662888092628347716
,p_translate_this_template=>'N'
,p_template_comment=>'Red Theme'
);
wwv_flow_api.create_plug_tmpl_display_point(
p_id=>wwv_flow_api.id(804729923981800364)
,p_plug_template_id=>wwv_flow_api.id(1774855849259936482)
,p_name=>'Region Body'
,p_placeholder=>'BODY'
,p_has_grid_support=>true
,p_glv_new_row=>true
,p_max_fixed_grid_columns=>12
);
wwv_flow_api.create_plug_tmpl_display_point(
p_id=>wwv_flow_api.id(804730409219800365)
,p_plug_template_id=>wwv_flow_api.id(1774855849259936482)
,p_name=>'Sub Regions'
,p_placeholder=>'SUB_REGIONS'
,p_has_grid_support=>true
,p_glv_new_row=>true
,p_max_fixed_grid_columns=>12
);
end;
/
prompt --application/shared_components/user_interface/templates/region/interactive_report
begin
wwv_flow_api.create_plug_template(
p_id=>wwv_flow_api.id(1774858309021936486)
,p_layout=>'TABLE'
,p_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div role="region" aria-label="#TITLE!ATTR#" id="#REGION_STATIC_ID#" #REGION_ATTRIBUTES# class="t-IRR-region #REGION_CSS_CLASSES#">',
' <h2 class="u-VisuallyHidden" id="#REGION_STATIC_ID#_heading" data-apex-heading>#TITLE#</h2>',
'#PREVIOUS##BODY##SUB_REGIONS##NEXT#',
'</div>'))
,p_page_plug_template_name=>'Interactive Report'
,p_internal_name=>'INTERACTIVE_REPORT'
,p_theme_id=>42
,p_theme_class_id=>9
,p_default_label_alignment=>'RIGHT'
,p_default_field_alignment=>'LEFT'
,p_reference_id=>2099079838218790610
,p_translate_this_template=>'N'
);
end;
/
prompt --application/shared_components/user_interface/templates/region/login
begin
wwv_flow_api.create_plug_template(
p_id=>wwv_flow_api.id(1774858630756936489)
,p_layout=>'TABLE'
,p_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div role="region" aria-label="#TITLE!ATTR#" class="t-Login-region t-Form--stretchInputs t-Form--labelsAbove #REGION_CSS_CLASSES#" id="#REGION_ID#" #REGION_ATTRIBUTES#>',
' <div class="t-Login-header">',
' <span class="t-Login-logo #ICON_CSS_CLASSES#"></span>',
' <h1 class="t-Login-title" id="#REGION_STATIC_ID#_heading" data-apex-heading>#TITLE#</h1>',
' </div>',
' <div class="t-Login-body">#BODY#</div>',
' <div class="t-Login-buttons">#NEXT#</div>',
' <div class="t-Login-links">#EDIT##CREATE#</div>',
' <div class="t-Login-subRegions">#SUB_REGIONS#</div>',
'</div>'))
,p_page_plug_template_name=>'Login'
,p_internal_name=>'LOGIN'
,p_theme_id=>42
,p_theme_class_id=>23
,p_default_label_alignment=>'RIGHT'
,p_default_field_alignment=>'LEFT'
,p_reference_id=>2672711194551076376
,p_translate_this_template=>'N'
);
wwv_flow_api.create_plug_tmpl_display_point(
p_id=>wwv_flow_api.id(804779400469800427)
,p_plug_template_id=>wwv_flow_api.id(1774858630756936489)
,p_name=>'Content Body'
,p_placeholder=>'BODY'
,p_has_grid_support=>false
,p_glv_new_row=>true
);
end;
/
prompt --application/shared_components/user_interface/templates/region/inline_dialog
begin
wwv_flow_api.create_plug_template(
p_id=>wwv_flow_api.id(1774858800950936491)
,p_layout=>'TABLE'
,p_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div id="#REGION_STATIC_ID#_parent">',
'<div id="#REGION_STATIC_ID#" class="t-DialogRegion #REGION_CSS_CLASSES# js-regionDialog" #REGION_ATTRIBUTES# style="display:none" title="#TITLE!ATTR#">',
' <div class="t-DialogRegion-wrap">',
' <div class="t-DialogRegion-bodyWrapperOut"><div class="t-DialogRegion-bodyWrapperIn"><div class="t-DialogRegion-body">#BODY#</div></div></div>',
' <div class="t-DialogRegion-buttons">',
' <div class="t-ButtonRegion t-ButtonRegion--dialogRegion">',
' <div class="t-ButtonRegion-wrap">',
' <div class="t-ButtonRegion-col t-ButtonRegion-col--left"><div class="t-ButtonRegion-buttons">#PREVIOUS##DELETE##CLOSE#</div></div>',
' <div class="t-ButtonRegion-col t-ButtonRegion-col--right"><div class="t-ButtonRegion-buttons">#EDIT##CREATE##NEXT#</div></div>',
' </div>',
' </div>',
' </div>',
' </div>',
'</div>',
'</div>'))
,p_page_plug_template_name=>'Inline Dialog'
,p_internal_name=>'INLINE_DIALOG'
,p_theme_id=>42
,p_theme_class_id=>24
,p_default_template_options=>'js-modal:js-draggable:js-resizable'
,p_preset_template_options=>'js-dialog-size600x400'
,p_default_label_alignment=>'RIGHT'
,p_default_field_alignment=>'LEFT'
,p_reference_id=>2671226943886536762
,p_translate_this_template=>'N'
);
wwv_flow_api.create_plug_tmpl_display_point(
p_id=>wwv_flow_api.id(804765651982800413)
,p_plug_template_id=>wwv_flow_api.id(1774858800950936491)
,p_name=>'Region Body'
,p_placeholder=>'BODY'
,p_has_grid_support=>true
,p_glv_new_row=>true
);
end;
/
prompt --application/shared_components/user_interface/templates/region/standard
begin
wwv_flow_api.create_plug_template(
p_id=>wwv_flow_api.id(1774859855390936493)
,p_layout=>'TABLE'
,p_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div role="region" aria-label="#TITLE!ATTR#" class="t-Region #REGION_CSS_CLASSES#" id="#REGION_STATIC_ID#" #REGION_ATTRIBUTES#>',
' <div class="t-Region-header">',
' <div class="t-Region-headerItems t-Region-headerItems--title">',
' <span class="t-Region-headerIcon"><span class="t-Icon #ICON_CSS_CLASSES#" aria-hidden="true"></span></span>',
' <h2 class="t-Region-title" id="#REGION_STATIC_ID#_heading" data-apex-heading>#TITLE#</h2>',
' </div>',
' <div class="t-Region-headerItems t-Region-headerItems--buttons">#COPY##EDIT#<span class="js-maximizeButtonContainer"></span></div>',
' </div>',
' <div class="t-Region-bodyWrap">',
' <div class="t-Region-buttons t-Region-buttons--top">',
' <div class="t-Region-buttons-left">#PREVIOUS#</div>',
' <div class="t-Region-buttons-right">#NEXT#</div>',
' </div>',
' <div class="t-Region-body">',
' #BODY#',
' #SUB_REGIONS#',
' </div>',
' <div class="t-Region-buttons t-Region-buttons--bottom">',
' <div class="t-Region-buttons-left">#CLOSE##HELP#</div>',
' <div class="t-Region-buttons-right">#DELETE##CHANGE##CREATE#</div>',
' </div>',
' </div>',
'</div>',
''))
,p_page_plug_template_name=>'Standard'
,p_internal_name=>'STANDARD'
,p_plug_table_bgcolor=>'#ffffff'
,p_theme_id=>42
,p_theme_class_id=>8
,p_preset_template_options=>'t-Region--scrollBody'
,p_plug_heading_bgcolor=>'#ffffff'
,p_plug_font_size=>'-1'
,p_default_label_alignment=>'RIGHT'
,p_default_field_alignment=>'LEFT'
,p_reference_id=>4070912133526059312
,p_translate_this_template=>'N'
);
wwv_flow_api.create_plug_tmpl_display_point(
p_id=>wwv_flow_api.id(804782879376800429)
,p_plug_template_id=>wwv_flow_api.id(1774859855390936493)
,p_name=>'Region Body'
,p_placeholder=>'BODY'
,p_has_grid_support=>true
,p_glv_new_row=>true
,p_max_fixed_grid_columns=>12
);
wwv_flow_api.create_plug_tmpl_display_point(
p_id=>wwv_flow_api.id(804783361572800430)
,p_plug_template_id=>wwv_flow_api.id(1774859855390936493)
,p_name=>'Sub Regions'
,p_placeholder=>'SUB_REGIONS'
,p_has_grid_support=>true
,p_glv_new_row=>true
,p_max_fixed_grid_columns=>12
);
end;
/
prompt --application/shared_components/user_interface/templates/region/title_bar
begin
wwv_flow_api.create_plug_template(
p_id=>wwv_flow_api.id(1774862430658936498)
,p_layout=>'TABLE'
,p_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div role="region" aria-label="#TITLE!ATTR#" id="#REGION_STATIC_ID#" #REGION_ATTRIBUTES# class="t-BreadcrumbRegion #REGION_CSS_CLASSES#"> ',
' <div class="t-BreadcrumbRegion-body">',
' <div class="t-BreadcrumbRegion-breadcrumb">#BODY#</div>',
' <div class="t-BreadcrumbRegion-title">',
' <h1 class="t-BreadcrumbRegion-titleText" data-apex-heading>#TITLE#</h1>',
' </div>',
' </div>',
' <div class="t-BreadcrumbRegion-buttons">#PREVIOUS##CLOSE##DELETE##HELP##CHANGE##EDIT##COPY##CREATE##NEXT#</div>',
'</div>'))
,p_page_plug_template_name=>'Title Bar'
,p_internal_name=>'TITLE_BAR'
,p_theme_id=>42
,p_theme_class_id=>6
,p_default_template_options=>'t-BreadcrumbRegion--showBreadcrumb'
,p_preset_template_options=>'t-BreadcrumbRegion--useBreadcrumbTitle'
,p_default_label_alignment=>'RIGHT'
,p_default_field_alignment=>'LEFT'
,p_reference_id=>2530016523834132090
,p_translate_this_template=>'N'
);
end;
/
prompt --application/shared_components/user_interface/templates/region/wizard_container
begin
wwv_flow_api.create_plug_template(
p_id=>wwv_flow_api.id(1774863107879936502)
,p_layout=>'TABLE'
,p_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div role="region" aria-label="#TITLE!ATTR#" class="t-Wizard #REGION_CSS_CLASSES#" id="#REGION_STATIC_ID#" #REGION_ATTRIBUTES#>',
' <div class="t-Wizard-header">',
' <h1 class="t-Wizard-title" data-apex-heading>#TITLE#</h1>',
' <div class="u-Table t-Wizard-controls">',
' <div class="u-Table-fit t-Wizard-buttons">#PREVIOUS##CLOSE#</div>',
' <div class="u-Table-fill t-Wizard-steps">#BODY#</div>',
' <div class="u-Table-fit t-Wizard-buttons">#NEXT#</div>',
' </div>',
' </div>',
' <div class="t-Wizard-body">#SUB_REGIONS#</div>',
'</div>'))
,p_page_plug_template_name=>'Wizard Container'
,p_internal_name=>'WIZARD_CONTAINER'
,p_theme_id=>42
,p_theme_class_id=>8
,p_preset_template_options=>'t-Wizard--hideStepsXSmall'
,p_default_label_alignment=>'RIGHT'
,p_default_field_alignment=>'LEFT'
,p_reference_id=>2117602213152591491
,p_translate_this_template=>'N'
);
wwv_flow_api.create_plug_tmpl_display_point(
p_id=>wwv_flow_api.id(804809780606800458)
,p_plug_template_id=>wwv_flow_api.id(1774863107879936502)
,p_name=>'Wizard Sub Regions'
,p_placeholder=>'SUB_REGIONS'
,p_has_grid_support=>true
,p_glv_new_row=>false
);
end;
/
prompt --application/shared_components/user_interface/templates/region/tabs_container
begin
wwv_flow_api.create_plug_template(
p_id=>wwv_flow_api.id(1859298875934135398)
,p_layout=>'TABLE'
,p_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-TabsRegion #REGION_CSS_CLASSES# apex-tabs-region" #REGION_ATTRIBUTES# id="#REGION_STATIC_ID#">',
' #BODY#',
' <div class="t-TabsRegion-items">#SUB_REGIONS#</div>',
'</div>'))
,p_sub_plug_template=>'<div data-label="#SUB_REGION_TITLE#" id="SR_#SUB_REGION_ID#">#SUB_REGION#</div>'
,p_page_plug_template_name=>'Tabs Container'
,p_internal_name=>'TABS_CONTAINER'
,p_javascript_file_urls=>'#IMAGE_PREFIX#libraries/apex/#MIN_DIRECTORY#widget.apexTabs#MIN#.js?v=#APEX_VERSION#'
,p_theme_id=>42
,p_theme_class_id=>5
,p_preset_template_options=>'t-TabsRegion-mod--simple'
,p_default_label_alignment=>'RIGHT'
,p_default_field_alignment=>'LEFT'
,p_reference_id=>3221725015618492759
,p_translate_this_template=>'N'
);
wwv_flow_api.create_plug_tmpl_display_point(
p_id=>wwv_flow_api.id(804802055560800449)
,p_plug_template_id=>wwv_flow_api.id(1859298875934135398)
,p_name=>'Region Body'
,p_placeholder=>'BODY'
,p_has_grid_support=>true
,p_glv_new_row=>true
);
wwv_flow_api.create_plug_tmpl_display_point(
p_id=>wwv_flow_api.id(804802558069800450)
,p_plug_template_id=>wwv_flow_api.id(1859298875934135398)
,p_name=>'Tabs'
,p_placeholder=>'SUB_REGIONS'
,p_has_grid_support=>false
,p_glv_new_row=>true
);
end;
/
prompt --application/shared_components/user_interface/templates/region/blank_with_attributes_no_grid
begin
wwv_flow_api.create_plug_template(
p_id=>wwv_flow_api.id(1939257338317598365)
,p_layout=>'TABLE'
,p_template=>'<div id="#REGION_STATIC_ID#" #REGION_ATTRIBUTES# class="#REGION_CSS_CLASSES#">#PREVIOUS##BODY##SUB_REGIONS##NEXT#</div>'
,p_page_plug_template_name=>'Blank with Attributes (No Grid)'
,p_internal_name=>'BLANK_WITH_ATTRIBUTES_NO_GRID'
,p_theme_id=>42
,p_theme_class_id=>7
,p_default_label_alignment=>'RIGHT'
,p_default_field_alignment=>'LEFT'
,p_reference_id=>3369790999010910123
,p_translate_this_template=>'N'
);
wwv_flow_api.create_plug_tmpl_display_point(
p_id=>wwv_flow_api.id(804704590050800320)
,p_plug_template_id=>wwv_flow_api.id(1939257338317598365)
,p_name=>'Body'
,p_placeholder=>'BODY'
,p_has_grid_support=>false
,p_glv_new_row=>true
);
wwv_flow_api.create_plug_tmpl_display_point(
p_id=>wwv_flow_api.id(804705079917800321)
,p_plug_template_id=>wwv_flow_api.id(1939257338317598365)
,p_name=>'Sub Regions'
,p_placeholder=>'SUB_REGIONS'
,p_has_grid_support=>false
,p_glv_new_row=>true
);
end;
/
prompt --application/shared_components/user_interface/templates/region/div_region_with_id
begin
wwv_flow_api.create_plug_template(
p_id=>wwv_flow_api.id(3314139557134950569)
,p_layout=>'TABLE'
,p_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div id="#REGION_STATIC_ID#" #REGION_ATTRIBUTES# class="#REGION_CSS_CLASSES#"> ',
'#BODY#',
'#CLOSE##PREVIOUS##NEXT##DELETE##EDIT##CHANGE##CREATE##CREATE2##EXPAND##COPY##HELP#',
'</div>'))
,p_page_plug_template_name=>'DIV Region with ID'
,p_internal_name=>'DIV_REGION_WITH_ID'
,p_theme_id=>101
,p_theme_class_id=>22
,p_default_label_alignment=>'RIGHT'
,p_default_field_alignment=>'LEFT'
,p_translate_this_template=>'N'
);
end;
/
prompt --application/shared_components/user_interface/templates/list/top_navigation_tabs
begin
wwv_flow_api.create_list_template(
p_id=>wwv_flow_api.id(31362403217672739)
,p_list_template_current=>'<li class="t-NavTabs-item #A03# is-active" id="#A01#"><a href="#LINK#" class="t-NavTabs-link #A04# " title="#TEXT_ESC_SC#"><span class="t-Icon #ICON_CSS_CLASSES#" aria-hidden="true"></span><span class="t-NavTabs-label">#TEXT_ESC_SC#</span><span class'
||'="t-NavTabs-badge #A05#">#A02#</span></a></li>'
,p_list_template_noncurrent=>'<li class="t-NavTabs-item #A03#" id="#A01#"><a href="#LINK#" class="t-NavTabs-link #A04# " title="#TEXT_ESC_SC#"><span class="t-Icon #ICON_CSS_CLASSES#" aria-hidden="true"></span><span class="t-NavTabs-label">#TEXT_ESC_SC#</span><span class="t-NavTab'
||'s-badge #A05#">#A02#</span></a></li>'
,p_list_template_name=>'Top Navigation Tabs'
,p_internal_name=>'TOP_NAVIGATION_TABS'
,p_theme_id=>42
,p_theme_class_id=>7
,p_preset_template_options=>'t-NavTabs--inlineLabels-lg:t-NavTabs--displayLabels-sm'
,p_list_template_before_rows=>'<ul class="t-NavTabs #COMPONENT_CSS_CLASSES#" id="#PARENT_STATIC_ID#_navtabs">'
,p_list_template_after_rows=>'</ul>'
,p_a01_label=>'List Item ID'
,p_a02_label=>'Badge Value'
,p_a03_label=>'List Item Class'
,p_a04_label=>'Link Class'
,p_a05_label=>'Badge Class'
,p_reference_id=>1453011561172885578
);
end;
/
prompt --application/shared_components/user_interface/templates/list/top_navigation_mega_menu
begin
wwv_flow_api.create_list_template(
p_id=>wwv_flow_api.id(574306143870650315)
,p_list_template_current=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li class="t-MegaMenu-item t-MegaMenu-item--top t-MegaMenu-item--noSub is-active #A04#" data-current="true" data-id="#A01#" data-shortcut="#A05#">',
' <span class="a-Menu-item t-MegaMenu-itemBody #A08#">',
' <span class="t-Icon #ICON_CSS_CLASSES#"></span>',
' <a class="a-Menu-label t-MegaMenu-labelWrap" href="#LINK#" target="#A06#">',
' <span class="t-MegaMenu-label">#TEXT_ESC_SC#</span>',
' <span class="t-MegaMenu-desc">#A03#</span>',
' </a>',
' <span class="t-MegaMenu-badge #A07#">#A02#</span>',
' </span>',
'</li>'))
,p_list_template_noncurrent=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li class="t-MegaMenu-item t-MegaMenu-item--top t-MegaMenu-item--noSub #A04#" data-current="false" data-id="#A01#" data-shortcut="#A05#">',
' <span class="a-Menu-item t-MegaMenu-itemBody #A08#">',
' <span class="t-Icon #ICON_CSS_CLASSES#"></span>',
' <a class="a-Menu-label t-MegaMenu-labelWrap" href="#LINK#" target="#A06#">',
' <span class="t-MegaMenu-label">#TEXT_ESC_SC#</span>',
' <span class="t-MegaMenu-desc">#A03#</span>',
' </a>',
' <span class="t-MegaMenu-badge #A07#">#A02#</span>',
' </span>',
'</li>'))
,p_list_template_name=>'Top Navigation Mega Menu'
,p_internal_name=>'TOP_NAVIGATION_MEGA_MENU'
,p_theme_id=>42
,p_theme_class_id=>20
,p_list_template_before_rows=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-MegaMenu #COMPONENT_CSS_CLASSES#" id="t_MenuNav" style="display:none;">',
' <div class="a-Menu-content t-MegaMenu-container">',
' <div class="t-MegaMenu-body">',
' <ul class="t-MegaMenu-list t-MegaMenu-list--top">'))
,p_list_template_after_rows=>' </ul></div></div></div>'
,p_before_sub_list=>'<ul class="t-MegaMenu-list t-MegaMenu-list--sub">'
,p_after_sub_list=>'</ul></li>'
,p_sub_list_item_current=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li class="t-MegaMenu-item is-active #A04#" data-current="true" data-id="#A01#" data-shortcut="#A05#">',
' <span class="a-Menu-item t-MegaMenu-itemBody #A08#">',
' <span class="t-Icon #ICON_CSS_CLASSES#"></span>',
' <a class="a-Menu-label t-MegaMenu-labelWrap" href="#LINK#" target="#A06#">',
' <span class="t-MegaMenu-label">#TEXT_ESC_SC#</span>',
' <span class="t-MegaMenu-desc">#A03#</span>',
' </a>',
' <span class="t-MegaMenu-badge #A07#">#A02#</span>',
' </span>',
'</li>'))
,p_sub_list_item_noncurrent=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li class="t-MegaMenu-item #A04#" data-current="false" data-id="#A01#" data-shortcut="#A05#">',
' <span class="a-Menu-item t-MegaMenu-itemBody #A08#">',
' <span class="t-Icon #ICON_CSS_CLASSES#"></span>',
' <a class="a-Menu-label t-MegaMenu-labelWrap" href="#LINK#" target="#A06#">',
' <span class="t-MegaMenu-label">#TEXT_ESC_SC#</span>',
' <span class="t-MegaMenu-desc">#A03#</span>',
' </a>',
' <span class="t-MegaMenu-badge #A07#">#A02#</span>',
' </span>',
'</li>'))
,p_item_templ_curr_w_child=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li class="t-MegaMenu-item t-MegaMenu-item--top t-MegaMenu-item--hasSub is-active #A04#" data-current="true" data-id="#A01#" data-shortcut="#A05#">',
' <span class="a-Menu-item t-MegaMenu-itemBody #A08#">',
' <span class="t-Icon #ICON_CSS_CLASSES#"></span>',
' <a class="a-Menu-label t-MegaMenu-labelWrap" href="#LINK#" target="#A06#">',
' <span class="t-MegaMenu-label">#TEXT_ESC_SC#</span>',
' <span class="t-MegaMenu-desc">#A03#</span>',
' </a>',
' <span class="t-MegaMenu-badge #A07#">#A02#</span>',
' </span>'))
,p_item_templ_noncurr_w_child=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li class="t-MegaMenu-item t-MegaMenu-item--top t-MegaMenu-item--hasSub #A04#" data-current="false" data-id="#A01#" data-shortcut="#A05#">',
' <span class="a-Menu-item t-MegaMenu-itemBody #A08#">',
' <span class="t-Icon #ICON_CSS_CLASSES#"></span>',
' <a class="a-Menu-label t-MegaMenu-labelWrap" href="#LINK#" target="#A06#">',
' <span class="t-MegaMenu-label">#TEXT_ESC_SC#</span>',
' <span class="t-MegaMenu-desc">#A03#</span>',
' </a>',
' <span class="t-MegaMenu-badge #A07#">#A02#</span>',
' </span>',
'</li>'))
,p_sub_templ_curr_w_child=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li class="t-MegaMenu-item is-active #A04#" data-current="true" data-id="#A01#" data-shortcut="#A05#">',
' <span class="a-Menu-item t-MegaMenu-itemBody #A08#">',
' <span class="t-Icon #ICON_CSS_CLASSES#"></span>',
' <a class="a-Menu-label t-MegaMenu-labelWrap" href="#LINK#" target="#A06#">',
' <span class="t-MegaMenu-label">#TEXT_ESC_SC#</span>',
' <span class="t-MegaMenu-desc">#A03#</span>',
' </a>',
' <span class="t-MegaMenu-badge #A07#">#A02#</span>',
' </span>'))
,p_sub_templ_noncurr_w_child=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li class="t-MegaMenu-item #A04#" data-current="false" data-id="#A01#" data-shortcut="#A05#">',
' <span class="a-Menu-item t-MegaMenu-itemBody #A08#">',
' <span class="t-Icon #ICON_CSS_CLASSES#"></span>',
' <a class="a-Menu-label t-MegaMenu-labelWrap" href="#LINK#" target="#A06#">',
' <span class="t-MegaMenu-label">#TEXT_ESC_SC#</span>',
' <span class="t-MegaMenu-desc">#A03#</span>',
' </a>',
' <span class="t-MegaMenu-badge #A07#">#A02#</span>',
' </span>'))
,p_a01_label=>'ID Attribute'
,p_a02_label=>'Badge Value'
,p_a03_label=>'Description'
,p_a04_label=>'List Item Class'
,p_a05_label=>'Shortcut Key'
,p_a06_label=>'Link Target'
,p_a07_label=>'Badge Class'
,p_a08_label=>'Menu Item Class'
,p_reference_id=>1665447133514362075
);
end;
/
prompt --application/shared_components/user_interface/templates/list/badge_list
begin
wwv_flow_api.create_list_template(
p_id=>wwv_flow_api.id(1774872583686936536)
,p_list_template_current=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li class="t-BadgeList-item #A02#">',
' <a class="t-BadgeList-wrap u-color #A04#" href="#LINK#" #A03#>',
' <span class="t-BadgeList-label">#TEXT#</span>',
' <span class="t-BadgeList-value">#A01#</span>',
' </a>',
'</li>'))
,p_list_template_noncurrent=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li class="t-BadgeList-item #A02#">',
' <a class="t-BadgeList-wrap u-color #A04#" href="#LINK#" #A03#>',
' <span class="t-BadgeList-label">#TEXT#</span>',
' <span class="t-BadgeList-value">#A01#</span>',
' </a>',
'</li>'))
,p_list_template_name=>'Badge List'
,p_internal_name=>'BADGE_LIST'
,p_theme_id=>42
,p_theme_class_id=>3
,p_preset_template_options=>'t-BadgeList--large:t-BadgeList--cols t-BadgeList--3cols:t-BadgeList--circular'
,p_list_template_before_rows=>'<ul class="t-BadgeList #COMPONENT_CSS_CLASSES#">'
,p_list_template_after_rows=>'</ul>'
,p_a01_label=>'Value'
,p_a02_label=>'List item CSS Classes'
,p_a03_label=>'Link Attributes'
,p_a04_label=>'Link Classes'
,p_reference_id=>2062482847268086664
,p_list_template_comment=>wwv_flow_string.join(wwv_flow_t_varchar2(
'A01: Large Number',
'A02: List Item Classes',
'A03: Link Attributes'))
);
end;
/
prompt --application/shared_components/user_interface/templates/list/cards
begin
wwv_flow_api.create_list_template(
p_id=>wwv_flow_api.id(1774874589747936542)
,p_list_template_current=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li class="t-Cards-item is-active #A04#">',
' <div class="t-Card">',
' <a href="#LINK#" class="t-Card-wrap" #A05#>',
' <div class="t-Card-icon u-color #A06#"><span class="t-Icon #ICON_CSS_CLASSES#"><span class="t-Card-initials" role="presentation">#A03#</span></span></div>',
' <div class="t-Card-titleWrap"><h3 class="t-Card-title">#TEXT#</h3><h4 class="t-Card-subtitle">#A07#</h4></div>',
' <div class="t-Card-body">',
' <div class="t-Card-desc">#A01#</div>',
' <div class="t-Card-info">#A02#</div>',
' </div>',
' <span class="t-Card-colorFill u-color #A06#"></span>',
' </a>',
' </div>',
'</li>'))
,p_list_template_noncurrent=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li class="t-Cards-item #A04#">',
' <div class="t-Card">',
' <a href="#LINK#" class="t-Card-wrap" #A05#>',
' <div class="t-Card-icon u-color #A06#"><span class="t-Icon #ICON_CSS_CLASSES#"><span class="t-Card-initials" role="presentation">#A03#</span></span></div>',
' <div class="t-Card-titleWrap"><h3 class="t-Card-title">#TEXT#</h3><h4 class="t-Card-subtitle">#A07#</h4></div>',
' <div class="t-Card-body">',
' <div class="t-Card-desc">#A01#</div>',
' <div class="t-Card-info">#A02#</div>',
' </div>',
' <span class="t-Card-colorFill u-color #A06#"></span>',
' </a>',
' </div>',
'</li>'))
,p_list_template_name=>'Cards'
,p_internal_name=>'CARDS'
,p_theme_id=>42
,p_theme_class_id=>4
,p_preset_template_options=>'t-Cards--animColorFill:t-Cards--3cols:t-Cards--basic'
,p_list_template_before_rows=>'<ul class="t-Cards #COMPONENT_CSS_CLASSES#">'
,p_list_template_after_rows=>'</ul>'
,p_a01_label=>'Description'
,p_a02_label=>'Secondary Information'
,p_a03_label=>'Initials'
,p_a04_label=>'List Item CSS Classes'
,p_a05_label=>'Link Attributes'
,p_a06_label=>'Card Color Class'
,p_a07_label=>'Subtitle'
,p_reference_id=>2885322685880632508
);
end;
/
prompt --application/shared_components/user_interface/templates/list/links_list
begin
wwv_flow_api.create_list_template(
p_id=>wwv_flow_api.id(1774877008397936545)
,p_list_template_current=>'<li class="t-LinksList-item is-current #A03#"><a href="#LINK#" class="t-LinksList-link" #A02#><span class="t-LinksList-icon"><span class="t-Icon #ICON_CSS_CLASSES#"></span></span><span class="t-LinksList-label">#TEXT#</span><span class="t-LinksList-b'
||'adge">#A01#</span></a></li>'
,p_list_template_noncurrent=>'<li class="t-LinksList-item #A03#"><a href="#LINK#" class="t-LinksList-link" #A02#><span class="t-LinksList-icon"><span class="t-Icon #ICON_CSS_CLASSES#"></span></span><span class="t-LinksList-label">#TEXT#</span><span class="t-LinksList-badge">#A01#'
||'</span></a></li>'
,p_list_template_name=>'Links List'
,p_internal_name=>'LINKS_LIST'
,p_theme_id=>42
,p_theme_class_id=>18
,p_list_template_before_rows=>'<ul class="t-LinksList #COMPONENT_CSS_CLASSES#" id="#LIST_ID#">'
,p_list_template_after_rows=>'</ul>'
,p_before_sub_list=>'<ul class="t-LinksList-list">'
,p_after_sub_list=>'</ul>'
,p_sub_list_item_current=>'<li class="t-LinksList-item is-current #A03#"><a href="#LINK#" class="t-LinksList-link" #A02#><span class="t-LinksList-icon"><span class="t-Icon #ICON_CSS_CLASSES#"></span></span><span class="t-LinksList-label">#TEXT#</span><span class="t-LinksList-b'
||'adge">#A01#</span></a></li>'
,p_sub_list_item_noncurrent=>'<li class="t-LinksList-item #A03#"><a href="#LINK#" class="t-LinksList-link" #A02#><span class="t-LinksList-icon"><span class="t-Icon #ICON_CSS_CLASSES#"></span></span><span class="t-LinksList-label">#TEXT#</span><span class="t-LinksList-badge">#A01#'
||'</span></a></li>'
,p_item_templ_curr_w_child=>'<li class="t-LinksList-item is-current is-expanded #A03#"><a href="#LINK#" class="t-LinksList-link" #A02#><span class="t-LinksList-icon"><span class="t-Icon #ICON_CSS_CLASSES#"></span></span><span class="t-LinksList-label">#TEXT#</span><span class="t'
||'-LinksList-badge">#A01#</span></a>#SUB_LISTS#</li>'
,p_item_templ_noncurr_w_child=>'<li class="t-LinksList-item #A03#"><a href="#LINK#" class="t-LinksList-link" #A02#><span class="t-LinksList-icon"><span class="t-Icon #ICON_CSS_CLASSES#"></span></span><span class="t-LinksList-label">#TEXT#</span><span class="t-LinksList-badge">#A01#'
||'</span></a></li>'
,p_a01_label=>'Badge Value'
,p_a02_label=>'Link Attributes'
,p_a03_label=>'List Item CSS Classes'
,p_reference_id=>4070914341144059318
);
end;
/
prompt --application/shared_components/user_interface/templates/list/media_list
begin
wwv_flow_api.create_list_template(
p_id=>wwv_flow_api.id(1774878219827936547)
,p_list_template_current=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li class="t-MediaList-item is-active #A04#">',
' <a href="#LINK#" class="t-MediaList-itemWrap #A05#" #A03#>',
' <div class="t-MediaList-iconWrap">',
' <span class="t-MediaList-icon u-color #A06#"><span class="t-Icon #ICON_CSS_CLASSES#" #IMAGE_ATTR#></span></span>',
' </div>',
' <div class="t-MediaList-body">',
' <h3 class="t-MediaList-title">#TEXT#</h3>',
' <p class="t-MediaList-desc">#A01#</p>',
' </div>',
' <div class="t-MediaList-badgeWrap">',
' <span class="t-MediaList-badge">#A02#</span>',
' </div>',
' </a>',
'</li>'))
,p_list_template_noncurrent=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li class="t-MediaList-item #A04#">',
' <a href="#LINK#" class="t-MediaList-itemWrap #A05#" #A03#>',
' <div class="t-MediaList-iconWrap">',
' <span class="t-MediaList-icon u-color #A06#"><span class="t-Icon #ICON_CSS_CLASSES#" #IMAGE_ATTR#></span></span>',
' </div>',
' <div class="t-MediaList-body">',
' <h3 class="t-MediaList-title">#TEXT#</h3>',
' <p class="t-MediaList-desc">#A01#</p>',
' </div>',
' <div class="t-MediaList-badgeWrap">',
' <span class="t-MediaList-badge">#A02#</span>',
' </div>',
' </a>',
'</li>'))
,p_list_template_name=>'Media List'
,p_internal_name=>'MEDIA_LIST'
,p_theme_id=>42
,p_theme_class_id=>5
,p_default_template_options=>'t-MediaList--showIcons:t-MediaList--showDesc'
,p_list_template_before_rows=>'<ul class="t-MediaList #COMPONENT_CSS_CLASSES#">'
,p_list_template_after_rows=>'</ul>'
,p_a01_label=>'Description'
,p_a02_label=>'Badge Value'
,p_a03_label=>'Link Attributes'
,p_a04_label=>'List Item CSS Classes'
,p_a05_label=>'Link Class'
,p_a06_label=>'Icon Color Class'
,p_reference_id=>2066548068783481421
);
end;
/
prompt --application/shared_components/user_interface/templates/list/menu_bar
begin
wwv_flow_api.create_list_template(
p_id=>wwv_flow_api.id(1774879954637936553)
,p_list_template_current=>'<li data-current="true" data-id="#A01#" data-disabled="#A02#" data-hide="#A03#" data-shortcut="#A05#" data-icon="#ICON_CSS_CLASSES#"><a href="#LINK#" title="#A04#" target="#A06#">#TEXT_ESC_SC#</a></li>'
,p_list_template_noncurrent=>'<li data-id="#A01#" data-disabled="#A02#" data-hide="#A03#" data-shortcut="#A05#" data-icon="#ICON_CSS_CLASSES#"><a href="#LINK#" title="#A04#" target="#A06#">#TEXT_ESC_SC#</a></li>'
,p_list_template_name=>'Menu Bar'
,p_internal_name=>'MENU_BAR'
,p_javascript_code_onload=>wwv_flow_string.join(wwv_flow_t_varchar2(
'var e = apex.jQuery("##PARENT_STATIC_ID#_menubar", apex.gPageContext$);',
'if (e.hasClass("js-addActions")) {',
' apex.actions.addFromMarkup( e );',
'}',
'e.menu({',
' behaveLikeTabs: e.hasClass("js-tabLike"),',
' menubarShowSubMenuIcon: e.hasClass("js-showSubMenuIcons") || null,',
' iconType: ''fa'',',
' menubar: true,',
' menubarOverflow: true,',
' callout: e.hasClass("js-menu-callout")',
'});'))
,p_theme_id=>42
,p_theme_class_id=>20
,p_default_template_options=>'js-showSubMenuIcons'
,p_list_template_before_rows=>'<div class="t-MenuBar #COMPONENT_CSS_CLASSES#" id="#PARENT_STATIC_ID#_menubar"><ul style="display:none">'
,p_list_template_after_rows=>'</ul></div>'
,p_before_sub_list=>'<ul>'
,p_after_sub_list=>'</ul></li>'
,p_sub_list_item_current=>'<li data-current="true" data-id="#A01#" data-disabled="#A02#" data-hide="#A03#" data-shortcut="#A05#" data-icon="#ICON_CSS_CLASSES#"><a href="#LINK#" title="#A04#" target="#A06#">#TEXT_ESC_SC#</a></li>'
,p_sub_list_item_noncurrent=>'<li data-id="#A01#" data-disabled="#A02#" data-hide="#A03#" data-shortcut="#A05#" data-icon="#ICON_CSS_CLASSES#"><a href="#LINK#" title="#A04#" target="#A06#">#TEXT_ESC_SC#</a></li>'
,p_item_templ_curr_w_child=>'<li data-current="true" data-id="#A01#" data-disabled="#A02#" data-hide="#A03#" data-shortcut="#A05#" data-icon="#ICON_CSS_CLASSES#"><a href="#LINK#" title="#A04#" target="#A06#">#TEXT_ESC_SC#</a>'
,p_item_templ_noncurr_w_child=>'<li data-id="#A01#" data-disabled="#A02#" data-hide="#A03#" data-shortcut="#A05#" data-icon="#ICON_CSS_CLASSES#"><a href="#LINK#" title="#A04#" target="#A06#">#TEXT_ESC_SC#</a>'
,p_sub_templ_curr_w_child=>'<li data-current="true" data-id="#A01#" data-disabled="#A02#" data-hide="#A03#" data-shortcut="#A05#" data-icon="#ICON_CSS_CLASSES#"><a href="#LINK#" title="#A04#" target="#A06#">#TEXT_ESC_SC#</a>'
,p_sub_templ_noncurr_w_child=>'<li data-id="#A01#" data-disabled="#A02#" data-hide="#A03#" data-shortcut="#A05#" data-icon="#ICON_CSS_CLASSES#"><a href="#LINK#" title="#A04#" target="#A06#">#TEXT_ESC_SC#</a>'
,p_a01_label=>'Menu Item ID / Action Name'
,p_a02_label=>'Disabled (True/False)'
,p_a03_label=>'Hidden (True/False)'
,p_a04_label=>'Title Attribute (Used By Actions Only)'
,p_a05_label=>'Shortcut'
,p_a06_label=>'Link Target'
,p_reference_id=>2008709236185638887
);
end;
/
prompt --application/shared_components/user_interface/templates/list/navigation_bar
begin
wwv_flow_api.create_list_template(
p_id=>wwv_flow_api.id(1774880169096936555)
,p_list_template_current=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li class="t-NavigationBar-item is-active #A02#">',
' <a class="t-Button t-Button--icon t-Button--header t-Button--navBar" href="#LINK#" title="#A04#">',
' <span class="t-Icon #ICON_CSS_CLASSES#" #IMAGE_ATTR#></span><span class="t-Button-label">#TEXT_ESC_SC#</span><span class="t-Button-badge">#A01#</span>',
' </a>',
'</li>'))
,p_list_template_noncurrent=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li class="t-NavigationBar-item #A02#">',
' <a class="t-Button t-Button--icon t-Button--header t-Button--navBar" href="#LINK#" title="#A04#">',
' <span class="t-Icon #ICON_CSS_CLASSES#" #IMAGE_ATTR#></span><span class="t-Button-label">#TEXT_ESC_SC#</span><span class="t-Button-badge">#A01#</span>',
' </a>',
'</li>'))
,p_list_template_name=>'Navigation Bar'
,p_internal_name=>'NAVIGATION_BAR'
,p_theme_id=>42
,p_theme_class_id=>20
,p_list_template_before_rows=>'<ul class="t-NavigationBar #COMPONENT_CSS_CLASSES#" id="#LIST_ID#">'
,p_list_template_after_rows=>'</ul>'
,p_before_sub_list=>'<div class="t-NavigationBar-menu" style="display: none" id="menu_#PARENT_LIST_ITEM_ID#"><ul>'
,p_after_sub_list=>'</ul></div></li>'
,p_sub_list_item_current=>'<li data-current="true" data-icon="#ICON_CSS_CLASSES#"><a href="#LINK#" title="#A04#">#TEXT_ESC_SC#</a></li>'
,p_sub_list_item_noncurrent=>'<li data-current="false" data-icon="#ICON_CSS_CLASSES#"><a href="#LINK#" title="#A04#">#TEXT_ESC_SC#</a></li>'
,p_item_templ_curr_w_child=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li class="t-NavigationBar-item is-active #A02#">',
' <button class="t-Button t-Button--icon t-Button t-Button--header t-Button--navBar js-menuButton" type="button" id="#LIST_ITEM_ID#" data-menu="menu_#LIST_ITEM_ID#" title="#A04#">',
' <span class="t-Icon #ICON_CSS_CLASSES#" #IMAGE_ATTR#></span><span class="t-Button-label">#TEXT_ESC_SC#</span><span class="t-Button-badge">#A01#</span><span class="a-Icon icon-down-arrow"></span>',
' </button>'))
,p_item_templ_noncurr_w_child=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li class="t-NavigationBar-item #A02#">',
' <button class="t-Button t-Button--icon t-Button t-Button--header t-Button--navBar js-menuButton" type="button" id="#LIST_ITEM_ID#" data-menu="menu_#LIST_ITEM_ID#" title="#A04#">',
' <span class="t-Icon #ICON_CSS_CLASSES#" #IMAGE_ATTR#></span><span class="t-Button-label">#TEXT_ESC_SC#</span><span class="t-Button-badge">#A01#</span><span class="a-Icon icon-down-arrow"></span>',
' </button>'))
,p_sub_templ_curr_w_child=>'<li data-current="true" data-icon="#ICON_CSS_CLASSES#"><a href="#LINK#" title="#A04#">#TEXT_ESC_SC#</a></li>'
,p_sub_templ_noncurr_w_child=>'<li data-current="false" data-icon="#ICON_CSS_CLASSES#"><a href="#LINK#" title="#A04#">#TEXT_ESC_SC#</a></li>'
,p_a01_label=>'Badge Value'
,p_a02_label=>'List Item CSS Classes'
,p_a04_label=>'Title Attribute'
,p_reference_id=>2846096252961119197
);
end;
/
prompt --application/shared_components/user_interface/templates/list/side_navigation_menu
begin
wwv_flow_api.create_list_template(
p_id=>wwv_flow_api.id(1774880316343936557)
,p_list_template_current=>'<li data-current="true" data-id="#A01#" data-disabled="#A02#" data-icon="#ICON_CSS_CLASSES#" data-shortcut="#A05#"><a href="#LINK#" title="#A04#" target="#A06#">#TEXT_ESC_SC#</a></li>'
,p_list_template_noncurrent=>'<li data-id="#A01#" data-disabled="#A02#" data-icon="#ICON_CSS_CLASSES#" data-shortcut="#A05#"><a href="#LINK#" title="#A04#" target="#A06#">#TEXT_ESC_SC#</a></li>'
,p_list_template_name=>'Side Navigation Menu'
,p_internal_name=>'SIDE_NAVIGATION_MENU'
,p_javascript_file_urls=>'#IMAGE_PREFIX#libraries/apex/#MIN_DIRECTORY#widget.treeView#MIN#.js?v=#APEX_VERSION#'
,p_javascript_code_onload=>'apex.jQuery(''body'').addClass(''t-PageBody--leftNav'');'
,p_theme_id=>42
,p_theme_class_id=>19
,p_default_template_options=>'js-defaultCollapsed'
,p_preset_template_options=>'js-navCollapsed--hidden:t-TreeNav--styleA'
,p_list_template_before_rows=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Body-nav" id="t_Body_nav" role="navigation" aria-label="&APP_TITLE!ATTR.">',
'<div class="t-TreeNav #COMPONENT_CSS_CLASSES#" id="t_TreeNav" data-id="#PARENT_STATIC_ID#_tree" aria-label="&APP_TITLE!ATTR."><ul style="display:none">'))
,p_list_template_after_rows=>'</ul></div></div>'
,p_before_sub_list=>'<ul>'
,p_after_sub_list=>'</ul></li>'
,p_sub_list_item_current=>'<li data-current="true" data-id="#A01#" data-disabled="#A02#" data-icon="#ICON_CSS_CLASSES#" data-shortcut="#A05#"><a href="#LINK#" title="#A04#" target="#A06#">#TEXT_ESC_SC#</a></li>'
,p_sub_list_item_noncurrent=>'<li data-id="#A01#" data-disabled="#A02#" data-icon="#ICON_CSS_CLASSES#" data-shortcut="#A05#"><a href="#LINK#" title="#A04#" target="#A06#">#TEXT_ESC_SC#</a></li>'
,p_item_templ_curr_w_child=>'<li data-current="true" data-id="#A01#" data-disabled="#A02#" data-icon="#ICON_CSS_CLASSES#" data-shortcut="#A05#"><a href="#LINK#" title="#A04#" target="#A06#">#TEXT_ESC_SC#</a>'
,p_item_templ_noncurr_w_child=>'<li data-id="#A01#" data-disabled="#A02#" data-icon="#ICON_CSS_CLASSES#" data-shortcut="#A05#"><a href="#LINK#" title="#A04#" target="#A06#">#TEXT_ESC_SC#</a>'
,p_sub_templ_curr_w_child=>'<li data-current="true" data-id="#A01#" data-disabled="#A02#" data-icon="#ICON_CSS_CLASSES#" data-shortcut="#A05#"><a href="#LINK#" title="#A04#" target="#A06#">#TEXT_ESC_SC#</a>'
,p_sub_templ_noncurr_w_child=>'<li data-id="#A01#" data-disabled="#A02#" data-icon="#ICON_CSS_CLASSES#" data-shortcut="#A05#"><a href="#LINK#" title="#A04#" target="#A06#">#TEXT_ESC_SC#</a>'
,p_a01_label=>'ID Attribute'
,p_a02_label=>'Disabled (True/False)'
,p_a04_label=>'Title Attribute (Used By Actions Only)'
,p_a05_label=>'Shortcut Key'
,p_a06_label=>'Link Target'
,p_reference_id=>2466292414354694776
);
end;
/
prompt --application/shared_components/user_interface/templates/list/top_navigation_menu
begin
wwv_flow_api.create_list_template(
p_id=>wwv_flow_api.id(1774880492604936559)
,p_list_template_current=>'<li data-current="true" data-id="#A01#" data-disabled="#A02#" data-hide="#A03#" data-shortcut="#A05#" data-icon="#ICON_CSS_CLASSES#"><a href="#LINK#" title="#A04#" target="#A06#">#TEXT_ESC_SC#</a></li>'
,p_list_template_noncurrent=>'<li data-id="#A01#" data-disabled="#A02#" data-hide="#A03#" data-shortcut="#A05#" data-icon="#ICON_CSS_CLASSES#"><a href="#LINK#" title="#A04#" target="#A06#">#TEXT_ESC_SC#</a></li>'
,p_list_template_name=>'Top Navigation Menu'
,p_internal_name=>'TOP_NAVIGATION_MENU'
,p_javascript_code_onload=>wwv_flow_string.join(wwv_flow_t_varchar2(
'var e = apex.jQuery("#t_MenuNav", apex.gPageContext$);',
'if (e.hasClass("js-addActions")) {',
' apex.actions.addFromMarkup( e );',
'}',
'e.menu({',
' behaveLikeTabs: e.hasClass("js-tabLike"),',
' menubarShowSubMenuIcon: e.hasClass("js-showSubMenuIcons") || null,',
' menubar: true,',
' menubarOverflow: true,',
' callout: e.hasClass("js-menu-callout")',
'});',
''))
,p_theme_id=>42
,p_theme_class_id=>20
,p_default_template_options=>'js-tabLike'
,p_list_template_before_rows=>'<div class="t-Header-nav-list #COMPONENT_CSS_CLASSES#" id="t_MenuNav"><ul style="display:none">'
,p_list_template_after_rows=>'</ul></div>'
,p_before_sub_list=>'<ul>'
,p_after_sub_list=>'</ul></li>'
,p_sub_list_item_current=>'<li data-current="true" data-id="#A01#" data-disabled="#A02#" data-hide="#A03#" data-shortcut="#A05#" data-icon="#ICON_CSS_CLASSES#"><a href="#LINK#" title="#A04#" target="#A06#">#TEXT_ESC_SC#</a></li>'
,p_sub_list_item_noncurrent=>'<li data-id="#A01#" data-disabled="#A02#" data-hide="#A03#" data-shortcut="#A05#" data-icon="#ICON_CSS_CLASSES#"><a href="#LINK#" title="#A04#" target="#A06#">#TEXT_ESC_SC#</a></li>'
,p_item_templ_curr_w_child=>'<li data-current="true" data-id="#A01#" data-disabled="#A02#" data-hide="#A03#" data-shortcut="#A05#" data-icon="#ICON_CSS_CLASSES#"><a href="#LINK#" title="#A04#" target="#A06#">#TEXT_ESC_SC#</a>'
,p_item_templ_noncurr_w_child=>'<li data-id="#A01#" data-disabled="#A02#" data-hide="#A03#" data-shortcut="#A05#" data-icon="#ICON_CSS_CLASSES#"><a href="#LINK#" title="#A04#" target="#A06#">#TEXT_ESC_SC#</a>'
,p_sub_templ_curr_w_child=>'<li data-current="true" data-id="#A01#" data-disabled="#A02#" data-hide="#A03#" data-shortcut="#A05#" data-icon="#ICON_CSS_CLASSES#"><a href="#LINK#" title="#A04#" target="#A06#">#TEXT_ESC_SC#</a>'
,p_sub_templ_noncurr_w_child=>'<li data-id="#A01#" data-disabled="#A02#" data-hide="#A03#" data-shortcut="#A05#" data-icon="#ICON_CSS_CLASSES#"><a href="#LINK#" title="#A04#" target="#A06#">#TEXT_ESC_SC#</a>'
,p_a01_label=>'Menu Item ID / Action Name'
,p_a02_label=>'Disabled (True/False)'
,p_a03_label=>'Hidden (True/False)'
,p_a04_label=>'Title Attribute (Used By Actions Only)'
,p_a05_label=>'Shortcut Key'
,p_a06_label=>'Link Target'
,p_reference_id=>2525307901300239072
);
end;
/
prompt --application/shared_components/user_interface/templates/list/wizard_progress
begin
wwv_flow_api.create_list_template(
p_id=>wwv_flow_api.id(1774881131647936562)
,p_list_template_current=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li class="t-WizardSteps-step is-active" id="#LIST_ITEM_ID#"><div class="t-WizardSteps-wrap" data-link="#LINK#"><span class="t-WizardSteps-marker"></span><span class="t-WizardSteps-label">#TEXT# <span class="t-WizardSteps-labelState"></span></span></'
||'div></li>',
''))
,p_list_template_noncurrent=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li class="t-WizardSteps-step" id="#LIST_ITEM_ID#"><div class="t-WizardSteps-wrap" data-link="#LINK#"><span class="t-WizardSteps-marker"></span><span class="t-WizardSteps-label">#TEXT# <span class="t-WizardSteps-labelState"></span></span></div></li>',
''))
,p_list_template_name=>'Wizard Progress'
,p_internal_name=>'WIZARD_PROGRESS'
,p_javascript_code_onload=>'apex.theme.initWizardProgressBar();'
,p_theme_id=>42
,p_theme_class_id=>17
,p_preset_template_options=>'t-WizardSteps--displayLabels'
,p_list_template_before_rows=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<h2 class="u-VisuallyHidden">#CURRENT_PROGRESS#</h2>',
'<ul class="t-WizardSteps #COMPONENT_CSS_CLASSES#" id="#LIST_ID#">'))
,p_list_template_after_rows=>'</ul>'
,p_reference_id=>2008702338707394488
);
end;
/
prompt --application/shared_components/user_interface/templates/list/tabs
begin
wwv_flow_api.create_list_template(
p_id=>wwv_flow_api.id(1859329970668135499)
,p_list_template_current=>'<li class="t-Tabs-item is-active #A03#" id="#A01#"><a href="#LINK#" class="t-Tabs-link #A04#"><span class="t-Icon #ICON_CSS_CLASSES#"></span><span class="t-Tabs-label">#TEXT#</span></a></li>'
,p_list_template_noncurrent=>'<li class="t-Tabs-item #A03#" id="#A01#"><a href="#LINK#" class="t-Tabs-link #A04#"><span class="t-Icon #ICON_CSS_CLASSES#"></span><span class="t-Tabs-label">#TEXT#</span></a></li>'
,p_list_template_name=>'Tabs'
,p_internal_name=>'TABS'
,p_javascript_file_urls=>'#IMAGE_PREFIX#libraries/apex/#MIN_DIRECTORY#widget.apexTabs#MIN#.js?v=#APEX_VERSION#'
,p_theme_id=>42
,p_theme_class_id=>7
,p_preset_template_options=>'t-Tabs--simple'
,p_list_template_before_rows=>'<ul class="t-Tabs #COMPONENT_CSS_CLASSES#">'
,p_list_template_after_rows=>'</ul>'
,p_a01_label=>'List Item ID'
,p_a03_label=>'List Item Class'
,p_a04_label=>'Link Class'
,p_reference_id=>3288206686691809997
);
end;
/
prompt --application/shared_components/user_interface/templates/list/menu_popup
begin
wwv_flow_api.create_list_template(
p_id=>wwv_flow_api.id(2145762120472370629)
,p_list_template_current=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li data-id="#A01#" data-disabled="#A02#" data-hide="#A03#" data-shortcut="#A05#" data-icon="#ICON_CSS_CLASSES#"><a href="#LINK#" title="#A04#" target="#A06#">#TEXT_ESC_SC#</a></li>',
''))
,p_list_template_noncurrent=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li data-id="#A01#" data-disabled="#A02#" data-hide="#A03#" data-shortcut="#A05#" data-icon="#ICON_CSS_CLASSES#"><a href="#LINK#" title="#A04#" target="#A06#">#TEXT_ESC_SC#</a></li>',
''))
,p_list_template_name=>'Menu Popup'
,p_internal_name=>'MENU_POPUP'
,p_javascript_code_onload=>wwv_flow_string.join(wwv_flow_t_varchar2(
'var e = apex.jQuery("##PARENT_STATIC_ID#_menu", apex.gPageContext$);',
'if (e.hasClass("js-addActions")) {',
' apex.actions.addFromMarkup( e );',
'}',
'e.menu({ iconType: ''fa'', callout: e.hasClass("js-menu-callout")});'))
,p_theme_id=>42
,p_theme_class_id=>20
,p_list_template_before_rows=>'<div id="#PARENT_STATIC_ID#_menu" class="#COMPONENT_CSS_CLASSES#" style="display:none;"><ul>'
,p_list_template_after_rows=>'</ul></div>'
,p_before_sub_list=>'<ul>'
,p_after_sub_list=>'</ul></li>'
,p_sub_list_item_current=>'<li data-id="#A01#" data-disabled="#A02#" data-hide="#A03#" data-shortcut="#A05#" data-icon="#ICON_CSS_CLASSES#"><a href="#LINK#" title="#A04#" target="#A06#">#TEXT_ESC_SC#</a></li>'
,p_sub_list_item_noncurrent=>'<li data-id="#A01#" data-disabled="#A02#" data-hide="#A03#" data-shortcut="#A05#" data-icon="#ICON_CSS_CLASSES#"><a href="#LINK#" title="#A04#" target="#A06#">#TEXT_ESC_SC#</a></li>'
,p_item_templ_curr_w_child=>'<li data-id="#A01#" data-disabled="#A02#" data-hide="#A03#" data-shortcut="#A05#" data-icon="#ICON_CSS_CLASSES#"><a href="#LINK#" title="#A04#" target="#A06#">#TEXT_ESC_SC#</a>'
,p_item_templ_noncurr_w_child=>'<li data-id="#A01#" data-disabled="#A02#" data-hide="#A03#" data-shortcut="#A05#" data-icon="#ICON_CSS_CLASSES#"><a href="#LINK#" title="#A04#" target="#A06#">#TEXT_ESC_SC#</a>'
,p_sub_templ_curr_w_child=>'<li data-id="#A01#" data-disabled="#A02#" data-hide="#A03#" data-shortcut="#A05#" data-icon="#ICON_CSS_CLASSES#"><a href="#LINK#" title="#A04#" target="#A06#">#TEXT_ESC_SC#</a>'
,p_sub_templ_noncurr_w_child=>'<li data-id="#A01#" data-disabled="#A02#" data-hide="#A03#" data-shortcut="#A05#" data-icon="#ICON_CSS_CLASSES#"><a href="#LINK#" title="#A04#" target="#A06#">#TEXT_ESC_SC#</a>'
,p_a01_label=>'Menu Item ID / Action Name'
,p_a02_label=>'Disabled (True/False)'
,p_a03_label=>'Hidden (True/False)'
,p_a04_label=>'Title Attribute (Used By Actions Only)'
,p_a05_label=>'Shortcut'
,p_a06_label=>'Link Target'
,p_reference_id=>3492264004432431646
);
end;
/
prompt --application/shared_components/user_interface/templates/report/media_list
begin
wwv_flow_api.create_row_template(
p_id=>wwv_flow_api.id(31402600142672772)
,p_row_template_name=>'Media List'
,p_internal_name=>'MEDIA_LIST'
,p_row_template1=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li class="t-MediaList-item #LIST_CLASS#">',
' <a href="#LINK#" class="t-MediaList-itemWrap #LINK_CLASS#" #LINK_ATTR#>',
' <div class="t-MediaList-iconWrap">',
' <span class="t-MediaList-icon u-color #ICON_COLOR_CLASS#"><span class="t-Icon #ICON_CLASS#"></span></span>',
' </div>',
' <div class="t-MediaList-body">',
' <h3 class="t-MediaList-title">#LIST_TITLE#</h3>',
' <p class="t-MediaList-desc">#LIST_TEXT#</p>',
' </div>',
' <div class="t-MediaList-badgeWrap">',
' <span class="t-MediaList-badge">#LIST_BADGE#</span>',
' </div>',
' </a>',
'</li>'))
,p_row_template_condition1=>':LINK is not null'
,p_row_template2=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li class="t-MediaList-item #LIST_CLASS#">',
' <div class="t-MediaList-itemWrap #LINK_CLASS#" #LINK_ATTR#>',
' <div class="t-MediaList-iconWrap">',
' <span class="t-MediaList-icon u-color #ICON_COLOR_CLASS#"><span class="t-Icon #ICON_CLASS#"></span></span>',
' </div>',
' <div class="t-MediaList-body">',
' <h3 class="t-MediaList-title">#LIST_TITLE#</h3>',
' <p class="t-MediaList-desc">#LIST_TEXT#</p>',
' </div>',
' <div class="t-MediaList-badgeWrap">',
' <span class="t-MediaList-badge">#LIST_BADGE#</span>',
' </div>',
' </div>',
'</li>'))
,p_row_template_before_rows=>'<ul class="t-MediaList #COMPONENT_CSS_CLASSES#" #REPORT_ATTRIBUTES# id="#REGION_STATIC_ID#_report" data-region-id="#REGION_STATIC_ID#">'
,p_row_template_after_rows=>wwv_flow_string.join(wwv_flow_t_varchar2(
'</ul>',
'<table class="t-Report-pagination" role="presentation">#PAGINATION#</table>'))
,p_row_template_type=>'NAMED_COLUMNS'
,p_row_template_display_cond1=>'NOT_CONDITIONAL'
,p_row_template_display_cond2=>'0'
,p_row_template_display_cond3=>'0'
,p_row_template_display_cond4=>'NOT_CONDITIONAL'
,p_pagination_template=>'<span class="t-Report-paginationText">#TEXT#</span>'
,p_next_page_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--next">',
' #PAGINATION_NEXT#<span class="a-Icon icon-right-arrow"></span>',
'</a>'))
,p_previous_page_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--prev">',
' <span class="a-Icon icon-left-arrow"></span>#PAGINATION_PREVIOUS#',
'</a>'))
,p_next_set_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--next">',
' #PAGINATION_NEXT_SET#<span class="a-Icon icon-right-arrow"></span>',
'</a>'))
,p_previous_set_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--prev">',
' <span class="a-Icon icon-left-arrow"></span>#PAGINATION_PREVIOUS_SET#',
'</a>'))
,p_theme_id=>42
,p_theme_class_id=>1
,p_default_template_options=>'t-MediaList--showDesc:t-MediaList--showIcons'
,p_preset_template_options=>'t-MediaList--stack'
,p_reference_id=>2092157460408299055
,p_translate_this_template=>'N'
,p_row_template_comment=>' (SELECT link_text, link_target, detail1, detail2, last_modified)'
);
end;
/
prompt --application/shared_components/user_interface/templates/report/timeline
begin
wwv_flow_api.create_row_template(
p_id=>wwv_flow_api.id(182785794129152129)
,p_row_template_name=>'Timeline'
,p_internal_name=>'TIMELINE'
,p_row_template1=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li class="t-Timeline-item #EVENT_MODIFIERS#" #EVENT_ATTRIBUTES#>',
' <div class="t-Timeline-wrap">',
' <div class="t-Timeline-user">',
' <div class="t-Timeline-avatar #USER_COLOR#">',
' #USER_AVATAR#',
' </div>',
' <div class="t-Timeline-userinfo">',
' <span class="t-Timeline-username">#USER_NAME#</span>',
' <span class="t-Timeline-date">#EVENT_DATE#</span>',
' </div>',
' </div>',
' <div class="t-Timeline-content">',
' <div class="t-Timeline-typeWrap">',
' <div class="t-Timeline-type #EVENT_STATUS#">',
' <span class="t-Icon #EVENT_ICON#"></span>',
' <span class="t-Timeline-typename">#EVENT_TYPE#</span>',
' </div>',
' </div>',
' <div class="t-Timeline-body">',
' <h3 class="t-Timeline-title">#EVENT_TITLE#</h3>',
' <p class="t-Timeline-desc">#EVENT_DESC#</p>',
' </div>',
' </div>',
' </div>',
'</li>'))
,p_row_template_condition1=>':EVENT_LINK is null'
,p_row_template2=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li class="t-Timeline-item #EVENT_MODIFIERS#" #EVENT_ATTRIBUTES#>',
' <a href="#EVENT_LINK#" class="t-Timeline-wrap">',
' <div class="t-Timeline-user">',
' <div class="t-Timeline-avatar #USER_COLOR#">',
' #USER_AVATAR#',
' </div>',
' <div class="t-Timeline-userinfo">',
' <span class="t-Timeline-username">#USER_NAME#</span>',
' <span class="t-Timeline-date">#EVENT_DATE#</span>',
' </div>',
' </div>',
' <div class="t-Timeline-content">',
' <div class="t-Timeline-typeWrap">',
' <div class="t-Timeline-type #EVENT_STATUS#">',
' <span class="t-Icon #EVENT_ICON#"></span>',
' <span class="t-Timeline-typename">#EVENT_TYPE#</span>',
' </div>',
' </div>',
' <div class="t-Timeline-body">',
' <h3 class="t-Timeline-title">#EVENT_TITLE#</h3>',
' <p class="t-Timeline-desc">#EVENT_DESC#</p>',
' </div>',
' </div>',
' </a>',
'</li>'))
,p_row_template_before_rows=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<ul class="t-Timeline #COMPONENT_CSS_CLASSES#" #REPORT_ATTRIBUTES# id="#REGION_STATIC_ID#_timeline" data-region-id="#REGION_STATIC_ID#">',
''))
,p_row_template_after_rows=>wwv_flow_string.join(wwv_flow_t_varchar2(
'</ul>',
'<table class="t-Report-pagination" role="presentation">#PAGINATION#</table>'))
,p_row_template_type=>'NAMED_COLUMNS'
,p_row_template_display_cond1=>'NOT_CONDITIONAL'
,p_row_template_display_cond2=>'0'
,p_row_template_display_cond3=>'0'
,p_row_template_display_cond4=>'NOT_CONDITIONAL'
,p_pagination_template=>'<span class="t-Report-paginationText">#TEXT#</span>'
,p_next_page_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--next">',
' #PAGINATION_NEXT#<span class="a-Icon icon-right-arrow"></span>',
'</a>'))
,p_previous_page_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--prev">',
' <span class="a-Icon icon-left-arrow"></span>#PAGINATION_PREVIOUS#',
'</a>'))
,p_next_set_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--next">',
' #PAGINATION_NEXT_SET#<span class="a-Icon icon-right-arrow"></span>',
'</a>'))
,p_previous_set_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--prev">',
' <span class="a-Icon icon-left-arrow"></span>#PAGINATION_PREVIOUS_SET#',
'</a>'))
,p_theme_id=>42
,p_theme_class_id=>7
,p_reference_id=>1513373588340069864
,p_translate_this_template=>'N'
);
end;
/
prompt --application/shared_components/user_interface/templates/report/content_row
begin
wwv_flow_api.create_row_template(
p_id=>wwv_flow_api.id(620306615375571554)
,p_row_template_name=>'Content Row'
,p_internal_name=>'CONTENT_ROW'
,p_row_template1=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li class="t-ContentRow-item #ITEM_CLASSES#">',
' <div class="t-ContentRow-wrap">',
' <div class="t-ContentRow-selection">#SELECTION#</div>',
' <div class="t-ContentRow-iconWrap">',
' <span class="t-ContentRow-icon #ICON_CLASS#">#ICON_HTML#</span>',
' </div>',
' <div class="t-ContentRow-body">',
' <div class="t-ContentRow-content">',
' <h3 class="t-ContentRow-title">#TITLE#</h3>',
' <div class="t-ContentRow-description">#DESCRIPTION#</div>',
' </div>',
' <div class="t-ContentRow-misc">#MISC#</div>',
' <div class="t-ContentRow-actions">#ACTIONS#</div>',
' </div>',
' </div>',
'</li>'))
,p_row_template_before_rows=>'<ul class="t-ContentRow #COMPONENT_CSS_CLASSES#" #REPORT_ATTRIBUTES# id="#REGION_STATIC_ID#_report" data-region-id="#REGION_STATIC_ID#">'
,p_row_template_after_rows=>wwv_flow_string.join(wwv_flow_t_varchar2(
'</ul>',
'<table class="t-Report-pagination" role="presentation">#PAGINATION#</table>'))
,p_row_template_type=>'NAMED_COLUMNS'
,p_row_template_display_cond1=>'0'
,p_row_template_display_cond2=>'0'
,p_row_template_display_cond3=>'0'
,p_row_template_display_cond4=>'0'
,p_pagination_template=>'<span class="t-Report-paginationText">#TEXT#</span>'
,p_next_page_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--next">',
' #PAGINATION_NEXT#<span class="a-Icon icon-right-arrow"></span>',
'</a>'))
,p_previous_page_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--prev">',
' <span class="a-Icon icon-left-arrow"></span>#PAGINATION_PREVIOUS#',
'</a>'))
,p_next_set_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--next">',
' #PAGINATION_NEXT_SET#<span class="a-Icon icon-right-arrow"></span>',
'</a>'))
,p_previous_set_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--prev">',
' <span class="a-Icon icon-left-arrow"></span>#PAGINATION_PREVIOUS_SET#',
'</a>'))
,p_theme_id=>42
,p_theme_class_id=>4
,p_reference_id=>1797843454948280151
,p_translate_this_template=>'N'
);
end;
/
prompt --application/shared_components/user_interface/templates/report/contextual_info
begin
wwv_flow_api.create_row_template(
p_id=>wwv_flow_api.id(804922099084800553)
,p_row_template_name=>'Contextual Info'
,p_internal_name=>'CONTEXTUAL_INFO'
,p_row_template1=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-ContextualInfo-item">',
' <span class="t-ContextualInfo-label">#COLUMN_HEADER#</span>',
' <span class="t-ContextualInfo-value">#COLUMN_VALUE#</span>',
'</div>'))
,p_row_template_before_rows=>' <div class="t-ContextualInfo #COMPONENT_CSS_CLASSES#" id="report_#REGION_STATIC_ID#" #REPORT_ATTRIBUTES# data-region-id="#REGION_STATIC_ID#">'
,p_row_template_after_rows=>wwv_flow_string.join(wwv_flow_t_varchar2(
'</div>',
'<table class="t-Report-pagination" role="presentation">#PAGINATION#</table>'))
,p_row_template_type=>'GENERIC_COLUMNS'
,p_row_template_display_cond1=>'0'
,p_row_template_display_cond2=>'0'
,p_row_template_display_cond3=>'0'
,p_row_template_display_cond4=>'0'
,p_pagination_template=>'<span class="t-Report-paginationText">#TEXT#</span>'
,p_next_page_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--next">',
' #PAGINATION_NEXT#<span class="a-Icon icon-right-arrow"></span>',
'</a>'))
,p_previous_page_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--prev">',
' <span class="a-Icon icon-left-arrow"></span>#PAGINATION_PREVIOUS#',
'</a>'))
,p_next_set_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--next">',
' #PAGINATION_NEXT_SET#<span class="a-Icon icon-right-arrow"></span>',
'</a>'))
,p_previous_set_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--prev">',
' <span class="a-Icon icon-left-arrow"></span>#PAGINATION_PREVIOUS_SET#',
'</a>'))
,p_theme_id=>42
,p_theme_class_id=>6
,p_reference_id=>2114325881116323585
,p_translate_this_template=>'N'
);
end;
/
prompt --application/shared_components/user_interface/templates/report/alerts
begin
wwv_flow_api.create_row_template(
p_id=>wwv_flow_api.id(1774863875195936505)
,p_row_template_name=>'Alerts'
,p_internal_name=>'ALERTS'
,p_row_template1=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Alert t-Alert--horizontal t-Alert--colorBG t-Alert--defaultIcons t-Alert--#ALERT_TYPE#" role="alert">',
' <div class="t-Alert-wrap">',
' <div class="t-Alert-icon">',
' <span class="t-Icon"></span>',
' </div>',
' <div class="t-Alert-content">',
' <div class="t-Alert-header">',
' <h2 class="t-Alert-title">#ALERT_TITLE#</h2>',
' </div>',
' <div class="t-Alert-body">',
' #ALERT_DESC#',
' </div>',
' </div>',
' <div class="t-Alert-buttons">',
' #ALERT_ACTION#',
' </div>',
' </div>',
'</div>'))
,p_row_template_before_rows=>'<div class="t-Alerts #COMPONENT_CSS_CLASSES#" #REPORT_ATTRIBUTES# id="#REGION_STATIC_ID#_alerts" data-region-id="#REGION_STATIC_ID#">'
,p_row_template_after_rows=>wwv_flow_string.join(wwv_flow_t_varchar2(
'</div>',
'<table class="t-Report-pagination" role="presentation">#PAGINATION#</table>'))
,p_row_template_type=>'NAMED_COLUMNS'
,p_row_template_display_cond1=>'0'
,p_row_template_display_cond2=>'0'
,p_row_template_display_cond3=>'0'
,p_row_template_display_cond4=>'0'
,p_pagination_template=>'<span class="t-Report-paginationText">#TEXT#</span>'
,p_next_page_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--next">',
' #PAGINATION_NEXT#<span class="a-Icon icon-right-arrow"></span>',
'</a>'))
,p_previous_page_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--prev">',
' <span class="a-Icon icon-left-arrow"></span>#PAGINATION_PREVIOUS#',
'</a>'))
,p_next_set_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--next">',
' #PAGINATION_NEXT_SET#<span class="a-Icon icon-right-arrow"></span>',
'</a>'))
,p_previous_set_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--prev">',
' <span class="a-Icon icon-left-arrow"></span>#PAGINATION_PREVIOUS_SET#',
'</a>'))
,p_theme_id=>42
,p_theme_class_id=>14
,p_reference_id=>2881456138952347027
,p_translate_this_template=>'N'
);
end;
/
prompt --application/shared_components/user_interface/templates/report/badge_list
begin
wwv_flow_api.create_row_template(
p_id=>wwv_flow_api.id(1774864081583936507)
,p_row_template_name=>'Badge List'
,p_internal_name=>'BADGE_LIST'
,p_row_template1=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li class="t-BadgeList-item">',
' <span class="t-BadgeList-wrap u-color">',
' <span class="t-BadgeList-label">#COLUMN_HEADER#</span>',
' <span class="t-BadgeList-value">#COLUMN_VALUE#</span>',
' </span>',
'</li>'))
,p_row_template_before_rows=>'<ul class="t-BadgeList #COMPONENT_CSS_CLASSES#" data-region-id="#REGION_STATIC_ID#">'
,p_row_template_after_rows=>wwv_flow_string.join(wwv_flow_t_varchar2(
'</ul>',
'<table class="t-Report-pagination" role="presentation">#PAGINATION#</table>'))
,p_row_template_type=>'GENERIC_COLUMNS'
,p_row_template_display_cond1=>'0'
,p_row_template_display_cond2=>'0'
,p_row_template_display_cond3=>'0'
,p_row_template_display_cond4=>'0'
,p_pagination_template=>'<span class="t-Report-paginationText">#TEXT#</span>'
,p_next_page_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--next">',
' #PAGINATION_NEXT#<span class="a-Icon icon-right-arrow"></span>',
'</a>'))
,p_previous_page_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--prev">',
' <span class="a-Icon icon-left-arrow"></span>#PAGINATION_PREVIOUS#',
'</a>'))
,p_next_set_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--next">',
' #PAGINATION_NEXT_SET#<span class="a-Icon icon-right-arrow"></span>',
'</a>'))
,p_previous_set_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--prev">',
' <span class="a-Icon icon-left-arrow"></span>#PAGINATION_PREVIOUS_SET#',
'</a>'))
,p_theme_id=>42
,p_theme_class_id=>6
,p_preset_template_options=>'t-BadgeList--large:t-BadgeList--fixed:t-BadgeList--circular'
,p_reference_id=>2103197159775914759
,p_translate_this_template=>'N'
);
end;
/
prompt --application/shared_components/user_interface/templates/report/cards
begin
wwv_flow_api.create_row_template(
p_id=>wwv_flow_api.id(1774866287250936513)
,p_row_template_name=>'Cards'
,p_internal_name=>'CARDS'
,p_row_template1=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li class="t-Cards-item #CARD_MODIFIERS#">',
' <div class="t-Card">',
' <a href="#CARD_LINK#" class="t-Card-wrap">',
' <div class="t-Card-icon u-color #CARD_COLOR#"><span class="t-Icon fa #CARD_ICON#"><span class="t-Card-initials" role="presentation">#CARD_INITIALS#</span></span></div>',
' <div class="t-Card-titleWrap"><h3 class="t-Card-title">#CARD_TITLE#</h3><h4 class="t-Card-subtitle">#CARD_SUBTITLE#</h4></div>',
' <div class="t-Card-body">',
' <div class="t-Card-desc">#CARD_TEXT#</div>',
' <div class="t-Card-info">#CARD_SUBTEXT#</div>',
' </div>',
' <span class="t-Card-colorFill u-color #CARD_COLOR#"></span>',
' </a>',
' </div>',
'</li>'))
,p_row_template_condition1=>':CARD_LINK is not null'
,p_row_template2=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li class="t-Cards-item #CARD_MODIFIERS#">',
' <div class="t-Card">',
' <div class="t-Card-wrap">',
' <div class="t-Card-icon u-color #CARD_COLOR#"><span class="t-Icon fa #CARD_ICON#"><span class="t-Card-initials" role="presentation">#CARD_INITIALS#</span></span></div>',
' <div class="t-Card-titleWrap"><h3 class="t-Card-title">#CARD_TITLE#</h3><h4 class="t-Card-subtitle">#CARD_SUBTITLE#</h4></div>',
' <div class="t-Card-body">',
' <div class="t-Card-desc">#CARD_TEXT#</div>',
' <div class="t-Card-info">#CARD_SUBTEXT#</div>',
' </div>',
' <span class="t-Card-colorFill u-color #CARD_COLOR#"></span>',
' </div>',
' </div>',
'</li>'))
,p_row_template_before_rows=>'<ul class="t-Cards #COMPONENT_CSS_CLASSES#" #REPORT_ATTRIBUTES# id="#REGION_STATIC_ID#_cards" data-region-id="#REGION_STATIC_ID#">'
,p_row_template_after_rows=>wwv_flow_string.join(wwv_flow_t_varchar2(
'</ul>',
'<table class="t-Report-pagination" role="presentation">#PAGINATION#</table>'))
,p_row_template_type=>'NAMED_COLUMNS'
,p_row_template_display_cond1=>'NOT_CONDITIONAL'
,p_row_template_display_cond2=>'0'
,p_row_template_display_cond3=>'0'
,p_row_template_display_cond4=>'NOT_CONDITIONAL'
,p_pagination_template=>'<span class="t-Report-paginationText">#TEXT#</span>'
,p_next_page_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--next">',
' #PAGINATION_NEXT#<span class="a-Icon icon-right-arrow"></span>',
'</a>'))
,p_previous_page_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--prev">',
' <span class="a-Icon icon-left-arrow"></span>#PAGINATION_PREVIOUS#',
'</a>'))
,p_next_set_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--next">',
' #PAGINATION_NEXT_SET#<span class="a-Icon icon-right-arrow"></span>',
'</a>'))
,p_previous_set_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--prev">',
' <span class="a-Icon icon-left-arrow"></span>#PAGINATION_PREVIOUS_SET#',
'</a>'))
,p_theme_id=>42
,p_theme_class_id=>7
,p_preset_template_options=>'t-Cards--animColorFill:t-Cards--3cols:t-Cards--basic'
,p_reference_id=>2973535649510699732
,p_translate_this_template=>'N'
);
end;
/
prompt --application/shared_components/user_interface/templates/report/comments
begin
wwv_flow_api.create_row_template(
p_id=>wwv_flow_api.id(1774868688704936519)
,p_row_template_name=>'Comments'
,p_internal_name=>'COMMENTS'
,p_row_template1=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li class="t-Comments-item #COMMENT_MODIFIERS#">',
' <div class="t-Comments-icon">',
' <div class="t-Comments-userIcon #ICON_MODIFIER#" aria-hidden="true">#USER_ICON#</div>',
' </div>',
' <div class="t-Comments-body">',
' <div class="t-Comments-info">',
' #USER_NAME# <span class="t-Comments-date">#COMMENT_DATE#</span> <span class="t-Comments-actions">#ACTIONS#</span>',
' </div>',
' <div class="t-Comments-comment">',
' #COMMENT_TEXT##ATTRIBUTE_1##ATTRIBUTE_2##ATTRIBUTE_3##ATTRIBUTE_4#',
' </div>',
' </div>',
'</li>'))
,p_row_template_before_rows=>'<ul class="t-Comments #COMPONENT_CSS_CLASSES#" #REPORT_ATTRIBUTES# id="#REGION_STATIC_ID#_report" data-region-id="#REGION_STATIC_ID#">'
,p_row_template_after_rows=>wwv_flow_string.join(wwv_flow_t_varchar2(
'</ul>',
'<table class="t-Report-pagination" role="presentation">#PAGINATION#</table>'))
,p_row_template_type=>'NAMED_COLUMNS'
,p_row_template_display_cond1=>'0'
,p_row_template_display_cond2=>'NOT_CONDITIONAL'
,p_row_template_display_cond3=>'0'
,p_row_template_display_cond4=>'0'
,p_pagination_template=>'<span class="t-Report-paginationText">#TEXT#</span>'
,p_next_page_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--next">',
' #PAGINATION_NEXT#<span class="a-Icon icon-right-arrow"></span>',
'</a>'))
,p_previous_page_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--prev">',
' <span class="a-Icon icon-left-arrow"></span>#PAGINATION_PREVIOUS#',
'</a>'))
,p_next_set_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--next">',
' #PAGINATION_NEXT_SET#<span class="a-Icon icon-right-arrow"></span>',
'</a>',
''))
,p_previous_set_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--prev">',
' <span class="a-Icon icon-left-arrow"></span>#PAGINATION_PREVIOUS_SET#',
'</a>'))
,p_theme_id=>42
,p_theme_class_id=>7
,p_preset_template_options=>'t-Comments--chat'
,p_reference_id=>2611722012730764232
,p_translate_this_template=>'N'
);
end;
/
prompt --application/shared_components/user_interface/templates/report/search_results
begin
wwv_flow_api.create_row_template(
p_id=>wwv_flow_api.id(1774869287131936525)
,p_row_template_name=>'Search Results'
,p_internal_name=>'SEARCH_RESULTS'
,p_row_template1=>wwv_flow_string.join(wwv_flow_t_varchar2(
' <li class="t-SearchResults-item">',
' <h3 class="t-SearchResults-title"><a href="#SEARCH_LINK#">#SEARCH_TITLE#</a></h3>',
' <div class="t-SearchResults-info">',
' <p class="t-SearchResults-desc">#SEARCH_DESC#</p>',
' <span class="t-SearchResults-misc">#LABEL_01#: #VALUE_01#</span>',
' </div>',
' </li>'))
,p_row_template_condition1=>':LABEL_02 is null'
,p_row_template2=>wwv_flow_string.join(wwv_flow_t_varchar2(
' <li class="t-SearchResults-item">',
' <h3 class="t-SearchResults-title"><a href="#SEARCH_LINK#">#SEARCH_TITLE#</a></h3>',
' <div class="t-SearchResults-info">',
' <p class="t-SearchResults-desc">#SEARCH_DESC#</p>',
' <span class="t-SearchResults-misc">#LABEL_01#: #VALUE_01#</span>',
' <span class="t-SearchResults-misc">#LABEL_02#: #VALUE_02#</span>',
' </div>',
' </li>'))
,p_row_template_condition2=>':LABEL_03 is null'
,p_row_template3=>wwv_flow_string.join(wwv_flow_t_varchar2(
' <li class="t-SearchResults-item">',
' <h3 class="t-SearchResults-title"><a href="#SEARCH_LINK#">#SEARCH_TITLE#</a></h3>',
' <div class="t-SearchResults-info">',
' <p class="t-SearchResults-desc">#SEARCH_DESC#</p>',
' <span class="t-SearchResults-misc">#LABEL_01#: #VALUE_01#</span>',
' <span class="t-SearchResults-misc">#LABEL_02#: #VALUE_02#</span>',
' <span class="t-SearchResults-misc">#LABEL_03#: #VALUE_03#</span>',
' </div>',
' </li>'))
,p_row_template_condition3=>':LABEL_04 is null'
,p_row_template4=>wwv_flow_string.join(wwv_flow_t_varchar2(
' <li class="t-SearchResults-item">',
' <h3 class="t-SearchResults-title"><a href="#SEARCH_LINK#">#SEARCH_TITLE#</a></h3>',
' <div class="t-SearchResults-info">',
' <p class="t-SearchResults-desc">#SEARCH_DESC#</p>',
' <span class="t-SearchResults-misc">#LABEL_01#: #VALUE_01#</span>',
' <span class="t-SearchResults-misc">#LABEL_02#: #VALUE_02#</span>',
' <span class="t-SearchResults-misc">#LABEL_03#: #VALUE_03#</span>',
' <span class="t-SearchResults-misc">#LABEL_04#: #VALUE_04#</span>',
' </div>',
' </li>'))
,p_row_template_before_rows=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-SearchResults #COMPONENT_CSS_CLASSES#" #REPORT_ATTRIBUTES# id="#REGION_STATIC_ID#_report" data-region-id="#REGION_STATIC_ID#">',
'<ul class="t-SearchResults-list">'))
,p_row_template_after_rows=>wwv_flow_string.join(wwv_flow_t_varchar2(
'</ul>',
'<table class="t-Report-pagination" role="presentation">#PAGINATION#</table>',
'</div>'))
,p_row_template_type=>'NAMED_COLUMNS'
,p_row_template_display_cond1=>'NOT_CONDITIONAL'
,p_row_template_display_cond2=>'NOT_CONDITIONAL'
,p_row_template_display_cond3=>'NOT_CONDITIONAL'
,p_row_template_display_cond4=>'NOT_CONDITIONAL'
,p_pagination_template=>'<span class="t-Report-paginationText">#TEXT#</span>'
,p_next_page_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--next">',
' #PAGINATION_NEXT#<span class="a-Icon icon-right-arrow"></span>',
'</a>'))
,p_previous_page_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--prev">',
' <span class="a-Icon icon-left-arrow"></span>#PAGINATION_PREVIOUS#',
'</a>'))
,p_next_set_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--next">',
' #PAGINATION_NEXT_SET#<span class="a-Icon icon-right-arrow"></span>',
'</a>'))
,p_previous_set_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--prev">',
' <span class="a-Icon icon-left-arrow"></span>#PAGINATION_PREVIOUS_SET#',
'</a>'))
,p_theme_id=>42
,p_theme_class_id=>1
,p_reference_id=>4070913431524059316
,p_translate_this_template=>'N'
,p_row_template_comment=>' (SELECT link_text, link_target, detail1, detail2, last_modified)'
);
end;
/
prompt --application/shared_components/user_interface/templates/report/standard
begin
wwv_flow_api.create_row_template(
p_id=>wwv_flow_api.id(1774869560539936527)
,p_row_template_name=>'Standard'
,p_internal_name=>'STANDARD'
,p_row_template1=>'<td class="t-Report-cell" #ALIGNMENT# headers="#COLUMN_HEADER_NAME#">#COLUMN_VALUE#</td>'
,p_row_template_before_rows=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Report #COMPONENT_CSS_CLASSES#" id="report_#REGION_STATIC_ID#" #REPORT_ATTRIBUTES# data-region-id="#REGION_STATIC_ID#">',
' <div class="t-Report-wrap">',
' <table class="t-Report-pagination" role="presentation">#TOP_PAGINATION#</table>',
' <div class="t-Report-tableWrap">',
' <table class="t-Report-report" id="report_table_#REGION_STATIC_ID#" aria-label="#REGION_TITLE#">'))
,p_row_template_after_rows=>wwv_flow_string.join(wwv_flow_t_varchar2(
' </tbody>',
' </table>',
' </div>',
' <div class="t-Report-links">#EXTERNAL_LINK##CSV_LINK#</div>',
' <table class="t-Report-pagination t-Report-pagination--bottom" role="presentation">#PAGINATION#</table>',
' </div>',
'</div>'))
,p_row_template_type=>'GENERIC_COLUMNS'
,p_before_column_heading=>'<thead>'
,p_column_heading_template=>'<th class="t-Report-colHead" #ALIGNMENT# id="#COLUMN_HEADER_NAME#" #COLUMN_WIDTH#>#COLUMN_HEADER#</th>'
,p_after_column_heading=>wwv_flow_string.join(wwv_flow_t_varchar2(
'</thead>',
'<tbody>'))
,p_row_template_display_cond1=>'0'
,p_row_template_display_cond2=>'0'
,p_row_template_display_cond3=>'0'
,p_row_template_display_cond4=>'0'
,p_pagination_template=>'<span class="t-Report-paginationText">#TEXT#</span>'
,p_next_page_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--next">',
' #PAGINATION_NEXT#<span class="a-Icon icon-right-arrow"></span>',
'</a>'))
,p_previous_page_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--prev">',
' <span class="a-Icon icon-left-arrow"></span>#PAGINATION_PREVIOUS#',
'</a>'))
,p_next_set_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--next">',
' #PAGINATION_NEXT_SET#<span class="a-Icon icon-right-arrow"></span>',
'</a>'))
,p_previous_set_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--prev">',
' <span class="a-Icon icon-left-arrow"></span>#PAGINATION_PREVIOUS_SET#',
'</a>'))
,p_theme_id=>42
,p_theme_class_id=>4
,p_preset_template_options=>'t-Report--altRowsDefault:t-Report--rowHighlight'
,p_reference_id=>2537207537838287671
,p_translate_this_template=>'N'
);
begin
wwv_flow_api.create_row_template_patch(
p_id=>wwv_flow_api.id(1774869560539936527)
,p_row_template_before_first=>'<tr>'
,p_row_template_after_last=>'</tr>'
);
exception when others then null;
end;
end;
/
prompt --application/shared_components/user_interface/templates/report/value_attribute_pairs_column
begin
wwv_flow_api.create_row_template(
p_id=>wwv_flow_api.id(1774871265928936531)
,p_row_template_name=>'Value Attribute Pairs - Column'
,p_internal_name=>'VALUE_ATTRIBUTE_PAIRS_COLUMN'
,p_row_template1=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<dt class="t-AVPList-label">',
' #COLUMN_HEADER#',
'</dt>',
'<dd class="t-AVPList-value">',
' #COLUMN_VALUE#',
'</dd>'))
,p_row_template_before_rows=>'<dl class="t-AVPList #COMPONENT_CSS_CLASSES#" #REPORT_ATTRIBUTES# data-region-id="#REGION_STATIC_ID#">'
,p_row_template_after_rows=>wwv_flow_string.join(wwv_flow_t_varchar2(
'</dl>',
'<table class="t-Report-pagination" role="presentation">#PAGINATION#</table>'))
,p_row_template_type=>'GENERIC_COLUMNS'
,p_row_template_display_cond1=>'0'
,p_row_template_display_cond2=>'0'
,p_row_template_display_cond3=>'0'
,p_row_template_display_cond4=>'0'
,p_pagination_template=>'<span class="t-Report-paginationText">#TEXT#</span>'
,p_next_page_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--next">',
' #PAGINATION_NEXT#<span class="a-Icon icon-right-arrow"></span>',
'</a>'))
,p_previous_page_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--prev">',
' <span class="a-Icon icon-left-arrow"></span>#PAGINATION_PREVIOUS#',
'</a>'))
,p_next_set_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--next">',
' #PAGINATION_NEXT_SET#<span class="a-Icon icon-right-arrow"></span>',
'</a>'))
,p_previous_set_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--prev">',
' <span class="a-Icon icon-left-arrow"></span>#PAGINATION_PREVIOUS_SET#',
'</a>'))
,p_theme_id=>42
,p_theme_class_id=>6
,p_preset_template_options=>'t-AVPList--leftAligned'
,p_reference_id=>2099068636272681754
,p_translate_this_template=>'N'
);
end;
/
prompt --application/shared_components/user_interface/templates/report/value_attribute_pairs_row
begin
wwv_flow_api.create_row_template(
p_id=>wwv_flow_api.id(1774872379547936533)
,p_row_template_name=>'Value Attribute Pairs - Row'
,p_internal_name=>'VALUE_ATTRIBUTE_PAIRS_ROW'
,p_row_template1=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<dt class="t-AVPList-label">',
' #1#',
'</dt>',
'<dd class="t-AVPList-value">',
' #2#',
'</dd>'))
,p_row_template_before_rows=>'<dl class="t-AVPList #COMPONENT_CSS_CLASSES#" #REPORT_ATTRIBUTES# id="report_#REGION_STATIC_ID#" data-region-id="#REGION_STATIC_ID#">'
,p_row_template_after_rows=>wwv_flow_string.join(wwv_flow_t_varchar2(
'</dl>',
'<table class="t-Report-pagination" role="presentation">#PAGINATION#</table>'))
,p_row_template_type=>'NAMED_COLUMNS'
,p_row_template_display_cond1=>'0'
,p_row_template_display_cond2=>'0'
,p_row_template_display_cond3=>'0'
,p_row_template_display_cond4=>'0'
,p_pagination_template=>'<span class="t-Report-paginationText">#TEXT#</span>'
,p_next_page_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--next">',
' #PAGINATION_NEXT#<span class="a-Icon icon-right-arrow"></span>',
'</a>'))
,p_previous_page_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--prev">',
' <span class="a-Icon icon-left-arrow"></span>#PAGINATION_PREVIOUS#',
'</a>'))
,p_next_set_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--next">',
' #PAGINATION_NEXT_SET#<span class="a-Icon icon-right-arrow"></span>',
'</a>'))
,p_previous_set_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<a href="#LINK#" class="t-Button t-Button--small t-Button--noUI t-Report-paginationLink t-Report-paginationLink--prev">',
' <span class="a-Icon icon-left-arrow"></span>#PAGINATION_PREVIOUS_SET#',
'</a>'))
,p_theme_id=>42
,p_theme_class_id=>7
,p_preset_template_options=>'t-AVPList--leftAligned'
,p_reference_id=>2099068321678681753
,p_translate_this_template=>'N'
);
end;
/
prompt --application/shared_components/user_interface/templates/label/required_floating
begin
wwv_flow_api.create_field_template(
p_id=>wwv_flow_api.id(274822744073356429)
,p_template_name=>'Required - Floating'
,p_internal_name=>'REQUIRED_FLOATING'
,p_template_body1=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Form-labelContainer">',
' <label for="#CURRENT_ITEM_NAME#" id="#LABEL_ID#" class="t-Form-label">'))
,p_template_body2=>wwv_flow_string.join(wwv_flow_t_varchar2(
' <span class="u-VisuallyHidden">(#VALUE_REQUIRED#)</span></label>',
'</div>'))
,p_before_item=>'<div class="t-Form-fieldContainer t-Form-fieldContainer--floatingLabel is-required #ITEM_CSS_CLASSES#" id="#CURRENT_ITEM_CONTAINER_ID#">'
,p_after_item=>'</div>'
,p_item_pre_text=>'<span class="t-Form-itemText t-Form-itemText--pre">#CURRENT_ITEM_PRE_TEXT#</span>'
,p_item_post_text=>'<span class="t-Form-itemText t-Form-itemText--post">#CURRENT_ITEM_POST_TEXT#</span>'
,p_before_element=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Form-inputContainer">',
' <div class="t-Form-itemWrapper">#ITEM_PRE_TEXT#'))
,p_after_element=>wwv_flow_string.join(wwv_flow_t_varchar2(
'#ITEM_POST_TEXT##HELP_TEMPLATE#',
' </div>',
' <div class="t-Form-itemAssistance">',
' #ERROR_TEMPLATE#',
' <div class="t-Form-itemRequired" aria-hidden="true">#REQUIRED#</div>',
' </div>',
' #INLINE_HELP_TEMPLATE#',
'</div>'))
,p_help_link=>'<button class="t-Form-helpButton js-itemHelp" data-itemhelp="#CURRENT_ITEM_ID#" title="#CURRENT_ITEM_HELP_LABEL#" aria-label="#CURRENT_ITEM_HELP_LABEL#" tabindex="-1" type="button"><span class="a-Icon icon-help" aria-hidden="true"></span></button>'
,p_inline_help_text=>'<div class="t-Form-inlineHelp">#CURRENT_ITEM_INLINE_HELP_TEXT#</div>'
,p_error_template=>'<div class="t-Form-error">#ERROR_MESSAGE#</div>'
,p_theme_id=>42
,p_theme_class_id=>4
,p_reference_id=>1607675344320152883
,p_translate_this_template=>'N'
);
end;
/
prompt --application/shared_components/user_interface/templates/label/optional_floating
begin
wwv_flow_api.create_field_template(
p_id=>wwv_flow_api.id(274823059345356429)
,p_template_name=>'Optional - Floating'
,p_internal_name=>'OPTIONAL_FLOATING'
,p_template_body1=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Form-labelContainer">',
'<label for="#CURRENT_ITEM_NAME#" id="#LABEL_ID#" class="t-Form-label">'))
,p_template_body2=>wwv_flow_string.join(wwv_flow_t_varchar2(
'</label>',
'</div>'))
,p_before_item=>'<div class="t-Form-fieldContainer t-Form-fieldContainer--floatingLabel #ITEM_CSS_CLASSES#" id="#CURRENT_ITEM_CONTAINER_ID#">'
,p_after_item=>'</div>'
,p_item_pre_text=>'<span class="t-Form-itemText t-Form-itemText--pre">#CURRENT_ITEM_PRE_TEXT#</span>'
,p_item_post_text=>'<span class="t-Form-itemText t-Form-itemText--post">#CURRENT_ITEM_POST_TEXT#</span>'
,p_before_element=>'<div class="t-Form-inputContainer"><div class="t-Form-itemWrapper">#ITEM_PRE_TEXT#'
,p_after_element=>'#ITEM_POST_TEXT##HELP_TEMPLATE#</div>#INLINE_HELP_TEMPLATE##ERROR_TEMPLATE#</div>'
,p_help_link=>'<button class="t-Form-helpButton js-itemHelp" data-itemhelp="#CURRENT_ITEM_ID#" title="#CURRENT_ITEM_HELP_LABEL#" aria-label="#CURRENT_ITEM_HELP_LABEL#" tabindex="-1" type="button"><span class="a-Icon icon-help" aria-hidden="true"></span></button>'
,p_inline_help_text=>'<span class="t-Form-inlineHelp">#CURRENT_ITEM_INLINE_HELP_TEXT#</span>'
,p_error_template=>'<span class="t-Form-error">#ERROR_MESSAGE#</span>'
,p_theme_id=>42
,p_theme_class_id=>3
,p_reference_id=>1607675164727151865
,p_translate_this_template=>'N'
);
end;
/
prompt --application/shared_components/user_interface/templates/label/hidden
begin
wwv_flow_api.create_field_template(
p_id=>wwv_flow_api.id(1774881796850936565)
,p_template_name=>'Hidden'
,p_internal_name=>'HIDDEN'
,p_template_body1=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Form-labelContainer t-Form-labelContainer--hiddenLabel col col-#LABEL_COLUMN_SPAN_NUMBER#">',
'<label for="#CURRENT_ITEM_NAME#" id="#LABEL_ID#" class="t-Form-label u-VisuallyHidden">'))
,p_template_body2=>wwv_flow_string.join(wwv_flow_t_varchar2(
'</label>',
'</div>'))
,p_before_item=>'<div class="t-Form-fieldContainer t-Form-fieldContainer--hiddenLabel rel-col #ITEM_CSS_CLASSES#" id="#CURRENT_ITEM_CONTAINER_ID#">'
,p_after_item=>'</div>'
,p_item_pre_text=>'<span class="t-Form-itemText t-Form-itemText--pre">#CURRENT_ITEM_PRE_TEXT#</span>'
,p_item_post_text=>'<span class="t-Form-itemText t-Form-itemText--post">#CURRENT_ITEM_POST_TEXT#</span>'
,p_before_element=>'<div class="t-Form-inputContainer col col-#ITEM_COLUMN_SPAN_NUMBER#"><div class="t-Form-itemWrapper">#ITEM_PRE_TEXT#'
,p_after_element=>'#ITEM_POST_TEXT##HELP_TEMPLATE#</div>#INLINE_HELP_TEMPLATE##ERROR_TEMPLATE#</div>'
,p_help_link=>'<button class="t-Form-helpButton js-itemHelp" data-itemhelp="#CURRENT_ITEM_ID#" title="#CURRENT_ITEM_HELP_LABEL#" aria-label="#CURRENT_ITEM_HELP_LABEL#" tabindex="-1" type="button"><span class="a-Icon icon-help" aria-hidden="true"></span></button>'
,p_inline_help_text=>'<span class="t-Form-inlineHelp">#CURRENT_ITEM_INLINE_HELP_TEXT#</span>'
,p_error_template=>'<span class="t-Form-error">#ERROR_MESSAGE#</span>'
,p_theme_id=>42
,p_theme_class_id=>13
,p_reference_id=>2039339104148359505
,p_translate_this_template=>'N'
);
end;
/
prompt --application/shared_components/user_interface/templates/label/optional
begin
wwv_flow_api.create_field_template(
p_id=>wwv_flow_api.id(1774882198755936568)
,p_template_name=>'Optional'
,p_internal_name=>'OPTIONAL'
,p_template_body1=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Form-labelContainer col col-#LABEL_COLUMN_SPAN_NUMBER#">',
'<label for="#CURRENT_ITEM_NAME#" id="#LABEL_ID#" class="t-Form-label">'))
,p_template_body2=>wwv_flow_string.join(wwv_flow_t_varchar2(
'</label>',
'</div>',
''))
,p_before_item=>'<div class="t-Form-fieldContainer rel-col #ITEM_CSS_CLASSES#" id="#CURRENT_ITEM_CONTAINER_ID#">'
,p_after_item=>'</div>'
,p_item_pre_text=>'<span class="t-Form-itemText t-Form-itemText--pre">#CURRENT_ITEM_PRE_TEXT#</span>'
,p_item_post_text=>'<span class="t-Form-itemText t-Form-itemText--post">#CURRENT_ITEM_POST_TEXT#</span>'
,p_before_element=>'<div class="t-Form-inputContainer col col-#ITEM_COLUMN_SPAN_NUMBER#"><div class="t-Form-itemWrapper">#ITEM_PRE_TEXT#'
,p_after_element=>'#ITEM_POST_TEXT##HELP_TEMPLATE#</div>#INLINE_HELP_TEMPLATE##ERROR_TEMPLATE#</div>'
,p_help_link=>'<button class="t-Form-helpButton js-itemHelp" data-itemhelp="#CURRENT_ITEM_ID#" title="#CURRENT_ITEM_HELP_LABEL#" aria-label="#CURRENT_ITEM_HELP_LABEL#" tabindex="-1" type="button"><span class="a-Icon icon-help" aria-hidden="true"></span></button>'
,p_inline_help_text=>'<span class="t-Form-inlineHelp">#CURRENT_ITEM_INLINE_HELP_TEXT#</span>'
,p_error_template=>'<span class="t-Form-error">#ERROR_MESSAGE#</span>'
,p_theme_id=>42
,p_theme_class_id=>3
,p_reference_id=>2317154212072806530
,p_translate_this_template=>'N'
);
end;
/
prompt --application/shared_components/user_interface/templates/label/optional_above
begin
wwv_flow_api.create_field_template(
p_id=>wwv_flow_api.id(1774882318212936569)
,p_template_name=>'Optional - Above'
,p_internal_name=>'OPTIONAL_ABOVE'
,p_template_body1=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Form-labelContainer">',
'<label for="#CURRENT_ITEM_NAME#" id="#LABEL_ID#" class="t-Form-label">'))
,p_template_body2=>wwv_flow_string.join(wwv_flow_t_varchar2(
'</label>#HELP_TEMPLATE#',
'</div>'))
,p_before_item=>'<div class="t-Form-fieldContainer t-Form-fieldContainer--stacked #ITEM_CSS_CLASSES#" id="#CURRENT_ITEM_CONTAINER_ID#">'
,p_after_item=>'</div>'
,p_item_pre_text=>'<span class="t-Form-itemText t-Form-itemText--pre">#CURRENT_ITEM_PRE_TEXT#</span>'
,p_item_post_text=>'<span class="t-Form-itemText t-Form-itemText--post">#CURRENT_ITEM_POST_TEXT#</span>'
,p_before_element=>'<div class="t-Form-inputContainer"><div class="t-Form-itemWrapper">#ITEM_PRE_TEXT#'
,p_after_element=>'#ITEM_POST_TEXT#</div>#INLINE_HELP_TEMPLATE##ERROR_TEMPLATE#</div>'
,p_help_link=>'<button class="t-Form-helpButton js-itemHelp" data-itemhelp="#CURRENT_ITEM_ID#" title="#CURRENT_ITEM_HELP_LABEL#" aria-label="#CURRENT_ITEM_HELP_LABEL#" tabindex="-1" type="button"><span class="a-Icon icon-help" aria-hidden="true"></span></button>'
,p_inline_help_text=>'<span class="t-Form-inlineHelp">#CURRENT_ITEM_INLINE_HELP_TEXT#</span>'
,p_error_template=>'<span class="t-Form-error">#ERROR_MESSAGE#</span>'
,p_theme_id=>42
,p_theme_class_id=>3
,p_reference_id=>3030114864004968404
,p_translate_this_template=>'N'
);
end;
/
prompt --application/shared_components/user_interface/templates/label/required
begin
wwv_flow_api.create_field_template(
p_id=>wwv_flow_api.id(1774882441270936571)
,p_template_name=>'Required'
,p_internal_name=>'REQUIRED'
,p_template_body1=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Form-labelContainer col col-#LABEL_COLUMN_SPAN_NUMBER#">',
' <label for="#CURRENT_ITEM_NAME#" id="#LABEL_ID#" class="t-Form-label">'))
,p_template_body2=>wwv_flow_string.join(wwv_flow_t_varchar2(
' <span class="u-VisuallyHidden">(#VALUE_REQUIRED#)</span></label>',
'</div>'))
,p_before_item=>'<div class="t-Form-fieldContainer is-required rel-col #ITEM_CSS_CLASSES#" id="#CURRENT_ITEM_CONTAINER_ID#">'
,p_after_item=>'</div>'
,p_item_pre_text=>'<span class="t-Form-itemText t-Form-itemText--pre">#CURRENT_ITEM_PRE_TEXT#</span>'
,p_item_post_text=>'<span class="t-Form-itemText t-Form-itemText--post">#CURRENT_ITEM_POST_TEXT#</span>'
,p_before_element=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Form-inputContainer col col-#ITEM_COLUMN_SPAN_NUMBER#">',
' <div class="t-Form-itemWrapper">#ITEM_PRE_TEXT#'))
,p_after_element=>wwv_flow_string.join(wwv_flow_t_varchar2(
'#ITEM_POST_TEXT##HELP_TEMPLATE#',
' </div>',
' <div class="t-Form-itemAssistance">',
' #ERROR_TEMPLATE#',
' <div class="t-Form-itemRequired" aria-hidden="true">#REQUIRED#</div>',
' </div>',
' #INLINE_HELP_TEMPLATE#',
'</div>'))
,p_help_link=>'<button class="t-Form-helpButton js-itemHelp" data-itemhelp="#CURRENT_ITEM_ID#" title="#CURRENT_ITEM_HELP_LABEL#" aria-label="#CURRENT_ITEM_HELP_LABEL#" tabindex="-1" type="button"><span class="a-Icon icon-help" aria-hidden="true"></span></button>'
,p_inline_help_text=>'<div class="t-Form-inlineHelp">#CURRENT_ITEM_INLINE_HELP_TEXT#</div>'
,p_error_template=>'<div class="t-Form-error">#ERROR_MESSAGE#</div>'
,p_theme_id=>42
,p_theme_class_id=>4
,p_reference_id=>2525313812251712801
,p_translate_this_template=>'N'
);
end;
/
prompt --application/shared_components/user_interface/templates/label/required_above
begin
wwv_flow_api.create_field_template(
p_id=>wwv_flow_api.id(1774882542426936574)
,p_template_name=>'Required - Above'
,p_internal_name=>'REQUIRED_ABOVE'
,p_template_body1=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Form-labelContainer">',
' <label for="#CURRENT_ITEM_NAME#" id="#LABEL_ID#" class="t-Form-label">'))
,p_template_body2=>wwv_flow_string.join(wwv_flow_t_varchar2(
' <span class="u-VisuallyHidden">(#VALUE_REQUIRED#)</span></label> #HELP_TEMPLATE#',
'</div>'))
,p_before_item=>'<div class="t-Form-fieldContainer t-Form-fieldContainer--stacked is-required #ITEM_CSS_CLASSES#" id="#CURRENT_ITEM_CONTAINER_ID#">'
,p_after_item=>'</div>'
,p_item_pre_text=>'<span class="t-Form-itemText t-Form-itemText--pre">#CURRENT_ITEM_PRE_TEXT#</span>'
,p_item_post_text=>'<span class="t-Form-itemText t-Form-itemText--post">#CURRENT_ITEM_POST_TEXT#</span>'
,p_before_element=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-Form-inputContainer">',
' <div class="t-Form-itemWrapper">#ITEM_PRE_TEXT#'))
,p_after_element=>wwv_flow_string.join(wwv_flow_t_varchar2(
'#ITEM_POST_TEXT##HELP_TEMPLATE#',
' </div>',
' <div class="t-Form-itemAssistance">',
' #ERROR_TEMPLATE#',
' <div class="t-Form-itemRequired" aria-hidden="true">#REQUIRED#</div>',
' </div>',
' #INLINE_HELP_TEMPLATE#',
'</div>'))
,p_help_link=>'<button class="t-Form-helpButton js-itemHelp" data-itemhelp="#CURRENT_ITEM_ID#" title="#CURRENT_ITEM_HELP_LABEL#" aria-label="#CURRENT_ITEM_HELP_LABEL#" tabindex="-1" type="button"><span class="a-Icon icon-help" aria-hidden="true"></span></button>'
,p_inline_help_text=>'<div class="t-Form-inlineHelp">#CURRENT_ITEM_INLINE_HELP_TEXT#</div>'
,p_error_template=>'<div class="t-Form-error">#ERROR_MESSAGE#</div>'
,p_theme_id=>42
,p_theme_class_id=>4
,p_reference_id=>3030115129444970113
,p_translate_this_template=>'N'
);
end;
/
prompt --application/shared_components/user_interface/templates/breadcrumb/breadcrumb
begin
wwv_flow_api.create_menu_template(
p_id=>wwv_flow_api.id(1774883299498936583)
,p_name=>'Breadcrumb'
,p_internal_name=>'BREADCRUMB'
,p_before_first=>'<ul class="t-Breadcrumb #COMPONENT_CSS_CLASSES#">'
,p_current_page_option=>'<li class="t-Breadcrumb-item is-active"><h1 class="t-Breadcrumb-label">#NAME#</h1></li>'
,p_non_current_page_option=>'<li class="t-Breadcrumb-item"><a href="#LINK#" class="t-Breadcrumb-label">#NAME#</a></li>'
,p_after_last=>'</ul>'
,p_max_levels=>6
,p_start_with_node=>'PARENT_TO_LEAF'
,p_theme_id=>42
,p_theme_class_id=>1
,p_reference_id=>4070916542570059325
,p_translate_this_template=>'N'
);
end;
/
prompt --application/shared_components/user_interface/templates/popuplov
begin
wwv_flow_api.create_popup_lov_template(
p_id=>wwv_flow_api.id(1774883512547936586)
,p_page_name=>'winlov'
,p_page_title=>'Search Dialog'
,p_page_html_head=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<!DOCTYPE html>',
'<html lang="&BROWSER_LANGUAGE.">',
'<head>',
'<title>#TITLE#</title>',
'#APEX_CSS#',
'#THEME_CSS#',
'#THEME_STYLE_CSS#',
'#FAVICONS#',
'#APEX_JAVASCRIPT#',
'#THEME_JAVASCRIPT#',
'<meta name="viewport" content="width=device-width,initial-scale=1.0" />',
'</head>'))
,p_page_body_attr=>'onload="first_field()" class="t-Page t-Page--popupLOV"'
,p_before_field_text=>'<div class="t-PopupLOV-actions t-Form--large">'
,p_filter_width=>'20'
,p_filter_max_width=>'100'
,p_filter_text_attr=>'class="apex-item-text"'
,p_find_button_text=>'Search'
,p_find_button_attr=>'class="t-Button t-Button--hot t-Button--padLeft"'
,p_close_button_text=>'Close'
,p_close_button_attr=>'class="t-Button u-pullRight"'
,p_next_button_text=>'Next >'
,p_next_button_attr=>'class="t-Button t-PopupLOV-button"'
,p_prev_button_text=>'< Previous'
,p_prev_button_attr=>'class="t-Button t-PopupLOV-button"'
,p_after_field_text=>'</div>'
,p_scrollbars=>'1'
,p_resizable=>'1'
,p_width=>'380'
,p_result_row_x_of_y=>'<div class="t-PopupLOV-pagination">Row(s) #FIRST_ROW# - #LAST_ROW#</div>'
,p_result_rows_per_pg=>100
,p_before_result_set=>'<div class="t-PopupLOV-links">'
,p_theme_id=>42
,p_theme_class_id=>1
,p_reference_id=>2885398517835871876
,p_translate_this_template=>'N'
,p_after_result_set=>'</div>'
);
end;
/
prompt --application/shared_components/user_interface/templates/calendar/calendar
begin
wwv_flow_api.create_calendar_template(
p_id=>wwv_flow_api.id(1774883429171936585)
,p_cal_template_name=>'Calendar'
,p_internal_name=>'CALENDAR'
,p_day_of_week_format=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<th id="#DY#" scope="col" class="t-ClassicCalendar-dayColumn">',
' <span class="visible-md visible-lg">#IDAY#</span>',
' <span class="hidden-md hidden-lg">#IDY#</span>',
'</th>'))
,p_month_title_format=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-ClassicCalendar">',
'<h1 class="t-ClassicCalendar-title">#IMONTH# #YYYY#</h1>'))
,p_month_open_format=>'<table class="t-ClassicCalendar-calendar" cellpadding="0" cellspacing="0" border="0" aria-label="#IMONTH# #YYYY#">'
,p_month_close_format=>wwv_flow_string.join(wwv_flow_t_varchar2(
'</table>',
'</div>',
''))
,p_day_title_format=>'<span class="t-ClassicCalendar-date">#DD#</span>'
,p_day_open_format=>'<td class="t-ClassicCalendar-day" headers="#DY#">#TITLE_FORMAT#<div class="t-ClassicCalendar-dayEvents">#DATA#</div>'
,p_day_close_format=>'</td>'
,p_today_open_format=>'<td class="t-ClassicCalendar-day is-today" headers="#DY#">#TITLE_FORMAT#<div class="t-ClassicCalendar-dayEvents">#DATA#</div>'
,p_weekend_title_format=>'<span class="t-ClassicCalendar-date">#DD#</span>'
,p_weekend_open_format=>'<td class="t-ClassicCalendar-day is-weekend" headers="#DY#">#TITLE_FORMAT#<div class="t-ClassicCalendar-dayEvents">#DATA#</div>'
,p_weekend_close_format=>'</td>'
,p_nonday_title_format=>'<span class="t-ClassicCalendar-date">#DD#</span>'
,p_nonday_open_format=>'<td class="t-ClassicCalendar-day is-inactive" headers="#DY#">'
,p_nonday_close_format=>'</td>'
,p_week_open_format=>'<tr>'
,p_week_close_format=>'</tr> '
,p_daily_title_format=>'<table cellspacing="0" cellpadding="0" border="0" summary="" class="t1DayCalendarHolder"> <tr> <td class="t1MonthTitle">#IMONTH# #DD#, #YYYY#</td> </tr> <tr> <td>'
,p_daily_open_format=>'<tr>'
,p_daily_close_format=>'</tr>'
,p_weekly_title_format=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-ClassicCalendar t-ClassicCalendar--weekly">',
'<h1 class="t-ClassicCalendar-title">#WTITLE#</h1>'))
,p_weekly_day_of_week_format=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<th scope="col" class="t-ClassicCalendar-dayColumn" id="#DY#">',
' <span class="visible-md visible-lg">#DD# #IDAY#</span>',
' <span class="hidden-md hidden-lg">#DD# #IDY#</span>',
'</th>'))
,p_weekly_month_open_format=>'<table border="0" cellpadding="0" cellspacing="0" aria-label="#CALENDAR_TITLE# #START_DL# - #END_DL#" class="t-ClassicCalendar-calendar">'
,p_weekly_month_close_format=>wwv_flow_string.join(wwv_flow_t_varchar2(
'</table>',
'</div>'))
,p_weekly_day_open_format=>'<td class="t-ClassicCalendar-day" headers="#DY#"><div class="t-ClassicCalendar-dayEvents">'
,p_weekly_day_close_format=>'</div></td>'
,p_weekly_today_open_format=>'<td class="t-ClassicCalendar-day is-today" headers="#DY#"><div class="t-ClassicCalendar-dayEvents">'
,p_weekly_weekend_open_format=>'<td class="t-ClassicCalendar-day is-weekend" headers="#DY#"><div class="t-ClassicCalendar-dayEvents">'
,p_weekly_weekend_close_format=>'</div></td>'
,p_weekly_time_open_format=>'<th scope="row" class="t-ClassicCalendar-day t-ClassicCalendar-timeCol">'
,p_weekly_time_close_format=>'</th>'
,p_weekly_time_title_format=>'#TIME#'
,p_weekly_hour_open_format=>'<tr>'
,p_weekly_hour_close_format=>'</tr>'
,p_daily_day_of_week_format=>'<th scope="col" id="#DY#" class="t-ClassicCalendar-dayColumn">#IDAY#</th>'
,p_daily_month_title_format=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-ClassicCalendar t-ClassicCalendar--daily">',
'<h1 class="t-ClassicCalendar-title">#IMONTH# #DD#, #YYYY#</h1>'))
,p_daily_month_open_format=>'<table border="0" cellpadding="0" cellspacing="0" aria-label="#CALENDAR_TITLE# #START_DL#" class="t-ClassicCalendar-calendar">'
,p_daily_month_close_format=>wwv_flow_string.join(wwv_flow_t_varchar2(
'</table>',
'</div>'))
,p_daily_day_open_format=>'<td class="t-ClassicCalendar-day" headers="#DY#"><div class="t-ClassicCalendar-dayEvents">'
,p_daily_day_close_format=>'</div></td>'
,p_daily_today_open_format=>'<td class="t-ClassicCalendar-day is-today" headers="#DY#"><div class="t-ClassicCalendar-dayEvents">'
,p_daily_time_open_format=>'<th scope="row" class="t-ClassicCalendar-day t-ClassicCalendar-timeCol" id="#TIME#">'
,p_daily_time_close_format=>'</th>'
,p_daily_time_title_format=>'#TIME#'
,p_daily_hour_open_format=>'<tr>'
,p_daily_hour_close_format=>'</tr>'
,p_cust_month_title_format=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-ClassicCalendar">',
'<h1 class="t-ClassicCalendar-title">#IMONTH# #YYYY#</h1>'))
,p_cust_day_of_week_format=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<th id="#DY#" scope="col" class="t-ClassicCalendar-dayColumn">',
' <span class="visible-md visible-lg">#IDAY#</span>',
' <span class="hidden-md hidden-lg">#IDY#</span>',
'</th>'))
,p_cust_month_open_format=>'<table class="t-ClassicCalendar-calendar" cellpadding="0" cellspacing="0" border="0" aria-label="#IMONTH# #YYYY#">'
,p_cust_month_close_format=>wwv_flow_string.join(wwv_flow_t_varchar2(
'</table>',
'</div>'))
,p_cust_week_open_format=>'<tr>'
,p_cust_week_close_format=>'</tr> '
,p_cust_day_title_format=>'<span class="t-ClassicCalendar-date">#DD#</span>'
,p_cust_day_open_format=>'<td class="t-ClassicCalendar-day" headers="#DY#">'
,p_cust_day_close_format=>'</td>'
,p_cust_today_open_format=>'<td class="t-ClassicCalendar-day is-today" headers="#DY#">'
,p_cust_nonday_title_format=>'<span class="t-ClassicCalendar-date">#DD#</span>'
,p_cust_nonday_open_format=>'<td class="t-ClassicCalendar-day is-inactive" headers="#DY#">'
,p_cust_nonday_close_format=>'</td>'
,p_cust_weekend_title_format=>'<span class="t-ClassicCalendar-date">#DD#</span>'
,p_cust_weekend_open_format=>'<td class="t-ClassicCalendar-day is-weekend" headers="#DY#">'
,p_cust_weekend_close_format=>'</td>'
,p_cust_hour_open_format=>'<tr>'
,p_cust_hour_close_format=>'</tr>'
,p_cust_time_title_format=>'#TIME#'
,p_cust_time_open_format=>'<th scope="row" class="t-ClassicCalendar-day t-ClassicCalendar-timeCol">'
,p_cust_time_close_format=>'</th>'
,p_cust_wk_month_title_format=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-ClassicCalendar">',
'<h1 class="t-ClassicCalendar-title">#WTITLE#</h1>'))
,p_cust_wk_day_of_week_format=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<th scope="col" class="t-ClassicCalendar-dayColumn" id="#DY#">',
' <span class="visible-md visible-lg">#DD# #IDAY#</span>',
' <span class="hidden-md hidden-lg">#DD# #IDY#</span>',
'</th>'))
,p_cust_wk_month_open_format=>'<table border="0" cellpadding="0" cellspacing="0" summary="#CALENDAR_TITLE# #START_DL# - #END_DL#" class="t-ClassicCalendar-calendar">'
,p_cust_wk_month_close_format=>wwv_flow_string.join(wwv_flow_t_varchar2(
'</table>',
'</div>'))
,p_cust_wk_week_open_format=>'<tr>'
,p_cust_wk_week_close_format=>'</tr> '
,p_cust_wk_day_open_format=>'<td class="t-ClassicCalendar-day" headers="#DY#"><div class="t-ClassicCalendar-dayEvents">'
,p_cust_wk_day_close_format=>'</div></td>'
,p_cust_wk_today_open_format=>'<td class="t-ClassicCalendar-day is-today" headers="#DY#"><div class="t-ClassicCalendar-dayEvents">'
,p_cust_wk_weekend_open_format=>'<td class="t-ClassicCalendar-day" headers="#DY#">'
,p_cust_wk_weekend_close_format=>'</td>'
,p_agenda_format=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="t-ClassicCalendar t-ClassicCalendar--list">',
' <div class="t-ClassicCalendar-title">#IMONTH# #YYYY#</div>',
' <ul class="t-ClassicCalendar-list">',
' #DAYS#',
' </ul>',
'</div>'))
,p_agenda_past_day_format=>wwv_flow_string.join(wwv_flow_t_varchar2(
' <li class="t-ClassicCalendar-listTitle is-past">',
' <span class="t-ClassicCalendar-listDayTitle">#IDAY#</span><span class="t-ClassicCalendar-listDayDate">#IMONTH# #DD#</span>',
' </li>'))
,p_agenda_today_day_format=>wwv_flow_string.join(wwv_flow_t_varchar2(
' <li class="t-ClassicCalendar-listTitle is-today">',
' <span class="t-ClassicCalendar-listDayTitle">#IDAY#</span><span class="t-ClassicCalendar-listDayDate">#IMONTH# #DD#</span>',
' </li>'))
,p_agenda_future_day_format=>wwv_flow_string.join(wwv_flow_t_varchar2(
' <li class="t-ClassicCalendar-listTitle is-future">',
' <span class="t-ClassicCalendar-listDayTitle">#IDAY#</span><span class="t-ClassicCalendar-listDayDate">#IMONTH# #DD#</span>',
' </li>'))
,p_agenda_past_entry_format=>' <li class="t-ClassicCalendar-listEvent is-past">#DATA#</li>'
,p_agenda_today_entry_format=>' <li class="t-ClassicCalendar-listEvent is-today">#DATA#</li>'
,p_agenda_future_entry_format=>' <li class="t-ClassicCalendar-listEvent is-future">#DATA#</li>'
,p_month_data_format=>'#DAYS#'
,p_month_data_entry_format=>'<span class="t-ClassicCalendar-event">#DATA#</span>'
,p_theme_id=>42
,p_theme_class_id=>1
,p_reference_id=>4070916747979059326
);
end;
/
prompt --application/shared_components/user_interface/themes
begin
wwv_flow_api.create_theme(
p_id=>wwv_flow_api.id(1774883885763936587)
,p_theme_id=>42
,p_theme_name=>'Universal Theme'
,p_theme_internal_name=>'UNIVERSAL_THEME'
,p_ui_type_name=>'DESKTOP'
,p_navigation_type=>'L'
,p_nav_bar_type=>'LIST'
,p_reference_id=>4070917134413059350
,p_is_locked=>false
,p_default_page_template=>wwv_flow_api.id(1774844326834936459)
,p_default_dialog_template=>wwv_flow_api.id(1774838326496936449)
,p_error_template=>wwv_flow_api.id(1774830836871936435)
,p_printer_friendly_template=>wwv_flow_api.id(1774844326834936459)
,p_breadcrumb_display_point=>'REGION_POSITION_01'
,p_sidebar_display_point=>'REGION_POSITION_02'
,p_login_template=>wwv_flow_api.id(1774830836871936435)
,p_default_button_template=>wwv_flow_api.id(1774883187200936581)
,p_default_region_template=>wwv_flow_api.id(1774859855390936493)
,p_default_chart_template=>wwv_flow_api.id(1774859855390936493)
,p_default_form_template=>wwv_flow_api.id(1774859855390936493)
,p_default_reportr_template=>wwv_flow_api.id(1774859855390936493)
,p_default_tabform_template=>wwv_flow_api.id(1774859855390936493)
,p_default_wizard_template=>wwv_flow_api.id(1774859855390936493)
,p_default_menur_template=>wwv_flow_api.id(1774862430658936498)
,p_default_listr_template=>wwv_flow_api.id(1774859855390936493)
,p_default_irr_template=>wwv_flow_api.id(1774858309021936486)
,p_default_report_template=>wwv_flow_api.id(1774869560539936527)
,p_default_label_template=>wwv_flow_api.id(1774882198755936568)
,p_default_menu_template=>wwv_flow_api.id(1774883299498936583)
,p_default_calendar_template=>wwv_flow_api.id(1774883429171936585)
,p_default_list_template=>wwv_flow_api.id(1774877008397936545)
,p_default_nav_list_template=>wwv_flow_api.id(1774880492604936559)
,p_default_top_nav_list_temp=>wwv_flow_api.id(1774880492604936559)
,p_default_side_nav_list_temp=>wwv_flow_api.id(1774880316343936557)
,p_default_nav_list_position=>'SIDE'
,p_default_dialogbtnr_template=>wwv_flow_api.id(1774849395965936471)
,p_default_dialogr_template=>wwv_flow_api.id(1774849216241936469)
,p_default_option_label=>wwv_flow_api.id(1774882198755936568)
,p_default_header_template=>wwv_flow_api.id(1774849216241936469)
,p_default_footer_template=>wwv_flow_api.id(1774849216241936469)
,p_default_required_label=>wwv_flow_api.id(1774882441270936571)
,p_default_page_transition=>'NONE'
,p_default_popup_transition=>'NONE'
,p_default_navbar_list_template=>wwv_flow_api.id(1774880169096936555)
,p_file_prefix => nvl(wwv_flow_application_install.get_static_theme_file_prefix(42),'#IMAGE_PREFIX#themes/theme_42/21.1/')
,p_files_version=>64
,p_icon_library=>'FONTAPEX'
,p_javascript_file_urls=>wwv_flow_string.join(wwv_flow_t_varchar2(
'#IMAGE_PREFIX#libraries/apex/#MIN_DIRECTORY#widget.stickyWidget#MIN#.js?v=#APEX_VERSION#',
'#THEME_IMAGES#js/theme42#MIN#.js?v=#APEX_VERSION#'))
,p_css_file_urls=>'#THEME_IMAGES#css/Core#MIN#.css?v=#APEX_VERSION#'
);
end;
/
prompt --application/shared_components/user_interface/theme_style
begin
wwv_flow_api.create_theme_style(
p_id=>wwv_flow_api.id(804374380107800033)
,p_theme_id=>42
,p_name=>'Redwood Light'
,p_css_file_urls=>wwv_flow_string.join(wwv_flow_t_varchar2(
'#IMAGE_PREFIX#libraries/oracle-fonts/oraclesans-apex#MIN#.css?v=#APEX_VERSION#',
'#THEME_IMAGES#css/Redwood#MIN#.css?v=#APEX_VERSION#'))
,p_is_current=>false
,p_is_public=>true
,p_is_accessible=>false
,p_theme_roller_input_file_urls=>'#THEME_IMAGES#less/theme/Redwood-Theme.less'
,p_theme_roller_output_file_url=>'#THEME_IMAGES#css/Redwood-Theme#MIN#.css?v=#APEX_VERSION#'
,p_theme_roller_read_only=>true
,p_reference_id=>2596426436825065489
);
wwv_flow_api.create_theme_style(
p_id=>wwv_flow_api.id(804374726777800033)
,p_theme_id=>42
,p_name=>'Vita'
,p_is_current=>true
,p_is_public=>true
,p_is_accessible=>true
,p_theme_roller_input_file_urls=>'#THEME_IMAGES#less/theme/Vita.less'
,p_theme_roller_output_file_url=>'#THEME_IMAGES#css/Vita#MIN#.css?v=#APEX_VERSION#'
,p_theme_roller_read_only=>true
,p_reference_id=>2719875314571594493
);
wwv_flow_api.create_theme_style(
p_id=>wwv_flow_api.id(804375143996800033)
,p_theme_id=>42
,p_name=>'Vita - Dark'
,p_is_current=>false
,p_is_public=>true
,p_is_accessible=>false
,p_theme_roller_input_file_urls=>'#THEME_IMAGES#less/theme/Vita-Dark.less'
,p_theme_roller_output_file_url=>'#THEME_IMAGES#css/Vita-Dark#MIN#.css?v=#APEX_VERSION#'
,p_theme_roller_read_only=>true
,p_reference_id=>3543348412015319650
);
wwv_flow_api.create_theme_style(
p_id=>wwv_flow_api.id(804375563575800033)
,p_theme_id=>42
,p_name=>'Vita - Red'
,p_is_current=>false
,p_is_public=>true
,p_is_accessible=>false
,p_theme_roller_input_file_urls=>'#THEME_IMAGES#less/theme/Vita-Red.less'
,p_theme_roller_output_file_url=>'#THEME_IMAGES#css/Vita-Red#MIN#.css?v=#APEX_VERSION#'
,p_theme_roller_read_only=>true
,p_reference_id=>1938457712423918173
);
wwv_flow_api.create_theme_style(
p_id=>wwv_flow_api.id(804375923535800034)
,p_theme_id=>42
,p_name=>'Vita - Slate'
,p_is_current=>false
,p_is_public=>true
,p_is_accessible=>false
,p_theme_roller_input_file_urls=>'#THEME_IMAGES#less/theme/Vita-Slate.less'
,p_theme_roller_output_file_url=>'#THEME_IMAGES#css/Vita-Slate#MIN#.css?v=#APEX_VERSION#'
,p_theme_roller_read_only=>true
,p_reference_id=>3291983347983194966
);
end;
/
prompt --application/shared_components/user_interface/theme_files
begin
null;
end;
/
prompt --application/shared_components/user_interface/theme_display_points
begin
null;
end;
/
prompt --application/shared_components/user_interface/template_opt_groups
begin
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804517999926800166)
,p_theme_id=>42
,p_name=>'BUTTON_SET'
,p_display_name=>'Button Set'
,p_display_sequence=>40
,p_template_types=>'BUTTON'
,p_help_text=>'Enables you to group many buttons together into a pill. You can use this option to specify where the button is within this set. Set the option to Default if this button is not part of a button set.'
,p_null_text=>'Default'
,p_is_advanced=>'Y'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804518301644800166)
,p_theme_id=>42
,p_name=>'ICON_HOVER_ANIMATION'
,p_display_name=>'Icon Hover Animation'
,p_display_sequence=>55
,p_template_types=>'BUTTON'
,p_null_text=>'Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804518793683800166)
,p_theme_id=>42
,p_name=>'ICON_POSITION'
,p_display_name=>'Icon Position'
,p_display_sequence=>50
,p_template_types=>'BUTTON'
,p_help_text=>'Sets the position of the icon relative to the label.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804519158210800166)
,p_theme_id=>42
,p_name=>'SIZE'
,p_display_name=>'Size'
,p_display_sequence=>10
,p_template_types=>'BUTTON'
,p_help_text=>'Sets the size of the button.'
,p_null_text=>'Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804519549983800166)
,p_theme_id=>42
,p_name=>'SPACING_BOTTOM'
,p_display_name=>'Spacing Bottom'
,p_display_sequence=>100
,p_template_types=>'BUTTON'
,p_help_text=>'Controls the spacing to the bottom of the button.'
,p_null_text=>'Default'
,p_is_advanced=>'Y'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804519940811800167)
,p_theme_id=>42
,p_name=>'SPACING_LEFT'
,p_display_name=>'Spacing Left'
,p_display_sequence=>70
,p_template_types=>'BUTTON'
,p_help_text=>'Controls the spacing to the left of the button.'
,p_null_text=>'Default'
,p_is_advanced=>'Y'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804520344615800167)
,p_theme_id=>42
,p_name=>'SPACING_RIGHT'
,p_display_name=>'Spacing Right'
,p_display_sequence=>80
,p_template_types=>'BUTTON'
,p_help_text=>'Controls the spacing to the right of the button.'
,p_null_text=>'Default'
,p_is_advanced=>'Y'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804520729019800167)
,p_theme_id=>42
,p_name=>'SPACING_TOP'
,p_display_name=>'Spacing Top'
,p_display_sequence=>90
,p_template_types=>'BUTTON'
,p_help_text=>'Controls the spacing to the top of the button.'
,p_null_text=>'Default'
,p_is_advanced=>'Y'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804521149456800167)
,p_theme_id=>42
,p_name=>'STYLE'
,p_display_name=>'Style'
,p_display_sequence=>30
,p_template_types=>'BUTTON'
,p_help_text=>'Sets the style of the button. Use the "Simple" option for secondary actions or sets of buttons. Use the "Remove UI Decoration" option to make the button appear as text.'
,p_null_text=>'Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804521578178800167)
,p_theme_id=>42
,p_name=>'TYPE'
,p_display_name=>'Type'
,p_display_sequence=>20
,p_template_types=>'BUTTON'
,p_null_text=>'Normal'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804521929603800168)
,p_theme_id=>42
,p_name=>'WIDTH'
,p_display_name=>'Width'
,p_display_sequence=>60
,p_template_types=>'BUTTON'
,p_help_text=>'Sets the width of the button.'
,p_null_text=>'Auto - Default'
,p_is_advanced=>'Y'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804522375064800168)
,p_theme_id=>42
,p_name=>'BOTTOM_MARGIN'
,p_display_name=>'Bottom Margin'
,p_display_sequence=>220
,p_template_types=>'FIELD'
,p_help_text=>'Set the bottom margin for this field.'
,p_null_text=>'Default'
,p_is_advanced=>'Y'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804522765288800168)
,p_theme_id=>42
,p_name=>'ITEM_POST_TEXT'
,p_display_name=>'Item Post Text'
,p_display_sequence=>30
,p_template_types=>'FIELD'
,p_help_text=>'Adjust the display of the Item Post Text'
,p_null_text=>'Default'
,p_is_advanced=>'Y'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804523171822800168)
,p_theme_id=>42
,p_name=>'ITEM_PRE_TEXT'
,p_display_name=>'Item Pre Text'
,p_display_sequence=>20
,p_template_types=>'FIELD'
,p_help_text=>'Adjust the display of the Item Pre Text'
,p_null_text=>'Default'
,p_is_advanced=>'Y'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804523518208800169)
,p_theme_id=>42
,p_name=>'LEFT_MARGIN'
,p_display_name=>'Left Margin'
,p_display_sequence=>220
,p_template_types=>'FIELD'
,p_help_text=>'Set the left margin for this field.'
,p_null_text=>'Default'
,p_is_advanced=>'Y'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804523902557800169)
,p_theme_id=>42
,p_name=>'PRESERVE_LABEL_SPACING'
,p_display_name=>'Preserve Label Spacing'
,p_display_sequence=>1
,p_template_types=>'FIELD'
,p_help_text=>'Preserves the label space and enables use of the Label Column Span property.'
,p_null_text=>'Yes'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804524323022800169)
,p_theme_id=>42
,p_name=>'RADIO_GROUP_DISPLAY'
,p_display_name=>'Item Group Display'
,p_display_sequence=>300
,p_template_types=>'FIELD'
,p_help_text=>'Determines the display style for radio and check box items.'
,p_null_text=>'Default'
,p_is_advanced=>'Y'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804524740728800169)
,p_theme_id=>42
,p_name=>'REQUIRED_INDICATOR'
,p_display_name=>'Required Indicator'
,p_display_sequence=>1
,p_template_types=>'FIELD'
,p_null_text=>'Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804525146789800169)
,p_theme_id=>42
,p_name=>'RIGHT_MARGIN'
,p_display_name=>'Right Margin'
,p_display_sequence=>230
,p_template_types=>'FIELD'
,p_help_text=>'Set the right margin for this field.'
,p_null_text=>'Default'
,p_is_advanced=>'Y'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804525524852800170)
,p_theme_id=>42
,p_name=>'SIZE'
,p_display_name=>'Size'
,p_display_sequence=>10
,p_template_types=>'FIELD'
,p_null_text=>'Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804525968502800170)
,p_theme_id=>42
,p_name=>'TOP_MARGIN'
,p_display_name=>'Top Margin'
,p_display_sequence=>200
,p_template_types=>'FIELD'
,p_help_text=>'Set the top margin for this field.'
,p_null_text=>'Default'
,p_is_advanced=>'Y'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804526372841800170)
,p_theme_id=>42
,p_name=>'ANIMATION'
,p_display_name=>'Animation'
,p_display_sequence=>80
,p_template_types=>'LIST'
,p_help_text=>'Sets the hover and focus animation.'
,p_null_text=>'Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804526767700800170)
,p_theme_id=>42
,p_name=>'BADGE_SIZE'
,p_display_name=>'Badge Size'
,p_display_sequence=>70
,p_template_types=>'LIST'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804527102441800170)
,p_theme_id=>42
,p_name=>'BODY_TEXT'
,p_display_name=>'Body Text'
,p_display_sequence=>40
,p_template_types=>'LIST'
,p_help_text=>'Determines the height of the card body.'
,p_null_text=>'Auto'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804527562180800171)
,p_theme_id=>42
,p_name=>'COLLAPSE_STYLE'
,p_display_name=>'Collapse Mode'
,p_display_sequence=>30
,p_template_types=>'LIST'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804527939408800171)
,p_theme_id=>42
,p_name=>'COLOR_ACCENTS'
,p_display_name=>'Color Accents'
,p_display_sequence=>50
,p_template_types=>'LIST'
,p_null_text=>'Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804528392038800171)
,p_theme_id=>42
,p_name=>'DESKTOP'
,p_display_name=>'Desktop'
,p_display_sequence=>90
,p_template_types=>'LIST'
,p_help_text=>'Determines the display for a desktop-sized screen'
,p_null_text=>'Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804528707803800171)
,p_theme_id=>42
,p_name=>'DISPLAY_ICONS'
,p_display_name=>'Display Icons'
,p_display_sequence=>30
,p_template_types=>'LIST'
,p_null_text=>'No Icons'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804529109054800172)
,p_theme_id=>42
,p_name=>'ICONS'
,p_display_name=>'Icons'
,p_display_sequence=>20
,p_template_types=>'LIST'
,p_null_text=>'No Icons'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804529546579800172)
,p_theme_id=>42
,p_name=>'ICON_SHAPE'
,p_display_name=>'Icon Shape'
,p_display_sequence=>60
,p_template_types=>'LIST'
,p_help_text=>'Determines the shape of the icon.'
,p_null_text=>'Circle'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804529910725800174)
,p_theme_id=>42
,p_name=>'ICON_STYLE'
,p_display_name=>'Icon Style'
,p_display_sequence=>35
,p_template_types=>'LIST'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804530367089800174)
,p_theme_id=>42
,p_name=>'LABEL_DISPLAY'
,p_display_name=>'Label Display'
,p_display_sequence=>50
,p_template_types=>'LIST'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804530712278800176)
,p_theme_id=>42
,p_name=>'LAYOUT'
,p_display_name=>'Layout'
,p_display_sequence=>30
,p_template_types=>'LIST'
,p_null_text=>'Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804531186510800176)
,p_theme_id=>42
,p_name=>'MOBILE'
,p_display_name=>'Mobile'
,p_display_sequence=>100
,p_template_types=>'LIST'
,p_help_text=>'Determines the display for a mobile-sized screen'
,p_null_text=>'Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804531568180800177)
,p_theme_id=>42
,p_name=>'SIZE'
,p_display_name=>'Size'
,p_display_sequence=>1
,p_template_types=>'LIST'
,p_null_text=>'Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804531903410800177)
,p_theme_id=>42
,p_name=>'STYLE'
,p_display_name=>'Style'
,p_display_sequence=>10
,p_template_types=>'LIST'
,p_null_text=>'Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804532346562800177)
,p_theme_id=>42
,p_name=>'CONTENT_PADDING'
,p_display_name=>'Content Padding'
,p_display_sequence=>1
,p_template_types=>'PAGE'
,p_help_text=>'Sets the Content Body padding for the page.'
,p_null_text=>'Default'
,p_is_advanced=>'Y'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804532712889800177)
,p_theme_id=>42
,p_name=>'DISPLAY_MODE'
,p_display_name=>'Display Mode'
,p_display_sequence=>30
,p_template_types=>'PAGE'
,p_help_text=>'Determines the default display appearance and positioning of the dialog. The default opens a floating dialog position at the center of the screen.'
,p_null_text=>'Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804533130849800178)
,p_theme_id=>42
,p_name=>'PAGE_BACKGROUND'
,p_display_name=>'Page Background'
,p_display_sequence=>20
,p_template_types=>'PAGE'
,p_null_text=>'Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804533575908800178)
,p_theme_id=>42
,p_name=>'PAGE_LAYOUT'
,p_display_name=>'Page Layout'
,p_display_sequence=>10
,p_template_types=>'PAGE'
,p_null_text=>'Floating (Default)'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804533973283800178)
,p_theme_id=>42
,p_name=>'ACCENT'
,p_display_name=>'Accent'
,p_display_sequence=>30
,p_template_types=>'REGION'
,p_help_text=>'Set the Region''s accent. This accent corresponds to a Theme-Rollable color and sets the background of the Region''s Header.'
,p_null_text=>'Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804534356570800178)
,p_theme_id=>42
,p_name=>'ALERT_DISPLAY'
,p_display_name=>'Alert Display'
,p_display_sequence=>1
,p_template_types=>'REGION'
,p_help_text=>'Sets the layout of the Alert Region.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804534799743800178)
,p_theme_id=>42
,p_name=>'ALERT_ICONS'
,p_display_name=>'Alert Icons'
,p_display_sequence=>2
,p_template_types=>'REGION'
,p_help_text=>'Sets how icons are handled for the Alert Region.'
,p_null_text=>'Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804535106487800179)
,p_theme_id=>42
,p_name=>'ALERT_TITLE'
,p_display_name=>'Alert Title'
,p_display_sequence=>40
,p_template_types=>'REGION'
,p_help_text=>'Determines how the title of the alert is displayed.'
,p_null_text=>'Visible - Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804535530444800179)
,p_theme_id=>42
,p_name=>'ALERT_TYPE'
,p_display_name=>'Alert Type'
,p_display_sequence=>3
,p_template_types=>'REGION'
,p_help_text=>'Sets the type of alert which can be used to determine the icon, icon color, and the background color.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804535921426800179)
,p_theme_id=>42
,p_name=>'ANIMATION'
,p_display_name=>'Animation'
,p_display_sequence=>10
,p_template_types=>'REGION'
,p_help_text=>'Sets the animation when navigating within the Carousel Region.'
,p_null_text=>'Fade'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804536344202800179)
,p_theme_id=>42
,p_name=>'BODY_HEIGHT'
,p_display_name=>'Body Height'
,p_display_sequence=>10
,p_template_types=>'REGION'
,p_help_text=>'Sets the Region Body height. You can also specify a custom height by modifying the Region''s CSS Classes and using the height helper classes "i-hXXX" where XXX is any increment of 10 from 100 to 800.'
,p_null_text=>'Auto - Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804536748710800179)
,p_theme_id=>42
,p_name=>'BODY_OVERFLOW'
,p_display_name=>'Body Overflow'
,p_display_sequence=>2
,p_template_types=>'REGION'
,p_help_text=>'Determines the scroll behavior when the region contents are larger than their container.'
,p_is_advanced=>'Y'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804537182667800180)
,p_theme_id=>42
,p_name=>'BODY_PADDING'
,p_display_name=>'Body Padding'
,p_display_sequence=>1
,p_template_types=>'REGION'
,p_help_text=>'Sets the Region Body padding for the region.'
,p_null_text=>'Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804537599226800180)
,p_theme_id=>42
,p_name=>'BODY_STYLE'
,p_display_name=>'Body Style'
,p_display_sequence=>20
,p_template_types=>'REGION'
,p_help_text=>'Controls the display of the region''s body container.'
,p_null_text=>'Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804537999086800180)
,p_theme_id=>42
,p_name=>'CALLOUT_POSITION'
,p_display_name=>'Callout Position'
,p_display_sequence=>10
,p_template_types=>'REGION'
,p_help_text=>'Determines where the callout for the popup will be positioned relative to its parent.'
,p_null_text=>'Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804538390703800180)
,p_theme_id=>42
,p_name=>'COLLAPSIBLE_BUTTON_ICONS'
,p_display_name=>'Collapsible Button Icons'
,p_display_sequence=>1
,p_template_types=>'REGION'
,p_help_text=>'Determines which arrows to use to represent the icons for the collapse and expand button.'
,p_null_text=>'Arrows'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804538729207800180)
,p_theme_id=>42
,p_name=>'COLLAPSIBLE_ICON_POSITION'
,p_display_name=>'Collapsible Icon Position'
,p_display_sequence=>1
,p_template_types=>'REGION'
,p_help_text=>'Determines the position of the expand and collapse toggle for the region.'
,p_null_text=>'Start'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804539195963800181)
,p_theme_id=>42
,p_name=>'DEFAULT_STATE'
,p_display_name=>'Default State'
,p_display_sequence=>1
,p_template_types=>'REGION'
,p_help_text=>'Sets the default state of the region.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804539508869800181)
,p_theme_id=>42
,p_name=>'DIALOG_SIZE'
,p_display_name=>'Dialog Size'
,p_display_sequence=>1
,p_template_types=>'REGION'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804539933964800181)
,p_theme_id=>42
,p_name=>'DISPLAY_ICON'
,p_display_name=>'Display Icon'
,p_display_sequence=>50
,p_template_types=>'REGION'
,p_help_text=>'Display the Hero Region icon.'
,p_null_text=>'Yes (Default)'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804540303363800181)
,p_theme_id=>42
,p_name=>'DISPLAY_MODE'
,p_display_name=>'Display Mode'
,p_display_sequence=>1
,p_template_types=>'REGION'
,p_help_text=>'Determines the default display appearance and positioning of the dialog. The default opens a floating dialog position at the center of the screen.'
,p_null_text=>'Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804540730240800182)
,p_theme_id=>42
,p_name=>'HEADER'
,p_display_name=>'Header'
,p_display_sequence=>20
,p_template_types=>'REGION'
,p_help_text=>'Determines the display of the Region Header which also contains the Region Title.'
,p_null_text=>'Visible - Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804541142025800182)
,p_theme_id=>42
,p_name=>'HEADING_FONT'
,p_display_name=>'Heading Font'
,p_display_sequence=>100
,p_template_types=>'REGION'
,p_help_text=>'Sets the font-family of the heading for this region.'
,p_null_text=>'Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804541531386800182)
,p_theme_id=>42
,p_name=>'HEADING_LEVEL'
,p_display_name=>'Heading Level'
,p_display_sequence=>1
,p_template_types=>'REGION'
,p_null_text=>'Default'
,p_is_advanced=>'Y'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804541987832800182)
,p_theme_id=>42
,p_name=>'HIDE_STEPS_FOR'
,p_display_name=>'Hide Steps For'
,p_display_sequence=>1
,p_template_types=>'REGION'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804542341212800182)
,p_theme_id=>42
,p_name=>'ICON_SHAPE'
,p_display_name=>'Icon Shape'
,p_display_sequence=>60
,p_template_types=>'REGION'
,p_help_text=>'Determines the shape of the icon.'
,p_null_text=>'Rounded Corners'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804542737652800183)
,p_theme_id=>42
,p_name=>'ITEM_PADDING'
,p_display_name=>'Item Spacing'
,p_display_sequence=>100
,p_template_types=>'REGION'
,p_help_text=>'Sets the padding around items within this region.'
,p_null_text=>'Default'
,p_is_advanced=>'Y'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804543166007800183)
,p_theme_id=>42
,p_name=>'ITEM_SIZE'
,p_display_name=>'Item Size'
,p_display_sequence=>110
,p_template_types=>'REGION'
,p_help_text=>'Sets the size of the form items within this region.'
,p_null_text=>'Default'
,p_is_advanced=>'Y'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804543543037800183)
,p_theme_id=>42
,p_name=>'ITEM_WIDTH'
,p_display_name=>'Item Width'
,p_display_sequence=>120
,p_template_types=>'REGION'
,p_help_text=>'Sets the width of the form items within this region.'
,p_null_text=>'Default'
,p_is_advanced=>'Y'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804543930140800183)
,p_theme_id=>42
,p_name=>'LABEL_ALIGNMENT'
,p_display_name=>'Label Alignment'
,p_display_sequence=>130
,p_template_types=>'REGION'
,p_help_text=>'Set the label text alignment for items within this region.'
,p_null_text=>'Right'
,p_is_advanced=>'Y'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804544369386800183)
,p_theme_id=>42
,p_name=>'LABEL_POSITION'
,p_display_name=>'Label Position'
,p_display_sequence=>140
,p_template_types=>'REGION'
,p_help_text=>'Sets the position of the label relative to the form item.'
,p_null_text=>'Inline - Default'
,p_is_advanced=>'Y'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804544768159800184)
,p_theme_id=>42
,p_name=>'LAYOUT'
,p_display_name=>'Layout'
,p_display_sequence=>1
,p_template_types=>'REGION'
,p_null_text=>'Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804545188343800184)
,p_theme_id=>42
,p_name=>'LOGIN_HEADER'
,p_display_name=>'Login Header'
,p_display_sequence=>10
,p_template_types=>'REGION'
,p_help_text=>'Controls the display of the Login region header.'
,p_null_text=>'Icon and Title (Default)'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804545564517800184)
,p_theme_id=>42
,p_name=>'REGION_BOTTOM_MARGIN'
,p_display_name=>'Bottom Margin'
,p_display_sequence=>210
,p_template_types=>'REGION'
,p_help_text=>'Set the bottom margin for this region.'
,p_null_text=>'Default'
,p_is_advanced=>'Y'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804545947074800184)
,p_theme_id=>42
,p_name=>'REGION_LEFT_MARGIN'
,p_display_name=>'Left Margin'
,p_display_sequence=>220
,p_template_types=>'REGION'
,p_help_text=>'Set the left margin for this region.'
,p_null_text=>'Default'
,p_is_advanced=>'Y'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804546312222800184)
,p_theme_id=>42
,p_name=>'REGION_RIGHT_MARGIN'
,p_display_name=>'Right Margin'
,p_display_sequence=>230
,p_template_types=>'REGION'
,p_help_text=>'Set the right margin for this region.'
,p_null_text=>'Default'
,p_is_advanced=>'Y'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804546742887800185)
,p_theme_id=>42
,p_name=>'REGION_TITLE'
,p_display_name=>'Region Title'
,p_display_sequence=>1
,p_template_types=>'REGION'
,p_help_text=>'Sets the source of the Title Bar region''s title.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804547172347800185)
,p_theme_id=>42
,p_name=>'REGION_TOP_MARGIN'
,p_display_name=>'Top Margin'
,p_display_sequence=>200
,p_template_types=>'REGION'
,p_help_text=>'Set the top margin for this region.'
,p_null_text=>'Default'
,p_is_advanced=>'Y'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804547523949800185)
,p_theme_id=>42
,p_name=>'STYLE'
,p_display_name=>'Style'
,p_display_sequence=>40
,p_template_types=>'REGION'
,p_help_text=>'Determines how the region is styled. Use the "Remove Borders" template option to remove the region''s borders and shadows.'
,p_null_text=>'Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804547991315800185)
,p_theme_id=>42
,p_name=>'TABS_SIZE'
,p_display_name=>'Tabs Size'
,p_display_sequence=>1
,p_template_types=>'REGION'
,p_null_text=>'Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804548300996800186)
,p_theme_id=>42
,p_name=>'TAB_STYLE'
,p_display_name=>'Tab Style'
,p_display_sequence=>1
,p_template_types=>'REGION'
,p_null_text=>'Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804548745380800186)
,p_theme_id=>42
,p_name=>'TIMER'
,p_display_name=>'Timer'
,p_display_sequence=>2
,p_template_types=>'REGION'
,p_help_text=>'Sets the timer for when to automatically navigate to the next region within the Carousel Region.'
,p_null_text=>'No Timer'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804549107092800186)
,p_theme_id=>42
,p_name=>'ALTERNATING_ROWS'
,p_display_name=>'Alternating Rows'
,p_display_sequence=>10
,p_template_types=>'REPORT'
,p_help_text=>'Shades alternate rows in the report with slightly different background colors.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804549542550800186)
,p_theme_id=>42
,p_name=>'ANIMATION'
,p_display_name=>'Animation'
,p_display_sequence=>70
,p_template_types=>'REPORT'
,p_help_text=>'Sets the hover and focus animation.'
,p_null_text=>'Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804549959177800186)
,p_theme_id=>42
,p_name=>'BADGE_SIZE'
,p_display_name=>'Badge Size'
,p_display_sequence=>10
,p_template_types=>'REPORT'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804550344016800187)
,p_theme_id=>42
,p_name=>'BODY_TEXT'
,p_display_name=>'Body Text'
,p_display_sequence=>40
,p_template_types=>'REPORT'
,p_help_text=>'Determines the height of the card body.'
,p_null_text=>'Auto'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804550766003800187)
,p_theme_id=>42
,p_name=>'COLOR_ACCENTS'
,p_display_name=>'Color Accents'
,p_display_sequence=>50
,p_template_types=>'REPORT'
,p_null_text=>'Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804551190349800187)
,p_theme_id=>42
,p_name=>'COL_ACTIONS'
,p_display_name=>'Actions'
,p_display_sequence=>150
,p_template_types=>'REPORT'
,p_null_text=>'Default'
,p_is_advanced=>'Y'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804551598901800187)
,p_theme_id=>42
,p_name=>'COL_CONTENT_DESCRIPTION'
,p_display_name=>'Description'
,p_display_sequence=>130
,p_template_types=>'REPORT'
,p_null_text=>'Default'
,p_is_advanced=>'Y'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804551912266800188)
,p_theme_id=>42
,p_name=>'COL_CONTENT_TITLE'
,p_display_name=>'Title'
,p_display_sequence=>120
,p_template_types=>'REPORT'
,p_null_text=>'Default'
,p_is_advanced=>'Y'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804552345258800188)
,p_theme_id=>42
,p_name=>'COL_ICON'
,p_display_name=>'Icon'
,p_display_sequence=>110
,p_template_types=>'REPORT'
,p_null_text=>'Default'
,p_is_advanced=>'Y'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804552799341800188)
,p_theme_id=>42
,p_name=>'COL_MISC'
,p_display_name=>'Misc'
,p_display_sequence=>140
,p_template_types=>'REPORT'
,p_null_text=>'Default'
,p_is_advanced=>'Y'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804553135986800188)
,p_theme_id=>42
,p_name=>'COL_SELECTION'
,p_display_name=>'Selection'
,p_display_sequence=>100
,p_template_types=>'REPORT'
,p_null_text=>'Default'
,p_is_advanced=>'Y'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804553548101800188)
,p_theme_id=>42
,p_name=>'COMMENTS_STYLE'
,p_display_name=>'Comments Style'
,p_display_sequence=>10
,p_template_types=>'REPORT'
,p_help_text=>'Determines the style in which comments are displayed.'
,p_null_text=>'Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804553983260800189)
,p_theme_id=>42
,p_name=>'CONTENT_ALIGNMENT'
,p_display_name=>'Content Alignment'
,p_display_sequence=>90
,p_template_types=>'REPORT'
,p_null_text=>'Center (Default)'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804554315052800189)
,p_theme_id=>42
,p_name=>'DISPLAY_ITEMS'
,p_display_name=>'Display Items'
,p_display_sequence=>20
,p_template_types=>'REPORT'
,p_null_text=>'Inline (Default)'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804554788183800189)
,p_theme_id=>42
,p_name=>'DISPLAY_LABELS'
,p_display_name=>'Display Labels'
,p_display_sequence=>30
,p_template_types=>'REPORT'
,p_null_text=>'Inline (Default)'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804555140165800189)
,p_theme_id=>42
,p_name=>'ICONS'
,p_display_name=>'Icons'
,p_display_sequence=>20
,p_template_types=>'REPORT'
,p_help_text=>'Controls how to handle icons in the report.'
,p_null_text=>'No Icons'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804555533444800189)
,p_theme_id=>42
,p_name=>'ICON_SHAPE'
,p_display_name=>'Icon Shape'
,p_display_sequence=>60
,p_template_types=>'REPORT'
,p_help_text=>'Determines the shape of the icon.'
,p_null_text=>'Circle'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804555933986800190)
,p_theme_id=>42
,p_name=>'LABEL_WIDTH'
,p_display_name=>'Label Width'
,p_display_sequence=>10
,p_template_types=>'REPORT'
,p_null_text=>'Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804556336641800190)
,p_theme_id=>42
,p_name=>'LAYOUT'
,p_display_name=>'Layout'
,p_display_sequence=>30
,p_template_types=>'REPORT'
,p_help_text=>'Determines the layout of Cards in the report.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804556716682800190)
,p_theme_id=>42
,p_name=>'PAGINATION_DISPLAY'
,p_display_name=>'Pagination Display'
,p_display_sequence=>10
,p_template_types=>'REPORT'
,p_help_text=>'Controls the display of pagination for this region.'
,p_null_text=>'Default'
,p_is_advanced=>'Y'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804557124613800190)
,p_theme_id=>42
,p_name=>'REPORT_BORDER'
,p_display_name=>'Report Border'
,p_display_sequence=>30
,p_template_types=>'REPORT'
,p_help_text=>'Controls the display of the Report''s borders.'
,p_null_text=>'Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804557567097800191)
,p_theme_id=>42
,p_name=>'ROW_HIGHLIGHTING'
,p_display_name=>'Row Highlighting'
,p_display_sequence=>20
,p_template_types=>'REPORT'
,p_help_text=>'Determines whether you want the row to be highlighted on hover.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804557959513800192)
,p_theme_id=>42
,p_name=>'SIZE'
,p_display_name=>'Size'
,p_display_sequence=>35
,p_template_types=>'REPORT'
,p_null_text=>'Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(804558397080800192)
,p_theme_id=>42
,p_name=>'STYLE'
,p_display_name=>'Style'
,p_display_sequence=>10
,p_template_types=>'REPORT'
,p_help_text=>'Determines the overall style for the component.'
,p_null_text=>'Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(971103499082736934)
,p_theme_id=>142
,p_name=>'ALERT_TYPE'
,p_display_name=>'Alert Type'
,p_display_sequence=>1
,p_template_types=>'REGION'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(971103815403736934)
,p_theme_id=>142
,p_name=>'DISPLAY_TYPE'
,p_display_name=>'Display Type'
,p_display_sequence=>1
,p_template_types=>'REGION'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(971105715099736938)
,p_theme_id=>142
,p_name=>'REGION_STYLE'
,p_display_name=>'Region Style'
,p_display_sequence=>1
,p_template_types=>'REGION'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(971106144139736938)
,p_theme_id=>142
,p_name=>'REGION_PADDING'
,p_display_name=>'Region Padding'
,p_display_sequence=>1
,p_template_types=>'REGION'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(971107866778736942)
,p_theme_id=>142
,p_name=>'BODY_HEIGHT'
,p_display_name=>'Body Height'
,p_display_sequence=>1
,p_template_types=>'REGION'
,p_null_text=>'Extend to Fit Contents'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(971108322921736942)
,p_theme_id=>142
,p_name=>'REGION_HEADER'
,p_display_name=>'Region Header'
,p_display_sequence=>1
,p_template_types=>'REGION'
,p_null_text=>'Visible - Default'
,p_is_advanced=>'N'
);
end;
/
begin
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(971108660505736942)
,p_theme_id=>142
,p_name=>'BODY_OVERFLOW'
,p_display_name=>'Body Overflow'
,p_display_sequence=>1
,p_template_types=>'REGION'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(971109678323736943)
,p_theme_id=>142
,p_name=>'REGION_TYPE'
,p_display_name=>'Region Type'
,p_display_sequence=>1
,p_template_types=>'REGION'
,p_null_text=>'Normal - Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(971110734954736944)
,p_theme_id=>142
,p_name=>'HIDE_STEPS_FOR'
,p_display_name=>'Hide Steps For'
,p_display_sequence=>1
,p_template_types=>'REGION'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(971111449353736946)
,p_theme_id=>142
,p_name=>'BADGE_SIZE'
,p_display_name=>'Badge Size'
,p_display_sequence=>1
,p_template_types=>'REPORT'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(971111748858736946)
,p_theme_id=>142
,p_name=>'LAYOUT'
,p_display_name=>'Layout'
,p_display_sequence=>1
,p_template_types=>'REPORT'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(971113776413736951)
,p_theme_id=>142
,p_name=>'ALTERNATING_ROWS'
,p_display_name=>'Alternating Rows'
,p_display_sequence=>1
,p_template_types=>'REPORT'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(971114189373736951)
,p_theme_id=>142
,p_name=>'ROW_HIGHLIGHTING'
,p_display_name=>'Row Highlighting'
,p_display_sequence=>1
,p_template_types=>'REPORT'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(971114540688736951)
,p_theme_id=>142
,p_name=>'REPORT_BORDER'
,p_display_name=>'Report Border'
,p_display_sequence=>1
,p_template_types=>'REPORT'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(971115945148736955)
,p_theme_id=>142
,p_name=>'LAYOUT'
,p_display_name=>'Layout'
,p_display_sequence=>1
,p_template_types=>'LIST'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(971116859841736958)
,p_theme_id=>142
,p_name=>'BADGE_SIZE'
,p_display_name=>'Badge Size'
,p_display_sequence=>1
,p_template_types=>'LIST'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(971118342847736960)
,p_theme_id=>142
,p_name=>'DISPLAY_ICONS'
,p_display_name=>'Display Icons'
,p_display_sequence=>1
,p_template_types=>'LIST'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(971119462936736961)
,p_theme_id=>142
,p_name=>'ICON_STYLE'
,p_display_name=>'Icon Style'
,p_display_sequence=>1
,p_template_types=>'LIST'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(971121282976736965)
,p_theme_id=>142
,p_name=>'LABEL_DISPLAY'
,p_display_name=>'Label Display'
,p_display_sequence=>1
,p_template_types=>'LIST'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(971122475917736968)
,p_theme_id=>142
,p_name=>'ICON_POSITION'
,p_display_name=>'Icon Position'
,p_display_sequence=>1
,p_template_types=>'BUTTON'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(971123176049736969)
,p_theme_id=>142
,p_name=>'BREADCRUMB_DIVIDER'
,p_display_name=>'Breadcrumb Divider'
,p_display_sequence=>1
,p_template_types=>'BREADCRUMB'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(971124472546736974)
,p_theme_id=>142
,p_name=>'BUTTON_TYPE'
,p_display_name=>'Button Type'
,p_display_sequence=>1
,p_template_types=>'BUTTON'
,p_null_text=>'Normal'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(971124775870736974)
,p_theme_id=>142
,p_name=>'SPACING_LEFT'
,p_display_name=>'Spacing Left'
,p_display_sequence=>1
,p_template_types=>'BUTTON'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(971125083802736974)
,p_theme_id=>142
,p_name=>'SPACING_RIGHT'
,p_display_name=>'Spacing Right'
,p_display_sequence=>1
,p_template_types=>'BUTTON'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(971125473042736974)
,p_theme_id=>142
,p_name=>'BUTTON_SIZE'
,p_display_name=>'Button Size'
,p_display_sequence=>1
,p_template_types=>'BUTTON'
,p_null_text=>'Default Size'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(971125819536736974)
,p_theme_id=>142
,p_name=>'BUTTON_STYLE'
,p_display_name=>'Button Style'
,p_display_sequence=>1
,p_template_types=>'BUTTON'
,p_null_text=>'Default Style'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(971126340261736974)
,p_theme_id=>142
,p_name=>'BUTTON_SET'
,p_display_name=>'Button Set'
,p_display_sequence=>1
,p_template_types=>'BUTTON'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(971127115960736975)
,p_theme_id=>142
,p_name=>'BUTTON_WIDTH'
,p_display_name=>'Button Width'
,p_display_sequence=>1
,p_template_types=>'BUTTON'
,p_null_text=>'Default Width'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(971127625463736975)
,p_theme_id=>142
,p_name=>'FORM_LABEL_WIDTH'
,p_display_name=>'Form Label Width'
,p_display_sequence=>1
,p_template_types=>'REGION'
,p_help_text=>'Help text for Form Label Width'
,p_null_text=>'Default Width'
,p_is_advanced=>'Y'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(971128072347736975)
,p_theme_id=>142
,p_name=>'FORM_LABEL_POSITION'
,p_display_name=>'Form Label Position'
,p_display_sequence=>1
,p_template_types=>'REGION'
,p_null_text=>'Inline - Default'
,p_is_advanced=>'Y'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(971128446154736975)
,p_theme_id=>142
,p_name=>'FORM_ITEMS_SIZE'
,p_display_name=>'Form Items Size'
,p_display_sequence=>1
,p_template_types=>'REGION'
,p_null_text=>'Default Size'
,p_is_advanced=>'Y'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(971128707693736975)
,p_theme_id=>142
,p_name=>'LABEL_ALIGNMENT'
,p_display_name=>'Label Alignment'
,p_display_sequence=>1
,p_template_types=>'REGION'
,p_help_text=>'Set the label text alignment for items within this region.'
,p_null_text=>'Right'
,p_is_advanced=>'Y'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(971128999598736975)
,p_theme_id=>142
,p_name=>'FORM_ITEM_PADDING'
,p_display_name=>'Form Item Padding'
,p_display_sequence=>1
,p_template_types=>'REGION'
,p_null_text=>'Default Padding'
,p_is_advanced=>'Y'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(1032964775577036041)
,p_theme_id=>142
,p_name=>'NAVIGATION_COLOR_SCHEME'
,p_display_name=>'Navigation Color Scheme'
,p_display_sequence=>1
,p_template_types=>'PAGE'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(1055634950550118515)
,p_theme_id=>142
,p_name=>'CURRENT_PAGE'
,p_display_name=>'Current Page'
,p_display_sequence=>1
,p_template_types=>'BREADCRUMB'
,p_null_text=>'Visible - Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(1215037508389691188)
,p_theme_id=>142
,p_name=>'REGION_ACCENT'
,p_display_name=>'Region Accent'
,p_display_sequence=>1
,p_template_types=>'REGION'
,p_null_text=>'Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(1215043449467691198)
,p_theme_id=>142
,p_name=>'LIST_STYLE'
,p_display_name=>'List Style'
,p_display_sequence=>1
,p_template_types=>'LIST'
,p_null_text=>'Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(1254283161118003825)
,p_theme_id=>142
,p_name=>'DIALOG_SIZE'
,p_display_name=>'Dialog Size'
,p_display_sequence=>1
,p_template_types=>'REGION'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(1254285545486003827)
,p_theme_id=>142
,p_name=>'DISPLAY'
,p_display_name=>'Display'
,p_display_sequence=>1
,p_template_types=>'REGION'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(1254304648181003862)
,p_theme_id=>142
,p_name=>'FORM_ITEM_WIDTH'
,p_display_name=>'Form Item Width'
,p_display_sequence=>1
,p_template_types=>'REGION'
,p_null_text=>'Default'
,p_is_advanced=>'Y'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(1340383749298943623)
,p_theme_id=>142
,p_name=>'LABEL_WIDTH'
,p_display_name=>'Label Width'
,p_display_sequence=>10
,p_template_types=>'REPORT'
,p_null_text=>'Default'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(1343890344948300944)
,p_theme_id=>142
,p_name=>'REGION_TITLE'
,p_display_name=>'Region Title'
,p_display_sequence=>1
,p_template_types=>'REGION'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_opt_group(
p_id=>wwv_flow_api.id(1520134944189390266)
,p_theme_id=>142
,p_name=>'COMMENTS_STYLE'
,p_display_name=>'Comments Style'
,p_display_sequence=>1
,p_template_types=>'REPORT'
,p_null_text=>'Default'
,p_is_advanced=>'N'
);
end;
/
prompt --application/shared_components/user_interface/template_options
begin
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(31218796582672636)
,p_theme_id=>42
,p_name=>'REMOVE_BODY_PADDING'
,p_display_name=>'Remove Body Padding'
,p_display_sequence=>20
,p_page_template_id=>wwv_flow_api.id(1774838326496936449)
,p_css_classes=>'t-Dialog--noPadding'
,p_template_types=>'PAGE'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(31236869465672647)
,p_theme_id=>42
,p_name=>'REMOVE_BODY_PADDING'
,p_display_name=>'Remove Body Padding'
,p_display_sequence=>20
,p_page_template_id=>wwv_flow_api.id(1774846340824936463)
,p_css_classes=>'t-Dialog--noPadding'
,p_template_types=>'PAGE'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(31353423212672732)
,p_theme_id=>42
,p_name=>'COLLAPSED_DEFAULT'
,p_display_name=>'Collapsed by Default'
,p_display_sequence=>10
,p_list_template_id=>wwv_flow_api.id(1774880316343936557)
,p_css_classes=>'js-defaultCollapsed'
,p_template_types=>'LIST'
,p_help_text=>'This option will load the side navigation menu in a collapsed state by default.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(31403161550672773)
,p_theme_id=>42
,p_name=>'2_COLUMN_GRID'
,p_display_name=>'2 Column Grid'
,p_display_sequence=>10
,p_report_template_id=>wwv_flow_api.id(31402600142672772)
,p_css_classes=>'t-MediaList--cols t-MediaList--2cols'
,p_group_id=>wwv_flow_api.id(804556336641800190)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(31403515727672773)
,p_theme_id=>42
,p_name=>'3_COLUMN_GRID'
,p_display_name=>'3 Column Grid'
,p_display_sequence=>20
,p_report_template_id=>wwv_flow_api.id(31402600142672772)
,p_css_classes=>'t-MediaList--cols t-MediaList--3cols'
,p_group_id=>wwv_flow_api.id(804556336641800190)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(31403880305672773)
,p_theme_id=>42
,p_name=>'4_COLUMN_GRID'
,p_display_name=>'4 Column Grid'
,p_display_sequence=>30
,p_report_template_id=>wwv_flow_api.id(31402600142672772)
,p_css_classes=>'t-MediaList--cols t-MediaList--4cols'
,p_group_id=>wwv_flow_api.id(804556336641800190)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(31404367712672774)
,p_theme_id=>42
,p_name=>'5_COLUMN_GRID'
,p_display_name=>'5 Column Grid'
,p_display_sequence=>40
,p_report_template_id=>wwv_flow_api.id(31402600142672772)
,p_css_classes=>'t-MediaList--cols t-MediaList--5cols'
,p_group_id=>wwv_flow_api.id(804556336641800190)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(31404669759672774)
,p_theme_id=>42
,p_name=>'APPLY_THEME_COLORS'
,p_display_name=>'Apply Theme Colors'
,p_display_sequence=>40
,p_report_template_id=>wwv_flow_api.id(31402600142672772)
,p_css_classes=>'u-colors'
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(31405126064672774)
,p_theme_id=>42
,p_name=>'SHOW_BADGES'
,p_display_name=>'Show Badges'
,p_display_sequence=>30
,p_report_template_id=>wwv_flow_api.id(31402600142672772)
,p_css_classes=>'t-MediaList--showBadges'
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(31405568622672774)
,p_theme_id=>42
,p_name=>'SHOW_DESCRIPTION'
,p_display_name=>'Show Description'
,p_display_sequence=>20
,p_report_template_id=>wwv_flow_api.id(31402600142672772)
,p_css_classes=>'t-MediaList--showDesc'
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(31405897621672774)
,p_theme_id=>42
,p_name=>'SHOW_ICONS'
,p_display_name=>'Show Icons'
,p_display_sequence=>10
,p_report_template_id=>wwv_flow_api.id(31402600142672772)
,p_css_classes=>'t-MediaList--showIcons'
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(31406269955672775)
,p_theme_id=>42
,p_name=>'SPAN_HORIZONTAL'
,p_display_name=>'Span Horizontal'
,p_display_sequence=>50
,p_report_template_id=>wwv_flow_api.id(31402600142672772)
,p_css_classes=>'t-MediaList--horizontal'
,p_group_id=>wwv_flow_api.id(804556336641800190)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(31406708836672775)
,p_theme_id=>42
,p_name=>'STACK'
,p_display_name=>'Stack'
,p_display_sequence=>5
,p_report_template_id=>wwv_flow_api.id(31402600142672772)
,p_css_classes=>'t-MediaList--stack'
,p_group_id=>wwv_flow_api.id(804556336641800190)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(136454373326065001)
,p_theme_id=>42
,p_name=>'AUTO_HEIGHT_INLINE_DIALOG'
,p_display_name=>'Auto Height'
,p_display_sequence=>1
,p_region_template_id=>wwv_flow_api.id(136453395504065000)
,p_css_classes=>'js-dialog-autoheight'
,p_template_types=>'REGION'
,p_help_text=>'This option will set the height of the dialog to fit its contents.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(136454752728065001)
,p_theme_id=>42
,p_name=>'LARGE_720X480'
,p_display_name=>'Large (720x480)'
,p_display_sequence=>30
,p_region_template_id=>wwv_flow_api.id(136453395504065000)
,p_css_classes=>'js-dialog-size720x480'
,p_group_id=>wwv_flow_api.id(804539508869800181)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(136455195617065001)
,p_theme_id=>42
,p_name=>'MEDIUM_600X400'
,p_display_name=>'Medium (600x400)'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(136453395504065000)
,p_css_classes=>'js-dialog-size600x400'
,p_group_id=>wwv_flow_api.id(804539508869800181)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(136455525677065001)
,p_theme_id=>42
,p_name=>'NONE'
,p_display_name=>'None'
,p_display_sequence=>1
,p_region_template_id=>wwv_flow_api.id(136453395504065000)
,p_css_classes=>'js-dialog-nosize'
,p_group_id=>wwv_flow_api.id(804539508869800181)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(136455959240065001)
,p_theme_id=>42
,p_name=>'SMALL_480X320'
,p_display_name=>'Small (480x320)'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(136453395504065000)
,p_css_classes=>'js-dialog-size480x320'
,p_group_id=>wwv_flow_api.id(804539508869800181)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(162330322426999423)
,p_theme_id=>42
,p_name=>'ADD_ACTIONS'
,p_display_name=>'Add Actions'
,p_display_sequence=>10
,p_list_template_id=>wwv_flow_api.id(2145762120472370629)
,p_css_classes=>'js-addActions'
,p_template_types=>'LIST'
,p_help_text=>'Enables you to define a keyboard shortcut to activate the menu item.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(185201469626477622)
,p_theme_id=>42
,p_name=>'COMPACT'
,p_display_name=>'Compact'
,p_display_sequence=>1
,p_report_template_id=>wwv_flow_api.id(182785794129152129)
,p_css_classes=>'t-Timeline--compact'
,p_group_id=>wwv_flow_api.id(804558397080800192)
,p_template_types=>'REPORT'
,p_help_text=>'Displays a compact version of timeline with smaller text and fewer columns.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(233042501763089608)
,p_theme_id=>42
,p_name=>'SHOW_REGION_ICON'
,p_display_name=>'Show Region Icon'
,p_display_sequence=>30
,p_region_template_id=>wwv_flow_api.id(1124325436919460426)
,p_css_classes=>'t-ContentBlock--showIcon'
,p_template_types=>'REGION'
,p_help_text=>'Displays the region icon in the region header beside the region title'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(233051041819089614)
,p_theme_id=>42
,p_name=>'REMOVE_BODY_PADDING'
,p_display_name=>'Remove Body Padding'
,p_display_sequence=>5
,p_region_template_id=>wwv_flow_api.id(1774858800950936491)
,p_css_classes=>'t-DialogRegion--noPadding'
,p_template_types=>'REGION'
,p_help_text=>'Removes the padding around the region body.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(233055960670089618)
,p_theme_id=>42
,p_name=>'REMOVE_BODY_PADDING'
,p_display_name=>'Remove Body Padding'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(136453395504065000)
,p_css_classes=>'t-DialogRegion--noPadding'
,p_template_types=>'REGION'
,p_help_text=>'Removes the padding around the region body.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(233123779769089667)
,p_theme_id=>42
,p_name=>'STYLE_B'
,p_display_name=>'Style B'
,p_display_sequence=>30
,p_list_template_id=>wwv_flow_api.id(1774880316343936557)
,p_css_classes=>'t-TreeNav--styleB'
,p_group_id=>wwv_flow_api.id(804531903410800177)
,p_template_types=>'LIST'
,p_help_text=>'Style Variation B'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(233124426811089667)
,p_theme_id=>42
,p_name=>'STYLE_A'
,p_display_name=>'Style A'
,p_display_sequence=>20
,p_list_template_id=>wwv_flow_api.id(1774880316343936557)
,p_css_classes=>'t-TreeNav--styleA'
,p_group_id=>wwv_flow_api.id(804531903410800177)
,p_template_types=>'LIST'
,p_help_text=>'Style Variation A'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(233125104762089667)
,p_theme_id=>42
,p_name=>'STYLE_C'
,p_display_name=>'Classic'
,p_display_sequence=>10
,p_list_template_id=>wwv_flow_api.id(1774880316343936557)
,p_css_classes=>'t-TreeNav--classic'
,p_group_id=>wwv_flow_api.id(804531903410800177)
,p_template_types=>'LIST'
,p_help_text=>'Classic Style'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(233137263987089676)
,p_theme_id=>42
,p_name=>'WIZARD_PROGRESS_LINKS'
,p_display_name=>'Make Wizard Steps Clickable'
,p_display_sequence=>40
,p_list_template_id=>wwv_flow_api.id(1774881131647936562)
,p_css_classes=>'js-wizardProgressLinks'
,p_template_types=>'LIST'
,p_help_text=>'This option will make the wizard steps clickable links.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(233187933394089715)
,p_theme_id=>42
,p_name=>'PUSH'
,p_display_name=>'Push'
,p_display_sequence=>20
,p_button_template_id=>wwv_flow_api.id(1774882633017936576)
,p_css_classes=>'t-Button--hoverIconPush'
,p_group_id=>wwv_flow_api.id(804518301644800166)
,p_template_types=>'BUTTON'
,p_help_text=>'The icon will animate to the right or left on button hover or focus.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(233188684372089715)
,p_theme_id=>42
,p_name=>'SPIN'
,p_display_name=>'Spin'
,p_display_sequence=>10
,p_button_template_id=>wwv_flow_api.id(1774882633017936576)
,p_css_classes=>'t-Button--hoverIconSpin'
,p_group_id=>wwv_flow_api.id(804518301644800166)
,p_template_types=>'BUTTON'
,p_help_text=>'The icon will spin on button hover or focus.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(233190999779089717)
,p_theme_id=>42
,p_name=>'PUSH'
,p_display_name=>'Push'
,p_display_sequence=>20
,p_button_template_id=>wwv_flow_api.id(1774882711901936578)
,p_css_classes=>'t-Button--hoverIconPush'
,p_group_id=>wwv_flow_api.id(804518301644800166)
,p_template_types=>'BUTTON'
,p_help_text=>'The icon will animate to the right or left on button hover or focus.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(233191680567089717)
,p_theme_id=>42
,p_name=>'SPIN'
,p_display_name=>'Spin'
,p_display_sequence=>10
,p_button_template_id=>wwv_flow_api.id(1774882711901936578)
,p_css_classes=>'t-Button--hoverIconSpin'
,p_group_id=>wwv_flow_api.id(804518301644800166)
,p_template_types=>'BUTTON'
,p_help_text=>'The icon will spin on button hover or focus.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(233192094831089718)
,p_theme_id=>42
,p_name=>'HIDE_LABEL_ON_MOBILE'
,p_display_name=>'Hide Label on Mobile'
,p_display_sequence=>10
,p_button_template_id=>wwv_flow_api.id(1774882711901936578)
,p_css_classes=>'t-Button--mobileHideLabel'
,p_template_types=>'BUTTON'
,p_help_text=>'This template options hides the button label on small screens.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(272367502971849772)
,p_theme_id=>42
,p_name=>'ICONS_PLUS_OR_MINUS'
,p_display_name=>'Plus or Minus'
,p_display_sequence=>1
,p_region_template_id=>wwv_flow_api.id(1774855849259936482)
,p_css_classes=>'t-Region--hideShowIconsMath'
,p_group_id=>wwv_flow_api.id(804538390703800180)
,p_template_types=>'REGION'
,p_help_text=>'Use the plus and minus icons for the expand and collapse button.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(272368265097849772)
,p_theme_id=>42
,p_name=>'CONRTOLS_POSITION_END'
,p_display_name=>'End'
,p_display_sequence=>1
,p_region_template_id=>wwv_flow_api.id(1774855849259936482)
,p_css_classes=>'t-Region--controlsPosEnd'
,p_group_id=>wwv_flow_api.id(804538729207800180)
,p_template_types=>'REGION'
,p_help_text=>'Position the expand / collapse button to the end of the region header.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(272385485647849785)
,p_theme_id=>42
,p_name=>'ICONS_SQUARE'
,p_display_name=>'Square'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(1774855340336936480)
,p_css_classes=>'t-HeroRegion--iconsSquare'
,p_group_id=>wwv_flow_api.id(804542341212800182)
,p_template_types=>'REGION'
,p_help_text=>'The icons are displayed within a square.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(272386162816849786)
,p_theme_id=>42
,p_name=>'ICONS_CIRCULAR'
,p_display_name=>'Circle'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1774855340336936480)
,p_css_classes=>'t-HeroRegion--iconsCircle'
,p_group_id=>wwv_flow_api.id(804542341212800182)
,p_template_types=>'REGION'
,p_help_text=>'The icons are displayed within a circle.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(272395598337849793)
,p_theme_id=>42
,p_name=>'REMOVE_PAGE_OVERLAY'
,p_display_name=>'Remove Page Overlay'
,p_display_sequence=>30
,p_region_template_id=>wwv_flow_api.id(136453395504065000)
,p_css_classes=>'js-popup-noOverlay'
,p_template_types=>'REGION'
,p_help_text=>'This option will display the inline dialog without an overlay on the background.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(272440856438849828)
,p_theme_id=>42
,p_name=>'ICONS_SQUARE'
,p_display_name=>'Square'
,p_display_sequence=>20
,p_list_template_id=>wwv_flow_api.id(1774874589747936542)
,p_css_classes=>'t-Cards--iconsSquare'
,p_group_id=>wwv_flow_api.id(804529546579800172)
,p_template_types=>'LIST'
,p_help_text=>'The icons are displayed within a square shape.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(272441578427849828)
,p_theme_id=>42
,p_name=>'ICONS_ROUNDED'
,p_display_name=>'Rounded Corners'
,p_display_sequence=>10
,p_list_template_id=>wwv_flow_api.id(1774874589747936542)
,p_css_classes=>'t-Cards--iconsRounded'
,p_group_id=>wwv_flow_api.id(804529546579800172)
,p_template_types=>'LIST'
,p_help_text=>'The icons are displayed within a square with rounded corners.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(272458740518849842)
,p_theme_id=>42
,p_name=>'ICONS_SQUARE'
,p_display_name=>'Square'
,p_display_sequence=>20
,p_list_template_id=>wwv_flow_api.id(1774878219827936547)
,p_css_classes=>'t-MediaList--iconsSquare'
,p_group_id=>wwv_flow_api.id(804529546579800172)
,p_template_types=>'LIST'
,p_help_text=>'The icons are displayed within a square shape.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(272459465065849842)
,p_theme_id=>42
,p_name=>'ICONS_ROUNDED'
,p_display_name=>'Rounded Corners'
,p_display_sequence=>10
,p_list_template_id=>wwv_flow_api.id(1774878219827936547)
,p_css_classes=>'t-MediaList--iconsRounded'
,p_group_id=>wwv_flow_api.id(804529546579800172)
,p_template_types=>'LIST'
,p_help_text=>'The icons are displayed within a square with rounded corners.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(272493199342849868)
,p_theme_id=>42
,p_name=>'ICONS_SQUARE'
,p_display_name=>'Square'
,p_display_sequence=>20
,p_report_template_id=>wwv_flow_api.id(1774866287250936513)
,p_css_classes=>'t-Cards--iconsSquare'
,p_group_id=>wwv_flow_api.id(804555533444800189)
,p_template_types=>'REPORT'
,p_help_text=>'The icons are displayed within a square shape.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(272493850820849869)
,p_theme_id=>42
,p_name=>'ICONS_ROUNDED'
,p_display_name=>'Rounded Corners'
,p_display_sequence=>10
,p_report_template_id=>wwv_flow_api.id(1774866287250936513)
,p_css_classes=>'t-Cards--iconsRounded'
,p_group_id=>wwv_flow_api.id(804555533444800189)
,p_template_types=>'REPORT'
,p_help_text=>'The icons are displayed within a square with rounded corners.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(272507456036849879)
,p_theme_id=>42
,p_name=>'ICONS_SQUARE'
,p_display_name=>'Square'
,p_display_sequence=>20
,p_report_template_id=>wwv_flow_api.id(1774868688704936519)
,p_css_classes=>'t-Comments--iconsSquare'
,p_group_id=>wwv_flow_api.id(804555533444800189)
,p_template_types=>'REPORT'
,p_help_text=>'The icons are displayed within a square shape.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(272508116445849879)
,p_theme_id=>42
,p_name=>'ICONS_ROUNDED'
,p_display_name=>'Rounded Corners'
,p_display_sequence=>10
,p_report_template_id=>wwv_flow_api.id(1774868688704936519)
,p_css_classes=>'t-Comments--iconsRounded'
,p_group_id=>wwv_flow_api.id(804555533444800189)
,p_template_types=>'REPORT'
,p_help_text=>'The icons are displayed within a square with rounded corners.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(272511521472849882)
,p_theme_id=>42
,p_name=>'ICONS_SQUARE'
,p_display_name=>'Square'
,p_display_sequence=>20
,p_report_template_id=>wwv_flow_api.id(31402600142672772)
,p_css_classes=>'t-MediaList--iconsSquare'
,p_group_id=>wwv_flow_api.id(804555533444800189)
,p_template_types=>'REPORT'
,p_help_text=>'The icons are displayed within a square shape.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(272512220181849882)
,p_theme_id=>42
,p_name=>'ICONS_ROUNDED'
,p_display_name=>'Rounded Corners'
,p_display_sequence=>10
,p_report_template_id=>wwv_flow_api.id(31402600142672772)
,p_css_classes=>'t-MediaList--iconsRounded'
,p_group_id=>wwv_flow_api.id(804555533444800189)
,p_template_types=>'REPORT'
,p_help_text=>'The icons are displayed within a square with rounded corners.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(428777619042299341)
,p_theme_id=>42
,p_name=>'SHOW_REGION_ICON'
,p_display_name=>'Show Region Icon'
,p_display_sequence=>50
,p_region_template_id=>wwv_flow_api.id(1774851103376936475)
,p_css_classes=>'t-Region--showIcon'
,p_template_types=>'REGION'
,p_help_text=>'Displays the region icon in the region header beside the region title'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(428819757004299377)
,p_theme_id=>42
,p_name=>'SHOW_REGION_ICON'
,p_display_name=>'Show Region Icon'
,p_display_sequence=>30
,p_region_template_id=>wwv_flow_api.id(1774859855390936493)
,p_css_classes=>'t-Region--showIcon'
,p_template_types=>'REGION'
,p_help_text=>'Displays the region icon in the region header beside the region title'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(428847692723299404)
,p_theme_id=>42
,p_name=>'APPLY_THEME_COLORS'
,p_display_name=>'Apply Theme Colors'
,p_display_sequence=>10
,p_list_template_id=>wwv_flow_api.id(1774872583686936536)
,p_css_classes=>'u-colors'
,p_template_types=>'LIST'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(428848400410299405)
,p_theme_id=>42
,p_name=>'CIRCULAR'
,p_display_name=>'Circular'
,p_display_sequence=>20
,p_list_template_id=>wwv_flow_api.id(1774872583686936536)
,p_css_classes=>'t-BadgeList--circular'
,p_group_id=>wwv_flow_api.id(804531903410800177)
,p_template_types=>'LIST'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(428849078252299406)
,p_theme_id=>42
,p_name=>'GRID'
,p_display_name=>'Grid'
,p_display_sequence=>30
,p_list_template_id=>wwv_flow_api.id(1774872583686936536)
,p_css_classes=>'t-BadgeList--dash'
,p_group_id=>wwv_flow_api.id(804531903410800177)
,p_template_types=>'LIST'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(428859081285299416)
,p_theme_id=>42
,p_name=>'DISPLAY_SUBTITLE'
,p_display_name=>'Display Subtitle'
,p_display_sequence=>20
,p_list_template_id=>wwv_flow_api.id(1774874589747936542)
,p_css_classes=>'t-Cards--displaySubtitle'
,p_template_types=>'LIST'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(428859774151299416)
,p_theme_id=>42
,p_name=>'BLOCK'
,p_display_name=>'Block'
,p_display_sequence=>40
,p_list_template_id=>wwv_flow_api.id(1774874589747936542)
,p_css_classes=>'t-Cards--featured t-Cards--block force-fa-lg'
,p_group_id=>wwv_flow_api.id(804531903410800177)
,p_template_types=>'LIST'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(428891584329299449)
,p_theme_id=>42
,p_name=>'NO_LABEL_LG'
,p_display_name=>'Do not display labels'
,p_display_sequence=>30
,p_list_template_id=>wwv_flow_api.id(31362403217672739)
,p_css_classes=>'t-NavTabs--hiddenLabels-lg'
,p_group_id=>wwv_flow_api.id(804528392038800171)
,p_template_types=>'LIST'
,p_help_text=>'Hides the label for the list item'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(428892306029299449)
,p_theme_id=>42
,p_name=>'LABEL_INLINE_LG'
,p_display_name=>'Display labels inline'
,p_display_sequence=>10
,p_list_template_id=>wwv_flow_api.id(31362403217672739)
,p_css_classes=>'t-NavTabs--inlineLabels-lg'
,p_group_id=>wwv_flow_api.id(804528392038800171)
,p_template_types=>'LIST'
,p_help_text=>'Display the label inline with the icon and badge'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(428892984384299450)
,p_theme_id=>42
,p_name=>'LABEL_ABOVE_LG'
,p_display_name=>'Display labels above'
,p_display_sequence=>20
,p_list_template_id=>wwv_flow_api.id(31362403217672739)
,p_css_classes=>'t-NavTabs--stacked'
,p_group_id=>wwv_flow_api.id(804528392038800171)
,p_template_types=>'LIST'
,p_help_text=>'Display the label stacked above the icon and badge'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(428893697622299450)
,p_theme_id=>42
,p_name=>'DISPLAY_LABELS_SM'
,p_display_name=>'Display labels'
,p_display_sequence=>40
,p_list_template_id=>wwv_flow_api.id(31362403217672739)
,p_css_classes=>'t-NavTabs--displayLabels-sm'
,p_group_id=>wwv_flow_api.id(804531186510800176)
,p_template_types=>'LIST'
,p_help_text=>'Displays the label for the list items below the icon'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(428894444731299451)
,p_theme_id=>42
,p_name=>'HIDE_LABELS_SM'
,p_display_name=>'Do not display labels'
,p_display_sequence=>50
,p_list_template_id=>wwv_flow_api.id(31362403217672739)
,p_css_classes=>'t-NavTabs--hiddenLabels-sm'
,p_group_id=>wwv_flow_api.id(804531186510800176)
,p_template_types=>'LIST'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(428901086947299461)
,p_theme_id=>42
,p_name=>'APPLY_THEME_COLORS'
,p_display_name=>'Apply Theme Colors'
,p_display_sequence=>10
,p_report_template_id=>wwv_flow_api.id(1774864081583936507)
,p_css_classes=>'u-colors'
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(428901836996299461)
,p_theme_id=>42
,p_name=>'CIRCULAR'
,p_display_name=>'Circular'
,p_display_sequence=>20
,p_report_template_id=>wwv_flow_api.id(1774864081583936507)
,p_css_classes=>'t-BadgeList--circular'
,p_group_id=>wwv_flow_api.id(804558397080800192)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(428902496754299462)
,p_theme_id=>42
,p_name=>'GRID'
,p_display_name=>'Grid'
,p_display_sequence=>30
,p_report_template_id=>wwv_flow_api.id(1774864081583936507)
,p_css_classes=>'t-BadgeList--dash'
,p_group_id=>wwv_flow_api.id(804558397080800192)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(428912799737299471)
,p_theme_id=>42
,p_name=>'BLOCK'
,p_display_name=>'Block'
,p_display_sequence=>40
,p_report_template_id=>wwv_flow_api.id(1774866287250936513)
,p_css_classes=>'t-Cards--featured t-Cards--block force-fa-lg'
,p_group_id=>wwv_flow_api.id(804558397080800192)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(428913228735299471)
,p_theme_id=>42
,p_name=>'DISPLAY_SUBTITLE'
,p_display_name=>'Display Subtitle'
,p_display_sequence=>20
,p_report_template_id=>wwv_flow_api.id(1774866287250936513)
,p_css_classes=>'t-Cards--displaySubtitle'
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(477602437754977727)
,p_theme_id=>42
,p_name=>'USE_COMPACT_STYLE'
,p_display_name=>'Use Compact Style'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1774862430658936498)
,p_css_classes=>'t-BreadcrumbRegion--compactTitle'
,p_template_types=>'REGION'
,p_help_text=>'Uses a compact style for the breadcrumbs.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(477675305513977783)
,p_theme_id=>42
,p_name=>'LARGE'
,p_display_name=>'Large'
,p_display_sequence=>20
,p_report_template_id=>wwv_flow_api.id(31402600142672772)
,p_css_classes=>'t-MediaList--large force-fa-lg'
,p_group_id=>wwv_flow_api.id(804557959513800192)
,p_template_types=>'REPORT'
,p_help_text=>'Increases the size of the text and icons in the list.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(551389850117967681)
,p_theme_id=>42
,p_name=>'STRETCH_TO_FIT_WINDOW'
,p_display_name=>'Stretch to Fit Window'
,p_display_sequence=>1
,p_page_template_id=>wwv_flow_api.id(1774838326496936449)
,p_css_classes=>'ui-dialog--stretch'
,p_template_types=>'PAGE'
,p_help_text=>'Stretch the dialog to fit the browser window.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(551407648637967695)
,p_theme_id=>42
,p_name=>'STRETCH_TO_FIT_WINDOW'
,p_display_name=>'Stretch to Fit Window'
,p_display_sequence=>10
,p_page_template_id=>wwv_flow_api.id(1774846340824936463)
,p_css_classes=>'ui-dialog--stretch'
,p_template_types=>'PAGE'
,p_help_text=>'Stretch the dialog to fit the browser window.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(551457508054967753)
,p_theme_id=>42
,p_name=>'TEXT_CONTENT'
,p_display_name=>'Text Content'
,p_display_sequence=>40
,p_region_template_id=>wwv_flow_api.id(1774859855390936493)
,p_css_classes=>'t-Region--textContent'
,p_group_id=>wwv_flow_api.id(804547523949800185)
,p_template_types=>'REGION'
,p_help_text=>'Useful for displaying primarily text-based content, such as FAQs and more.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(574306693589650322)
,p_theme_id=>42
,p_name=>'DISPLAY_MENU_CALLOUT'
,p_display_name=>'Display Menu Callout'
,p_display_sequence=>20
,p_list_template_id=>wwv_flow_api.id(574306143870650315)
,p_css_classes=>'js-menu-callout'
,p_template_types=>'LIST'
,p_help_text=>'Displays a callout arrow that points to where the menu was activated from.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(574307058097650322)
,p_theme_id=>42
,p_name=>'FULL_WIDTH'
,p_display_name=>'Full Width'
,p_display_sequence=>10
,p_list_template_id=>wwv_flow_api.id(574306143870650315)
,p_css_classes=>'t-MegaMenu--fullWidth'
,p_template_types=>'LIST'
,p_help_text=>'Stretches the menu to fill the width of the screen.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(574307437415650322)
,p_theme_id=>42
,p_name=>'2_COLUMNS'
,p_display_name=>'2 Columns'
,p_display_sequence=>10
,p_list_template_id=>wwv_flow_api.id(574306143870650315)
,p_css_classes=>'t-MegaMenu--layout2Cols'
,p_group_id=>wwv_flow_api.id(804530712278800176)
,p_template_types=>'LIST'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(574307800397650322)
,p_theme_id=>42
,p_name=>'3_COLUMNS'
,p_display_name=>'3 Columns'
,p_display_sequence=>20
,p_list_template_id=>wwv_flow_api.id(574306143870650315)
,p_css_classes=>'t-MegaMenu--layout3Cols'
,p_group_id=>wwv_flow_api.id(804530712278800176)
,p_template_types=>'LIST'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(574308268358650323)
,p_theme_id=>42
,p_name=>'4_COLUMNS'
,p_display_name=>'4 Columns'
,p_display_sequence=>30
,p_list_template_id=>wwv_flow_api.id(574306143870650315)
,p_css_classes=>'t-MegaMenu--layout4Cols'
,p_group_id=>wwv_flow_api.id(804530712278800176)
,p_template_types=>'LIST'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(574308674707650323)
,p_theme_id=>42
,p_name=>'5_COLUMNS'
,p_display_name=>'5 Columns'
,p_display_sequence=>40
,p_list_template_id=>wwv_flow_api.id(574306143870650315)
,p_css_classes=>'t-MegaMenu--layout5Cols'
,p_group_id=>wwv_flow_api.id(804530712278800176)
,p_template_types=>'LIST'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(574309042191650323)
,p_theme_id=>42
,p_name=>'CUSTOM'
,p_display_name=>'Custom'
,p_display_sequence=>60
,p_list_template_id=>wwv_flow_api.id(574306143870650315)
,p_css_classes=>'t-MegaMenu--layoutCustom'
,p_group_id=>wwv_flow_api.id(804530712278800176)
,p_template_types=>'LIST'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(574309445727650323)
,p_theme_id=>42
,p_name=>'STACKED'
,p_display_name=>'Stacked'
,p_display_sequence=>60
,p_list_template_id=>wwv_flow_api.id(574306143870650315)
,p_css_classes=>'t-MegaMenu--layoutStacked'
,p_group_id=>wwv_flow_api.id(804530712278800176)
,p_template_types=>'LIST'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(578596442812282618)
,p_theme_id=>42
,p_name=>'AUTO_HEIGHT_INLINE_DIALOG'
,p_display_name=>'Auto Height'
,p_display_sequence=>1
,p_region_template_id=>wwv_flow_api.id(1774858800950936491)
,p_css_classes=>'js-dialog-autoheight'
,p_template_types=>'REGION'
,p_help_text=>'This option will set the height of the dialog to fit its contents.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(620055715004571354)
,p_theme_id=>42
,p_name=>'PAGE_BACKGROUND_3'
,p_display_name=>'Background 3'
,p_display_sequence=>30
,p_page_template_id=>wwv_flow_api.id(1774830836871936435)
,p_css_classes=>'t-LoginPage--bg3'
,p_group_id=>wwv_flow_api.id(804533130849800178)
,p_template_types=>'PAGE'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(620056490873571354)
,p_theme_id=>42
,p_name=>'PAGE_LAYOUT_SPLIT'
,p_display_name=>'Split'
,p_display_sequence=>1
,p_page_template_id=>wwv_flow_api.id(1774830836871936435)
,p_css_classes=>'t-LoginPage--split'
,p_group_id=>wwv_flow_api.id(804533575908800178)
,p_template_types=>'PAGE'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(620057111867571355)
,p_theme_id=>42
,p_name=>'PAGE_BACKGROUND_1'
,p_display_name=>'Background 1'
,p_display_sequence=>10
,p_page_template_id=>wwv_flow_api.id(1774830836871936435)
,p_css_classes=>'t-LoginPage--bg1'
,p_group_id=>wwv_flow_api.id(804533130849800178)
,p_template_types=>'PAGE'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(620057895524571355)
,p_theme_id=>42
,p_name=>'PAGE_BACKGROUND_2'
,p_display_name=>'Background 2'
,p_display_sequence=>20
,p_page_template_id=>wwv_flow_api.id(1774830836871936435)
,p_css_classes=>'t-LoginPage--bg2'
,p_group_id=>wwv_flow_api.id(804533130849800178)
,p_template_types=>'PAGE'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(620157108839571431)
,p_theme_id=>42
,p_name=>'DISPLAY_POPUP_CALLOUT'
,p_display_name=>'Display Popup Callout'
,p_display_sequence=>40
,p_region_template_id=>wwv_flow_api.id(136453395504065000)
,p_css_classes=>'js-popup-callout'
,p_template_types=>'REGION'
,p_help_text=>'Use this option to add display a callout for the popup. Note that callout will only be displayed if the data-parent-element custom attribute is defined.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(620157867022571432)
,p_theme_id=>42
,p_name=>'BEFORE'
,p_display_name=>'Before'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(136453395504065000)
,p_css_classes=>'js-popup-pos-before'
,p_group_id=>wwv_flow_api.id(804537999086800180)
,p_template_types=>'REGION'
,p_help_text=>'Positions the callout before or typically to the left of the parent.'
);
end;
/
begin
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(620158510981571432)
,p_theme_id=>42
,p_name=>'AFTER'
,p_display_name=>'After'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(136453395504065000)
,p_css_classes=>'js-popup-pos-after'
,p_group_id=>wwv_flow_api.id(804537999086800180)
,p_template_types=>'REGION'
,p_help_text=>'Positions the callout after or typically to the right of the parent.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(620159284428571433)
,p_theme_id=>42
,p_name=>'ABOVE'
,p_display_name=>'Above'
,p_display_sequence=>30
,p_region_template_id=>wwv_flow_api.id(136453395504065000)
,p_css_classes=>'js-popup-pos-above'
,p_group_id=>wwv_flow_api.id(804537999086800180)
,p_template_types=>'REGION'
,p_help_text=>'Positions the callout above or typically on top of the parent.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(620159984265571433)
,p_theme_id=>42
,p_name=>'BELOW'
,p_display_name=>'Below'
,p_display_sequence=>40
,p_region_template_id=>wwv_flow_api.id(136453395504065000)
,p_css_classes=>'js-popup-pos-below'
,p_group_id=>wwv_flow_api.id(804537999086800180)
,p_template_types=>'REGION'
,p_help_text=>'Positions the callout below or typically to the bottom of the parent.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(620160695575571434)
,p_theme_id=>42
,p_name=>'INSIDE'
,p_display_name=>'Inside'
,p_display_sequence=>50
,p_region_template_id=>wwv_flow_api.id(136453395504065000)
,p_css_classes=>'js-popup-pos-inside'
,p_group_id=>wwv_flow_api.id(804537999086800180)
,p_template_types=>'REGION'
,p_help_text=>'Positions the callout inside of the parent. This is useful when the parent is sufficiently large, such as a report or large region.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(620170053818571441)
,p_theme_id=>42
,p_name=>'LOGIN_HEADER_ICON'
,p_display_name=>'Icon'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1774858630756936489)
,p_css_classes=>'t-Login-region--headerIcon'
,p_group_id=>wwv_flow_api.id(804545188343800184)
,p_template_types=>'REGION'
,p_help_text=>'Displays only the Region Icon in the Login region.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(620170716054571442)
,p_theme_id=>42
,p_name=>'LOGIN_HEADER_TITLE'
,p_display_name=>'Title'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(1774858630756936489)
,p_css_classes=>'t-Login-region--headerTitle js-removeLandmark'
,p_group_id=>wwv_flow_api.id(804545188343800184)
,p_template_types=>'REGION'
,p_help_text=>'Displays only the Region Title in the Login region.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(620171453678571442)
,p_theme_id=>42
,p_name=>'LOGO_HEADER_HIDDEN'
,p_display_name=>'Hidden'
,p_display_sequence=>30
,p_region_template_id=>wwv_flow_api.id(1774858630756936489)
,p_css_classes=>'t-Login-region--headerHidden js-removeLandmark'
,p_group_id=>wwv_flow_api.id(804545188343800184)
,p_template_types=>'REGION'
,p_help_text=>'Hides both the Region Icon and Title from the Login region.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(620235639113571500)
,p_theme_id=>42
,p_name=>'DISPLAY_MENU_CALLOUT'
,p_display_name=>'Display Menu Callout'
,p_display_sequence=>50
,p_list_template_id=>wwv_flow_api.id(1774879954637936553)
,p_css_classes=>'js-menu-callout'
,p_template_types=>'LIST'
,p_help_text=>'Use this option to add display a callout for the menu.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(620237874743571501)
,p_theme_id=>42
,p_name=>'DISPLAY_MENU_CALLOUT'
,p_display_name=>'Display Menu Callout'
,p_display_sequence=>20
,p_list_template_id=>wwv_flow_api.id(2145762120472370629)
,p_css_classes=>'js-menu-callout'
,p_template_types=>'LIST'
,p_help_text=>'Use this option to add display a callout for the menu. Note that callout will only be displayed if the data-parent-element custom attribute is defined.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(620239125523571502)
,p_theme_id=>42
,p_name=>'DISPLAY_MENU_CALLOUT'
,p_display_name=>'Display Menu Callout'
,p_display_sequence=>10
,p_list_template_id=>wwv_flow_api.id(1774880169096936555)
,p_css_classes=>'js-menu-callout'
,p_template_types=>'LIST'
,p_help_text=>'Use this option to add display a callout for the menu.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(620240400253571503)
,p_theme_id=>42
,p_name=>'ICON_DEFAULT'
,p_display_name=>'Icon (Default)'
,p_display_sequence=>10
,p_list_template_id=>wwv_flow_api.id(1774880316343936557)
,p_css_classes=>'js-navCollapsed--default'
,p_group_id=>wwv_flow_api.id(804527562180800171)
,p_template_types=>'LIST'
,p_help_text=>'Display icons when the navigation menu is collapsed for large screens.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(620241143408571504)
,p_theme_id=>42
,p_name=>'COLLAPSE_STYLE_HIDDEN'
,p_display_name=>'Hidden'
,p_display_sequence=>20
,p_list_template_id=>wwv_flow_api.id(1774880316343936557)
,p_css_classes=>'js-navCollapsed--hidden'
,p_group_id=>wwv_flow_api.id(804527562180800171)
,p_template_types=>'LIST'
,p_help_text=>'Completely hide the navigation menu when it is collapsed.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(620249614979571510)
,p_theme_id=>42
,p_name=>'DISPLAY_MENU_CALLOUT'
,p_display_name=>'Display Menu Callout'
,p_display_sequence=>50
,p_list_template_id=>wwv_flow_api.id(1774880492604936559)
,p_css_classes=>'js-menu-callout'
,p_template_types=>'LIST'
,p_help_text=>'Use this option to add display a callout for the menu.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(620307180512571554)
,p_theme_id=>42
,p_name=>'ACTIONS_HIDDEN'
,p_display_name=>'Hidden'
,p_display_sequence=>60
,p_report_template_id=>wwv_flow_api.id(620306615375571554)
,p_css_classes=>'t-ContentRow--hideActions'
,p_group_id=>wwv_flow_api.id(804551190349800187)
,p_template_types=>'REPORT'
,p_help_text=>'Hides the Actions column from being rendered on the screen.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(620307588035571555)
,p_theme_id=>42
,p_name=>'ALIGNMENT_TOP'
,p_display_name=>'Top'
,p_display_sequence=>100
,p_report_template_id=>wwv_flow_api.id(620306615375571554)
,p_css_classes=>'t-ContentRow--alignTop'
,p_group_id=>wwv_flow_api.id(804553983260800189)
,p_template_types=>'REPORT'
,p_help_text=>'Aligns the content to the top of the row. This is useful when you expect that yours rows will vary in height (e.g. some rows will have longer descriptions than others).'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(620307957467571555)
,p_theme_id=>42
,p_name=>'DESCRIPTION_HIDDEN'
,p_display_name=>'Hidden'
,p_display_sequence=>40
,p_report_template_id=>wwv_flow_api.id(620306615375571554)
,p_css_classes=>'t-ContentRow--hideDescription'
,p_group_id=>wwv_flow_api.id(804551598901800187)
,p_template_types=>'REPORT'
,p_help_text=>'Hides the Description from being rendered on the screen.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(620308369827571555)
,p_theme_id=>42
,p_name=>'ICON_HIDDEN'
,p_display_name=>'Hidden'
,p_display_sequence=>20
,p_report_template_id=>wwv_flow_api.id(620306615375571554)
,p_css_classes=>'t-ContentRow--hideIcon'
,p_group_id=>wwv_flow_api.id(804552345258800188)
,p_template_types=>'REPORT'
,p_help_text=>'Hides the Icon from being rendered on the screen.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(620308725847571555)
,p_theme_id=>42
,p_name=>'MISC_HIDDEN'
,p_display_name=>'Hidden'
,p_display_sequence=>50
,p_report_template_id=>wwv_flow_api.id(620306615375571554)
,p_css_classes=>'t-ContentRow--hideMisc'
,p_group_id=>wwv_flow_api.id(804552799341800188)
,p_template_types=>'REPORT'
,p_help_text=>'Hides the Misc column from being rendered on the screen.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(620309184282571556)
,p_theme_id=>42
,p_name=>'SELECTION_HIDDEN'
,p_display_name=>'Hidden'
,p_display_sequence=>10
,p_report_template_id=>wwv_flow_api.id(620306615375571554)
,p_css_classes=>'t-ContentRow--hideSelection'
,p_group_id=>wwv_flow_api.id(804553135986800188)
,p_template_types=>'REPORT'
,p_help_text=>'Hides the Selection column from being rendered on the screen.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(620309582189571556)
,p_theme_id=>42
,p_name=>'STYLE_COMPACT'
,p_display_name=>'Compact'
,p_display_sequence=>1
,p_report_template_id=>wwv_flow_api.id(620306615375571554)
,p_css_classes=>'t-ContentRow--styleCompact'
,p_group_id=>wwv_flow_api.id(804558397080800192)
,p_template_types=>'REPORT'
,p_help_text=>'This option reduces the padding and font sizes to present a compact display of the same information.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(620309999357571556)
,p_theme_id=>42
,p_name=>'TITLE_HIDDEN'
,p_display_name=>'Hidden'
,p_display_sequence=>30
,p_report_template_id=>wwv_flow_api.id(620306615375571554)
,p_css_classes=>'t-ContentRow--hideTitle'
,p_group_id=>wwv_flow_api.id(804551912266800188)
,p_template_types=>'REPORT'
,p_help_text=>'Hides the Title from being rendered on the screen.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(647758382980271192)
,p_theme_id=>42
,p_name=>'HEADING_FONT_ALTERNATIVE'
,p_display_name=>'Alternative'
,p_display_sequence=>1
,p_region_template_id=>wwv_flow_api.id(1124325436919460426)
,p_css_classes=>'t-ContentBlock--headingFontAlt'
,p_group_id=>wwv_flow_api.id(804541142025800182)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(647764430158271197)
,p_theme_id=>42
,p_name=>'HEADING_FONT_ALTERNATIVE'
,p_display_name=>'Alternative'
,p_display_sequence=>1
,p_region_template_id=>wwv_flow_api.id(1774855340336936480)
,p_css_classes=>'t-HeroRegion--headingFontAlt'
,p_group_id=>wwv_flow_api.id(804541142025800182)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(647819322363271239)
,p_theme_id=>42
,p_name=>'HEADING_FONT_ALTERNATIVE'
,p_display_name=>'Alternative'
,p_display_sequence=>1
,p_region_template_id=>wwv_flow_api.id(1774862430658936498)
,p_css_classes=>'t-BreadcrumbRegion--headingFontAlt'
,p_group_id=>wwv_flow_api.id(804541142025800182)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(647936535823271330)
,p_theme_id=>42
,p_name=>'INDICATOR_ASTERISK'
,p_display_name=>'Asterisk'
,p_display_sequence=>10
,p_field_template_id=>wwv_flow_api.id(1774882441270936571)
,p_css_classes=>'t-Form-fieldContainer--indicatorAsterisk'
,p_group_id=>wwv_flow_api.id(804524740728800169)
,p_template_types=>'FIELD'
,p_help_text=>'Displays an asterisk * on required items.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(647937226267271330)
,p_theme_id=>42
,p_name=>'INDICATOR_LABEL'
,p_display_name=>'Inline Label'
,p_display_sequence=>20
,p_field_template_id=>wwv_flow_api.id(1774882441270936571)
,p_css_classes=>'t-Form-fieldContainer--indicatorLabel'
,p_group_id=>wwv_flow_api.id(804524740728800169)
,p_template_types=>'FIELD'
,p_help_text=>'Displays "Required" inline.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(647939341622271332)
,p_theme_id=>42
,p_name=>'INDICATOR_ASTERISK'
,p_display_name=>'Asterisk'
,p_display_sequence=>10
,p_field_template_id=>wwv_flow_api.id(1774882542426936574)
,p_css_classes=>'t-Form-fieldContainer--indicatorAsterisk'
,p_group_id=>wwv_flow_api.id(804524740728800169)
,p_template_types=>'FIELD'
,p_help_text=>'Displays an asterisk * on required items.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(647940039363271332)
,p_theme_id=>42
,p_name=>'INDICATOR_LABEL'
,p_display_name=>'Inline Label'
,p_display_sequence=>20
,p_field_template_id=>wwv_flow_api.id(1774882542426936574)
,p_css_classes=>'t-Form-fieldContainer--indicatorLabel'
,p_group_id=>wwv_flow_api.id(804524740728800169)
,p_template_types=>'FIELD'
,p_help_text=>'Displays "Required" inline.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(647942178154271334)
,p_theme_id=>42
,p_name=>'INDICATOR_ASTERISK'
,p_display_name=>'Asterisk'
,p_display_sequence=>10
,p_field_template_id=>wwv_flow_api.id(274822744073356429)
,p_css_classes=>'t-Form-fieldContainer--indicatorAsterisk'
,p_group_id=>wwv_flow_api.id(804524740728800169)
,p_template_types=>'FIELD'
,p_help_text=>'Displays an asterisk * on required items.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(647942864489271334)
,p_theme_id=>42
,p_name=>'INDICATOR_LABEL'
,p_display_name=>'Inline Label'
,p_display_sequence=>20
,p_field_template_id=>wwv_flow_api.id(274822744073356429)
,p_css_classes=>'t-Form-fieldContainer--indicatorLabel'
,p_group_id=>wwv_flow_api.id(804524740728800169)
,p_template_types=>'FIELD'
,p_help_text=>'Displays "Required" inline.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(703425229101554649)
,p_theme_id=>42
,p_name=>'APPLY_THEME_COLORS'
,p_display_name=>'Apply Theme Colors'
,p_display_sequence=>1
,p_region_template_id=>wwv_flow_api.id(703424774023554648)
,p_css_classes=>'u-colors'
,p_template_types=>'REGION'
,p_help_text=>'Applies the colors from the theme''s color palette to the icons or initials within cards.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(703425649387554649)
,p_theme_id=>42
,p_name=>'STYLE_A'
,p_display_name=>'Style A'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(703424774023554648)
,p_css_classes=>'t-CardsRegion--styleA'
,p_group_id=>wwv_flow_api.id(804547523949800185)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(703426096530554649)
,p_theme_id=>42
,p_name=>'STYLE_B'
,p_display_name=>'Style B'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(703424774023554648)
,p_css_classes=>'t-CardsRegion--styleB'
,p_group_id=>wwv_flow_api.id(804547523949800185)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(703426445049554649)
,p_theme_id=>42
,p_name=>'STYLE_C'
,p_display_name=>'Style C'
,p_display_sequence=>30
,p_region_template_id=>wwv_flow_api.id(703424774023554648)
,p_css_classes=>'t-CardsRegion--styleC'
,p_group_id=>wwv_flow_api.id(804547523949800185)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(703462592756554678)
,p_theme_id=>42
,p_name=>'ADD_ACTIONS'
,p_display_name=>'Add Actions'
,p_display_sequence=>1
,p_list_template_id=>wwv_flow_api.id(1774880316343936557)
,p_css_classes=>'js-addActions'
,p_template_types=>'LIST'
,p_help_text=>'Use this option to add shortcuts for menu items. Note that actions.js must be included on your page to support this functionality.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(703471393518554686)
,p_theme_id=>42
,p_name=>'ADD_ACTIONS'
,p_display_name=>'Add Actions'
,p_display_sequence=>1
,p_list_template_id=>wwv_flow_api.id(574306143870650315)
,p_css_classes=>'js-addActions'
,p_template_types=>'LIST'
,p_help_text=>'Use this option to add shortcuts for menu items. Note that actions.js must be included on your page to support this functionality.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(751751935576146912)
,p_theme_id=>42
,p_name=>'FEATURED'
,p_display_name=>'Featured'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1774855340336936480)
,p_css_classes=>'t-HeroRegion--featured'
,p_group_id=>wwv_flow_api.id(804547523949800185)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(751752613267146913)
,p_theme_id=>42
,p_name=>'DISPLAY_ICON_NO'
,p_display_name=>'No'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1774855340336936480)
,p_css_classes=>'t-HeroRegion--hideIcon'
,p_group_id=>wwv_flow_api.id(804539933964800181)
,p_template_types=>'REGION'
,p_help_text=>'Hide the Hero Region icon.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(751753309781146914)
,p_theme_id=>42
,p_name=>'STACKED_FEATURED'
,p_display_name=>'Stacked Featured'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(1774855340336936480)
,p_css_classes=>'t-HeroRegion--featured t-HeroRegion--centered'
,p_group_id=>wwv_flow_api.id(804547523949800185)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(785596625720632026)
,p_theme_id=>42
,p_name=>'STICKY_HEADER_ON_MOBILE'
,p_display_name=>'Sticky Header on Mobile'
,p_display_sequence=>100
,p_page_template_id=>wwv_flow_api.id(1774825962588936426)
,p_css_classes=>'js-pageStickyMobileHeader'
,p_template_types=>'PAGE'
,p_help_text=>'This will position the contents of the Breadcrumb Bar region position so it sticks to the top of the screen for small screens.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(785605660109632032)
,p_theme_id=>42
,p_name=>'STICKY_HEADER_ON_MOBILE'
,p_display_name=>'Sticky Header on Mobile'
,p_display_sequence=>100
,p_page_template_id=>wwv_flow_api.id(1774828232547936431)
,p_css_classes=>'js-pageStickyMobileHeader'
,p_template_types=>'PAGE'
,p_help_text=>'This will position the contents of the Breadcrumb Bar region position so it sticks to the top of the screen for small screens.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(785616832074632039)
,p_theme_id=>42
,p_name=>'STICKY_HEADER_ON_MOBILE'
,p_display_name=>'Sticky Header on Mobile'
,p_display_sequence=>100
,p_page_template_id=>wwv_flow_api.id(1774833450290936439)
,p_css_classes=>'js-pageStickyMobileHeader'
,p_template_types=>'PAGE'
,p_help_text=>'This will position the contents of the Breadcrumb Bar region position so it sticks to the top of the screen for small screens.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(785624104001632044)
,p_theme_id=>42
,p_name=>'STICKY_HEADER_ON_MOBILE'
,p_display_name=>'Sticky Header on Mobile'
,p_display_sequence=>100
,p_page_template_id=>wwv_flow_api.id(1774836276815936445)
,p_css_classes=>'js-pageStickyMobileHeader'
,p_template_types=>'PAGE'
,p_help_text=>'This will position the contents of the Breadcrumb Bar region position so it sticks to the top of the screen for small screens.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(785635943761632052)
,p_theme_id=>42
,p_name=>'STICKY_HEADER_ON_MOBILE'
,p_display_name=>'Sticky Header on Mobile'
,p_display_sequence=>100
,p_page_template_id=>wwv_flow_api.id(1774842030261936456)
,p_css_classes=>'js-pageStickyMobileHeader'
,p_template_types=>'PAGE'
,p_help_text=>'This will position the contents of the Breadcrumb Bar region position so it sticks to the top of the screen for small screens.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(785643249459632056)
,p_theme_id=>42
,p_name=>'STICKY_HEADER_ON_MOBILE'
,p_display_name=>'Sticky Header on Mobile'
,p_display_sequence=>100
,p_page_template_id=>wwv_flow_api.id(1774844326834936459)
,p_css_classes=>'js-pageStickyMobileHeader'
,p_template_types=>'PAGE'
,p_help_text=>'This will position the contents of the Breadcrumb Bar region position so it sticks to the top of the screen for small screens.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(785660129784632070)
,p_theme_id=>42
,p_name=>'STICK_TO_BOTTOM'
,p_display_name=>'Stick to Bottom for Mobile'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1774849395965936471)
,p_css_classes=>'t-ButtonRegion--stickToBottom'
,p_template_types=>'REGION'
,p_help_text=>'This will position the button container region to the bottom of the screen for small screens.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804581859482800216)
,p_theme_id=>42
,p_name=>'HEADING_LEVEL_H1'
,p_display_name=>'H1'
,p_display_sequence=>10
,p_css_classes=>'js-headingLevel-1'
,p_group_id=>wwv_flow_api.id(804541531386800182)
,p_template_types=>'REGION'
,p_help_text=>'H1'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804582596745800216)
,p_theme_id=>42
,p_name=>'HEADING_LEVEL_H2'
,p_display_name=>'H2'
,p_display_sequence=>20
,p_css_classes=>'js-headingLevel-2'
,p_group_id=>wwv_flow_api.id(804541531386800182)
,p_template_types=>'REGION'
,p_help_text=>'H2'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804583247120800217)
,p_theme_id=>42
,p_name=>'HEADING_LEVEL_H3'
,p_display_name=>'H3'
,p_display_sequence=>30
,p_css_classes=>'js-headingLevel-3'
,p_group_id=>wwv_flow_api.id(804541531386800182)
,p_template_types=>'REGION'
,p_help_text=>'H3'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804583994574800217)
,p_theme_id=>42
,p_name=>'H4'
,p_display_name=>'H4'
,p_display_sequence=>40
,p_css_classes=>'js-headingLevel-4'
,p_group_id=>wwv_flow_api.id(804541531386800182)
,p_template_types=>'REGION'
,p_help_text=>'H4'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804584682651800217)
,p_theme_id=>42
,p_name=>'HEADING_LEVEL_H5'
,p_display_name=>'H5'
,p_display_sequence=>50
,p_css_classes=>'js-headingLevel-5'
,p_group_id=>wwv_flow_api.id(804541531386800182)
,p_template_types=>'REGION'
,p_help_text=>'H5'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804585330583800218)
,p_theme_id=>42
,p_name=>'HEADING_LEVEL_H6'
,p_display_name=>'H6'
,p_display_sequence=>60
,p_css_classes=>'js-headingLevel-6'
,p_group_id=>wwv_flow_api.id(804541531386800182)
,p_template_types=>'REGION'
,p_help_text=>'H6'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804586065074800218)
,p_theme_id=>42
,p_name=>'FBM_LARGE'
,p_display_name=>'Large'
,p_display_sequence=>40
,p_css_classes=>'margin-bottom-lg'
,p_group_id=>wwv_flow_api.id(804522375064800168)
,p_template_types=>'FIELD'
,p_help_text=>'Adds a large bottom margin for this field.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804586721201800219)
,p_theme_id=>42
,p_name=>'RBM_LARGE'
,p_display_name=>'Large'
,p_display_sequence=>40
,p_css_classes=>'margin-bottom-lg'
,p_group_id=>wwv_flow_api.id(804545564517800184)
,p_template_types=>'REGION'
,p_help_text=>'Adds a large bottom margin to the region.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804587480007800219)
,p_theme_id=>42
,p_name=>'FBM_MEDIUM'
,p_display_name=>'Medium'
,p_display_sequence=>30
,p_css_classes=>'margin-bottom-md'
,p_group_id=>wwv_flow_api.id(804522375064800168)
,p_template_types=>'FIELD'
,p_help_text=>'Adds a medium bottom margin for this field.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804588144007800220)
,p_theme_id=>42
,p_name=>'RBM_MEDIUM'
,p_display_name=>'Medium'
,p_display_sequence=>30
,p_css_classes=>'margin-bottom-md'
,p_group_id=>wwv_flow_api.id(804545564517800184)
,p_template_types=>'REGION'
,p_help_text=>'Adds a medium bottom margin to the region.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804588837116800220)
,p_theme_id=>42
,p_name=>'FBM_NONE'
,p_display_name=>'None'
,p_display_sequence=>10
,p_css_classes=>'margin-bottom-none'
,p_group_id=>wwv_flow_api.id(804522375064800168)
,p_template_types=>'FIELD'
,p_help_text=>'Removes the bottom margin for this field.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804589527395800221)
,p_theme_id=>42
,p_name=>'RBM_NONE'
,p_display_name=>'None'
,p_display_sequence=>10
,p_css_classes=>'margin-bottom-none'
,p_group_id=>wwv_flow_api.id(804545564517800184)
,p_template_types=>'REGION'
,p_help_text=>'Removes the bottom margin for this region.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804590283230800221)
,p_theme_id=>42
,p_name=>'FBM_SMALL'
,p_display_name=>'Small'
,p_display_sequence=>20
,p_css_classes=>'margin-bottom-sm'
,p_group_id=>wwv_flow_api.id(804522375064800168)
,p_template_types=>'FIELD'
,p_help_text=>'Adds a small bottom margin for this field.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804590914910800222)
,p_theme_id=>42
,p_name=>'RBM_SMALL'
,p_display_name=>'Small'
,p_display_sequence=>20
,p_css_classes=>'margin-bottom-sm'
,p_group_id=>wwv_flow_api.id(804545564517800184)
,p_template_types=>'REGION'
,p_help_text=>'Adds a small bottom margin to the region.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804591647845800222)
,p_theme_id=>42
,p_name=>'FLM_LARGE'
,p_display_name=>'Large'
,p_display_sequence=>40
,p_css_classes=>'margin-left-lg'
,p_group_id=>wwv_flow_api.id(804523518208800169)
,p_template_types=>'FIELD'
,p_help_text=>'Adds a large left margin for this field.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804592347587800223)
,p_theme_id=>42
,p_name=>'RLM_LARGE'
,p_display_name=>'Large'
,p_display_sequence=>40
,p_css_classes=>'margin-left-lg'
,p_group_id=>wwv_flow_api.id(804545947074800184)
,p_template_types=>'REGION'
,p_help_text=>'Adds a large right margin to the region.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804593070895800223)
,p_theme_id=>42
,p_name=>'FLM_MEDIUM'
,p_display_name=>'Medium'
,p_display_sequence=>30
,p_css_classes=>'margin-left-md'
,p_group_id=>wwv_flow_api.id(804523518208800169)
,p_template_types=>'FIELD'
,p_help_text=>'Adds a medium left margin for this field.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804593712441800223)
,p_theme_id=>42
,p_name=>'RLM_MEDIUM'
,p_display_name=>'Medium'
,p_display_sequence=>30
,p_css_classes=>'margin-left-md'
,p_group_id=>wwv_flow_api.id(804545947074800184)
,p_template_types=>'REGION'
,p_help_text=>'Adds a medium right margin to the region.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804594408709800224)
,p_theme_id=>42
,p_name=>'FLM_NONE'
,p_display_name=>'None'
,p_display_sequence=>10
,p_css_classes=>'margin-left-none'
,p_group_id=>wwv_flow_api.id(804523518208800169)
,p_template_types=>'FIELD'
,p_help_text=>'Removes the left margin for this field.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804595138369800224)
,p_theme_id=>42
,p_name=>'RLM_NONE'
,p_display_name=>'None'
,p_display_sequence=>10
,p_css_classes=>'margin-left-none'
,p_group_id=>wwv_flow_api.id(804545947074800184)
,p_template_types=>'REGION'
,p_help_text=>'Removes the left margin from the region.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804595893802800225)
,p_theme_id=>42
,p_name=>'FLM_SMALL'
,p_display_name=>'Small'
,p_display_sequence=>20
,p_css_classes=>'margin-left-sm'
,p_group_id=>wwv_flow_api.id(804523518208800169)
,p_template_types=>'FIELD'
,p_help_text=>'Adds a small left margin for this field.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804596549369800225)
,p_theme_id=>42
,p_name=>'RLM_SMALL'
,p_display_name=>'Small'
,p_display_sequence=>20
,p_css_classes=>'margin-left-sm'
,p_group_id=>wwv_flow_api.id(804545947074800184)
,p_template_types=>'REGION'
,p_help_text=>'Adds a small left margin to the region.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804597216767800226)
,p_theme_id=>42
,p_name=>'FRM_LARGE'
,p_display_name=>'Large'
,p_display_sequence=>40
,p_css_classes=>'margin-right-lg'
,p_group_id=>wwv_flow_api.id(804525146789800169)
,p_template_types=>'FIELD'
,p_help_text=>'Adds a large right margin for this field.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804597959688800226)
,p_theme_id=>42
,p_name=>'RRM_LARGE'
,p_display_name=>'Large'
,p_display_sequence=>40
,p_css_classes=>'margin-right-lg'
,p_group_id=>wwv_flow_api.id(804546312222800184)
,p_template_types=>'REGION'
,p_help_text=>'Adds a large right margin to the region.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804598615940800227)
,p_theme_id=>42
,p_name=>'FRM_MEDIUM'
,p_display_name=>'Medium'
,p_display_sequence=>30
,p_css_classes=>'margin-right-md'
,p_group_id=>wwv_flow_api.id(804525146789800169)
,p_template_types=>'FIELD'
,p_help_text=>'Adds a medium right margin for this field.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804599335360800227)
,p_theme_id=>42
,p_name=>'RRM_MEDIUM'
,p_display_name=>'Medium'
,p_display_sequence=>30
,p_css_classes=>'margin-right-md'
,p_group_id=>wwv_flow_api.id(804546312222800184)
,p_template_types=>'REGION'
,p_help_text=>'Adds a medium right margin to the region.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804600054309800228)
,p_theme_id=>42
,p_name=>'FRM_NONE'
,p_display_name=>'None'
,p_display_sequence=>10
,p_css_classes=>'margin-right-none'
,p_group_id=>wwv_flow_api.id(804525146789800169)
,p_template_types=>'FIELD'
,p_help_text=>'Removes the right margin for this field.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804600781735800228)
,p_theme_id=>42
,p_name=>'RRM_NONE'
,p_display_name=>'None'
,p_display_sequence=>10
,p_css_classes=>'margin-right-none'
,p_group_id=>wwv_flow_api.id(804546312222800184)
,p_template_types=>'REGION'
,p_help_text=>'Removes the right margin from the region.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804601428137800229)
,p_theme_id=>42
,p_name=>'FRM_SMALL'
,p_display_name=>'Small'
,p_display_sequence=>20
,p_css_classes=>'margin-right-sm'
,p_group_id=>wwv_flow_api.id(804525146789800169)
,p_template_types=>'FIELD'
,p_help_text=>'Adds a small right margin for this field.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804602131070800229)
,p_theme_id=>42
,p_name=>'RRM_SMALL'
,p_display_name=>'Small'
,p_display_sequence=>20
,p_css_classes=>'margin-right-sm'
,p_group_id=>wwv_flow_api.id(804546312222800184)
,p_template_types=>'REGION'
,p_help_text=>'Adds a small right margin to the region.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804602873992800230)
,p_theme_id=>42
,p_name=>'FTM_LARGE'
,p_display_name=>'Large'
,p_display_sequence=>40
,p_css_classes=>'margin-top-lg'
,p_group_id=>wwv_flow_api.id(804525968502800170)
,p_template_types=>'FIELD'
,p_help_text=>'Adds a large top margin for this field.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804603511990800230)
,p_theme_id=>42
,p_name=>'RTM_LARGE'
,p_display_name=>'Large'
,p_display_sequence=>40
,p_css_classes=>'margin-top-lg'
,p_group_id=>wwv_flow_api.id(804547172347800185)
,p_template_types=>'REGION'
,p_help_text=>'Adds a large top margin to the region.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804604208636800230)
,p_theme_id=>42
,p_name=>'FTM_MEDIUM'
,p_display_name=>'Medium'
,p_display_sequence=>30
,p_css_classes=>'margin-top-md'
,p_group_id=>wwv_flow_api.id(804525968502800170)
,p_template_types=>'FIELD'
,p_help_text=>'Adds a medium top margin for this field.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804604990276800231)
,p_theme_id=>42
,p_name=>'RTM_MEDIUM'
,p_display_name=>'Medium'
,p_display_sequence=>30
,p_css_classes=>'margin-top-md'
,p_group_id=>wwv_flow_api.id(804547172347800185)
,p_template_types=>'REGION'
,p_help_text=>'Adds a medium top margin to the region.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804605643640800231)
,p_theme_id=>42
,p_name=>'FTM_NONE'
,p_display_name=>'None'
,p_display_sequence=>10
,p_css_classes=>'margin-top-none'
,p_group_id=>wwv_flow_api.id(804525968502800170)
,p_template_types=>'FIELD'
,p_help_text=>'Removes the top margin for this field.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804606305592800232)
,p_theme_id=>42
,p_name=>'RTM_NONE'
,p_display_name=>'None'
,p_display_sequence=>10
,p_css_classes=>'margin-top-none'
,p_group_id=>wwv_flow_api.id(804547172347800185)
,p_template_types=>'REGION'
,p_help_text=>'Removes the top margin for this region.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804607008546800232)
,p_theme_id=>42
,p_name=>'FTM_SMALL'
,p_display_name=>'Small'
,p_display_sequence=>20
,p_css_classes=>'margin-top-sm'
,p_group_id=>wwv_flow_api.id(804525968502800170)
,p_template_types=>'FIELD'
,p_help_text=>'Adds a small top margin for this field.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804607790924800233)
,p_theme_id=>42
,p_name=>'RTM_SMALL'
,p_display_name=>'Small'
,p_display_sequence=>20
,p_css_classes=>'margin-top-sm'
,p_group_id=>wwv_flow_api.id(804547172347800185)
,p_template_types=>'REGION'
,p_help_text=>'Adds a small top margin to the region.'
);
end;
/
begin
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804608475736800233)
,p_theme_id=>42
,p_name=>'DANGER'
,p_display_name=>'Danger'
,p_display_sequence=>30
,p_css_classes=>'t-Button--danger'
,p_group_id=>wwv_flow_api.id(804521578178800167)
,p_template_types=>'BUTTON'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804609135673800234)
,p_theme_id=>42
,p_name=>'LARGEBOTTOMMARGIN'
,p_display_name=>'Large'
,p_display_sequence=>20
,p_css_classes=>'t-Button--gapBottom'
,p_group_id=>wwv_flow_api.id(804519549983800166)
,p_template_types=>'BUTTON'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804609883307800234)
,p_theme_id=>42
,p_name=>'LARGELEFTMARGIN'
,p_display_name=>'Large'
,p_display_sequence=>20
,p_css_classes=>'t-Button--gapLeft'
,p_group_id=>wwv_flow_api.id(804519940811800167)
,p_template_types=>'BUTTON'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804610502245800234)
,p_theme_id=>42
,p_name=>'LARGERIGHTMARGIN'
,p_display_name=>'Large'
,p_display_sequence=>20
,p_css_classes=>'t-Button--gapRight'
,p_group_id=>wwv_flow_api.id(804520344615800167)
,p_template_types=>'BUTTON'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804611244776800235)
,p_theme_id=>42
,p_name=>'LARGETOPMARGIN'
,p_display_name=>'Large'
,p_display_sequence=>20
,p_css_classes=>'t-Button--gapTop'
,p_group_id=>wwv_flow_api.id(804520729019800167)
,p_template_types=>'BUTTON'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804611974573800235)
,p_theme_id=>42
,p_name=>'LARGE'
,p_display_name=>'Large'
,p_display_sequence=>30
,p_css_classes=>'t-Button--large'
,p_group_id=>wwv_flow_api.id(804519158210800166)
,p_template_types=>'BUTTON'
,p_help_text=>'A large button.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804612665956800236)
,p_theme_id=>42
,p_name=>'DISPLAY_AS_LINK'
,p_display_name=>'Display as Link'
,p_display_sequence=>30
,p_css_classes=>'t-Button--link'
,p_group_id=>wwv_flow_api.id(804521149456800167)
,p_template_types=>'BUTTON'
,p_help_text=>'This option makes the button appear as a text link.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804613301371800236)
,p_theme_id=>42
,p_name=>'NOUI'
,p_display_name=>'Remove UI Decoration'
,p_display_sequence=>20
,p_css_classes=>'t-Button--noUI'
,p_group_id=>wwv_flow_api.id(804521149456800167)
,p_template_types=>'BUTTON'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804614079124800237)
,p_theme_id=>42
,p_name=>'SMALLBOTTOMMARGIN'
,p_display_name=>'Small'
,p_display_sequence=>10
,p_css_classes=>'t-Button--padBottom'
,p_group_id=>wwv_flow_api.id(804519549983800166)
,p_template_types=>'BUTTON'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804614762632800237)
,p_theme_id=>42
,p_name=>'SMALLLEFTMARGIN'
,p_display_name=>'Small'
,p_display_sequence=>10
,p_css_classes=>'t-Button--padLeft'
,p_group_id=>wwv_flow_api.id(804519940811800167)
,p_template_types=>'BUTTON'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804615446721800238)
,p_theme_id=>42
,p_name=>'SMALLRIGHTMARGIN'
,p_display_name=>'Small'
,p_display_sequence=>10
,p_css_classes=>'t-Button--padRight'
,p_group_id=>wwv_flow_api.id(804520344615800167)
,p_template_types=>'BUTTON'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804616124923800238)
,p_theme_id=>42
,p_name=>'SMALLTOPMARGIN'
,p_display_name=>'Small'
,p_display_sequence=>10
,p_css_classes=>'t-Button--padTop'
,p_group_id=>wwv_flow_api.id(804520729019800167)
,p_template_types=>'BUTTON'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804616891643800239)
,p_theme_id=>42
,p_name=>'PILL'
,p_display_name=>'Inner Button'
,p_display_sequence=>20
,p_css_classes=>'t-Button--pill'
,p_group_id=>wwv_flow_api.id(804517999926800166)
,p_template_types=>'BUTTON'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804617551720800239)
,p_theme_id=>42
,p_name=>'PILLEND'
,p_display_name=>'Last Button'
,p_display_sequence=>30
,p_css_classes=>'t-Button--pillEnd'
,p_group_id=>wwv_flow_api.id(804517999926800166)
,p_template_types=>'BUTTON'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804618264309800239)
,p_theme_id=>42
,p_name=>'PILLSTART'
,p_display_name=>'First Button'
,p_display_sequence=>10
,p_css_classes=>'t-Button--pillStart'
,p_group_id=>wwv_flow_api.id(804517999926800166)
,p_template_types=>'BUTTON'
,p_help_text=>'Use this for the start of a pill button.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804618914173800240)
,p_theme_id=>42
,p_name=>'PRIMARY'
,p_display_name=>'Primary'
,p_display_sequence=>10
,p_css_classes=>'t-Button--primary'
,p_group_id=>wwv_flow_api.id(804521578178800167)
,p_template_types=>'BUTTON'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804619653480800240)
,p_theme_id=>42
,p_name=>'SIMPLE'
,p_display_name=>'Simple'
,p_display_sequence=>10
,p_css_classes=>'t-Button--simple'
,p_group_id=>wwv_flow_api.id(804521149456800167)
,p_template_types=>'BUTTON'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804620329248800241)
,p_theme_id=>42
,p_name=>'SMALL'
,p_display_name=>'Small'
,p_display_sequence=>20
,p_css_classes=>'t-Button--small'
,p_group_id=>wwv_flow_api.id(804519158210800166)
,p_template_types=>'BUTTON'
,p_help_text=>'A small button.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804621010057800241)
,p_theme_id=>42
,p_name=>'STRETCH'
,p_display_name=>'Stretch'
,p_display_sequence=>10
,p_css_classes=>'t-Button--stretch'
,p_group_id=>wwv_flow_api.id(804521929603800168)
,p_template_types=>'BUTTON'
,p_help_text=>'Stretches button to fill container'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804621797472800242)
,p_theme_id=>42
,p_name=>'SUCCESS'
,p_display_name=>'Success'
,p_display_sequence=>40
,p_css_classes=>'t-Button--success'
,p_group_id=>wwv_flow_api.id(804521578178800167)
,p_template_types=>'BUTTON'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804622443500800242)
,p_theme_id=>42
,p_name=>'TINY'
,p_display_name=>'Tiny'
,p_display_sequence=>10
,p_css_classes=>'t-Button--tiny'
,p_group_id=>wwv_flow_api.id(804519158210800166)
,p_template_types=>'BUTTON'
,p_help_text=>'A very small button.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804623178549800242)
,p_theme_id=>42
,p_name=>'WARNING'
,p_display_name=>'Warning'
,p_display_sequence=>20
,p_css_classes=>'t-Button--warning'
,p_group_id=>wwv_flow_api.id(804521578178800167)
,p_template_types=>'BUTTON'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804623868888800243)
,p_theme_id=>42
,p_name=>'SHOWFORMLABELSABOVE'
,p_display_name=>'Show Form Labels Above'
,p_display_sequence=>10
,p_css_classes=>'t-Form--labelsAbove'
,p_group_id=>wwv_flow_api.id(804544369386800183)
,p_template_types=>'REGION'
,p_help_text=>'Show form labels above input fields.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804624595758800243)
,p_theme_id=>42
,p_name=>'FORMSIZELARGE'
,p_display_name=>'Large'
,p_display_sequence=>10
,p_css_classes=>'t-Form--large'
,p_group_id=>wwv_flow_api.id(804543166007800183)
,p_template_types=>'REGION'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804625268880800244)
,p_theme_id=>42
,p_name=>'FORMLEFTLABELS'
,p_display_name=>'Left'
,p_display_sequence=>20
,p_css_classes=>'t-Form--leftLabels'
,p_group_id=>wwv_flow_api.id(804543930140800183)
,p_template_types=>'REGION'
,p_help_text=>'Align form labels to left.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804625907659800244)
,p_theme_id=>42
,p_name=>'FORMREMOVEPADDING'
,p_display_name=>'None'
,p_display_sequence=>20
,p_css_classes=>'t-Form--noPadding'
,p_group_id=>wwv_flow_api.id(804542737652800183)
,p_template_types=>'REGION'
,p_help_text=>'Removes spacing between items.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804626624692800245)
,p_theme_id=>42
,p_name=>'FORMSLIMPADDING'
,p_display_name=>'Slim'
,p_display_sequence=>10
,p_css_classes=>'t-Form--slimPadding'
,p_group_id=>wwv_flow_api.id(804542737652800183)
,p_template_types=>'REGION'
,p_help_text=>'Reduces form item spacing.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804627388138800245)
,p_theme_id=>42
,p_name=>'FORMSTANDARDPADDING'
,p_display_name=>'Standard'
,p_display_sequence=>5
,p_css_classes=>'t-Form--standardPadding'
,p_group_id=>wwv_flow_api.id(804542737652800183)
,p_template_types=>'REGION'
,p_help_text=>'Uses the standard spacing between items.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804628040024800245)
,p_theme_id=>42
,p_name=>'STRETCH_FORM_FIELDS'
,p_display_name=>'Stretch Form Fields'
,p_display_sequence=>10
,p_css_classes=>'t-Form--stretchInputs'
,p_group_id=>wwv_flow_api.id(804543543037800183)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804628742306800246)
,p_theme_id=>42
,p_name=>'FORMSIZEXLARGE'
,p_display_name=>'X Large'
,p_display_sequence=>20
,p_css_classes=>'t-Form--xlarge'
,p_group_id=>wwv_flow_api.id(804543166007800183)
,p_template_types=>'REGION'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804629402833800246)
,p_theme_id=>42
,p_name=>'LARGE_FIELD'
,p_display_name=>'Large'
,p_display_sequence=>10
,p_css_classes=>'t-Form-fieldContainer--large'
,p_group_id=>wwv_flow_api.id(804525524852800170)
,p_template_types=>'FIELD'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804630147286800247)
,p_theme_id=>42
,p_name=>'POST_TEXT_BLOCK'
,p_display_name=>'Display as Block'
,p_display_sequence=>10
,p_css_classes=>'t-Form-fieldContainer--postTextBlock'
,p_group_id=>wwv_flow_api.id(804522765288800168)
,p_template_types=>'FIELD'
,p_help_text=>'Displays the Item Post Text in a block style immediately after the item.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804630861139800247)
,p_theme_id=>42
,p_name=>'PRE_TEXT_BLOCK'
,p_display_name=>'Display as Block'
,p_display_sequence=>10
,p_css_classes=>'t-Form-fieldContainer--preTextBlock'
,p_group_id=>wwv_flow_api.id(804523171822800168)
,p_template_types=>'FIELD'
,p_help_text=>'Displays the Item Pre Text in a block style immediately before the item.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804631562329800248)
,p_theme_id=>42
,p_name=>'DISPLAY_AS_PILL_BUTTON'
,p_display_name=>'Display as Pill Button'
,p_display_sequence=>10
,p_css_classes=>'t-Form-fieldContainer--radioButtonGroup'
,p_group_id=>wwv_flow_api.id(804524323022800169)
,p_template_types=>'FIELD'
,p_help_text=>'Displays the radio buttons to look like a button set / pill button. Note that the the radio buttons must all be in the same row for this option to work.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804631958251800248)
,p_theme_id=>42
,p_name=>'STRETCH_FORM_ITEM'
,p_display_name=>'Stretch Form Item'
,p_display_sequence=>10
,p_css_classes=>'t-Form-fieldContainer--stretchInputs'
,p_template_types=>'FIELD'
,p_help_text=>'Stretches the form item to fill its container.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804632623840800248)
,p_theme_id=>42
,p_name=>'X_LARGE_SIZE'
,p_display_name=>'X Large'
,p_display_sequence=>20
,p_css_classes=>'t-Form-fieldContainer--xlarge'
,p_group_id=>wwv_flow_api.id(804525524852800170)
,p_template_types=>'FIELD'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804633329349800249)
,p_theme_id=>42
,p_name=>'REMOVE_PADDING'
,p_display_name=>'Remove Padding'
,p_display_sequence=>1
,p_css_classes=>'t-PageBody--noContentPadding'
,p_group_id=>wwv_flow_api.id(804532346562800177)
,p_template_types=>'PAGE'
,p_help_text=>'Removes padding from the content region.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804634006762800249)
,p_theme_id=>42
,p_name=>'HIDE_WHEN_ALL_ROWS_DISPLAYED'
,p_display_name=>'Hide when all rows displayed'
,p_display_sequence=>10
,p_css_classes=>'t-Report--hideNoPagination'
,p_group_id=>wwv_flow_api.id(804556716682800190)
,p_template_types=>'REPORT'
,p_help_text=>'This option will hide the pagination when all rows are displayed.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804731214559800365)
,p_theme_id=>42
,p_name=>'ACCENT_6'
,p_display_name=>'Accent 6'
,p_display_sequence=>60
,p_region_template_id=>wwv_flow_api.id(1774855849259936482)
,p_css_classes=>'t-Region--accent6'
,p_group_id=>wwv_flow_api.id(804533973283800178)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804731929391800367)
,p_theme_id=>42
,p_name=>'ACCENT_7'
,p_display_name=>'Accent 7'
,p_display_sequence=>70
,p_region_template_id=>wwv_flow_api.id(1774855849259936482)
,p_css_classes=>'t-Region--accent7'
,p_group_id=>wwv_flow_api.id(804533973283800178)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804732662509800368)
,p_theme_id=>42
,p_name=>'ACCENT_8'
,p_display_name=>'Accent 8'
,p_display_sequence=>80
,p_region_template_id=>wwv_flow_api.id(1774855849259936482)
,p_css_classes=>'t-Region--accent8'
,p_group_id=>wwv_flow_api.id(804533973283800178)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804733300375800368)
,p_theme_id=>42
,p_name=>'ACCENT_9'
,p_display_name=>'Accent 9'
,p_display_sequence=>90
,p_region_template_id=>wwv_flow_api.id(1774855849259936482)
,p_css_classes=>'t-Region--accent9'
,p_group_id=>wwv_flow_api.id(804533973283800178)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804734079934800368)
,p_theme_id=>42
,p_name=>'ACCENT_10'
,p_display_name=>'Accent 10'
,p_display_sequence=>100
,p_region_template_id=>wwv_flow_api.id(1774855849259936482)
,p_css_classes=>'t-Region--accent10'
,p_group_id=>wwv_flow_api.id(804533973283800178)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804734727381800371)
,p_theme_id=>42
,p_name=>'ACCENT_11'
,p_display_name=>'Accent 11'
,p_display_sequence=>110
,p_region_template_id=>wwv_flow_api.id(1774855849259936482)
,p_css_classes=>'t-Region--accent11'
,p_group_id=>wwv_flow_api.id(804533973283800178)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804735460532800372)
,p_theme_id=>42
,p_name=>'ACCENT_12'
,p_display_name=>'Accent 12'
,p_display_sequence=>120
,p_region_template_id=>wwv_flow_api.id(1774855849259936482)
,p_css_classes=>'t-Region--accent12'
,p_group_id=>wwv_flow_api.id(804533973283800178)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804736169994800372)
,p_theme_id=>42
,p_name=>'ACCENT_13'
,p_display_name=>'Accent 13'
,p_display_sequence=>130
,p_region_template_id=>wwv_flow_api.id(1774855849259936482)
,p_css_classes=>'t-Region--accent13'
,p_group_id=>wwv_flow_api.id(804533973283800178)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804736887400800373)
,p_theme_id=>42
,p_name=>'ACCENT_14'
,p_display_name=>'Accent 14'
,p_display_sequence=>140
,p_region_template_id=>wwv_flow_api.id(1774855849259936482)
,p_css_classes=>'t-Region--accent14'
,p_group_id=>wwv_flow_api.id(804533973283800178)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804737522677800373)
,p_theme_id=>42
,p_name=>'ACCENT_15'
,p_display_name=>'Accent 15'
,p_display_sequence=>150
,p_region_template_id=>wwv_flow_api.id(1774855849259936482)
,p_css_classes=>'t-Region--accent15'
,p_group_id=>wwv_flow_api.id(804533973283800178)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804922504772800553)
,p_theme_id=>42
,p_name=>'DISPLAY_ITEMS_STACKED'
,p_display_name=>'Stacked'
,p_display_sequence=>1
,p_report_template_id=>wwv_flow_api.id(804922099084800553)
,p_css_classes=>'t-ContextualInfo-item--stacked'
,p_group_id=>wwv_flow_api.id(804554315052800189)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(804922902815800553)
,p_theme_id=>42
,p_name=>'DISPLAY_LABELS_STACKED'
,p_display_name=>'Stacked'
,p_display_sequence=>1
,p_report_template_id=>wwv_flow_api.id(804922099084800553)
,p_css_classes=>'t-ContextualInfo-label--stacked'
,p_group_id=>wwv_flow_api.id(804554788183800189)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1124252085147460312)
,p_theme_id=>42
,p_name=>'HIDDENHEADERNOAT'
,p_display_name=>'Hidden'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1774847460117936466)
,p_css_classes=>'t-Alert--removeHeading js-removeLandmark'
,p_group_id=>wwv_flow_api.id(804535106487800179)
,p_template_types=>'REGION'
,p_help_text=>'Hides the Alert Title from being displayed.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1124252827560460313)
,p_theme_id=>42
,p_name=>'HIDDENHEADER'
,p_display_name=>'Hidden but Accessible'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(1774847460117936466)
,p_css_classes=>'t-Alert--accessibleHeading'
,p_group_id=>wwv_flow_api.id(804535106487800179)
,p_template_types=>'REGION'
,p_help_text=>'Visually hides the alert title, but assistive technologies can still read it.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1124293988062460370)
,p_theme_id=>42
,p_name=>'REMOVE_BODY_PADDING'
,p_display_name=>'Remove Body Padding'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1774855340336936480)
,p_css_classes=>'t-HeroRegion--noPadding'
,p_template_types=>'REGION'
,p_help_text=>'Removes the padding around the hero region.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1124325949472460426)
,p_theme_id=>42
,p_name=>'CONTENT_TITLE_H1'
,p_display_name=>'Large'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1124325436919460426)
,p_css_classes=>'t-ContentBlock--h1'
,p_group_id=>wwv_flow_api.id(804546742887800185)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1124326277099460427)
,p_theme_id=>42
,p_name=>'CONTENT_TITLE_H2'
,p_display_name=>'Medium'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(1124325436919460426)
,p_css_classes=>'t-ContentBlock--h2'
,p_group_id=>wwv_flow_api.id(804546742887800185)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1124326736026460427)
,p_theme_id=>42
,p_name=>'CONTENT_TITLE_H3'
,p_display_name=>'Small'
,p_display_sequence=>30
,p_region_template_id=>wwv_flow_api.id(1124325436919460426)
,p_css_classes=>'t-ContentBlock--h3'
,p_group_id=>wwv_flow_api.id(804546742887800185)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1124336160223460443)
,p_theme_id=>42
,p_name=>'CARDS_STACKED'
,p_display_name=>'Stacked'
,p_display_sequence=>5
,p_list_template_id=>wwv_flow_api.id(1774874589747936542)
,p_css_classes=>'t-Cards--stacked'
,p_group_id=>wwv_flow_api.id(804530712278800176)
,p_template_types=>'LIST'
,p_help_text=>'Stacks the cards on top of each other.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1124336782137460446)
,p_theme_id=>42
,p_name=>'RAISE_CARD'
,p_display_name=>'Raise Card'
,p_display_sequence=>20
,p_list_template_id=>wwv_flow_api.id(1774874589747936542)
,p_css_classes=>'t-Cards--animRaiseCard'
,p_group_id=>wwv_flow_api.id(804526372841800170)
,p_template_types=>'LIST'
,p_help_text=>'Raises the card so it pops up.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1124337537210460447)
,p_theme_id=>42
,p_name=>'COLOR_FILL'
,p_display_name=>'Color Fill'
,p_display_sequence=>10
,p_list_template_id=>wwv_flow_api.id(1774874589747936542)
,p_css_classes=>'t-Cards--animColorFill'
,p_group_id=>wwv_flow_api.id(804526372841800170)
,p_template_types=>'LIST'
,p_help_text=>'Fills the card background with the color of the icon or default link style.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1124376513111460517)
,p_theme_id=>42
,p_name=>'CARD_RAISE_CARD'
,p_display_name=>'Raise Card'
,p_display_sequence=>20
,p_report_template_id=>wwv_flow_api.id(1774866287250936513)
,p_css_classes=>'t-Cards--animRaiseCard'
,p_group_id=>wwv_flow_api.id(804549542550800186)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1124377244639460517)
,p_theme_id=>42
,p_name=>'CARDS_COLOR_FILL'
,p_display_name=>'Color Fill'
,p_display_sequence=>10
,p_report_template_id=>wwv_flow_api.id(1774866287250936513)
,p_css_classes=>'t-Cards--animColorFill'
,p_group_id=>wwv_flow_api.id(804549542550800186)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1342743757034377355)
,p_theme_id=>42
,p_name=>'REMEMBER_COLLAPSIBLE_STATE'
,p_display_name=>'Remember Collapsible State'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(1774855849259936482)
,p_css_classes=>'js-useLocalStorage'
,p_template_types=>'REGION'
,p_help_text=>'This option saves the current state of the collapsible region for the duration of the session.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1478468696692231822)
,p_theme_id=>42
,p_name=>'APPLY_THEME_COLORS'
,p_display_name=>'Apply Theme Colors'
,p_display_sequence=>40
,p_list_template_id=>wwv_flow_api.id(1774878219827936547)
,p_css_classes=>'u-colors'
,p_template_types=>'LIST'
,p_help_text=>'Applies colors from the Theme''s color palette to icons in the list.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1483660932356621562)
,p_theme_id=>42
,p_name=>'LIST_SIZE_LARGE'
,p_display_name=>'Large'
,p_display_sequence=>10
,p_list_template_id=>wwv_flow_api.id(1774878219827936547)
,p_css_classes=>'t-MediaList--large force-fa-lg'
,p_group_id=>wwv_flow_api.id(804531568180800177)
,p_template_types=>'LIST'
,p_help_text=>'Increases the size of the text and icons in the list.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1488172816059999501)
,p_theme_id=>42
,p_name=>'ACCENT_10'
,p_display_name=>'Accent 10'
,p_display_sequence=>100
,p_region_template_id=>wwv_flow_api.id(1774859855390936493)
,p_css_classes=>'t-Region--accent10'
,p_group_id=>wwv_flow_api.id(804533973283800178)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1488173484014999502)
,p_theme_id=>42
,p_name=>'ACCENT_11'
,p_display_name=>'Accent 11'
,p_display_sequence=>110
,p_region_template_id=>wwv_flow_api.id(1774859855390936493)
,p_css_classes=>'t-Region--accent11'
,p_group_id=>wwv_flow_api.id(804533973283800178)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1488174238094999503)
,p_theme_id=>42
,p_name=>'ACCENT_15'
,p_display_name=>'Accent 15'
,p_display_sequence=>150
,p_region_template_id=>wwv_flow_api.id(1774859855390936493)
,p_css_classes=>'t-Region--accent15'
,p_group_id=>wwv_flow_api.id(804533973283800178)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1488174960730999503)
,p_theme_id=>42
,p_name=>'ACCENT_7'
,p_display_name=>'Accent 7'
,p_display_sequence=>70
,p_region_template_id=>wwv_flow_api.id(1774859855390936493)
,p_css_classes=>'t-Region--accent7'
,p_group_id=>wwv_flow_api.id(804533973283800178)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1488175593995999504)
,p_theme_id=>42
,p_name=>'ACCENT_6'
,p_display_name=>'Accent 6'
,p_display_sequence=>60
,p_region_template_id=>wwv_flow_api.id(1774859855390936493)
,p_css_classes=>'t-Region--accent6'
,p_group_id=>wwv_flow_api.id(804533973283800178)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1488176272796999504)
,p_theme_id=>42
,p_name=>'ACCENT_13'
,p_display_name=>'Accent 13'
,p_display_sequence=>130
,p_region_template_id=>wwv_flow_api.id(1774859855390936493)
,p_css_classes=>'t-Region--accent13'
,p_group_id=>wwv_flow_api.id(804533973283800178)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1488177000686999505)
,p_theme_id=>42
,p_name=>'ACCENT_8'
,p_display_name=>'Accent 8'
,p_display_sequence=>80
,p_region_template_id=>wwv_flow_api.id(1774859855390936493)
,p_css_classes=>'t-Region--accent8'
,p_group_id=>wwv_flow_api.id(804533973283800178)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1488177738100999505)
,p_theme_id=>42
,p_name=>'ACCENT_9'
,p_display_name=>'Accent 9'
,p_display_sequence=>90
,p_region_template_id=>wwv_flow_api.id(1774859855390936493)
,p_css_classes=>'t-Region--accent9'
,p_group_id=>wwv_flow_api.id(804533973283800178)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1488178407296999506)
,p_theme_id=>42
,p_name=>'ACCENT_14'
,p_display_name=>'Accent 14'
,p_display_sequence=>140
,p_region_template_id=>wwv_flow_api.id(1774859855390936493)
,p_css_classes=>'t-Region--accent14'
,p_group_id=>wwv_flow_api.id(804533973283800178)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1488179070422999507)
,p_theme_id=>42
,p_name=>'ACCENT_12'
,p_display_name=>'Accent 12'
,p_display_sequence=>120
,p_region_template_id=>wwv_flow_api.id(1774859855390936493)
,p_css_classes=>'t-Region--accent12'
,p_group_id=>wwv_flow_api.id(804533973283800178)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774847921664936468)
,p_theme_id=>42
,p_name=>'COLOREDBACKGROUND'
,p_display_name=>'Highlight Background'
,p_display_sequence=>1
,p_region_template_id=>wwv_flow_api.id(1774847460117936466)
,p_css_classes=>'t-Alert--colorBG'
,p_template_types=>'REGION'
,p_help_text=>'Set alert background color to that of the alert type (warning, success, etc.)'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774848259736936469)
,p_theme_id=>42
,p_name=>'DANGER'
,p_display_name=>'Danger'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(1774847460117936466)
,p_css_classes=>'t-Alert--danger'
,p_group_id=>wwv_flow_api.id(804535530444800179)
,p_template_types=>'REGION'
,p_help_text=>'Show an error or danger alert.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774848532146936469)
,p_theme_id=>42
,p_name=>'HORIZONTAL'
,p_display_name=>'Horizontal'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1774847460117936466)
,p_css_classes=>'t-Alert--horizontal'
,p_group_id=>wwv_flow_api.id(804534356570800178)
,p_template_types=>'REGION'
,p_help_text=>'Show horizontal alert with buttons to the right.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774848646947936469)
,p_theme_id=>42
,p_name=>'INFORMATION'
,p_display_name=>'Information'
,p_display_sequence=>30
,p_region_template_id=>wwv_flow_api.id(1774847460117936466)
,p_css_classes=>'t-Alert--info'
,p_group_id=>wwv_flow_api.id(804535530444800179)
,p_template_types=>'REGION'
,p_help_text=>'Show informational alert.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774848840278936469)
,p_theme_id=>42
,p_name=>'SUCCESS'
,p_display_name=>'Success'
,p_display_sequence=>40
,p_region_template_id=>wwv_flow_api.id(1774847460117936466)
,p_css_classes=>'t-Alert--success'
,p_group_id=>wwv_flow_api.id(804535530444800179)
,p_template_types=>'REGION'
,p_help_text=>'Show success alert.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774848894026936469)
,p_theme_id=>42
,p_name=>'USEDEFAULTICONS'
,p_display_name=>'Show Default Icons'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(1774847460117936466)
,p_css_classes=>'t-Alert--defaultIcons'
,p_group_id=>wwv_flow_api.id(804534799743800178)
,p_template_types=>'REGION'
,p_help_text=>'Uses default icons for alert types.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774849066765936469)
,p_theme_id=>42
,p_name=>'WARNING'
,p_display_name=>'Warning'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1774847460117936466)
,p_css_classes=>'t-Alert--warning'
,p_group_id=>wwv_flow_api.id(804535530444800179)
,p_template_types=>'REGION'
,p_help_text=>'Show a warning alert.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774849121425936469)
,p_theme_id=>42
,p_name=>'WIZARD'
,p_display_name=>'Wizard'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(1774847460117936466)
,p_css_classes=>'t-Alert--wizard'
,p_group_id=>wwv_flow_api.id(804534356570800178)
,p_template_types=>'REGION'
,p_help_text=>'Show the alert in a wizard style region.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774850457345936474)
,p_theme_id=>42
,p_name=>'BORDERLESS'
,p_display_name=>'Borderless'
,p_display_sequence=>1
,p_region_template_id=>wwv_flow_api.id(1774849395965936471)
,p_css_classes=>'t-ButtonRegion--noBorder'
,p_group_id=>wwv_flow_api.id(804547523949800185)
,p_template_types=>'REGION'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774850730896936474)
,p_theme_id=>42
,p_name=>'NOPADDING'
,p_display_name=>'No Padding'
,p_display_sequence=>3
,p_region_template_id=>wwv_flow_api.id(1774849395965936471)
,p_css_classes=>'t-ButtonRegion--noPadding'
,p_group_id=>wwv_flow_api.id(804537182667800180)
,p_template_types=>'REGION'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774850776608936475)
,p_theme_id=>42
,p_name=>'REMOVEUIDECORATION'
,p_display_name=>'Remove UI Decoration'
,p_display_sequence=>4
,p_region_template_id=>wwv_flow_api.id(1774849395965936471)
,p_css_classes=>'t-ButtonRegion--noUI'
,p_group_id=>wwv_flow_api.id(804547523949800185)
,p_template_types=>'REGION'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774850879362936475)
,p_theme_id=>42
,p_name=>'SLIMPADDING'
,p_display_name=>'Slim Padding'
,p_display_sequence=>5
,p_region_template_id=>wwv_flow_api.id(1774849395965936471)
,p_css_classes=>'t-ButtonRegion--slimPadding'
,p_group_id=>wwv_flow_api.id(804537182667800180)
,p_template_types=>'REGION'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774852072280936478)
,p_theme_id=>42
,p_name=>'240PX'
,p_display_name=>'240px'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1774851103376936475)
,p_css_classes=>'i-h240'
,p_group_id=>wwv_flow_api.id(804536344202800179)
,p_template_types=>'REGION'
,p_help_text=>'Sets region body height to 240px.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774852194254936478)
,p_theme_id=>42
,p_name=>'320PX'
,p_display_name=>'320px'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(1774851103376936475)
,p_css_classes=>'i-h320'
,p_group_id=>wwv_flow_api.id(804536344202800179)
,p_template_types=>'REGION'
,p_help_text=>'Sets region body height to 320px.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774852300456936478)
,p_theme_id=>42
,p_name=>'480PX'
,p_display_name=>'480px'
,p_display_sequence=>30
,p_region_template_id=>wwv_flow_api.id(1774851103376936475)
,p_css_classes=>'i-h480'
,p_group_id=>wwv_flow_api.id(804536344202800179)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774852644693936479)
,p_theme_id=>42
,p_name=>'5_SECONDS'
,p_display_name=>'5 Seconds'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1774851103376936475)
,p_css_classes=>'js-cycle5s'
,p_group_id=>wwv_flow_api.id(804548745380800186)
,p_template_types=>'REGION'
);
end;
/
begin
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774852674724936479)
,p_theme_id=>42
,p_name=>'640PX'
,p_display_name=>'640px'
,p_display_sequence=>40
,p_region_template_id=>wwv_flow_api.id(1774851103376936475)
,p_css_classes=>'i-h640'
,p_group_id=>wwv_flow_api.id(804536344202800179)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774853034565936479)
,p_theme_id=>42
,p_name=>'ACCENT_1'
,p_display_name=>'Accent 1'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1774851103376936475)
,p_css_classes=>'t-Region--accent1'
,p_group_id=>wwv_flow_api.id(804533973283800178)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774853089268936479)
,p_theme_id=>42
,p_name=>'ACCENT_2'
,p_display_name=>'Accent 2'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(1774851103376936475)
,p_css_classes=>'t-Region--accent2'
,p_group_id=>wwv_flow_api.id(804533973283800178)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774853184802936479)
,p_theme_id=>42
,p_name=>'ACCENT_3'
,p_display_name=>'Accent 3'
,p_display_sequence=>30
,p_region_template_id=>wwv_flow_api.id(1774851103376936475)
,p_css_classes=>'t-Region--accent3'
,p_group_id=>wwv_flow_api.id(804533973283800178)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774853325198936479)
,p_theme_id=>42
,p_name=>'ACCENT_4'
,p_display_name=>'Accent 4'
,p_display_sequence=>40
,p_region_template_id=>wwv_flow_api.id(1774851103376936475)
,p_css_classes=>'t-Region--accent4'
,p_group_id=>wwv_flow_api.id(804533973283800178)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774853469137936479)
,p_theme_id=>42
,p_name=>'ACCENT_5'
,p_display_name=>'Accent 5'
,p_display_sequence=>50
,p_region_template_id=>wwv_flow_api.id(1774851103376936475)
,p_css_classes=>'t-Region--accent5'
,p_group_id=>wwv_flow_api.id(804533973283800178)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774853736012936479)
,p_theme_id=>42
,p_name=>'HIDDENHEADERNOAT'
,p_display_name=>'Hidden'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1774851103376936475)
,p_css_classes=>'t-Region--removeHeader'
,p_group_id=>wwv_flow_api.id(804540730240800182)
,p_template_types=>'REGION'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774854016030936479)
,p_theme_id=>42
,p_name=>'HIDEOVERFLOW'
,p_display_name=>'Hide'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1774851103376936475)
,p_css_classes=>'t-Region--hiddenOverflow'
,p_group_id=>wwv_flow_api.id(804536748710800179)
,p_template_types=>'REGION'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774854136398936479)
,p_theme_id=>42
,p_name=>'HIDEREGIONHEADER'
,p_display_name=>'Hidden but accessible'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(1774851103376936475)
,p_css_classes=>'t-Region--hideHeader'
,p_group_id=>wwv_flow_api.id(804540730240800182)
,p_template_types=>'REGION'
,p_help_text=>'This option will hide the region header. Note that the region title will still be audible for Screen Readers. Buttons placed in the region header will be hidden and inaccessible.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774854219178936479)
,p_theme_id=>42
,p_name=>'NOBODYPADDING'
,p_display_name=>'Remove Body Padding'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1774851103376936475)
,p_css_classes=>'t-Region--noPadding'
,p_template_types=>'REGION'
,p_help_text=>'Removes padding from region body.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774854311422936479)
,p_theme_id=>42
,p_name=>'NOBORDER'
,p_display_name=>'Remove Borders'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1774851103376936475)
,p_css_classes=>'t-Region--noBorder'
,p_group_id=>wwv_flow_api.id(804547523949800185)
,p_template_types=>'REGION'
,p_help_text=>'Removes borders from the region.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774854421443936479)
,p_theme_id=>42
,p_name=>'REMEMBER_CAROUSEL_SLIDE'
,p_display_name=>'Remember Carousel Slide'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(1774851103376936475)
,p_css_classes=>'js-useLocalStorage'
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774854508295936479)
,p_theme_id=>42
,p_name=>'SCROLLBODY'
,p_display_name=>'Scroll'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(1774851103376936475)
,p_css_classes=>'t-Region--scrollBody'
,p_group_id=>wwv_flow_api.id(804536748710800179)
,p_template_types=>'REGION'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774854743138936480)
,p_theme_id=>42
,p_name=>'SHOW_NEXT_AND_PREVIOUS_BUTTONS'
,p_display_name=>'Show Next and Previous Buttons'
,p_display_sequence=>30
,p_region_template_id=>wwv_flow_api.id(1774851103376936475)
,p_css_classes=>'t-Region--showCarouselControls'
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774855046974936480)
,p_theme_id=>42
,p_name=>'SLIDE'
,p_display_name=>'Slide'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1774851103376936475)
,p_css_classes=>'t-Region--carouselSlide'
,p_group_id=>wwv_flow_api.id(804535921426800179)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774855130697936480)
,p_theme_id=>42
,p_name=>'SPIN'
,p_display_name=>'Spin'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(1774851103376936475)
,p_css_classes=>'t-Region--carouselSpin'
,p_group_id=>wwv_flow_api.id(804535921426800179)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774855175336936480)
,p_theme_id=>42
,p_name=>'STACKED'
,p_display_name=>'Stack Region'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(1774851103376936475)
,p_css_classes=>'t-Region--stacked'
,p_group_id=>wwv_flow_api.id(804547523949800185)
,p_template_types=>'REGION'
,p_help_text=>'Removes side borders and shadows, and can be useful for accordions and regions that need to be grouped together vertically.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774856582450936485)
,p_theme_id=>42
,p_name=>'240PX'
,p_display_name=>'240px'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1774855849259936482)
,p_css_classes=>'i-h240'
,p_group_id=>wwv_flow_api.id(804536344202800179)
,p_template_types=>'REGION'
,p_help_text=>'Sets region body height to 240px.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774856766812936485)
,p_theme_id=>42
,p_name=>'320PX'
,p_display_name=>'320px'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(1774855849259936482)
,p_css_classes=>'i-h320'
,p_group_id=>wwv_flow_api.id(804536344202800179)
,p_template_types=>'REGION'
,p_help_text=>'Sets region body height to 320px.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774856800816936485)
,p_theme_id=>42
,p_name=>'ACCENT_1'
,p_display_name=>'Accent 1'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1774855849259936482)
,p_css_classes=>'t-Region--accent1'
,p_group_id=>wwv_flow_api.id(804533973283800178)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774856915307936485)
,p_theme_id=>42
,p_name=>'ACCENT_2'
,p_display_name=>'Accent 2'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(1774855849259936482)
,p_css_classes=>'t-Region--accent2'
,p_group_id=>wwv_flow_api.id(804533973283800178)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774856976280936485)
,p_theme_id=>42
,p_name=>'ACCENT_3'
,p_display_name=>'Accent 3'
,p_display_sequence=>30
,p_region_template_id=>wwv_flow_api.id(1774855849259936482)
,p_css_classes=>'t-Region--accent3'
,p_group_id=>wwv_flow_api.id(804533973283800178)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774857163679936485)
,p_theme_id=>42
,p_name=>'ACCENT_4'
,p_display_name=>'Accent 4'
,p_display_sequence=>40
,p_region_template_id=>wwv_flow_api.id(1774855849259936482)
,p_css_classes=>'t-Region--accent4'
,p_group_id=>wwv_flow_api.id(804533973283800178)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774857220143936485)
,p_theme_id=>42
,p_name=>'ACCENT_5'
,p_display_name=>'Accent 5'
,p_display_sequence=>50
,p_region_template_id=>wwv_flow_api.id(1774855849259936482)
,p_css_classes=>'t-Region--accent5'
,p_group_id=>wwv_flow_api.id(804533973283800178)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774857488232936486)
,p_theme_id=>42
,p_name=>'COLLAPSED'
,p_display_name=>'Collapsed'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(1774855849259936482)
,p_css_classes=>'is-collapsed'
,p_group_id=>wwv_flow_api.id(804539195963800181)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774857621283936486)
,p_theme_id=>42
,p_name=>'EXPANDED'
,p_display_name=>'Expanded'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1774855849259936482)
,p_css_classes=>'is-expanded'
,p_group_id=>wwv_flow_api.id(804539195963800181)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774857700869936486)
,p_theme_id=>42
,p_name=>'HIDEOVERFLOW'
,p_display_name=>'Hide'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(1774855849259936482)
,p_css_classes=>'t-Region--hiddenOverflow'
,p_group_id=>wwv_flow_api.id(804536748710800179)
,p_template_types=>'REGION'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774857778723936486)
,p_theme_id=>42
,p_name=>'NOBODYPADDING'
,p_display_name=>'Remove Body Padding'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1774855849259936482)
,p_css_classes=>'t-Region--noPadding'
,p_template_types=>'REGION'
,p_help_text=>'Removes padding from region body.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774857965367936486)
,p_theme_id=>42
,p_name=>'NOBORDER'
,p_display_name=>'Remove Borders'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1774855849259936482)
,p_css_classes=>'t-Region--noBorder'
,p_group_id=>wwv_flow_api.id(804547523949800185)
,p_template_types=>'REGION'
,p_help_text=>'Removes borders from the region.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774858044754936486)
,p_theme_id=>42
,p_name=>'SCROLLBODY'
,p_display_name=>'Scroll - Default'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1774855849259936482)
,p_css_classes=>'t-Region--scrollBody'
,p_group_id=>wwv_flow_api.id(804536748710800179)
,p_template_types=>'REGION'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774858220189936486)
,p_theme_id=>42
,p_name=>'STACKED'
,p_display_name=>'Stack Region'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(1774855849259936482)
,p_css_classes=>'t-Region--stacked'
,p_group_id=>wwv_flow_api.id(804547523949800185)
,p_template_types=>'REGION'
,p_help_text=>'Removes side borders and shadows, and can be useful for accordions and regions that need to be grouped together vertically.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774858530275936489)
,p_theme_id=>42
,p_name=>'REMOVEBORDERS'
,p_display_name=>'Remove Borders'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1774858309021936486)
,p_css_classes=>'t-IRR-region--noBorders'
,p_template_types=>'REGION'
,p_help_text=>'Removes borders around the Interactive Report'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774858996519936493)
,p_theme_id=>42
,p_name=>'DRAGGABLE'
,p_display_name=>'Draggable'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(1774858800950936491)
,p_css_classes=>'js-draggable'
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774859357729936493)
,p_theme_id=>42
,p_name=>'LARGE_720X480'
,p_display_name=>'Large (720x480)'
,p_display_sequence=>30
,p_region_template_id=>wwv_flow_api.id(1774858800950936491)
,p_css_classes=>'js-dialog-size720x480'
,p_group_id=>wwv_flow_api.id(804539508869800181)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774859433742936493)
,p_theme_id=>42
,p_name=>'MEDIUM_600X400'
,p_display_name=>'Medium (600x400)'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(1774858800950936491)
,p_css_classes=>'js-dialog-size600x400'
,p_group_id=>wwv_flow_api.id(804539508869800181)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774859501041936493)
,p_theme_id=>42
,p_name=>'MODAL'
,p_display_name=>'Modal'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1774858800950936491)
,p_css_classes=>'js-modal'
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774859590506936493)
,p_theme_id=>42
,p_name=>'RESIZABLE'
,p_display_name=>'Resizable'
,p_display_sequence=>30
,p_region_template_id=>wwv_flow_api.id(1774858800950936491)
,p_css_classes=>'js-resizable'
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774859760254936493)
,p_theme_id=>42
,p_name=>'SMALL_480X320'
,p_display_name=>'Small (480x320)'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1774858800950936491)
,p_css_classes=>'js-dialog-size480x320'
,p_group_id=>wwv_flow_api.id(804539508869800181)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774860627217936497)
,p_theme_id=>42
,p_name=>'240PX'
,p_display_name=>'240px'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1774859855390936493)
,p_css_classes=>'i-h240'
,p_group_id=>wwv_flow_api.id(804536344202800179)
,p_template_types=>'REGION'
,p_help_text=>'Sets region body height to 240px.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774860756424936497)
,p_theme_id=>42
,p_name=>'320PX'
,p_display_name=>'320px'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(1774859855390936493)
,p_css_classes=>'i-h320'
,p_group_id=>wwv_flow_api.id(804536344202800179)
,p_template_types=>'REGION'
,p_help_text=>'Sets region body height to 320px.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774860812241936497)
,p_theme_id=>42
,p_name=>'480PX'
,p_display_name=>'480px'
,p_display_sequence=>30
,p_region_template_id=>wwv_flow_api.id(1774859855390936493)
,p_css_classes=>'i-h480'
,p_group_id=>wwv_flow_api.id(804536344202800179)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774860950116936497)
,p_theme_id=>42
,p_name=>'640PX'
,p_display_name=>'640px'
,p_display_sequence=>40
,p_region_template_id=>wwv_flow_api.id(1774859855390936493)
,p_css_classes=>'i-h640'
,p_group_id=>wwv_flow_api.id(804536344202800179)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774861049224936497)
,p_theme_id=>42
,p_name=>'ACCENT_1'
,p_display_name=>'Accent 1'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1774859855390936493)
,p_css_classes=>'t-Region--accent1'
,p_group_id=>wwv_flow_api.id(804533973283800178)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774861150976936497)
,p_theme_id=>42
,p_name=>'ACCENT_2'
,p_display_name=>'Accent 2'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(1774859855390936493)
,p_css_classes=>'t-Region--accent2'
,p_group_id=>wwv_flow_api.id(804533973283800178)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774861247187936497)
,p_theme_id=>42
,p_name=>'ACCENT_3'
,p_display_name=>'Accent 3'
,p_display_sequence=>30
,p_region_template_id=>wwv_flow_api.id(1774859855390936493)
,p_css_classes=>'t-Region--accent3'
,p_group_id=>wwv_flow_api.id(804533973283800178)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774861290406936497)
,p_theme_id=>42
,p_name=>'ACCENT_4'
,p_display_name=>'Accent 4'
,p_display_sequence=>40
,p_region_template_id=>wwv_flow_api.id(1774859855390936493)
,p_css_classes=>'t-Region--accent4'
,p_group_id=>wwv_flow_api.id(804533973283800178)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774861421971936497)
,p_theme_id=>42
,p_name=>'ACCENT_5'
,p_display_name=>'Accent 5'
,p_display_sequence=>50
,p_region_template_id=>wwv_flow_api.id(1774859855390936493)
,p_css_classes=>'t-Region--accent5'
,p_group_id=>wwv_flow_api.id(804533973283800178)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774861633195936497)
,p_theme_id=>42
,p_name=>'HIDDENHEADERNOAT'
,p_display_name=>'Hidden'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1774859855390936493)
,p_css_classes=>'t-Region--removeHeader js-removeLandmark'
,p_group_id=>wwv_flow_api.id(804540730240800182)
,p_template_types=>'REGION'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774861672312936497)
,p_theme_id=>42
,p_name=>'HIDEOVERFLOW'
,p_display_name=>'Hide'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(1774859855390936493)
,p_css_classes=>'t-Region--hiddenOverflow'
,p_group_id=>wwv_flow_api.id(804536748710800179)
,p_template_types=>'REGION'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774861835438936498)
,p_theme_id=>42
,p_name=>'HIDEREGIONHEADER'
,p_display_name=>'Hidden but accessible'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(1774859855390936493)
,p_css_classes=>'t-Region--hideHeader'
,p_group_id=>wwv_flow_api.id(804540730240800182)
,p_template_types=>'REGION'
,p_help_text=>'This option will hide the region header. Note that the region title will still be audible for Screen Readers. Buttons placed in the region header will be hidden and inaccessible.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774861894839936498)
,p_theme_id=>42
,p_name=>'NOBODYPADDING'
,p_display_name=>'Remove Body Padding'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1774859855390936493)
,p_css_classes=>'t-Region--noPadding'
,p_template_types=>'REGION'
,p_help_text=>'Removes padding from region body.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774861995957936498)
,p_theme_id=>42
,p_name=>'NOBORDER'
,p_display_name=>'Remove Borders'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1774859855390936493)
,p_css_classes=>'t-Region--noBorder'
,p_group_id=>wwv_flow_api.id(804547523949800185)
,p_template_types=>'REGION'
,p_help_text=>'Removes borders from the region.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774862114115936498)
,p_theme_id=>42
,p_name=>'SCROLLBODY'
,p_display_name=>'Scroll - Default'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1774859855390936493)
,p_css_classes=>'t-Region--scrollBody'
,p_group_id=>wwv_flow_api.id(804536748710800179)
,p_template_types=>'REGION'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774862364541936498)
,p_theme_id=>42
,p_name=>'STACKED'
,p_display_name=>'Stack Region'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(1774859855390936493)
,p_css_classes=>'t-Region--stacked'
,p_group_id=>wwv_flow_api.id(804547523949800185)
,p_template_types=>'REGION'
,p_help_text=>'Removes side borders and shadows, and can be useful for accordions and regions that need to be grouped together vertically.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774862859867936502)
,p_theme_id=>42
,p_name=>'GET_TITLE_FROM_BREADCRUMB'
,p_display_name=>'Use Current Breadcrumb Entry'
,p_display_sequence=>1
,p_region_template_id=>wwv_flow_api.id(1774862430658936498)
,p_css_classes=>'t-BreadcrumbRegion--useBreadcrumbTitle'
,p_group_id=>wwv_flow_api.id(804546742887800185)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774862923652936502)
,p_theme_id=>42
,p_name=>'HIDE_BREADCRUMB'
,p_display_name=>'Show Breadcrumbs'
,p_display_sequence=>1
,p_region_template_id=>wwv_flow_api.id(1774862430658936498)
,p_css_classes=>'t-BreadcrumbRegion--showBreadcrumb'
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774863064329936502)
,p_theme_id=>42
,p_name=>'REGION_HEADER_VISIBLE'
,p_display_name=>'Use Region Title'
,p_display_sequence=>1
,p_region_template_id=>wwv_flow_api.id(1774862430658936498)
,p_css_classes=>'t-BreadcrumbRegion--useRegionTitle'
,p_group_id=>wwv_flow_api.id(804546742887800185)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774863604624936504)
,p_theme_id=>42
,p_name=>'HIDESMALLSCREENS'
,p_display_name=>'Small Screens (Tablet)'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(1774863107879936502)
,p_css_classes=>'t-Wizard--hideStepsSmall'
,p_group_id=>wwv_flow_api.id(804541987832800182)
,p_template_types=>'REGION'
,p_help_text=>'Hides the wizard progress steps for screens that are smaller than 768px wide.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774863853568936504)
,p_theme_id=>42
,p_name=>'HIDEXSMALLSCREENS'
,p_display_name=>'X Small Screens (Mobile)'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1774863107879936502)
,p_css_classes=>'t-Wizard--hideStepsXSmall'
,p_group_id=>wwv_flow_api.id(804541987832800182)
,p_template_types=>'REGION'
,p_help_text=>'Hides the wizard progress steps for screens that are smaller than 768px wide.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774864474093936509)
,p_theme_id=>42
,p_name=>'128PX'
,p_display_name=>'128px'
,p_display_sequence=>50
,p_report_template_id=>wwv_flow_api.id(1774864081583936507)
,p_css_classes=>'t-BadgeList--xxlarge'
,p_group_id=>wwv_flow_api.id(804549959177800186)
,p_template_types=>'REPORT'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774864868706936510)
,p_theme_id=>42
,p_name=>'2COLUMNGRID'
,p_display_name=>'2 Column Grid'
,p_display_sequence=>20
,p_report_template_id=>wwv_flow_api.id(1774864081583936507)
,p_css_classes=>'t-BadgeList--cols'
,p_group_id=>wwv_flow_api.id(804556336641800190)
,p_template_types=>'REPORT'
,p_help_text=>'Arrange badges in a two column grid'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774864900330936510)
,p_theme_id=>42
,p_name=>'32PX'
,p_display_name=>'32px'
,p_display_sequence=>10
,p_report_template_id=>wwv_flow_api.id(1774864081583936507)
,p_css_classes=>'t-BadgeList--small'
,p_group_id=>wwv_flow_api.id(804549959177800186)
,p_template_types=>'REPORT'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774865067730936510)
,p_theme_id=>42
,p_name=>'3COLUMNGRID'
,p_display_name=>'3 Column Grid'
,p_display_sequence=>30
,p_report_template_id=>wwv_flow_api.id(1774864081583936507)
,p_css_classes=>'t-BadgeList--cols t-BadgeList--3cols'
,p_group_id=>wwv_flow_api.id(804556336641800190)
,p_template_types=>'REPORT'
,p_help_text=>'Arrange badges in a 3 column grid'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774865135875936510)
,p_theme_id=>42
,p_name=>'48PX'
,p_display_name=>'48px'
,p_display_sequence=>20
,p_report_template_id=>wwv_flow_api.id(1774864081583936507)
,p_css_classes=>'t-BadgeList--medium'
,p_group_id=>wwv_flow_api.id(804549959177800186)
,p_template_types=>'REPORT'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774865251700936510)
,p_theme_id=>42
,p_name=>'4COLUMNGRID'
,p_display_name=>'4 Column Grid'
,p_display_sequence=>40
,p_report_template_id=>wwv_flow_api.id(1774864081583936507)
,p_css_classes=>'t-BadgeList--cols t-BadgeList--4cols'
,p_group_id=>wwv_flow_api.id(804556336641800190)
,p_template_types=>'REPORT'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774865311829936510)
,p_theme_id=>42
,p_name=>'5COLUMNGRID'
,p_display_name=>'5 Column Grid'
,p_display_sequence=>50
,p_report_template_id=>wwv_flow_api.id(1774864081583936507)
,p_css_classes=>'t-BadgeList--cols t-BadgeList--5cols'
,p_group_id=>wwv_flow_api.id(804556336641800190)
,p_template_types=>'REPORT'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774865372064936510)
,p_theme_id=>42
,p_name=>'64PX'
,p_display_name=>'64px'
,p_display_sequence=>30
,p_report_template_id=>wwv_flow_api.id(1774864081583936507)
,p_css_classes=>'t-BadgeList--large'
,p_group_id=>wwv_flow_api.id(804549959177800186)
,p_template_types=>'REPORT'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774865535768936510)
,p_theme_id=>42
,p_name=>'96PX'
,p_display_name=>'96px'
,p_display_sequence=>40
,p_report_template_id=>wwv_flow_api.id(1774864081583936507)
,p_css_classes=>'t-BadgeList--xlarge'
,p_group_id=>wwv_flow_api.id(804549959177800186)
,p_template_types=>'REPORT'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774865588704936510)
,p_theme_id=>42
,p_name=>'FIXED'
,p_display_name=>'Span Horizontally'
,p_display_sequence=>60
,p_report_template_id=>wwv_flow_api.id(1774864081583936507)
,p_css_classes=>'t-BadgeList--fixed'
,p_group_id=>wwv_flow_api.id(804556336641800190)
,p_template_types=>'REPORT'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774865671630936510)
,p_theme_id=>42
,p_name=>'FLEXIBLEBOX'
,p_display_name=>'Flexible Box'
,p_display_sequence=>80
,p_report_template_id=>wwv_flow_api.id(1774864081583936507)
,p_css_classes=>'t-BadgeList--flex'
,p_group_id=>wwv_flow_api.id(804556336641800190)
,p_template_types=>'REPORT'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774865855024936510)
,p_theme_id=>42
,p_name=>'FLOATITEMS'
,p_display_name=>'Float Items'
,p_display_sequence=>70
,p_report_template_id=>wwv_flow_api.id(1774864081583936507)
,p_css_classes=>'t-BadgeList--float'
,p_group_id=>wwv_flow_api.id(804556336641800190)
,p_template_types=>'REPORT'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774866035498936510)
,p_theme_id=>42
,p_name=>'STACKED'
,p_display_name=>'Stacked'
,p_display_sequence=>10
,p_report_template_id=>wwv_flow_api.id(1774864081583936507)
,p_css_classes=>'t-BadgeList--stacked'
,p_group_id=>wwv_flow_api.id(804556336641800190)
,p_template_types=>'REPORT'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774866519929936516)
,p_theme_id=>42
,p_name=>'2_COLUMNS'
,p_display_name=>'2 Columns'
,p_display_sequence=>15
,p_report_template_id=>wwv_flow_api.id(1774866287250936513)
,p_css_classes=>'t-Cards--cols'
,p_group_id=>wwv_flow_api.id(804556336641800190)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774866791493936517)
,p_theme_id=>42
,p_name=>'2_LINES'
,p_display_name=>'2 Lines'
,p_display_sequence=>10
,p_report_template_id=>wwv_flow_api.id(1774866287250936513)
,p_css_classes=>'t-Cards--desc-2ln'
,p_group_id=>wwv_flow_api.id(804550344016800187)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774866931799936517)
,p_theme_id=>42
,p_name=>'3_COLUMNS'
,p_display_name=>'3 Columns'
,p_display_sequence=>20
,p_report_template_id=>wwv_flow_api.id(1774866287250936513)
,p_css_classes=>'t-Cards--3cols'
,p_group_id=>wwv_flow_api.id(804556336641800190)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774867064727936518)
,p_theme_id=>42
,p_name=>'3_LINES'
,p_display_name=>'3 Lines'
,p_display_sequence=>20
,p_report_template_id=>wwv_flow_api.id(1774866287250936513)
,p_css_classes=>'t-Cards--desc-3ln'
,p_group_id=>wwv_flow_api.id(804550344016800187)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774867159730936518)
,p_theme_id=>42
,p_name=>'4_COLUMNS'
,p_display_name=>'4 Columns'
,p_display_sequence=>30
,p_report_template_id=>wwv_flow_api.id(1774866287250936513)
,p_css_classes=>'t-Cards--4cols'
,p_group_id=>wwv_flow_api.id(804556336641800190)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774867225601936518)
,p_theme_id=>42
,p_name=>'4_LINES'
,p_display_name=>'4 Lines'
,p_display_sequence=>30
,p_report_template_id=>wwv_flow_api.id(1774866287250936513)
,p_css_classes=>'t-Cards--desc-4ln'
,p_group_id=>wwv_flow_api.id(804550344016800187)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774867320167936518)
,p_theme_id=>42
,p_name=>'5_COLUMNS'
,p_display_name=>'5 Columns'
,p_display_sequence=>50
,p_report_template_id=>wwv_flow_api.id(1774866287250936513)
,p_css_classes=>'t-Cards--5cols'
,p_group_id=>wwv_flow_api.id(804556336641800190)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774867663043936518)
,p_theme_id=>42
,p_name=>'BASIC'
,p_display_name=>'Basic'
,p_display_sequence=>10
,p_report_template_id=>wwv_flow_api.id(1774866287250936513)
,p_css_classes=>'t-Cards--basic'
,p_group_id=>wwv_flow_api.id(804558397080800192)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774867929994936518)
,p_theme_id=>42
,p_name=>'DISPLAY_ICONS'
,p_display_name=>'Display Icons'
,p_display_sequence=>10
,p_report_template_id=>wwv_flow_api.id(1774866287250936513)
,p_css_classes=>'t-Cards--displayIcons'
,p_group_id=>wwv_flow_api.id(804555140165800189)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774868029167936518)
,p_theme_id=>42
,p_name=>'DISPLAY_INITIALS'
,p_display_name=>'Display Initials'
,p_display_sequence=>20
,p_report_template_id=>wwv_flow_api.id(1774866287250936513)
,p_css_classes=>'t-Cards--displayInitials'
,p_group_id=>wwv_flow_api.id(804555140165800189)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774868150931936518)
,p_theme_id=>42
,p_name=>'FEATURED'
,p_display_name=>'Featured'
,p_display_sequence=>30
,p_report_template_id=>wwv_flow_api.id(1774866287250936513)
,p_css_classes=>'t-Cards--featured force-fa-lg'
,p_group_id=>wwv_flow_api.id(804558397080800192)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774868259624936519)
,p_theme_id=>42
,p_name=>'FLOAT'
,p_display_name=>'Float'
,p_display_sequence=>60
,p_report_template_id=>wwv_flow_api.id(1774866287250936513)
,p_css_classes=>'t-Cards--float'
,p_group_id=>wwv_flow_api.id(804556336641800190)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774868294341936519)
,p_theme_id=>42
,p_name=>'SPAN_HORIZONTALLY'
,p_display_name=>'Span Horizontally'
,p_display_sequence=>70
,p_report_template_id=>wwv_flow_api.id(1774866287250936513)
,p_css_classes=>'t-Cards--spanHorizontally'
,p_group_id=>wwv_flow_api.id(804556336641800190)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774868583124936519)
,p_theme_id=>42
,p_name=>'USE_THEME_COLORS'
,p_display_name=>'Apply Theme Colors'
,p_display_sequence=>10
,p_report_template_id=>wwv_flow_api.id(1774866287250936513)
,p_css_classes=>'u-colors'
,p_template_types=>'REPORT'
);
end;
/
begin
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774869079426936525)
,p_theme_id=>42
,p_name=>'BASIC'
,p_display_name=>'Basic'
,p_display_sequence=>10
,p_report_template_id=>wwv_flow_api.id(1774868688704936519)
,p_css_classes=>'t-Comments--basic'
,p_group_id=>wwv_flow_api.id(804553548101800188)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774869194535936525)
,p_theme_id=>42
,p_name=>'SPEECH_BUBBLES'
,p_display_name=>'Speech Bubbles'
,p_display_sequence=>20
,p_report_template_id=>wwv_flow_api.id(1774868688704936519)
,p_css_classes=>'t-Comments--chat'
,p_group_id=>wwv_flow_api.id(804553548101800188)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774869879515936530)
,p_theme_id=>42
,p_name=>'ALTROWCOLORSDISABLE'
,p_display_name=>'Disable'
,p_display_sequence=>20
,p_report_template_id=>wwv_flow_api.id(1774869560539936527)
,p_css_classes=>'t-Report--staticRowColors'
,p_group_id=>wwv_flow_api.id(804549107092800186)
,p_template_types=>'REPORT'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774870054490936530)
,p_theme_id=>42
,p_name=>'ALTROWCOLORSENABLE'
,p_display_name=>'Enable'
,p_display_sequence=>10
,p_report_template_id=>wwv_flow_api.id(1774869560539936527)
,p_css_classes=>'t-Report--altRowsDefault'
,p_group_id=>wwv_flow_api.id(804549107092800186)
,p_template_types=>'REPORT'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774870316669936531)
,p_theme_id=>42
,p_name=>'ENABLE'
,p_display_name=>'Enable'
,p_display_sequence=>10
,p_report_template_id=>wwv_flow_api.id(1774869560539936527)
,p_css_classes=>'t-Report--rowHighlight'
,p_group_id=>wwv_flow_api.id(804557567097800191)
,p_template_types=>'REPORT'
,p_help_text=>'Enable row highlighting on mouse over'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774870607037936531)
,p_theme_id=>42
,p_name=>'HORIZONTALBORDERS'
,p_display_name=>'Horizontal Only'
,p_display_sequence=>20
,p_report_template_id=>wwv_flow_api.id(1774869560539936527)
,p_css_classes=>'t-Report--horizontalBorders'
,p_group_id=>wwv_flow_api.id(804557124613800190)
,p_template_types=>'REPORT'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774870715192936531)
,p_theme_id=>42
,p_name=>'REMOVEALLBORDERS'
,p_display_name=>'No Borders'
,p_display_sequence=>30
,p_report_template_id=>wwv_flow_api.id(1774869560539936527)
,p_css_classes=>'t-Report--noBorders'
,p_group_id=>wwv_flow_api.id(804557124613800190)
,p_template_types=>'REPORT'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774870805211936531)
,p_theme_id=>42
,p_name=>'REMOVEOUTERBORDERS'
,p_display_name=>'No Outer Borders'
,p_display_sequence=>40
,p_report_template_id=>wwv_flow_api.id(1774869560539936527)
,p_css_classes=>'t-Report--inline'
,p_group_id=>wwv_flow_api.id(804557124613800190)
,p_template_types=>'REPORT'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774870910805936531)
,p_theme_id=>42
,p_name=>'ROWHIGHLIGHTDISABLE'
,p_display_name=>'Disable'
,p_display_sequence=>20
,p_report_template_id=>wwv_flow_api.id(1774869560539936527)
,p_css_classes=>'t-Report--rowHighlightOff'
,p_group_id=>wwv_flow_api.id(804557567097800191)
,p_template_types=>'REPORT'
,p_help_text=>'Disable row highlighting on mouse over'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774871047522936531)
,p_theme_id=>42
,p_name=>'STRETCHREPORT'
,p_display_name=>'Stretch Report'
,p_display_sequence=>10
,p_report_template_id=>wwv_flow_api.id(1774869560539936527)
,p_css_classes=>'t-Report--stretch'
,p_template_types=>'REPORT'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774871080724936531)
,p_theme_id=>42
,p_name=>'VERTICALBORDERS'
,p_display_name=>'Vertical Only'
,p_display_sequence=>20
,p_report_template_id=>wwv_flow_api.id(1774869560539936527)
,p_css_classes=>'t-Report--verticalBorders'
,p_group_id=>wwv_flow_api.id(804557124613800190)
,p_template_types=>'REPORT'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774871601991936533)
,p_theme_id=>42
,p_name=>'FIXED_LARGE'
,p_display_name=>'Fixed - Large'
,p_display_sequence=>30
,p_report_template_id=>wwv_flow_api.id(1774871265928936531)
,p_css_classes=>'t-AVPList--fixedLabelLarge'
,p_group_id=>wwv_flow_api.id(804555933986800190)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774871716011936533)
,p_theme_id=>42
,p_name=>'FIXED_MEDIUM'
,p_display_name=>'Fixed - Medium'
,p_display_sequence=>20
,p_report_template_id=>wwv_flow_api.id(1774871265928936531)
,p_css_classes=>'t-AVPList--fixedLabelMedium'
,p_group_id=>wwv_flow_api.id(804555933986800190)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774871848354936533)
,p_theme_id=>42
,p_name=>'FIXED_SMALL'
,p_display_name=>'Fixed - Small'
,p_display_sequence=>10
,p_report_template_id=>wwv_flow_api.id(1774871265928936531)
,p_css_classes=>'t-AVPList--fixedLabelSmall'
,p_group_id=>wwv_flow_api.id(804555933986800190)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774871915871936533)
,p_theme_id=>42
,p_name=>'LEFT_ALIGNED_DETAILS'
,p_display_name=>'Left Aligned Details'
,p_display_sequence=>10
,p_report_template_id=>wwv_flow_api.id(1774871265928936531)
,p_css_classes=>'t-AVPList--leftAligned'
,p_group_id=>wwv_flow_api.id(804556336641800190)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774872042503936533)
,p_theme_id=>42
,p_name=>'RIGHT_ALIGNED_DETAILS'
,p_display_name=>'Right Aligned Details'
,p_display_sequence=>20
,p_report_template_id=>wwv_flow_api.id(1774871265928936531)
,p_css_classes=>'t-AVPList--rightAligned'
,p_group_id=>wwv_flow_api.id(804556336641800190)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774872081203936533)
,p_theme_id=>42
,p_name=>'VARIABLE_LARGE'
,p_display_name=>'Variable - Large'
,p_display_sequence=>60
,p_report_template_id=>wwv_flow_api.id(1774871265928936531)
,p_css_classes=>'t-AVPList--variableLabelLarge'
,p_group_id=>wwv_flow_api.id(804555933986800190)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774872169592936533)
,p_theme_id=>42
,p_name=>'VARIABLE_MEDIUM'
,p_display_name=>'Variable - Medium'
,p_display_sequence=>50
,p_report_template_id=>wwv_flow_api.id(1774871265928936531)
,p_css_classes=>'t-AVPList--variableLabelMedium'
,p_group_id=>wwv_flow_api.id(804555933986800190)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774872284645936533)
,p_theme_id=>42
,p_name=>'VARIABLE_SMALL'
,p_display_name=>'Variable - Small'
,p_display_sequence=>40
,p_report_template_id=>wwv_flow_api.id(1774871265928936531)
,p_css_classes=>'t-AVPList--variableLabelSmall'
,p_group_id=>wwv_flow_api.id(804555933986800190)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774872988770936539)
,p_theme_id=>42
,p_name=>'2COLUMNGRID'
,p_display_name=>'2 Column Grid'
,p_display_sequence=>20
,p_list_template_id=>wwv_flow_api.id(1774872583686936536)
,p_css_classes=>'t-BadgeList--cols'
,p_group_id=>wwv_flow_api.id(804530712278800176)
,p_template_types=>'LIST'
,p_help_text=>'Arrange badges in a two column grid'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774873094037936539)
,p_theme_id=>42
,p_name=>'3COLUMNGRID'
,p_display_name=>'3 Column Grid'
,p_display_sequence=>30
,p_list_template_id=>wwv_flow_api.id(1774872583686936536)
,p_css_classes=>'t-BadgeList--cols t-BadgeList--3cols'
,p_group_id=>wwv_flow_api.id(804530712278800176)
,p_template_types=>'LIST'
,p_help_text=>'Arrange badges in a 3 column grid'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774873173264936539)
,p_theme_id=>42
,p_name=>'4COLUMNGRID'
,p_display_name=>'4 Column Grid'
,p_display_sequence=>40
,p_list_template_id=>wwv_flow_api.id(1774872583686936536)
,p_css_classes=>'t-BadgeList--cols t-BadgeList--4cols'
,p_group_id=>wwv_flow_api.id(804530712278800176)
,p_template_types=>'LIST'
,p_help_text=>'Arrange badges in 4 column grid'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774873340597936539)
,p_theme_id=>42
,p_name=>'5COLUMNGRID'
,p_display_name=>'5 Column Grid'
,p_display_sequence=>50
,p_list_template_id=>wwv_flow_api.id(1774872583686936536)
,p_css_classes=>'t-BadgeList--cols t-BadgeList--5cols'
,p_group_id=>wwv_flow_api.id(804530712278800176)
,p_template_types=>'LIST'
,p_help_text=>'Arrange badges in a 5 column grid'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774873387200936539)
,p_theme_id=>42
,p_name=>'FIXED'
,p_display_name=>'Span Horizontally'
,p_display_sequence=>60
,p_list_template_id=>wwv_flow_api.id(1774872583686936536)
,p_css_classes=>'t-BadgeList--fixed'
,p_group_id=>wwv_flow_api.id(804530712278800176)
,p_template_types=>'LIST'
,p_help_text=>'Span badges horizontally'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774873479753936541)
,p_theme_id=>42
,p_name=>'FLEXIBLEBOX'
,p_display_name=>'Flexible Box'
,p_display_sequence=>80
,p_list_template_id=>wwv_flow_api.id(1774872583686936536)
,p_css_classes=>'t-BadgeList--flex'
,p_group_id=>wwv_flow_api.id(804530712278800176)
,p_template_types=>'LIST'
,p_help_text=>'Use flexbox to arrange items'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774873579656936542)
,p_theme_id=>42
,p_name=>'FLOATITEMS'
,p_display_name=>'Float Items'
,p_display_sequence=>70
,p_list_template_id=>wwv_flow_api.id(1774872583686936536)
,p_css_classes=>'t-BadgeList--float'
,p_group_id=>wwv_flow_api.id(804530712278800176)
,p_template_types=>'LIST'
,p_help_text=>'Float badges to left'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774873876264936542)
,p_theme_id=>42
,p_name=>'LARGE'
,p_display_name=>'64px'
,p_display_sequence=>30
,p_list_template_id=>wwv_flow_api.id(1774872583686936536)
,p_css_classes=>'t-BadgeList--large'
,p_group_id=>wwv_flow_api.id(804526767700800170)
,p_template_types=>'LIST'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774874014846936542)
,p_theme_id=>42
,p_name=>'MEDIUM'
,p_display_name=>'48px'
,p_display_sequence=>20
,p_list_template_id=>wwv_flow_api.id(1774872583686936536)
,p_css_classes=>'t-BadgeList--medium'
,p_group_id=>wwv_flow_api.id(804526767700800170)
,p_template_types=>'LIST'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774874260556936542)
,p_theme_id=>42
,p_name=>'SMALL'
,p_display_name=>'32px'
,p_display_sequence=>10
,p_list_template_id=>wwv_flow_api.id(1774872583686936536)
,p_css_classes=>'t-BadgeList--small'
,p_group_id=>wwv_flow_api.id(804526767700800170)
,p_template_types=>'LIST'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774874332858936542)
,p_theme_id=>42
,p_name=>'STACKED'
,p_display_name=>'Stacked'
,p_display_sequence=>10
,p_list_template_id=>wwv_flow_api.id(1774872583686936536)
,p_css_classes=>'t-BadgeList--stacked'
,p_group_id=>wwv_flow_api.id(804530712278800176)
,p_template_types=>'LIST'
,p_help_text=>'Stack badges on top of each other'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774874464769936542)
,p_theme_id=>42
,p_name=>'XLARGE'
,p_display_name=>'96px'
,p_display_sequence=>40
,p_list_template_id=>wwv_flow_api.id(1774872583686936536)
,p_css_classes=>'t-BadgeList--xlarge'
,p_group_id=>wwv_flow_api.id(804526767700800170)
,p_template_types=>'LIST'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774874555245936542)
,p_theme_id=>42
,p_name=>'XXLARGE'
,p_display_name=>'128px'
,p_display_sequence=>50
,p_list_template_id=>wwv_flow_api.id(1774872583686936536)
,p_css_classes=>'t-BadgeList--xxlarge'
,p_group_id=>wwv_flow_api.id(804526767700800170)
,p_template_types=>'LIST'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774874818577936544)
,p_theme_id=>42
,p_name=>'2_COLUMNS'
,p_display_name=>'2 Columns'
,p_display_sequence=>10
,p_list_template_id=>wwv_flow_api.id(1774874589747936542)
,p_css_classes=>'t-Cards--cols'
,p_group_id=>wwv_flow_api.id(804530712278800176)
,p_template_types=>'LIST'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774875156646936544)
,p_theme_id=>42
,p_name=>'2_LINES'
,p_display_name=>'2 Lines'
,p_display_sequence=>10
,p_list_template_id=>wwv_flow_api.id(1774874589747936542)
,p_css_classes=>'t-Cards--desc-2ln'
,p_group_id=>wwv_flow_api.id(804527102441800170)
,p_template_types=>'LIST'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774875226555936544)
,p_theme_id=>42
,p_name=>'3_COLUMNS'
,p_display_name=>'3 Columns'
,p_display_sequence=>20
,p_list_template_id=>wwv_flow_api.id(1774874589747936542)
,p_css_classes=>'t-Cards--3cols'
,p_group_id=>wwv_flow_api.id(804530712278800176)
,p_template_types=>'LIST'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774875331099936544)
,p_theme_id=>42
,p_name=>'3_LINES'
,p_display_name=>'3 Lines'
,p_display_sequence=>20
,p_list_template_id=>wwv_flow_api.id(1774874589747936542)
,p_css_classes=>'t-Cards--desc-3ln'
,p_group_id=>wwv_flow_api.id(804527102441800170)
,p_template_types=>'LIST'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774875438973936544)
,p_theme_id=>42
,p_name=>'4_COLUMNS'
,p_display_name=>'4 Columns'
,p_display_sequence=>30
,p_list_template_id=>wwv_flow_api.id(1774874589747936542)
,p_css_classes=>'t-Cards--4cols'
,p_group_id=>wwv_flow_api.id(804530712278800176)
,p_template_types=>'LIST'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774875556539936544)
,p_theme_id=>42
,p_name=>'4_LINES'
,p_display_name=>'4 Lines'
,p_display_sequence=>30
,p_list_template_id=>wwv_flow_api.id(1774874589747936542)
,p_css_classes=>'t-Cards--desc-4ln'
,p_group_id=>wwv_flow_api.id(804527102441800170)
,p_template_types=>'LIST'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774875634872936544)
,p_theme_id=>42
,p_name=>'5_COLUMNS'
,p_display_name=>'5 Columns'
,p_display_sequence=>50
,p_list_template_id=>wwv_flow_api.id(1774874589747936542)
,p_css_classes=>'t-Cards--5cols'
,p_group_id=>wwv_flow_api.id(804530712278800176)
,p_template_types=>'LIST'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774875904745936544)
,p_theme_id=>42
,p_name=>'BASIC'
,p_display_name=>'Basic'
,p_display_sequence=>10
,p_list_template_id=>wwv_flow_api.id(1774874589747936542)
,p_css_classes=>'t-Cards--basic'
,p_group_id=>wwv_flow_api.id(804531903410800177)
,p_template_types=>'LIST'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774876214942936545)
,p_theme_id=>42
,p_name=>'DISPLAY_ICONS'
,p_display_name=>'Display Icons'
,p_display_sequence=>10
,p_list_template_id=>wwv_flow_api.id(1774874589747936542)
,p_css_classes=>'t-Cards--displayIcons'
,p_group_id=>wwv_flow_api.id(804529109054800172)
,p_template_types=>'LIST'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774876362910936545)
,p_theme_id=>42
,p_name=>'DISPLAY_INITIALS'
,p_display_name=>'Display Initials'
,p_display_sequence=>20
,p_list_template_id=>wwv_flow_api.id(1774874589747936542)
,p_css_classes=>'t-Cards--displayInitials'
,p_group_id=>wwv_flow_api.id(804529109054800172)
,p_template_types=>'LIST'
,p_help_text=>'Initials come from List Attribute 3'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774876385741936545)
,p_theme_id=>42
,p_name=>'FEATURED'
,p_display_name=>'Featured'
,p_display_sequence=>30
,p_list_template_id=>wwv_flow_api.id(1774874589747936542)
,p_css_classes=>'t-Cards--featured force-fa-lg'
,p_group_id=>wwv_flow_api.id(804531903410800177)
,p_template_types=>'LIST'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774876547465936545)
,p_theme_id=>42
,p_name=>'FLOAT'
,p_display_name=>'Float'
,p_display_sequence=>60
,p_list_template_id=>wwv_flow_api.id(1774874589747936542)
,p_css_classes=>'t-Cards--float'
,p_group_id=>wwv_flow_api.id(804530712278800176)
,p_template_types=>'LIST'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774876621242936545)
,p_theme_id=>42
,p_name=>'SPAN_HORIZONTALLY'
,p_display_name=>'Span Horizontally'
,p_display_sequence=>70
,p_list_template_id=>wwv_flow_api.id(1774874589747936542)
,p_css_classes=>'t-Cards--spanHorizontally'
,p_group_id=>wwv_flow_api.id(804530712278800176)
,p_template_types=>'LIST'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774876952766936545)
,p_theme_id=>42
,p_name=>'USE_THEME_COLORS'
,p_display_name=>'Apply Theme Colors'
,p_display_sequence=>10
,p_list_template_id=>wwv_flow_api.id(1774874589747936542)
,p_css_classes=>'u-colors'
,p_template_types=>'LIST'
,p_help_text=>'Applies the colors from the theme''s color palette to the icons or initials within cards.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774877241250936547)
,p_theme_id=>42
,p_name=>'ACTIONS'
,p_display_name=>'Actions'
,p_display_sequence=>10
,p_list_template_id=>wwv_flow_api.id(1774877008397936545)
,p_css_classes=>'t-LinksList--actions'
,p_group_id=>wwv_flow_api.id(804531903410800177)
,p_template_types=>'LIST'
,p_help_text=>'Render as actions to be placed on the right side column.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774877311545936547)
,p_theme_id=>42
,p_name=>'DISABLETEXTWRAPPING'
,p_display_name=>'Disable Text Wrapping'
,p_display_sequence=>30
,p_list_template_id=>wwv_flow_api.id(1774877008397936545)
,p_css_classes=>'t-LinksList--nowrap'
,p_template_types=>'LIST'
,p_help_text=>'Do not allow link text to wrap to new lines. Truncate with ellipsis.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774877544972936547)
,p_theme_id=>42
,p_name=>'SHOWBADGES'
,p_display_name=>'Show Badges'
,p_display_sequence=>10
,p_list_template_id=>wwv_flow_api.id(1774877008397936545)
,p_css_classes=>'t-LinksList--showBadge'
,p_template_types=>'LIST'
,p_help_text=>'Show badge to right of link (requires Attribute 1 to be populated)'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774877625509936547)
,p_theme_id=>42
,p_name=>'SHOWGOTOARROW'
,p_display_name=>'Show Right Arrow'
,p_display_sequence=>20
,p_list_template_id=>wwv_flow_api.id(1774877008397936545)
,p_css_classes=>'t-LinksList--showArrow'
,p_template_types=>'LIST'
,p_help_text=>'Show arrow to the right of link'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774877915452936547)
,p_theme_id=>42
,p_name=>'SHOWICONS'
,p_display_name=>'For All Items'
,p_display_sequence=>20
,p_list_template_id=>wwv_flow_api.id(1774877008397936545)
,p_css_classes=>'t-LinksList--showIcons'
,p_group_id=>wwv_flow_api.id(804528707803800171)
,p_template_types=>'LIST'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774877988363936547)
,p_theme_id=>42
,p_name=>'SHOWTOPICONS'
,p_display_name=>'For Top Level Items Only'
,p_display_sequence=>10
,p_list_template_id=>wwv_flow_api.id(1774877008397936545)
,p_css_classes=>'t-LinksList--showTopIcons'
,p_group_id=>wwv_flow_api.id(804528707803800171)
,p_template_types=>'LIST'
,p_help_text=>'This will show icons for top level items of the list only. It will not show icons for sub lists.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774878468038936548)
,p_theme_id=>42
,p_name=>'2COLUMNGRID'
,p_display_name=>'2 Column Grid'
,p_display_sequence=>10
,p_list_template_id=>wwv_flow_api.id(1774878219827936547)
,p_css_classes=>'t-MediaList--cols t-MediaList--2cols'
,p_group_id=>wwv_flow_api.id(804530712278800176)
,p_template_types=>'LIST'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774878500794936549)
,p_theme_id=>42
,p_name=>'3COLUMNGRID'
,p_display_name=>'3 Column Grid'
,p_display_sequence=>20
,p_list_template_id=>wwv_flow_api.id(1774878219827936547)
,p_css_classes=>'t-MediaList--cols t-MediaList--3cols'
,p_group_id=>wwv_flow_api.id(804530712278800176)
,p_template_types=>'LIST'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774878664050936549)
,p_theme_id=>42
,p_name=>'4COLUMNGRID'
,p_display_name=>'4 Column Grid'
,p_display_sequence=>30
,p_list_template_id=>wwv_flow_api.id(1774878219827936547)
,p_css_classes=>'t-MediaList--cols t-MediaList--4cols'
,p_group_id=>wwv_flow_api.id(804530712278800176)
,p_template_types=>'LIST'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774878733945936549)
,p_theme_id=>42
,p_name=>'5COLUMNGRID'
,p_display_name=>'5 Column Grid'
,p_display_sequence=>40
,p_list_template_id=>wwv_flow_api.id(1774878219827936547)
,p_css_classes=>'t-MediaList--cols t-MediaList--5cols'
,p_group_id=>wwv_flow_api.id(804530712278800176)
,p_template_types=>'LIST'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774879695521936549)
,p_theme_id=>42
,p_name=>'SPANHORIZONTAL'
,p_display_name=>'Span Horizontal'
,p_display_sequence=>50
,p_list_template_id=>wwv_flow_api.id(1774878219827936547)
,p_css_classes=>'t-MediaList--horizontal'
,p_group_id=>wwv_flow_api.id(804530712278800176)
,p_template_types=>'LIST'
,p_help_text=>'Show all list items in one horizontal row.'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774880713082936562)
,p_theme_id=>42
,p_name=>'ADD_ACTIONS'
,p_display_name=>'Add Actions'
,p_display_sequence=>1
,p_list_template_id=>wwv_flow_api.id(1774880492604936559)
,p_css_classes=>'js-addActions'
,p_template_types=>'LIST'
,p_help_text=>'Use this option to add shortcuts for menu items. Note that actions.js must be included on your page to support this functionality.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774880815338936562)
,p_theme_id=>42
,p_name=>'BEHAVE_LIKE_TABS'
,p_display_name=>'Behave Like Tabs'
,p_display_sequence=>1
,p_list_template_id=>wwv_flow_api.id(1774880492604936559)
,p_css_classes=>'js-tabLike'
,p_template_types=>'LIST'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774881057711936562)
,p_theme_id=>42
,p_name=>'SHOW_SUB_MENU_ICONS'
,p_display_name=>'Show Sub Menu Icons'
,p_display_sequence=>1
,p_list_template_id=>wwv_flow_api.id(1774880492604936559)
,p_css_classes=>'js-showSubMenuIcons'
,p_template_types=>'LIST'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774881523989936564)
,p_theme_id=>42
,p_name=>'ALLSTEPS'
,p_display_name=>'All Steps'
,p_display_sequence=>10
,p_list_template_id=>wwv_flow_api.id(1774881131647936562)
,p_css_classes=>'t-WizardSteps--displayLabels'
,p_group_id=>wwv_flow_api.id(804530367089800174)
,p_template_types=>'LIST'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774881618504936564)
,p_theme_id=>42
,p_name=>'CURRENTSTEPONLY'
,p_display_name=>'Current Step Only'
,p_display_sequence=>20
,p_list_template_id=>wwv_flow_api.id(1774881131647936562)
,p_css_classes=>'t-WizardSteps--displayCurrentLabelOnly'
,p_group_id=>wwv_flow_api.id(804530367089800174)
,p_template_types=>'LIST'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774881733232936564)
,p_theme_id=>42
,p_name=>'HIDELABELS'
,p_display_name=>'Hide Labels'
,p_display_sequence=>30
,p_list_template_id=>wwv_flow_api.id(1774881131647936562)
,p_css_classes=>'t-WizardSteps--hideLabels'
,p_group_id=>wwv_flow_api.id(804530367089800174)
,p_template_types=>'LIST'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774882987468936581)
,p_theme_id=>42
,p_name=>'LEFTICON'
,p_display_name=>'Left'
,p_display_sequence=>10
,p_button_template_id=>wwv_flow_api.id(1774882711901936578)
,p_css_classes=>'t-Button--iconLeft'
,p_group_id=>wwv_flow_api.id(804518793683800166)
,p_template_types=>'BUTTON'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1774883135513936581)
,p_theme_id=>42
,p_name=>'RIGHTICON'
,p_display_name=>'Right'
,p_display_sequence=>20
,p_button_template_id=>wwv_flow_api.id(1774882711901936578)
,p_css_classes=>'t-Button--iconRight'
,p_group_id=>wwv_flow_api.id(804518793683800166)
,p_template_types=>'BUTTON'
,p_is_advanced=>'N'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1826081426258937719)
,p_theme_id=>42
,p_name=>'COMPACT'
,p_display_name=>'Compact'
,p_display_sequence=>20
,p_list_template_id=>wwv_flow_api.id(1774874589747936542)
,p_css_classes=>'t-Cards--compact'
,p_group_id=>wwv_flow_api.id(804531903410800177)
,p_template_types=>'LIST'
,p_help_text=>'Use this option when you want to show smaller cards.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1826082165602937721)
,p_theme_id=>42
,p_name=>'HIDDEN_BODY_TEXT'
,p_display_name=>'Hidden'
,p_display_sequence=>50
,p_list_template_id=>wwv_flow_api.id(1774874589747936542)
,p_css_classes=>'t-Cards--hideBody'
,p_group_id=>wwv_flow_api.id(804527102441800170)
,p_template_types=>'LIST'
,p_help_text=>'This option hides the card body which contains description and subtext.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1826346904859939655)
,p_theme_id=>42
,p_name=>'COMPACT'
,p_display_name=>'Compact'
,p_display_sequence=>20
,p_report_template_id=>wwv_flow_api.id(1774866287250936513)
,p_css_classes=>'t-Cards--compact'
,p_group_id=>wwv_flow_api.id(804558397080800192)
,p_template_types=>'REPORT'
,p_help_text=>'Use this option when you want to show smaller cards.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1826347578105939657)
,p_theme_id=>42
,p_name=>'HIDDEN_BODY_TEXT'
,p_display_name=>'Hidden'
,p_display_sequence=>50
,p_report_template_id=>wwv_flow_api.id(1774866287250936513)
,p_css_classes=>'t-Cards--hideBody'
,p_group_id=>wwv_flow_api.id(804550344016800187)
,p_template_types=>'REPORT'
,p_help_text=>'This option hides the card body which contains description and subtext.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1859248872721135262)
,p_theme_id=>42
,p_name=>'HIDE_ICONS'
,p_display_name=>'Hide Icons'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1774847460117936466)
,p_css_classes=>'t-Alert--noIcon'
,p_group_id=>wwv_flow_api.id(804534799743800178)
,p_template_types=>'REGION'
,p_help_text=>'Hides alert icons'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1859249516083135262)
,p_theme_id=>42
,p_name=>'SHOW_CUSTOM_ICONS'
,p_display_name=>'Show Custom Icons'
,p_display_sequence=>30
,p_region_template_id=>wwv_flow_api.id(1774847460117936466)
,p_css_classes=>'t-Alert--customIcons'
,p_group_id=>wwv_flow_api.id(804534799743800178)
,p_template_types=>'REGION'
,p_help_text=>'Set custom icons by modifying the Alert Region''s Icon CSS Classes property.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1859300302442135401)
,p_theme_id=>42
,p_name=>'REMEMBER_ACTIVE_TAB'
,p_display_name=>'Remember Active Tab'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1859298875934135398)
,p_css_classes=>'js-useLocalStorage'
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1859324784916135463)
,p_theme_id=>42
,p_name=>'BEHAVE_LIKE_TABS'
,p_display_name=>'Behave Like Tabs'
,p_display_sequence=>10
,p_list_template_id=>wwv_flow_api.id(1774879954637936553)
,p_css_classes=>'js-tabLike'
,p_template_types=>'LIST'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1859325163228135463)
,p_theme_id=>42
,p_name=>'ADD_ACTIONS'
,p_display_name=>'Add Actions'
,p_display_sequence=>40
,p_list_template_id=>wwv_flow_api.id(1774879954637936553)
,p_css_classes=>'js-addActions'
,p_template_types=>'LIST'
,p_help_text=>'Use this option to add shortcuts for menu items. Note that actions.js must be included on your page to support this functionality.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1859325465291135464)
,p_theme_id=>42
,p_name=>'SHOW_SUB_MENU_ICONS'
,p_display_name=>'Show Sub Menu Icons'
,p_display_sequence=>30
,p_list_template_id=>wwv_flow_api.id(1774879954637936553)
,p_css_classes=>'js-showSubMenuIcons'
,p_template_types=>'LIST'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1859330421251135501)
,p_theme_id=>42
,p_name=>'ABOVE_LABEL'
,p_display_name=>'Above Label'
,p_display_sequence=>20
,p_list_template_id=>wwv_flow_api.id(1859329970668135499)
,p_css_classes=>'t-Tabs--iconsAbove'
,p_group_id=>wwv_flow_api.id(804529109054800172)
,p_template_types=>'LIST'
,p_help_text=>'Places icons above tab label.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1859330704083135501)
,p_theme_id=>42
,p_name=>'FILL_LABELS'
,p_display_name=>'Fill Labels'
,p_display_sequence=>1
,p_list_template_id=>wwv_flow_api.id(1859329970668135499)
,p_css_classes=>'t-Tabs--fillLabels'
,p_group_id=>wwv_flow_api.id(804530712278800176)
,p_template_types=>'LIST'
,p_help_text=>'Stretch tabs to fill to the width of the tabs container.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1859330978540135501)
,p_theme_id=>42
,p_name=>'INLINE_WITH_LABEL'
,p_display_name=>'Inline with Label'
,p_display_sequence=>10
,p_list_template_id=>wwv_flow_api.id(1859329970668135499)
,p_css_classes=>'t-Tabs--inlineIcons'
,p_group_id=>wwv_flow_api.id(804529109054800172)
,p_template_types=>'LIST'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1859331308761135502)
,p_theme_id=>42
,p_name=>'LARGE'
,p_display_name=>'Large'
,p_display_sequence=>10
,p_list_template_id=>wwv_flow_api.id(1859329970668135499)
,p_css_classes=>'t-Tabs--large'
,p_group_id=>wwv_flow_api.id(804531568180800177)
,p_template_types=>'LIST'
,p_help_text=>'Increases font size and white space around tab items.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1859331605803135502)
,p_theme_id=>42
,p_name=>'PILL'
,p_display_name=>'Pill'
,p_display_sequence=>20
,p_list_template_id=>wwv_flow_api.id(1859329970668135499)
,p_css_classes=>'t-Tabs--pill'
,p_group_id=>wwv_flow_api.id(804531903410800177)
,p_template_types=>'LIST'
,p_help_text=>'Displays tabs in a pill container.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1859331901622135502)
,p_theme_id=>42
,p_name=>'SIMPLE'
,p_display_name=>'Simple'
,p_display_sequence=>10
,p_list_template_id=>wwv_flow_api.id(1859329970668135499)
,p_css_classes=>'t-Tabs--simple'
,p_group_id=>wwv_flow_api.id(804531903410800177)
,p_template_types=>'LIST'
,p_help_text=>'A very simplistic tab UI.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1859332208232135502)
,p_theme_id=>42
,p_name=>'SMALL'
,p_display_name=>'Small'
,p_display_sequence=>5
,p_list_template_id=>wwv_flow_api.id(1859329970668135499)
,p_css_classes=>'t-Tabs--small'
,p_group_id=>wwv_flow_api.id(804531568180800177)
,p_template_types=>'LIST'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1859359301922135588)
,p_theme_id=>42
,p_name=>'RIGHT_ALIGNED_DETAILS'
,p_display_name=>'Right Aligned Details'
,p_display_sequence=>20
,p_report_template_id=>wwv_flow_api.id(1774872379547936533)
,p_css_classes=>'t-AVPList--rightAligned'
,p_group_id=>wwv_flow_api.id(804556336641800190)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1859359942123135589)
,p_theme_id=>42
,p_name=>'VARIABLE_SMALL'
,p_display_name=>'Variable - Small'
,p_display_sequence=>40
,p_report_template_id=>wwv_flow_api.id(1774872379547936533)
,p_css_classes=>'t-AVPList--variableLabelSmall'
,p_group_id=>wwv_flow_api.id(804555933986800190)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1859360510067135589)
,p_theme_id=>42
,p_name=>'FIXED_MEDIUM'
,p_display_name=>'Fixed - Medium'
,p_display_sequence=>20
,p_report_template_id=>wwv_flow_api.id(1774872379547936533)
,p_css_classes=>'t-AVPList--fixedLabelMedium'
,p_group_id=>wwv_flow_api.id(804555933986800190)
,p_template_types=>'REPORT'
);
end;
/
begin
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1859361158983135590)
,p_theme_id=>42
,p_name=>'LEFT_ALIGNED_DETAILS'
,p_display_name=>'Left Aligned Details'
,p_display_sequence=>10
,p_report_template_id=>wwv_flow_api.id(1774872379547936533)
,p_css_classes=>'t-AVPList--leftAligned'
,p_group_id=>wwv_flow_api.id(804556336641800190)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1859361757346135590)
,p_theme_id=>42
,p_name=>'VARIABLE_LARGE'
,p_display_name=>'Variable - Large'
,p_display_sequence=>60
,p_report_template_id=>wwv_flow_api.id(1774872379547936533)
,p_css_classes=>'t-AVPList--variableLabelLarge'
,p_group_id=>wwv_flow_api.id(804555933986800190)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1859362309504135590)
,p_theme_id=>42
,p_name=>'FIXED_SMALL'
,p_display_name=>'Fixed - Small'
,p_display_sequence=>10
,p_report_template_id=>wwv_flow_api.id(1774872379547936533)
,p_css_classes=>'t-AVPList--fixedLabelSmall'
,p_group_id=>wwv_flow_api.id(804555933986800190)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1859362968891135591)
,p_theme_id=>42
,p_name=>'FIXED_LARGE'
,p_display_name=>'Fixed - Large'
,p_display_sequence=>30
,p_report_template_id=>wwv_flow_api.id(1774872379547936533)
,p_css_classes=>'t-AVPList--fixedLabelLarge'
,p_group_id=>wwv_flow_api.id(804555933986800190)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1859363537168135591)
,p_theme_id=>42
,p_name=>'VARIABLE_MEDIUM'
,p_display_name=>'Variable - Medium'
,p_display_sequence=>50
,p_report_template_id=>wwv_flow_api.id(1774872379547936533)
,p_css_classes=>'t-AVPList--variableLabelMedium'
,p_group_id=>wwv_flow_api.id(804555933986800190)
,p_template_types=>'REPORT'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1930731842910605311)
,p_theme_id=>42
,p_name=>'TABSLARGE'
,p_display_name=>'Large'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(1859298875934135398)
,p_css_classes=>'t-TabsRegion-mod--large'
,p_group_id=>wwv_flow_api.id(804547991315800185)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1930732370056605311)
,p_theme_id=>42
,p_name=>'TABS_SMALL'
,p_display_name=>'Small'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1859298875934135398)
,p_css_classes=>'t-TabsRegion-mod--small'
,p_group_id=>wwv_flow_api.id(804547991315800185)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1930732980500605311)
,p_theme_id=>42
,p_name=>'FILL_TAB_LABELS'
,p_display_name=>'Fill Tab Labels'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1859298875934135398)
,p_css_classes=>'t-TabsRegion-mod--fillLabels'
,p_group_id=>wwv_flow_api.id(804544768159800184)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1930733649732605311)
,p_theme_id=>42
,p_name=>'PILL'
,p_display_name=>'Pill'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(1859298875934135398)
,p_css_classes=>'t-TabsRegion-mod--pill'
,p_group_id=>wwv_flow_api.id(804548300996800186)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1930734240860605312)
,p_theme_id=>42
,p_name=>'SIMPLE'
,p_display_name=>'Simple'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1859298875934135398)
,p_css_classes=>'t-TabsRegion-mod--simple'
,p_group_id=>wwv_flow_api.id(804548300996800186)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1951930984245088669)
,p_theme_id=>42
,p_name=>'SHOW_ICONS'
,p_display_name=>'Show Icons'
,p_display_sequence=>10
,p_list_template_id=>wwv_flow_api.id(1774878219827936547)
,p_css_classes=>'t-MediaList--showIcons'
,p_template_types=>'LIST'
,p_help_text=>'Display an icon next to the list item.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1951931325528088669)
,p_theme_id=>42
,p_name=>'SHOW_DESCRIPTION'
,p_display_name=>'Show Description'
,p_display_sequence=>20
,p_list_template_id=>wwv_flow_api.id(1774878219827936547)
,p_css_classes=>'t-MediaList--showDesc'
,p_template_types=>'LIST'
,p_help_text=>'Shows the description (Attribute 1) for each list item.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(1951931638648088669)
,p_theme_id=>42
,p_name=>'SHOW_BADGES'
,p_display_name=>'Show Badges'
,p_display_sequence=>30
,p_list_template_id=>wwv_flow_api.id(1774878219827936547)
,p_css_classes=>'t-MediaList--showBadges'
,p_template_types=>'LIST'
,p_help_text=>'Show a badge (Attribute 2) to the right of the list item.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(2199348403495041953)
,p_theme_id=>42
,p_name=>'LIGHT_BACKGROUND'
,p_display_name=>'Light Background'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(1124325436919460426)
,p_css_classes=>'t-ContentBlock--lightBG'
,p_group_id=>wwv_flow_api.id(804537599226800180)
,p_template_types=>'REGION'
,p_help_text=>'Gives the region body a slightly lighter background.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(2199348769790041953)
,p_theme_id=>42
,p_name=>'ADD_BODY_PADDING'
,p_display_name=>'Add Body Padding'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1124325436919460426)
,p_css_classes=>'t-ContentBlock--padded'
,p_template_types=>'REGION'
,p_help_text=>'Adds padding to the region''s body container.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(2199349528377041954)
,p_theme_id=>42
,p_name=>'SHADOW_BACKGROUND'
,p_display_name=>'Shadow Background'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1124325436919460426)
,p_css_classes=>'t-ContentBlock--shadowBG'
,p_group_id=>wwv_flow_api.id(804537599226800180)
,p_template_types=>'REGION'
,p_help_text=>'Gives the region body a slightly darker background.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(2276372623271638024)
,p_theme_id=>42
,p_name=>'SHOW_MAXIMIZE_BUTTON'
,p_display_name=>'Show Maximize Button'
,p_display_sequence=>40
,p_region_template_id=>wwv_flow_api.id(1774851103376936475)
,p_css_classes=>'js-showMaximizeButton'
,p_template_types=>'REGION'
,p_help_text=>'Displays a button in the Region Header to maximize the region. Clicking this button will toggle the maximize state and stretch the region to fill the screen.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(2276396711728638115)
,p_theme_id=>42
,p_name=>'SHOW_MAXIMIZE_BUTTON'
,p_display_name=>'Show Maximize Button'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(1774858309021936486)
,p_css_classes=>'js-showMaximizeButton'
,p_template_types=>'REGION'
,p_help_text=>'Displays a button in the Interactive Reports toolbar to maximize the report. Clicking this button will toggle the maximize state and stretch the report to fill the screen.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(2276400862914638168)
,p_theme_id=>42
,p_name=>'SHOW_MAXIMIZE_BUTTON'
,p_display_name=>'Show Maximize Button'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(1774859855390936493)
,p_css_classes=>'js-showMaximizeButton'
,p_template_types=>'REGION'
,p_help_text=>'Displays a button in the Region Header to maximize the region. Clicking this button will toggle the maximize state and stretch the region to fill the screen.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(2302932332123288459)
,p_theme_id=>42
,p_name=>'VERTICAL_LIST'
,p_display_name=>'Vertical Orientation'
,p_display_sequence=>10
,p_list_template_id=>wwv_flow_api.id(1774881131647936562)
,p_css_classes=>'t-WizardSteps--vertical'
,p_template_types=>'LIST'
,p_help_text=>'Displays the wizard progress list in a vertical orientation and is suitable for displaying within a side column of a page.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(2385177698375179088)
,p_theme_id=>42
,p_name=>'SHOW_TITLE'
,p_display_name=>'Show Title'
,p_display_sequence=>10
,p_region_template_id=>wwv_flow_api.id(1774863107879936502)
,p_css_classes=>'t-Wizard--showTitle'
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(2401289203254307736)
,p_theme_id=>42
,p_name=>'10_SECONDS'
,p_display_name=>'10 Seconds'
,p_display_sequence=>20
,p_region_template_id=>wwv_flow_api.id(1774851103376936475)
,p_css_classes=>'js-cycle10s'
,p_group_id=>wwv_flow_api.id(804548745380800186)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(2401289849010307738)
,p_theme_id=>42
,p_name=>'15_SECONDS'
,p_display_name=>'15 Seconds'
,p_display_sequence=>30
,p_region_template_id=>wwv_flow_api.id(1774851103376936475)
,p_css_classes=>'js-cycle15s'
,p_group_id=>wwv_flow_api.id(804548745380800186)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(2401290371376307739)
,p_theme_id=>42
,p_name=>'20_SECONDS'
,p_display_name=>'20 Seconds'
,p_display_sequence=>40
,p_region_template_id=>wwv_flow_api.id(1774851103376936475)
,p_css_classes=>'js-cycle20s'
,p_group_id=>wwv_flow_api.id(804548745380800186)
,p_template_types=>'REGION'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(2401304661982307764)
,p_theme_id=>42
,p_name=>'480PX'
,p_display_name=>'480px'
,p_display_sequence=>30
,p_region_template_id=>wwv_flow_api.id(1774855849259936482)
,p_css_classes=>'i-h480'
,p_group_id=>wwv_flow_api.id(804536344202800179)
,p_template_types=>'REGION'
,p_help_text=>'Sets body height to 480px.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(2401305209501307764)
,p_theme_id=>42
,p_name=>'640PX'
,p_display_name=>'640px'
,p_display_sequence=>40
,p_region_template_id=>wwv_flow_api.id(1774855849259936482)
,p_css_classes=>'i-h640'
,p_group_id=>wwv_flow_api.id(804536344202800179)
,p_template_types=>'REGION'
,p_help_text=>'Sets body height to 640px.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(2473704809227237425)
,p_theme_id=>42
,p_name=>'REMOVE_UI_DECORATION'
,p_display_name=>'Remove UI Decoration'
,p_display_sequence=>30
,p_region_template_id=>wwv_flow_api.id(1774855849259936482)
,p_css_classes=>'t-Region--noUI'
,p_group_id=>wwv_flow_api.id(804547523949800185)
,p_template_types=>'REGION'
,p_help_text=>'Removes UI decoration (borders, backgrounds, shadows, etc) from the region.'
);
wwv_flow_api.create_template_option(
p_id=>wwv_flow_api.id(2473853760227327784)
,p_theme_id=>42
,p_name=>'REMOVE_UI_DECORATION'
,p_display_name=>'Remove UI Decoration'
,p_display_sequence=>30
,p_region_template_id=>wwv_flow_api.id(1774859855390936493)
,p_css_classes=>'t-Region--noUI'
,p_group_id=>wwv_flow_api.id(804547523949800185)
,p_template_types=>'REGION'
,p_help_text=>'Removes UI decoration (borders, backgrounds, shadows, etc) from the region.'
);
end;
/
prompt --application/shared_components/globalization/language
begin
null;
end;
/
prompt --application/shared_components/globalization/translations
begin
null;
end;
/
prompt --application/shared_components/logic/build_options
begin
null;
end;
/
prompt --application/shared_components/globalization/messages
begin
null;
end;
/
prompt --application/shared_components/globalization/dyntranslations
begin
null;
end;
/
prompt --application/shared_components/security/authentications/collections_built_in_auth
begin
wwv_flow_api.create_authentication(
p_id=>wwv_flow_api.id(8706951165162370193)
,p_name=>'Collections Built-In Auth'
,p_scheme_type=>'NATIVE_APEX_ACCOUNTS'
,p_invalid_session_type=>'URL'
,p_invalid_session_url=>'f?p=&APP_ID.:101:&SESSION.'
,p_logout_url=>'f?p=&APP_ID.:101'
,p_cookie_name=>'ORA_WWV_PACKAGED_APPLICATIONS'
,p_use_secure_cookie_yn=>'N'
,p_ras_mode=>0
);
end;
/
prompt --application/shared_components/plugins/region_type/com_oracle_apex_display_source
begin
wwv_flow_api.create_plugin(
p_id=>wwv_flow_api.id(1320260871786399754)
,p_plugin_type=>'REGION TYPE'
,p_name=>'COM.ORACLE.APEX.DISPLAY_SOURCE'
,p_display_name=>'Source Display'
,p_supported_ui_types=>'DESKTOP'
,p_image_prefix => nvl(wwv_flow_application_install.get_static_plugin_file_prefix('REGION TYPE','COM.ORACLE.APEX.DISPLAY_SOURCE'),'')
,p_plsql_code=>wwv_flow_string.join(wwv_flow_t_varchar2(
'function render (',
' p_region in apex_plugin.t_region,',
' p_plugin in apex_plugin.t_plugin,',
' p_is_printer_friendly in boolean )',
' return apex_plugin.t_region_render_result',
'is',
' -- It''s better to have named variables instead of using the generic ones,',
' -- makes the code more readable. We are using the same defaults for the',
' -- required attributes as in the plug-in attribute configuration, because',
' -- they can still be null. Keep them in sync!',
' c_region_static_id constant varchar2(255) := p_region.attribute_01;',
' c_highlight_page_item constant varchar2(255) := p_region.attribute_02;',
'',
' l_highlight_term varchar2(4000) := '''';',
'',
' cursor sql_csr( d_region_static_id in varchar2 ) is',
' select source_type, 10 seq, null series_name, region_source source',
' from apex_application_page_regions',
' where application_id = :APP_ID',
' and page_id = :APP_PAGE_ID',
' and static_id = d_region_static_id',
' and ( source_type_code like ''PLUGIN%''',
' or source_type_code like ''STATIC_TEXT%''',
' or source_type in (',
' ''Calendar'',',
' ''Easy Calendar'',',
' ''Interactive Report'',',
' ''Interactive Grid'',',
' ''List View'',',
' ''Report'',',
' ''PL/SQL'',',
' ''Tabular Form''',
' )',
' )',
' union all',
' select reg.source_type, 10 seq, null series_name, to_clob(tr.tree_query) source',
' from apex_application_page_regions reg,',
' apex_application_page_trees tr',
' where reg.application_id = :APP_ID',
' and reg.page_id = :APP_PAGE_ID',
' and reg.static_id = d_region_static_id',
' and tr.application_id = reg.application_id',
' and tr.page_id = reg.page_id',
' and tr.region_id = reg.region_id',
' and reg.source_type in (''JavaScript Tree'')',
' union all',
' select reg.source_type, 10 seq, null series_name, to_clob(list_query) source',
' from apex_application_page_regions reg,',
' apex_application_lists li',
' where reg.application_id = :APP_ID',
' and reg.page_id = :APP_PAGE_ID',
' and reg.static_id = d_region_static_id',
' and li.application_id = reg.application_id',
' and li.list_id = reg.list_id',
' and reg.source_type in ( ''List'' )',
' order by 1, 2;',
' sql_rec sql_csr%ROWTYPE;',
'begin',
' if c_highlight_page_item is not null then',
' l_highlight_term := apex_escape.html(trim(lower(v(c_highlight_page_item))));',
' end if;',
'',
' for sql_rec in sql_csr( c_region_static_id ) loop',
' if sql_rec.series_name is not null then',
' sys.htp.p(''<p><strong>''||apex_escape.html(sql_rec.series_name)||'':</strong></p>'');',
' end if;',
' sys.htp.p(''<pre>'');',
' if l_highlight_term is not null then',
' sys.htp.p(replace(apex_escape.html(sql_rec.source),',
' l_highlight_term,''<span class="highlight">''||l_highlight_term||''</span>''));',
' else',
' sys.htp.p(apex_escape.html(sql_rec.source));',
' end if;',
' sys.htp.p(''</pre>'');',
' end loop;',
'',
' return null;',
'end render;'))
,p_api_version=>1
,p_render_function=>'render'
,p_substitute_attributes=>true
,p_reference_id=>1305119942933551255
,p_subscribe_plugin_settings=>true
,p_help_text=>'This region plug-in is used to display the SQL Source region of an accompanying region.'
,p_version_identifier=>'5.0.1'
);
wwv_flow_api.create_plugin_attribute(
p_id=>wwv_flow_api.id(608876005661319229)
,p_plugin_id=>wwv_flow_api.id(1320260871786399754)
,p_attribute_scope=>'COMPONENT'
,p_attribute_sequence=>1
,p_display_sequence=>10
,p_prompt=>'Region Static ID'
,p_attribute_type=>'TEXT'
,p_is_required=>true
,p_is_translatable=>false
,p_help_text=>'Enter the static ID as defined in the target region''s attributes section.'
);
wwv_flow_api.create_plugin_attribute(
p_id=>wwv_flow_api.id(608876419845319229)
,p_plugin_id=>wwv_flow_api.id(1320260871786399754)
,p_attribute_scope=>'COMPONENT'
,p_attribute_sequence=>2
,p_display_sequence=>20
,p_prompt=>'Highlight Term Page Item'
,p_attribute_type=>'PAGE ITEM'
,p_is_required=>false
,p_is_translatable=>false
,p_help_text=>'If you wish to have a term in your region source highlighted, create a page item and select it here.'
);
end;
/
prompt --application/shared_components/plugins/region_type/com_oracle_apex_sampleappfooter
begin
wwv_flow_api.create_plugin(
p_id=>wwv_flow_api.id(1661294630311246490)
,p_plugin_type=>'REGION TYPE'
,p_name=>'COM.ORACLE.APEX.SAMPLEAPPFOOTER'
,p_display_name=>'Sample Apps Footer'
,p_supported_ui_types=>'DESKTOP'
,p_image_prefix => nvl(wwv_flow_application_install.get_static_plugin_file_prefix('REGION TYPE','COM.ORACLE.APEX.SAMPLEAPPFOOTER'),'')
,p_plsql_code=>wwv_flow_string.join(wwv_flow_t_varchar2(
'function render ( p_region in apex_plugin.t_region,',
' p_plugin in apex_plugin.t_plugin,',
' p_is_printer_friendly in boolean )',
' return apex_plugin.t_region_render_result is',
'begin',
' sys.htp.p(''<ul class="t-Cards t-Cards--sampleAppsFooter t-Cards--featured force-fa-lg t-Cards--displayIcons t-Cards--hideBody t-Cards--animColorFill">'');',
' sys.htp.p(''<li class="t-Cards-item">'');',
' sys.htp.p('' <div class="t-Card">'');',
' sys.htp.p('' <a href="https://apex.oracle.com/twitter" target="_blank" class="t-Card-wrap">'');',
' sys.htp.p('' <div class="t-Card-icon"><span class="t-Icon fa fa-twitter" style="color: #1da1f2"></span></div>'');',
' sys.htp.p('' <div class="t-Card-titleWrap"><h3 class="t-Card-title">Twitter</h3></div>'');',
' sys.htp.p('' </a>'');',
' sys.htp.p('' </div>'');',
' sys.htp.p(''</li>'');',
' sys.htp.p(''<li class="t-Cards-item">'');',
' sys.htp.p('' <div class="t-Card">'');',
' sys.htp.p('' <a href="https://apex.oracle.com/linkedin" target="_blank" class="t-Card-wrap">'');',
' sys.htp.p('' <div class="t-Card-icon"><span class="t-Icon fa fa-linkedin" style="color: #0077b5"></span></div>'');',
' sys.htp.p('' <div class="t-Card-titleWrap"><h3 class="t-Card-title">LinkedIn</h3></div>'');',
' sys.htp.p('' </a>'');',
' sys.htp.p('' </div>'');',
' sys.htp.p(''</li>'');',
' sys.htp.p(''<li class="t-Cards-item">'');',
' sys.htp.p('' <div class="t-Card">'');',
' sys.htp.p('' <a href="https://apex.oracle.com/facebook" target="_blank" class="t-Card-wrap">'');',
' sys.htp.p('' <div class="t-Card-icon"><span class="t-Icon fa fa-facebook" style="color: #3b5998"></span></div>'');',
' sys.htp.p('' <div class="t-Card-titleWrap"><h3 class="t-Card-title">Facebook</h3></div>'');',
' sys.htp.p('' </a>'');',
' sys.htp.p('' </div>'');',
' sys.htp.p(''</li>'');',
' sys.htp.p(''<li class="t-Cards-item">'');',
' sys.htp.p('' <div class="t-Card">'');',
' sys.htp.p('' <a href="https://apex.oracle.com/youtube" target="_blank" class="t-Card-wrap">'');',
' sys.htp.p('' <div class="t-Card-icon"><span class="t-Icon fa fa-youtube" style="color: red"></span></div>'');',
' sys.htp.p('' <div class="t-Card-titleWrap"><h3 class="t-Card-title">YouTube</h3></div>'');',
' sys.htp.p('' </a>'');',
' sys.htp.p('' </div>'');',
' sys.htp.p(''</li>'');',
' sys.htp.p(''<li class="t-Cards-item">'');',
' sys.htp.p('' <div class="t-Card">'');',
' sys.htp.p('' <a href="https://apex.oracle.com/" target="_blank" class="t-Card-wrap">'');',
' sys.htp.p('' <div class="t-Card-icon"><span class="t-Icon fa fa-apex" style="color: #707070"></span></div>'');',
' sys.htp.p('' <div class="t-Card-titleWrap"><h3 class="t-Card-title">apex.oracle.com</h3></div>'');',
' sys.htp.p('' </a>'');',
' sys.htp.p('' </div>'');',
' sys.htp.p(''</li>'');',
' sys.htp.p(''<li class="t-Cards-item">'');',
' sys.htp.p('' <div class="t-Card">'');',
' sys.htp.p('' <a href="https://apex.oracle.com/community" target="_blank" class="t-Card-wrap">'');',
' sys.htp.p('' <div class="t-Card-icon"><span class="t-Icon fa fa-users" style="color: #707070"></span></div>'');',
' sys.htp.p('' <div class="t-Card-titleWrap"><h3 class="t-Card-title">Oracle APEX Community</h3></div>'');',
' sys.htp.p('' </a>'');',
' sys.htp.p('' </div>'');',
' sys.htp.p(''</li>'');',
' sys.htp.p(''<li class="t-Cards-item">'');',
' sys.htp.p('' <div class="t-Card">'');',
' sys.htp.p('' <a href="https://community.oracle.com/tech/developers/categories/1application_express" target="_blank" class="t-Card-wrap">'');',
' sys.htp.p('' <div class="t-Card-icon"><span class="t-Icon fa fa-comments-o" style="color: #707070"></span></div>'');',
' sys.htp.p('' <div class="t-Card-titleWrap"><h3 class="t-Card-title">Discussion Forums</h3></div>'');',
' sys.htp.p('' </a>'');',
' sys.htp.p('' </div>'');',
' sys.htp.p(''</li>'');',
' sys.htp.p(''<li class="t-Cards-item">'');',
' sys.htp.p('' <div class="t-Card">'');',
' sys.htp.p('' <a href="https://apex.oracle.com/autonomous" target="_blank" class="t-Card-wrap">'');',
' sys.htp.p('' <div class="t-Card-icon"><span class="t-Icon fa fa-cloud" style="color: #707070"></span></div>'');',
' sys.htp.p('' <div class="t-Card-titleWrap"><h3 class="t-Card-title">Autonomous Database + APEX</h3></div>'');',
' sys.htp.p('' </a>'');',
' sys.htp.p('' </div>'');',
' sys.htp.p(''</li>'');',
' sys.htp.p(''</ul>'');',
' return null;',
'end render;'))
,p_api_version=>1
,p_render_function=>'render'
,p_substitute_attributes=>true
,p_reference_id=>1660759070362076804
,p_subscribe_plugin_settings=>true
,p_help_text=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<p>This region plug-in is used to display a custom footer at the bottom of pages with large icons for navigating to other sites such as twitter and linkedin.</p>',
'<p>Note: This plug-in should be customized to meet your specific requirements, rather than used as is.</p>'))
,p_version_identifier=>'5.0.1'
);
end;
/
prompt --application/user_interfaces
begin
wwv_flow_api.create_user_interface(
p_id=>wwv_flow_api.id(1121389871104511367)
,p_ui_type_name=>'DESKTOP'
,p_display_name=>'DESKTOP'
,p_display_seq=>10
,p_use_auto_detect=>false
,p_is_default=>true
,p_theme_id=>42
,p_home_url=>'f?p=&APP_ID.:100:&SESSION.'
,p_login_url=>'f?p=&APP_ID.:LOGIN:&SESSION.'
,p_theme_style_by_user_pref=>false
,p_navigation_list_id=>wwv_flow_api.id(1774925232189944037)
,p_navigation_list_position=>'SIDE'
,p_navigation_list_template_id=>wwv_flow_api.id(1774880316343936557)
,p_nav_list_template_options=>'#DEFAULT#:t-TreeNav--styleA'
,p_css_file_urls=>'#IMAGE_PREFIX#pkgapp_ui/css/5.0#MIN#.css'
,p_nav_bar_type=>'LIST'
,p_nav_bar_list_id=>wwv_flow_api.id(1774964515238991205)
,p_nav_bar_list_template_id=>wwv_flow_api.id(1774880169096936555)
);
end;
/
prompt --application/user_interfaces/combined_files
begin
null;
end;
/
prompt --application/pages/page_00001
begin
wwv_flow_api.create_page(
p_id=>1
,p_user_interface_id=>wwv_flow_api.id(1121389871104511367)
,p_name=>'Basic Collections'
,p_alias=>'BASIC-COLLECTIONS'
,p_step_title=>'Basic Collections'
,p_reload_on_submit=>'A'
,p_warn_on_unsaved_changes=>'N'
,p_first_item=>'AUTO_FIRST_ITEM'
,p_autocomplete_on_off=>'ON'
,p_inline_css=>wwv_flow_string.join(wwv_flow_t_varchar2(
'section.infoRegion {',
' border: 1px solid #9AAEC8;',
' background-color: #DDE7F5;',
'}',
'section.infoRegion > div.uRegionHeading {',
' background: none transparent;',
'}',
'.infoRegionIcon {',
' position: absolute;',
' left: 0;',
' margin: 16px;',
' top: 0;',
'}',
'section.infoRegion.uRegion > div.uRegionContent {',
' position: relative;',
' min-height: 32px;',
' padding: 16px 16px 16px 64px;',
'}',
'.infoRegion h1 {',
' font-weight: bold;',
' font-size: 14px;',
' color: #202020;',
' text-shadow: 0 1px 0 rgba(255,255,255,.65);',
'}',
'.infoRegion p {',
' font-size: 12px;',
' line-height: 20px;',
' padding: 8px 0 0 0;',
' text-shadow: 0 1px 0 rgba(255,255,255,.25);',
' color: #303030;',
'}',
'.infoRegion p:last-child {',
' margin-bottom: 0 !important;',
'}',
'',
'',
'',
'div.featuredBlock{',
' -webkit-border-radius:3px;',
' -moz-border-radius:3px;',
' border-radius:3px;',
' -webkit-box-shadow:0 1px 2px rgba(0,0,0,0.05);',
' -moz-box-shadow:0 1px 2px rgba(0,0,0,0.05);',
' box-shadow:0 1px 2px rgba(0,0,0,0.05);',
' border:1px solid #E1E6EB;',
' margin-bottom:18px',
'}',
'div.featuredBlock div.featuredIcon{',
' background-image:url(''data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPb'
||'lVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIvPjxzdG9wIG9mZnNldD0iNDAlIiBzdG9wLWNvbG9yPSIjZmZmZmZmIi8+PHN0b3Agb2Zmc2V0PSI2MCUiIHN0b3AtY29sb3I9IiNmNGY0ZjgiLz48c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3A'
||'tY29sb3I9IiNmZmZmZmYiLz48L2xpbmVhckdyYWRpZW50PjwvZGVmcz48cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSJ1cmwoI2dyYWQpIiAvPjwvc3ZnPiA='');',
' background-size:100%;',
' background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(40%, #ffffff), color-stop(60%, #f4f4f8), color-stop(100%, #ffffff));',
' background-image:-webkit-linear-gradient(top, #ffffff 0%,#ffffff 40%,#f4f4f8 60%,#ffffff 100%);',
' background-image:-moz-linear-gradient(top, #ffffff 0%,#ffffff 40%,#f4f4f8 60%,#ffffff 100%);',
' background-image:linear-gradient(top, #ffffff 0%,#ffffff 40%,#f4f4f8 60%,#ffffff 100%);',
' -webkit-border-radius:3px 3px 0 0;',
' -moz-border-radius:3px 3px 0 0;',
' border-radius:3px 3px 0 0;',
' padding:8px 0;',
' min-height: 90px;',
' text-align:center;',
'}',
'div.featuredBlock div.featuredIcon img{',
' display:block;',
' margin:0 auto 0 auto;',
' -webkit-box-reflect:below -20px -webkit-gradient(linear, left top, left bottom, from(transparent), color-stop(65%, transparent), to(rgba(255,255,255,0.2)));',
'}',
'div.featuredBlock div.featuredIcon h1{',
' font-size:12px;',
' line-height:12px;',
' color:#404040;',
' margin:0 8px;',
' padding:0;',
' text-align:center;',
'}',
'a.blockLink,a.blockLink:hover{',
' text-decoration:none',
'}',
'a.blockLink:hover div.featuredBlock{',
' border:1px solid #b1bbcb',
'}',
'a.blockLink:hover div.featuredBlock div.featuredIcon{',
' background: none #e5effb;',
' -webkit-box-shadow: 0 0 10px rgba(50,117,199,0.25);',
' -moz-box-shadow: 0 0 10px rgba(50,117,199,0.25);',
' box-shadow: 0 0 10px rgba(50,117,199,0.25);',
'}',
'.regionDivider {',
' border-top: 2px solid #F0F0F0 !important;',
' padding-top: 8px;;',
'}'))
,p_step_template=>wwv_flow_api.id(1774844326834936459)
,p_page_template_options=>'#DEFAULT#'
,p_protection_level=>'C'
,p_help_text=>'No help is available for this page.'
,p_last_updated_by=>'ALLAN'
,p_last_upd_yyyymmddhh24miss=>'20210513080230'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(1224506178237833142)
,p_plug_name=>'About this page'
,p_plug_template=>wwv_flow_api.id(1774849216241936469)
,p_plug_display_sequence=>10
,p_plug_new_grid_column=>false
,p_plug_display_point=>'BODY'
,p_plug_source=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<p>This use case covers the basics of creating and editing an Oracle Application Express (APEX) collection. Collections are used to support vectors of APEX se',
'ssion-based data. APEX Collections are commonly used in place of Oracle temporary tables, but they should not be used for millions of rows per user per APEX ',
'session.</p>'))
,p_plug_query_headings_type=>'QUERY_COLUMNS'
,p_plug_query_num_rows=>15
,p_plug_query_num_rows_type=>'NEXT_PREVIOUS_LINKS'
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_plug_query_show_nulls_as=>' - '
,p_pagination_display_position=>'BOTTOM_RIGHT'
,p_attribute_01=>'N'
,p_attribute_02=>'HTML'
,p_attribute_03=>'N'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(1318675956004382463)
,p_plug_name=>'Breadcrumb'
,p_region_template_options=>'#DEFAULT#:t-BreadcrumbRegion--useBreadcrumbTitle'
,p_component_template_options=>'#DEFAULT#'
,p_plug_template=>wwv_flow_api.id(1774862430658936498)
,p_plug_display_sequence=>40
,p_plug_display_point=>'REGION_POSITION_01'
,p_menu_id=>wwv_flow_api.id(1318675881153380306)
,p_plug_source_type=>'NATIVE_BREADCRUMB'
,p_menu_template_id=>wwv_flow_api.id(1774883299498936583)
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(1413536304262655363)
,p_plug_name=>'Footer'
,p_plug_display_sequence=>40
,p_include_in_reg_disp_sel_yn=>'Y'
,p_plug_display_point=>'BODY'
,p_plug_source_type=>'PLUGIN_COM.ORACLE.APEX.SAMPLEAPPFOOTER'
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(8430640146823165001)
,p_plug_name=>'APEX_COLLECTIONS View'
,p_region_template_options=>'#DEFAULT#'
,p_plug_template=>wwv_flow_api.id(1774858309021936486)
,p_plug_display_sequence=>30
,p_plug_display_point=>'BODY'
,p_query_type=>'SQL'
,p_plug_source=>wwv_flow_string.join(wwv_flow_t_varchar2(
'select seq_id, c001, c002, c003, c004, c005, n001, n002, n003, d001, d002, d003, case when xmltype001 is null then null else substr(extract(xmltype001,''*'').getstringval(),1,40) || ''...'' end xmltype001, md5_original, collection_name, COLLECTION_NAME '
||'COLLECTION_NAME2',
' from apex_collections',
''))
,p_plug_source_type=>'NATIVE_IR'
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_plug_query_show_nulls_as=>' - '
,p_pagination_display_position=>'BOTTOM_RIGHT'
);
wwv_flow_api.create_worksheet(
p_id=>wwv_flow_api.id(8430640231394165001)
,p_name=>'APEX Collections View'
,p_max_row_count=>'10000'
,p_max_row_count_message=>'This query returns more than 10,000 rows, please filter your data to ensure complete results.'
,p_no_data_found_message=>'No data found.'
,p_allow_save_rpt_public=>'Y'
,p_allow_report_categories=>'N'
,p_show_nulls_as=>'-'
,p_pagination_type=>'ROWS_X_TO_Y'
,p_pagination_display_pos=>'BOTTOM_RIGHT'
,p_show_display_row_count=>'Y'
,p_report_list_mode=>'TABS'
,p_lazy_loading=>false
,p_show_detail_link=>'N'
,p_show_notify=>'Y'
,p_show_calendar=>'N'
,p_download_formats=>'CSV'
,p_detail_link_text=>'<img src="#IMAGE_PREFIX#app_ui/img/icons/apex-edit-pencil.png" class="apex-edit-pencil" alt="">'
,p_allow_exclude_null_values=>'N'
,p_allow_hide_extra_columns=>'N'
,p_icon_view_columns_per_row=>1
,p_owner=>'JOEL'
,p_internal_uid=>7788161179199500656
);
wwv_flow_api.create_worksheet_column(
p_id=>wwv_flow_api.id(8430640529178165002)
,p_db_column_name=>'SEQ_ID'
,p_display_order=>2
,p_column_identifier=>'B'
,p_column_label=>'Sequence'
,p_column_type=>'NUMBER'
,p_display_text_as=>'WITHOUT_MODIFICATION'
,p_heading_alignment=>'RIGHT'
,p_column_alignment=>'RIGHT'
);
wwv_flow_api.create_worksheet_column(
p_id=>wwv_flow_api.id(8430640651524165002)
,p_db_column_name=>'C001'
,p_display_order=>3
,p_column_identifier=>'C'
,p_column_label=>'Character<br />Attribute 1'
,p_column_type=>'STRING'
,p_display_text_as=>'WITHOUT_MODIFICATION'
,p_heading_alignment=>'LEFT'
);
wwv_flow_api.create_worksheet_column(
p_id=>wwv_flow_api.id(8430640745915165002)
,p_db_column_name=>'C002'
,p_display_order=>4
,p_column_identifier=>'D'
,p_column_label=>'Character<br />Attribute 2'
,p_column_type=>'STRING'
,p_display_text_as=>'WITHOUT_MODIFICATION'
,p_heading_alignment=>'LEFT'
);
wwv_flow_api.create_worksheet_column(
p_id=>wwv_flow_api.id(8430640835219165002)
,p_db_column_name=>'C003'
,p_display_order=>5
,p_column_identifier=>'E'
,p_column_label=>'Character<br />Attribute 3'
,p_column_type=>'STRING'
,p_display_text_as=>'WITHOUT_MODIFICATION'
,p_heading_alignment=>'LEFT'
);
wwv_flow_api.create_worksheet_column(
p_id=>wwv_flow_api.id(8430640920644165002)
,p_db_column_name=>'C004'
,p_display_order=>6
,p_column_identifier=>'F'
,p_column_label=>'Character<br />Attribute 4'
,p_column_type=>'STRING'
,p_display_text_as=>'WITHOUT_MODIFICATION'
,p_heading_alignment=>'LEFT'
);
wwv_flow_api.create_worksheet_column(
p_id=>wwv_flow_api.id(8430641039342165002)
,p_db_column_name=>'C005'
,p_display_order=>7
,p_column_identifier=>'G'
,p_column_label=>'Character<br />Attribute 5'
,p_column_type=>'STRING'
,p_display_text_as=>'WITHOUT_MODIFICATION'
,p_heading_alignment=>'LEFT'
);
wwv_flow_api.create_worksheet_column(
p_id=>wwv_flow_api.id(8430641137314165003)
,p_db_column_name=>'N001'
,p_display_order=>8
,p_column_identifier=>'H'
,p_column_label=>'Numeric<br />Attribute 1'
,p_column_type=>'NUMBER'
,p_display_text_as=>'WITHOUT_MODIFICATION'
,p_heading_alignment=>'RIGHT'
,p_column_alignment=>'RIGHT'
);
wwv_flow_api.create_worksheet_column(
p_id=>wwv_flow_api.id(8430641223609165003)
,p_db_column_name=>'N002'
,p_display_order=>9
,p_column_identifier=>'I'
,p_column_label=>'Numeric<br />Attribute 2'
,p_column_type=>'NUMBER'
,p_display_text_as=>'WITHOUT_MODIFICATION'
,p_heading_alignment=>'RIGHT'
,p_column_alignment=>'RIGHT'
);
wwv_flow_api.create_worksheet_column(
p_id=>wwv_flow_api.id(8430641339362165003)
,p_db_column_name=>'N003'
,p_display_order=>10
,p_column_identifier=>'J'
,p_column_label=>'Numeric<br />Attribute 3'
,p_column_type=>'NUMBER'
,p_display_text_as=>'WITHOUT_MODIFICATION'
,p_heading_alignment=>'RIGHT'
,p_column_alignment=>'RIGHT'
);
wwv_flow_api.create_worksheet_column(
p_id=>wwv_flow_api.id(8430641551962165003)
,p_db_column_name=>'MD5_ORIGINAL'
,p_display_order=>12
,p_column_identifier=>'L'
,p_column_label=>'MD5 Original'
,p_column_type=>'STRING'
,p_display_text_as=>'WITHOUT_MODIFICATION'
,p_heading_alignment=>'LEFT'
);
wwv_flow_api.create_worksheet_column(
p_id=>wwv_flow_api.id(8430641648999165003)
,p_db_column_name=>'COLLECTION_NAME'
,p_display_order=>13
,p_column_identifier=>'M'
,p_column_label=>'Action'
,p_column_link=>'f?p=&APP_ID.:4:&SESSION.::&DEBUG.:4:P4_NAME,P4_SEQ:#COLLECTION_NAME#,#SEQ_ID#'
,p_column_linktext=>'Edit'
,p_column_link_attr=>'class="t-Button t-Button--warning"'
,p_column_type=>'STRING'
,p_display_text_as=>'WITHOUT_MODIFICATION'
,p_heading_alignment=>'LEFT'
);
wwv_flow_api.create_worksheet_column(
p_id=>wwv_flow_api.id(8430642540236182440)
,p_db_column_name=>'XMLTYPE001'
,p_display_order=>14
,p_column_identifier=>'N'
,p_column_label=>'XML Type'
,p_column_type=>'STRING'
,p_heading_alignment=>'LEFT'
);
wwv_flow_api.create_worksheet_column(
p_id=>wwv_flow_api.id(8396235419854621371)
,p_db_column_name=>'D001'
,p_display_order=>15
,p_column_identifier=>'O'
,p_column_label=>'Date<br />Attribute 1'
,p_column_type=>'DATE'
,p_heading_alignment=>'LEFT'
,p_tz_dependent=>'N'
);
wwv_flow_api.create_worksheet_column(
p_id=>wwv_flow_api.id(8396235524702621373)
,p_db_column_name=>'D002'
,p_display_order=>16
,p_column_identifier=>'P'
,p_column_label=>'Date<br />Attribute 2'
,p_column_type=>'DATE'
,p_heading_alignment=>'LEFT'
,p_tz_dependent=>'N'
);
wwv_flow_api.create_worksheet_column(
p_id=>wwv_flow_api.id(8396235616630621374)
,p_db_column_name=>'D003'
,p_display_order=>17
,p_column_identifier=>'Q'
,p_column_label=>'Date<br />Attribute 3'
,p_column_type=>'DATE'
,p_heading_alignment=>'LEFT'
,p_tz_dependent=>'N'
);
wwv_flow_api.create_worksheet_column(
p_id=>wwv_flow_api.id(1224410475951955913)
,p_db_column_name=>'COLLECTION_NAME2'
,p_display_order=>18
,p_column_identifier=>'R'
,p_column_label=>'Collection Name'
,p_column_type=>'STRING'
,p_heading_alignment=>'LEFT'
,p_tz_dependent=>'N'
);
wwv_flow_api.create_worksheet_rpt(
p_id=>wwv_flow_api.id(8430641747246165509)
,p_application_user=>'APXWS_DEFAULT'
,p_report_seq=>10
,p_report_alias=>'4502667'
,p_status=>'PUBLIC'
,p_is_default=>'Y'
,p_display_rows=>5
,p_report_columns=>'COLLECTION_NAME:COLLECTION_NAME2:SEQ_ID:C001:C002:C003:C004:C005:N001:N002:N003:D001:D002:D003:XMLTYPE001:'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(8430948228479907735)
,p_plug_name=>'Tip'
,p_region_css_classes=>'infoTextRegion'
,p_region_template_options=>'#DEFAULT#'
,p_plug_template=>wwv_flow_api.id(1774849216241936469)
,p_plug_display_sequence=>20
,p_plug_display_point=>'BODY'
,p_plug_source=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<ol style="margin: 8px 24px;">',
'<li>Click the "Create Collection" button to create a new named collection',
'<li>Add members to the collection by clicking the "Modify Collection" button',
'<li>Modify the members of the collection by clicking the icon in the Action column in the report below',
'</ol>'))
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_plug_column_width=>'valign=top'
,p_attribute_01=>'N'
,p_attribute_02=>'HTML'
,p_attribute_03=>'N'
);
wwv_flow_api.create_page_button(
p_id=>wwv_flow_api.id(8866711617073954630)
,p_button_sequence=>20
,p_button_plug_id=>wwv_flow_api.id(1318675956004382463)
,p_button_name=>'Create_Collection'
,p_button_action=>'REDIRECT_PAGE'
,p_button_template_options=>'#DEFAULT#'
,p_button_template_id=>wwv_flow_api.id(1774883187200936581)
,p_button_is_hot=>'Y'
,p_button_image_alt=>'Create Collection'
,p_button_position=>'REGION_TEMPLATE_CREATE'
,p_button_redirect_url=>'f?p=&APP_ID.:2:&SESSION.::&DEBUG.:RP,2::'
);
wwv_flow_api.create_page_button(
p_id=>wwv_flow_api.id(8866762509511056586)
,p_button_sequence=>10
,p_button_plug_id=>wwv_flow_api.id(1318675956004382463)
,p_button_name=>'Modify_Collection'
,p_button_action=>'REDIRECT_PAGE'
,p_button_template_options=>'#DEFAULT#'
,p_button_template_id=>wwv_flow_api.id(1774883187200936581)
,p_button_image_alt=>'Modify Collection'
,p_button_position=>'REGION_TEMPLATE_EDIT'
,p_button_redirect_url=>'f?p=&APP_ID.:3:&SESSION.::&DEBUG.:RP::'
);
wwv_flow_api.create_page_button(
p_id=>wwv_flow_api.id(2452034501844077451)
,p_button_sequence=>10
,p_button_plug_id=>wwv_flow_api.id(8430640146823165001)
,p_button_name=>'RESET'
,p_button_action=>'REDIRECT_PAGE'
,p_button_template_options=>'#DEFAULT#'
,p_button_template_id=>wwv_flow_api.id(1774882633017936576)
,p_button_image_alt=>'Reset'
,p_button_position=>'RIGHT_OF_IR_SEARCH_BAR'
,p_button_redirect_url=>'f?p=&APP_ID.:&APP_PAGE_ID.:&SESSION.::&DEBUG.:RP,&APP_PAGE_ID.,RIR::'
,p_icon_css_classes=>'fa-undo-alt'
);
end;
/
prompt --application/pages/page_00002
begin
wwv_flow_api.create_page(
p_id=>2
,p_user_interface_id=>wwv_flow_api.id(1121389871104511367)
,p_name=>'Create Collection'
,p_alias=>'CREATE-COLLECTION'
,p_page_mode=>'MODAL'
,p_step_title=>'Create Collection'
,p_reload_on_submit=>'A'
,p_warn_on_unsaved_changes=>'N'
,p_first_item=>'AUTO_FIRST_ITEM'
,p_autocomplete_on_off=>'OFF'
,p_step_template=>wwv_flow_api.id(1774846340824936463)
,p_page_template_options=>'#DEFAULT#'
,p_protection_level=>'C'
,p_help_text=>'No help is available for this page.'
,p_last_updated_by=>'ALLAN'
,p_last_upd_yyyymmddhh24miss=>'20210513080510'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(1713164201739995053)
,p_plug_name=>'Buttons'
,p_region_template_options=>'#DEFAULT#:t-ButtonRegion--noUI'
,p_plug_template=>wwv_flow_api.id(1774849395965936471)
,p_plug_display_sequence=>20
,p_include_in_reg_disp_sel_yn=>'Y'
,p_plug_display_point=>'REGION_POSITION_03'
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_attribute_01=>'N'
,p_attribute_02=>'HTML'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(8866716089470964392)
,p_plug_name=>'Collection'
,p_region_template_options=>'#DEFAULT#'
,p_plug_template=>wwv_flow_api.id(1774849216241936469)
,p_plug_display_sequence=>10
,p_plug_display_point=>'BODY'
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_plug_column_width=>'valign=top'
,p_attribute_01=>'N'
,p_attribute_02=>'HTML'
,p_attribute_03=>'N'
);
wwv_flow_api.create_page_button(
p_id=>wwv_flow_api.id(8866728403268979008)
,p_button_sequence=>20
,p_button_plug_id=>wwv_flow_api.id(1713164201739995053)
,p_button_name=>'Create'
,p_button_action=>'SUBMIT'
,p_button_template_options=>'#DEFAULT#'
,p_button_template_id=>wwv_flow_api.id(1774883187200936581)
,p_button_image_alt=>'Create Collection'
,p_button_position=>'REGION_TEMPLATE_NEXT'
);
wwv_flow_api.create_page_button(
p_id=>wwv_flow_api.id(8866731010540981114)
,p_button_sequence=>30
,p_button_plug_id=>wwv_flow_api.id(1713164201739995053)
,p_button_name=>'Create_Replace'
,p_button_action=>'SUBMIT'
,p_button_template_options=>'#DEFAULT#'
,p_button_template_id=>wwv_flow_api.id(1774883187200936581)
,p_button_is_hot=>'Y'
,p_button_image_alt=>'Create/Replace Collection'
,p_button_position=>'REGION_TEMPLATE_NEXT'
);
wwv_flow_api.create_page_button(
p_id=>wwv_flow_api.id(8866723014911972908)
,p_button_sequence=>10
,p_button_plug_id=>wwv_flow_api.id(1713164201739995053)
,p_button_name=>'Cancel'
,p_button_action=>'REDIRECT_PAGE'
,p_button_template_options=>'#DEFAULT#'
,p_button_template_id=>wwv_flow_api.id(1774883187200936581)
,p_button_image_alt=>'Cancel'
,p_button_position=>'REGION_TEMPLATE_PREVIOUS'
,p_button_redirect_url=>'f?p=&APP_ID.:1:&SESSION.::&DEBUG.:::'
);
wwv_flow_api.create_page_branch(
p_id=>wwv_flow_api.id(8866723400571972910)
,p_branch_action=>'3'
,p_branch_point=>'AFTER_PROCESSING'
,p_branch_type=>'BRANCH_TO_STEP'
,p_branch_sequence=>10
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8866718417709966497)
,p_name=>'P2_NAME'
,p_is_required=>true
,p_item_sequence=>10
,p_item_plug_id=>wwv_flow_api.id(8866716089470964392)
,p_prompt=>'Collection Name'
,p_display_as=>'NATIVE_TEXT_FIELD'
,p_cSize=>64
,p_cMaxlength=>2000
,p_field_template=>wwv_flow_api.id(274822744073356429)
,p_item_template_options=>'#DEFAULT#'
,p_protection_level=>'S'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_01=>'Y'
,p_attribute_02=>'N'
,p_attribute_04=>'TEXT'
,p_attribute_05=>'NONE'
);
wwv_flow_api.create_page_process(
p_id=>wwv_flow_api.id(8866745713371998896)
,p_process_sequence=>10
,p_process_point=>'AFTER_SUBMIT'
,p_process_type=>'NATIVE_PLSQL'
,p_process_name=>'Create'
,p_process_sql_clob=>wwv_flow_string.join(wwv_flow_t_varchar2(
'apex_collection.create_collection( p_collection_name => :P2_NAME );',
'commit;'))
,p_process_clob_language=>'PLSQL'
,p_process_error_message=>'Error creating collection <b>&P2_NAME.</b>.'
,p_process_when_button_id=>wwv_flow_api.id(8866728403268979008)
,p_process_success_message=>'Successfully created collection <b>&P2_NAME.</b>.'
);
wwv_flow_api.create_page_process(
p_id=>wwv_flow_api.id(1156315145607388521)
,p_process_sequence=>20
,p_process_point=>'AFTER_SUBMIT'
,p_process_type=>'NATIVE_PLSQL'
,p_process_name=>'Create on Return Key Submit'
,p_process_sql_clob=>wwv_flow_string.join(wwv_flow_t_varchar2(
'apex_collection.create_collection( p_collection_name => :P2_NAME );',
'commit;'))
,p_process_clob_language=>'PLSQL'
,p_process_error_message=>'Error creating collection <b>&P2_NAME.</b>.'
,p_process_when=>'P2_NAME'
,p_process_when_type=>'REQUEST_EQUALS_CONDITION'
,p_process_success_message=>'Successfully created collection <b>&P2_NAME.</b>.'
);
wwv_flow_api.create_page_process(
p_id=>wwv_flow_api.id(8866750420045010910)
,p_process_sequence=>30
,p_process_point=>'AFTER_SUBMIT'
,p_process_type=>'NATIVE_PLSQL'
,p_process_name=>'Create/Replace'
,p_process_sql_clob=>wwv_flow_string.join(wwv_flow_t_varchar2(
'apex_collection.create_or_truncate_collection( p_collection_name => :P2_NAME );',
'commit;'))
,p_process_clob_language=>'PLSQL'
,p_process_error_message=>'Error creating/replacing collection <b>&P2_NAME.</b>.'
,p_process_when_button_id=>wwv_flow_api.id(8866731010540981114)
,p_process_success_message=>'Successfully created/replaced collection <b>&P2_NAME.</b>.'
);
end;
/
prompt --application/pages/page_00003
begin
wwv_flow_api.create_page(
p_id=>3
,p_user_interface_id=>wwv_flow_api.id(1121389871104511367)
,p_name=>'Modify Collection'
,p_alias=>'MODIFY-COLLECTION'
,p_step_title=>'Modify Collection'
,p_reload_on_submit=>'A'
,p_warn_on_unsaved_changes=>'N'
,p_first_item=>'AUTO_FIRST_ITEM'
,p_autocomplete_on_off=>'OFF'
,p_step_template=>wwv_flow_api.id(1774844326834936459)
,p_page_template_options=>'#DEFAULT#'
,p_protection_level=>'C'
,p_help_text=>'No help is available for this page.'
,p_last_updated_by=>'ALLAN'
,p_last_upd_yyyymmddhh24miss=>'20210301103343'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(1318677074012387622)
,p_plug_name=>'Breadcrumb'
,p_region_template_options=>'#DEFAULT#:t-BreadcrumbRegion--useBreadcrumbTitle'
,p_component_template_options=>'#DEFAULT#'
,p_plug_template=>wwv_flow_api.id(1774862430658936498)
,p_plug_display_sequence=>1
,p_plug_display_point=>'REGION_POSITION_01'
,p_menu_id=>wwv_flow_api.id(1318675881153380306)
,p_plug_source_type=>'NATIVE_BREADCRUMB'
,p_menu_template_id=>wwv_flow_api.id(1774883299498936583)
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(1713164352515995054)
,p_plug_name=>'About this page'
,p_region_template_options=>'#DEFAULT#'
,p_plug_template=>wwv_flow_api.id(1774849216241936469)
,p_plug_display_sequence=>10
,p_include_in_reg_disp_sel_yn=>'Y'
,p_plug_display_point=>'BODY'
,p_plug_source=>'<p>Use this page to add members (records) into your collection. Note that this application does not use all of the fields available in APEX collections.</p>'
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_attribute_01=>'N'
,p_attribute_02=>'HTML'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(8866776014061211253)
,p_plug_name=>'Collection'
,p_region_template_options=>'#DEFAULT#:t-Region--scrollBody'
,p_plug_template=>wwv_flow_api.id(1774859855390936493)
,p_plug_display_sequence=>20
,p_plug_display_point=>'BODY'
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_plug_column_width=>'valign=top'
,p_attribute_01=>'N'
,p_attribute_02=>'HTML'
,p_attribute_03=>'N'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(8866777310827212764)
,p_plug_name=>'Member Attributes'
,p_region_template_options=>'#DEFAULT#:t-Region--scrollBody'
,p_plug_template=>wwv_flow_api.id(1774859855390936493)
,p_plug_display_sequence=>30
,p_plug_display_point=>'BODY'
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_attribute_01=>'N'
,p_attribute_02=>'HTML'
,p_attribute_03=>'N'
);
wwv_flow_api.create_page_button(
p_id=>wwv_flow_api.id(8866793219358220219)
,p_button_sequence=>30
,p_button_plug_id=>wwv_flow_api.id(1318677074012387622)
,p_button_name=>'Cancel'
,p_button_action=>'SUBMIT'
,p_button_template_options=>'#DEFAULT#'
,p_button_template_id=>wwv_flow_api.id(1774883187200936581)
,p_button_image_alt=>'Cancel'
,p_button_position=>'REGION_TEMPLATE_CLOSE'
);
wwv_flow_api.create_page_button(
p_id=>wwv_flow_api.id(8866957797229934597)
,p_button_sequence=>10
,p_button_plug_id=>wwv_flow_api.id(1318677074012387622)
,p_button_name=>'Add_Member_Add_Another'
,p_button_action=>'SUBMIT'
,p_button_template_options=>'#DEFAULT#'
,p_button_template_id=>wwv_flow_api.id(1774883187200936581)
,p_button_image_alt=>'Add Member & Add Another'
,p_button_position=>'REGION_TEMPLATE_CREATE'
);
wwv_flow_api.create_page_button(
p_id=>wwv_flow_api.id(8866814719751248727)
,p_button_sequence=>20
,p_button_plug_id=>wwv_flow_api.id(1318677074012387622)
,p_button_name=>'Add_Member'
,p_button_action=>'SUBMIT'
,p_button_template_options=>'#DEFAULT#'
,p_button_template_id=>wwv_flow_api.id(1774883187200936581)
,p_button_is_hot=>'Y'
,p_button_image_alt=>'Add Member'
,p_button_position=>'REGION_TEMPLATE_CREATE'
);
wwv_flow_api.create_page_button(
p_id=>wwv_flow_api.id(8866974021171969857)
,p_button_sequence=>10
,p_button_plug_id=>wwv_flow_api.id(8866776014061211253)
,p_button_name=>'Truncate_Collection'
,p_button_action=>'SUBMIT'
,p_button_template_options=>'#DEFAULT#'
,p_button_template_id=>wwv_flow_api.id(1774883187200936581)
,p_button_image_alt=>'Truncate Collection'
,p_button_position=>'REGION_TEMPLATE_EDIT'
);
wwv_flow_api.create_page_button(
p_id=>wwv_flow_api.id(8866981399831973146)
,p_button_sequence=>20
,p_button_plug_id=>wwv_flow_api.id(8866776014061211253)
,p_button_name=>'Delete_Collection'
,p_button_action=>'SUBMIT'
,p_button_template_options=>'#DEFAULT#:t-Button--simple:t-Button--danger'
,p_button_template_id=>wwv_flow_api.id(1774883187200936581)
,p_button_image_alt=>'Delete Collection'
,p_button_position=>'REGION_TEMPLATE_EDIT'
);
wwv_flow_api.create_page_button(
p_id=>wwv_flow_api.id(8866993113814986607)
,p_button_sequence=>30
,p_button_plug_id=>wwv_flow_api.id(8866776014061211253)
,p_button_name=>'Resequence'
,p_button_action=>'SUBMIT'
,p_button_template_options=>'#DEFAULT#'
,p_button_template_id=>wwv_flow_api.id(1774883187200936581)
,p_button_image_alt=>'Resequence'
,p_button_position=>'REGION_TEMPLATE_EDIT'
);
wwv_flow_api.create_page_branch(
p_id=>wwv_flow_api.id(8866958213645934607)
,p_branch_action=>'3'
,p_branch_point=>'AFTER_PROCESSING'
,p_branch_type=>'BRANCH_TO_STEP'
,p_branch_when_button_id=>wwv_flow_api.id(8866957797229934597)
,p_branch_sequence=>10
);
wwv_flow_api.create_page_branch(
p_id=>wwv_flow_api.id(8866796421813222882)
,p_branch_action=>'1'
,p_branch_point=>'AFTER_PROCESSING'
,p_branch_type=>'BRANCH_TO_STEP'
,p_branch_sequence=>20
,p_branch_comment=>'Created 16-JUL-2002 15:56 by JOEL'
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8396234424309594330)
,p_name=>'P3_DATE_ATTR1'
,p_item_sequence=>100
,p_item_plug_id=>wwv_flow_api.id(8866777310827212764)
,p_prompt=>'Date Attribute 1'
,p_display_as=>'NATIVE_DATE_PICKER'
,p_cSize=>64
,p_cMaxlength=>4000
,p_field_template=>wwv_flow_api.id(1774882198755936568)
,p_item_template_options=>'#DEFAULT#'
,p_protection_level=>'S'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_04=>'button'
,p_attribute_05=>'N'
,p_attribute_07=>'NONE'
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8396234715436601231)
,p_name=>'P3_DATE_ATTR2'
,p_item_sequence=>110
,p_item_plug_id=>wwv_flow_api.id(8866777310827212764)
,p_prompt=>'Date Attribute 2'
,p_display_as=>'NATIVE_DATE_PICKER'
,p_cSize=>64
,p_cMaxlength=>4000
,p_field_template=>wwv_flow_api.id(1774882198755936568)
,p_item_template_options=>'#DEFAULT#'
,p_protection_level=>'S'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_04=>'button'
,p_attribute_05=>'N'
,p_attribute_07=>'NONE'
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8396234922709603275)
,p_name=>'P3_DATE_ATTR3'
,p_item_sequence=>120
,p_item_plug_id=>wwv_flow_api.id(8866777310827212764)
,p_prompt=>'Date Attribute 3'
,p_display_as=>'NATIVE_DATE_PICKER'
,p_cSize=>64
,p_cMaxlength=>4000
,p_field_template=>wwv_flow_api.id(1774882198755936568)
,p_item_template_options=>'#DEFAULT#'
,p_protection_level=>'S'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_04=>'button'
,p_attribute_05=>'N'
,p_attribute_07=>'NONE'
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8429614647541691269)
,p_name=>'P3_NUM_ATTR1'
,p_item_sequence=>70
,p_item_plug_id=>wwv_flow_api.id(8866777310827212764)
,p_prompt=>'Numeric Attribute 1'
,p_display_as=>'NATIVE_NUMBER_FIELD'
,p_cSize=>64
,p_cMaxlength=>4000
,p_field_template=>wwv_flow_api.id(1774882198755936568)
,p_item_template_options=>'#DEFAULT#'
,p_protection_level=>'S'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_03=>'right'
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8429614845977691270)
,p_name=>'P3_NUM_ATTR2'
,p_item_sequence=>80
,p_item_plug_id=>wwv_flow_api.id(8866777310827212764)
,p_prompt=>'Numeric Attribute 2'
,p_display_as=>'NATIVE_NUMBER_FIELD'
,p_cSize=>64
,p_cMaxlength=>4000
,p_field_template=>wwv_flow_api.id(1774882198755936568)
,p_item_template_options=>'#DEFAULT#'
,p_protection_level=>'S'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_03=>'right'
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8429615034731691270)
,p_name=>'P3_NUM_ATTR3'
,p_item_sequence=>90
,p_item_plug_id=>wwv_flow_api.id(8866777310827212764)
,p_prompt=>'Numeric Attribute 3'
,p_display_as=>'NATIVE_NUMBER_FIELD'
,p_cSize=>64
,p_cMaxlength=>4000
,p_field_template=>wwv_flow_api.id(1774882198755936568)
,p_item_template_options=>'#DEFAULT#'
,p_protection_level=>'S'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_03=>'right'
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8866786406082214991)
,p_name=>'P3_NAME'
,p_item_sequence=>10
,p_item_plug_id=>wwv_flow_api.id(8866776014061211253)
,p_prompt=>'Collection Name'
,p_source=>'P2_NAME'
,p_source_type=>'ITEM'
,p_display_as=>'NATIVE_TEXT_FIELD'
,p_cSize=>64
,p_cMaxlength=>2000
,p_field_template=>wwv_flow_api.id(1774882198755936568)
,p_item_template_options=>'#DEFAULT#'
,p_protection_level=>'S'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_01=>'N'
,p_attribute_02=>'N'
,p_attribute_04=>'TEXT'
,p_attribute_05=>'BOTH'
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8866800010599228047)
,p_name=>'P3_ATTR1'
,p_item_sequence=>20
,p_item_plug_id=>wwv_flow_api.id(8866777310827212764)
,p_prompt=>'Character Attribute 1'
,p_display_as=>'NATIVE_TEXT_FIELD'
,p_cSize=>64
,p_cMaxlength=>2000
,p_field_template=>wwv_flow_api.id(1774882198755936568)
,p_item_template_options=>'#DEFAULT#'
,p_protection_level=>'S'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_01=>'N'
,p_attribute_02=>'N'
,p_attribute_04=>'TEXT'
,p_attribute_05=>'BOTH'
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8866802306501230000)
,p_name=>'P3_ATTR2'
,p_item_sequence=>30
,p_item_plug_id=>wwv_flow_api.id(8866777310827212764)
,p_prompt=>'Character Attribute 2'
,p_display_as=>'NATIVE_TEXT_FIELD'
,p_cSize=>64
,p_cMaxlength=>2000
,p_field_template=>wwv_flow_api.id(1774882198755936568)
,p_item_template_options=>'#DEFAULT#'
,p_protection_level=>'S'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_01=>'N'
,p_attribute_02=>'N'
,p_attribute_04=>'TEXT'
,p_attribute_05=>'BOTH'
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8866804601756232157)
,p_name=>'P3_ATTR3'
,p_item_sequence=>40
,p_item_plug_id=>wwv_flow_api.id(8866777310827212764)
,p_prompt=>'Character Attribute 3'
,p_display_as=>'NATIVE_TEXT_FIELD'
,p_cSize=>64
,p_cMaxlength=>2000
,p_field_template=>wwv_flow_api.id(1774882198755936568)
,p_item_template_options=>'#DEFAULT#'
,p_protection_level=>'S'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_01=>'N'
,p_attribute_02=>'N'
,p_attribute_04=>'TEXT'
,p_attribute_05=>'BOTH'
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8866806897443234127)
,p_name=>'P3_ATTR4'
,p_item_sequence=>50
,p_item_plug_id=>wwv_flow_api.id(8866777310827212764)
,p_prompt=>'Character Attribute 4'
,p_display_as=>'NATIVE_TEXT_FIELD'
,p_cSize=>64
,p_cMaxlength=>2000
,p_field_template=>wwv_flow_api.id(1774882198755936568)
,p_item_template_options=>'#DEFAULT#'
,p_protection_level=>'S'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_01=>'N'
,p_attribute_02=>'N'
,p_attribute_04=>'TEXT'
,p_attribute_05=>'BOTH'
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8866809193346236003)
,p_name=>'P3_ATTR5'
,p_item_sequence=>60
,p_item_plug_id=>wwv_flow_api.id(8866777310827212764)
,p_prompt=>'Character Attribute 5'
,p_display_as=>'NATIVE_TEXT_FIELD'
,p_cSize=>64
,p_cMaxlength=>2000
,p_field_template=>wwv_flow_api.id(1774882198755936568)
,p_item_template_options=>'#DEFAULT#'
,p_protection_level=>'S'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_01=>'N'
,p_attribute_02=>'N'
,p_attribute_04=>'TEXT'
,p_attribute_05=>'BOTH'
);
wwv_flow_api.create_page_validation(
p_id=>wwv_flow_api.id(8867000613690995552)
,p_validation_name=>'Collection Name not null'
,p_validation_sequence=>10
,p_validation=>'P3_NAME'
,p_validation_type=>'ITEM_NOT_NULL'
,p_error_message=>'Collection name cannot be null'
,p_validation_condition=>':REQUEST in (''Truncate_Collection'',''Delete_Collection'',''Resequence'',''Add_Member'',''Add_Member_Add_Another'')'
,p_validation_condition2=>'PLSQL'
,p_validation_condition_type=>'EXPRESSION'
,p_associated_item=>wwv_flow_api.id(8866786406082214991)
,p_error_display_location=>'INLINE_WITH_FIELD_AND_NOTIFICATION'
);
wwv_flow_api.create_page_process(
p_id=>wwv_flow_api.id(8866821999791263447)
,p_process_sequence=>10
,p_process_point=>'AFTER_SUBMIT'
,p_process_type=>'NATIVE_PLSQL'
,p_process_name=>'Add Member'
,p_process_sql_clob=>wwv_flow_string.join(wwv_flow_t_varchar2(
'--',
'-- This application uses the Application Level Date format to control the default date format for the application.',
'-- Without this, then you would need to specify explict date format masks in the TO_DATE conversions.',
'apex_collection.add_member(',
' p_collection_name => :P3_NAME,',
' p_c001 => :P3_ATTR1,',
' p_c002 => :P3_ATTR2,',
' p_c003 => :P3_ATTR3,',
' p_c004 => :P3_ATTR4,',
' p_c005 => :P3_ATTR5,',
' p_n001 => :P3_NUM_ATTR1,',
' p_n002 => :P3_NUM_ATTR2,',
' p_n003 => :P3_NUM_ATTR3,',
' p_d001 => to_date(:P3_DATE_ATTR1),',
' p_d002 => to_date(:P3_DATE_ATTR2),',
' p_d003 => to_date(:P3_DATE_ATTR3),',
' p_generate_md5 => ''YES'' );',
'commit;'))
,p_process_clob_language=>'PLSQL'
,p_process_error_message=>'Error adding member to collection <b>&P3_NAME.</b>.'
,p_process_when=>':REQUEST in (''Add_Member'',''Add_Member_Add_Another'')'
,p_process_when_type=>'EXPRESSION'
,p_process_when2=>'SQL'
,p_process_success_message=>'Successfully added member to collection <b>&P3_NAME.</b>.'
);
wwv_flow_api.create_page_process(
p_id=>wwv_flow_api.id(8867114121497204602)
,p_process_sequence=>20
,p_process_point=>'AFTER_SUBMIT'
,p_process_type=>'NATIVE_PLSQL'
,p_process_name=>'Resequence'
,p_process_sql_clob=>wwv_flow_string.join(wwv_flow_t_varchar2(
'apex_collection.resequence_collection(',
' p_collection_name => :P3_NAME );',
'commit;'))
,p_process_clob_language=>'PLSQL'
,p_process_error_message=>'Error resequencing members in collection <b>&P3_NAME.</b>.'
,p_process_when_button_id=>wwv_flow_api.id(8866993113814986607)
,p_process_success_message=>'Successfully resequenced members in collection <b>&P3_NAME.</b>.'
);
wwv_flow_api.create_page_process(
p_id=>wwv_flow_api.id(8867118501872213764)
,p_process_sequence=>30
,p_process_point=>'AFTER_SUBMIT'
,p_process_type=>'NATIVE_PLSQL'
,p_process_name=>'Delete Collection'
,p_process_sql_clob=>wwv_flow_string.join(wwv_flow_t_varchar2(
'apex_collection.delete_collection(',
' p_collection_name => :P3_NAME );',
'--',
'commit;'))
,p_process_clob_language=>'PLSQL'
,p_process_error_message=>'Error deleting collection <b>&P3_NAME.</b>.'
,p_process_when_button_id=>wwv_flow_api.id(8866981399831973146)
,p_process_success_message=>'Successfully deleted collection <b>&P3_NAME.</b>.'
);
wwv_flow_api.create_page_process(
p_id=>wwv_flow_api.id(8867181195690657249)
,p_process_sequence=>40
,p_process_point=>'AFTER_SUBMIT'
,p_process_type=>'NATIVE_PLSQL'
,p_process_name=>'Truncate Collection'
,p_process_sql_clob=>wwv_flow_string.join(wwv_flow_t_varchar2(
'apex_collection.truncate_collection(',
' p_collection_name => :P3_NAME );',
'--',
'commit;'))
,p_process_clob_language=>'PLSQL'
,p_process_error_message=>'Error truncating collection <b>&P3_NAME.</b>.'
,p_process_when_button_id=>wwv_flow_api.id(8866974021171969857)
,p_process_success_message=>'Successfully truncated collection <b>&P3_NAME.</b>.'
);
wwv_flow_api.create_page_process(
p_id=>wwv_flow_api.id(7960446708983693505)
,p_process_sequence=>50
,p_process_point=>'AFTER_SUBMIT'
,p_process_type=>'NATIVE_SESSION_STATE'
,p_process_name=>'Clear Cache'
,p_attribute_01=>'CLEAR_CACHE_CURRENT_PAGE'
,p_error_display_location=>'INLINE_IN_NOTIFICATION'
);
end;
/
prompt --application/pages/page_00004
begin
wwv_flow_api.create_page(
p_id=>4
,p_user_interface_id=>wwv_flow_api.id(1121389871104511367)
,p_name=>'Modify Collection Member'
,p_alias=>'MODIFY-COLLECTION-MEMBER'
,p_page_mode=>'MODAL'
,p_step_title=>'Modify Collection Member'
,p_reload_on_submit=>'A'
,p_warn_on_unsaved_changes=>'N'
,p_first_item=>'AUTO_FIRST_ITEM'
,p_autocomplete_on_off=>'OFF'
,p_step_template=>wwv_flow_api.id(1774846340824936463)
,p_page_template_options=>'#DEFAULT#'
,p_protection_level=>'C'
,p_help_text=>'No help is available for this page.'
,p_last_updated_by=>'ALLAN'
,p_last_upd_yyyymmddhh24miss=>'20210301103343'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(1713164403465995055)
,p_plug_name=>'About this page'
,p_region_template_options=>'#DEFAULT#'
,p_plug_template=>wwv_flow_api.id(1774849216241936469)
,p_plug_display_sequence=>10
,p_include_in_reg_disp_sel_yn=>'Y'
,p_plug_display_point=>'BODY'
,p_plug_source=>'<p>Use this page to modify a member of the collection.</p>'
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_attribute_01=>'N'
,p_attribute_02=>'HTML'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(1713164471262995056)
,p_plug_name=>'Buttons'
,p_region_template_options=>'#DEFAULT#:t-ButtonRegion--noUI'
,p_plug_template=>wwv_flow_api.id(1774849395965936471)
,p_plug_display_sequence=>20
,p_include_in_reg_disp_sel_yn=>'Y'
,p_plug_display_point=>'REGION_POSITION_03'
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_attribute_01=>'N'
,p_attribute_02=>'HTML'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(8867020310875012064)
,p_plug_name=>'Collection Member'
,p_region_template_options=>'#DEFAULT#:t-Region--scrollBody:t-Region--hideHeader:t-Region--noBorder'
,p_plug_template=>wwv_flow_api.id(1774859855390936493)
,p_plug_display_sequence=>30
,p_plug_display_point=>'BODY'
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_attribute_01=>'N'
,p_attribute_02=>'HTML'
,p_attribute_03=>'N'
);
wwv_flow_api.create_page_button(
p_id=>wwv_flow_api.id(8867102496481180374)
,p_button_sequence=>20
,p_button_plug_id=>wwv_flow_api.id(1713164471262995056)
,p_button_name=>'Delete_Member'
,p_button_action=>'SUBMIT'
,p_button_template_options=>'#DEFAULT#:t-Button--simple:t-Button--danger'
,p_button_template_id=>wwv_flow_api.id(1774883187200936581)
,p_button_image_alt=>'Delete Member'
,p_button_position=>'REGION_TEMPLATE_NEXT'
);
wwv_flow_api.create_page_button(
p_id=>wwv_flow_api.id(8867057500403039552)
,p_button_sequence=>40
,p_button_plug_id=>wwv_flow_api.id(1713164471262995056)
,p_button_name=>'Update_Member'
,p_button_action=>'SUBMIT'
,p_button_template_options=>'#DEFAULT#'
,p_button_template_id=>wwv_flow_api.id(1774883187200936581)
,p_button_is_hot=>'Y'
,p_button_image_alt=>'Update Member'
,p_button_position=>'REGION_TEMPLATE_NEXT'
);
wwv_flow_api.create_page_button(
p_id=>wwv_flow_api.id(8867052915163034328)
,p_button_sequence=>10
,p_button_plug_id=>wwv_flow_api.id(1713164471262995056)
,p_button_name=>'Cancel'
,p_button_action=>'DEFINED_BY_DA'
,p_button_template_options=>'#DEFAULT#'
,p_button_template_id=>wwv_flow_api.id(1774883187200936581)
,p_button_image_alt=>'Cancel'
,p_button_position=>'REGION_TEMPLATE_PREVIOUS'
);
wwv_flow_api.create_page_branch(
p_id=>wwv_flow_api.id(8867053307023034330)
,p_branch_action=>'1'
,p_branch_point=>'AFTER_PROCESSING'
,p_branch_type=>'BRANCH_TO_STEP'
,p_branch_sequence=>10
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8396237331806662669)
,p_name=>'P4_DATE_ATTR1'
,p_item_sequence=>110
,p_item_plug_id=>wwv_flow_api.id(8867020310875012064)
,p_prompt=>'Date Attribute 1'
,p_display_as=>'NATIVE_DATE_PICKER'
,p_cSize=>64
,p_cMaxlength=>4000
,p_field_template=>wwv_flow_api.id(1774882198755936568)
,p_item_template_options=>'#DEFAULT#'
,p_protection_level=>'S'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_04=>'button'
,p_attribute_05=>'N'
,p_attribute_07=>'NONE'
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8396237612198666519)
,p_name=>'P4_DATE_ATTR2'
,p_item_sequence=>120
,p_item_plug_id=>wwv_flow_api.id(8867020310875012064)
,p_prompt=>'Date Attribute 2'
,p_display_as=>'NATIVE_DATE_PICKER'
,p_cSize=>64
,p_cMaxlength=>4000
,p_field_template=>wwv_flow_api.id(1774882198755936568)
,p_item_template_options=>'#DEFAULT#'
,p_protection_level=>'S'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_04=>'button'
,p_attribute_05=>'N'
,p_attribute_07=>'NONE'
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8396237822933669574)
,p_name=>'P4_DATE_ATTR3'
,p_item_sequence=>130
,p_item_plug_id=>wwv_flow_api.id(8867020310875012064)
,p_prompt=>'Date Attribute 3'
,p_display_as=>'NATIVE_DATE_PICKER'
,p_cSize=>64
,p_cMaxlength=>4000
,p_field_template=>wwv_flow_api.id(1774882198755936568)
,p_item_template_options=>'#DEFAULT#'
,p_protection_level=>'S'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_04=>'button'
,p_attribute_05=>'N'
,p_attribute_07=>'NONE'
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8430615644870493172)
,p_name=>'P4_NUM_ATTR1'
,p_item_sequence=>80
,p_item_plug_id=>wwv_flow_api.id(8867020310875012064)
,p_prompt=>'Numeric Attribute 1'
,p_display_as=>'NATIVE_NUMBER_FIELD'
,p_cSize=>64
,p_cMaxlength=>4000
,p_field_template=>wwv_flow_api.id(1774882198755936568)
,p_item_template_options=>'#DEFAULT#'
,p_protection_level=>'S'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_03=>'right'
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8430615925954497108)
,p_name=>'P4_NUM_ATTR2'
,p_item_sequence=>90
,p_item_plug_id=>wwv_flow_api.id(8867020310875012064)
,p_prompt=>'Numeric Attribute 2'
,p_display_as=>'NATIVE_NUMBER_FIELD'
,p_cSize=>64
,p_cMaxlength=>4000
,p_field_template=>wwv_flow_api.id(1774882198755936568)
,p_item_template_options=>'#DEFAULT#'
,p_protection_level=>'S'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_03=>'right'
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8430616131495498701)
,p_name=>'P4_NUM_ATTR3'
,p_item_sequence=>100
,p_item_plug_id=>wwv_flow_api.id(8867020310875012064)
,p_prompt=>'Numeric Attribute 3'
,p_display_as=>'NATIVE_NUMBER_FIELD'
,p_cSize=>64
,p_cMaxlength=>4000
,p_field_template=>wwv_flow_api.id(1774882198755936568)
,p_item_template_options=>'#DEFAULT#'
,p_protection_level=>'S'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_03=>'right'
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8430616951496523431)
,p_name=>'P4_XMLTYPE'
,p_item_sequence=>140
,p_item_plug_id=>wwv_flow_api.id(8867020310875012064)
,p_prompt=>'XMLType'
,p_display_as=>'NATIVE_TEXTAREA'
,p_cSize=>80
,p_cMaxlength=>4000
,p_cHeight=>5
,p_field_template=>wwv_flow_api.id(1774882318212936569)
,p_item_template_options=>'#DEFAULT#'
,p_protection_level=>'S'
,p_help_text=>'Enter a well-formed XML fragment or document.'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_01=>'Y'
,p_attribute_02=>'N'
,p_attribute_03=>'N'
,p_attribute_04=>'NONE'
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8867022603111015641)
,p_name=>'P4_NAME'
,p_item_sequence=>10
,p_item_plug_id=>wwv_flow_api.id(8867020310875012064)
,p_prompt=>'Name'
,p_display_as=>'NATIVE_DISPLAY_ONLY'
,p_field_template=>wwv_flow_api.id(1774882198755936568)
,p_item_template_options=>'#DEFAULT#'
,p_protection_level=>'S'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_01=>'Y'
,p_attribute_02=>'VALUE'
,p_attribute_04=>'N'
,p_attribute_05=>'PLAIN'
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8867028297504018253)
,p_name=>'P4_SEQ'
,p_item_sequence=>20
,p_item_plug_id=>wwv_flow_api.id(8867020310875012064)
,p_prompt=>'Sequence'
,p_display_as=>'NATIVE_DISPLAY_ONLY'
,p_field_template=>wwv_flow_api.id(1774882198755936568)
,p_item_template_options=>'#DEFAULT#'
,p_protection_level=>'S'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_01=>'Y'
,p_attribute_02=>'VALUE'
,p_attribute_04=>'N'
,p_attribute_05=>'PLAIN'
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8867034219704023197)
,p_name=>'P4_ATTR1'
,p_item_sequence=>30
,p_item_plug_id=>wwv_flow_api.id(8867020310875012064)
,p_prompt=>'Character Attribute 1'
,p_display_as=>'NATIVE_TEXT_FIELD'
,p_cSize=>64
,p_cMaxlength=>2000
,p_field_template=>wwv_flow_api.id(1774882198755936568)
,p_item_template_options=>'#DEFAULT#'
,p_protection_level=>'S'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_01=>'N'
,p_attribute_02=>'N'
,p_attribute_04=>'TEXT'
,p_attribute_05=>'BOTH'
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8867038216038024836)
,p_name=>'P4_ATTR2'
,p_item_sequence=>40
,p_item_plug_id=>wwv_flow_api.id(8867020310875012064)
,p_prompt=>'Character Attribute 2'
,p_display_as=>'NATIVE_TEXT_FIELD'
,p_cSize=>64
,p_cMaxlength=>2000
,p_field_template=>wwv_flow_api.id(1774882198755936568)
,p_item_template_options=>'#DEFAULT#'
,p_protection_level=>'S'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_01=>'N'
,p_attribute_02=>'N'
,p_attribute_04=>'TEXT'
,p_attribute_05=>'BOTH'
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8867040512803026350)
,p_name=>'P4_ATTR3'
,p_item_sequence=>50
,p_item_plug_id=>wwv_flow_api.id(8867020310875012064)
,p_prompt=>'Character Attribute 3'
,p_display_as=>'NATIVE_TEXT_FIELD'
,p_cSize=>64
,p_cMaxlength=>2000
,p_field_template=>wwv_flow_api.id(1774882198755936568)
,p_item_template_options=>'#DEFAULT#'
,p_protection_level=>'S'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_01=>'N'
,p_attribute_02=>'N'
,p_attribute_04=>'TEXT'
,p_attribute_05=>'BOTH'
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8867044509784027757)
,p_name=>'P4_ATTR4'
,p_item_sequence=>60
,p_item_plug_id=>wwv_flow_api.id(8867020310875012064)
,p_prompt=>'Character Attribute 4'
,p_display_as=>'NATIVE_TEXT_FIELD'
,p_cSize=>64
,p_cMaxlength=>2000
,p_field_template=>wwv_flow_api.id(1774882198755936568)
,p_item_template_options=>'#DEFAULT#'
,p_protection_level=>'S'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_01=>'N'
,p_attribute_02=>'N'
,p_attribute_04=>'TEXT'
,p_attribute_05=>'BOTH'
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8867047306118029408)
,p_name=>'P4_ATTR5'
,p_item_sequence=>70
,p_item_plug_id=>wwv_flow_api.id(8867020310875012064)
,p_prompt=>'Character Attribute 5'
,p_display_as=>'NATIVE_TEXT_FIELD'
,p_cSize=>64
,p_cMaxlength=>2000
,p_field_template=>wwv_flow_api.id(1774882198755936568)
,p_item_template_options=>'#DEFAULT#'
,p_protection_level=>'S'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_01=>'N'
,p_attribute_02=>'N'
,p_attribute_04=>'TEXT'
,p_attribute_05=>'BOTH'
);
wwv_flow_api.create_page_da_event(
p_id=>wwv_flow_api.id(229026122705043465)
,p_name=>'Cancel Modal'
,p_event_sequence=>10
,p_triggering_element_type=>'BUTTON'
,p_triggering_button_id=>wwv_flow_api.id(8867052915163034328)
,p_bind_type=>'bind'
,p_bind_event_type=>'click'
);
wwv_flow_api.create_page_da_action(
p_id=>wwv_flow_api.id(229026220236043466)
,p_event_id=>wwv_flow_api.id(229026122705043465)
,p_event_result=>'TRUE'
,p_action_sequence=>10
,p_execute_on_page_init=>'N'
,p_action=>'NATIVE_DIALOG_CANCEL'
);
wwv_flow_api.create_page_process(
p_id=>wwv_flow_api.id(8867096911004118350)
,p_process_sequence=>10
,p_process_point=>'AFTER_HEADER'
,p_process_type=>'NATIVE_PLSQL'
,p_process_name=>'Populate form'
,p_process_sql_clob=>wwv_flow_string.join(wwv_flow_t_varchar2(
'--',
'-- Given the values supplied for collection name and sequence,',
'-- fetch the values from the Collections database view',
'-- and populate the items on the page',
'--',
'for c1 in ( select c001, c002, c003, c004, c005, n001, n002, n003, d001, d002, d003, xmltype001',
' from apex_collections',
' where collection_name = :P4_NAME',
' and seq_id = :P4_SEQ ) loop',
' :P4_ATTR1 := c1.c001;',
' :P4_ATTR2 := c1.c002;',
' :P4_ATTR3 := c1.c003;',
' :P4_ATTR4 := c1.c004;',
' :P4_ATTR5 := c1.c005;',
' :P4_NUM_ATTR1 := c1.n001;',
' :P4_NUM_ATTR2 := c1.n002;',
' :P4_NUM_ATTR3 := c1.n003;',
' :P4_DATE_ATTR1 := c1.d001;',
' :P4_DATE_ATTR2 := c1.d002;',
' :P4_DATE_ATTR3 := c1.d003;',
' if c1.xmltype001 is not null then',
' :P4_XMLTYPE := xmltype.extract(c1.xmltype001,''/'').getstringval();',
' end if;',
' ',
' exit;',
'end loop;'))
,p_process_clob_language=>'PLSQL'
);
wwv_flow_api.create_page_process(
p_id=>wwv_flow_api.id(8867072410838057677)
,p_process_sequence=>10
,p_process_point=>'AFTER_SUBMIT'
,p_process_type=>'NATIVE_PLSQL'
,p_process_name=>'Update Member'
,p_process_sql_clob=>wwv_flow_string.join(wwv_flow_t_varchar2(
'declare',
' l_xmltype xmltype := null;',
'begin',
' if :P4_XMLTYPE is not null then',
' l_xmltype := xmltype( :P4_XMLTYPE );',
' end if;',
' --',
' --',
' -- This application uses the Application Level Date format to control the default date format for the application.',
' -- Without this, then you would need to specify explict date format masks in the TO_DATE conversions.',
' --',
' apex_collection.update_member(',
' p_collection_name => :P4_NAME,',
' p_seq => :P4_SEQ,',
' p_c001 => :P4_ATTR1,',
' p_c002 => :P4_ATTR2,',
' p_c003 => :P4_ATTR3,',
' p_c004 => :P4_ATTR4,',
' p_c005 => :P4_ATTR5,',
' p_n001 => :P4_NUM_ATTR1,',
' p_n002 => :P4_NUM_ATTR2,',
' p_n003 => :P4_NUM_ATTR3,',
' p_d001 => to_date(:P4_DATE_ATTR1),',
' p_d002 => to_date(:P4_DATE_ATTR2),',
' p_d003 => to_date(:P4_DATE_ATTR3),',
' p_xmltype001 => l_xmltype );',
' commit;',
'end;'))
,p_process_clob_language=>'PLSQL'
,p_process_error_message=>'Error updating member <b>&P4_SEQ.</b> in collection <b>&P4_NAME.</b>.'
,p_process_when_button_id=>wwv_flow_api.id(8867057500403039552)
,p_process_success_message=>'Successfully updated member <b>&P4_SEQ.</b> in collection <b>&P4_NAME.</b>.'
);
wwv_flow_api.create_page_process(
p_id=>wwv_flow_api.id(8867105393702187191)
,p_process_sequence=>20
,p_process_point=>'AFTER_SUBMIT'
,p_process_type=>'NATIVE_PLSQL'
,p_process_name=>'Delete Member'
,p_process_sql_clob=>wwv_flow_string.join(wwv_flow_t_varchar2(
'apex_collection.delete_member(',
' p_collection_name => :P4_NAME,',
' p_seq => :P4_SEQ );',
'--',
'commit;'))
,p_process_clob_language=>'PLSQL'
,p_process_error_message=>'Error deleting member <b>&P4_SEQ.</b> in collection <b>&P4_NAME.</b>.'
,p_process_when_button_id=>wwv_flow_api.id(8867102496481180374)
,p_process_success_message=>'Successfully deleted member <b>&P4_SEQ.</b> in collection <b>&P4_NAME.</b>.'
);
end;
/
prompt --application/pages/page_00005
begin
wwv_flow_api.create_page(
p_id=>5
,p_user_interface_id=>wwv_flow_api.id(1121389871104511367)
,p_name=>'Application Theme Style'
,p_alias=>'APPLICATION-THEME-STYLE'
,p_step_title=>'Application Theme Style'
,p_reload_on_submit=>'A'
,p_warn_on_unsaved_changes=>'N'
,p_autocomplete_on_off=>'OFF'
,p_page_template_options=>'#DEFAULT#'
,p_protection_level=>'C'
,p_help_text=>'No help is available for this page.'
,p_last_updated_by=>'ALLAN'
,p_last_upd_yyyymmddhh24miss=>'20210301103343'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(2127150102793260915)
,p_plug_name=>'Set User Interface Theme Style'
,p_region_template_options=>'#DEFAULT#:t-Region--hideHeader:t-Region--scrollBody'
,p_component_template_options=>'#DEFAULT#'
,p_plug_template=>wwv_flow_api.id(1774859855390936493)
,p_plug_display_sequence=>20
,p_plug_display_point=>'BODY'
,p_plug_query_headings_type=>'QUERY_COLUMNS'
,p_plug_query_num_rows_type=>'NEXT_PREVIOUS_LINKS'
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_plug_query_show_nulls_as=>' - '
,p_pagination_display_position=>'BOTTOM_RIGHT'
,p_attribute_01=>'N'
,p_attribute_02=>'HTML'
,p_attribute_03=>'N'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(2127150547796260917)
,p_plug_name=>'items'
,p_parent_plug_id=>wwv_flow_api.id(2127150102793260915)
,p_region_template_options=>'#DEFAULT#'
,p_component_template_options=>'#DEFAULT#'
,p_plug_template=>wwv_flow_api.id(1774849216241936469)
,p_plug_display_sequence=>30
,p_plug_display_point=>'BODY'
,p_translate_title=>'N'
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_attribute_01=>'N'
,p_attribute_02=>'HTML'
,p_attribute_03=>'N'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(2127151335586260918)
,p_plug_name=>'About this page'
,p_region_css_classes=>'infoTextRegion'
,p_region_template_options=>'#DEFAULT#'
,p_component_template_options=>'#DEFAULT#'
,p_plug_template=>wwv_flow_api.id(1774849216241936469)
,p_plug_display_sequence=>10
,p_plug_display_point=>'BODY'
,p_plug_source=>'<p>Select the look and feel of the application you would like to use for all users of this application.</p>'
,p_plug_query_headings_type=>'QUERY_COLUMNS'
,p_plug_query_num_rows_type=>'NEXT_PREVIOUS_LINKS'
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_plug_query_show_nulls_as=>' - '
,p_pagination_display_position=>'BOTTOM_RIGHT'
,p_attribute_01=>'N'
,p_attribute_02=>'HTML'
,p_attribute_03=>'N'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(2127151705228260919)
,p_plug_name=>'Breadcrumb'
,p_region_template_options=>'#DEFAULT#:t-BreadcrumbRegion--useBreadcrumbTitle'
,p_component_template_options=>'#DEFAULT#'
,p_plug_template=>wwv_flow_api.id(1774862430658936498)
,p_plug_display_sequence=>10
,p_plug_display_point=>'REGION_POSITION_01'
,p_menu_id=>wwv_flow_api.id(1318675881153380306)
,p_plug_source_type=>'NATIVE_BREADCRUMB'
,p_menu_template_id=>wwv_flow_api.id(1774883299498936583)
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
);
wwv_flow_api.create_page_button(
p_id=>wwv_flow_api.id(2127152164082260919)
,p_button_sequence=>10
,p_button_plug_id=>wwv_flow_api.id(2127151705228260919)
,p_button_name=>'CANCEL'
,p_button_action=>'REDIRECT_PAGE'
,p_button_template_options=>'#DEFAULT#'
,p_button_template_id=>wwv_flow_api.id(1774883187200936581)
,p_button_image_alt=>'Cancel'
,p_button_position=>'REGION_TEMPLATE_CLOSE'
,p_button_redirect_url=>'f?p=&APP_ID.:settings:&SESSION.::&DEBUG.:::'
);
wwv_flow_api.create_page_button(
p_id=>wwv_flow_api.id(2127152475840260919)
,p_button_sequence=>20
,p_button_plug_id=>wwv_flow_api.id(2127151705228260919)
,p_button_name=>'SAVE'
,p_button_action=>'SUBMIT'
,p_button_template_options=>'#DEFAULT#'
,p_button_template_id=>wwv_flow_api.id(1774883187200936581)
,p_button_is_hot=>'Y'
,p_button_image_alt=>'Apply Changes'
,p_button_position=>'REGION_TEMPLATE_CREATE'
);
wwv_flow_api.create_page_branch(
p_id=>wwv_flow_api.id(2127154024148260921)
,p_branch_action=>'f?p=&APP_ID.:settings:&SESSION.::&DEBUG.:::&success_msg=#SUCCESS_MSG#'
,p_branch_point=>'AFTER_PROCESSING'
,p_branch_type=>'REDIRECT_URL'
,p_branch_when_button_id=>wwv_flow_api.id(2127152475840260919)
,p_branch_sequence=>10
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(2127150926868260917)
,p_name=>'P5_DESKTOP_THEME_STYLE_ID'
,p_is_required=>true
,p_item_sequence=>10
,p_item_plug_id=>wwv_flow_api.id(2127150547796260917)
,p_use_cache_before_default=>'NO'
,p_prompt=>'Desktop Theme Style'
,p_source=>wwv_flow_string.join(wwv_flow_t_varchar2(
'select s.theme_style_id',
'from apex_application_theme_styles s, apex_application_themes t',
'where s.application_id = t.application_id',
'and s.theme_number = t.theme_number',
'and s.application_id = :app_id',
'and t.ui_type_name = ''DESKTOP''',
'and s.is_current = ''Yes'''))
,p_source_type=>'QUERY'
,p_display_as=>'NATIVE_SELECT_LIST'
,p_lov=>wwv_flow_string.join(wwv_flow_t_varchar2(
'select s.name d,',
' s.theme_style_id r',
'from apex_application_theme_styles s, apex_application_themes t',
'where s.application_id = t.application_id',
'and s.theme_number = t.theme_number',
'and s.application_id = :app_id',
'and t.ui_type_name = ''DESKTOP''',
'and t.is_current = ''Yes''',
'order by 1'))
,p_cHeight=>1
,p_display_when=>wwv_flow_string.join(wwv_flow_t_varchar2(
'select 1',
'from apex_application_theme_styles s, apex_application_themes t',
'where s.application_id = t.application_id',
'and s.theme_number = t.theme_number',
'and s.application_id = :app_id',
'and t.ui_type_name = ''DESKTOP'''))
,p_display_when_type=>'EXISTS'
,p_field_template=>wwv_flow_api.id(1774882441270936571)
,p_item_template_options=>'#DEFAULT#'
,p_lov_display_extra=>'NO'
,p_protection_level=>'S'
,p_restricted_characters=>'WEB_SAFE'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_01=>'NONE'
,p_attribute_02=>'N'
);
wwv_flow_api.create_page_process(
p_id=>wwv_flow_api.id(2127153480000260921)
,p_process_sequence=>10
,p_process_point=>'AFTER_SUBMIT'
,p_process_type=>'NATIVE_PLSQL'
,p_process_name=>'Set Theme Style'
,p_process_sql_clob=>wwv_flow_string.join(wwv_flow_t_varchar2(
'if :P5_DESKTOP_THEME_STYLE_ID is not null then',
' for c1 in (select theme_number',
' from apex_application_themes',
' where application_id = :app_id',
' and ui_type_name = ''DESKTOP''',
' and is_current = ''Yes'')',
' loop',
' apex_theme.set_current_style (',
' p_theme_number => c1.theme_number,',
' p_id => :P5_DESKTOP_THEME_STYLE_ID',
' );',
' end loop;',
'end if;'))
,p_process_clob_language=>'PLSQL'
,p_process_error_message=>'#SQLERRM#'
,p_error_display_location=>'INLINE_IN_NOTIFICATION'
,p_process_when_button_id=>wwv_flow_api.id(2127152475840260919)
,p_process_success_message=>'Theme Style Set for All Users.'
);
end;
/
prompt --application/pages/page_00006
begin
wwv_flow_api.create_page(
p_id=>6
,p_user_interface_id=>wwv_flow_api.id(1121389871104511367)
,p_name=>'Data Synchronization'
,p_alias=>'EMP'
,p_step_title=>'Data Synchronization'
,p_reload_on_submit=>'A'
,p_warn_on_unsaved_changes=>'N'
,p_first_item=>'AUTO_FIRST_ITEM'
,p_autocomplete_on_off=>'OFF'
,p_step_template=>wwv_flow_api.id(1774844326834936459)
,p_page_template_options=>'#DEFAULT#'
,p_protection_level=>'C'
,p_last_updated_by=>'ALLAN'
,p_last_upd_yyyymmddhh24miss=>'20210301103343'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(1318677957866392433)
,p_plug_name=>'Breadcrumb'
,p_region_template_options=>'#DEFAULT#:t-BreadcrumbRegion--useBreadcrumbTitle'
,p_component_template_options=>'#DEFAULT#'
,p_plug_template=>wwv_flow_api.id(1774862430658936498)
,p_plug_display_sequence=>10
,p_plug_display_point=>'REGION_POSITION_01'
,p_menu_id=>wwv_flow_api.id(1318675881153380306)
,p_plug_source_type=>'NATIVE_BREADCRUMB'
,p_menu_template_id=>wwv_flow_api.id(1774883299498936583)
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(2532921754471244952)
,p_plug_name=>'Container'
,p_region_template_options=>'#DEFAULT#:t-Region--noPadding:t-Region--removeHeader js-removeLandmark:t-Region--scrollBody'
,p_plug_template=>wwv_flow_api.id(1774859855390936493)
,p_plug_display_sequence=>30
,p_include_in_reg_disp_sel_yn=>'Y'
,p_plug_display_point=>'BODY'
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_attribute_01=>'N'
,p_attribute_02=>'HTML'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(1320262356690406695)
,p_plug_name=>'EBA_DEMO_CS_EMP table SQL Source'
,p_parent_plug_id=>wwv_flow_api.id(2532921754471244952)
,p_region_template_options=>'#DEFAULT#:is-collapsed:t-Region--noBorder:t-Region--scrollBody'
,p_plug_template=>wwv_flow_api.id(1774855849259936482)
,p_plug_display_sequence=>20
,p_plug_new_grid_row=>false
,p_plug_new_grid_column=>false
,p_plug_display_point=>'BODY'
,p_plug_source_type=>'PLUGIN_COM.ORACLE.APEX.DISPLAY_SOURCE'
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_attribute_01=>'emp_table'
);
wwv_flow_api.create_report_region(
p_id=>wwv_flow_api.id(8867311097445884349)
,p_name=>'EBA_DEMO_CS_EMP table'
,p_region_name=>'emp_table'
,p_parent_plug_id=>wwv_flow_api.id(2532921754471244952)
,p_template=>wwv_flow_api.id(1774859855390936493)
,p_display_sequence=>10
,p_region_template_options=>'#DEFAULT#:t-Region--noPadding:t-Region--noBorder:t-Region--scrollBody'
,p_component_template_options=>'#DEFAULT#:t-Report--stretch:t-Report--altRowsDefault:t-Report--rowHighlight:t-Report--inline'
,p_display_point=>'BODY'
,p_source_type=>'NATIVE_SQL_REPORT'
,p_query_type=>'SQL'
,p_source=>wwv_flow_string.join(wwv_flow_t_varchar2(
'select empno, ename, job, mgr, hiredate, sal, comm, deptno',
' from eba_demo_cs_emp'))
,p_ajax_enabled=>'Y'
,p_fixed_header=>'NONE'
,p_lazy_loading=>false
,p_query_row_template=>wwv_flow_api.id(1774869560539936527)
,p_query_num_rows=>50
,p_query_options=>'DERIVED_REPORT_COLUMNS'
,p_ignore_pagination=>0
,p_query_num_rows_type=>'ROWS_X_TO_Y_OF_Z'
,p_query_row_count_max=>500
,p_pagination_display_position=>'BOTTOM_RIGHT'
,p_csv_output=>'N'
,p_prn_output=>'N'
,p_sort_null=>'F'
,p_query_asc_image=>'blue_arrow_down.gif'
,p_query_desc_image=>'blue_arrow_up.gif'
,p_plug_query_strip_html=>'Y'
);
wwv_flow_api.create_report_columns(
p_id=>wwv_flow_api.id(8789915888382584100)
,p_query_column_id=>1
,p_column_alias=>'EMPNO'
,p_column_display_sequence=>1
,p_column_heading=>'EmpNo'
,p_column_alignment=>'RIGHT'
,p_heading_alignment=>'RIGHT'
,p_default_sort_column_sequence=>1
,p_disable_sort_column=>'N'
);
wwv_flow_api.create_report_columns(
p_id=>wwv_flow_api.id(8789915976622584100)
,p_query_column_id=>2
,p_column_alias=>'ENAME'
,p_column_display_sequence=>2
,p_column_heading=>'Name'
,p_heading_alignment=>'LEFT'
,p_disable_sort_column=>'N'
);
wwv_flow_api.create_report_columns(
p_id=>wwv_flow_api.id(8789916071544584100)
,p_query_column_id=>3
,p_column_alias=>'JOB'
,p_column_display_sequence=>3
,p_column_heading=>'Job'
,p_heading_alignment=>'LEFT'
,p_disable_sort_column=>'N'
);
wwv_flow_api.create_report_columns(
p_id=>wwv_flow_api.id(8789916188087584100)
,p_query_column_id=>4
,p_column_alias=>'MGR'
,p_column_display_sequence=>4
,p_column_heading=>'Manager'
,p_column_alignment=>'RIGHT'
,p_heading_alignment=>'RIGHT'
,p_disable_sort_column=>'N'
,p_lov_show_nulls=>'NO'
,p_lov_display_extra=>'YES'
,p_include_in_export=>'Y'
);
wwv_flow_api.create_report_columns(
p_id=>wwv_flow_api.id(8789916289253584100)
,p_query_column_id=>5
,p_column_alias=>'HIREDATE'
,p_column_display_sequence=>5
,p_column_heading=>'Hire Date'
,p_heading_alignment=>'LEFT'
,p_disable_sort_column=>'N'
);
wwv_flow_api.create_report_columns(
p_id=>wwv_flow_api.id(8789916377423584100)
,p_query_column_id=>6
,p_column_alias=>'SAL'
,p_column_display_sequence=>6
,p_column_heading=>'Salary'
,p_column_format=>'FML999G999G999G999G990D00'
,p_column_alignment=>'RIGHT'
,p_heading_alignment=>'RIGHT'
,p_disable_sort_column=>'N'
,p_lov_show_nulls=>'NO'
,p_lov_display_extra=>'YES'
,p_include_in_export=>'Y'
);
wwv_flow_api.create_report_columns(
p_id=>wwv_flow_api.id(8789916463263584100)
,p_query_column_id=>7
,p_column_alias=>'COMM'
,p_column_display_sequence=>7
,p_column_heading=>'Commission'
,p_column_format=>'FML999G999G999G999G990D00'
,p_column_alignment=>'RIGHT'
,p_heading_alignment=>'RIGHT'
,p_disable_sort_column=>'N'
,p_lov_show_nulls=>'NO'
,p_lov_display_extra=>'YES'
,p_include_in_export=>'Y'
);
wwv_flow_api.create_report_columns(
p_id=>wwv_flow_api.id(8789916558856584101)
,p_query_column_id=>8
,p_column_alias=>'DEPTNO'
,p_column_display_sequence=>8
,p_column_heading=>'DeptNo'
,p_column_alignment=>'RIGHT'
,p_heading_alignment=>'RIGHT'
,p_disable_sort_column=>'N'
);
wwv_flow_api.create_report_region(
p_id=>wwv_flow_api.id(8867323199158898707)
,p_name=>'EMP Collection'
,p_region_name=>'emp_collection'
,p_template=>wwv_flow_api.id(1774859855390936493)
,p_display_sequence=>20
,p_region_template_options=>'#DEFAULT#:t-Region--noPadding:t-Region--scrollBody'
,p_component_template_options=>'#DEFAULT#:t-Report--stretch:t-Report--altRowsDefault:t-Report--rowHighlight:t-Report--inline'
,p_display_point=>'BODY'
,p_source_type=>'NATIVE_SQL_REPORT'
,p_query_type=>'SQL'
,p_source=>wwv_flow_string.join(wwv_flow_t_varchar2(
'select seq_id editlink,',
' seq_id, ',
' n001, ',
' n002, ',
' n003, ',
' n004, ',
' d001, ',
' c001, ',
' c002, ',
' c003, ',
' c004 status',
'from apex_collections',
'where collection_name = ''EMPCOLLECTION''',
''))
,p_ajax_enabled=>'Y'
,p_fixed_header=>'NONE'
,p_lazy_loading=>false
,p_query_row_template=>wwv_flow_api.id(1774869560539936527)
,p_query_num_rows=>50
,p_query_options=>'DERIVED_REPORT_COLUMNS'
,p_ignore_pagination=>0
,p_query_num_rows_type=>'ROWS_X_TO_Y_OF_Z'
,p_query_row_count_max=>500
,p_pagination_display_position=>'BOTTOM_RIGHT'
,p_csv_output=>'N'
,p_prn_output=>'N'
,p_sort_null=>'F'
,p_query_asc_image=>'blue_arrow_down.gif'
,p_query_desc_image=>'blue_arrow_up.gif'
,p_plug_query_strip_html=>'Y'
);
wwv_flow_api.create_report_columns(
p_id=>wwv_flow_api.id(8789916662580584112)
,p_query_column_id=>1
,p_column_alias=>'EDITLINK'
,p_column_display_sequence=>1
,p_column_heading=>'Action'
,p_column_link=>'f?p=&APP_ID.:7:&SESSION.::&DEBUG.:7:P7_SEQ,P7_STATUS:#SEQ_ID#,#STATUS#'
,p_column_linktext=>'Edit'
,p_column_link_attr=>'class="t-Button t-Button--warning"'
,p_column_alignment=>'CENTER'
,p_display_as=>'WITHOUT_MODIFICATION'
,p_derived_column=>'N'
,p_include_in_export=>'Y'
);
wwv_flow_api.create_report_columns(
p_id=>wwv_flow_api.id(8789916760475584113)
,p_query_column_id=>2
,p_column_alias=>'SEQ_ID'
,p_column_display_sequence=>2
,p_column_heading=>'Sequence'
,p_use_as_row_header=>'N'
,p_column_alignment=>'RIGHT'
,p_heading_alignment=>'RIGHT'
,p_default_sort_column_sequence=>1
,p_disable_sort_column=>'N'
,p_lov_show_nulls=>'NO'
,p_lov_display_extra=>'YES'
,p_include_in_export=>'Y'
);
wwv_flow_api.create_report_columns(
p_id=>wwv_flow_api.id(8430611147996219687)
,p_query_column_id=>3
,p_column_alias=>'N001'
,p_column_display_sequence=>3
,p_column_heading=>'EmpNo'
,p_use_as_row_header=>'N'
,p_column_alignment=>'RIGHT'
,p_heading_alignment=>'RIGHT'
,p_disable_sort_column=>'N'
,p_lov_show_nulls=>'NO'
,p_lov_display_extra=>'YES'
,p_include_in_export=>'Y'
);
wwv_flow_api.create_report_columns(
p_id=>wwv_flow_api.id(8430611221291219688)
,p_query_column_id=>4
,p_column_alias=>'N002'
,p_column_display_sequence=>8
,p_column_heading=>'Salary'
,p_use_as_row_header=>'N'
,p_column_format=>'FML999G999G999G999G990D00'
,p_column_alignment=>'RIGHT'
,p_heading_alignment=>'RIGHT'
,p_disable_sort_column=>'N'
,p_lov_show_nulls=>'NO'
,p_lov_display_extra=>'YES'
,p_include_in_export=>'Y'
);
wwv_flow_api.create_report_columns(
p_id=>wwv_flow_api.id(8430611334392219688)
,p_query_column_id=>5
,p_column_alias=>'N003'
,p_column_display_sequence=>9
,p_column_heading=>'Commission'
,p_use_as_row_header=>'N'
,p_column_format=>'FML999G999G999G999G990D00'
,p_column_alignment=>'RIGHT'
,p_heading_alignment=>'RIGHT'
,p_disable_sort_column=>'N'
,p_lov_show_nulls=>'NO'
,p_lov_display_extra=>'YES'
,p_include_in_export=>'Y'
);
wwv_flow_api.create_report_columns(
p_id=>wwv_flow_api.id(8430611420069219688)
,p_query_column_id=>6
,p_column_alias=>'N004'
,p_column_display_sequence=>10
,p_column_heading=>'DeptNo'
,p_use_as_row_header=>'N'
,p_column_alignment=>'RIGHT'
,p_heading_alignment=>'RIGHT'
,p_disable_sort_column=>'N'
,p_lov_show_nulls=>'NO'
,p_lov_display_extra=>'YES'
,p_include_in_export=>'Y'
);
wwv_flow_api.create_report_columns(
p_id=>wwv_flow_api.id(8396259517972510109)
,p_query_column_id=>7
,p_column_alias=>'D001'
,p_column_display_sequence=>7
,p_column_heading=>'Hire Date'
,p_use_as_row_header=>'N'
,p_heading_alignment=>'LEFT'
,p_disable_sort_column=>'N'
,p_lov_show_nulls=>'NO'
,p_lov_display_extra=>'YES'
,p_include_in_export=>'Y'
);
wwv_flow_api.create_report_columns(
p_id=>wwv_flow_api.id(8789916864274584113)
,p_query_column_id=>8
,p_column_alias=>'C001'
,p_column_display_sequence=>4
,p_column_heading=>'Name'
,p_use_as_row_header=>'N'
,p_heading_alignment=>'LEFT'
,p_disable_sort_column=>'N'
,p_lov_show_nulls=>'NO'
,p_lov_display_extra=>'YES'
,p_include_in_export=>'Y'
);
wwv_flow_api.create_report_columns(
p_id=>wwv_flow_api.id(8789916979756584113)
,p_query_column_id=>9
,p_column_alias=>'C002'
,p_column_display_sequence=>5
,p_column_heading=>'Job'
,p_use_as_row_header=>'N'
,p_heading_alignment=>'LEFT'
,p_disable_sort_column=>'N'
,p_lov_show_nulls=>'NO'
,p_lov_display_extra=>'YES'
,p_include_in_export=>'Y'
);
wwv_flow_api.create_report_columns(
p_id=>wwv_flow_api.id(8789917073866584113)
,p_query_column_id=>10
,p_column_alias=>'C003'
,p_column_display_sequence=>6
,p_column_heading=>'Manager'
,p_use_as_row_header=>'N'
,p_column_alignment=>'RIGHT'
,p_heading_alignment=>'RIGHT'
,p_disable_sort_column=>'N'
,p_lov_show_nulls=>'NO'
,p_lov_display_extra=>'YES'
,p_include_in_export=>'Y'
);
wwv_flow_api.create_report_columns(
p_id=>wwv_flow_api.id(8789917684623584113)
,p_query_column_id=>11
,p_column_alias=>'STATUS'
,p_column_display_sequence=>11
,p_column_heading=>'Status'
,p_use_as_row_header=>'N'
,p_heading_alignment=>'LEFT'
,p_disable_sort_column=>'N'
,p_display_as=>'TEXT_FROM_LOV_ESC'
,p_named_lov=>wwv_flow_api.id(1330719884636063179)
,p_lov_show_nulls=>'NO'
,p_lov_display_extra=>'NO'
,p_include_in_export=>'Y'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(1320262062513404081)
,p_plug_name=>'EMP Collection SQL Source'
,p_parent_plug_id=>wwv_flow_api.id(8867323199158898707)
,p_region_template_options=>'#DEFAULT#:is-collapsed:t-Region--noBorder:t-Region--scrollBody'
,p_region_attributes=>'style="margin-left: 8px;"'
,p_plug_template=>wwv_flow_api.id(1774855849259936482)
,p_plug_display_sequence=>10
,p_plug_display_point=>'BODY'
,p_plug_source_type=>'PLUGIN_COM.ORACLE.APEX.DISPLAY_SOURCE'
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_attribute_01=>'emp_collection'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(8867561809411547367)
,p_plug_name=>'About this page'
,p_plug_template=>wwv_flow_api.id(1774849216241936469)
,p_plug_display_sequence=>10
,p_plug_new_grid_column=>false
,p_plug_display_point=>'BODY'
,p_plug_source=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<p>This use case populates an Oracle Application Express (APEX) collection from a sample Employees table, the user updates the collection, and then synchroniz',
'es the data in the collection with the base table. To use this example, please follow the instructions below.</p>',
'<ol>',
'<li>Populate the collection from the EBA_DEMO_CS_EMP table',
'<li>Add, Delete, and Update members in the collection',
'<li>Synchronize the members of the collection with the EBA_DEMO_CS_EMP table by clicking the "Apply Collection" button',
'</ol>'))
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_plug_column_width=>'valign=top'
,p_attribute_01=>'N'
,p_attribute_02=>'HTML'
,p_attribute_03=>'N'
);
wwv_flow_api.create_page_button(
p_id=>wwv_flow_api.id(8867339210509922427)
,p_button_sequence=>10
,p_button_plug_id=>wwv_flow_api.id(8867323199158898707)
,p_button_name=>'Populate'
,p_button_action=>'SUBMIT'
,p_button_template_options=>'#DEFAULT#'
,p_button_template_id=>wwv_flow_api.id(1774883187200936581)
,p_button_image_alt=>'Populate Collection from EBA_DEMO_CS_EMP '
,p_button_position=>'REGION_TEMPLATE_EDIT'
);
wwv_flow_api.create_page_button(
p_id=>wwv_flow_api.id(8867458202330279669)
,p_button_sequence=>20
,p_button_plug_id=>wwv_flow_api.id(8867323199158898707)
,p_button_name=>'Add_Member'
,p_button_action=>'REDIRECT_PAGE'
,p_button_template_options=>'#DEFAULT#'
,p_button_template_id=>wwv_flow_api.id(1774883187200936581)
,p_button_image_alt=>'Add Member'
,p_button_position=>'REGION_TEMPLATE_EDIT'
,p_button_redirect_url=>'f?p=&APP_ID.:7:&SESSION.::&DEBUG.:RP,7::'
,p_button_condition=>'apex_collection.collection_exists(''EMPCOLLECTION'')'
,p_button_condition2=>'PLSQL'
,p_button_condition_type=>'EXPRESSION'
);
wwv_flow_api.create_page_button(
p_id=>wwv_flow_api.id(8867390012596998747)
,p_button_sequence=>30
,p_button_plug_id=>wwv_flow_api.id(8867323199158898707)
,p_button_name=>'Apply_Collection'
,p_button_action=>'SUBMIT'
,p_button_template_options=>'#DEFAULT#'
,p_button_template_id=>wwv_flow_api.id(1774883187200936581)
,p_button_image_alt=>'Apply Collection'
,p_button_position=>'REGION_TEMPLATE_EDIT'
,p_button_condition=>'apex_collection.collection_exists(''EMPCOLLECTION'')'
,p_button_condition2=>'PLSQL'
,p_button_condition_type=>'EXPRESSION'
);
wwv_flow_api.create_page_branch(
p_id=>wwv_flow_api.id(8867390395168998749)
,p_branch_name=>'Go To Page 6'
,p_branch_action=>'6'
,p_branch_point=>'AFTER_PROCESSING'
,p_branch_type=>'BRANCH_TO_STEP'
,p_branch_sequence=>10
);
wwv_flow_api.create_page_process(
p_id=>wwv_flow_api.id(8867343607316940563)
,p_process_sequence=>10
,p_process_point=>'AFTER_SUBMIT'
,p_process_type=>'NATIVE_PLSQL'
,p_process_name=>'Populate'
,p_process_sql_clob=>wwv_flow_string.join(wwv_flow_t_varchar2(
'declare',
' l_rowxml varchar2(4000);',
'begin',
'if apex_collection.collection_exists( ''EMPCollection'') = TRUE then',
' --',
' apex_collection.delete_collection(',
' p_collection_name => ''EMPCollection'' );',
'end if;',
'--',
'apex_collection.create_collection_from_query2(',
' p_collection_name => ''EMPCollection'',',
' p_query => ''select empno, sal, comm, deptno, null, hiredate, null, null, null, null, ename, job, mgr, ''''O'''' original_flag from eba_demo_cs_emp order by ename'',',
' p_generate_md5 => ''YES'');',
'--',
'for c1 in (select n001 empno, seq_id',
' from apex_collections',
' where collection_name = ''EMPCOLLECTION''',
' order by seq_id) loop',
' ',
' l_rowxml := dbms_xmlgen.getxml( ''select * from eba_demo_cs_emp where empno = '' || c1.empno );',
' apex_collection.update_member_attribute( ',
' p_collection_name => ''EMPCollection'',',
' p_seq => c1.seq_id,',
' p_xmltype_number => 1,',
' p_xmltype_value => XMLType(l_rowxml));',
'end loop;',
'--',
'commit;',
'end;'))
,p_process_clob_language=>'PLSQL'
,p_process_when_button_id=>wwv_flow_api.id(8867339210509922427)
);
wwv_flow_api.create_page_process(
p_id=>wwv_flow_api.id(8867535412695485016)
,p_process_sequence=>20
,p_process_point=>'AFTER_SUBMIT'
,p_process_type=>'NATIVE_PLSQL'
,p_process_name=>'Apply changes to EBA_DEMO_CS_EMP table'
,p_process_sql_clob=>wwv_flow_string.join(wwv_flow_t_varchar2(
'--',
'-- Loop through all the members of the collection. For those that are still',
'-- marked as Original, they have not changed, so no changes need to be applied.',
'-- For those marked as updated, deleted, or new, issue the appropriate DML',
'-- against the SCOTT.EMP table.',
'--',
'for c1 in (select c001, c002, c003, c004, d001, n001, n002, n003, n004',
' from apex_collections',
' where collection_name = ''EMPCOLLECTION'') loop',
' if c1.c004 = ''N'' then',
' insert into eba_demo_cs_emp (empno, ename, job, mgr, hiredate, sal, comm, deptno)',
' values (c1.n001, c1.c001, c1.c002, c1.c003, c1.d001, c1.n002, c1.n003, c1.n004 );',
'',
' elsif c1.c004 = ''U'' then',
' update eba_demo_cs_emp',
' set ename = c1.c001,',
' job = c1.c002,',
' mgr = c1.c003,',
' hiredate = c1.d001,',
' sal = c1.n002,',
' comm = c1.n003,',
' deptno = c1.n004',
' where empno = c1.n001;',
'',
' elsif c1.c004 = ''D'' then',
' delete from eba_demo_cs_emp',
' where empno = c1.n001;',
'',
' end if;',
'end loop;',
'--',
'-- Clear the contents of the collection',
'--',
'apex_collection.delete_collection( p_collection_name => ''EMPCOLLECTION'' );',
'--',
'commit;'))
,p_process_clob_language=>'PLSQL'
,p_process_error_message=>'Error applying changes to the database table.'
,p_process_when_button_id=>wwv_flow_api.id(8867390012596998747)
,p_process_success_message=>'Successfully applied changes to the database table.'
);
end;
/
prompt --application/pages/page_00007
begin
wwv_flow_api.create_page(
p_id=>7
,p_user_interface_id=>wwv_flow_api.id(1121389871104511367)
,p_name=>'Add/Edit Collection Member'
,p_alias=>'EDITEMP'
,p_page_mode=>'MODAL'
,p_step_title=>'Add/Edit Collection Member'
,p_reload_on_submit=>'A'
,p_warn_on_unsaved_changes=>'N'
,p_first_item=>'AUTO_FIRST_ITEM'
,p_autocomplete_on_off=>'OFF'
,p_step_template=>wwv_flow_api.id(1774846340824936463)
,p_page_template_options=>'#DEFAULT#'
,p_protection_level=>'C'
,p_read_only_when_type=>'VAL_OF_ITEM_IN_COND_EQ_COND2'
,p_read_only_when=>'P7_STATUS'
,p_read_only_when2=>'D'
,p_last_updated_by=>'ALLAN'
,p_last_upd_yyyymmddhh24miss=>'20210301103343'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(1713164909223995060)
,p_plug_name=>'Buttons'
,p_region_template_options=>'#DEFAULT#:t-ButtonRegion--noUI'
,p_plug_template=>wwv_flow_api.id(1774849395965936471)
,p_plug_display_sequence=>10
,p_include_in_reg_disp_sel_yn=>'Y'
,p_plug_display_point=>'REGION_POSITION_03'
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_attribute_01=>'N'
,p_attribute_02=>'HTML'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(8867408312283196535)
,p_plug_name=>'Collection Member'
,p_region_template_options=>'#DEFAULT#:t-Region--scrollBody:t-Region--hideHeader:t-Region--noBorder'
,p_plug_template=>wwv_flow_api.id(1774859855390936493)
,p_plug_display_sequence=>10
,p_plug_display_point=>'BODY'
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_attribute_01=>'N'
,p_attribute_02=>'HTML'
,p_attribute_03=>'N'
);
wwv_flow_api.create_page_button(
p_id=>wwv_flow_api.id(8867435609555253385)
,p_button_sequence=>30
,p_button_plug_id=>wwv_flow_api.id(1713164909223995060)
,p_button_name=>'Delete_Member'
,p_button_action=>'SUBMIT'
,p_button_template_options=>'#DEFAULT#:t-Button--simple:t-Button--danger'
,p_button_template_id=>wwv_flow_api.id(1774883187200936581)
,p_button_image_alt=>'Delete Member'
,p_button_position=>'REGION_TEMPLATE_NEXT'
,p_button_condition=>':P7_SEQ is not null and :P7_STATUS <> ''D'''
,p_button_condition2=>'PLSQL'
,p_button_condition_type=>'EXPRESSION'
);
wwv_flow_api.create_page_button(
p_id=>wwv_flow_api.id(8867437918905256071)
,p_button_sequence=>40
,p_button_plug_id=>wwv_flow_api.id(1713164909223995060)
,p_button_name=>'Update_Member'
,p_button_action=>'SUBMIT'
,p_button_template_options=>'#DEFAULT#'
,p_button_template_id=>wwv_flow_api.id(1774883187200936581)
,p_button_is_hot=>'Y'
,p_button_image_alt=>'Update Member'
,p_button_position=>'REGION_TEMPLATE_NEXT'
,p_button_condition=>':P7_SEQ is not null and :P7_STATUS <> ''D'''
,p_button_condition2=>'PLSQL'
,p_button_condition_type=>'EXPRESSION'
);
wwv_flow_api.create_page_button(
p_id=>wwv_flow_api.id(8867433301936251155)
,p_button_sequence=>50
,p_button_plug_id=>wwv_flow_api.id(1713164909223995060)
,p_button_name=>'Add_Member'
,p_button_action=>'SUBMIT'
,p_button_template_options=>'#DEFAULT#'
,p_button_template_id=>wwv_flow_api.id(1774883187200936581)
,p_button_is_hot=>'Y'
,p_button_image_alt=>'Add Member'
,p_button_position=>'REGION_TEMPLATE_NEXT'
,p_button_condition=>'P7_SEQ'
,p_button_condition_type=>'ITEM_IS_NULL'
);
wwv_flow_api.create_page_button(
p_id=>wwv_flow_api.id(8867440193064258044)
,p_button_sequence=>10
,p_button_plug_id=>wwv_flow_api.id(1713164909223995060)
,p_button_name=>'Cancel'
,p_button_action=>'DEFINED_BY_DA'
,p_button_template_options=>'#DEFAULT#'
,p_button_template_id=>wwv_flow_api.id(1774883187200936581)
,p_button_image_alt=>'Cancel'
,p_button_position=>'REGION_TEMPLATE_PREVIOUS'
);
wwv_flow_api.create_page_branch(
p_id=>wwv_flow_api.id(8867442608352259169)
,p_branch_action=>'6'
,p_branch_point=>'AFTER_PROCESSING'
,p_branch_type=>'BRANCH_TO_STEP'
,p_branch_sequence=>10
,p_branch_comment=>'Created 17-JUL-2002 14:16 by JOEL'
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8430619242248653179)
,p_name=>'P7_XMLTYPE'
,p_item_sequence=>110
,p_item_plug_id=>wwv_flow_api.id(8867408312283196535)
,p_prompt=>'XMLType'
,p_display_as=>'NATIVE_TEXTAREA'
,p_cSize=>80
,p_cMaxlength=>4000
,p_cHeight=>15
,p_display_when=>'P7_SEQ'
,p_display_when_type=>'ITEM_IS_NOT_NULL'
,p_field_template=>wwv_flow_api.id(1774882318212936569)
,p_item_template_options=>'#DEFAULT#'
,p_protection_level=>'S'
,p_help_text=>'The XMLType field in this application is only used for demonstration purposes. The value of this field is computed using the PL/SQL API DBMS_XMLGEN.'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_01=>'Y'
,p_attribute_02=>'N'
,p_attribute_03=>'N'
,p_attribute_04=>'NONE'
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8867411597402203411)
,p_name=>'P7_EMPNO'
,p_item_sequence=>30
,p_item_plug_id=>wwv_flow_api.id(8867408312283196535)
,p_prompt=>'Emp No'
,p_display_as=>'NATIVE_NUMBER_FIELD'
,p_cSize=>64
,p_cMaxlength=>2000
,p_display_when=>'P7_EMPNO'
,p_display_when_type=>'ITEM_IS_NULL'
,p_field_template=>wwv_flow_api.id(1774882198755936568)
,p_item_template_options=>'#DEFAULT#'
,p_protection_level=>'S'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_03=>'right'
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8867413890286206772)
,p_name=>'P7_ENAME'
,p_item_sequence=>40
,p_item_plug_id=>wwv_flow_api.id(8867408312283196535)
,p_prompt=>'Employee Name'
,p_display_as=>'NATIVE_TEXT_FIELD'
,p_cSize=>64
,p_cMaxlength=>2000
,p_field_template=>wwv_flow_api.id(1774882198755936568)
,p_item_template_options=>'#DEFAULT#'
,p_protection_level=>'S'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_01=>'N'
,p_attribute_02=>'N'
,p_attribute_04=>'TEXT'
,p_attribute_05=>'BOTH'
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8867416718093209013)
,p_name=>'P7_JOB'
,p_item_sequence=>50
,p_item_plug_id=>wwv_flow_api.id(8867408312283196535)
,p_prompt=>'Job'
,p_display_as=>'NATIVE_SELECT_LIST'
,p_named_lov=>'JOB LOV'
,p_lov=>wwv_flow_string.join(wwv_flow_t_varchar2(
'select distinct job d, job r',
' from eba_demo_cs_emp',
' order by 1'))
,p_cHeight=>1
,p_field_template=>wwv_flow_api.id(1774882198755936568)
,p_item_template_options=>'#DEFAULT#'
,p_lov_display_extra=>'YES'
,p_protection_level=>'S'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_01=>'NONE'
,p_attribute_02=>'N'
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8867419015074210461)
,p_name=>'P7_MGR'
,p_item_sequence=>60
,p_item_plug_id=>wwv_flow_api.id(8867408312283196535)
,p_prompt=>'Manager'
,p_display_as=>'NATIVE_SELECT_LIST'
,p_lov=>wwv_flow_string.join(wwv_flow_t_varchar2(
'select ename d, empno r',
' from eba_demo_cs_emp',
' where (:P7_EMPNO is null or empno <> :P7_EMPNO)',
' order by 1 asc;'))
,p_cHeight=>1
,p_field_template=>wwv_flow_api.id(1774882198755936568)
,p_item_template_options=>'#DEFAULT#'
,p_lov_display_extra=>'YES'
,p_protection_level=>'S'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_01=>'NONE'
,p_attribute_02=>'N'
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8867421311408212189)
,p_name=>'P7_HIREDATE'
,p_item_sequence=>70
,p_item_plug_id=>wwv_flow_api.id(8867408312283196535)
,p_prompt=>'Hire Date'
,p_display_as=>'NATIVE_DATE_PICKER'
,p_cSize=>64
,p_cMaxlength=>2000
,p_field_template=>wwv_flow_api.id(1774882198755936568)
,p_item_template_options=>'#DEFAULT#'
,p_protection_level=>'S'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_04=>'button'
,p_attribute_05=>'N'
,p_attribute_07=>'NONE'
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8867423603213215944)
,p_name=>'P7_SAL'
,p_item_sequence=>80
,p_item_plug_id=>wwv_flow_api.id(8867408312283196535)
,p_prompt=>'Salary'
,p_display_as=>'NATIVE_NUMBER_FIELD'
,p_cSize=>64
,p_cMaxlength=>2000
,p_field_template=>wwv_flow_api.id(1774882198755936568)
,p_item_template_options=>'#DEFAULT#'
,p_protection_level=>'S'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_03=>'right'
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8867426390908236878)
,p_name=>'P7_COMM'
,p_item_sequence=>90
,p_item_plug_id=>wwv_flow_api.id(8867408312283196535)
,p_prompt=>'Commission'
,p_display_as=>'NATIVE_NUMBER_FIELD'
,p_cSize=>64
,p_cMaxlength=>2000
,p_field_template=>wwv_flow_api.id(1774882198755936568)
,p_item_template_options=>'#DEFAULT#'
,p_protection_level=>'S'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_03=>'right'
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8867428718069239417)
,p_name=>'P7_DEPTNO'
,p_item_sequence=>100
,p_item_plug_id=>wwv_flow_api.id(8867408312283196535)
,p_prompt=>'Dept No'
,p_display_as=>'NATIVE_SELECT_LIST'
,p_named_lov=>'DEPTNO LOV'
,p_lov=>wwv_flow_string.join(wwv_flow_t_varchar2(
'select distinct deptno d, deptno r',
' from eba_demo_cs_emp',
' order by 1'))
,p_cHeight=>1
,p_field_template=>wwv_flow_api.id(1774882198755936568)
,p_item_template_options=>'#DEFAULT#'
,p_lov_display_extra=>'YES'
,p_protection_level=>'S'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_01=>'NONE'
,p_attribute_02=>'N'
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8867444901666262286)
,p_name=>'P7_SEQ'
,p_item_sequence=>20
,p_item_plug_id=>wwv_flow_api.id(8867408312283196535)
,p_display_as=>'NATIVE_HIDDEN'
,p_protection_level=>'S'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_01=>'Y'
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8867488218401360866)
,p_name=>'P7_STATUS'
,p_item_sequence=>10
,p_item_plug_id=>wwv_flow_api.id(8867408312283196535)
,p_prompt=>'Status'
,p_display_as=>'NATIVE_DISPLAY_ONLY'
,p_named_lov=>'STATUS LOV'
,p_lov=>'.'||wwv_flow_api.id(1330719884636063179)||'.'
,p_field_template=>wwv_flow_api.id(1774882198755936568)
,p_item_template_options=>'#DEFAULT#'
,p_lov_display_extra=>'NO'
,p_protection_level=>'S'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_01=>'N'
,p_attribute_02=>'LOV'
,p_attribute_04=>'Y'
,p_attribute_05=>'PLAIN'
);
wwv_flow_api.create_page_da_event(
p_id=>wwv_flow_api.id(229026284416043467)
,p_name=>'Cancel Modal'
,p_event_sequence=>10
,p_triggering_element_type=>'BUTTON'
,p_triggering_button_id=>wwv_flow_api.id(8867440193064258044)
,p_bind_type=>'bind'
,p_bind_event_type=>'click'
);
wwv_flow_api.create_page_da_action(
p_id=>wwv_flow_api.id(229026402308043468)
,p_event_id=>wwv_flow_api.id(229026284416043467)
,p_event_result=>'TRUE'
,p_action_sequence=>10
,p_execute_on_page_init=>'N'
,p_action=>'NATIVE_DIALOG_CANCEL'
);
wwv_flow_api.create_page_process(
p_id=>wwv_flow_api.id(8867485391025358397)
,p_process_sequence=>10
,p_process_point=>'AFTER_HEADER'
,p_process_type=>'NATIVE_PLSQL'
,p_process_name=>'Populate Form with Member Attributes'
,p_process_sql_clob=>wwv_flow_string.join(wwv_flow_t_varchar2(
'for c1 in (select c001, c002, c003, c004, d001, n001, n002, n003, n004, xmltype001',
' from apex_collections',
' where collection_name = ''EMPCOLLECTION''',
' and seq_id = :P7_SEQ) loop',
' --',
' :P7_EMPNO := c1.n001;',
' :P7_ENAME := c1.c001;',
' :P7_JOB := c1.c002;',
' :P7_MGR := c1.c003;',
' :P7_HIREDATE := c1.d001;',
' :P7_SAL := c1.n002;',
' :P7_COMM := c1.n003;',
' :P7_DEPTNO := c1.n004;',
' :P7_STATUS := c1.c004;',
' if c1.xmltype001 is not null then',
' :P7_XMLTYPE := xmltype.extract(c1.xmltype001,''/*'').getstringval();',
' end if;',
' --',
'end loop;'))
,p_process_clob_language=>'PLSQL'
,p_process_when=>'P7_SEQ'
,p_process_when_type=>'ITEM_IS_NOT_NULL'
);
wwv_flow_api.create_page_process(
p_id=>wwv_flow_api.id(8867473614988316822)
,p_process_sequence=>20
,p_process_point=>'AFTER_SUBMIT'
,p_process_type=>'NATIVE_PLSQL'
,p_process_name=>'Add Member'
,p_process_sql_clob=>wwv_flow_string.join(wwv_flow_t_varchar2(
'declare',
' l_xmltype xmltype;',
'begin',
'if :P7_XMLTYPE is not null then',
' l_xmltype := xmltype( :P7_XMLTYPE );',
'end if;',
'',
'apex_collection.add_member(',
' p_collection_name => ''EMPCOLLECTION'',',
' p_n001 => :P7_EMPNO,',
' p_n002 => :P7_SAL,',
' p_n003 => :P7_COMM,',
' p_n004 => :P7_DEPTNO,',
' p_c001 => :P7_ENAME,',
' p_c002 => :P7_JOB,',
' p_c003 => :P7_MGR,',
' p_d001 => :P7_HIREDATE,',
' p_c004 => ''N'',',
' p_xmltype001 => l_xmltype,',
' p_generate_md5 => ''YES'' );',
'--',
'commit;',
'end;'))
,p_process_clob_language=>'PLSQL'
,p_process_error_message=>'Error adding new member to EMP collection.'
,p_process_when_button_id=>wwv_flow_api.id(8867433301936251155)
,p_process_success_message=>'Successfully added new member to EMP collection.'
);
wwv_flow_api.create_page_process(
p_id=>wwv_flow_api.id(8867503301999383607)
,p_process_sequence=>30
,p_process_point=>'AFTER_SUBMIT'
,p_process_type=>'NATIVE_PLSQL'
,p_process_name=>'Delete Member'
,p_process_sql_clob=>wwv_flow_string.join(wwv_flow_t_varchar2(
'--',
'-- If the member of the collection is ''New'', then we don''t',
'-- need to mark it for deletion, we can physically remove it',
'-- from the collection. Otherwise, mark it for deletion so',
'-- it will be eventually physically removed from the EMP table',
'-- when applied',
'--',
'if :P7_STATUS = ''N'' then',
' apex_collection.delete_member(',
' p_collection_name => ''EMPCOLLECTION'',',
' p_seq => :P7_SEQ );',
'else',
' apex_collection.update_member_attribute(',
' p_collection_name => ''EMPCOLLECTION'',',
' p_seq => :P7_SEQ,',
' p_attr_number => 4,',
' p_attr_value => ''D'' );',
'end if;',
'--',
'commit;'))
,p_process_clob_language=>'PLSQL'
,p_process_error_message=>wwv_flow_string.join(wwv_flow_t_varchar2(
'Error deleting collection member.',
'',
''))
,p_process_when_button_id=>wwv_flow_api.id(8867435609555253385)
,p_process_success_message=>'Succesfully deleted collection member.'
);
wwv_flow_api.create_page_process(
p_id=>wwv_flow_api.id(8867516314254423533)
,p_process_sequence=>40
,p_process_point=>'AFTER_SUBMIT'
,p_process_type=>'NATIVE_PLSQL'
,p_process_name=>'Update Member'
,p_process_sql_clob=>wwv_flow_string.join(wwv_flow_t_varchar2(
'declare',
' l_status varchar2(10);',
' l_xmltype xmltype;',
'begin',
' --',
' -- If the member of the collection is marked as ''New'', then',
' -- leave it marked as ''New'', otherwise mark as updated so',
' -- it will eventually be updated to the EMP database table.',
' --',
' if :P7_STATUS = ''N'' then',
' l_status := ''N'';',
' else',
' l_status := ''U'';',
' end if;',
' --',
' if :P7_XMLTYPE is not null then',
' l_xmltype := xmltype( :P7_XMLTYPE );',
' end if;',
' --',
' apex_collection.update_member(',
' p_collection_name => ''EMPCOLLECTION'',',
' p_seq => :P7_SEQ,',
' p_n001 => :P7_EMPNO,',
' p_n002 => :P7_SAL,',
' p_n003 => :P7_COMM,',
' p_n004 => :P7_DEPTNO,',
' p_c001 => :P7_ENAME,',
' p_c002 => :P7_JOB,',
' p_c003 => :P7_MGR,',
' p_d001 => :P7_HIREDATE,',
' p_c004 => l_status,',
' p_xmltype001 => l_xmltype );',
' --',
' commit;',
'end;'))
,p_process_clob_language=>'PLSQL'
,p_process_error_message=>'Error updating collection member.'
,p_process_when_button_id=>wwv_flow_api.id(8867437918905256071)
,p_process_success_message=>'Succesfully updated collection member.'
);
wwv_flow_api.create_page_process(
p_id=>wwv_flow_api.id(8867464011562288027)
,p_process_sequence=>50
,p_process_point=>'AFTER_SUBMIT'
,p_process_type=>'NATIVE_SESSION_STATE'
,p_process_name=>'Clear Cache'
,p_attribute_01=>'CLEAR_CACHE_CURRENT_PAGE'
);
end;
/
prompt --application/pages/page_00008
begin
wwv_flow_api.create_page(
p_id=>8
,p_user_interface_id=>wwv_flow_api.id(1121389871104511367)
,p_name=>'Help'
,p_alias=>'HELP'
,p_step_title=>'Help'
,p_reload_on_submit=>'A'
,p_warn_on_unsaved_changes=>'N'
,p_autocomplete_on_off=>'ON'
,p_html_page_header=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<style>',
'div.helpContainer{width:960px;margin:16px auto;zoom:1}',
'div.helpContainer:before,div.helpContainer:after{content:"\0020";display:block;height:0;overflow:hidden}',
'div.helpContainer:after{clear:both}',
'div.helpContainer div.helpSide{float:left;width:300px}',
'div.helpContainer div.helpSide h1.appNameHeader{position:relative;font:bold 22px/36px Arial,sans-serif;color:#404040;padding:0;margin:0}',
'div.helpContainer div.helpSide h1.appNameHeader img{display:block;position:absolute;left:0;top:0}',
'div.helpContainer div.helpMain{float:right;border-left:1px solid #EEE;width:632px;padding-left:16px}',
'div.helpContainer div.helpMain h2{font:bold 20px/32px Arial,sans-serif;color:#404040;margin:0 0 8px 0}',
'div.helpContainer div.helpMain h3{font:bold 16px/24px Arial,sans-serif;color:#404040;margin:0 0 8px 0}',
'div.helpContainer div.helpMain h4{font:bold 12px/16px Arial,sans-serif;color:#404040;margin:0 0 8px 0}',
'div.helpContainer div.helpMain p{font:normal 12px/16px Arial,sans-serif;color:#404040;margin:0 0 8px 0}',
'div.helpContainer div.helpMain ul{list-style:outside disc;margin:0 0 0 24px}',
'div.helpContainer div.helpMain ul li{font:normal 12px/20px Arial,sans-serif;color:#404040}',
'div.helpContainer div.helpMain .aboutApp,div.helpContainer div.helpMain .textRegion{border-bottom:1px solid #EEE;padding-bottom:16px;margin-bottom:16px}',
'</style>'))
,p_step_template=>wwv_flow_api.id(1774844326834936459)
,p_page_template_options=>'#DEFAULT#'
,p_protection_level=>'C'
,p_last_updated_by=>'ALLAN'
,p_last_upd_yyyymmddhh24miss=>'20210301103343'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(2049238948237568250)
,p_plug_name=>'Help Container'
,p_region_template_options=>'#DEFAULT#:t-Region--removeHeader js-removeLandmark:t-Region--scrollBody'
,p_plug_template=>wwv_flow_api.id(1774859855390936493)
,p_plug_display_sequence=>10
,p_include_in_reg_disp_sel_yn=>'Y'
,p_plug_display_point=>'BODY'
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_attribute_01=>'N'
,p_attribute_02=>'HTML'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(3314137783788812516)
,p_plug_name=>'Quick Start'
,p_parent_plug_id=>wwv_flow_api.id(2049238948237568250)
,p_region_template_options=>'#DEFAULT#'
,p_plug_template=>wwv_flow_api.id(1774849216241936469)
,p_plug_display_sequence=>20
,p_plug_new_grid_row=>false
,p_plug_new_grid_column=>false
,p_plug_display_point=>'BODY'
,p_plug_source=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<H2>Getting Started</h2>',
'<p>Run the application as a developer; at the bottom of the page will be buttons for viewing the page in the Application Express Application Builder. Click on the "Edit Page X" button to see how the pages are defined.</p>',
'<p>If you have questions, ask them on the <a href="https://forums.oracle.com/forums/forum.jspa?forumID=137">OTN Forum</a>.</p>'))
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_attribute_01=>'N'
,p_attribute_02=>'HTML'
,p_attribute_03=>'N'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(3314137980656812517)
,p_plug_name=>'Features'
,p_parent_plug_id=>wwv_flow_api.id(2049238948237568250)
,p_region_template_options=>'#DEFAULT#'
,p_plug_template=>wwv_flow_api.id(1774849216241936469)
,p_plug_display_sequence=>30
,p_plug_new_grid_row=>false
,p_plug_new_grid_column=>false
,p_plug_display_point=>'BODY'
,p_plug_source=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<h2>Features</h2>',
'<p>',
' <ul>',
' <li>Custom Collections</li>',
' <ul>',
' <li>Character data-type collection elements</li>',
' <li>Numeric data-type collection elements</li>',
' <li>Date data-type collection elements</li>',
' </ul>',
' <li>Table-Derived Collections</li>',
' <ul>',
' <li>Synchronizing collection data with application table data</li>',
' <li>XML ROWSET data display</li>',
' </ul>',
' </ul>',
'</p>'))
,p_plug_query_headings_type=>'QUERY_COLUMNS'
,p_plug_query_num_rows=>15
,p_plug_query_num_rows_type=>'NEXT_PREVIOUS_LINKS'
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_plug_query_show_nulls_as=>' - '
,p_pagination_display_position=>'BOTTOM_RIGHT'
,p_attribute_01=>'N'
,p_attribute_02=>'HTML'
,p_attribute_03=>'N'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(3314138183846812517)
,p_plug_name=>'About this Application'
,p_parent_plug_id=>wwv_flow_api.id(2049238948237568250)
,p_region_template_options=>'#DEFAULT#'
,p_plug_template=>wwv_flow_api.id(1774849216241936469)
,p_plug_display_sequence=>10
,p_plug_new_grid_row=>false
,p_plug_display_point=>'BODY'
,p_plug_source=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<h2>About this Application</h2>',
'',
'<p>This example application demonstrates the use of the Collections API, and how it can easily be employed in your applications.</p>',
'',
'<p>The first tab, Basic Collections, provides a simple interface to see collections in action, to easily create and delete collections, as well as add members, modify members, and remove members from the collection. This example application also show'
||'s the MD5 message digest computed automatically each time a new member is added to a collection. This provides a convenient mechanism to determine if any attributes of a collection member have changed.</p>',
'',
'<p>The second tab, Data Synchronization, shows a complete example using collections to maintain values in session state for many rows of data. This example also demonstrates a method to synchronize information contained in the collection with the EMP'
||' database table. This example uses an additional, non-user editable collection member attribute to track the status of a particular row in the collection. The XMLType001 column of the collection is populated with the XML ROWSET representation of the '
||'row, but it is only used for demonstration purposes and is not involved in the synchronization of the collection to the EMP table.</p>',
'',
'<p>In the Data Synchronization example, you should first populate the named collection from the EMP table by clicking the "Populate Collection from EMP" button. Then, you can add new members, update members, and delete members in this collection. Mod'
||'ifications will happen exclusively to the members in the collection. By clicking the "Apply Collection" button, you are then instructing the application to process each row in the EMP collection, issuing the correct INSERT, UPDATE or DELETE statement'
||'s against the EMP table.</p>'))
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_attribute_01=>'N'
,p_attribute_02=>'HTML'
,p_attribute_03=>'N'
);
wwv_flow_api.create_report_region(
p_id=>wwv_flow_api.id(2049239004355568251)
,p_name=>'&APP_NAME.'
,p_template=>wwv_flow_api.id(1774855340336936480)
,p_display_sequence=>20
,p_include_in_reg_disp_sel_yn=>'Y'
,p_region_css_classes=>'t-HeroRegion--featured'
,p_icon_css_classes=>'app-sample-collections'
,p_region_template_options=>'#DEFAULT#'
,p_component_template_options=>'#DEFAULT#:t-AVPList--rightAligned'
,p_new_grid_row=>false
,p_grid_column_span=>4
,p_display_point=>'BODY'
,p_source_type=>'NATIVE_SQL_REPORT'
,p_query_type=>'SQL'
,p_source=>wwv_flow_string.join(wwv_flow_t_varchar2(
'select aa.version app_version,',
' to_char(aa.pages,''999G999G990'') pages,',
' ''Oracle'' vendor',
'from apex_applications aa',
'where aa.application_id = :APP_ID'))
,p_ajax_enabled=>'Y'
,p_lazy_loading=>false
,p_query_row_template=>wwv_flow_api.id(1774871265928936531)
,p_query_num_rows=>15
,p_query_options=>'DERIVED_REPORT_COLUMNS'
,p_query_show_nulls_as=>'-'
,p_csv_output=>'N'
,p_prn_output=>'N'
,p_sort_null=>'L'
,p_plug_query_strip_html=>'N'
);
wwv_flow_api.create_report_columns(
p_id=>wwv_flow_api.id(2049239112720568252)
,p_query_column_id=>1
,p_column_alias=>'APP_VERSION'
,p_column_display_sequence=>1
,p_column_heading=>'App version'
,p_use_as_row_header=>'N'
,p_heading_alignment=>'LEFT'
,p_disable_sort_column=>'N'
,p_derived_column=>'N'
,p_include_in_export=>'Y'
);
wwv_flow_api.create_report_columns(
p_id=>wwv_flow_api.id(2049239260415568253)
,p_query_column_id=>2
,p_column_alias=>'PAGES'
,p_column_display_sequence=>2
,p_column_heading=>'Pages'
,p_use_as_row_header=>'N'
,p_heading_alignment=>'LEFT'
,p_disable_sort_column=>'N'
,p_derived_column=>'N'
,p_include_in_export=>'Y'
);
wwv_flow_api.create_report_columns(
p_id=>wwv_flow_api.id(2049239360285568254)
,p_query_column_id=>3
,p_column_alias=>'VENDOR'
,p_column_display_sequence=>3
,p_column_heading=>'Vendor'
,p_use_as_row_header=>'N'
,p_heading_alignment=>'LEFT'
,p_disable_sort_column=>'N'
,p_derived_column=>'N'
,p_include_in_export=>'Y'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(3314137157499812509)
,p_plug_name=>'Help'
,p_region_template_options=>'#DEFAULT#:t-BreadcrumbRegion--useBreadcrumbTitle'
,p_component_template_options=>'#DEFAULT#'
,p_plug_template=>wwv_flow_api.id(1774862430658936498)
,p_plug_display_sequence=>1
,p_plug_display_point=>'REGION_POSITION_01'
,p_menu_id=>wwv_flow_api.id(1318675881153380306)
,p_plug_source_type=>'NATIVE_BREADCRUMB'
,p_menu_template_id=>wwv_flow_api.id(1774883299498936583)
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_plug_display_condition_type=>'NEVER'
);
end;
/
prompt --application/pages/page_00012
begin
wwv_flow_api.create_page(
p_id=>12
,p_user_interface_id=>wwv_flow_api.id(1121389871104511367)
,p_tab_set=>'TS1'
,p_name=>'Sample Collections - API Examples'
,p_alias=>'SAMPLE-COLLECTIONS-API-EXAMPLES'
,p_step_title=>'Sample Collections - API Syntax'
,p_reload_on_submit=>'A'
,p_warn_on_unsaved_changes=>'N'
,p_autocomplete_on_off=>'ON'
,p_step_template=>wwv_flow_api.id(1774844326834936459)
,p_page_template_options=>'#DEFAULT#'
,p_nav_list_template_options=>'#DEFAULT#'
,p_help_text=>'No help is available for this page.'
,p_last_updated_by=>'ALLAN'
,p_last_upd_yyyymmddhh24miss=>'20210301103343'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(1299653654729546636)
,p_plug_name=>'apex_collection.create_or_truncate_collection'
,p_plug_template=>wwv_flow_api.id(1774859855390936493)
,p_plug_display_sequence=>20
,p_plug_new_grid_column=>false
,p_plug_display_point=>'BODY'
,p_plug_source=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<pre>apex_collection.create_or_truncate_collection( p_collection_name => :P2_NAME );',
'commit;</pre>'))
,p_plug_query_headings_type=>'QUERY_COLUMNS'
,p_plug_query_num_rows=>15
,p_plug_query_num_rows_type=>'NEXT_PREVIOUS_LINKS'
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_plug_query_show_nulls_as=>' - '
,p_pagination_display_position=>'BOTTOM_RIGHT'
,p_attribute_01=>'N'
,p_attribute_02=>'HTML'
,p_attribute_03=>'N'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(1299654061318624260)
,p_plug_name=>'apex_collection.add_member'
,p_plug_template=>wwv_flow_api.id(1774859855390936493)
,p_plug_display_sequence=>30
,p_plug_display_point=>'BODY'
,p_plug_source=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<pre>',
'--',
'-- This application uses the Application Level Date format to control the default date format for the application.',
'-- Without this, then you would need to specify explict date format masks in the TO_DATE conversions.',
'--',
'apex_collection.add_member(',
' p_collection_name => :P3_NAME,',
' p_c001 => :P3_ATTR1,',
' p_c002 => :P3_ATTR2,',
' p_c003 => :P3_ATTR3,',
' p_c004 => :P3_ATTR4,',
' p_c005 => :P3_ATTR5,',
' p_n001 => :P3_NUM_ATTR1,',
' p_n002 => :P3_NUM_ATTR2,',
' p_n003 => :P3_NUM_ATTR3,',
' p_d001 => to_date(:P3_DATE_ATTR1),',
' p_d002 => to_date(:P3_DATE_ATTR2),',
' p_d003 => to_date(:P3_DATE_ATTR3),',
' p_generate_md5 => ''YES'' );',
'commit;',
'</pre>'))
,p_plug_query_headings_type=>'QUERY_COLUMNS'
,p_plug_query_num_rows_type=>'NEXT_PREVIOUS_LINKS'
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_plug_query_show_nulls_as=>' - '
,p_pagination_display_position=>'BOTTOM_RIGHT'
,p_attribute_01=>'N'
,p_attribute_02=>'HTML'
,p_attribute_03=>'N'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(1299654458332632867)
,p_plug_name=>'apex_collection.resequence_collection'
,p_plug_template=>wwv_flow_api.id(1774859855390936493)
,p_plug_display_sequence=>40
,p_plug_new_grid_column=>false
,p_plug_display_point=>'BODY'
,p_plug_source=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<pre>apex_collection.resequence_collection(',
' p_collection_name => :P3_NAME );',
'commit;',
'</pre>'))
,p_plug_query_headings_type=>'QUERY_COLUMNS'
,p_plug_query_num_rows=>15
,p_plug_query_num_rows_type=>'NEXT_PREVIOUS_LINKS'
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_plug_query_show_nulls_as=>' - '
,p_pagination_display_position=>'BOTTOM_RIGHT'
,p_attribute_01=>'N'
,p_attribute_02=>'HTML'
,p_attribute_03=>'N'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(1299654782227639702)
,p_plug_name=>'apex_collection.delete_collection'
,p_plug_template=>wwv_flow_api.id(1774859855390936493)
,p_plug_display_sequence=>50
,p_plug_new_grid_column=>false
,p_plug_display_point=>'BODY'
,p_plug_source=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<pre>apex_collection.delete_collection(',
' p_collection_name => :P3_NAME );',
'--',
'commit;',
'</pre>'))
,p_plug_query_headings_type=>'QUERY_COLUMNS'
,p_plug_query_num_rows=>15
,p_plug_query_num_rows_type=>'NEXT_PREVIOUS_LINKS'
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_plug_query_show_nulls_as=>' - '
,p_pagination_display_position=>'BOTTOM_RIGHT'
,p_attribute_01=>'N'
,p_attribute_02=>'HTML'
,p_attribute_03=>'N'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(1299655264004643973)
,p_plug_name=>'About this page'
,p_region_template_options=>'#DEFAULT#'
,p_plug_template=>wwv_flow_api.id(1774849216241936469)
,p_plug_display_sequence=>10
,p_plug_new_grid_column=>false
,p_plug_display_point=>'BODY'
,p_plug_source=>'<p>This page lists some of the PL/SQL page processes used in this demonstration application.</p>'
,p_plug_query_headings_type=>'QUERY_COLUMNS'
,p_plug_query_num_rows=>15
,p_plug_query_num_rows_type=>'NEXT_PREVIOUS_LINKS'
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_plug_query_show_nulls_as=>' - '
,p_pagination_display_position=>'BOTTOM_RIGHT'
,p_attribute_01=>'N'
,p_attribute_02=>'HTML'
,p_attribute_03=>'N'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(1299656971754655691)
,p_plug_name=>'apex_collection.truncate_collection'
,p_plug_template=>wwv_flow_api.id(1774859855390936493)
,p_plug_display_sequence=>60
,p_plug_new_grid_column=>false
,p_plug_display_point=>'BODY'
,p_plug_source=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<pre>apex_collection.truncate_collection (',
' p_collection_name => :P3_NAME );',
'--',
'commit;',
'</pre>'))
,p_plug_query_headings_type=>'QUERY_COLUMNS'
,p_plug_query_num_rows=>15
,p_plug_query_num_rows_type=>'NEXT_PREVIOUS_LINKS'
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_plug_query_show_nulls_as=>' - '
,p_pagination_display_position=>'BOTTOM_RIGHT'
,p_attribute_01=>'N'
,p_attribute_02=>'HTML'
,p_attribute_03=>'N'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(1299657968252701919)
,p_plug_name=>'apex_collections'
,p_plug_template=>wwv_flow_api.id(1774859855390936493)
,p_plug_display_sequence=>70
,p_plug_new_grid_column=>false
,p_plug_display_point=>'BODY'
,p_plug_source=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<pre>select seq_id editlink,',
' seq_id, ',
' n001, ',
' n002, ',
' n003, ',
' n004, ',
' d001, ',
' c001, ',
' c002, ',
' c003, ',
' c004 status',
'from apex_collections',
'where collection_name = ''EMPCOLLECTION''',
'</pre>'))
,p_plug_query_headings_type=>'QUERY_COLUMNS'
,p_plug_query_num_rows=>15
,p_plug_query_num_rows_type=>'NEXT_PREVIOUS_LINKS'
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_plug_query_show_nulls_as=>' - '
,p_pagination_display_position=>'BOTTOM_RIGHT'
,p_attribute_01=>'N'
,p_attribute_02=>'HTML'
,p_attribute_03=>'N'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(1318679280376398958)
,p_plug_name=>'Breadcrumb'
,p_region_template_options=>'#DEFAULT#:t-BreadcrumbRegion--useBreadcrumbTitle'
,p_component_template_options=>'#DEFAULT#'
,p_plug_template=>wwv_flow_api.id(1774862430658936498)
,p_plug_display_sequence=>10
,p_plug_display_point=>'REGION_POSITION_01'
,p_menu_id=>wwv_flow_api.id(1318675881153380306)
,p_plug_source_type=>'NATIVE_BREADCRUMB'
,p_menu_template_id=>wwv_flow_api.id(1774883299498936583)
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(1330859070390380808)
,p_plug_name=>'apex_collection.create_collection_from_query2'
,p_plug_template=>wwv_flow_api.id(1774859855390936493)
,p_plug_display_sequence=>80
,p_plug_new_grid_column=>false
,p_plug_display_point=>'BODY'
,p_plug_source=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<pre>apex_collection.create_collection_from_query2(',
' p_collection_name => ''EMPCollection'',',
' p_query => ''select empno, sal, comm, deptno, null, hiredate, null, null, null, null, ename, job, mgr, ''''O'''' original_flag from eba_demo_cs_emp order by ename'',',
' p_generate_md5 => ''YES'');',
'</pre>'))
,p_plug_query_headings_type=>'QUERY_COLUMNS'
,p_plug_query_num_rows=>15
,p_plug_query_num_rows_type=>'NEXT_PREVIOUS_LINKS'
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_plug_query_show_nulls_as=>' - '
,p_pagination_display_position=>'BOTTOM_RIGHT'
,p_attribute_01=>'N'
,p_attribute_02=>'HTML'
,p_attribute_03=>'N'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(1330859360478387467)
,p_plug_name=>'apex_collection.update_member_attribute'
,p_plug_template=>wwv_flow_api.id(1774859855390936493)
,p_plug_display_sequence=>90
,p_plug_new_grid_column=>false
,p_plug_display_point=>'BODY'
,p_plug_source=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<pre>',
'for c1 in (select n001 empno, seq_id',
' from apex_collections',
' where collection_name = ''EMPCOLLECTION''',
' order by seq_id) loop',
' ',
' l_rowxml := dbms_xmlgen.getxml( ''select * from eba_demo_cs_emp where empno = '' || c1.empno );',
' apex_collection.update_member_attribute( ',
' p_collection_name => ''EMPCollection'',',
' p_seq => c1.seq_id,',
' p_xmltype_number => 1,',
' p_xmltype_value => XMLType(l_rowxml));',
'end loop;',
'</pre>'))
,p_plug_query_headings_type=>'QUERY_COLUMNS'
,p_plug_query_num_rows=>15
,p_plug_query_num_rows_type=>'NEXT_PREVIOUS_LINKS'
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_plug_query_show_nulls_as=>' - '
,p_pagination_display_position=>'BOTTOM_RIGHT'
,p_attribute_01=>'N'
,p_attribute_02=>'HTML'
,p_attribute_03=>'N'
);
end;
/
prompt --application/pages/page_00035
begin
wwv_flow_api.create_page(
p_id=>35
,p_user_interface_id=>wwv_flow_api.id(1121389871104511367)
,p_tab_set=>'TS1'
,p_name=>'Administration'
,p_alias=>'SETTINGS'
,p_step_title=>'Administration'
,p_reload_on_submit=>'A'
,p_warn_on_unsaved_changes=>'N'
,p_autocomplete_on_off=>'ON'
,p_step_template=>wwv_flow_api.id(1774844326834936459)
,p_page_template_options=>'#DEFAULT#'
,p_nav_list_template_options=>'#DEFAULT#'
,p_help_text=>'No help is available for this page.'
,p_last_updated_by=>'ALLAN'
,p_last_upd_yyyymmddhh24miss=>'20210301103343'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(1318662282993158843)
,p_plug_name=>'Administration'
,p_region_template_options=>'#DEFAULT#:t-Region--noPadding:t-Region--scrollBody:t-Region--hideHeader'
,p_component_template_options=>'#DEFAULT#'
,p_plug_template=>wwv_flow_api.id(1774859855390936493)
,p_plug_display_sequence=>10
,p_plug_new_grid_column=>false
,p_plug_display_point=>'BODY'
,p_list_id=>wwv_flow_api.id(1318661468097158837)
,p_plug_source_type=>'NATIVE_LIST'
,p_list_template_id=>wwv_flow_api.id(1774878219827936547)
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(1318681970595415082)
,p_plug_name=>'Breadcrumb'
,p_region_template_options=>'#DEFAULT#:t-BreadcrumbRegion--useBreadcrumbTitle'
,p_component_template_options=>'#DEFAULT#'
,p_plug_template=>wwv_flow_api.id(1774862430658936498)
,p_plug_display_sequence=>1
,p_plug_display_point=>'REGION_POSITION_01'
,p_menu_id=>wwv_flow_api.id(1318675881153380306)
,p_plug_source_type=>'NATIVE_BREADCRUMB'
,p_menu_template_id=>wwv_flow_api.id(1774883299498936583)
);
end;
/
prompt --application/pages/page_00036
begin
wwv_flow_api.create_page(
p_id=>36
,p_user_interface_id=>wwv_flow_api.id(1121389871104511367)
,p_tab_set=>'TS1'
,p_name=>'Remove Collections'
,p_alias=>'REMOVE-COLLECTIONS'
,p_step_title=>'Remove Collections'
,p_reload_on_submit=>'A'
,p_warn_on_unsaved_changes=>'N'
,p_autocomplete_on_off=>'ON'
,p_step_template=>wwv_flow_api.id(1774844326834936459)
,p_page_template_options=>'#DEFAULT#'
,p_nav_list_template_options=>'#DEFAULT#'
,p_help_text=>'No help is available for this page.'
,p_last_updated_by=>'ALLAN'
,p_last_upd_yyyymmddhh24miss=>'20210301103343'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(1318663263032174487)
,p_plug_name=>'Remove Collections'
,p_region_template_options=>'#DEFAULT#'
,p_plug_template=>wwv_flow_api.id(1774849216241936469)
,p_plug_display_sequence=>10
,p_plug_display_point=>'BODY'
,p_plug_source=>'<p>To remove all user-created collections and reset this application to the factory default, click on the Remove Collections button.</p>'
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_attribute_01=>'N'
,p_attribute_02=>'HTML'
,p_attribute_03=>'N'
);
wwv_flow_api.create_report_region(
p_id=>wwv_flow_api.id(1330761753328319076)
,p_name=>'Collection Members In Current Application'
,p_template=>wwv_flow_api.id(1774859855390936493)
,p_display_sequence=>20
,p_region_template_options=>'#DEFAULT#:t-Region--noPadding:t-Region--scrollBody'
,p_component_template_options=>'#DEFAULT#:t-Report--stretch:t-Report--altRowsDefault:t-Report--rowHighlight:t-Report--inline'
,p_display_point=>'BODY'
,p_source_type=>'NATIVE_SQL_REPORT'
,p_query_type=>'SQL'
,p_source=>wwv_flow_string.join(wwv_flow_t_varchar2(
'select collection_name, count(*) collection_count',
' from apex_collections',
' group by collection_name'))
,p_display_when_condition=>'select null from apex_collections'
,p_display_condition_type=>'EXISTS'
,p_ajax_enabled=>'Y'
,p_fixed_header=>'NONE'
,p_lazy_loading=>false
,p_query_row_template=>wwv_flow_api.id(1774869560539936527)
,p_query_num_rows=>15
,p_query_options=>'DERIVED_REPORT_COLUMNS'
,p_query_show_nulls_as=>' - '
,p_query_no_data_found=>'No collection members found'
,p_query_num_rows_type=>'NEXT_PREVIOUS_LINKS'
,p_pagination_display_position=>'BOTTOM_RIGHT'
,p_csv_output=>'N'
,p_prn_output=>'N'
,p_sort_null=>'L'
,p_query_asc_image=>'apex/builder/dup.gif'
,p_query_asc_image_attr=>'width="16" height="16" alt="" '
,p_query_desc_image=>'apex/builder/ddown.gif'
,p_query_desc_image_attr=>'width="16" height="16" alt="" '
,p_plug_query_strip_html=>'Y'
);
wwv_flow_api.create_report_columns(
p_id=>wwv_flow_api.id(1330762076179319090)
,p_query_column_id=>1
,p_column_alias=>'COLLECTION_NAME'
,p_column_display_sequence=>1
,p_column_heading=>'Collection Name'
,p_use_as_row_header=>'N'
,p_heading_alignment=>'LEFT'
,p_default_sort_column_sequence=>1
,p_lov_show_nulls=>'NO'
,p_lov_display_extra=>'YES'
,p_include_in_export=>'Y'
);
wwv_flow_api.create_report_columns(
p_id=>wwv_flow_api.id(1330762184494319093)
,p_query_column_id=>2
,p_column_alias=>'COLLECTION_COUNT'
,p_column_display_sequence=>2
,p_column_heading=>'Number of Members'
,p_column_alignment=>'RIGHT'
,p_heading_alignment=>'RIGHT'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(1847905622140835571)
,p_plug_name=>'Breacdcrumb'
,p_region_template_options=>'#DEFAULT#:t-BreadcrumbRegion--useBreadcrumbTitle'
,p_component_template_options=>'#DEFAULT#'
,p_plug_template=>wwv_flow_api.id(1774862430658936498)
,p_plug_display_sequence=>10
,p_include_in_reg_disp_sel_yn=>'Y'
,p_plug_display_point=>'REGION_POSITION_01'
,p_menu_id=>wwv_flow_api.id(1318675881153380306)
,p_plug_source_type=>'NATIVE_BREADCRUMB'
,p_menu_template_id=>wwv_flow_api.id(1774883299498936583)
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
);
wwv_flow_api.create_page_button(
p_id=>wwv_flow_api.id(1318663857438179142)
,p_button_sequence=>20
,p_button_plug_id=>wwv_flow_api.id(1847905622140835571)
,p_button_name=>'CANCEL'
,p_button_action=>'REDIRECT_PAGE'
,p_button_template_options=>'#DEFAULT#'
,p_button_template_id=>wwv_flow_api.id(1774883187200936581)
,p_button_image_alt=>'Cancel'
,p_button_position=>'REGION_TEMPLATE_CLOSE'
,p_button_redirect_url=>'f?p=&APP_ID.:35:&SESSION.::&DEBUG.:RP::'
);
wwv_flow_api.create_page_button(
p_id=>wwv_flow_api.id(1318664054203180674)
,p_button_sequence=>10
,p_button_plug_id=>wwv_flow_api.id(1847905622140835571)
,p_button_name=>'remove_collections'
,p_button_action=>'SUBMIT'
,p_button_template_options=>'#DEFAULT#'
,p_button_template_id=>wwv_flow_api.id(1774883187200936581)
,p_button_is_hot=>'Y'
,p_button_image_alt=>'Remove Collections'
,p_button_position=>'REGION_TEMPLATE_DELETE'
);
wwv_flow_api.create_page_branch(
p_id=>wwv_flow_api.id(1318682856809422573)
,p_branch_name=>'go back to admin'
,p_branch_action=>'f?p=&APP_ID.:35:&SESSION.::&DEBUG.:::&success_msg=#SUCCESS_MSG#'
,p_branch_point=>'AFTER_PROCESSING'
,p_branch_type=>'REDIRECT_URL'
,p_branch_sequence=>10
);
wwv_flow_api.create_page_process(
p_id=>wwv_flow_api.id(1318663463857176553)
,p_process_sequence=>10
,p_process_point=>'AFTER_SUBMIT'
,p_process_type=>'NATIVE_PLSQL'
,p_process_name=>'remove collections'
,p_process_sql_clob=>wwv_flow_string.join(wwv_flow_t_varchar2(
'-- This procedure will delete all collections that belong to the current user',
'-- in the current APEX session and for the current application ID',
'--',
'apex_collection.delete_all_collections;'))
,p_process_clob_language=>'PLSQL'
,p_error_display_location=>'INLINE_IN_NOTIFICATION'
,p_process_success_message=>'Collections removed.'
);
end;
/
prompt --application/pages/page_00039
begin
wwv_flow_api.create_page(
p_id=>39
,p_user_interface_id=>wwv_flow_api.id(1121389871104511367)
,p_name=>'Reset Data'
,p_alias=>'RESET-DATA'
,p_step_title=>'Reset Data'
,p_reload_on_submit=>'A'
,p_warn_on_unsaved_changes=>'N'
,p_autocomplete_on_off=>'ON'
,p_step_template=>wwv_flow_api.id(1774844326834936459)
,p_page_template_options=>'#DEFAULT#'
,p_help_text=>'No help is available for this page.'
,p_last_updated_by=>'ALLAN'
,p_last_upd_yyyymmddhh24miss=>'20210301103343'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(1318680672939411743)
,p_plug_name=>'Manage Sample Application'
,p_region_template_options=>'#DEFAULT#:t-Region--scrollBody'
,p_plug_template=>wwv_flow_api.id(1774859855390936493)
,p_plug_display_sequence=>10
,p_plug_display_point=>'BODY'
,p_plug_source=>'<span class="infoTextRegion"><p>Click the reset data button to reset the data to default values.</p></span>'
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_attribute_01=>'N'
,p_attribute_02=>'HTML'
,p_attribute_03=>'N'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(1318681368214411746)
,p_plug_name=>'Breadcrumb'
,p_region_template_options=>'#DEFAULT#:t-BreadcrumbRegion--useBreadcrumbTitle'
,p_component_template_options=>'#DEFAULT#'
,p_plug_template=>wwv_flow_api.id(1774862430658936498)
,p_plug_display_sequence=>10
,p_plug_display_point=>'REGION_POSITION_01'
,p_menu_id=>wwv_flow_api.id(1318675881153380306)
,p_plug_source_type=>'NATIVE_BREADCRUMB'
,p_menu_template_id=>wwv_flow_api.id(1774883299498936583)
);
wwv_flow_api.create_page_button(
p_id=>wwv_flow_api.id(1318680869423411743)
,p_button_sequence=>10
,p_button_plug_id=>wwv_flow_api.id(1318681368214411746)
,p_button_name=>'CANCEL'
,p_button_action=>'REDIRECT_PAGE'
,p_button_template_options=>'#DEFAULT#'
,p_button_template_id=>wwv_flow_api.id(1774883187200936581)
,p_button_image_alt=>'Cancel'
,p_button_position=>'REGION_TEMPLATE_EDIT'
,p_button_redirect_url=>'f?p=&APP_ID.:35:&SESSION.::&DEBUG.:RP::'
);
wwv_flow_api.create_page_button(
p_id=>wwv_flow_api.id(1318681084040411744)
,p_button_sequence=>20
,p_button_plug_id=>wwv_flow_api.id(1318681368214411746)
,p_button_name=>'reset_data'
,p_button_action=>'SUBMIT'
,p_button_template_options=>'#DEFAULT#'
,p_button_template_id=>wwv_flow_api.id(1774883187200936581)
,p_button_is_hot=>'Y'
,p_button_image_alt=>'Reset Data'
,p_button_position=>'REGION_TEMPLATE_EDIT'
);
wwv_flow_api.create_page_branch(
p_id=>wwv_flow_api.id(1318682660691420732)
,p_branch_name=>'go back to admin'
,p_branch_action=>'f?p=&APP_ID.:35:&SESSION.::&DEBUG.:RP::&success_msg=#SUCCESS_MSG#'
,p_branch_point=>'AFTER_PROCESSING'
,p_branch_type=>'REDIRECT_URL'
,p_branch_sequence=>10
);
wwv_flow_api.create_page_process(
p_id=>wwv_flow_api.id(1318681664518411746)
,p_process_sequence=>10
,p_process_point=>'AFTER_SUBMIT'
,p_process_type=>'NATIVE_PLSQL'
,p_process_name=>'reset data'
,p_process_sql_clob=>'eba_demo_cs_emp_data;'
,p_process_clob_language=>'PLSQL'
,p_error_display_location=>'INLINE_IN_NOTIFICATION'
,p_process_success_message=>'Data has been reset to default values.'
);
end;
/
prompt --application/pages/page_00100
begin
wwv_flow_api.create_page(
p_id=>100
,p_user_interface_id=>wwv_flow_api.id(1121389871104511367)
,p_name=>'Home'
,p_alias=>'HOME'
,p_step_title=>'&APP_NAME.'
,p_reload_on_submit=>'A'
,p_warn_on_unsaved_changes=>'N'
,p_autocomplete_on_off=>'ON'
,p_inline_css=>wwv_flow_string.join(wwv_flow_t_varchar2(
'section.infoRegion {',
' border: 1px solid #9AAEC8;',
' background-color: #DDE7F5;',
'}',
'section.infoRegion > div.uRegionHeading {',
' background: none transparent;',
'}',
'.infoRegionIcon {',
' position: absolute;',
' left: 0;',
' margin: 16px;',
' top: 0;',
'}',
'section.infoRegion.uRegion > div.uRegionContent {',
' position: relative;',
' min-height: 32px;',
' padding: 16px 16px 16px 64px;',
'}',
'.infoRegion h1 {',
' font-weight: bold;',
' font-size: 14px;',
' color: #202020;',
' text-shadow: 0 1px 0 rgba(255,255,255,.65);',
'}',
'.infoRegion p {',
' font-size: 12px;',
' line-height: 20px;',
' padding: 8px 0 0 0;',
' text-shadow: 0 1px 0 rgba(255,255,255,.25);',
' color: #303030;',
'}',
'.infoRegion p:last-child {',
' margin-bottom: 0 !important;',
'}',
'',
'',
'',
'div.featuredBlock{',
' -webkit-border-radius:3px;',
' -moz-border-radius:3px;',
' border-radius:3px;',
' -webkit-box-shadow:0 1px 2px rgba(0,0,0,0.05);',
' -moz-box-shadow:0 1px 2px rgba(0,0,0,0.05);',
' box-shadow:0 1px 2px rgba(0,0,0,0.05);',
' border:1px solid #E1E6EB;',
' margin-bottom:18px',
'}',
'div.featuredBlock div.featuredIcon{',
' background-image:url(''data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPb'
||'lVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIvPjxzdG9wIG9mZnNldD0iNDAlIiBzdG9wLWNvbG9yPSIjZmZmZmZmIi8+PHN0b3Agb2Zmc2V0PSI2MCUiIHN0b3AtY29sb3I9IiNmNGY0ZjgiLz48c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3A'
||'tY29sb3I9IiNmZmZmZmYiLz48L2xpbmVhckdyYWRpZW50PjwvZGVmcz48cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSJ1cmwoI2dyYWQpIiAvPjwvc3ZnPiA='');',
' background-size:100%;',
' background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(40%, #ffffff), color-stop(60%, #f4f4f8), color-stop(100%, #ffffff));',
' background-image:-webkit-linear-gradient(top, #ffffff 0%,#ffffff 40%,#f4f4f8 60%,#ffffff 100%);',
' background-image:-moz-linear-gradient(top, #ffffff 0%,#ffffff 40%,#f4f4f8 60%,#ffffff 100%);',
' background-image:linear-gradient(top, #ffffff 0%,#ffffff 40%,#f4f4f8 60%,#ffffff 100%);',
' -webkit-border-radius:3px 3px 0 0;',
' -moz-border-radius:3px 3px 0 0;',
' border-radius:3px 3px 0 0;',
' padding:8px 0;',
' min-height: 90px;',
' text-align:center;',
'}',
'div.featuredBlock div.featuredIcon img{',
' display:block;',
' margin:0 auto 0 auto;',
' -webkit-box-reflect:below -20px -webkit-gradient(linear, left top, left bottom, from(transparent), color-stop(65%, transparent), to(rgba(255,255,255,0.2)));',
'}',
'div.featuredBlock div.featuredIcon h1{',
' font-size:12px;',
' line-height:12px;',
' color:#404040;',
' margin:0 8px;',
' padding:0;',
' text-align:center;',
'}',
'a.blockLink,a.blockLink:hover{',
' text-decoration:none',
'}',
'a.blockLink:hover div.featuredBlock{',
' border:1px solid #b1bbcb',
'}',
'a.blockLink:hover div.featuredBlock div.featuredIcon{',
' background: none #e5effb;',
' -webkit-box-shadow: 0 0 10px rgba(50,117,199,0.25);',
' -moz-box-shadow: 0 0 10px rgba(50,117,199,0.25);',
' box-shadow: 0 0 10px rgba(50,117,199,0.25);',
'}',
'.regionDivider {',
' border-top: 2px solid #F0F0F0 !important;',
' padding-top: 8px;;',
'}'))
,p_step_template=>wwv_flow_api.id(1774844326834936459)
,p_page_template_options=>'#DEFAULT#'
,p_help_text=>'No help is available for this page.'
,p_last_updated_by=>'HILARY'
,p_last_upd_yyyymmddhh24miss=>'20210309053857'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(1318666167367205937)
,p_plug_name=>'About this Application'
,p_region_template_options=>'#DEFAULT#'
,p_plug_template=>wwv_flow_api.id(1774849216241936469)
,p_plug_display_sequence=>10
,p_plug_display_point=>'BODY'
,p_plug_source=>'<p>Use this Oracle Application Express (APEX) collections sample to extend session state management to deal with arrays of session-based data. Oracle APEX page items provides automatic session management for single value items, but does not manage a'
||'rrays of session state. Oracle APEX collections provides the ability to manager user session state for an array ("table" of rows and columns). The Oracle database has temporary tables, but since each page view in Oracle APEX has a stateless model, '
||'each page view in Oracle APEX is a new database session. For this reason Oracle temporary tables can not be used for any multi page use case. Oracle APEX provides API''s to create and manage APEX collection session state. See the example Use Cases a'
||'nd example API syntax links below to learn more about using Oracle APEX collections. </p>'
,p_plug_query_headings_type=>'QUERY_COLUMNS'
,p_plug_query_num_rows=>15
,p_plug_query_num_rows_type=>'NEXT_PREVIOUS_LINKS'
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_plug_query_show_nulls_as=>' - '
,p_pagination_display_position=>'BOTTOM_RIGHT'
,p_attribute_01=>'N'
,p_attribute_02=>'HTML'
,p_attribute_03=>'N'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(1318670974355271501)
,p_plug_name=>'Collection Examples'
,p_region_name=>'EXAMPLES'
,p_region_template_options=>'#DEFAULT#'
,p_component_template_options=>'#DEFAULT#:t-Cards--featured force-fa-lg:t-Cards--displayIcons:t-Cards--3cols:t-Cards--desc-3ln:u-colors:t-Cards--animColorFill'
,p_plug_template=>wwv_flow_api.id(1774849216241936469)
,p_plug_display_sequence=>20
,p_plug_display_point=>'BODY'
,p_list_id=>wwv_flow_api.id(1318669864821271501)
,p_plug_source_type=>'NATIVE_LIST'
,p_list_template_id=>wwv_flow_api.id(1774874589747936542)
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(1318676362237384290)
,p_plug_name=>'Breadcrumb'
,p_region_template_options=>'#DEFAULT#:t-BreadcrumbRegion--useBreadcrumbTitle'
,p_component_template_options=>'#DEFAULT#'
,p_plug_template=>wwv_flow_api.id(1774862430658936498)
,p_plug_display_sequence=>20
,p_plug_display_point=>'REGION_POSITION_01'
,p_menu_id=>wwv_flow_api.id(1318675881153380306)
,p_plug_source_type=>'NATIVE_BREADCRUMB'
,p_menu_template_id=>wwv_flow_api.id(1774883299498936583)
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_plug_display_condition_type=>'NEVER'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(1713164814714995059)
,p_plug_name=>'Footer'
,p_region_template_options=>'#DEFAULT#'
,p_plug_template=>wwv_flow_api.id(1774849216241936469)
,p_plug_display_sequence=>30
,p_include_in_reg_disp_sel_yn=>'Y'
,p_plug_display_point=>'BODY'
,p_plug_source_type=>'PLUGIN_COM.ORACLE.APEX.SAMPLEAPPFOOTER'
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(2123312203475451348)
,p_plug_name=>'&APP_NAME.'
,p_icon_css_classes=>'app-sample-collections'
,p_region_template_options=>'#DEFAULT#'
,p_plug_template=>wwv_flow_api.id(1774855340336936480)
,p_plug_display_sequence=>10
,p_include_in_reg_disp_sel_yn=>'Y'
,p_plug_display_point=>'REGION_POSITION_01'
,p_plug_source=>'<P>Use collections to store and manipulate large amounts of data</p>'
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_attribute_01=>'N'
,p_attribute_02=>'HTML'
);
end;
/
prompt --application/pages/page_00101
begin
wwv_flow_api.create_page(
p_id=>101
,p_user_interface_id=>wwv_flow_api.id(1121389871104511367)
,p_name=>'Login Page'
,p_alias=>'LOGIN'
,p_step_title=>'Sign In | &APP_NAME.'
,p_reload_on_submit=>'A'
,p_warn_on_unsaved_changes=>'N'
,p_autocomplete_on_off=>'OFF'
,p_inline_css=>wwv_flow_string.join(wwv_flow_t_varchar2(
'.appIcon.sample_collections {',
'background-position:-192px -320px;',
'}',
'',
'.appIcon {',
'display: inline-block;',
'width: 64px;',
'height: 64px;',
'background-image: url(#IMAGE_PREFIX#eba/img/eba_launchpad.png);',
'background-repeat: no-repeat;',
'border: none;',
'-webkit-border-radius: 4px;',
'-moz-border-radius: 4px;',
'border-radius: 4px;',
'-webkit-box-shadow: 0 0 1px rgba(0,0,0,0.75) inset;',
'-moz-box-shadow: 0 0 1px rgba(0,0,0,0.75) inset;',
'box-shadow: 0 0 1px rgba(0,0,0,0.75) inset;',
'margin-right: 8px;',
'vertical-align: middle;',
'}'))
,p_step_template=>wwv_flow_api.id(1774830836871936435)
,p_page_template_options=>'#DEFAULT#'
,p_page_is_public_y_n=>'Y'
,p_protection_level=>'U'
,p_page_comment=>'This page was generated by the Login Page wizard'
,p_last_updated_by=>'ALLAN'
,p_last_upd_yyyymmddhh24miss=>'20210301103342'
);
wwv_flow_api.create_page_plug(
p_id=>wwv_flow_api.id(8738079251721431309)
,p_plug_name=>'Sample Collections'
,p_region_name=>'sample_collections'
,p_icon_css_classes=>'app-sample-collections'
,p_region_template_options=>'#DEFAULT#'
,p_plug_template=>wwv_flow_api.id(1774858630756936489)
,p_plug_display_sequence=>10
,p_plug_display_point=>'BODY'
,p_plug_query_options=>'DERIVED_REPORT_COLUMNS'
,p_attribute_01=>'N'
,p_attribute_02=>'HTML'
,p_attribute_03=>'N'
);
wwv_flow_api.create_page_button(
p_id=>wwv_flow_api.id(5901756368843305415)
,p_button_sequence=>10
,p_button_plug_id=>wwv_flow_api.id(8738079251721431309)
,p_button_name=>'LOGIN'
,p_button_action=>'SUBMIT'
,p_button_template_options=>'#DEFAULT#'
,p_button_template_id=>wwv_flow_api.id(1774883187200936581)
,p_button_is_hot=>'Y'
,p_button_image_alt=>'Sign In'
,p_button_position=>'REGION_TEMPLATE_NEXT'
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8738079334802431317)
,p_name=>'P101_USERNAME'
,p_is_required=>true
,p_item_sequence=>10
,p_item_plug_id=>wwv_flow_api.id(8738079251721431309)
,p_prompt=>'Username'
,p_placeholder=>'username'
,p_post_element_text=>'<span class="t-Login-iconValidation a-Icon icon-check"></span>'
,p_display_as=>'NATIVE_TEXT_FIELD'
,p_cSize=>64
,p_cMaxlength=>100
,p_field_template=>wwv_flow_api.id(1774881796850936565)
,p_item_icon_css_classes=>'fa-user'
,p_item_template_options=>'#DEFAULT#'
,p_protection_level=>'I'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_01=>'N'
,p_attribute_02=>'N'
,p_attribute_04=>'TEXT'
,p_attribute_05=>'BOTH'
);
wwv_flow_api.create_page_item(
p_id=>wwv_flow_api.id(8738079440766431319)
,p_name=>'P101_PASSWORD'
,p_is_required=>true
,p_item_sequence=>20
,p_item_plug_id=>wwv_flow_api.id(8738079251721431309)
,p_prompt=>'Password'
,p_placeholder=>'password'
,p_post_element_text=>'<span class="t-Login-iconValidation a-Icon icon-check"></span>'
,p_display_as=>'NATIVE_PASSWORD'
,p_cSize=>64
,p_cMaxlength=>100
,p_field_template=>wwv_flow_api.id(1774881796850936565)
,p_item_icon_css_classes=>'fa-key'
,p_item_template_options=>'#DEFAULT#'
,p_is_persistent=>'N'
,p_protection_level=>'I'
,p_encrypt_session_state_yn=>'Y'
,p_attribute_01=>'Y'
);
wwv_flow_api.create_page_da_event(
p_id=>wwv_flow_api.id(1297317456571960001)
,p_name=>'Set Focus'
,p_event_sequence=>10
,p_triggering_condition_type=>'JAVASCRIPT_EXPRESSION'
,p_triggering_expression=>'( $v( "P101_USERNAME" ) === "" )'
,p_bind_type=>'bind'
,p_bind_event_type=>'ready'
);
wwv_flow_api.create_page_da_action(
p_id=>wwv_flow_api.id(1297317754677960004)
,p_event_id=>wwv_flow_api.id(1297317456571960001)
,p_event_result=>'TRUE'
,p_action_sequence=>10
,p_execute_on_page_init=>'N'
,p_action=>'NATIVE_SET_FOCUS'
,p_affected_elements_type=>'ITEM'
,p_affected_elements=>'P101_USERNAME'
);
wwv_flow_api.create_page_da_action(
p_id=>wwv_flow_api.id(1297317963988960007)
,p_event_id=>wwv_flow_api.id(1297317456571960001)
,p_event_result=>'FALSE'
,p_action_sequence=>20
,p_execute_on_page_init=>'N'
,p_action=>'NATIVE_SET_FOCUS'
,p_affected_elements_type=>'ITEM'
,p_affected_elements=>'P101_PASSWORD'
);
wwv_flow_api.create_page_process(
p_id=>wwv_flow_api.id(8738079733457431329)
,p_process_sequence=>10
,p_process_point=>'AFTER_SUBMIT'
,p_process_type=>'NATIVE_PLSQL'
,p_process_name=>'Set Username Cookie'
,p_process_sql_clob=>wwv_flow_string.join(wwv_flow_t_varchar2(
'apex_authentication.send_login_username_cookie (',
' p_username => lower(:P101_USERNAME) );'))
,p_process_clob_language=>'PLSQL'
);
wwv_flow_api.create_page_process(
p_id=>wwv_flow_api.id(8738079630293431321)
,p_process_sequence=>20
,p_process_point=>'AFTER_SUBMIT'
,p_process_type=>'NATIVE_PLSQL'
,p_process_name=>'Login'
,p_process_sql_clob=>wwv_flow_string.join(wwv_flow_t_varchar2(
'apex_authentication.login(',
' p_username => :P101_USERNAME,',
' p_password => :P101_PASSWORD );'))
,p_process_clob_language=>'PLSQL'
);
wwv_flow_api.create_page_process(
p_id=>wwv_flow_api.id(8738079837299431329)
,p_process_sequence=>30
,p_process_point=>'AFTER_SUBMIT'
,p_process_type=>'NATIVE_SESSION_STATE'
,p_process_name=>'Clear'
,p_attribute_01=>'CLEAR_CACHE_CURRENT_PAGE'
);
wwv_flow_api.create_page_process(
p_id=>wwv_flow_api.id(8738079939111431329)
,p_process_sequence=>10
,p_process_point=>'BEFORE_HEADER'
,p_process_type=>'NATIVE_PLSQL'
,p_process_name=>'Get Username Cookie'
,p_process_sql_clob=>':P101_USERNAME := apex_authentication.get_login_username_cookie;'
,p_process_clob_language=>'PLSQL'
);
end;
/
prompt --application/deployment/definition
begin
wwv_flow_api.create_install(
p_id=>wwv_flow_api.id(8020670391359461679)
,p_welcome_message=>'This application installer will guide you through the process of creating your database objects and seed data.'
,p_configuration_message=>'You can configure the following attributes of your application.'
,p_build_options_message=>'You can choose to include the following build options.'
,p_validation_message=>'The following validations will be performed to ensure your system is compatible with this application.'
,p_install_message=>'Please confirm that you would like to install this application''s supporting objects.'
,p_upgrade_message=>'The application installer has detected that this application''s supporting objects were already present. This wizard will guide you through the process of upgrading these supporting objects.'
,p_upgrade_confirm_message=>'Please confirm that you would like to install this application''s supporting objects.'
,p_upgrade_success_message=>'Your application''s supporting objects have been installed.'
,p_upgrade_failure_message=>'Installation of database objects and seed data has failed.'
,p_get_version_sql_query=>wwv_flow_string.join(wwv_flow_t_varchar2(
'select null',
' from user_tables',
' where table_name like ''EBA_DEMO_CS_%'''))
,p_deinstall_success_message=>'Deinstallation complete.'
,p_deinstall_script_clob=>wwv_flow_string.join(wwv_flow_t_varchar2(
'drop procedure eba_demo_cs_emp_data',
'/',
' ',
'drop table eba_demo_cs_emp cascade constraints',
'/',
''))
,p_required_free_kb=>100
,p_required_sys_privs=>'CREATE PROCEDURE:CREATE TABLE:CREATE TRIGGER:CREATE VIEW'
,p_required_names_available=>'EBA_DEMO_CS_EMP_DATA:EBA_DEMO_CS_EMP'
);
end;
/
prompt --application/deployment/install/install_set_plscope_settings
begin
wwv_flow_api.create_install_script(
p_id=>wwv_flow_api.id(3342322582122931536)
,p_install_id=>wwv_flow_api.id(8020670391359461679)
,p_name=>'Set plscope_settings'
,p_sequence=>5
,p_script_type=>'INSTALL'
,p_script_clob=>'ALTER SESSION SET PLSCOPE_SETTINGS = ''IDENTIFIERS:NONE'';'
);
end;
/
prompt --application/deployment/install/upgrade_create_eba_demo_cs_emp_table
begin
wwv_flow_api.create_install_script(
p_id=>wwv_flow_api.id(1318653854805795464)
,p_install_id=>wwv_flow_api.id(8020670391359461679)
,p_name=>'Create EBA_DEMO_CS_EMP Table'
,p_sequence=>20
,p_script_type=>'UPGRADE'
,p_condition_type=>'NOT_EXISTS'
,p_condition=>'select table_name from user_tables where table_name = ''EBA_DEMO_CS_EMP'''
,p_script_clob=>wwv_flow_string.join(wwv_flow_t_varchar2(
'drop table eba_demo_cs_emp cascade constraints',
'/',
'',
'create table eba_demo_cs_emp (',
' empno NUMBER(4) not null',
' constraint eba_demo_cs_emp_pk',
' primary key,',
' ename VARCHAR2(10),',
' job VARCHAR2(9),',
' mgr NUMBER(4),',
' hiredate DATE,',
' sal NUMBER(7),',
' comm NUMBER(7),',
' deptno NUMBER(2)',
')',
'/',
'',
'create index eba_demo_cs_emp_1 ON eba_demo_cs_emp (MGR)',
'/',
' ',
'create index eba_demo_cs_emp_2 ON eba_demo_cs_emp (DEPTNO)',
'/',
'',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7839,''KING'',''PRESIDENT'',null,to_date(''17-11-81'',''DD-MM-RR''),5000,null,10);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7698,''BLAKE'',''MANAGER'',7839,to_date(''01-05-81'',''DD-MM-RR''),2850,null,30);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7782,''CLARK'',''MANAGER'',7839,to_date(''09-06-81'',''DD-MM-RR''),2450,null,10);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7566,''JONES'',''MANAGER'',7839,to_date(''02-04-81'',''DD-MM-RR''),2975,null,20);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7788,''SCOTT'',''ANALYST'',7566,to_date(''09-12-82'',''DD-MM-RR''),3000,null,20);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7902,''FORD'',''ANALYST'',7566,to_date(''03-12-81'',''DD-MM-RR''),3000,null,20);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7369,''SMITH'',''CLERK'',7902,to_date(''17-12-80'',''DD-MM-RR''),800,null,20);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7499,''ALLEN'',''SALESMAN'',7698,to_date(''20-02-81'',''DD-MM-RR''),1600,300,30);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7521,''WARD'',''SALESMAN'',7698,to_date(''22-02-81'',''DD-MM-RR''),1250,500,30);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7654,''MARTIN'',''SALESMAN'',7698,to_date(''28-09-81'',''DD-MM-RR''),1250,1400,30);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7844,''TURNER'',''SALESMAN'',7698,to_date(''08-09-81'',''DD-MM-RR''),1500,0,30);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7876,''ADAMS'',''CLERK'',7788,to_date(''12-01-83'',''DD-MM-RR''),1100,null,20);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7900,''JAMES'',''CLERK'',7698,to_date(''03-12-81'',''DD-MM-RR''),950,null,30);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7934,''MILLER'',''CLERK'',7782,to_date(''23-01-82'',''DD-MM-RR''),1300,null,10);',
'',
'commit;'))
);
end;
/
prompt --application/deployment/install/install_create_eba_demo_cs_emp_table
begin
wwv_flow_api.create_install_script(
p_id=>wwv_flow_api.id(1318653261470778469)
,p_install_id=>wwv_flow_api.id(8020670391359461679)
,p_name=>'Create EBA_DEMO_CS_EMP table'
,p_sequence=>20
,p_script_type=>'INSTALL'
,p_script_clob=>wwv_flow_string.join(wwv_flow_t_varchar2(
'create table eba_demo_cs_emp (',
' empno NUMBER(4) not null',
' constraint eba_demo_cs_emp_pk',
' primary key,',
' ename VARCHAR2(10),',
' job VARCHAR2(9),',
' mgr NUMBER(4),',
' hiredate DATE,',
' sal NUMBER(7),',
' comm NUMBER(7),',
' deptno NUMBER(2)',
')',
'/',
'',
'create index eba_demo_cs_emp_idx1 ON eba_demo_cs_emp (MGR)',
'/',
' ',
'create index eba_demo_cs_emp_idx2 ON eba_demo_cs_emp (DEPTNO)',
'/',
'',
'delete from eba_demo_cs_emp;',
'',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7839,''KING'',''PRESIDENT'',null,to_date(''17-11-81'',''DD-MM-RR''),5000,null,10);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7698,''BLAKE'',''MANAGER'',7839,to_date(''01-05-81'',''DD-MM-RR''),2850,null,30);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7782,''CLARK'',''MANAGER'',7839,to_date(''09-06-81'',''DD-MM-RR''),2450,null,10);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7566,''JONES'',''MANAGER'',7839,to_date(''02-04-81'',''DD-MM-RR''),2975,null,20);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7788,''SCOTT'',''ANALYST'',7566,to_date(''09-12-82'',''DD-MM-RR''),3000,null,20);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7902,''FORD'',''ANALYST'',7566,to_date(''03-12-81'',''DD-MM-RR''),3000,null,20);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7369,''SMITH'',''CLERK'',7902,to_date(''17-12-80'',''DD-MM-RR''),800,null,20);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7499,''ALLEN'',''SALESMAN'',7698,to_date(''20-02-81'',''DD-MM-RR''),1600,300,30);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7521,''WARD'',''SALESMAN'',7698,to_date(''22-02-81'',''DD-MM-RR''),1250,500,30);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7654,''MARTIN'',''SALESMAN'',7698,to_date(''28-09-81'',''DD-MM-RR''),1250,1400,30);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7844,''TURNER'',''SALESMAN'',7698,to_date(''08-09-81'',''DD-MM-RR''),1500,0,30);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7876,''ADAMS'',''CLERK'',7788,to_date(''12-01-83'',''DD-MM-RR''),1100,null,20);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7900,''JAMES'',''CLERK'',7698,to_date(''03-12-81'',''DD-MM-RR''),950,null,30);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7934,''MILLER'',''CLERK'',7782,to_date(''23-01-82'',''DD-MM-RR''),1300,null,10);',
''))
);
end;
/
prompt --application/deployment/install/install_sample_data
begin
wwv_flow_api.create_install_script(
p_id=>wwv_flow_api.id(1320303159937729850)
,p_install_id=>wwv_flow_api.id(8020670391359461679)
,p_name=>'Sample Data'
,p_sequence=>30
,p_script_type=>'INSTALL'
,p_script_clob=>wwv_flow_string.join(wwv_flow_t_varchar2(
'create or replace procedure eba_demo_cs_emp_data',
'as',
'begin',
'',
'delete from eba_demo_cs_emp;',
'',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7839,''KING'',''PRESIDENT'',null,to_date(''17-11-81'',''DD-MM-RR''),5000,null,10);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7698,''BLAKE'',''MANAGER'',7839,to_date(''01-05-81'',''DD-MM-RR''),2850,null,30);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7782,''CLARK'',''MANAGER'',7839,to_date(''09-06-81'',''DD-MM-RR''),2450,null,10);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7566,''JONES'',''MANAGER'',7839,to_date(''02-04-81'',''DD-MM-RR''),2975,null,20);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7788,''SCOTT'',''ANALYST'',7566,to_date(''09-12-82'',''DD-MM-RR''),3000,null,20);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7902,''FORD'',''ANALYST'',7566,to_date(''03-12-81'',''DD-MM-RR''),3000,null,20);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7369,''SMITH'',''CLERK'',7902,to_date(''17-12-80'',''DD-MM-RR''),800,null,20);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7499,''ALLEN'',''SALESMAN'',7698,to_date(''20-02-81'',''DD-MM-RR''),1600,300,30);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7521,''WARD'',''SALESMAN'',7698,to_date(''22-02-81'',''DD-MM-RR''),1250,500,30);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7654,''MARTIN'',''SALESMAN'',7698,to_date(''28-09-81'',''DD-MM-RR''),1250,1400,30);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7844,''TURNER'',''SALESMAN'',7698,to_date(''08-09-81'',''DD-MM-RR''),1500,0,30);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7876,''ADAMS'',''CLERK'',7788,to_date(''12-01-83'',''DD-MM-RR''),1100,null,20);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7900,''JAMES'',''CLERK'',7698,to_date(''03-12-81'',''DD-MM-RR''),950,null,30);',
'insert into eba_demo_cs_emp (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values (7934,''MILLER'',''CLERK'',7782,to_date(''23-01-82'',''DD-MM-RR''),1300,null,10);',
'',
'end eba_demo_cs_emp_data;',
'/',
'',
''))
);
end;
/
prompt --application/deployment/checks
begin
null;
end;
/
prompt --application/deployment/buildoptions
begin
null;
end;
/
prompt --application/end_environment
begin
wwv_flow_api.import_end(p_auto_install_sup_obj => nvl(wwv_flow_application_install.get_auto_install_sup_obj, false));
commit;
end;
/
set verify on feedback on define on
prompt ...done | the_stack |
-- Licensed to the Apache Software Foundation (ASF) under one or more
-- contributor license agreements. See the NOTICE file distributed with
-- this work for additional information regarding copyright ownership.
-- The ASF licenses this file to You under the Apache License, Version 2.0
-- (the "License"); you may not use this file except in compliance with
-- the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
CREATE OR REPLACE FUNCTION getXportalUIdByLoginId(input_val varchar(100))
RETURNS bigint LANGUAGE SQL AS $$ SELECT x_portal_user.id FROM x_portal_user
WHERE x_portal_user.login_id = $1; $$;
CREATE OR REPLACE FUNCTION getModulesIdByName(input_val varchar(100))
RETURNS bigint LANGUAGE SQL AS $$ SELECT x_modules_master.id FROM x_modules_master
WHERE x_modules_master.module = $1; $$;
select 'delimiter start';
CREATE OR REPLACE FUNCTION add_security_zone_permissions()
RETURNS void AS $$
DECLARE
v_column_exists integer := 0;
BEGIN
select count(*) into v_column_exists from x_modules_master where module='Security Zone';
IF v_column_exists = 0 THEN
INSERT INTO x_modules_master(create_time,update_time,added_by_id,upd_by_id,module,url) VALUES(current_timestamp,current_timestamp,getXportalUIdByLoginId('admin'),getXportalUIdByLoginId('admin'),'Security Zone','');
END IF;
v_column_exists:=0;
select count(*) into v_column_exists from x_user_module_perm where user_id=getXportalUIdByLoginId('admin') and module_id=getModulesIdByName('Security Zone');
IF v_column_exists = 0 THEN
INSERT INTO x_user_module_perm (user_id,module_id,create_time,update_time,added_by_id,upd_by_id,is_allowed) VALUES (getXportalUIdByLoginId('admin'),getModulesIdByName('Security Zone'),current_timestamp,current_timestamp,getXportalUIdByLoginId('admin'),getXportalUIdByLoginId('admin'),1);
END IF;
v_column_exists:=0;
select count(*) into v_column_exists from x_user_module_perm where user_id=getXportalUIdByLoginId('rangerusersync') and module_id=getModulesIdByName('Security Zone');
IF v_column_exists = 0 THEN
INSERT INTO x_user_module_perm (user_id,module_id,create_time,update_time,added_by_id,upd_by_id,is_allowed) VALUES (getXportalUIdByLoginId('rangerusersync'),getModulesIdByName('Security Zone'),current_timestamp,current_timestamp,getXportalUIdByLoginId('admin'),getXportalUIdByLoginId('admin'),1);
END IF;
v_column_exists:=0;
select count(*) into v_column_exists from x_user_module_perm where user_id=getXportalUIdByLoginId('rangertagsync') and module_id=getModulesIdByName('Security Zone');
IF v_column_exists = 0 THEN
INSERT INTO x_user_module_perm (user_id,module_id,create_time,update_time,added_by_id,upd_by_id,is_allowed) VALUES (getXportalUIdByLoginId('rangertagsync'),getModulesIdByName('Security Zone'),current_timestamp,current_timestamp,getXportalUIdByLoginId('admin'),getXportalUIdByLoginId('admin'),1);
END IF;
END;
$$ LANGUAGE plpgsql;
select 'delimiter end';
select add_security_zone_permissions();
select 'delimiter end';
commit;
select 'delimiter start';
CREATE OR REPLACE FUNCTION add_zone_x_policy_export_audit()
RETURNS void AS $$
DECLARE
v_column_exists integer := 0;
BEGIN
select count(*) into v_column_exists from pg_attribute where attrelid in(select oid from pg_class where relname='x_policy_export_audit') and attname='zone_name';
IF v_column_exists = 0 THEN
ALTER TABLE x_policy_export_audit ADD COLUMN zone_name VARCHAR(255) DEFAULT NULL NULL;
END IF;
END;
$$ LANGUAGE plpgsql;
select 'delimiter end';
select add_zone_x_policy_export_audit();
select 'delimiter end';
select 'delimiter start';
CREATE OR REPLACE FUNCTION remove_x_policy_zone_id()
RETURNS void AS $$
DECLARE
v_column_exists integer := 0;
BEGIN
select count(*) into v_column_exists from pg_attribute where attrelid in(select oid from pg_class where relname='x_policy') and attname='zone_id';
IF v_column_exists > 0 THEN
ALTER TABLE x_policy DROP CONSTRAINT x_policy_FK_zone_id;
ALTER TABLE x_policy DROP COLUMN zone_id ;
END IF;
END;
$$ LANGUAGE plpgsql;
select 'delimiter end';
select remove_x_policy_zone_id();
select 'delimiter end';
DROP TABLE IF EXISTS x_security_zone_ref_group CASCADE;
DROP SEQUENCE IF EXISTS x_sec_zone_ref_group_seq;
DROP TABLE IF EXISTS x_security_zone_ref_user CASCADE;
DROP SEQUENCE IF EXISTS x_sec_zone_ref_user_seq;
DROP TABLE IF EXISTS x_security_zone_ref_resource CASCADE;
DROP SEQUENCE IF EXISTS x_sec_zone_ref_resource_seq;
DROP TABLE IF EXISTS x_security_zone_ref_service CASCADE;
DROP SEQUENCE IF EXISTS x_sec_zone_ref_service_seq;
DROP TABLE IF EXISTS x_security_zone_ref_tag_srvc CASCADE;
DROP SEQUENCE IF EXISTS x_sec_zone_ref_tag_srvc_seq;
DROP TABLE IF EXISTS x_ranger_global_state CASCADE;
DROP SEQUENCE IF EXISTS x_ranger_global_state_seq;
DROP TABLE IF EXISTS x_security_zone CASCADE;
DROP SEQUENCE IF EXISTS x_security_zone_seq;
CREATE SEQUENCE x_security_zone_seq;
CREATE TABLE x_security_zone (
id BIGINT DEFAULT nextval('x_security_zone_seq'::regclass),
create_time TIMESTAMP DEFAULT NULL NULL,
update_time TIMESTAMP DEFAULT NULL NULL,
added_by_id BIGINT DEFAULT NULL NULL,
upd_by_id BIGINT DEFAULT NULL NULL,
version BIGINT DEFAULT NULL NULL,
name varchar(255) NOT NULL,
jsonData text DEFAULT NULL NULL,
description VARCHAR(1024) DEFAULT NULL NULL,
primary key (id),
CONSTRAINT x_security_zone_UK_name UNIQUE (name),
CONSTRAINT x_security_zone_FK_added_by_id FOREIGN KEY (added_by_id) REFERENCES x_portal_user (id),
CONSTRAINT x_security_zone_FK_upd_by_id FOREIGN KEY (upd_by_id) REFERENCES x_portal_user (id)
);
CREATE SEQUENCE x_ranger_global_state_seq;
CREATE TABLE x_ranger_global_state (
id BIGINT DEFAULT nextval('x_ranger_global_state_seq'::regclass),
create_time TIMESTAMP DEFAULT NULL NULL,
update_time TIMESTAMP DEFAULT NULL NULL,
added_by_id BIGINT DEFAULT NULL NULL,
upd_by_id BIGINT DEFAULT NULL NULL,
version BIGINT DEFAULT NULL NULL,
state_name varchar(255) NOT NULL,
app_data varchar(255) DEFAULT NULL NULL,
primary key (id),
CONSTRAINT x_ranger_global_state_UK_state_name UNIQUE (state_name),
CONSTRAINT x_ranger_global_state_FK_added_by_id FOREIGN KEY (added_by_id) REFERENCES x_portal_user (id),
CONSTRAINT x_ranger_global_state_FK_upd_by_id FOREIGN KEY (upd_by_id) REFERENCES x_portal_user (id)
);
CREATE SEQUENCE x_sec_zone_ref_service_seq;
CREATE TABLE x_security_zone_ref_service (
id BIGINT DEFAULT nextval('x_sec_zone_ref_service_seq'::regclass),
create_time TIMESTAMP DEFAULT NULL NULL,
update_time TIMESTAMP DEFAULT NULL NULL,
added_by_id BIGINT DEFAULT NULL NULL,
upd_by_id BIGINT DEFAULT NULL NULL,
zone_id BIGINT DEFAULT NULL NULL,
service_id BIGINT DEFAULT NULL NULL,
service_name varchar(255) NULL DEFAULT NULL::character varying,
primary key (id),
CONSTRAINT x_sz_ref_service_FK_added_by_id FOREIGN KEY (added_by_id) REFERENCES x_portal_user (id),
CONSTRAINT x_sz_ref_service_FK_upd_by_id FOREIGN KEY (upd_by_id) REFERENCES x_portal_user (id),
CONSTRAINT x_sz_ref_service_FK_zone_id FOREIGN KEY (zone_id) REFERENCES x_security_zone (id),
CONSTRAINT x_sz_ref_service_FK_service_id FOREIGN KEY (service_id) REFERENCES x_service (id),
CONSTRAINT x_sz_ref_service_FK_service_name FOREIGN KEY (service_name) REFERENCES x_service (name)
);
CREATE SEQUENCE x_sec_zone_ref_tag_srvc_seq;
CREATE TABLE x_security_zone_ref_tag_srvc (
id BIGINT DEFAULT nextval('x_sec_zone_ref_tag_srvc_SEQ'::regclass),
create_time TIMESTAMP DEFAULT NULL NULL,
update_time TIMESTAMP DEFAULT NULL NULL,
added_by_id BIGINT DEFAULT NULL NULL,
upd_by_id BIGINT DEFAULT NULL NULL,
zone_id BIGINT DEFAULT NULL NULL,
tag_srvc_id BIGINT DEFAULT NULL NULL,
tag_srvc_name varchar(255) NULL DEFAULT NULL::character varying,
primary key (id),
CONSTRAINT x_sz_refTagSrvc_FK_aded_by_id FOREIGN KEY (added_by_id) REFERENCES x_portal_user (id),
CONSTRAINT x_sz_refTagSrvc_FK_upd_by_id FOREIGN KEY (upd_by_id) REFERENCES x_portal_user (id),
CONSTRAINT x_sz_refTagSrvc_FK_zone_id FOREIGN KEY (zone_id) REFERENCES x_security_zone (id),
CONSTRAINT x_sz_refTagSrvc_FK_tag_srvc_id FOREIGN KEY (tag_srvc_id) REFERENCES x_service (id),
CONSTRAINT x_sz_refTagSrvc_FK_tag_srvc_name FOREIGN KEY (tag_srvc_name) REFERENCES x_service (name)
);
CREATE SEQUENCE x_sec_zone_ref_resource_seq;
CREATE TABLE x_security_zone_ref_resource (
id BIGINT DEFAULT nextval('x_sec_zone_ref_resource_seq'::regclass),
create_time TIMESTAMP DEFAULT NULL NULL,
update_time TIMESTAMP DEFAULT NULL NULL,
added_by_id BIGINT DEFAULT NULL NULL,
upd_by_id BIGINT DEFAULT NULL NULL,
zone_id BIGINT DEFAULT NULL NULL,
resource_def_id BIGINT DEFAULT NULL NULL,
resource_name varchar(255) NULL DEFAULT NULL::character varying,
primary key (id),
CONSTRAINT x_sz_ref_res_FK_added_by_id FOREIGN KEY (added_by_id) REFERENCES x_portal_user (id),
CONSTRAINT x_sz_ref_res_FK_upd_by_id FOREIGN KEY (upd_by_id) REFERENCES x_portal_user (id),
CONSTRAINT x_sz_ref_service_FK_zone_id FOREIGN KEY (zone_id) REFERENCES x_security_zone (id),
CONSTRAINT x_sz_ref_res_FK_resource_def_id FOREIGN KEY (resource_def_id) REFERENCES x_resource_def (id)
);
CREATE SEQUENCE x_sec_zone_ref_user_seq;
CREATE TABLE x_security_zone_ref_user (
id BIGINT DEFAULT nextval('x_sec_zone_ref_user_seq'::regclass),
create_time TIMESTAMP DEFAULT NULL NULL,
update_time TIMESTAMP DEFAULT NULL NULL,
added_by_id BIGINT DEFAULT NULL NULL,
upd_by_id BIGINT DEFAULT NULL NULL,
zone_id BIGINT DEFAULT NULL NULL,
user_id BIGINT DEFAULT NULL NULL,
user_name varchar(255) NULL DEFAULT NULL::character varying,
user_type SMALLINT DEFAULT NULL NULL,
primary key (id),
CONSTRAINT x_sz_ref_user_FK_added_by_id FOREIGN KEY (added_by_id) REFERENCES x_portal_user (id),
CONSTRAINT x_sz_ref_user_FK_upd_by_id FOREIGN KEY (upd_by_id) REFERENCES x_portal_user (id),
CONSTRAINT x_sz_ref_user_FK_zone_id FOREIGN KEY (zone_id) REFERENCES x_security_zone (id),
CONSTRAINT x_sz_ref_user_FK_user_id FOREIGN KEY (user_id) REFERENCES x_user (id),
CONSTRAINT x_sz_ref_user_FK_user_name FOREIGN KEY (user_name) REFERENCES x_user (user_name)
);
CREATE SEQUENCE x_sec_zone_ref_group_seq;
CREATE TABLE x_security_zone_ref_group (
id BIGINT DEFAULT nextval('x_sec_zone_ref_group_seq'::regclass),
create_time TIMESTAMP DEFAULT NULL NULL,
update_time TIMESTAMP DEFAULT NULL NULL,
added_by_id BIGINT DEFAULT NULL NULL,
upd_by_id BIGINT DEFAULT NULL NULL,
zone_id BIGINT DEFAULT NULL NULL,
group_id BIGINT DEFAULT NULL NULL,
group_name varchar(255) NULL DEFAULT NULL::character varying,
group_type SMALLINT DEFAULT NULL NULL,
primary key (id),
CONSTRAINT x_sz_ref_group_FK_added_by_id FOREIGN KEY (added_by_id) REFERENCES x_portal_user (id),
CONSTRAINT x_sz_ref_group_FK_upd_by_id FOREIGN KEY (upd_by_id) REFERENCES x_portal_user (id),
CONSTRAINT x_sz_ref_group_FK_zone_id FOREIGN KEY (zone_id) REFERENCES x_security_zone (id),
CONSTRAINT x_sz_ref_group_FK_group_id FOREIGN KEY (group_id) REFERENCES x_group (id)
);
select 'delimiter start';
CREATE OR REPLACE FUNCTION add_unzone_entry()
RETURNS void AS $$
DECLARE
v_column_exists integer := 0;
BEGIN
select count(*) into v_column_exists from x_security_zone where id=1 and name=' ';
IF v_column_exists = 0 THEN
INSERT INTO x_security_zone(create_time, update_time, added_by_id, upd_by_id, version, name, jsonData, description) VALUES (current_timestamp, current_timestamp, getXportalUIdByLoginId('admin'), getXportalUIdByLoginId('admin'), 1, ' ', '', 'Unzoned zone');
END IF;
END;
$$ LANGUAGE plpgsql;
select 'delimiter end';
select add_unzone_entry();
select 'delimiter end';
select 'delimiter start';
CREATE OR REPLACE FUNCTION add_x_policy_zone_id()
RETURNS void AS $$
DECLARE
v_column_exists integer := 0;
BEGIN
select count(*) into v_column_exists from pg_attribute where attrelid in(select oid from pg_class where relname='x_policy') and attname='zone_id';
IF v_column_exists = 0 THEN
ALTER TABLE x_policy ADD COLUMN zone_id BIGINT DEFAULT 1 NOT NULL,ADD CONSTRAINT x_policy_FK_zone_id FOREIGN KEY(zone_id) REFERENCES x_security_zone(id);
END IF;
END;
$$ LANGUAGE plpgsql;
select 'delimiter end';
select add_x_policy_zone_id();
select 'delimiter end'; | the_stack |
--
-- HW_PBE
--
-- Testset 1 dynamic datanode reduction for single table
create table t1_xc_fqs(id1 int, id2 int, num int);
-- only params
prepare s as select * from t1_xc_fqs where id1=$1 and id2=$2;
prepare i as insert into t1_xc_fqs values ($1, $2, $3);
prepare u as update t1_xc_fqs set num=0 where id1=$1 and id2=$2;
prepare d as delete from t1_xc_fqs where id1=$1 and id2=$2;
set enable_pbe_optimization to false;
insert into t1_xc_fqs values (1,1,1), (2,2,2), (3,3,3), (4,4,4), (5,5,5);
explain (costs off, verbose on) execute s (1,1);
explain (costs off, verbose on) execute i (6,6,6);
explain (costs off, verbose on) execute u (2,2);
explain (costs off, verbose on) execute d (3,3);
execute s (1,1);
execute i (6,6,6);
select * from t1_xc_fqs order by id1;
execute u (2,2);
select * from t1_xc_fqs order by id1;
execute d (3,3);
select * from t1_xc_fqs order by id1;
set enable_pbe_optimization to true;
truncate t1_xc_fqs;
insert into t1_xc_fqs values (1,1,1), (2,2,2), (3,3,3), (4,4,4), (5,5,5);
explain (costs off, verbose on) execute s (1,1);
explain (costs off, verbose on) execute i (6,6,6);
explain (costs off, verbose on) execute u (2,2);
explain (costs off, verbose on) execute d (3,3);
execute s (1,1);
execute i (6,6,6);
select * from t1_xc_fqs order by id1;
execute u (2,2);
select * from t1_xc_fqs order by id1;
execute d (3,3);
select * from t1_xc_fqs order by id1;
deallocate s;
deallocate i;
deallocate u;
deallocate d;
-- const and params
prepare s as select * from t1_xc_fqs where id1=$1 and id2=2;
prepare i as insert into t1_xc_fqs values ($1, 2, 3);
prepare u as update t1_xc_fqs set num=1 where id1=$1 and id2=2;
prepare d as delete from t1_xc_fqs where id1=$1 and id2=2;
set enable_pbe_optimization to false;
truncate t1_xc_fqs;
insert into t1_xc_fqs values (1,1,1), (2,2,2), (3,3,3), (4,4,4), (5,5,5);
explain (costs off, verbose on) execute s (1);
explain (costs off, verbose on) execute i (6);
explain (costs off, verbose on) execute u (2);
explain (costs off, verbose on) execute d (3);
execute s (1);
execute i (6);
select * from t1_xc_fqs order by id1;
execute u (2);
select * from t1_xc_fqs order by id1;
execute d (3);
select * from t1_xc_fqs order by id1, id2;
set enable_pbe_optimization to true;
truncate t1_xc_fqs;
insert into t1_xc_fqs values (1,1,1), (2,2,2), (3,3,3), (4,4,4), (5,5,5);
explain (costs off, verbose on) execute s (1);
explain (costs off, verbose on) execute i (6);
explain (costs off, verbose on) execute u (2);
explain (costs off, verbose on) execute d (3);
execute s (1);
execute i (6);
select * from t1_xc_fqs order by id1;
execute u (2);
select * from t1_xc_fqs order by id1;
execute d (3);
select * from t1_xc_fqs order by id1, id2;
deallocate s;
deallocate i;
deallocate u;
deallocate d;
drop table t1_xc_fqs;
-- Testset 2 dynamic datanode reduction for multi-table join
create table t1_xc_fqs(id1 int, id2 int, num int);
insert into t1_xc_fqs values (1,1,11), (2,2,21), (3,3,31), (4,4,41), (5,5,51);
create table t2_xc_fqs(id1 int, id2 int, num int);
insert into t2_xc_fqs values (1,2,12), (2,3,22), (3,4,32), (4,5,42), (5,6,52);
create table t3_xc_fqs(id11 int, id22 int, num int);
insert into t3_xc_fqs values (1,13,13), (2,23,23), (3,33,33), (4,43,43), (5,53,53);
-- implicit join
prepare s0 as select * from t1_xc_fqs t1,t2_xc_fqs t2 where t1.id1=$1 and t2.id1=$2;
prepare s1 as select id11 from t1_xc_fqs t1,t2_xc_fqs t2,t3_xc_fqs t3 where t1.id1=$1 and t2.id1=$2 and t3.id11=$3;
prepare s2 as select * from t1_xc_fqs t1,t2_xc_fqs t2 where t1.id1=t2.id1 and t1.id1=$1;
prepare s3 as select id11 from t1_xc_fqs t1,t2_xc_fqs t2,t3_xc_fqs t3 where t1.id1=t2.id1 and t3.id11=$1;
prepare s4 as select id11 from t1_xc_fqs t1,t2_xc_fqs t2,t3_xc_fqs t3 where t1.id1=t2.id1 and t1.id1=t3.id11 and t3.id11=$1;
prepare s5 as select * from t1_xc_fqs t1,t2_xc_fqs t2 where t1.id1=t2.id2 and t2.id1=$1 and t2.id2=$2;
set enable_pbe_optimization to false;
explain (costs off, verbose on) execute s0 (1,1);
explain (costs off, verbose on) execute s0 (1,3);
explain (costs off, verbose on) execute s1 (2,2,2);
explain (costs off, verbose on) execute s2 (3);
explain (costs off, verbose on) execute s3 (4);
explain (costs off, verbose on) execute s4 (5);
explain (costs off, verbose on) execute s5 (4,5);
execute s0 (1,1);
execute s0 (1,3);
execute s1 (2,2,2);
execute s2 (3);
execute s3 (4);
execute s4 (5);
execute s5 (4,5);
set enable_pbe_optimization to true;
explain (costs off, verbose on) execute s0 (1,1);
explain (costs off, verbose on) execute s0 (1,3);
explain (costs off, verbose on) execute s1 (2,2,2);
explain (costs off, verbose on) execute s2 (3);
explain (costs off, verbose on) execute s3 (4);
explain (costs off, verbose on) execute s4 (5);
explain (costs off, verbose on) execute s5 (4,5);
execute s0 (1,1);
execute s0 (1,3);
execute s1 (2,2,2);
execute s2 (3);
execute s3 (4);
execute s4 (5);
execute s5 (4,5);
deallocate s0;
deallocate s1;
deallocate s2;
deallocate s3;
deallocate s4;
deallocate s5;
-- explicit join
prepare s0 as select * from t1_xc_fqs t1 join t2_xc_fqs t2 on t1.id1=$1 and t2.id1=$2;
prepare s1 as select id11 from t1_xc_fqs t1 join t2_xc_fqs t2 on t1.id1=$1 and t2.id1=$2 join t3_xc_fqs t3 on t3.id11=$3;
prepare s2 as select * from t1_xc_fqs t1 join t2_xc_fqs t2 on t1.id1=t2.id1 and t2.id1=$1;
prepare s3 as select id11 from t1_xc_fqs t1 join t2_xc_fqs t2 on t1.id1=t2.id1 join t3_xc_fqs t3 on t3.id11=$1;
prepare s4 as select id11 from t1_xc_fqs t1 join t2_xc_fqs t2 on t1.id1=t2.id1 join t3_xc_fqs t3 on t1.id1=t3.id11 and t3.id11=$1;
prepare s5 as select * from t1_xc_fqs t1 join t2_xc_fqs t2 on t1.id1=t2.id2 where t2.id1=$1 and t2.id2=$2;
set enable_pbe_optimization to false;
explain (costs off, verbose on) execute s0 (1,1);
explain (costs off, verbose on) execute s0 (1,3);
explain (costs off, verbose on) execute s1 (2,2,2);
explain (costs off, verbose on) execute s2 (3);
explain (costs off, verbose on) execute s3 (4);
explain (costs off, verbose on) execute s4 (5);
explain (costs off, verbose on) execute s5 (4,5);
execute s0 (1,1);
execute s0 (1,3);
execute s1 (2,2,2);
execute s2 (3);
execute s3 (4);
execute s4 (5);
execute s5 (4,5);
set enable_pbe_optimization to true;
explain (costs off, verbose on) execute s0 (1,1);
explain (costs off, verbose on) execute s0 (1,3);
explain (costs off, verbose on) execute s1 (2,2,2);
explain (costs off, verbose on) execute s2 (3);
explain (costs off, verbose on) execute s3 (4);
explain (costs off, verbose on) execute s4 (5);
explain (costs off, verbose on) execute s5 (4,5);
execute s0 (1,1);
execute s0 (1,3);
execute s1 (2,2,2);
execute s2 (3);
execute s3 (4);
execute s4 (5);
execute s5 (4,5);
deallocate s0;
deallocate s1;
deallocate s2;
deallocate s3;
deallocate s4;
deallocate s5;
-- outer join
prepare s0 as select * from t1_xc_fqs t1 left join t2_xc_fqs t2 on t1.id1=t2.id1 and t2.id1=$1 order by t1.id1;
prepare s1 as select * from t1_xc_fqs t1 right join t2_xc_fqs t2 on t1.id1=t2.id1 and t2.id1=$1 order by t2.id1;
prepare s2 as select * from t1_xc_fqs t1 full join t2_xc_fqs t2 on t1.id1=t2.id1 and t2.id1=$1 order by t1.id1, t2.id1;
set enable_pbe_optimization to false;
explain (costs off, verbose on) execute s0 (1);
explain (costs off, verbose on) execute s1 (1);
explain (costs off, verbose on) execute s2 (1);
execute s0 (1);
execute s1 (1);
execute s2 (1);
set enable_pbe_optimization to true;
explain (costs off, verbose on) execute s0 (1);
explain (costs off, verbose on) execute s1 (1);
explain (costs off, verbose on) execute s2 (1);
execute s0 (1);
execute s1 (1);
execute s2 (1);
deallocate s0;
deallocate s1;
deallocate s2;
prepare s0 as select * from t1_xc_fqs t1 left join t2_xc_fqs t2 on t1.id1=t2.id1 and t2.id1=$1 order by t1.id1;
prepare s1 as select * from t1_xc_fqs t1 right join t2_xc_fqs t2 on t1.id1=t2.id1 and t2.id1=$1 order by t2.id1;
prepare s2 as select * from t1_xc_fqs t1 full join t2_xc_fqs t2 on t1.id1=t2.id1 and t2.id1=$1 order by t1.id1, t2.id1;
set enable_pbe_optimization to false;
explain (costs off, verbose on) execute s0 (1);
explain (costs off, verbose on) execute s1 (1);
explain (costs off, verbose on) execute s2 (1);
execute s0 (1);
execute s1 (1);
execute s2 (1);
set enable_pbe_optimization to true;
explain (costs off, verbose on) execute s0 (1);
explain (costs off, verbose on) execute s1 (1);
explain (costs off, verbose on) execute s2 (1);
execute s0 (1);
execute s1 (1);
execute s2 (1);
deallocate s0;
deallocate s1;
deallocate s2;
drop table t1_xc_fqs;
drop table t2_xc_fqs;
drop table t3_xc_fqs;
-- Testset 3 dynamic datanode reduction for single table (column)
create table t1_xc_fqs(id1 int, id2 int, num int) with (orientation = column);
-- only params
prepare s as select * from t1_xc_fqs where id1=$1 and id2=$2;
prepare i as insert into t1_xc_fqs values ($1, $2, $3);
prepare u as update t1_xc_fqs set num=0 where id1=$1 and id2=$2;
prepare d as delete from t1_xc_fqs where id1=$1 and id2=$2;
set enable_pbe_optimization to false;
insert into t1_xc_fqs values (1,1,1), (2,2,2), (3,3,3), (4,4,4), (5,5,5);
explain (costs off, verbose on) execute s (1,1);
explain (costs off, verbose on) execute i (6,6,6);
explain (costs off, verbose on) execute u (2,2);
explain (costs off, verbose on) execute d (3,3);
execute s (1,1);
execute i (6,6,6);
select * from t1_xc_fqs order by id1;
execute u (2,2);
select * from t1_xc_fqs order by id1;
execute d (3,3);
select * from t1_xc_fqs order by id1;
set enable_pbe_optimization to true;
truncate t1_xc_fqs;
insert into t1_xc_fqs values (1,1,1), (2,2,2), (3,3,3), (4,4,4), (5,5,5);
explain (costs off, verbose on) execute s (1,1);
explain (costs off, verbose on) execute i (6,6,6);
explain (costs off, verbose on) execute u (2,2);
explain (costs off, verbose on) execute d (3,3);
execute s (1,1);
execute i (6,6,6);
select * from t1_xc_fqs order by id1;
execute u (2,2);
select * from t1_xc_fqs order by id1;
execute d (3,3);
select * from t1_xc_fqs order by id1;
deallocate s;
deallocate i;
deallocate u;
deallocate d;
-- const and params
prepare s as select * from t1_xc_fqs where id1=$1 and id2=2;
prepare i as insert into t1_xc_fqs values ($1, 2, 3);
prepare u as update t1_xc_fqs set num=1 where id1=$1 and id2=2;
prepare d as delete from t1_xc_fqs where id1=$1 and id2=2;
set enable_pbe_optimization to false;
truncate t1_xc_fqs;
insert into t1_xc_fqs values (1,1,1), (2,2,2), (3,3,3), (4,4,4), (5,5,5);
explain (costs off, verbose on) execute s (1);
explain (costs off, verbose on) execute i (6);
explain (costs off, verbose on) execute u (2);
explain (costs off, verbose on) execute d (3);
execute s (1);
execute i (6);
select * from t1_xc_fqs order by id1, id2;
execute u (2);
select * from t1_xc_fqs order by id1, id2;
execute d (3);
select * from t1_xc_fqs order by id1, id2;
set enable_pbe_optimization to true;
truncate t1_xc_fqs;
insert into t1_xc_fqs values (1,1,1), (2,2,2), (3,3,3), (4,4,4), (5,5,5);
explain (costs off, verbose on) execute s (1);
explain (costs off, verbose on) execute i (6);
explain (costs off, verbose on) execute u (2);
explain (costs off, verbose on) execute d (3);
execute s (1);
execute i (6);
select * from t1_xc_fqs order by id1, id2;
execute u (2);
select * from t1_xc_fqs order by id1, id2;
execute d (3);
select * from t1_xc_fqs order by id1, id2;
deallocate s;
deallocate i;
deallocate u;
deallocate d;
drop table t1_xc_fqs;
-- Testset 4 dynamic datanode reduction for multi-table join (column and row)
create table t1_xc_fqs(id1 int, id2 int, num int) with (orientation = column);
insert into t1_xc_fqs values (1,1,11), (2,2,21), (3,3,31), (4,4,41), (5,5,51);
create table t2_xc_fqs(id1 int, id2 int, num int);
insert into t2_xc_fqs values (1,2,12), (2,3,22), (3,4,32), (4,5,42), (5,6,52);
create table t3_xc_fqs(id11 int, id22 int, num int);
insert into t3_xc_fqs values (1,13,13), (2,23,23), (3,33,33), (4,43,43), (5,53,53);
-- implicit join
prepare s0 as select * from t1_xc_fqs t1,t2_xc_fqs t2 where t1.id1=$1 and t2.id1=$2;
prepare s1 as select id11 from t1_xc_fqs t1,t2_xc_fqs t2,t3_xc_fqs t3 where t1.id1=$1 and t2.id1=$2 and t3.id11=$3;
prepare s2 as select * from t1_xc_fqs t1,t2_xc_fqs t2 where t1.id1=t2.id1 and t1.id1=$1;
prepare s3 as select id11 from t1_xc_fqs t1,t2_xc_fqs t2,t3_xc_fqs t3 where t1.id1=t2.id1 and t3.id11=$1;
prepare s4 as select id11 from t1_xc_fqs t1,t2_xc_fqs t2,t3_xc_fqs t3 where t1.id1=t2.id1 and t1.id1=t3.id11 and t3.id11=$1;
prepare s5 as select * from t1_xc_fqs t1,t2_xc_fqs t2 where t1.id1=t2.id2 and t2.id1=$1 and t2.id2=$2;
set enable_pbe_optimization to false;
explain (costs off, verbose on) execute s0 (1,1);
explain (costs off, verbose on) execute s0 (1,3);
explain (costs off, verbose on) execute s1 (2,2,2);
explain (costs off, verbose on) execute s2 (3);
explain (costs off, verbose on) execute s3 (4);
explain (costs off, verbose on) execute s4 (5);
explain (costs off, verbose on) execute s5 (4,5);
execute s0 (1,1);
execute s0 (1,3);
execute s1 (2,2,2);
execute s2 (3);
execute s3 (4);
execute s4 (5);
execute s5 (4,5);
set enable_pbe_optimization to true;
explain (costs off, verbose on) execute s0 (1,1);
explain (costs off, verbose on) execute s0 (1,3);
explain (costs off, verbose on) execute s1 (2,2,2);
explain (costs off, verbose on) execute s2 (3);
explain (costs off, verbose on) execute s3 (4);
explain (costs off, verbose on) execute s4 (5);
explain (costs off, verbose on) execute s5 (4,5);
execute s0 (1,1);
execute s0 (1,3);
execute s1 (2,2,2);
execute s2 (3);
execute s3 (4);
execute s4 (5);
execute s5 (4,5);
deallocate s0;
deallocate s1;
deallocate s2;
deallocate s3;
deallocate s4;
deallocate s5;
-- explicit join
prepare s0 as select * from t1_xc_fqs t1 join t2_xc_fqs t2 on t1.id1=$1 and t2.id1=$2;
prepare s1 as select id11 from t1_xc_fqs t1 join t2_xc_fqs t2 on t1.id1=$1 and t2.id1=$2 join t3_xc_fqs t3 on t3.id11=$3;
prepare s2 as select * from t1_xc_fqs t1 join t2_xc_fqs t2 on t1.id1=t2.id1 and t2.id1=$1;
prepare s3 as select id11 from t1_xc_fqs t1 join t2_xc_fqs t2 on t1.id1=t2.id1 join t3_xc_fqs t3 on t3.id11=$1;
prepare s4 as select id11 from t1_xc_fqs t1 join t2_xc_fqs t2 on t1.id1=t2.id1 join t3_xc_fqs t3 on t1.id1=t3.id11 and t3.id11=$1;
prepare s5 as select * from t1_xc_fqs t1 join t2_xc_fqs t2 on t1.id1=t2.id2 where t2.id1=$1 and t2.id2=$2;
set enable_pbe_optimization to false;
explain (costs off, verbose on) execute s0 (1,1);
explain (costs off, verbose on) execute s0 (1,3);
explain (costs off, verbose on) execute s1 (2,2,2);
explain (costs off, verbose on) execute s2 (3);
explain (costs off, verbose on) execute s3 (4);
explain (costs off, verbose on) execute s4 (5);
explain (costs off, verbose on) execute s5 (4,5);
execute s0 (1,1);
execute s0 (1,3);
execute s1 (2,2,2);
execute s2 (3);
execute s3 (4);
execute s4 (5);
execute s5 (4,5);
set enable_pbe_optimization to true;
explain (costs off, verbose on) execute s0 (1,1);
explain (costs off, verbose on) execute s0 (1,3);
explain (costs off, verbose on) execute s1 (2,2,2);
explain (costs off, verbose on) execute s2 (3);
explain (costs off, verbose on) execute s3 (4);
explain (costs off, verbose on) execute s4 (5);
explain (costs off, verbose on) execute s5 (4,5);
execute s0 (1,1);
execute s0 (1,3);
execute s1 (2,2,2);
execute s2 (3);
execute s3 (4);
execute s4 (5);
execute s5 (4,5);
deallocate s0;
deallocate s1;
deallocate s2;
deallocate s3;
deallocate s4;
deallocate s5;
drop table t1_xc_fqs;
drop table t2_xc_fqs;
drop table t3_xc_fqs;
-- Testset 5 dynamic datanode reduction for single table (replication)
create table t1_xc_fqs(id1 int, id2 int, num int);
prepare s as select * from t1_xc_fqs where id1=$1 and id2=2;
prepare i as insert into t1_xc_fqs values ($1, 2, 3);
prepare u as update t1_xc_fqs set num=0 where id1=$1 and id2=2;
prepare d as delete from t1_xc_fqs where id1=$1 and id2=2;
set enable_pbe_optimization to false;
insert into t1_xc_fqs values (1,1,1), (2,2,2), (3,3,3), (4,4,4), (5,5,5);
explain (costs off, verbose on) execute s (1);
explain (costs off, verbose on) execute i (6);
explain (costs off, verbose on) execute u (2);
explain (costs off, verbose on) execute d (3);
execute s (1);
execute i (6);
select * from t1_xc_fqs order by id1;
execute u (2);
select * from t1_xc_fqs order by id1;
execute d (3);
select * from t1_xc_fqs order by id1;
set enable_pbe_optimization to true;
truncate t1_xc_fqs;
insert into t1_xc_fqs values (1,1,1), (2,2,2), (3,3,3), (4,4,4), (5,5,5);
explain (costs off, verbose on) execute s (1);
explain (costs off, verbose on) execute i (6);
explain (costs off, verbose on) execute u (2);
explain (costs off, verbose on) execute d (3);
execute s (1);
execute i (6);
select * from t1_xc_fqs order by id1;
execute u (2);
select * from t1_xc_fqs order by id1;
execute d (3);
select * from t1_xc_fqs order by id1;
deallocate s;
deallocate i;
deallocate u;
deallocate d;
drop table t1_xc_fqs;
-- Testset 6 dynamic datanode reduction for multi-table join (replication and distribute)
create table t1_xc_fqs(id1 int, id2 int, num int);
insert into t1_xc_fqs values (1,1,11), (2,2,21), (3,3,31), (4,4,41), (5,5,51);
create table t2_xc_fqs(id1 int, id2 int, num int);
insert into t2_xc_fqs values (1,2,12), (2,3,22), (3,4,32), (4,5,42), (5,6,52);
create table t3_xc_fqs(id11 int, id22 int, num int);
insert into t3_xc_fqs values (1,13,13), (2,23,23), (3,33,33), (4,43,43), (5,53,53);
-- implicit join
prepare s0 as select * from t1_xc_fqs t1,t2_xc_fqs t2 where t1.id1=$1 and t2.id1=$2;
prepare s1 as select id11 from t1_xc_fqs t1,t2_xc_fqs t2,t3_xc_fqs t3 where t1.id1=$1 and t2.id1=$2 and t3.id11=$3;
prepare s2 as select * from t1_xc_fqs t1,t2_xc_fqs t2 where t1.id1=t2.id1 and t1.id1=$1;
prepare s3 as select id11 from t1_xc_fqs t1,t2_xc_fqs t2,t3_xc_fqs t3 where t1.id1=t2.id1 and t3.id11=$1;
prepare s4 as select id11 from t1_xc_fqs t1,t2_xc_fqs t2,t3_xc_fqs t3 where t1.id1=t2.id1 and t1.id1=t3.id11 and t3.id11=$1;
prepare s5 as select * from t1_xc_fqs t1,t2_xc_fqs t2 where t1.id1=t2.id2 and t2.id1=$1 and t2.id2=$2;
set enable_pbe_optimization to false;
explain (costs off, verbose on) execute s0 (1,1);
explain (costs off, verbose on) execute s0 (1,3);
explain (costs off, verbose on) execute s1 (2,2,2);
explain (costs off, verbose on) execute s2 (3);
explain (costs off, verbose on) execute s3 (4);
explain (costs off, verbose on) execute s4 (5);
explain (costs off, verbose on) execute s5 (4,5);
execute s0 (1,1);
execute s0 (1,3);
execute s1 (2,2,2);
execute s2 (3);
execute s3 (4);
execute s4 (5);
execute s5 (4,5);
set enable_pbe_optimization to true;
explain (costs off, verbose on) execute s0 (1,1);
explain (costs off, verbose on) execute s0 (1,3);
explain (costs off, verbose on) execute s1 (2,2,2);
explain (costs off, verbose on) execute s2 (3);
explain (costs off, verbose on) execute s3 (4);
explain (costs off, verbose on) execute s4 (5);
explain (costs off, verbose on) execute s5 (4,5);
execute s0 (1,1);
execute s0 (1,3);
execute s1 (2,2,2);
execute s2 (3);
execute s3 (4);
execute s4 (5);
execute s5 (4,5);
deallocate s0;
deallocate s1;
deallocate s2;
deallocate s3;
deallocate s4;
deallocate s5;
-- explicit join
prepare s0 as select * from t1_xc_fqs t1 join t2_xc_fqs t2 on t1.id1=$1 and t2.id1=$2;
prepare s1 as select id11 from t1_xc_fqs t1 join t2_xc_fqs t2 on t1.id1=$1 and t2.id1=$2 join t3_xc_fqs t3 on t3.id11=$3;
prepare s2 as select * from t1_xc_fqs t1 join t2_xc_fqs t2 on t1.id1=t2.id1 and t2.id1=$1;
prepare s3 as select id11 from t1_xc_fqs t1 join t2_xc_fqs t2 on t1.id1=t2.id1 join t3_xc_fqs t3 on t3.id11=$1;
prepare s4 as select id11 from t1_xc_fqs t1 join t2_xc_fqs t2 on t1.id1=t2.id1 join t3_xc_fqs t3 on t1.id1=t3.id11 and t3.id11=$1;
prepare s5 as select * from t1_xc_fqs t1 join t2_xc_fqs t2 on t1.id1=t2.id2 where t2.id1=$1 and t2.id2=$2;
set enable_pbe_optimization to false;
explain (costs off, verbose on) execute s0 (1,1);
explain (costs off, verbose on) execute s0 (1,3);
explain (costs off, verbose on) execute s1 (2,2,2);
explain (costs off, verbose on) execute s2 (3);
explain (costs off, verbose on) execute s3 (4);
explain (costs off, verbose on) execute s4 (5);
explain (costs off, verbose on) execute s5 (4,5);
execute s0 (1,1);
execute s0 (1,3);
execute s1 (2,2,2);
execute s2 (3);
execute s3 (4);
execute s4 (5);
execute s5 (4,5);
set enable_pbe_optimization to true;
explain (costs off, verbose on) execute s0 (1,1);
explain (costs off, verbose on) execute s0 (1,3);
explain (costs off, verbose on) execute s1 (2,2,2);
explain (costs off, verbose on) execute s2 (3);
explain (costs off, verbose on) execute s3 (4);
explain (costs off, verbose on) execute s4 (5);
explain (costs off, verbose on) execute s5 (4,5);
execute s0 (1,1);
execute s0 (1,3);
execute s1 (2,2,2);
execute s2 (3);
execute s3 (4);
execute s4 (5);
execute s5 (4,5);
deallocate s0;
deallocate s1;
deallocate s2;
deallocate s3;
deallocate s4;
deallocate s5;
drop table t1_xc_fqs;
drop table t2_xc_fqs;
drop table t3_xc_fqs;
--Optimization
create table t1_xc_fqs(id1 int, id2 int, num int);
insert into t1_xc_fqs values (1,1,1), (2,2,2), (3,3,3), (4,4,4), (5,5,5);
prepare a as select num from t1_xc_fqs where id1=$1 order by id2;
set enable_pbe_optimization to false;
explain verbose execute a (1);
execute a (1);
set enable_pbe_optimization to true;
explain verbose execute a (1);
execute a (1);
deallocate a;
drop table t1_xc_fqs;
-- Testset bug fixing
create table distribute_by_int (int1 int,numeric1 numeric(7,3));
prepare a as insert into distribute_by_int values ($1,$2);
explain verbose execute a(51,1111);
execute a(51,1111);
explain verbose execute a(51,1111);
deallocate a;
drop table distribute_by_int;
create table distribute_by_date (col_date date, c_ts_without timestamp without time zone, c_ts_with timestamp with time zone);
insert into distribute_by_date values ('2014-09-12 00:00:00','2014-09-12 00:00:00');
prepare a as select * from distribute_by_date where col_date=$1;
explain verbose execute a('2014-09-12 00:00:00');
deallocate a;
drop table distribute_by_date;
create table distribute_by_varchar (char1 char(4),varchar1 varchar(50));
insert into distribute_by_varchar values ('10','10');
prepare a as delete from distribute_by_varchar where varchar1=$1;
explain verbose execute a('10');
deallocate a;
drop table distribute_by_varchar;
CREATE TABLE pbe_prunning_000(id INT,part INT, c_bigint bigint, c_text text);
insert into pbe_prunning_000 values (10,10,10,'abcdefghijklmn0010');
CREATE TABLE pbe_prunning_tmp (id INT,part INT, c_bigint bigint, c_text text);
SET enable_pbe_optimization to false;
PREPARE pa AS INSERT into pbe_prunning_tmp(id,part,c_bigint, c_text) SELECT id,part,c_bigint, c_text FROM pbe_prunning_000 pp0 WHERE pp0.c_bigint=$1 AND pp0.c_text=$2;
EXECUTE pa(10,'abcdefghijklmn0010');
SELECT * FROM pbe_prunning_tmp pp1 WHERE pp1.c_bigint=10 AND pp1.c_text='abcdefghijklmn0010';
DEALLOCATE PREPARE pa;
PREPARE pa AS UPDATE pbe_prunning_tmp pp1 SET id=999 WHERE pp1.c_bigint=$1 AND pp1.c_text=$2;
EXECUTE pa(10,'abcdefghijklmn0010');
SELECT * FROM pbe_prunning_tmp pp1 WHERE pp1.c_bigint=10 AND pp1.c_text='abcdefghijklmn0010';
DEALLOCATE PREPARE pa;
drop table pbe_prunning_tmp;
drop table pbe_prunning_000;
SET enable_pbe_optimization to false;
create table t_DTS2017082304009 (id int,name text);
insert into t_DTS2017082304009 values (1,'a'),(2,'b'),(3,'c'), (4,'d'),(5,'e');
prepare a as select * from t_DTS2017082304009 where id=$1;
execute a (1);
execute a (2);
execute a (3);
execute a (4);
execute a (5);
execute a (1);
deallocate a;
drop table t_DTS2017082304009;
-- Bugfix for FQS multi-table join
create table t1(id1 int, id2 int, num int);
insert into t1 values (1,11,11), (2,21,21), (3,31,31), (4,41,41), (5,51,51);
create table t2(id1 int, id2 int, num int);
insert into t2 values (1,12,12), (2,22,22), (3,32,32), (4,42,42), (5,52,52);
create table t3(id11 int, id22 int, num int);
insert into t3 values (1,13,13), (2,23,23), (3,33,33), (4,43,43), (5,53,53);
prepare a as select id11 from t1, t2, t3 where t1.id1=$1 and t2.id1=$2 and t3.id11=$3;
prepare b as select id11 from t1, t2, t3 where t1.id1=t2.id1 and t3.id11=$1;
prepare c as select id11 from t1,t2,t3 where t1.id1=t2.id1 and t1.id1=t3.id11 and t1.id1=$1;
SET enable_pbe_optimization to false;
execute a (1,1,1);
execute b (1);
execute c (1);
SET enable_pbe_optimization to true;
execute a (1,1,1);
execute b (1);
execute c (1);
drop table t1;
drop table t2;
drop table t3;
CREATE TABLE pbe_prunning_001 (id INT, c_int INT, c_numeric NUMERIC(7,3));
CREATE TABLE pbe_prunning_002 (id INT, c_int INT, c_numeric NUMERIC(7,3));
INSERT INTO pbe_prunning_001 values (1, 1, 1);
INSERT INTO pbe_prunning_002 values (1, 1, 1);
PREPARE pa AS SELECT * FROM pbe_prunning_001 pp1 RIGHT OUTER JOIN pbe_prunning_002 pp2 ON pp1.c_int=pp2.c_int WHERE (pp1.c_int=$1 AND pp1.c_numeric=$2 AND pp2.c_int=$3 AND pp2.c_numeric=$4) or pp1.id=$5;
EXPLAIN(COSTS FALSE) EXECUTE pa(10,10,10,10,11);
DEALLOCATE PREPARE pa;
DROP TABLE pbe_prunning_001;
DROP TABLE pbe_prunning_002;
create table pbe_prunning_000(id INT,part INT, c_int INT, c_numeric NUMERIC(7,3));
insert into pbe_prunning_000 values(1,1,10,10);
CREATE TABLE pbe_prunning_tmp (id INT,part INT, c_int INT, c_numeric NUMERIC(7,3));
set enable_pbe_optimization to false;
PREPARE pa AS INSERT INTO pbe_prunning_tmp (id, part, c_int, c_numeric) SELECT id, part, c_int, c_numeric FROM pbe_prunning_000 pp0 WHERE pp0.c_int=$1 AND pp0.c_numeric=$2;
explain(costs off)execute pa(10,10);
EXECUTE pa(10,10);
deallocate pa;
PREPARE pa AS INSERT INTO pbe_prunning_tmp (id, part, c_int, c_numeric) SELECT id, part, c_int, c_numeric FROM pbe_prunning_000 pp0 WHERE pp0.c_int=$1;
explain(costs off)execute pa(10);
EXECUTE pa(10);
select * from pbe_prunning_tmp;
deallocate pa;
drop table pbe_prunning_000;
drop table pbe_prunning_tmp;
CREATE TABLE pbe_prunning_001 (id INT,part INT, c_int INT, c_numeric NUMERIC(7,3));
insert into pbe_prunning_001 values(1937,1937,1937.000);
insert into pbe_prunning_001 values(1938,1938,1938.000);
CREATE TABLE pbe_prunning_002 (id INT,part INT, c_int INT, c_numeric NUMERIC(7,3));
set enable_pbe_optimization to false;
PREPARE pa AS SELECT * FROM pbe_prunning_001 pp1 CROSS JOIN pbe_prunning_002 pp2 WHERE pp1.c_int=$1 OR pp1.c_numeric=$2 OR pp2.c_int=$3 OR pp2.c_numeric=$4 order by 1,2,3,4,5,6;
explain(costs off) execute pa(10,10,10,10);
EXECUTE pa(10,10,10,10);
deallocate pa;
PREPARE pa AS SELECT * FROM pbe_prunning_001 pp1 CROSS JOIN pbe_prunning_002 pp2 WHERE pp1.c_int=$1 OR pp1.c_numeric=$2 OR pp2.c_int=$3 order by 1,2,3,4,5,6;
explain(costs off) execute pa(10,10,10);
EXECUTE pa(10,10,10);
deallocate pa;
drop table pbe_prunning_001;
drop table pbe_prunning_002;
--mix options: custom, generic, stream
create table t1_xc_fqs(id1 int, id2 int, num int);
insert into t1_xc_fqs values (1,11,11), (2,21,21);
create table t2_xc_fqs(id1 int, id2 int, num int);
insert into t2_xc_fqs values (1,12,12), (1,22,22), (2,22,22);
prepare s0 as select * from t1_xc_fqs t1,t2_xc_fqs t2 where t1.id1=$1 and t2.id1=$2 and t2.id2=$3;
set enable_pbe_optimization to false;
explain(costs off, verbose on) execute s0 (1,1,12);
execute s0 (1,1,12);
explain(costs off, verbose on) execute s0 (1,1,22);
execute s0 (1,1,22);
explain(costs off, verbose on) execute s0 (1,1,12);
execute s0 (1,1,12);
explain(costs off, verbose on) execute s0 (1,1,22);
execute s0 (1,1,22);
explain(costs off, verbose on) execute s0 (1,1,12);
execute s0 (1,1,12);
explain(costs off, verbose on) execute s0 (1,1,22);
execute s0 (1,1,22);
set enable_pbe_optimization to true;
explain(costs off, verbose on) execute s0 (1,1,12);
execute s0 (1,1,12);
explain(costs off, verbose on) execute s0 (1,1,22);
execute s0 (1,1,22);
explain(costs off, verbose on) execute s0 (1,1,12);
execute s0 (1,1,12);
explain(costs off, verbose on) execute s0 (1,1,22);
execute s0 (1,1,22);
explain(costs off, verbose on) execute s0 (1,1,12);
execute s0 (1,1,12);
explain(costs off, verbose on) execute s0 (1,1,22);
execute s0 (1,1,22);
set enable_pbe_optimization to false;
explain(costs off, verbose on) execute s0 (1,1,12);
execute s0 (1,1,12);
explain(costs off, verbose on) execute s0 (1,1,22);
execute s0 (1,1,22);
explain(costs off, verbose on) execute s0 (1,1,12);
execute s0 (1,1,12);
explain(costs off, verbose on) execute s0 (1,1,22);
execute s0 (1,1,22);
explain(costs off, verbose on) execute s0 (1,1,12);
execute s0 (1,1,12);
explain(costs off, verbose on) execute s0 (1,1,22);
execute s0 (1,1,22);
deallocate s0;
drop table t1_xc_fqs;
drop table t2_xc_fqs;
set enable_pbe_optimization to true;
create table DTS2018081308755_t1 (id int, num int);
insert into DTS2018081308755_t1 values (1,1),(20,20);
explain analyze create table DTS2018081308755_t2 as select * from DTS2018081308755_t1;
drop table DTS2018081308755_t2;
drop table DTS2018081308755_t1;
create table cs_his(segment1 varchar(15), period_name varchar(15), currency_code varchar(15), frequency_code varchar(15), segment3 varchar(15), segment3_desc varchar(200), end_balance_dr numeric, end_balance_cr numeric) with (orientation=column);
create table bs_his(row_desc varchar(800),row_id numeric,amount1 numeric, amount2 numeric, period_name varchar(80), frequency_code varchar(80), currency_code varchar(80), segment1 varchar(80)) with (orientation=column);
insert into cs_his values('11','20190227','22','33','44','55',1.3,3.5);
insert into cs_his values('11','20181231','22','33','44','55',1.3,3.5);
CREATE OR REPLACE FUNCTION test_func(v_date character varying, OUT ret integer)
RETURNS integer
LANGUAGE plpgsql
NOT FENCED
AS $$DECLARE
V_DT VARCHAR2(10);
V_LY_END VARCHAR2(10) := '20181231';
BEGIN
insert into bs_his
(row_desc,
row_id,
amount1,
amount2,
period_name,
frequency_code,
currency_code,
segment1)
select '资 产:',
'1',
'' qc,
'' qm,
b.period_name,
b.frequency_code,
b.currency_code,
b.segment1
from cs_his b
where b.period_name in (v_date, V_LY_END);
END $$;
select test_func(20190227);
select test_func(20190227);
select test_func(20190227);
select test_func(20190227);
select test_func(20190227);
select test_func(20190227);
select test_func(20190227);
--14 rows
select * from bs_his order by period_name;
drop FUNCTION test_func;
drop table bs_his;
drop table cs_his; | the_stack |
-- Insert
insert into px_parallel_dml_t1 select generate_series(1,60),generate_series(1,60);
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t2 select generate_series(1,60),generate_series(1,60);
insert into px_parallel_dml_t2 select generate_series(1,60),generate_series(1,60);
select count(*) from px_parallel_dml_t1;
select count(*) from px_parallel_dml_t2;
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t1 select c2, c1 from px_parallel_dml_t1;
insert into px_parallel_dml_t2 select c2, c1 from px_parallel_dml_t1;
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t1 select c2, c1 from px_parallel_dml_t2;
insert into px_parallel_dml_t1 select c2, c1 from px_parallel_dml_t2;
select count(*) from px_parallel_dml_t1;
select count(*) from px_parallel_dml_t2;
insert into px_parallel_dml_t1 select c2, c1 from px_parallel_dml_t2 where c1 = '1';
insert into px_parallel_dml_t2 select c2, c1 from px_parallel_dml_t1 where c1 = '1';
select count(*) from px_parallel_dml_t1;
select count(*) from px_parallel_dml_t2;
set polar_px_enable_insert_from_tableless=0;
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t1 VALUES(100,100);
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t2 VALUES(200,200);
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t1 select generate_series(101,150),generate_series(101,150);
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t2 select generate_series(101,150),generate_series(101,150);
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t1 select 1,2;
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t2 select 3,4;
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t1 select generate_series(201,250), c2 from px_parallel_dml_t2;
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t1 select generate_series(301,350),generate_series(301,350) union select * from px_parallel_dml_t3;
-- Use PX Insert
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t1 select * from px_parallel_dml_t2;
-- Assert Op DML
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t1 select * from px_parallel_dml_t2 where c1 = (select c2 from px_parallel_dml_t3);
insert into px_parallel_dml_t1 select * from px_parallel_dml_t2 where c1 = (select c2 from px_parallel_dml_t3);
-- Test Ordered Sensitive
set polar_px_enable_insert_order_sensitive=1;
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t1 select * from px_parallel_dml_t2;
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t1 select * from px_parallel_dml_t2 order by px_parallel_dml_t2.c1;
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t1 select c2 from px_parallel_dml_t2 group by px_parallel_dml_t2.c2 order by px_parallel_dml_t2.c2;
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t1 select generate_series(101,150),generate_series(101,150);
set polar_px_enable_insert_order_sensitive=0;
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t1 select * from px_parallel_dml_t2;
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t1 select * from px_parallel_dml_t2 order by px_parallel_dml_t2.c1;
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t1 select c2 from px_parallel_dml_t2 group by px_parallel_dml_t2.c2 order by px_parallel_dml_t2.c2;
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t1 select generate_series(101,150),generate_series(101,150);
--Insert into normal table select * from partition table
insert into px_parallel_dml_t0_insert select px_parallel_dml_t0_hash.id,px_parallel_dml_t1_range.value from px_parallel_dml_t0_hash,px_parallel_dml_t1_range where px_parallel_dml_t0_hash.id = px_parallel_dml_t1_range.id and px_parallel_dml_t1_range.id < 2000;
insert into px_parallel_dml_t0_insert select px_parallel_dml_t0_hash.id,px_parallel_dml_t1_range.value from px_parallel_dml_t0_hash,px_parallel_dml_t1_range where px_parallel_dml_t0_hash.id = px_parallel_dml_t1_range.id and px_parallel_dml_t1_range.id < 2000;
insert into px_parallel_dml_t0_insert select px_parallel_dml_t0_hash.id,px_parallel_dml_t1_range.value from px_parallel_dml_t0_hash,px_parallel_dml_t1_range where px_parallel_dml_t0_hash.id = px_parallel_dml_t1_range.id and px_parallel_dml_t1_range.id < 2000;
insert into px_parallel_dml_t0_insert select * from px_parallel_dml_t0_hash where id < 2000;
insert into px_parallel_dml_t0_insert select * from px_parallel_dml_t0_hash where id < 2000;
insert into px_parallel_dml_t0_insert select px_parallel_dml_t0_hash.id,px_parallel_dml_t1_range.value from px_parallel_dml_t0_hash,px_parallel_dml_t1_range where px_parallel_dml_t0_hash.id = px_parallel_dml_t1_range.id and px_parallel_dml_t1_range.id > 28000;
insert into px_parallel_dml_t0_insert select * from px_parallel_dml_t0_hash,px_parallel_dml_t1_range where px_parallel_dml_t0_hash.id = px_parallel_dml_t1_range.id and px_parallel_dml_t1_range.id > 28000;
insert into px_parallel_dml_t0_insert select * from px_parallel_dml_t1_range where id > 29000;
insert into px_parallel_dml_t0_insert select * from px_parallel_dml_t1_range where id > 29000;
insert into px_parallel_dml_t0_insert select * from px_parallel_dml_t2_list where job='student';
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t0_insert select 100000,pvalue from px_parallel_dml_t2_list where job='student';
insert into px_parallel_dml_t0_insert select 100000,pvalue from px_parallel_dml_t2_list where job='student';
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t0_insert select id, px_parallel_dml_t2_list.pvalue from px_parallel_dml_t2_list,px_parallel_dml_t0_hash where px_parallel_dml_t2_list.job='student' and px_parallel_dml_t0_hash.id < 5000 LIMIT 5000;
insert into px_parallel_dml_t0_insert select id, px_parallel_dml_t2_list.pvalue from px_parallel_dml_t2_list,px_parallel_dml_t0_hash where px_parallel_dml_t2_list.job='student' and px_parallel_dml_t0_hash.id < 5000 LIMIT 5000;
select count(*)from px_parallel_dml_t0_insert;
-- Open the px_enable_insert_partition_table
set polar_px_enable_insert_partition_table='on';
--Insert into partition table select * from normal table
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t0_hash select * from px_parallel_dml_t0_select_table limit 1000;
insert into px_parallel_dml_t0_hash select * from px_parallel_dml_t0_select_table limit 1000;
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t1_range select * from px_parallel_dml_t0_select_table limit 1000;
insert into px_parallel_dml_t1_range select * from px_parallel_dml_t0_select_table limit 1000;
-- With Index
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t1_range_index select * from px_parallel_dml_t0_select_table limit 1000;
insert into px_parallel_dml_t1_range_index select * from px_parallel_dml_t0_select_table limit 1000;
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t2_list select 'student',px_parallel_dml_t0_select_table.id from px_parallel_dml_t0_select_table limit 1000;
insert into px_parallel_dml_t2_list select * from px_parallel_dml_t0_select_table limit 1000;
select count(*) from px_parallel_dml_t0_hash;
select count(*) from px_parallel_dml_t1_range;
select count(*) from px_parallel_dml_t2_list;
--Insert into partition table select * from partition table
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t0_hash select * from px_parallel_dml_t1_range where id < 2000;
insert into px_parallel_dml_t0_hash select * from px_parallel_dml_t1_range where id < 2000;
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t0_hash select * from px_parallel_dml_t2_list where job='teachar' and pvalue < 12000;
insert into px_parallel_dml_t0_hash select 100000,pvalue from px_parallel_dml_t2_list where job='teachar' and pvalue < 12000;
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t1_range select * from px_parallel_dml_t0_hash where id > 28000;
insert into px_parallel_dml_t1_range select * from px_parallel_dml_t0_hash where id > 28000;
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t1_range select * from px_parallel_dml_t2_list where job='teachar' and pvalue < 12000;
insert into px_parallel_dml_t1_range select 100000,pvalue from px_parallel_dml_t2_list where job='teachar' and pvalue < 12000;
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t2_list select 'student',px_parallel_dml_t0_hash.id from px_parallel_dml_t0_hash where id > 28000;
insert into px_parallel_dml_t2_list select * from px_parallel_dml_t0_hash where id > 28000;
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t2_list select * from px_parallel_dml_t1_range where id < 2000;
insert into px_parallel_dml_t2_list select * from px_parallel_dml_t1_range where id < 2000;
select count(*) from px_parallel_dml_t0_hash;
select count(*) from px_parallel_dml_t1_range;
select count(*) from px_parallel_dml_t2_list;
-- Close the px_enable_insert_partition_table
set polar_px_enable_insert_partition_table='off';
--Insert into partition table select * from normal table
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t0_hash select * from px_parallel_dml_t0_select_table limit 1000;
insert into px_parallel_dml_t0_hash select * from px_parallel_dml_t0_select_table limit 1000;
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t1_range select * from px_parallel_dml_t0_select_table limit 1000;
insert into px_parallel_dml_t1_range select * from px_parallel_dml_t0_select_table limit 1000;
-- With Index
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t1_range_index select * from px_parallel_dml_t0_select_table limit 1000;
insert into px_parallel_dml_t1_range_index select * from px_parallel_dml_t0_select_table limit 1000;
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t2_list select 'student',px_parallel_dml_t0_select_table.id from px_parallel_dml_t0_select_table limit 1000;
insert into px_parallel_dml_t2_list select * from px_parallel_dml_t0_select_table limit 1000;
select count(*) from px_parallel_dml_t0_hash;
select count(*) from px_parallel_dml_t1_range;
select count(*) from px_parallel_dml_t2_list;
--Insert into partition table select * from partition table
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t0_hash select * from px_parallel_dml_t1_range where id < 2000;
insert into px_parallel_dml_t0_hash select * from px_parallel_dml_t1_range where id < 2000;
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t0_hash select * from px_parallel_dml_t2_list where job='teachar' and pvalue < 12000;
insert into px_parallel_dml_t0_hash select 100000,pvalue from px_parallel_dml_t2_list where job='teachar' and pvalue < 12000;
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t1_range select * from px_parallel_dml_t0_hash where id > 28000;
insert into px_parallel_dml_t1_range select * from px_parallel_dml_t0_hash where id > 28000;
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t1_range select * from px_parallel_dml_t2_list where job='teachar' and pvalue < 12000;
insert into px_parallel_dml_t1_range select 100000,pvalue from px_parallel_dml_t2_list where job='teachar' and pvalue < 12000;
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t2_list select * from 'student',px_parallel_dml_t0_hash.id where id > 28000;
insert into px_parallel_dml_t2_list select * from px_parallel_dml_t0_hash where id > 28000;
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t2_list select * from px_parallel_dml_t1_range where id < 2000;
insert into px_parallel_dml_t2_list select * from px_parallel_dml_t1_range where id < 2000;
select count(*) from px_parallel_dml_t0_hash;
select count(*) from px_parallel_dml_t1_range;
select count(*) from px_parallel_dml_t2_list;
------------------------------------------------------------------------
--Insert into ... select from index
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t3 select * from px_parallel_dml_t4 where c1 < 500;
insert into px_parallel_dml_t3 select * from px_parallel_dml_t4 where c1 < 500;
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t3 select * from px_parallel_dml_t4 where c2 < 500;
insert into px_parallel_dml_t3 select * from px_parallel_dml_t4 where c2 < 500;
select count(*) from px_parallel_dml_t3;
------------------------------------------------------------------------
-- Select Join
-- Innser join
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t1 select c1,px_parallel_dml_t3.c2 from px_parallel_dml_t2 LEFT OUTER JOIN px_parallel_dml_t3 using(c1);
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t1 select c1,px_parallel_dml_t3.c2 from px_parallel_dml_t2 RIGHT OUTER JOIN px_parallel_dml_t3 using(c1);
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t1 select c1,px_parallel_dml_t3.c2 from px_parallel_dml_t2 FULL OUTER JOIN px_parallel_dml_t3 using(c1);
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t1 select px_parallel_dml_t2.c1,px_parallel_dml_t3.c2 from px_parallel_dml_t2 CROSS JOIN px_parallel_dml_t3;
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t1 select c1,px_parallel_dml_t3.c2 from px_parallel_dml_t2 NATURAL JOIN px_parallel_dml_t3;
select count(*) from px_parallel_dml_t1;
------------------------------------------------------------------------
-- Group BY
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t1 select * from px_parallel_dml_t2 group by c1,c2;
insert into px_parallel_dml_t1 select * from px_parallel_dml_t2 group by c1,c2;
select count(*) from px_parallel_dml_t1;
--------------------------------------------------------------------------
-- Insert not NULL Constrains Table
set polar_px_optimizer_enable_dml_constraints='off';
insert into px_parallel_dml_t6 select generate_series(1,1000),NULL;
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t5 select * from px_parallel_dml_t6;
insert into px_parallel_dml_t5 select * from px_parallel_dml_t6;
set polar_px_optimizer_enable_dml_constraints='on';
select count(*) from px_parallel_dml_t5;
----------------------------------------------------------------------------
---- Insert into table with default num
EXPLAIN (VERBOSE, COSTS OFF) insert into px_parallel_dml_t8 select c1 from px_parallel_dml_t9;
insert into px_parallel_dml_t8 select c1 from px_parallel_dml_t9;
select * from px_parallel_dml_t8 ORDER BY c1 ASC; | the_stack |
set enable_trigger_shipping = off;
create schema xc_trigship;
set search_path to xc_trigship,public;
\set EXP 'EXPLAIN (verbose, num_costs off)'
\set CHECK_TABLE 'select * from xctrigemp1 order by id'
\set RUN_UPDATE 'update xctrigemp1 set empsal = empsal + 1000 where empname != $$Dummy$$';
\set RUN_DELETE 'delete from xctrigemp1 where empname || now() = $$Dummy$$ || now()';
\set TRUNC 'truncate table xc_auditlog, xctrigemp1';
\set RUN_INSERT 'insert into xctrigemp1 values (1, $$Akash$$, 1000, $$AkashAddress$$), (2, $$Prakash$$, 1500, $$PrakashAddress$$), (3, $$Vikas$$, NULL, $$VikasAddress$$), (4, $$Samar$$, -9999, $$SamarAddress$$), (5, $$Sanika$$, 2000, $$SanikaAddress$$), (-1, $$Dummy$$, 9999, $$DummyAddress$$)'
-- Create Objects
-----------------
-- Base table on which the DML operations would be fired.
create table xctrigemp1 (id int unique, empname varchar unique, empsal float, empadd varchar, trigop varchar);
alter table xctrigemp1 alter column id set not null;
alter table xctrigemp1 alter column empname set not null;
-- Table where all the logs of DML operations would be dumped.
create table xc_auditlog (trigdata varchar, nodename varchar);
alter table xc_auditlog add primary key(trigdata, nodename);
-- Convenience function to be used by all the trigger functions to dump all the trigger
-- information including name, operation etc into the xc_auditlog table.
CREATE FUNCTION xc_auditlog_func (tg_name name, tg_op text, tg_level text, tg_when text,
oldrow text, newrow text, nodename name) returns void as $$
DECLARE
trigdata varchar;
BEGIN
trigdata := left(tg_level, 1) || left(tg_op, 1) || left(tg_when, 1) || ' ' || tg_name;
if (tg_level = 'ROW') then
if (oldrow is not null) then
trigdata := trigdata || ' ' || oldrow;
end if;
if (newrow is not null) then
trigdata := trigdata || ' ' || newrow;
end if;
end if;
insert into xc_auditlog values (trigdata, nodename::varchar);
END
$$ language plpgsql;
-- STATEMENT trigger function. This also dumps everything except the row.
CREATE FUNCTION xc_stmttrig_func() RETURNS TRIGGER AS $$
BEGIN
perform xc_auditlog_func(TG_NAME, TG_OP, TG_LEVEL, TG_WHEN, NULL, NULL, pgxc_node_str());
RETURN NULL;
END $$ immutable LANGUAGE 'plpgsql';
-- A few statement triggers.
CREATE TRIGGER xc_stmttrig1 BEFORE INSERT OR UPDATE OR DELETE ON xctrigemp1
FOR EACH STATEMENT EXECUTE PROCEDURE xc_stmttrig_func();
CREATE TRIGGER xc_stmttrig2 AFTER INSERT OR UPDATE OR DELETE ON xctrigemp1
FOR EACH STATEMENT EXECUTE PROCEDURE xc_stmttrig_func();
-- Main trigger function to be used by triggers. It skips the DML operation if
-- salary is invalid. And it inserts a 'default' salary amount if it is NULL.
create function xc_brt_func() returns trigger as
$$
begin
IF (TG_OP = 'DELETE') then
OLD.trigop = OLD.trigop || '_' || left(TG_OP, 1) || left(TG_WHEN, 1) || '_' || TG_NAME;
perform xc_auditlog_func(TG_NAME, TG_OP, TG_LEVEL, TG_WHEN, OLD::text, NULL, pgxc_node_str());
return OLD;
ELSE
if NEW.trigop is NULL then
NEW.trigop = '';
end if;
IF (TG_OP = 'INSERT') then
IF NEW.empsal IS NULL THEN
NEW.empsal := 9999;
END IF;
END IF;
NEW.trigop = NEW.trigop || '_' || left(TG_OP, 1) || left(TG_WHEN, 1) || '_' || TG_NAME;
perform xc_auditlog_func(TG_NAME, TG_OP, TG_LEVEL, TG_WHEN, NULL, NEW::text, pgxc_node_str());
END IF;
IF NEW.empsal < 0 THEN
return NULL;
ELSE
return NEW;
END IF;
end
$$ immutable language plpgsql;
-- Additional trigger function so that we can have a mix of shippable and non-shippable
-- triggers. Turn on or off the volatility of this function as required.
create function xc_brt_vol_func() returns trigger as
$$
begin
IF (TG_OP = 'DELETE') then
OLD.trigop = OLD.trigop || '_' || left(TG_OP, 1) || left(TG_WHEN, 1) || '_' || TG_NAME;
perform xc_auditlog_func(TG_NAME, TG_OP, TG_LEVEL, TG_WHEN, OLD::text, NULL, pgxc_node_str());
return OLD;
ELSE
NEW.trigop = NEW.trigop || '_' || left(TG_OP, 1) || left(TG_WHEN, 1) || '_' || TG_NAME;
perform xc_auditlog_func(TG_NAME, TG_OP, TG_LEVEL, TG_WHEN, NULL, NEW::text, pgxc_node_str());
END IF;
return NEW;
end
$$ immutable language plpgsql; -- Declare this initially immutable, to be changed later.
-- A few BEFORE ROW triggers to start with
CREATE TRIGGER brtrig2 BEFORE INSERT ON xctrigemp1
FOR EACH ROW EXECUTE PROCEDURE xc_brt_vol_func();
CREATE TRIGGER brtrig3 BEFORE INSERT OR UPDATE OR DELETE ON xctrigemp1
FOR EACH ROW EXECUTE PROCEDURE xc_brt_func();
CREATE TRIGGER brtrig1 BEFORE INSERT OR UPDATE OR DELETE ON xctrigemp1
FOR EACH ROW EXECUTE PROCEDURE xc_brt_func();
\set QUIET false
-- Setup is now ready to test shippability with BR triggers.
-- All functions are immutable, so all the queries should be shippable or should
-- invoke all of the row triggers on datanode if the query is not shippable.
-- Statement triggers are always executed on coordinator.
:RUN_INSERT;
:RUN_UPDATE;
:RUN_DELETE;
:CHECK_TABLE;
-- Make the statement trigger non-shippable. Even with this, the statement
-- should be shippable. Statement triggers are anyway invoked separately for
-- FQS query.
alter function xc_stmttrig_func() volatile;
:TRUNC;
:RUN_INSERT;
:RUN_UPDATE;
:RUN_DELETE;
:CHECK_TABLE;
-- Make trigger brtrig2 non-shippable.
-- Now, the INSERTs should execute *all* of the ROW triggers on coordinator.
-- Also, the brtrig2 trigger being non-shippable should not affect the
-- shippability of DELETEs or UPDATEs. They should still invoke triggers on datanodes.
-- This is because brtrig2 is defined only for INSERT.
alter function xc_stmttrig_func() immutable; -- (Turn stmt trigger back to shippable)
alter function xc_brt_vol_func() volatile;
:TRUNC;
:RUN_INSERT;
:RUN_UPDATE;
:RUN_DELETE;
:CHECK_TABLE;
-- Now include UPDATE in the brtrig2 trigger definition, and verify
-- that the UPDATE is now invoking triggers on coordinator. DELETEs should
-- continue running on datanodes.
DROP TRIGGER brtrig2 on xctrigemp1;
CREATE TRIGGER brtrig2 BEFORE INSERT OR UPDATE ON xctrigemp1
FOR EACH ROW EXECUTE PROCEDURE xc_brt_vol_func();
:TRUNC;
:RUN_INSERT;
:RUN_UPDATE;
:RUN_DELETE;
:CHECK_TABLE;
-- Keep 2 shippable BR triggers, and 1 non-shippable AR trigger.
-- Since there are non-shippable AR triggers, the BR triggers also should be
-- executed on coordinator even when they are all shippable.
DROP TRIGGER brtrig1 on xctrigemp1;
DROP TRIGGER brtrig2 on xctrigemp1;
DROP TRIGGER brtrig3 on xctrigemp1;
CREATE TRIGGER brtrig3 BEFORE INSERT OR UPDATE OR DELETE ON xctrigemp1
FOR EACH ROW EXECUTE PROCEDURE xc_brt_func();
CREATE TRIGGER brtrig1 BEFORE INSERT OR UPDATE OR DELETE ON xctrigemp1
FOR EACH ROW EXECUTE PROCEDURE xc_brt_func();
CREATE TRIGGER artrig AFTER INSERT OR UPDATE OR DELETE ON xctrigemp1
FOR EACH ROW EXECUTE PROCEDURE xc_brt_vol_func();
alter function xc_brt_func() immutable;
alter function xc_brt_vol_func() volatile;
:TRUNC;
:RUN_INSERT;
:RUN_INSERT; -- This should invoke the constraint triggers.
:RUN_UPDATE;
update xctrigemp1 set empname = 'Akash' where empname != $$Dummy$$; -- Constraint triggers
:RUN_DELETE;
:CHECK_TABLE;
-- Make the above AR trigger shippable. This will cause both AR and BR triggers
-- to run on datanode.
alter function xc_brt_vol_func() immutable;
:TRUNC;
:RUN_INSERT;
:RUN_UPDATE;
:RUN_DELETE;
:CHECK_TABLE;
-- Make one of the BR triggers non-shippable. This should not affect AR triggers.
-- They should continue to run on datanode.
alter function xc_brt_func() volatile;
:TRUNC;
:RUN_INSERT;
:RUN_UPDATE;
:RUN_DELETE;
:CHECK_TABLE;
-- Drop all BR triggers. We have only AR triggers and they are shippable. So the query should be FQSed.
DROP TRIGGER brtrig1 on xctrigemp1;
DROP TRIGGER brtrig3 on xctrigemp1;
:TRUNC;
:RUN_INSERT;
:RUN_UPDATE;
:RUN_DELETE;
:CHECK_TABLE;
-- When non-shippable AR triggers are present, we do execute BR triggers also on coordinator,
-- and so in the remote UPDATE stmt, we update *all* the columns. But when we do
-- not have BR triggers in the first place, this should revert back the remote
-- UPDATE statement to the normal behaviour where it updates only the user-supplied
-- columns.
-- Make the AR trigger function non-shippable.
alter function xc_brt_vol_func() volatile;
:TRUNC;
:RUN_INSERT;
:RUN_UPDATE;
:RUN_DELETE;
:CHECK_TABLE;
drop schema xc_trigship cascade;
--self add
--test insert/update/delete ship trigger
--1. create table
create table test_trigger_src_tbl(id1 int, id2 int, id3 int);
create table test_trigger_des_tbl(id1 int, id2 int, id3 int);
--2. create trigger function
create or replace function tri_insert_func() returns trigger as
$$
declare
begin
insert into test_trigger_des_tbl values(new.id1, new.id2, new.id3); --can ship
--insert into test_trigger_des_tbl values(1,2,3); --can not ship
--insert into test_trigger_des_tbl(id2,id3) values(new.id2, new.id3); --can not ship
return new;
end
$$ language plpgsql;
create or replace function tri_update_func() returns trigger as
$$
declare
begin
update test_trigger_des_tbl set id3 = new.id3 where id1=old.id1 and id1>50 and id1<350; --can ship
update test_trigger_des_tbl set id3 = new.id3 where id1=200 and id1=old.id1 and id1<250; --can ship
update test_trigger_des_tbl set id3 = new.id3 where id1>200 and id1=old.id1; --can ship
update test_trigger_des_tbl set id3 = new.id3 where id1=old.id1 and id1>50; --can ship
update test_trigger_des_tbl set id3 = new.id3 where id1=old.id1; --can ship
--update test_trigger_des_tbl set id3 = new.id3 where id1=old.id1 or id1>50; --can not ship
--update test_trigger_des_tbl set id3 = new.id3 where id1=old.id1 and id1=100 or id1>50 or id1<350; --can not ship
--update test_trigger_des_tbl set id3 = new.id3 where id1=old.id1 or id1>50 or id1<350; --can not ship
--update test_trigger_des_tbl set id3 = new.id3 where id1>old.id1 and id1=old.id1; --can not ship
--update test_trigger_des_tbl set id3 = new.id3 where id1>old.id1 and id1=50; --can not ship
--update test_trigger_des_tbl set id3 = new.id3 where id2>old.id2 and id2=50; --can not ship
--update test_trigger_des_tbl set id3 = new.id3 where id2=old.id2 and id1=50; --can not ship
--update test_trigger_des_tbl set id3 = new.id3 where id2=old.id2; --can not ship
return new;
end
$$ language plpgsql;
create or replace function tri_delete_func() returns trigger as
$$
declare
begin
delete from test_trigger_des_tbl where id1=old.id1;
return old;
end
$$ language plpgsql;
create trigger insert_trigger
before insert on test_trigger_src_tbl
for each row
execute procedure tri_insert_func();
create trigger update_trigger
after update on test_trigger_src_tbl
for each row
execute procedure tri_update_func();
create trigger delete_trigger
before delete on test_trigger_src_tbl
for each row
execute procedure tri_delete_func();
set enable_trigger_shipping = off;
PREPARE insert1_call_trigger (int, int, int) AS INSERT INTO test_trigger_src_tbl VALUES($1, $2, $3);
EXECUTE insert1_call_trigger(100, 100, 100);
set enable_trigger_shipping = on;
PREPARE insert2_call_trigger (int, int, int) AS INSERT INTO test_trigger_src_tbl VALUES($1, $2, $3);
EXECUTE insert2_call_trigger(200, 200, 200);
select * from test_trigger_src_tbl order by id1;
select * from test_trigger_des_tbl order by id1;
set enable_trigger_shipping = off;
set enable_trigger_shipping = on;
select * from test_trigger_src_tbl order by id1;
select * from test_trigger_des_tbl order by id1;
set enable_trigger_shipping = off;
set enable_trigger_shipping = on;
select * from test_trigger_src_tbl order by id1;
select * from test_trigger_des_tbl order by id1;
drop table if exists test_trigger_src_tbl;
drop table if exists test_trigger_des_tbl; | the_stack |
;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
create database if not exists `coinexchangedev`;
USE `coinexchangedev`;
/*Table structure for table `balance` */
DROP TABLE IF EXISTS `balance`;
CREATE TABLE `balance` (
`BalanceId` int(10) NOT NULL AUTO_INCREMENT,
`Currency` varchar(10) DEFAULT NULL,
`AccountId` int(11) DEFAULT NULL,
`AvailableBalance` double DEFAULT NULL,
`CurrentBalance` double DEFAULT NULL,
`PendingBalance` double DEFAULT NULL,
`IsFrozen` tinyint(1) DEFAULT NULL,
PRIMARY KEY (`BalanceId`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
/*Table structure for table `currencypair` */
DROP TABLE IF EXISTS `currencypair`;
CREATE TABLE `currencypair` (
`CurrencyPairName` varchar(25) NOT NULL,
`BaseCurrency` varchar(10) DEFAULT NULL,
`QuoteCurrency` varchar(10) DEFAULT NULL,
PRIMARY KEY (`CurrencyPairName`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC;
/*Table structure for table `deposit` */
DROP TABLE IF EXISTS `deposit`;
CREATE TABLE `deposit` (
`Id` int(11) NOT NULL AUTO_INCREMENT,
`Currency` varchar(7) DEFAULT NULL,
`IsCryptoCurrency` tinyint(1) DEFAULT NULL,
`AccountId` int(11) DEFAULT NULL,
`DepositId` varchar(100) DEFAULT NULL,
`Date` datetime(6) DEFAULT NULL,
`Amount` double DEFAULT NULL,
`Fee` double DEFAULT NULL,
`Confirmations` int(11) DEFAULT NULL,
`Status` varchar(15) DEFAULT NULL,
`Type` varchar(15) DEFAULT NULL,
`TransactionId` varchar(100) DEFAULT NULL,
`BitcoinAddress` varchar(100) DEFAULT NULL,
PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
/*Table structure for table `depositaddress` */
DROP TABLE IF EXISTS `depositaddress`;
CREATE TABLE `depositaddress` (
`Id` int(11) NOT NULL AUTO_INCREMENT,
`Currency` varchar(15) DEFAULT NULL,
`IsCryptoCurrency` tinyint(1) DEFAULT NULL,
`AccountId` int(11) DEFAULT NULL,
`BitcoinAddress` varchar(50) DEFAULT NULL,
`Status` varchar(20) DEFAULT NULL,
`CreationDateTime` datetime DEFAULT NULL,
`DateUsed` datetime DEFAULT NULL,
PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
/*Table structure for table `depositlimit` */
DROP TABLE IF EXISTS `depositlimit`;
CREATE TABLE `depositlimit` (
`Id` int(10) NOT NULL AUTO_INCREMENT,
`TierLevel` varchar(15) DEFAULT NULL,
`DailyLimit` double DEFAULT NULL,
`MonthlyLimit` double DEFAULT NULL,
`LimitsCurrency` varchar(20) DEFAULT NULL,
PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
/*Table structure for table `fee` */
DROP TABLE IF EXISTS `fee`;
CREATE TABLE `fee` (
`Id` int(11) NOT NULL AUTO_INCREMENT,
`CurrencyPair` varchar(15) DEFAULT NULL,
`PercentageFee` double DEFAULT NULL,
`Amount` double DEFAULT NULL,
PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=51 DEFAULT CHARSET=latin1;
/*Table structure for table `ledger` */
DROP TABLE IF EXISTS `ledger`;
CREATE TABLE `ledger` (
`Id` int(11) NOT NULL AUTO_INCREMENT,
`LedgerId` varchar(50) DEFAULT NULL,
`DateTime` datetime(6) DEFAULT NULL,
`LedgerType` varchar(15) DEFAULT NULL,
`Currency` varchar(15) DEFAULT NULL,
`AccountId` int(11) DEFAULT NULL,
`Amount` double DEFAULT NULL,
`AmountInUsd` double DEFAULT NULL,
`Fee` double DEFAULT NULL,
`Balance` double DEFAULT NULL,
`TradeId` varchar(50) DEFAULT NULL,
`OrderId` varchar(50) DEFAULT NULL,
`WithdrawId` varchar(50) DEFAULT NULL,
`DepositId` varchar(50) DEFAULT NULL,
`IsBaseCurrencyInTrade` tinyint(1) DEFAULT NULL,
PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
/*Table structure for table `mfasubscription` */
DROP TABLE IF EXISTS `mfasubscription`;
CREATE TABLE `mfasubscription` (
`MfaSubscriptionId` varchar(11) NOT NULL,
`MfaSubscriptionName` varchar(50) DEFAULT NULL,
PRIMARY KEY (`MfaSubscriptionId`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Table structure for table `mfasubscriptionstatus` */
DROP TABLE IF EXISTS `mfasubscriptionstatus`;
CREATE TABLE `mfasubscriptionstatus` (
`Id` int(11) NOT NULL AUTO_INCREMENT,
`ApiKey` varchar(100) DEFAULT NULL,
`UserId` int(11) DEFAULT NULL,
`Enabled` tinyint(1) DEFAULT NULL,
`MfaSubscriptionId` varchar(11) DEFAULT NULL,
PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Table structure for table `ohlc` */
DROP TABLE IF EXISTS `ohlc`;
CREATE TABLE `ohlc` (
`Id` int(11) NOT NULL AUTO_INCREMENT,
`DateTime` datetime DEFAULT NULL,
`Open` decimal(10,5) DEFAULT NULL,
`High` decimal(10,5) DEFAULT NULL,
`Low` decimal(10,5) DEFAULT NULL,
`Close` decimal(10,5) DEFAULT NULL,
`Volume` decimal(10,5) DEFAULT NULL,
`CurrencyPair` varchar(100) DEFAULT NULL,
`AveragePrice` decimal(10,5) DEFAULT NULL,
`TotalWeight` decimal(10,5) DEFAULT NULL,
PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Table structure for table `order` */
DROP TABLE IF EXISTS `order`;
CREATE TABLE `order` (
`OrderId` varchar(100) NOT NULL,
`OrderType` varchar(100) DEFAULT NULL,
`OrderSide` varchar(100) DEFAULT NULL,
`Price` decimal(10,5) DEFAULT NULL,
`VolumeExecuted` decimal(10,5) DEFAULT NULL,
`Status` varchar(100) DEFAULT NULL,
`TraderId` varchar(100) DEFAULT NULL,
`CurrencyPair` varchar(25) DEFAULT NULL,
`OrderDateTime` datetime DEFAULT NULL,
`Volume` decimal(10,5) DEFAULT NULL,
`OpenQuantity` decimal(10,5) DEFAULT NULL,
`AveragePrice` decimal(10,5) DEFAULT NULL,
`ClosingDateTime` datetime DEFAULT NULL,
PRIMARY KEY (`OrderId`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Table structure for table `passwordcoderecord` */
DROP TABLE IF EXISTS `passwordcoderecord`;
CREATE TABLE `passwordcoderecord` (
`Id` int(11) NOT NULL,
`ForgotPasswordCode` varchar(100) DEFAULT NULL,
`ExpirationDateTime` datetime DEFAULT NULL,
`CreationDateTime` datetime DEFAULT NULL,
`IsUsed` tinyint(1) DEFAULT NULL,
`UserId` int(11) DEFAULT NULL,
PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Table structure for table `pendingtransaction` */
DROP TABLE IF EXISTS `pendingtransaction`;
CREATE TABLE `pendingtransaction` (
`Id` int(11) NOT NULL AUTO_INCREMENT,
`BalanceId` int(10) DEFAULT NULL,
`Currency` varchar(20) DEFAULT NULL,
`InstanceId` varchar(50) DEFAULT NULL,
`PendingTransactionType` int(11) DEFAULT NULL,
`Amount` double DEFAULT NULL,
PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1;
/*Table structure for table `permission` */
DROP TABLE IF EXISTS `permission`;
CREATE TABLE `permission` (
`PermissionId` varchar(10) NOT NULL,
`PermissionName` varchar(50) DEFAULT NULL,
PRIMARY KEY (`PermissionId`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Table structure for table `securitykeyspair` */
DROP TABLE IF EXISTS `securitykeyspair`;
CREATE TABLE `securitykeyspair` (
`ApiKey` varchar(100) NOT NULL,
`SecretKey` varchar(100) DEFAULT NULL,
`KeyDescription` varchar(50) DEFAULT NULL,
`ExpirationDate` datetime DEFAULT NULL,
`StartDate` datetime DEFAULT NULL,
`EndDate` datetime DEFAULT NULL,
`LastModified` datetime DEFAULT NULL,
`SystemGenerated` tinyint(1) DEFAULT NULL,
`UserId` int(11) DEFAULT NULL,
`CreationDateTime` datetime DEFAULT NULL,
`EnableExpirationDate` tinyint(1) DEFAULT NULL,
`EnableStartDate` tinyint(1) DEFAULT NULL,
`EnableEndDate` tinyint(1) DEFAULT NULL,
`Deleted` tinyint(1) DEFAULT NULL,
`MfaCode` varchar(100) DEFAULT NULL,
PRIMARY KEY (`ApiKey`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Table structure for table `securitykeyspermission` */
DROP TABLE IF EXISTS `securitykeyspermission`;
CREATE TABLE `securitykeyspermission` (
`Id` int(11) NOT NULL AUTO_INCREMENT,
`ApiKey` varchar(100) DEFAULT NULL,
`PermissionId` varchar(10) DEFAULT NULL,
`IsAllowed` tinyint(1) DEFAULT NULL,
PRIMARY KEY (`Id`),
KEY `FK_apikeypermission` (`PermissionId`),
CONSTRAINT `FK_apikeypermission` FOREIGN KEY (`PermissionId`) REFERENCES `permission` (`PermissionId`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Table structure for table `tickerinfo` */
DROP TABLE IF EXISTS `tickerinfo`;
CREATE TABLE `tickerinfo` (
`Id` int(11) NOT NULL AUTO_INCREMENT,
`AskPrice` decimal(10,5) DEFAULT NULL,
`AskVolume` decimal(10,5) DEFAULT NULL,
`BidPrice` decimal(10,5) DEFAULT NULL,
`BidVolume` decimal(10,5) DEFAULT NULL,
`OpeningPrice` decimal(10,5) DEFAULT NULL,
`TradePrice` decimal(10,5) DEFAULT NULL,
`TradeVolume` decimal(10,5) DEFAULT NULL,
`TodaysVolumeWeight` decimal(10,5) DEFAULT NULL,
`Last24HourVolumeWeight` decimal(10,5) DEFAULT NULL,
`TodaysTrades` bigint(20) DEFAULT NULL,
`Last24HourTrades` bigint(20) DEFAULT NULL,
`TodaysLow` decimal(10,5) DEFAULT NULL,
`Last24HoursLow` decimal(10,5) DEFAULT NULL,
`TodaysHigh` decimal(10,5) DEFAULT NULL,
`Last24HoursHigh` decimal(10,5) DEFAULT NULL,
`TodaysVolume` decimal(10,5) DEFAULT NULL,
`Last24HourVolume` decimal(10,5) DEFAULT NULL,
`CurrencyPair` varchar(50) DEFAULT NULL,
PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC;
/*Table structure for table `tier` */
DROP TABLE IF EXISTS `tier`;
CREATE TABLE `tier` (
`TierLevel` varchar(30) NOT NULL,
`TierName` varchar(100) DEFAULT NULL,
PRIMARY KEY (`TierLevel`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Table structure for table `trade` */
DROP TABLE IF EXISTS `trade`;
CREATE TABLE `trade` (
`TradeId` varchar(100) NOT NULL,
`Price` decimal(10,5) DEFAULT NULL,
`Volume` decimal(10,5) DEFAULT NULL,
`ExecutionDateTime` datetime DEFAULT NULL,
`CurrencyPair` varchar(50) DEFAULT NULL,
`BuyOrderId` varchar(100) DEFAULT NULL,
`BuyTraderId` varchar(100) DEFAULT NULL,
`SellOrderId` varchar(100) DEFAULT NULL,
`SellTraderId` varchar(100) DEFAULT NULL,
PRIMARY KEY (`TradeId`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Table structure for table `user` */
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`Id` int(11) NOT NULL AUTO_INCREMENT,
`UserName` varchar(50) DEFAULT NULL,
`Password` varchar(100) DEFAULT NULL,
`PublicKey` varchar(100) DEFAULT NULL,
`Email` varchar(50) DEFAULT NULL,
`Language` varchar(100) DEFAULT NULL,
`TimeZone` mediumblob,
`AutoLogout` bigint(20) DEFAULT NULL,
`LastLogin` datetime DEFAULT NULL,
`ActivationKey` varchar(50) DEFAULT NULL,
`Country` varchar(50) DEFAULT NULL,
`State` varchar(50) DEFAULT NULL,
`PhoneNumber` varchar(50) DEFAULT NULL,
`Address1` varchar(100) DEFAULT NULL,
`Address2` varchar(100) DEFAULT NULL,
`IsActivationKeyUsed` tinyint(1) DEFAULT NULL,
`IsUserBlocked` tinyint(1) DEFAULT NULL,
`Deleted` tinyint(1) DEFAULT NULL,
`ForgotPasswordCode` varchar(100) DEFAULT NULL,
`ForgotPasswordCodeExpiration` datetime DEFAULT NULL,
`City` varchar(50) DEFAULT NULL,
`ZipCode` int(11) DEFAULT NULL,
`SocialSecurityNumber` varchar(50) DEFAULT NULL,
`NationalIdentificationNumber` varchar(50) DEFAULT NULL,
`FullName` varchar(50) DEFAULT NULL,
`DateOfBirth` date DEFAULT NULL,
`AdminEmailsSubscribed` tinyint(1) DEFAULT NULL,
`NewsletterEmailsSubscribed` tinyint(1) DEFAULT NULL,
`MfaCode` varchar(60) DEFAULT NULL,
PRIMARY KEY (`Id`),
UNIQUE KEY `NewIndex1` (`UserName`,`Email`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Table structure for table `userdocument` */
DROP TABLE IF EXISTS `userdocument`;
CREATE TABLE `userdocument` (
`Id` int(11) NOT NULL AUTO_INCREMENT,
`DocumentType` varchar(50) DEFAULT NULL,
`DocumentPath` varchar(200) DEFAULT NULL,
`UserId` int(11) DEFAULT NULL,
PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Table structure for table `usertierlevelstatus` */
DROP TABLE IF EXISTS `usertierlevelstatus`;
CREATE TABLE `usertierlevelstatus` (
`Id` int(11) NOT NULL AUTO_INCREMENT,
`TierLevel` varchar(50) DEFAULT NULL,
`Status` varchar(50) DEFAULT NULL,
`UserId` int(11) DEFAULT NULL,
PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Table structure for table `withdraw` */
DROP TABLE IF EXISTS `withdraw`;
CREATE TABLE `withdraw` (
`Id` int(11) NOT NULL AUTO_INCREMENT,
`WithdrawId` varchar(50) DEFAULT NULL,
`Currency` varchar(10) DEFAULT NULL,
`IsCryptoCurrency` tinyint(1) DEFAULT NULL,
`Amount` double DEFAULT NULL,
`AmountInUsd` double DEFAULT NULL,
`Fee` double DEFAULT NULL,
`DateTime` datetime DEFAULT NULL,
`Type` varchar(15) DEFAULT NULL,
`Status` varchar(15) DEFAULT NULL,
`AccountId` int(11) DEFAULT NULL,
`BankName` varchar(20) DEFAULT NULL,
`BankAccountAddress` varchar(20) DEFAULT NULL,
`BankAccountSwiftCode` varchar(20) DEFAULT NULL,
`TransactionId` varchar(50) DEFAULT NULL,
`BitcoinAddress` varchar(50) DEFAULT NULL,
PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Table structure for table `withdrawaddress` */
DROP TABLE IF EXISTS `withdrawaddress`;
CREATE TABLE `withdrawaddress` (
`Id` int(10) NOT NULL AUTO_INCREMENT,
`Currency` varchar(15) DEFAULT NULL,
`IsCryptoCurrency` tinyint(1) DEFAULT NULL,
`AccountId` int(11) DEFAULT NULL,
`BitcoinAddress` varchar(50) DEFAULT NULL,
`Description` varchar(140) DEFAULT NULL,
`CreationDateTime` datetime DEFAULT NULL,
PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Table structure for table `withdrawfees` */
DROP TABLE IF EXISTS `withdrawfees`;
CREATE TABLE `withdrawfees` (
`Id` int(11) NOT NULL AUTO_INCREMENT,
`Currency` varchar(15) DEFAULT NULL,
`MinimumAmount` double DEFAULT NULL,
`Fee` double DEFAULT NULL,
PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
/*Table structure for table `withdrawlimit` */
DROP TABLE IF EXISTS `withdrawlimit`;
CREATE TABLE `withdrawlimit` (
`Id` int(10) NOT NULL AUTO_INCREMENT,
`TierLevel` varchar(15) DEFAULT NULL,
`DailyLimit` double DEFAULT NULL,
`MonthlyLimit` double DEFAULT NULL,
`LimitsCurrency` varchar(20) DEFAULT NULL,
PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; | the_stack |
-- // CLOUD-65294 Sync database with domains
-- Migration SQL that makes the change goes here.
-- account_preferences
ALTER TABLE account_preferences
ALTER COLUMN maxnumberofclusters DROP NOT NULL,
ALTER COLUMN maxnumberofnodespercluster DROP NOT NULL,
ALTER COLUMN maxnumberofclustersperuser DROP NOT NULL;
-- blueprint
DELETE FROM blueprint WHERE account IS NULL OR owner IS NULL;
DELETE FROM blueprint WHERE
blueprintname IS NULL OR
blueprinttext IS NULL;
UPDATE blueprint SET hostgroupcount = 0 WHERE hostgroupcount IS NULL;
ALTER TABLE blueprint
ALTER COLUMN account SET NOT NULL,
ALTER COLUMN blueprintname SET NOT NULL,
ALTER COLUMN blueprinttext SET NOT NULL,
ALTER COLUMN hostgroupcount DROP NOT NULL,
ALTER COLUMN owner SET NOT NULL;
-- cloudbreakevent
DELETE FROM cloudbreakevent WHERE account IS NULL OR owner IS NULL;
DELETE FROM cloudbreakevent WHERE
cloud IS NULL OR
eventmessage IS NULL OR
eventtimestamp IS NULL OR
eventtype IS NULL OR
nodecount IS NULL OR
region IS NULL OR
stackid IS NULL OR
stackname IS NULL OR
stackstatus IS NULL;
ALTER TABLE cloudbreakevent
ALTER COLUMN account SET NOT NULL,
ALTER COLUMN cloud SET NOT NULL,
ALTER COLUMN eventmessage SET NOT NULL,
ALTER COLUMN eventtimestamp SET NOT NULL,
ALTER COLUMN eventtype SET NOT NULL,
ALTER COLUMN nodecount SET NOT NULL,
ALTER COLUMN owner SET NOT NULL,
ALTER COLUMN region SET NOT NULL,
ALTER COLUMN stackid SET NOT NULL,
ALTER COLUMN stackname SET NOT NULL,
ALTER COLUMN stackstatus SET NOT NULL;
-- cloudbreakusage
DELETE FROM cloudbreakusage WHERE account IS NULL OR owner IS NULL;
DELETE FROM cloudbreakusage WHERE
day IS NULL OR
instancegroup IS NULL OR
instancetype IS NULL OR
provider IS NULL OR
region IS NULL OR
stackid IS NULL OR
stackname IS NULL;
UPDATE cloudbreakusage SET costs = 0.0 WHERE costs IS NULL;
UPDATE cloudbreakusage SET instancehours = 0 WHERE instancehours IS NULL;
ALTER TABLE cloudbreakusage
ALTER COLUMN account SET NOT NULL,
ALTER COLUMN costs SET NOT NULL,
ALTER COLUMN day SET NOT NULL,
ALTER COLUMN instancegroup SET NOT NULL,
ALTER COLUMN instancehours SET NOT NULL,
ALTER COLUMN instancetype SET NOT NULL,
ALTER COLUMN owner SET NOT NULL,
ALTER COLUMN provider SET NOT NULL,
ALTER COLUMN region SET NOT NULL,
ALTER COLUMN stackid SET NOT NULL,
ALTER COLUMN stackname SET NOT NULL;
-- cluster
DELETE FROM cluster WHERE account IS NULL OR owner IS NULL;
UPDATE cluster SET emailneeded = FALSE WHERE emailneeded IS NULL;
UPDATE cluster SET secure = FALSE WHERE secure IS NULL;
UPDATE cluster SET status = 'WAIT_FOR_SYNC' WHERE status IS NULL;
UPDATE cluster SET username = '' WHERE username IS NULL;
UPDATE cluster SET password = '' WHERE password IS NULL;
UPDATE cluster SET configstrategy = 'ALWAYS_APPLY_DONT_OVERRIDE_CUSTOM_VALUES' WHERE configstrategy IS NULL;
ALTER TABLE cluster
ALTER COLUMN account SET NOT NULL,
ALTER COLUMN emailneeded SET NOT NULL,
ALTER COLUMN owner SET NOT NULL,
ALTER COLUMN secure SET NOT NULL,
ALTER COLUMN status SET NOT NULL,
ALTER COLUMN username SET NOT NULL,
ALTER COLUMN password SET NOT NULL,
ALTER COLUMN configstrategy SET NOT NULL;
-- clustertemplate
DELETE FROM clustertemplate WHERE account IS NULL OR owner IS NULL;
ALTER TABLE clustertemplate
ALTER COLUMN account SET NOT NULL,
ALTER COLUMN owner SET NOT NULL;
-- component
ALTER TABLE component
ALTER COLUMN componenttype DROP NOT NULL,
ALTER COLUMN attributes DROP NOT NULL;
-- constrainttemplate
DELETE FROM constrainttemplate WHERE account IS NULL OR owner IS NULL;
UPDATE constrainttemplate SET status = 'USER_MANAGED' WHERE status IS NULL;
ALTER TABLE constrainttemplate
ALTER COLUMN account SET NOT NULL,
ALTER COLUMN owner SET NOT NULL,
ALTER COLUMN status SET NOT NULL;
-- credential
DELETE FROM credential WHERE account IS NULL OR owner IS NULL;
ALTER TABLE credential
ALTER COLUMN account SET NOT NULL,
ALTER COLUMN owner SET NOT NULL;
-- flowlog
DELETE FROM flowlog WHERE stackid IS NULL;
UPDATE flowlog SET finalized = TRUE WHERE finalized IS NULL;
ALTER TABLE flowlog
ALTER COLUMN stackid SET NOT NULL,
ALTER COLUMN finalized SET NOT NULL;
-- hostgroup
DELETE FROM hostgroup WHERE cluster_id IS NULL;
UPDATE hostgroup SET name = 'undefined' WHERE name IS NULL;
ALTER TABLE hostgroup
ALTER COLUMN name SET NOT NULL,
ALTER COLUMN cluster_id SET NOT NULL;
-- hostmetadata
DELETE FROM hostmetadata WHERE hostgroup_id IS NULL;
UPDATE hostmetadata SET hostname = 'undefined' WHERE hostname IS NULL;
UPDATE hostmetadata SET hostmetadatastate = 'UNHEALTHY' WHERE hostmetadatastate IS NULL;
ALTER TABLE hostmetadata
ALTER COLUMN hostname SET NOT NULL,
ALTER COLUMN hostgroup_id SET NOT NULL,
ALTER COLUMN hostmetadatastate SET NOT NULL;
-- instancegroup
DELETE FROM instancegroup WHERE stack_id IS NULL;
UPDATE instancegroup SET groupname = 'undefined' WHERE groupname IS NULL;
UPDATE instancegroup SET instancegrouptype = 'CORE' WHERE instancegrouptype IS NULL;
UPDATE instancegroup SET nodecount = 0 WHERE nodecount IS NULL;
ALTER TABLE instancegroup
ALTER COLUMN groupname SET NOT NULL,
ALTER COLUMN instancegrouptype SET NOT NULL,
ALTER COLUMN nodecount SET NOT NULL,
ALTER COLUMN stack_id SET NOT NULL;
-- instancemetadata
UPDATE instancemetadata SET instancestatus = 'FAILED' WHERE instancestatus IS NULL;
ALTER TABLE instancemetadata
ALTER COLUMN instancestatus SET NOT NULL;
-- ldapconfig
DELETE FROM ldapconfig WHERE account IS NULL OR owner IS NULL;
UPDATE ldapconfig SET serverssl = FALSE WHERE serverssl IS NULL;
UPDATE ldapconfig SET binddn = 'undefined' WHERE binddn IS NULL;
UPDATE ldapconfig SET bindpassword = 'undefined' WHERE bindpassword IS NULL;
ALTER TABLE ldapconfig
ALTER COLUMN account SET NOT NULL,
ALTER COLUMN owner SET NOT NULL,
ALTER COLUMN serverssl SET NOT NULL,
ALTER COLUMN binddn SET NOT NULL,
ALTER COLUMN bindpassword SET NOT NULL;
-- network
DELETE FROM network WHERE account IS NULL OR owner IS NULL;
UPDATE network SET status = 'USER_MANAGED' WHERE status IS NULL;
ALTER TABLE network
ALTER COLUMN account SET NOT NULL,
ALTER COLUMN owner SET NOT NULL,
ALTER COLUMN status SET NOT NULL;
-- rdsconfig
DELETE FROM rdsconfig WHERE databasetype IS NULL;
UPDATE rdsconfig SET connectionurl = 'undefined' WHERE connectionurl IS NULL;
UPDATE rdsconfig SET connectionusername = 'undefined' WHERE connectionusername IS NULL;
UPDATE rdsconfig SET connectionpassword = 'undefined' WHERE connectionpassword IS NULL;
ALTER TABLE rdsconfig
ALTER COLUMN connectionurl SET NOT NULL,
ALTER COLUMN connectionusername SET NOT NULL,
ALTER COLUMN connectionpassword SET NOT NULL,
ALTER COLUMN databasetype SET NOT NULL,
ALTER COLUMN creationdate DROP NOT NULL;
-- recipe
DELETE FROM recipe WHERE account IS NULL OR owner IS NULL;
UPDATE recipe SET name = 'undefined' WHERE name IS NULL;
ALTER TABLE recipe
ALTER COLUMN account SET NOT NULL,
ALTER COLUMN name SET NOT NULL,
ALTER COLUMN owner SET NOT NULL;
-- resource
DELETE FROM resource WHERE resourcetype IS NULL OR resourcestatus IS NULL;
ALTER TABLE resource
ALTER COLUMN resourcetype SET NOT NULL,
ALTER COLUMN resourcestatus SET NOT NULL;
-- securitygroup
DELETE FROM securitygroup WHERE account IS NULL OR owner IS NULL;
UPDATE securitygroup SET status = 'USER_MANAGED' WHERE status IS NULL;
ALTER TABLE securitygroup
ALTER COLUMN account SET NOT NULL,
ALTER COLUMN owner SET NOT NULL,
ALTER COLUMN status SET NOT NULL;
-- sssdconfig
DELETE FROM sssdconfig WHERE account IS NULL OR owner IS NULL;
ALTER TABLE sssdconfig
ALTER COLUMN account SET NOT NULL,
ALTER COLUMN owner SET NOT NULL;
-- stack
DELETE FROM stack WHERE account IS NULL OR owner IS NULL;
UPDATE stack SET onfailureactionaction = 'ROLLBACK' WHERE onfailureactionaction IS NULL;
UPDATE stack SET region = 'undefined' WHERE region IS NULL;
UPDATE stack SET status = 'WAIT_FOR_SYNC' WHERE status IS NULL;
ALTER TABLE stack
ALTER COLUMN account SET NOT NULL,
ALTER COLUMN onfailureactionaction SET NOT NULL,
ALTER COLUMN owner SET NOT NULL,
ALTER COLUMN region SET NOT NULL,
ALTER COLUMN status SET NOT NULL,
ALTER COLUMN created DROP NOT NULL,
ALTER COLUMN gatewayport DROP NOT NULL;
-- template
DELETE FROM template WHERE account IS NULL OR owner IS NULL;
UPDATE template SET volumecount = 1 WHERE volumecount IS NULL;
UPDATE template SET instancetype = 'undefined' WHERE instancetype IS NULL;
UPDATE template SET status = 'USER_MANAGED' WHERE status IS NULL;
ALTER TABLE template
ALTER COLUMN account SET NOT NULL,
ALTER COLUMN owner SET NOT NULL,
ALTER COLUMN volumecount SET NOT NULL,
ALTER COLUMN instancetype SET NOT NULL,
ALTER COLUMN status SET NOT NULL;
-- topology
DELETE FROM topology WHERE owner IS NULL;
UPDATE topology SET deleted = FALSE WHERE deleted IS NULL;
ALTER TABLE topology
ALTER COLUMN owner SET NOT NULL,
ALTER COLUMN deleted SET NOT NULL;
-- //@UNDO
-- SQL to undo the change goes here.
-- account_preferences
ALTER TABLE account_preferences
ALTER COLUMN maxnumberofclusters SET NOT NULL,
ALTER COLUMN maxnumberofnodespercluster SET NOT NULL,
ALTER COLUMN maxnumberofclustersperuser SET NOT NULL;
-- blueprint
ALTER TABLE blueprint
ALTER COLUMN account DROP NOT NULL,
ALTER COLUMN blueprintname DROP NOT NULL,
ALTER COLUMN blueprinttext DROP NOT NULL,
ALTER COLUMN hostgroupcount SET NOT NULL,
ALTER COLUMN owner DROP NOT NULL;
-- cloudbreakevent
ALTER TABLE cloudbreakevent
ALTER COLUMN account DROP NOT NULL,
ALTER COLUMN cloud DROP NOT NULL,
ALTER COLUMN eventmessage DROP NOT NULL,
ALTER COLUMN eventtimestamp DROP NOT NULL,
ALTER COLUMN eventtype DROP NOT NULL,
ALTER COLUMN nodecount DROP NOT NULL,
ALTER COLUMN owner DROP NOT NULL,
ALTER COLUMN region DROP NOT NULL,
ALTER COLUMN stackid DROP NOT NULL,
ALTER COLUMN stackname DROP NOT NULL,
ALTER COLUMN stackstatus DROP NOT NULL;
-- cloudbreakusage
ALTER TABLE cloudbreakusage
ALTER COLUMN account DROP NOT NULL,
ALTER COLUMN costs DROP NOT NULL,
ALTER COLUMN day DROP NOT NULL,
ALTER COLUMN instancegroup DROP NOT NULL,
ALTER COLUMN instancehours DROP NOT NULL,
ALTER COLUMN instancetype DROP NOT NULL,
ALTER COLUMN owner DROP NOT NULL,
ALTER COLUMN provider DROP NOT NULL,
ALTER COLUMN region DROP NOT NULL,
ALTER COLUMN stackid DROP NOT NULL,
ALTER COLUMN stackname DROP NOT NULL;
-- cluster
ALTER TABLE cluster
ALTER COLUMN account DROP NOT NULL,
ALTER COLUMN emailneeded DROP NOT NULL,
ALTER COLUMN owner DROP NOT NULL,
ALTER COLUMN secure DROP NOT NULL,
ALTER COLUMN status DROP NOT NULL,
ALTER COLUMN username DROP NOT NULL,
ALTER COLUMN password DROP NOT NULL,
ALTER COLUMN configstrategy DROP NOT NULL;
-- clustertemplate
ALTER TABLE clustertemplate
ALTER COLUMN account DROP NOT NULL,
ALTER COLUMN owner DROP NOT NULL;
-- component
ALTER TABLE component
ALTER COLUMN componenttype SET NOT NULL,
ALTER COLUMN attributes SET NOT NULL;
-- constrainttemplate
ALTER TABLE constrainttemplate
ALTER COLUMN account DROP NOT NULL,
ALTER COLUMN owner DROP NOT NULL,
ALTER COLUMN status DROP NOT NULL;
-- credential
ALTER TABLE credential
ALTER COLUMN account DROP NOT NULL,
ALTER COLUMN owner DROP NOT NULL;
-- flowlog
ALTER TABLE flowlog
ALTER COLUMN stackid DROP NOT NULL,
ALTER COLUMN finalized DROP NOT NULL;
-- hostgroup
ALTER TABLE hostgroup
ALTER COLUMN name DROP NOT NULL,
ALTER COLUMN cluster_id DROP NOT NULL;
-- hostmetadata
ALTER TABLE hostmetadata
ALTER COLUMN hostname DROP NOT NULL,
ALTER COLUMN hostgroup_id DROP NOT NULL,
ALTER COLUMN hostmetadatastate DROP NOT NULL;
-- instancegroup
ALTER TABLE instancegroup
ALTER COLUMN groupname DROP NOT NULL,
ALTER COLUMN instancegrouptype DROP NOT NULL,
ALTER COLUMN nodecount DROP NOT NULL,
ALTER COLUMN stack_id DROP NOT NULL;
-- instancemetadata
ALTER TABLE instancemetadata
ALTER COLUMN instancestatus DROP NOT NULL;
-- ldapconfig
ALTER TABLE ldapconfig
ALTER COLUMN account DROP NOT NULL,
ALTER COLUMN owner DROP NOT NULL,
ALTER COLUMN serverssl DROP NOT NULL,
ALTER COLUMN binddn DROP NOT NULL,
ALTER COLUMN bindpassword DROP NOT NULL;
-- network
ALTER TABLE network
ALTER COLUMN account DROP NOT NULL,
ALTER COLUMN owner DROP NOT NULL,
ALTER COLUMN status DROP NOT NULL;
-- rdsconfig
ALTER TABLE rdsconfig
ALTER COLUMN connectionurl DROP NOT NULL,
ALTER COLUMN connectionusername DROP NOT NULL,
ALTER COLUMN connectionpassword DROP NOT NULL,
ALTER COLUMN databasetype DROP NOT NULL,
ALTER COLUMN creationdate SET NOT NULL;
-- recipe
ALTER TABLE recipe
ALTER COLUMN account DROP NOT NULL,
ALTER COLUMN name DROP NOT NULL,
ALTER COLUMN owner DROP NOT NULL;
-- resource
ALTER TABLE resource
ALTER COLUMN resourcetype DROP NOT NULL,
ALTER COLUMN resourcestatus DROP NOT NULL;
-- securitygroup
ALTER TABLE securitygroup
ALTER COLUMN account DROP NOT NULL,
ALTER COLUMN owner DROP NOT NULL,
ALTER COLUMN status DROP NOT NULL;
-- sssdconfig
ALTER TABLE sssdconfig
ALTER COLUMN account DROP NOT NULL,
ALTER COLUMN owner DROP NOT NULL;
-- stack
ALTER TABLE stack
ALTER COLUMN account DROP NOT NULL,
ALTER COLUMN onfailureactionaction DROP NOT NULL,
ALTER COLUMN owner DROP NOT NULL,
ALTER COLUMN region DROP NOT NULL,
ALTER COLUMN status DROP NOT NULL,
ALTER COLUMN created SET NOT NULL,
ALTER COLUMN gatewayport SET NOT NULL;
-- template
ALTER TABLE template
ALTER COLUMN account DROP NOT NULL,
ALTER COLUMN owner DROP NOT NULL,
ALTER COLUMN volumecount DROP NOT NULL,
ALTER COLUMN instancetype DROP NOT NULL,
ALTER COLUMN status DROP NOT NULL;
-- topology
ALTER TABLE topology
ALTER COLUMN owner DROP NOT NULL,
ALTER COLUMN deleted DROP NOT NULL; | the_stack |
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user` (
`id` bigint(11) NOT NULL AUTO_INCREMENT,
`username` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户名',
`nickname` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '用户昵称',
`password` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '密码',
`sex` int(11) NULL DEFAULT NULL COMMENT '性别',
`phone` varchar(13) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手机号',
`email` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '邮箱',
`avatar` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '头像',
`dept_id` bigint(11) NULL DEFAULT NULL COMMENT '部门id 一个用户只有 一个部门',
`dept_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
`status` int(1) NULL DEFAULT NULL COMMENT '状态 0无效 1有效',
`creator` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '创建人',
`create_date` datetime NOT NULL COMMENT '创建时间',
`modifier` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '修改人',
`modify_date` datetime NOT NULL COMMENT '修改时间',
`remarks` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
`del_flag` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除 (0 是 1否)',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 25 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of sys_user
-- ----------------------------
INSERT INTO `sys_user` VALUES (1, 'admin', '超级管理员', '$2a$10$ts07XkBaX7OwC5xA449gh.MO1Sa3KfyJlcx./lZKkMEgP8XDSoR9e', 1, '123456789', 'wangdingfeng@live.com', 'others/18.jpg', 7, '研发部', 1, 'admin', '2020-03-19 14:35:18', 'admin', '2021-01-22 16:20:21', '我是一个备注11', 0);
INSERT INTO `sys_user` VALUES (10, 'spark', '火花', '$2a$10$wzbrofpaLJlttu.0anLX3uT8iDoV.JER8k0HmnHKfTJeLjXbQZX2.', 1, '123123', '123@qq.com', 'others/14.jpg', 3, '研发一部', 1, 'admin', '2020-03-19 20:31:04', 'admin', '2020-12-30 16:52:08', '1', 0);
INSERT INTO `sys_user` VALUES (11, 'zhubian2', '主编2', '$2a$10$T7q/efLKfeRhfpLS9bDaueMxngZmC6Zb/s9.si0Gbsjof0CR2sFV6', 0, '1231232199', '123@qq.com', 'sunny/5.jpg', 5, '文章一部', 1, 'admin', '2020-03-19 20:47:09', 'admin', '2020-12-28 11:43:12', '主编', 0);
INSERT INTO `sys_user` VALUES (12, 'zhubian1', '主编1', '$2a$10$RtbN3jyBh5Zvd0H99PkYwuH6zmsMfN37bEZkyow78Dh/KTn0C4Ev.', 1, '1999999999', '12312312@qq.com', 'others/14.jpg', 5, '文章一部', 1, 'admin', '2020-03-21 19:56:30', 'admin', '2020-11-13 20:19:55', NULL, 0);
INSERT INTO `sys_user` VALUES (13, 'zuzhang', '组长', '$2a$10$DMb.Gx/GbX657UT6Z5/Lx.AOYRZhHsK0/KWlflqxlNxhhoZmbAPz6', 0, '12312312323', '123555@qq.com', 'others/10.jpg', 0, '根目录', 1, 'admin', '2020-04-14 16:54:44', 'admin', '2020-11-13 20:23:41', '组长', 0);
INSERT INTO `sys_user` VALUES (24, 'system', '系统管理员', '$2a$10$ZLRrshM2lmppckQf6/evI.SgXb8Hd8jl0HV8KCm0Ogy5Nnxnr9W2i', 1, '', 'system@qq.com', 'others/18.jpg', 7, '研发部', 1, 'admin', '2021-01-22 16:04:08', 'admin', '2021-01-22 16:04:08', '系统管理员 除删除外的所有操作', 0);
-- ----------------------------
-- Table structure for sys_oauth_client_details
-- ----------------------------
DROP TABLE IF EXISTS `sys_oauth_client_details`;
CREATE TABLE `sys_oauth_client_details` (
`id` int(10) NOT NULL AUTO_INCREMENT COMMENT '主键',
`client_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '授权ID',
`client_secret` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '秘钥',
`resource_ids` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '资源ID',
`scope` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '权限范围',
`authorized_grant_types` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '授权类型',
`web_server_redirect_uri` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '重定向地址',
`authorities` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '授权的权限',
`access_token_validity` int(11) NULL DEFAULT NULL COMMENT 'token 时效',
`refresh_token_validity` int(11) NULL DEFAULT NULL COMMENT '刷新时效',
`autoapprove` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '否自动Approval',
`additional_information` varchar(4096) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '附加信息',
`creator` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '创建人',
`create_date` datetime NOT NULL COMMENT '创建时间',
`modifier` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '修改人',
`modify_date` datetime NOT NULL COMMENT '修改时间',
`remarks` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
`del_flag` tinyint(1) NOT NULL COMMENT '是否删除 (0 是 1否)',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `client_id`(`client_id`) USING BTREE COMMENT '授权ID不能重复'
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '客户端表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of sys_oauth_client_details
-- ----------------------------
INSERT INTO `sys_oauth_client_details` VALUES (1, 'spark-admin', 'spark-admin-secret', NULL, 'all,read,write', 'password,refresh_token,authorization_code,client_credentials,implicit', NULL, NULL, 21600, 28800, 'true', NULL, 'admin', '2021-02-20 13:52:25', 'admin', '2021-02-20 13:52:30', NULL, 0);
INSERT INTO `sys_oauth_client_details` VALUES (2, 'gerrit', 'gerrit', NULL, 'read,all,write', 'authorization_code,refresh_token,password,implicit,client_credentials', '', NULL, 21600, 28800, 'true', NULL, 'admin', '2021-02-20 13:53:08', 'admin', '2021-02-20 13:53:12', NULL, 0);
INSERT INTO `sys_oauth_client_details` VALUES (3, 'spark-app', 'spark-app-secret', NULL, 'all', 'client_credentials', '', NULL, 21600, 28800, 'false', NULL, 'admin', '2021-02-20 13:53:16', 'admin', '2021-02-20 13:53:19', NULL, 0);
INSERT INTO `sys_oauth_client_details` VALUES (4, 'spark-wx', 'spark-wx', NULL, 'all', 'client_credentials', '', NULL, 21600, 28800, 'false', NULL, 'admin', '2020-12-10 09:17:08', 'admin', '2020-12-10 09:17:08', NULL, 0);
-- ----------------------------
-- Table structure for sys_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role` (
`id` bigint(11) NOT NULL AUTO_INCREMENT,
`role_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '角色名称',
`role_code` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '角色编号',
`description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '描述',
`dept_id` bigint(20) NULL DEFAULT NULL COMMENT '部门id',
`dept_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门简称',
`status` int(1) NULL DEFAULT NULL COMMENT '状态 0无效 1有效',
`creator` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '创建人',
`create_date` datetime NOT NULL COMMENT '创建时间',
`modifier` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '修改人',
`modify_date` datetime NOT NULL COMMENT '修改时间',
`remarks` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
`del_flag` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除 (0 是 1否)',
`ds_type` int(1) NULL DEFAULT NULL COMMENT '数据权限类型',
`ds_scope` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '自定义数据权限',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `role_code`(`role_code`) USING BTREE COMMENT '角色编号不能重复'
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of sys_role
-- ----------------------------
INSERT INTO `sys_role` VALUES (1, '超级管理员', 'ROLE_ADMIN', '超级管理员', 7, '研发部', NULL, 'admin', '2020-03-19 22:54:10', 'admin', '2020-11-10 17:26:01', NULL, 0, 1, NULL);
INSERT INTO `sys_role` VALUES (2, '系统管理员', 'ROLE_SYSTEM', '我是', 7, '研发部', NULL, 'admin', '2020-03-19 22:55:31', 'admin', '2020-04-27 15:06:54', NULL, 0, NULL, NULL);
INSERT INTO `sys_role` VALUES (3, '测试角色', 'ROLE_TEST', '', 2, NULL, NULL, 'admin', '2020-03-19 22:56:06', 'admin', '2020-03-19 22:56:06', NULL, 1, NULL, NULL);
INSERT INTO `sys_role` VALUES (4, '测试角色1', 'ROLE_TEST_1', '', 2, NULL, NULL, 'admin', '2020-03-19 23:01:32', 'admin', '2020-03-19 23:01:32', NULL, 1, NULL, NULL);
INSERT INTO `sys_role` VALUES (5, '文章审核组长', 'ROLE_GROUP_LEADER', '文章审核组长', 5, '文章一部', NULL, 'admin', '2020-04-14 16:49:52', 'admin', '2020-08-12 16:14:08', NULL, 0, 3, '0');
INSERT INTO `sys_role` VALUES (6, '主编', 'ROLE_EDITOR_MANAGE', '主编', 5, '文章一部', NULL, 'admin', '2020-04-14 16:55:45', 'admin', '2020-11-23 02:31:24', NULL, 0, 3, NULL);
-- ----------------------------
-- Table structure for sys_menu
-- ----------------------------
DROP TABLE IF EXISTS `sys_menu`;
CREATE TABLE `sys_menu` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '菜单名称',
`pid` bigint(20) NOT NULL COMMENT '上级菜单ID',
`type` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '类型',
`i_frame` bit(1) NULL DEFAULT NULL COMMENT '是否外链',
`path` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '路径',
`component` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '组件路径',
`permission` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '权限',
`hidden` bit(1) NULL DEFAULT NULL COMMENT '是否隐藏',
`icon` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图标',
`sort` bigint(20) NOT NULL DEFAULT 0 COMMENT '排序',
`creator` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '创建人',
`create_date` datetime NOT NULL COMMENT '创建时间',
`modifier` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '修改人',
`modify_date` datetime NOT NULL COMMENT '修改时间',
`remarks` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
`del_flag` tinyint(1) NOT NULL DEFAULT 0 COMMENT '状态',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 106 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '菜单表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of sys_menu
-- ----------------------------
INSERT INTO `sys_menu` VALUES (1, '系统管理', 0, '0', b'0', 'example', 'Layout', '', b'0', 'example', 1, 'admin', '2020-04-02 15:37:06', 'admin', '2020-12-10 20:49:10', NULL, 0);
INSERT INTO `sys_menu` VALUES (2, '用户管理', 1, '1', b'0', '/user', 'sys/user/index', '', b'0', 'user', 1, 'admin', '2020-03-16 15:38:27', 'admin', '2020-05-02 09:35:41', NULL, 0);
INSERT INTO `sys_menu` VALUES (3, '新增', 2, '2', b'0', NULL, NULL, 'user:add', b'0', NULL, 2, 'admin', '2020-03-16 15:41:23', 'admin', '2020-12-11 00:18:53', NULL, 0);
INSERT INTO `sys_menu` VALUES (4, '编辑', 2, '2', b'0', NULL, NULL, 'user:edit', b'0', NULL, 3, 'admin', '2020-03-16 15:42:22', 'admin', '2020-03-21 21:32:02', NULL, 0);
INSERT INTO `sys_menu` VALUES (5, '删除', 2, '2', b'0', NULL, NULL, 'user:delete', b'0', NULL, 4, 'admin', '2020-03-16 15:43:05', 'admin', '2020-03-21 21:32:14', NULL, 0);
INSERT INTO `sys_menu` VALUES (6, '角色管理', 1, '1', b'0', '/role', 'sys/role/index', NULL, b'0', 'tree', 5, 'admin', '2020-03-16 15:44:21', 'admin', '2020-05-02 09:35:48', NULL, 0);
INSERT INTO `sys_menu` VALUES (7, '新增', 6, '2', b'0', NULL, NULL, 'role:add', b'0', NULL, 6, 'admin', '2020-03-18 15:05:22', 'admin', '2020-03-21 21:32:38', NULL, 0);
INSERT INTO `sys_menu` VALUES (8, '编辑', 6, '2', b'0', NULL, NULL, 'role:edit', b'0', NULL, 7, 'admin', '2020-03-18 15:06:05', 'admin', '2020-03-21 21:32:26', NULL, 0);
INSERT INTO `sys_menu` VALUES (9, '删除', 6, '2', b'0', NULL, NULL, 'role:delete', b'0', NULL, 8, 'admin', '2020-03-18 15:06:46', 'admin', '2020-03-21 21:32:47', NULL, 0);
INSERT INTO `sys_menu` VALUES (10, '菜单管理', 1, '1', b'0', '/menu', 'sys/menu/index', NULL, b'0', 'table', 10, 'admin', '2020-03-18 15:07:57', 'admin', '2020-03-18 15:08:04', NULL, 0);
INSERT INTO `sys_menu` VALUES (11, '新增', 10, '2', b'0', '', '', 'menu:add', b'0', '', 100, 'admin', '2020-03-20 13:45:34', 'admin', '2020-03-21 21:32:58', NULL, 0);
INSERT INTO `sys_menu` VALUES (12, '编辑', 10, '2', b'0', '', '', 'menu:edit', b'0', '', 110, 'admin', '2020-03-21 09:35:26', 'admin', '2020-03-21 21:33:09', NULL, 0);
INSERT INTO `sys_menu` VALUES (13, '删除', 10, '2', b'0', '', '', 'menu:delete', b'0', '', 120, 'admin', '2020-03-21 09:36:04', 'admin', '2020-03-21 21:33:18', NULL, 0);
INSERT INTO `sys_menu` VALUES (14, '部门管理', 1, '1', b'0', '/dept', 'sys/dept/index', '', b'0', 'dept', 20, 'admin', '2020-03-21 09:38:25', 'admin', '2020-10-18 15:20:43', NULL, 0);
INSERT INTO `sys_menu` VALUES (15, '新增', 14, '2', b'0', '', '', 'dept:add', b'0', '', 210, 'admin', '2020-03-21 09:39:01', 'admin', '2020-03-21 09:39:01', NULL, 0);
INSERT INTO `sys_menu` VALUES (16, '编辑', 14, '2', b'0', '', '', 'dept:edit', b'0', '', 220, 'admin', '2020-03-21 09:39:22', 'admin', '2020-03-21 09:39:22', NULL, 0);
INSERT INTO `sys_menu` VALUES (17, '删除', 14, '2', b'0', '', '', 'dept:delete', b'0', '', 230, 'admin', '2020-03-21 09:39:42', 'admin', '2020-03-21 09:39:42', NULL, 0);
INSERT INTO `sys_menu` VALUES (18, '字典管理', 1, '1', b'0', '/dict', 'sys/dict/index', '', b'0', 'dictionary', 30, 'admin', '2020-03-21 14:49:56', 'admin', '2020-05-02 09:36:03', NULL, 0);
INSERT INTO `sys_menu` VALUES (19, '新增', 18, '2', b'0', '', '', 'dict:add', b'0', '', 10, 'admin', '2020-03-21 14:50:31', 'admin', '2020-03-21 14:50:31', NULL, 0);
INSERT INTO `sys_menu` VALUES (20, '编辑', 18, '2', b'0', '', '', 'dict:edit', b'0', '', 10, 'admin', '2020-03-21 14:50:48', 'admin', '2020-03-21 14:50:48', NULL, 0);
INSERT INTO `sys_menu` VALUES (21, '删除', 18, '2', b'0', '', '', 'dict:delete', b'0', '', 10, 'admin', '2020-03-21 14:51:03', 'admin', '2020-03-21 14:51:03', NULL, 0);
INSERT INTO `sys_menu` VALUES (22, '客户端管理', 1, '1', b'0', '/oauth', 'sys/oauth/index', '', b'0', 'oauthClient', 40, 'admin', '2020-03-21 15:39:23', 'admin', '2020-05-02 09:36:10', NULL, 0);
INSERT INTO `sys_menu` VALUES (23, '系统监控', 0, '0', b'0', 'monitor', 'Layout', '', b'0', 'oauthClient', 10, 'admin', '2020-03-21 21:37:44', 'admin', '2020-12-10 19:56:43', NULL, 0);
INSERT INTO `sys_menu` VALUES (24, '接口文档', 23, '1', b'1', 'https://api.xiapeiyi.com/swagger-ui.html', NULL, '', b'0', '', 20, 'admin', '2020-03-21 21:39:27', 'admin', '2021-01-21 14:06:32', NULL, 0);
INSERT INTO `sys_menu` VALUES (25, 'Nacos', 23, '1', b'1', 'http://nacos.xiapeiyi.com/nacos', NULL, '', b'0', '', 30, 'admin', '2020-03-21 21:58:22', 'admin', '2021-01-21 14:07:07', NULL, 0);
INSERT INTO `sys_menu` VALUES (26, 'Admin监控', 23, '1', b'1', 'http://www.sparkplatform.cn:9002', NULL, '', b'0', '', 40, 'admin', '2020-03-22 14:12:05', 'admin', '2020-05-07 16:55:10', NULL, 0);
INSERT INTO `sys_menu` VALUES (27, '系统日志', 23, '1', b'0', '/log', 'sys/log/index', '', b'0', '', 5, 'admin', '2020-03-25 10:02:45', 'admin', '2020-05-02 09:37:16', NULL, 0);
INSERT INTO `sys_menu` VALUES (28, '协同管理', 0, '0', b'0', 'act', 'Layout', '', b'0', 'act', 5, 'admin', '2020-04-03 20:41:47', 'admin', '2020-05-07 16:58:13', NULL, 0);
INSERT INTO `sys_menu` VALUES (29, '待办事项', 28, '1', b'0', '/tasks', 'act/tasks/index', '', b'0', 'guide', 10, 'admin', '2020-04-06 14:47:36', 'admin', '2020-05-30 11:06:53', NULL, 0);
INSERT INTO `sys_menu` VALUES (30, '已办事项', 28, '1', b'0', '/histasks', 'act/histasks/index', '', b'0', 'handle', 20, 'admin', '2020-04-06 14:48:34', 'admin', '2020-05-02 09:36:34', NULL, 0);
INSERT INTO `sys_menu` VALUES (31, '流程管理', 28, '1', b'0', '/process', 'act/process/index', '', b'0', 'model', 30, 'admin', '2020-04-06 14:50:20', 'admin', '2020-05-02 09:36:41', NULL, 0);
INSERT INTO `sys_menu` VALUES (32, '研发工具', 0, '0', b'0', 'wrench', 'Layout', '', b'0', 'wrench', 20, 'admin', '2020-04-15 15:20:55', 'admin', '2020-05-03 11:11:28', NULL, 0);
INSERT INTO `sys_menu` VALUES (33, '代码生成', 32, '1', b'0', '/code', 'sys/gen/index', '', b'0', 'code', 10, 'admin', '2020-04-15 15:33:51', 'admin', '2020-05-02 09:37:32', NULL, 0);
INSERT INTO `sys_menu` VALUES (34, '表单例子', 32, '1', b'0', '/form', 'form/index', '', b'0', 'edit', 20, 'admin', '2020-04-16 11:22:02', 'admin', '2020-05-02 09:37:38', NULL, 0);
INSERT INTO `sys_menu` VALUES (35, '文件管理', 58, '1', b'0', '/file', 'sys/file/index', '', b'0', '_file', 50, 'admin', '2020-04-18 15:05:21', 'admin', '2020-12-10 19:56:59', NULL, 0);
INSERT INTO `sys_menu` VALUES (36, '登录日志', 23, '1', b'0', '/login-log', 'sys/login-log/index', '', b'0', '', 10, 'admin', '2020-04-18 23:05:07', 'admin', '2020-05-02 09:37:23', NULL, 0);
INSERT INTO `sys_menu` VALUES (37, '新增', 22, '2', b'0', '', NULL, 'oauth:add', b'0', '', 10, 'admin', '2020-04-26 11:37:24', 'admin', '2020-04-26 11:37:24', NULL, 0);
INSERT INTO `sys_menu` VALUES (38, '编辑', 22, '2', b'0', '', NULL, 'oauth:edit', b'0', '', 10, 'admin', '2020-04-26 11:37:48', 'admin', '2020-04-26 11:37:48', NULL, 0);
INSERT INTO `sys_menu` VALUES (39, '删除', 22, '2', b'0', '', NULL, 'oauth:delete', b'0', '', 10, 'admin', '2020-04-26 11:38:07', 'admin', '2020-04-26 11:38:07', NULL, 0);
INSERT INTO `sys_menu` VALUES (40, '内容平台', 0, '0', b'0', 'cms', 'Layout', '', b'0', 'international', 9, 'admin', '2020-05-03 11:12:52', 'admin', '2020-05-07 16:58:24', NULL, 0);
INSERT INTO `sys_menu` VALUES (41, '文章列表', 40, '1', b'0', '/article/list', 'cms/article/list', '', b'0', 'loggers', 10, 'admin', '2020-05-03 11:14:06', 'admin', '2020-06-18 14:54:03', NULL, 0);
INSERT INTO `sys_menu` VALUES (45, '数据库监控', 23, '1', b'0', 'http://49.232.72.173:9020/druid', NULL, '', b'0', '', 50, 'admin', '2020-05-07 16:57:11', 'admin', '2020-05-07 16:58:01', NULL, 0);
INSERT INTO `sys_menu` VALUES (46, '流程设计', 28, '1', b'0', '/model', 'act/model/index', '', b'0', 'act', 25, 'admin', '2020-05-29 17:22:35', 'admin', '2020-05-30 11:07:02', NULL, 0);
INSERT INTO `sys_menu` VALUES (47, '实例管理', 28, '1', b'0', '/instance', 'act/instance/index', '', b'0', 'star', 90, 'admin', '2020-06-01 17:50:35', 'admin', '2020-06-01 17:50:35', NULL, 0);
INSERT INTO `sys_menu` VALUES (48, '定时任务', 58, '1', b'0', '/quartz', 'sys/quartz/index', '', b'0', 'clock', 60, 'admin', '2020-06-12 14:55:32', 'admin', '2020-12-10 19:57:35', NULL, 0);
INSERT INTO `sys_menu` VALUES (49, '新增', 48, '2', b'0', '', NULL, 'quartz:add', b'0', '', 10, 'admin', '2020-06-12 14:56:55', 'admin', '2020-06-12 14:56:55', NULL, 0);
INSERT INTO `sys_menu` VALUES (50, '编辑', 48, '2', b'0', '', NULL, 'quartz:edit', b'0', '', 11, 'admin', '2020-06-12 14:57:11', 'admin', '2020-06-12 14:57:11', NULL, 0);
INSERT INTO `sys_menu` VALUES (51, '删除', 48, '2', b'0', '', NULL, 'quartz:delete', b'0', '', 13, 'admin', '2020-06-12 14:57:25', 'admin', '2020-06-12 14:57:25', NULL, 0);
INSERT INTO `sys_menu` VALUES (57, 'Minio', 23, '1', b'1', 'https://oss.xiapeiyi.com', NULL, '', b'0', '', 60, 'admin', '2020-11-10 17:25:23', 'admin', '2021-01-21 14:07:42', NULL, 0);
INSERT INTO `sys_menu` VALUES (58, '扩展功能', 0, '0', b'0', 'extend', 'Layout', '', b'0', 'sparkler', 3, 'admin', '2020-12-10 19:56:30', 'admin', '2020-12-10 19:56:30', NULL, 0);
INSERT INTO `sys_menu` VALUES (65, '行政区域', 58, '1', b'0', '/area', 'sys/area/index', '', b'0', 'icon-location', 10, 'admin', '2020-12-13 13:26:36', 'admin', '2020-12-13 13:27:35', NULL, 0);
INSERT INTO `sys_menu` VALUES (66, '商城会员', 0, '0', b'0', '/shop/user', 'Layout', '', b'0', 'wechat', 15, 'admin', '2020-12-13 16:43:53', 'admin', '2021-01-05 17:56:07', NULL, 0);
INSERT INTO `sys_menu` VALUES (67, '会员管理', 66, '1', b'0', '/shop/user', 'shop/user/index', '', b'0', 'user', 10, 'admin', '2020-12-13 16:45:06', 'admin', '2020-12-13 16:45:06', NULL, 0);
INSERT INTO `sys_menu` VALUES (68, '收货地址', 66, '1', b'0', '/shop/user/address', 'shop/user/address/index', '', b'0', 'icon-location', 20, 'admin', '2020-12-13 17:12:47', 'admin', '2020-12-19 12:00:00', NULL, 0);
INSERT INTO `sys_menu` VALUES (69, '会员收藏', 66, '1', b'0', '/shop/user/collect', 'shop/user/collect/index', '', b'0', 'collect', 30, 'admin', '2020-12-13 17:26:04', 'admin', '2020-12-19 12:00:12', NULL, 0);
INSERT INTO `sys_menu` VALUES (70, '会员足迹', 66, '1', b'0', '/shop/user/footprint', 'shop/user/footprint/index', '', b'0', 'footprint', 40, 'admin', '2020-12-13 17:26:47', 'admin', '2020-12-19 12:00:19', NULL, 0);
INSERT INTO `sys_menu` VALUES (71, '微信凭证', 58, '1', b'0', '/shop/auth', 'shop/auth/index', '', b'0', 'wechat', 10, 'admin', '2020-12-14 11:31:06', 'admin', '2020-12-14 11:31:06', NULL, 0);
INSERT INTO `sys_menu` VALUES (72, '编辑', 71, '2', b'0', '', NULL, 'shop:auth:edit', b'0', '', 10, 'admin', '2020-12-14 13:10:52', 'admin', '2020-12-14 13:10:52', NULL, 0);
INSERT INTO `sys_menu` VALUES (73, '删除', 71, '2', b'0', '', NULL, 'shop:auth:del', b'0', '', 11, 'admin', '2020-12-14 13:11:23', 'admin', '2020-12-14 13:11:27', NULL, 0);
INSERT INTO `sys_menu` VALUES (74, '商品管理', 0, '0', b'0', '/goods', 'Layout', '', b'0', 'goods', 16, 'admin', '2020-12-15 14:55:49', 'admin', '2021-01-05 17:55:14', NULL, 0);
INSERT INTO `sys_menu` VALUES (75, '商品列表', 74, '1', b'0', '/goods/list', 'shop/goods/list', '', b'0', 'goods-1', 11, 'admin', '2020-12-15 15:00:30', 'admin', '2021-01-05 17:56:20', NULL, 0);
INSERT INTO `sys_menu` VALUES (76, '新增', 75, '2', b'0', '', NULL, 'shop:goods:add', b'0', '', 10, 'admin', '2020-12-15 15:08:19', 'admin', '2020-12-15 15:08:19', NULL, 1);
INSERT INTO `sys_menu` VALUES (77, '编辑', 75, '2', b'0', '', NULL, 'shop:goods:edit', b'0', '', 11, 'admin', '2020-12-15 15:08:41', 'admin', '2020-12-15 15:08:41', NULL, 0);
INSERT INTO `sys_menu` VALUES (78, '删除', 75, '2', b'0', '', NULL, 'shop:goods:del', b'0', '', 12, 'admin', '2020-12-15 15:08:57', 'admin', '2020-12-15 15:08:57', NULL, 0);
INSERT INTO `sys_menu` VALUES (79, '商品规格', 74, '1', b'0', '/specs', 'shop/specs/index', '', b'0', 'specs', 20, 'admin', '2020-12-16 14:41:22', 'admin', '2021-01-05 17:56:32', NULL, 0);
INSERT INTO `sys_menu` VALUES (80, '商品分类', 74, '1', b'0', '/goods/category', 'shop/goods/category/index', '', b'0', 'nested copy', 30, 'admin', '2020-12-18 11:28:12', 'admin', '2021-01-05 17:56:38', NULL, 0);
INSERT INTO `sys_menu` VALUES (81, '编辑', 80, '2', b'0', '', NULL, 'shop:category:edit', b'0', '', 10, 'admin', '2020-12-18 11:28:36', 'admin', '2020-12-18 11:28:36', NULL, 0);
INSERT INTO `sys_menu` VALUES (82, '删除', 80, '2', b'0', '', NULL, 'shop:category:del', b'0', '', 10, 'admin', '2020-12-18 11:28:50', 'admin', '2020-12-18 11:28:50', NULL, 0);
INSERT INTO `sys_menu` VALUES (83, '商品评价', 74, '1', b'0', '/goods/comment', 'shop/goods/comment/index', '', b'0', 'form', 40, 'admin', '2020-12-18 23:12:02', 'admin', '2021-01-05 17:56:44', NULL, 0);
INSERT INTO `sys_menu` VALUES (84, '购物车', 66, '1', b'0', '/shop/user/cart', 'shop/user/cart/index', '', b'0', 'shopping', 24, 'admin', '2020-12-19 11:58:48', 'admin', '2020-12-19 12:00:06', NULL, 0);
INSERT INTO `sys_menu` VALUES (85, '订单中心', 0, '0', b'0', 'order', 'Layout', '', b'0', 'documentation', 17, 'admin', '2020-12-22 17:10:22', 'admin', '2021-01-07 18:12:30', NULL, 0);
INSERT INTO `sys_menu` VALUES (86, '订单管理', 85, '1', b'0', '/order/normal', 'shop/order/order-normal', '', b'0', 'nested copy', 10, 'admin', '2020-12-22 17:11:06', 'admin', '2021-01-07 21:13:17', NULL, 0);
INSERT INTO `sys_menu` VALUES (87, '商城设置', 0, '0', b'0', 'shop/setting', 'Layout', '', b'0', 'wrench', 18, 'admin', '2021-01-03 14:47:44', 'admin', '2021-01-05 17:56:54', NULL, 0);
INSERT INTO `sys_menu` VALUES (88, '轮播图', 87, '1', b'0', '/swiper', 'shop/setting/swiper/index', '', b'0', 'swiper', 10, 'admin', '2021-01-03 14:51:09', 'admin', '2021-01-07 13:37:13', NULL, 0);
INSERT INTO `sys_menu` VALUES (89, '营销中心', 0, '0', b'0', 'marketing', 'Layout', '', b'0', 'marketing', 19, 'admin', '2021-01-04 17:00:24', 'admin', '2021-01-04 17:00:24', NULL, 0);
INSERT INTO `sys_menu` VALUES (90, '优惠券', 89, '1', b'0', '/coupon', 'shop/marketing/coupon/index', '', b'0', 'coupon', 10, 'admin', '2021-01-04 17:12:41', 'admin', '2021-01-06 21:20:25', NULL, 0);
INSERT INTO `sys_menu` VALUES (94, '秒杀设置', 95, '1', b'0', '/seckill/manage', 'shop/marketing/seckill/manage/index', '', b'0', 'setting', 10, 'admin', '2021-01-05 17:35:41', 'admin', '2021-01-05 17:57:08', NULL, 0);
INSERT INTO `sys_menu` VALUES (95, '秒杀管理', 89, '1', b'0', 'seckill', 'ParentView', '', b'0', 'seckill', 20, 'admin', '2021-01-05 17:42:02', 'admin', '2021-01-05 17:48:39', NULL, 0);
INSERT INTO `sys_menu` VALUES (96, '秒杀商品', 95, '1', b'0', '/seckill/goods', 'shop/marketing/seckill/goods/index', '', b'0', 'goods', 12, 'admin', '2021-01-05 17:45:05', 'admin', '2021-01-05 17:57:15', NULL, 0);
INSERT INTO `sys_menu` VALUES (97, '团购管理', 89, '1', b'0', 'pink', 'ParentView', '', b'0', 'pink', 30, 'admin', '2021-01-06 21:23:21', 'admin', '2021-01-06 21:23:32', NULL, 0);
INSERT INTO `sys_menu` VALUES (98, '团购商品', 97, '1', b'0', '/pink/goods', 'shop/marketing/pink/goods/index', '', b'0', 'goods-1', 10, 'admin', '2021-01-06 21:28:17', 'admin', '2021-01-06 21:28:17', NULL, 0);
INSERT INTO `sys_menu` VALUES (99, '团购列表', 97, '1', b'0', '/pink/list', 'shop/marketing/pink/index', '', b'0', 'list', 11, 'admin', '2021-01-06 21:29:02', 'admin', '2021-01-06 21:29:02', NULL, 0);
INSERT INTO `sys_menu` VALUES (100, '团购订单', 85, '1', b'0', '/order/pink', 'shop/order/order-pink', '', b'0', 'pink', 11, 'admin', '2021-01-07 21:23:33', 'admin', '2021-01-07 21:23:53', NULL, 0);
INSERT INTO `sys_menu` VALUES (101, '秒杀订单', 85, '1', b'0', '/order/seckill', 'shop/order/order-seckill', '', b'0', 'seckill', 12, 'admin', '2021-01-07 21:24:37', 'admin', '2021-01-07 21:24:37', NULL, 0);
INSERT INTO `sys_menu` VALUES (102, '退款/纠纷', 85, '1', b'0', '/order/refund', 'shop/order/order-refund', '', b'0', 'link', 15, 'admin', '2021-01-12 15:16:26', 'admin', '2021-01-12 15:16:26', NULL, 0);
INSERT INTO `sys_menu` VALUES (103, '授权', 6, '2', b'0', '', NULL, 'role:auth', b'0', '', 10, 'admin', '2021-01-22 15:37:26', 'admin', '2021-01-22 15:37:26', NULL, 0);
INSERT INTO `sys_menu` VALUES (105, '新增', 75, '2', b'0', '', NULL, 'shop:goods:add', b'0', '', 1, 'admin', '2021-01-22 23:14:20', 'admin', '2021-01-22 23:14:20', NULL, 0);
-- ----------------------------
-- Table structure for sys_user_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_role`;
CREATE TABLE `sys_user_role` (
`id` bigint(11) NOT NULL AUTO_INCREMENT,
`role_id` bigint(11) NULL DEFAULT NULL COMMENT '角色id',
`user_id` bigint(11) NULL DEFAULT NULL COMMENT '用户id',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 94 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户角色' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of sys_user_role
-- ----------------------------
INSERT INTO `sys_user_role` VALUES (42, 2, 10);
INSERT INTO `sys_user_role` VALUES (43, 5, 10);
INSERT INTO `sys_user_role` VALUES (44, 2, 14);
INSERT INTO `sys_user_role` VALUES (49, 1, 16);
INSERT INTO `sys_user_role` VALUES (50, 2, 16);
INSERT INTO `sys_user_role` VALUES (51, 1, 17);
INSERT INTO `sys_user_role` VALUES (52, 2, 18);
INSERT INTO `sys_user_role` VALUES (53, 2, 8);
INSERT INTO `sys_user_role` VALUES (56, 6, 11);
INSERT INTO `sys_user_role` VALUES (61, 2, 19);
INSERT INTO `sys_user_role` VALUES (66, 1, 20);
INSERT INTO `sys_user_role` VALUES (70, 5, 21);
INSERT INTO `sys_user_role` VALUES (75, 5, 22);
INSERT INTO `sys_user_role` VALUES (80, 6, 12);
INSERT INTO `sys_user_role` VALUES (81, 5, 13);
INSERT INTO `sys_user_role` VALUES (86, 6, 23);
INSERT INTO `sys_user_role` VALUES (87, 1, 1);
INSERT INTO `sys_user_role` VALUES (88, 5, 1);
INSERT INTO `sys_user_role` VALUES (89, 2, 1);
INSERT INTO `sys_user_role` VALUES (90, 6, 1);
INSERT INTO `sys_user_role` VALUES (91, 2, 24);
INSERT INTO `sys_user_role` VALUES (92, 5, 24);
INSERT INTO `sys_user_role` VALUES (93, 6, 24);
-- ----------------------------
-- Table structure for sys_role_menu
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_menu`;
CREATE TABLE `sys_role_menu` (
`id` bigint(11) NOT NULL AUTO_INCREMENT,
`role_id` bigint(11) NULL DEFAULT NULL COMMENT '角色id',
`menu_id` bigint(11) NULL DEFAULT NULL COMMENT '菜单id',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1985 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色菜单表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of sys_role_menu
-- ----------------------------
INSERT INTO `sys_role_menu` VALUES (265, 5, 28);
INSERT INTO `sys_role_menu` VALUES (266, 5, 29);
INSERT INTO `sys_role_menu` VALUES (267, 5, 30);
INSERT INTO `sys_role_menu` VALUES (981, 6, 28);
INSERT INTO `sys_role_menu` VALUES (982, 6, 29);
INSERT INTO `sys_role_menu` VALUES (983, 6, 30);
INSERT INTO `sys_role_menu` VALUES (984, 6, 31);
INSERT INTO `sys_role_menu` VALUES (985, 6, 46);
INSERT INTO `sys_role_menu` VALUES (1736, 2, 1);
INSERT INTO `sys_role_menu` VALUES (1737, 2, 2);
INSERT INTO `sys_role_menu` VALUES (1738, 2, 3);
INSERT INTO `sys_role_menu` VALUES (1739, 2, 4);
INSERT INTO `sys_role_menu` VALUES (1740, 2, 6);
INSERT INTO `sys_role_menu` VALUES (1741, 2, 7);
INSERT INTO `sys_role_menu` VALUES (1742, 2, 8);
INSERT INTO `sys_role_menu` VALUES (1743, 2, 10);
INSERT INTO `sys_role_menu` VALUES (1744, 2, 11);
INSERT INTO `sys_role_menu` VALUES (1745, 2, 12);
INSERT INTO `sys_role_menu` VALUES (1746, 2, 14);
INSERT INTO `sys_role_menu` VALUES (1747, 2, 15);
INSERT INTO `sys_role_menu` VALUES (1748, 2, 16);
INSERT INTO `sys_role_menu` VALUES (1749, 2, 18);
INSERT INTO `sys_role_menu` VALUES (1750, 2, 19);
INSERT INTO `sys_role_menu` VALUES (1751, 2, 20);
INSERT INTO `sys_role_menu` VALUES (1752, 2, 22);
INSERT INTO `sys_role_menu` VALUES (1753, 2, 37);
INSERT INTO `sys_role_menu` VALUES (1754, 2, 38);
INSERT INTO `sys_role_menu` VALUES (1755, 2, 23);
INSERT INTO `sys_role_menu` VALUES (1756, 2, 24);
INSERT INTO `sys_role_menu` VALUES (1757, 2, 25);
INSERT INTO `sys_role_menu` VALUES (1758, 2, 26);
INSERT INTO `sys_role_menu` VALUES (1759, 2, 27);
INSERT INTO `sys_role_menu` VALUES (1760, 2, 36);
INSERT INTO `sys_role_menu` VALUES (1761, 2, 45);
INSERT INTO `sys_role_menu` VALUES (1762, 2, 57);
INSERT INTO `sys_role_menu` VALUES (1763, 2, 28);
INSERT INTO `sys_role_menu` VALUES (1764, 2, 29);
INSERT INTO `sys_role_menu` VALUES (1765, 2, 30);
INSERT INTO `sys_role_menu` VALUES (1766, 2, 31);
INSERT INTO `sys_role_menu` VALUES (1767, 2, 46);
INSERT INTO `sys_role_menu` VALUES (1768, 2, 47);
INSERT INTO `sys_role_menu` VALUES (1769, 2, 32);
INSERT INTO `sys_role_menu` VALUES (1770, 2, 33);
INSERT INTO `sys_role_menu` VALUES (1771, 2, 34);
INSERT INTO `sys_role_menu` VALUES (1772, 2, 40);
INSERT INTO `sys_role_menu` VALUES (1773, 2, 41);
INSERT INTO `sys_role_menu` VALUES (1774, 2, 58);
INSERT INTO `sys_role_menu` VALUES (1775, 2, 35);
INSERT INTO `sys_role_menu` VALUES (1776, 2, 48);
INSERT INTO `sys_role_menu` VALUES (1777, 2, 49);
INSERT INTO `sys_role_menu` VALUES (1778, 2, 50);
INSERT INTO `sys_role_menu` VALUES (1779, 2, 51);
INSERT INTO `sys_role_menu` VALUES (1780, 2, 65);
INSERT INTO `sys_role_menu` VALUES (1781, 2, 71);
INSERT INTO `sys_role_menu` VALUES (1782, 2, 72);
INSERT INTO `sys_role_menu` VALUES (1783, 2, 73);
INSERT INTO `sys_role_menu` VALUES (1784, 2, 66);
INSERT INTO `sys_role_menu` VALUES (1785, 2, 67);
INSERT INTO `sys_role_menu` VALUES (1786, 2, 68);
INSERT INTO `sys_role_menu` VALUES (1787, 2, 69);
INSERT INTO `sys_role_menu` VALUES (1788, 2, 70);
INSERT INTO `sys_role_menu` VALUES (1789, 2, 84);
INSERT INTO `sys_role_menu` VALUES (1790, 2, 74);
INSERT INTO `sys_role_menu` VALUES (1791, 2, 75);
INSERT INTO `sys_role_menu` VALUES (1792, 2, 77);
INSERT INTO `sys_role_menu` VALUES (1793, 2, 78);
INSERT INTO `sys_role_menu` VALUES (1794, 2, 79);
INSERT INTO `sys_role_menu` VALUES (1795, 2, 80);
INSERT INTO `sys_role_menu` VALUES (1796, 2, 81);
INSERT INTO `sys_role_menu` VALUES (1797, 2, 83);
INSERT INTO `sys_role_menu` VALUES (1798, 2, 85);
INSERT INTO `sys_role_menu` VALUES (1799, 2, 86);
INSERT INTO `sys_role_menu` VALUES (1800, 2, 100);
INSERT INTO `sys_role_menu` VALUES (1801, 2, 101);
INSERT INTO `sys_role_menu` VALUES (1802, 2, 102);
INSERT INTO `sys_role_menu` VALUES (1803, 2, 87);
INSERT INTO `sys_role_menu` VALUES (1804, 2, 88);
INSERT INTO `sys_role_menu` VALUES (1805, 2, 89);
INSERT INTO `sys_role_menu` VALUES (1806, 2, 90);
INSERT INTO `sys_role_menu` VALUES (1807, 2, 95);
INSERT INTO `sys_role_menu` VALUES (1808, 2, 94);
INSERT INTO `sys_role_menu` VALUES (1809, 2, 96);
INSERT INTO `sys_role_menu` VALUES (1810, 2, 97);
INSERT INTO `sys_role_menu` VALUES (1811, 2, 98);
INSERT INTO `sys_role_menu` VALUES (1812, 2, 99);
INSERT INTO `sys_role_menu` VALUES (1899, 1, 1);
INSERT INTO `sys_role_menu` VALUES (1900, 1, 2);
INSERT INTO `sys_role_menu` VALUES (1901, 1, 3);
INSERT INTO `sys_role_menu` VALUES (1902, 1, 4);
INSERT INTO `sys_role_menu` VALUES (1903, 1, 5);
INSERT INTO `sys_role_menu` VALUES (1904, 1, 6);
INSERT INTO `sys_role_menu` VALUES (1905, 1, 7);
INSERT INTO `sys_role_menu` VALUES (1906, 1, 8);
INSERT INTO `sys_role_menu` VALUES (1907, 1, 9);
INSERT INTO `sys_role_menu` VALUES (1908, 1, 103);
INSERT INTO `sys_role_menu` VALUES (1909, 1, 10);
INSERT INTO `sys_role_menu` VALUES (1910, 1, 11);
INSERT INTO `sys_role_menu` VALUES (1911, 1, 12);
INSERT INTO `sys_role_menu` VALUES (1912, 1, 13);
INSERT INTO `sys_role_menu` VALUES (1913, 1, 14);
INSERT INTO `sys_role_menu` VALUES (1914, 1, 15);
INSERT INTO `sys_role_menu` VALUES (1915, 1, 16);
INSERT INTO `sys_role_menu` VALUES (1916, 1, 17);
INSERT INTO `sys_role_menu` VALUES (1917, 1, 18);
INSERT INTO `sys_role_menu` VALUES (1918, 1, 19);
INSERT INTO `sys_role_menu` VALUES (1919, 1, 20);
INSERT INTO `sys_role_menu` VALUES (1920, 1, 21);
INSERT INTO `sys_role_menu` VALUES (1921, 1, 22);
INSERT INTO `sys_role_menu` VALUES (1922, 1, 37);
INSERT INTO `sys_role_menu` VALUES (1923, 1, 38);
INSERT INTO `sys_role_menu` VALUES (1924, 1, 39);
INSERT INTO `sys_role_menu` VALUES (1925, 1, 23);
INSERT INTO `sys_role_menu` VALUES (1926, 1, 24);
INSERT INTO `sys_role_menu` VALUES (1927, 1, 25);
INSERT INTO `sys_role_menu` VALUES (1928, 1, 26);
INSERT INTO `sys_role_menu` VALUES (1929, 1, 27);
INSERT INTO `sys_role_menu` VALUES (1930, 1, 36);
INSERT INTO `sys_role_menu` VALUES (1931, 1, 45);
INSERT INTO `sys_role_menu` VALUES (1932, 1, 57);
INSERT INTO `sys_role_menu` VALUES (1933, 1, 28);
INSERT INTO `sys_role_menu` VALUES (1934, 1, 29);
INSERT INTO `sys_role_menu` VALUES (1935, 1, 30);
INSERT INTO `sys_role_menu` VALUES (1936, 1, 31);
INSERT INTO `sys_role_menu` VALUES (1937, 1, 46);
INSERT INTO `sys_role_menu` VALUES (1938, 1, 47);
INSERT INTO `sys_role_menu` VALUES (1939, 1, 32);
INSERT INTO `sys_role_menu` VALUES (1940, 1, 33);
INSERT INTO `sys_role_menu` VALUES (1941, 1, 34);
INSERT INTO `sys_role_menu` VALUES (1942, 1, 40);
INSERT INTO `sys_role_menu` VALUES (1943, 1, 41);
INSERT INTO `sys_role_menu` VALUES (1944, 1, 58);
INSERT INTO `sys_role_menu` VALUES (1945, 1, 35);
INSERT INTO `sys_role_menu` VALUES (1946, 1, 48);
INSERT INTO `sys_role_menu` VALUES (1947, 1, 49);
INSERT INTO `sys_role_menu` VALUES (1948, 1, 50);
INSERT INTO `sys_role_menu` VALUES (1949, 1, 51);
INSERT INTO `sys_role_menu` VALUES (1950, 1, 65);
INSERT INTO `sys_role_menu` VALUES (1951, 1, 71);
INSERT INTO `sys_role_menu` VALUES (1952, 1, 72);
INSERT INTO `sys_role_menu` VALUES (1953, 1, 73);
INSERT INTO `sys_role_menu` VALUES (1954, 1, 66);
INSERT INTO `sys_role_menu` VALUES (1955, 1, 67);
INSERT INTO `sys_role_menu` VALUES (1956, 1, 68);
INSERT INTO `sys_role_menu` VALUES (1957, 1, 69);
INSERT INTO `sys_role_menu` VALUES (1958, 1, 70);
INSERT INTO `sys_role_menu` VALUES (1959, 1, 84);
INSERT INTO `sys_role_menu` VALUES (1960, 1, 74);
INSERT INTO `sys_role_menu` VALUES (1961, 1, 75);
INSERT INTO `sys_role_menu` VALUES (1962, 1, 77);
INSERT INTO `sys_role_menu` VALUES (1963, 1, 78);
INSERT INTO `sys_role_menu` VALUES (1964, 1, 105);
INSERT INTO `sys_role_menu` VALUES (1965, 1, 79);
INSERT INTO `sys_role_menu` VALUES (1966, 1, 80);
INSERT INTO `sys_role_menu` VALUES (1967, 1, 81);
INSERT INTO `sys_role_menu` VALUES (1968, 1, 82);
INSERT INTO `sys_role_menu` VALUES (1969, 1, 83);
INSERT INTO `sys_role_menu` VALUES (1970, 1, 85);
INSERT INTO `sys_role_menu` VALUES (1971, 1, 86);
INSERT INTO `sys_role_menu` VALUES (1972, 1, 100);
INSERT INTO `sys_role_menu` VALUES (1973, 1, 101);
INSERT INTO `sys_role_menu` VALUES (1974, 1, 102);
INSERT INTO `sys_role_menu` VALUES (1975, 1, 87);
INSERT INTO `sys_role_menu` VALUES (1976, 1, 88);
INSERT INTO `sys_role_menu` VALUES (1977, 1, 89);
INSERT INTO `sys_role_menu` VALUES (1978, 1, 90);
INSERT INTO `sys_role_menu` VALUES (1979, 1, 95);
INSERT INTO `sys_role_menu` VALUES (1980, 1, 94);
INSERT INTO `sys_role_menu` VALUES (1981, 1, 96);
INSERT INTO `sys_role_menu` VALUES (1982, 1, 97);
INSERT INTO `sys_role_menu` VALUES (1983, 1, 98);
INSERT INTO `sys_role_menu` VALUES (1984, 1, 99);
-- ----------------------------
-- Table structure for sys_dept
-- ----------------------------
DROP TABLE IF EXISTS `sys_dept`;
CREATE TABLE `sys_dept` (
`ID` bigint(11) NOT NULL AUTO_INCREMENT,
`pid` bigint(11) NULL DEFAULT NULL COMMENT '父部门id',
`pids` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '父级ids',
`simple_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '简称',
`full_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '全称',
`address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '地址',
`dept_type` int(11) NULL DEFAULT NULL COMMENT '部门类型(0 公司1部门)',
`sort` int(11) NULL DEFAULT 0 COMMENT '排序',
`creator` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '创建人',
`create_date` datetime NOT NULL COMMENT '创建时间',
`modifier` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '修改人',
`modify_date` datetime NOT NULL COMMENT '修改时间',
`remarks` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
`del_flag` tinyint(1) NOT NULL DEFAULT 0 COMMENT '状态',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 10 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '部门表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of sys_dept
-- ----------------------------
INSERT INTO `sys_dept` VALUES (1, 0, '0', 'spark', 'spark开源公司', '北京朝阳区', 0, 10, 'admin', '2020-03-21 10:07:50', 'admin', '2020-07-30 11:20:15', NULL, 0);
INSERT INTO `sys_dept` VALUES (2, 1, '0,1', '技术部', '信息技术部', '朝阳区建国路', 1, 10, 'admin', '2020-03-21 10:11:50', 'admin', '2020-08-01 09:57:19', NULL, 0);
INSERT INTO `sys_dept` VALUES (3, 7, '0,1,2,7', '研发一部', '研发一部门', NULL, 1, 10, 'admin', '2020-03-21 10:12:31', 'admin', '2020-07-02 15:57:39', NULL, 0);
INSERT INTO `sys_dept` VALUES (4, 1, '0,1', '内容部门', '内容部门', NULL, 1, 10, 'admin', '2020-03-21 10:13:17', 'admin', '2020-07-02 15:57:42', NULL, 0);
INSERT INTO `sys_dept` VALUES (5, 4, '0,1,4', '文章一部', '文章一部', NULL, 1, 10, 'admin', '2020-03-21 10:13:56', 'admin', '2020-07-02 15:57:43', NULL, 0);
INSERT INTO `sys_dept` VALUES (6, 2, '0,1,2', '测试部', '测试部', '大望路', 1, 10, 'admin', '2020-03-21 13:03:00', 'admin', '2020-08-01 09:59:21', NULL, 0);
INSERT INTO `sys_dept` VALUES (7, 2, '0,1,2', '研发部', '研发部', NULL, 0, 10, 'admin', '2020-03-21 13:04:01', 'admin', '2020-07-02 15:57:37', NULL, 0);
INSERT INTO `sys_dept` VALUES (8, 6, '0,1,2,6', '测试一部', '测试一部门', NULL, 0, 10, 'admin', '2020-03-21 13:05:09', 'admin', '2020-07-02 15:57:33', NULL, 0);
INSERT INTO `sys_dept` VALUES (9, 0, '0', '2', '2', '2', 0, 10, 'admin', '2020-09-03 16:35:05', 'admin', '2020-09-03 16:35:05', NULL, 1);
-- ----------------------------
-- Table structure for sys_dict
-- ----------------------------
DROP TABLE IF EXISTS `sys_dict`;
CREATE TABLE `sys_dict` (
`id` bigint(11) NOT NULL AUTO_INCREMENT,
`name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '字典名称',
`type` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '字典类型',
`description` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '描述',
`creator` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '创建人',
`create_date` datetime NOT NULL COMMENT '创建时间',
`modifier` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '修改人',
`modify_date` datetime NOT NULL COMMENT '修改时间',
`remarks` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
`del_flag` tinyint(1) NOT NULL DEFAULT 0 COMMENT '状态',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 40 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '字典表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of sys_dict
-- ----------------------------
INSERT INTO `sys_dict` VALUES (1, '用户状态', 'user_status', '用户状态', 'admin', '2020-03-26 11:36:58', 'admin', '2020-03-26 11:36:58', NULL, 0);
INSERT INTO `sys_dict` VALUES (2, '性别', 'sex', '0 女 1 男', 'admin', '2020-04-29 21:28:17', 'admin', '2020-04-29 21:28:17', NULL, 0);
INSERT INTO `sys_dict` VALUES (3, '文件状态', 'file_status', '文件状态 0 未绑定 1已绑定', 'admin', '2020-05-02 09:53:31', 'admin', '2020-05-02 09:54:18', NULL, 0);
INSERT INTO `sys_dict` VALUES (4, '流程业务类型', 'processs_type', '用于业务流程类型', 'admin', '2020-05-02 09:55:00', 'admin', '2020-05-02 09:55:00', NULL, 0);
INSERT INTO `sys_dict` VALUES (5, '文章状态', 'article_status', '0 暂存 1 退回修改 2 组长审核 3 主编审核 4 审核通过 5 审核不通过', 'admin', '2020-05-07 13:53:09', 'admin', '2020-05-07 13:53:09', NULL, 0);
INSERT INTO `sys_dict` VALUES (6, '是否', 'yes_no', '0 否 1 是', 'admin', '2020-06-11 10:13:07', 'admin', '2020-06-11 10:24:54', NULL, 0);
INSERT INTO `sys_dict` VALUES (7, '执行任务策略', 'quartz_misfire_policy', '定时任务调度', 'admin', '2020-06-11 10:14:42', 'admin', '2020-10-13 14:32:18', NULL, 0);
INSERT INTO `sys_dict` VALUES (8, '定时任务状态', 'quartz_status', '0 暂停 1 正常', 'admin', '2020-06-11 13:50:12', 'admin', '2020-06-11 13:50:12', NULL, 0);
INSERT INTO `sys_dict` VALUES (9, '定时任务日志状态', 'quartz_log_status', '0 正常 1 失败', 'admin', '2020-06-11 16:37:25', 'admin', '2020-06-11 16:37:25', NULL, 0);
INSERT INTO `sys_dict` VALUES (10, '定时任务组', 'quartz_group', 'DEFAULT 默认 SYSTEM 系统 BUSINESS', 'admin', '2020-06-11 17:28:03', 'admin', '2020-06-11 17:28:03', NULL, 0);
INSERT INTO `sys_dict` VALUES (11, '任务类型', 'quartz_type', '0 bean类型 1 rest类型 2 消息队列', 'admin', '2020-06-12 11:55:49', 'admin', '2020-06-12 11:55:49', NULL, 0);
INSERT INTO `sys_dict` VALUES (12, '角色数据权限范围', 'role_ds_type', '全部:1 本级:2 自定义:3', 'admin', '2020-08-07 17:50:39', 'admin', '2020-08-07 17:50:39', NULL, 0);
INSERT INTO `sys_dict` VALUES (13, '部门类型', 'dept_type', '部门类型 0 公司 1 部门 2 小组', 'admin', '2020-08-07 17:52:04', 'admin', '2020-10-14 09:53:44', NULL, 0);
INSERT INTO `sys_dict` VALUES (14, 'aaaa', 'ck', '啊啊啊啊', 'admin', '2020-10-14 16:05:40', 'admin', '2020-10-14 16:05:40', NULL, 1);
INSERT INTO `sys_dict` VALUES (15, '按按', 'aa', '按按', 'admin', '2020-10-14 16:20:36', 'admin', '2020-10-14 16:20:36', NULL, 1);
INSERT INTO `sys_dict` VALUES (16, 'aaa', 'aaa', 'aaa', 'admin', '2020-10-14 16:25:05', 'admin', '2020-10-14 16:25:05', NULL, 1);
INSERT INTO `sys_dict` VALUES (17, '是是是', 'sss', '', 'admin', '2020-10-19 21:30:05', 'admin', '2020-10-19 21:30:05', NULL, 1);
INSERT INTO `sys_dict` VALUES (18, '区域类型', 'area_type', '', 'admin', '2020-12-13 13:28:43', 'admin', '2020-12-13 13:28:43', NULL, 0);
INSERT INTO `sys_dict` VALUES (19, '商城会员类型', 'shop_user_type', '0 普通会员 1 VIP', 'admin', '2020-12-13 16:56:56', 'admin', '2020-12-13 16:56:56', NULL, 0);
INSERT INTO `sys_dict` VALUES (20, '商城会员', 'shop_user_status', '0 可用, 1 禁用, 2 注销', 'admin', '2020-12-13 16:57:51', 'admin', '2020-12-13 16:57:51', NULL, 0);
INSERT INTO `sys_dict` VALUES (21, '单位', 'goods_unit', '商品单位', 'admin', '2020-12-15 16:49:18', 'admin', '2020-12-15 16:49:18', NULL, 0);
INSERT INTO `sys_dict` VALUES (22, '组件类型', 'attr_type', '用于商品规格组件类型 ', 'admin', '2020-12-16 14:49:27', 'admin', '2020-12-16 14:49:27', NULL, 0);
INSERT INTO `sys_dict` VALUES (23, '商品关键词', 'goods_keywords', '商品关键词', 'admin', '2020-12-18 13:56:54', 'admin', '2020-12-18 13:56:54', NULL, 0);
INSERT INTO `sys_dict` VALUES (24, '商品状态', 'goods_status', '0 待上架 1 上架 2 下架', 'admin', '2020-12-18 21:10:40', 'admin', '2020-12-18 21:10:40', NULL, 0);
INSERT INTO `sys_dict` VALUES (25, '订单类型', 'shop_order_type', '0 普通订单 1 团购订单 2 秒杀订单', 'admin', '2020-12-22 17:17:19', 'admin', '2020-12-22 17:17:19', NULL, 0);
INSERT INTO `sys_dict` VALUES (26, '订单状态', 'shop_order_status', '0 待付款 1 已取消 2 已付款 3 已发货 4 用户确认收货 5 退款 6 完成', 'admin', '2020-12-22 17:19:12', 'admin', '2020-12-22 17:19:12', NULL, 0);
INSERT INTO `sys_dict` VALUES (27, '发货状态', 'shop_shipping_status', '0 待发货 1 已发货 2 已收货 2 退货', 'admin', '2020-12-22 17:21:20', 'admin', '2020-12-22 17:21:20', NULL, 0);
INSERT INTO `sys_dict` VALUES (28, '支付状态', 'shop_pay_status', '0 待付款 2 已付款', 'admin', '2020-12-22 17:22:21', 'admin', '2020-12-22 17:22:21', NULL, 0);
INSERT INTO `sys_dict` VALUES (29, '轮播图类型', 'swiper_type', ' none 无类型 goods 商品', 'admin', '2021-01-03 15:05:39', 'admin', '2021-01-03 15:05:39', NULL, 0);
INSERT INTO `sys_dict` VALUES (30, '状态', 'status', '通用状态 0 正常 1 停用', 'admin', '2021-01-03 15:06:57', 'admin', '2021-01-03 15:06:57', NULL, 0);
INSERT INTO `sys_dict` VALUES (31, '优惠券类型', 'coupon_type', '优惠券类型 新人券 现金券 满减券 折扣券', 'admin', '2021-01-04 17:16:41', 'admin', '2021-01-04 17:16:41', NULL, 0);
INSERT INTO `sys_dict` VALUES (32, '优惠券状态', 'coupon_status', '0 未开始 1进行中 2已结束', 'admin', '2021-01-04 17:19:59', 'admin', '2021-01-04 17:19:59', NULL, 0);
INSERT INTO `sys_dict` VALUES (33, '商品活动状态', 'goods_activity', '0 正常 1秒杀 2 团购', 'admin', '2021-01-06 17:00:52', 'admin', '2021-01-06 17:00:52', NULL, 0);
INSERT INTO `sys_dict` VALUES (34, '拼团商品状态', 'shop_pink_status', '0 待成团 1 拼团中 2 拼团成功3 拼团失败', 'admin', '2021-01-07 13:21:17', 'admin', '2021-01-07 13:29:58', NULL, 0);
INSERT INTO `sys_dict` VALUES (35, '订单状态', 'order_status', '0 待付款 1 已取消 2 已付款 3 已发货 4 退款 5 完成 6 待评价', 'admin', '2021-01-07 15:42:59', 'admin', '2021-01-12 10:10:22', NULL, 0);
INSERT INTO `sys_dict` VALUES (36, '发货状态', 'shipping_status', ' 0 待发货 1 已发货 2 已收货 3 退货', 'admin', '2021-01-07 16:13:24', 'admin', '2021-01-07 16:13:24', NULL, 0);
INSERT INTO `sys_dict` VALUES (37, '发货状态', 'shipping_status', ' 0 待发货 1 已发货 2 已收货 3 退货', 'admin', '2021-01-07 16:13:26', 'admin', '2021-01-07 16:13:26', NULL, 1);
INSERT INTO `sys_dict` VALUES (38, '退款状态', 'refund_status', ' 0 申请中 1 退款完成 2 拒绝退款', 'admin', '2021-01-07 16:19:57', 'admin', '2021-01-07 16:19:57', NULL, 0);
INSERT INTO `sys_dict` VALUES (39, '快递公司', 'express_company', '快递公司代码', 'admin', '2021-01-11 18:05:10', 'admin', '2021-01-11 18:05:10', NULL, 0);
-- ----------------------------
-- Table structure for sys_dict_item
-- ----------------------------
DROP TABLE IF EXISTS `sys_dict_item`;
CREATE TABLE `sys_dict_item` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`pid` int(10) NULL DEFAULT NULL COMMENT '父id',
`type` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '类型',
`label` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '标签值',
`value` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '字典值',
`sort` int(10) NULL DEFAULT 0 COMMENT '排序',
`description` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '描述',
`value1` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '扩展属性1',
`value2` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '扩展属性2',
`creator` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '创建人',
`create_date` datetime NOT NULL COMMENT '创建时间',
`modifier` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '修改人',
`modify_date` datetime NOT NULL COMMENT '修改时间',
`remarks` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
`del_flag` tinyint(1) NOT NULL DEFAULT 0 COMMENT '状态',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 128 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '字典子表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of sys_dict_item
-- ----------------------------
INSERT INTO `sys_dict_item` VALUES (1, 1, 'user_status', '禁用', '0', 10, '禁用', NULL, NULL, 'admin', '2020-03-26 13:32:22', 'admin', '2020-03-26 13:43:45', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (2, 1, 'user_status', '正常', '1', 11, '正常', NULL, NULL, 'admin', '2020-03-26 13:41:34', 'admin', '2020-03-26 13:41:34', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (3, 1, 'user_status', '锁定', '2', 12, '锁定', NULL, NULL, 'admin', '2020-03-26 13:46:17', 'admin', '2020-03-26 13:46:17', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (4, 1, 'user_status', '过期', '3', 13, '过期', NULL, NULL, 'admin', '2020-03-26 13:46:33', 'admin', '2020-03-26 13:46:33', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (5, 1, 'user_status', '测试删除', '5', 16, '测试删除', NULL, NULL, 'admin', '2020-03-26 13:46:50', 'admin', '2020-03-26 13:48:33', NULL, 1);
INSERT INTO `sys_dict_item` VALUES (6, 2, 'sex', '女', '0', 10, '', NULL, NULL, 'admin', '2020-04-29 21:29:55', 'admin', '2020-04-29 21:29:55', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (7, 2, 'sex', '男', '1', 11, '', NULL, NULL, 'admin', '2020-04-29 21:30:07', 'admin', '2020-04-29 21:30:07', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (8, 3, 'file_status', '未绑定', '0', 10, '', NULL, NULL, 'admin', '2020-05-02 09:53:55', 'admin', '2020-05-02 09:53:55', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (9, 3, 'file_status', '已绑定', '1', 11, '', NULL, NULL, 'admin', '2020-05-02 09:54:04', 'admin', '2020-05-02 09:54:04', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (10, 4, 'processs_type', '文章审核', 'PROCESS_ARTICLE', 10, '文章审核流程', '/article/task', NULL, 'admin', '2020-05-02 09:55:53', 'admin', '2020-06-18 15:12:51', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (11, 5, 'article_status', '暂存', '0', 10, '', NULL, NULL, 'admin', '2020-05-07 13:53:25', 'admin', '2020-05-07 13:53:25', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (12, 5, 'article_status', '退回修改', '1', 10, '', NULL, NULL, 'admin', '2020-05-07 13:53:35', 'admin', '2020-05-07 13:53:35', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (13, 5, 'article_status', '组长审核', '2', 10, '', NULL, NULL, 'admin', '2020-05-07 13:53:43', 'admin', '2020-05-07 13:53:43', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (14, 5, 'article_status', '主编审核', '3', 10, '', NULL, NULL, 'admin', '2020-05-07 13:53:48', 'admin', '2020-05-07 13:53:48', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (15, 5, 'article_status', '审核通过', '4', 10, '', NULL, NULL, 'admin', '2020-05-07 13:53:54', 'admin', '2020-05-07 13:53:54', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (16, 5, 'article_status', '审核不通过', '5', 10, '', NULL, NULL, 'admin', '2020-05-07 13:53:59', 'admin', '2020-05-07 13:53:59', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (17, 6, '是否', '否', '0', 11, '', NULL, NULL, 'admin', '2020-06-11 10:13:24', 'admin', '2020-06-11 10:13:49', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (18, 6, '是否', '是', '1', 10, '', NULL, NULL, 'admin', '2020-06-11 10:13:45', 'admin', '2020-06-11 10:13:45', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (19, 7, '执行任务策略', '默认', '0', 10, '', NULL, NULL, 'admin', '2020-06-11 10:15:03', 'admin', '2020-06-11 10:15:03', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (20, 7, '执行任务策略', '立即触发执行', '1', 11, '', NULL, NULL, 'admin', '2020-06-11 10:15:11', 'admin', '2020-06-11 10:15:15', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (21, 7, '执行任务策略', '触发一次执行', '2', 14, '', NULL, NULL, 'admin', '2020-06-11 10:15:27', 'admin', '2020-06-11 10:16:07', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (22, 7, '执行任务策略', '不触发立即执行', '3', 18, '', NULL, NULL, 'admin', '2020-06-11 10:15:58', 'admin', '2020-06-11 10:15:58', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (23, 8, 'quartz_status', '暂停', '0', 10, '', NULL, NULL, 'admin', '2020-06-11 13:50:33', 'admin', '2020-06-11 13:50:33', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (24, 8, 'quartz_status', '正常', '1', 11, '', NULL, NULL, 'admin', '2020-06-11 13:50:41', 'admin', '2020-06-11 13:50:41', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (25, 9, 'quartz_log_status', '正常', '0', 10, '', NULL, NULL, 'admin', '2020-06-11 16:37:37', 'admin', '2020-06-11 16:37:37', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (26, 9, 'quartz_log_status', '失败', '1', 11, '', NULL, NULL, 'admin', '2020-06-11 16:37:42', 'admin', '2020-06-11 16:37:50', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (27, 10, 'quartz_group', '默认', 'DEFAULT', 10, '', NULL, NULL, 'admin', '2020-06-11 17:28:15', 'admin', '2020-06-11 17:28:15', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (28, 10, 'quartz_group', '系统', 'SYSTEM', 11, '', NULL, NULL, 'admin', '2020-06-11 17:28:31', 'admin', '2020-06-11 17:28:31', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (29, 10, 'quartz_group', '业务', 'BUSINESS', 12, '', NULL, NULL, 'admin', '2020-06-11 17:28:45', 'admin', '2020-06-11 17:28:45', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (30, 11, 'quartz_type', 'java bean', '0', 10, '', NULL, NULL, 'admin', '2020-06-12 11:56:23', 'admin', '2020-06-12 11:56:47', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (31, 11, 'quartz_type', 'rest请求', '1', 11, '', NULL, NULL, 'admin', '2020-06-12 11:56:56', 'admin', '2020-08-16 22:00:45', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (32, 11, 'quartz_type', '消息队列', '2', 12, '', NULL, NULL, 'admin', '2020-06-12 11:57:04', 'admin', '2020-06-12 11:57:14', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (33, 12, 'role_ds_type', '全部', '1', 10, '', NULL, NULL, 'admin', '2020-08-07 17:51:07', 'admin', '2020-10-13 15:04:55', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (34, 12, 'role_ds_type', '本级', '2', 11, '', NULL, NULL, 'admin', '2020-08-07 17:51:16', 'admin', '2020-08-07 17:51:16', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (35, 12, 'role_ds_type', '本级以及子级', '3', 13, '', NULL, NULL, 'admin', '2020-08-07 17:51:34', 'admin', '2020-08-07 17:51:34', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (36, 12, 'role_ds_type', '自定义', '4', 13, '', NULL, NULL, 'admin', '2020-08-07 17:51:44', 'admin', '2020-11-10 16:26:18', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (37, 13, 'dept_type', '公司', '0', 10, '111', NULL, NULL, 'admin', '2020-08-07 17:52:19', 'admin', '2020-11-13 09:26:51', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (38, 13, 'dept_type', '部门', '1', 11, '', NULL, NULL, 'admin', '2020-08-07 17:52:27', 'admin', '2020-10-14 09:53:55', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (39, 13, 'dept_type', '小组', '2', 12, '', NULL, NULL, 'admin', '2020-08-07 17:52:36', 'admin', '2020-08-07 17:52:36', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (40, 15, 'aa', 'aaaa', '啊啊啊啊', 10, '啊啊啊啊啊', NULL, NULL, 'admin', '2020-10-14 17:53:57', 'admin', '2020-10-14 17:53:57', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (41, 15, 'aa', 'nnnn', 'nnnn', 10, '这是我们的哈哈哈哈', NULL, NULL, 'admin', '2020-10-15 09:12:26', 'admin', '2020-10-15 09:12:26', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (42, 15, 'aa', '重中之重', '22222', 10, '2222', '222', '222', 'admin', '2020-10-15 09:48:55', 'admin', '2020-10-15 09:48:55', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (43, 15, 'aa', 'bbbb', 'bbbb', 10, 'bbbb', NULL, NULL, 'admin', '2020-10-15 09:51:43', 'admin', '2020-10-15 09:51:43', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (44, 18, 'area_type', '省级', '1', 10, '', NULL, NULL, 'admin', '2020-12-13 13:28:55', 'admin', '2020-12-13 13:28:55', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (45, 18, 'area_type', '地级市', '2', 10, '', NULL, NULL, 'admin', '2020-12-13 13:29:21', 'admin', '2020-12-13 13:29:21', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (46, 18, 'area_type', '区级', '3', 10, '', NULL, NULL, 'admin', '2020-12-13 13:29:37', 'admin', '2020-12-13 13:29:37', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (47, 19, 'shop_user_type', '普通会员', '0', 10, '', NULL, NULL, 'admin', '2020-12-13 16:58:07', 'admin', '2020-12-13 16:58:07', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (48, 19, 'shop_user_type', 'VIP', '1', 10, '', NULL, NULL, 'admin', '2020-12-13 16:58:15', 'admin', '2020-12-13 16:58:15', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (49, 20, 'shop_user_status', '可用', '0', 10, '', NULL, NULL, 'admin', '2020-12-13 16:58:29', 'admin', '2020-12-13 16:58:29', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (50, 20, 'shop_user_status', '禁用', '1', 10, '', NULL, NULL, 'admin', '2020-12-13 16:58:43', 'admin', '2020-12-13 16:58:43', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (51, 20, 'shop_user_status', '注销', '2', 10, '', NULL, NULL, 'admin', '2020-12-13 16:58:54', 'admin', '2020-12-13 16:58:54', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (52, 21, 'goods_unit', '件/个', 'piece/pieces', 1, '', NULL, NULL, 'admin', '2020-12-15 16:52:14', 'admin', '2020-12-15 16:52:14', NULL, 1);
INSERT INTO `sys_dict_item` VALUES (53, 21, 'goods_unit', '双', 'pair', 2, '', NULL, NULL, 'admin', '2020-12-15 16:52:33', 'admin', '2020-12-15 16:53:07', NULL, 1);
INSERT INTO `sys_dict_item` VALUES (54, 21, 'goods_unit', '包', 'pack/packs', 3, '', NULL, NULL, 'admin', '2020-12-15 16:53:31', 'admin', '2020-12-15 16:53:31', NULL, 1);
INSERT INTO `sys_dict_item` VALUES (55, 21, 'goods_unit', '毫升', 'milliliter', 4, '', NULL, NULL, 'admin', '2020-12-15 16:54:09', 'admin', '2020-12-15 16:54:09', NULL, 1);
INSERT INTO `sys_dict_item` VALUES (56, 21, 'goods_unit', '毫克', 'milligram', 5, '', NULL, NULL, 'admin', '2020-12-15 16:54:28', 'admin', '2020-12-15 16:54:28', NULL, 1);
INSERT INTO `sys_dict_item` VALUES (57, 21, 'goods_unit', '盎司', 'ounce', 6, '', NULL, NULL, 'admin', '2020-12-15 16:54:45', 'admin', '2020-12-15 16:54:50', NULL, 1);
INSERT INTO `sys_dict_item` VALUES (58, 21, 'goods_unit', '套', 'set/sets', 7, '', NULL, NULL, 'admin', '2020-12-15 16:55:15', 'admin', '2020-12-15 16:55:15', NULL, 1);
INSERT INTO `sys_dict_item` VALUES (59, 21, 'goods_unit', '码', 'yard/yards', 8, '', NULL, NULL, 'admin', '2020-12-15 16:55:50', 'admin', '2020-12-15 16:55:50', NULL, 1);
INSERT INTO `sys_dict_item` VALUES (60, 22, 'attr_type', '单选', 'list_box', 10, '用于select', NULL, NULL, 'admin', '2020-12-16 14:49:57', 'admin', '2020-12-16 14:49:57', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (61, 22, 'attr_type', '多选', 'check_box', 10, '用户checkbox', NULL, NULL, 'admin', '2020-12-16 14:50:18', 'admin', '2020-12-16 14:50:18', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (62, 22, 'attr_type', '输入', 'input', 10, '用户输入框', NULL, NULL, 'admin', '2020-12-16 14:50:34', 'admin', '2020-12-16 14:50:34', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (63, 23, 'goods_keywords', '团长推荐', '团长推荐', 10, '', NULL, NULL, 'admin', '2020-12-18 13:57:32', 'admin', '2020-12-18 13:57:32', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (64, 23, 'goods_keywords', '包邮', '包邮', 10, '', NULL, NULL, 'admin', '2020-12-18 13:57:37', 'admin', '2020-12-18 13:57:37', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (65, 24, 'goods_status', '待上架', '0', 10, '', NULL, NULL, 'admin', '2020-12-18 21:10:54', 'admin', '2020-12-18 21:10:54', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (66, 24, 'goods_status', '已上架', '1', 11, '', NULL, NULL, 'admin', '2020-12-18 21:11:00', 'admin', '2020-12-18 21:11:11', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (67, 24, 'goods_status', '下架', '2', 12, '', NULL, NULL, 'admin', '2020-12-18 21:11:06', 'admin', '2020-12-18 21:11:17', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (68, 21, 'goods_unit', 'KG', 'kg', 10, '', NULL, NULL, 'admin', '2020-12-19 14:58:00', 'admin', '2020-12-19 14:58:00', NULL, 1);
INSERT INTO `sys_dict_item` VALUES (69, 25, 'shop_order_type', '普通订单', '0', 10, '', NULL, NULL, 'admin', '2020-12-22 17:17:38', 'admin', '2020-12-22 17:17:38', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (70, 25, 'shop_order_type', '团购订单', '1', 10, '', NULL, NULL, 'admin', '2020-12-22 17:17:46', 'admin', '2020-12-22 17:17:46', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (71, 25, 'shop_order_type', '秒杀订单', '2', 10, '', NULL, NULL, 'admin', '2020-12-22 17:17:52', 'admin', '2020-12-22 17:17:52', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (72, 26, 'shop_order_status', '待付款', '0', 10, '', NULL, NULL, 'admin', '2020-12-22 17:19:24', 'admin', '2020-12-22 17:19:24', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (73, 26, 'shop_order_status', '已取消', '1', 11, '', NULL, NULL, 'admin', '2020-12-22 17:19:31', 'admin', '2020-12-22 17:19:31', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (74, 26, 'shop_order_status', '已付款', '2', 12, '', NULL, NULL, 'admin', '2020-12-22 17:19:40', 'admin', '2020-12-22 17:19:40', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (75, 26, 'shop_order_status', '已发货', '3', 13, '', NULL, NULL, 'admin', '2020-12-22 17:19:48', 'admin', '2020-12-22 17:19:48', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (76, 26, 'shop_order_status', '用户确认收货', '4', 14, '', NULL, NULL, 'admin', '2020-12-22 17:19:58', 'admin', '2020-12-22 17:19:58', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (77, 26, 'shop_order_status', '退款', '5', 15, '', NULL, NULL, 'admin', '2020-12-22 17:20:08', 'admin', '2020-12-22 17:20:08', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (78, 26, 'shop_order_status', '完成', '6', 16, '', NULL, NULL, 'admin', '2020-12-22 17:20:19', 'admin', '2020-12-22 17:20:19', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (79, 27, 'shop_shipping_status', '待发货', '0', 10, '', NULL, NULL, 'admin', '2020-12-22 17:21:32', 'admin', '2020-12-22 17:21:32', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (80, 27, 'shop_shipping_status', '已发货', '1', 11, '', NULL, NULL, 'admin', '2020-12-22 17:21:41', 'admin', '2020-12-22 17:21:41', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (81, 27, 'shop_shipping_status', '已收货', '2', 12, '', NULL, NULL, 'admin', '2020-12-22 17:21:49', 'admin', '2020-12-22 17:21:49', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (82, 27, 'shop_shipping_status', '退货', '3', 13, '', NULL, NULL, 'admin', '2020-12-22 17:22:02', 'admin', '2020-12-22 17:22:02', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (83, 28, 'shop_pay_status', '待付款', '0', 10, '', NULL, NULL, 'admin', '2020-12-22 17:22:33', 'admin', '2020-12-22 17:22:33', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (84, 28, 'shop_pay_status', '已付款', '1', 11, '', NULL, NULL, 'admin', '2020-12-22 17:22:41', 'admin', '2020-12-22 17:22:41', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (85, 29, 'swiper_type', '无', 'none', 10, '', NULL, NULL, 'admin', '2021-01-03 15:05:53', 'admin', '2021-01-03 15:05:53', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (86, 29, 'swiper_type', '商品', 'goods', 11, '', NULL, NULL, 'admin', '2021-01-03 15:06:07', 'admin', '2021-01-03 15:06:07', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (87, 30, 'status', '正常', '0', 10, '', NULL, NULL, 'admin', '2021-01-03 15:07:09', 'admin', '2021-01-03 15:07:09', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (88, 30, 'status', '停用', '1', 11, '', NULL, NULL, 'admin', '2021-01-03 15:07:14', 'admin', '2021-01-03 15:07:14', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (89, 31, 'coupon_type', '新人券', 'new', 10, '', NULL, NULL, 'admin', '2021-01-04 17:16:53', 'admin', '2021-01-04 17:16:53', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (90, 31, 'coupon_type', '现金券', 'money', 11, '', NULL, NULL, 'admin', '2021-01-04 17:17:16', 'admin', '2021-01-04 17:17:16', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (91, 31, 'coupon_type', '满减券', 'fullRed', 12, '', NULL, NULL, 'admin', '2021-01-04 17:18:24', 'admin', '2021-01-04 17:18:24', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (92, 31, 'coupon_type', '折扣券', 'discount', 16, '', NULL, NULL, 'admin', '2021-01-04 17:18:50', 'admin', '2021-01-04 17:18:50', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (93, 32, 'coupon_status', '未开始', '0', 10, '', NULL, NULL, 'admin', '2021-01-04 17:20:14', 'admin', '2021-01-04 17:20:14', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (94, 32, 'coupon_status', '进行中', '1', 11, '', NULL, NULL, 'admin', '2021-01-04 17:20:21', 'admin', '2021-01-04 17:20:21', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (95, 32, 'coupon_status', '已结束', '2', 13, '', NULL, NULL, 'admin', '2021-01-04 17:20:27', 'admin', '2021-01-04 17:20:27', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (96, 33, 'goods_activity', '正常', '0', 10, '', NULL, NULL, 'admin', '2021-01-06 17:01:03', 'admin', '2021-01-06 17:01:03', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (97, 33, 'goods_activity', '秒杀', '1', 10, '', NULL, NULL, 'admin', '2021-01-06 17:01:08', 'admin', '2021-01-06 17:01:08', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (98, 33, 'goods_activity', '团购', '2', 10, '', NULL, NULL, 'admin', '2021-01-06 17:01:13', 'admin', '2021-01-06 17:01:13', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (99, 34, 'shop_pink_status', '待成团', '0', 10, '', NULL, NULL, 'admin', '2021-01-07 13:21:34', 'admin', '2021-01-07 13:30:11', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (100, 34, 'shop_pink_status', '拼团中', '1', 11, '', NULL, NULL, 'admin', '2021-01-07 13:21:46', 'admin', '2021-01-07 13:30:16', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (101, 34, 'shop_pink_status', '拼团成功', '2', 11, '', NULL, NULL, 'admin', '2021-01-07 13:21:52', 'admin', '2021-01-07 13:30:27', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (102, 34, 'shop_pink_status', '拼团失败', '3', 10, '', NULL, NULL, 'admin', '2021-01-07 13:22:04', 'admin', '2021-01-07 13:30:34', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (103, 35, 'order_status', '待付款', '0', 10, '', NULL, NULL, 'admin', '2021-01-07 15:45:14', 'admin', '2021-01-07 15:45:14', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (104, 35, 'order_status', '已取消', '1', 11, '', NULL, NULL, 'admin', '2021-01-07 15:45:21', 'admin', '2021-01-07 15:45:21', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (105, 35, 'order_status', '已付款', '2', 12, '', NULL, NULL, 'admin', '2021-01-07 15:45:34', 'admin', '2021-01-07 15:45:34', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (106, 35, 'order_status', '已发货', '3', 13, '', NULL, NULL, 'admin', '2021-01-07 15:46:00', 'admin', '2021-01-07 15:46:00', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (107, 35, 'order_status', '用户确认收货', '4', 14, '', NULL, NULL, 'admin', '2021-01-07 15:46:10', 'admin', '2021-01-07 15:46:10', NULL, 1);
INSERT INTO `sys_dict_item` VALUES (108, 35, 'order_status', '退款', '4', 15, '', NULL, NULL, 'admin', '2021-01-07 15:46:18', 'admin', '2021-01-12 10:10:40', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (109, 35, 'order_status', '完成', '5', 16, '', NULL, NULL, 'admin', '2021-01-07 15:46:29', 'admin', '2021-01-12 10:10:45', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (110, 35, 'order_status', '待评价', '6', 17, '', NULL, NULL, 'admin', '2021-01-07 15:46:51', 'admin', '2021-01-12 10:10:48', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (111, 36, 'shipping_status', '待发货', '0', 10, '', NULL, NULL, 'admin', '2021-01-07 16:13:42', 'admin', '2021-01-07 16:13:42', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (112, 36, 'shipping_status', '已发货', '1', 11, '', NULL, NULL, 'admin', '2021-01-07 16:13:50', 'admin', '2021-01-07 16:13:50', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (113, 36, 'shipping_status', '已收货', '2', 12, '', NULL, NULL, 'admin', '2021-01-07 16:13:57', 'admin', '2021-01-07 16:14:11', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (114, 36, 'shipping_status', '退货', '3', 13, '', NULL, NULL, 'admin', '2021-01-07 16:14:06', 'admin', '2021-01-07 16:14:06', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (115, 38, 'refund_status', '申请中', '0', 10, '', NULL, NULL, 'admin', '2021-01-07 16:20:22', 'admin', '2021-01-07 16:20:22', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (116, 38, 'refund_status', '退款完成', '1', 11, '', NULL, NULL, 'admin', '2021-01-07 16:20:32', 'admin', '2021-01-07 16:20:43', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (117, 38, 'refund_status', '拒绝退款', '2', 12, '', NULL, NULL, 'admin', '2021-01-07 16:20:40', 'admin', '2021-01-07 16:20:40', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (118, 39, 'express_company', '顺丰速运', 'SF', 10, '', NULL, NULL, 'admin', '2021-01-11 18:05:30', 'admin', '2021-01-11 18:05:30', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (119, 39, 'express_company', '中通快递', 'ZTO', 11, '', NULL, NULL, 'admin', '2021-01-11 18:05:47', 'admin', '2021-01-11 18:05:47', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (120, 39, 'express_company', '申通快递', 'STO', 12, '', NULL, NULL, 'admin', '2021-01-11 18:06:05', 'admin', '2021-01-11 18:06:05', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (121, 39, 'express_company', '圆通速递', 'YTO', 14, '', NULL, NULL, 'admin', '2021-01-11 18:06:26', 'admin', '2021-01-11 18:06:26', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (122, 39, 'express_company', '韵达速递', 'YD', 15, '', NULL, NULL, 'admin', '2021-01-11 18:06:50', 'admin', '2021-01-11 18:06:50', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (123, 21, 'goods_unit', '个/件', '1', 10, '', NULL, NULL, 'admin', '2021-01-12 16:14:18', 'admin', '2021-01-12 16:14:18', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (124, 23, 'goods_keywords', '精选', '精选', 1, '', NULL, NULL, 'admin', '2021-01-22 23:19:35', 'admin', '2021-01-22 23:19:35', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (125, 23, 'goods_keywords', '时令鲜果', '时令鲜果', 2, '', NULL, NULL, 'admin', '2021-01-22 23:19:52', 'admin', '2021-01-22 23:19:52', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (126, 23, 'goods_keywords', '当季畅销', '当季畅销', 3, '', NULL, NULL, 'admin', '2021-01-22 23:20:14', 'admin', '2021-01-22 23:20:21', NULL, 0);
INSERT INTO `sys_dict_item` VALUES (127, 23, 'goods_keywords', '年货精选', '年货精选', 5, '', NULL, NULL, 'admin', '2021-01-22 23:20:36', 'admin', '2021-01-22 23:20:36', NULL, 0);
-- ----------------------------
-- Table structure for sys_file_info
-- ----------------------------
DROP TABLE IF EXISTS `sys_file_info`;
CREATE TABLE `sys_file_info` (
`id` int(10) NOT NULL AUTO_INCREMENT COMMENT '主键',
`file_code` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件存储名称 uuid',
`file_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件名称',
`file_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件类型',
`file_size` int(15) NULL DEFAULT NULL COMMENT '文件大小',
`file_path` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件路径',
`biz_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件绑定id',
`biz_type` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件绑定类型',
`service_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '服务名称',
`status` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '状态 0 未绑定 1 绑定',
`creator` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '创建人',
`create_date` datetime NOT NULL COMMENT '创建时间',
`modifier` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '修改人',
`modify_date` datetime NOT NULL COMMENT '修改时间',
`remarks` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
`del_flag` tinyint(1) NOT NULL DEFAULT 0 COMMENT '状态',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '文件信息表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of sys_file_info
-- ----------------------------
INSERT INTO `sys_file_info` VALUES (1, 'c54dc1f48449446388fd5737d065326b', '空白.docx', 'docx', 45, 'biz/PROCESS_ARTICLE/10002/c54dc1f48449446388fd5737d065326b.docx', '10002', 'PROCESS_ARTICLE', NULL, '1', 'admin', '2020-04-19 11:42:25', 'admin', '2020-04-19 14:08:53', NULL, 1);
INSERT INTO `sys_file_info` VALUES (2, '035f388d041f434db5943a59fbff54f4', '我的头像.jpg', 'jpg', 20, 'temp/2020-04-19/035f388d041f434db5943a59fbff54f4.jpg', NULL, NULL, NULL, '0', 'admin', '2020-04-19 11:42:45', 'admin', '2020-04-19 11:42:45', NULL, 0);
INSERT INTO `sys_file_info` VALUES (3, '8659900097a143b8959403f262c9c038', 'Blue+白色动态14键.bds', 'bds', 303829, 'biz/string/string/8659900097a143b8959403f262c9c038.bds', 'string', 'string', 'string', '1', 'admin', '2020-11-07 15:45:10', 'admin', '2020-11-07 15:56:59', NULL, 1);
INSERT INTO `sys_file_info` VALUES (4, '6913fb1d80b44a84af8b3996db938b9b', '接口参数.txt', 'txt', 3759, 'temp/2020-12-11/6913fb1d80b44a84af8b3996db938b9b.txt', NULL, NULL, NULL, '0', 'admin', '2020-12-11 16:43:02', 'admin', '2020-12-11 16:43:02', NULL, 0);
-- ----------------------------
-- Table structure for sys_job
-- ----------------------------
DROP TABLE IF EXISTS `sys_job`;
CREATE TABLE `sys_job` (
`id` int(10) NOT NULL AUTO_INCREMENT COMMENT '任务ID',
`name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '任务名称',
`job_group` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'DEFAULT' COMMENT '任务组名',
`type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '调用类型 0 bean类型 1 rest类型 2 消息队列',
`invoke_target` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '调用目标字符串',
`cron_expression` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'cron执行表达式',
`misfire_policy` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '3' COMMENT '计划执行错误策略(1立即执行 2执行一次 3放弃执行)',
`concurrent` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '1' COMMENT '是否并发执行(1允许 0禁止)',
`status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '状态(1-正常,0-锁定)',
`creator` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '创建人',
`create_date` datetime NOT NULL COMMENT '创建时间',
`modifier` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '修改人',
`modify_date` datetime NOT NULL COMMENT '修改时间',
`remarks` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
`del_flag` tinyint(1) NOT NULL DEFAULT 0 COMMENT '状态',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '定时任务调度表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of sys_job
-- ----------------------------
INSERT INTO `sys_job` VALUES (1, '系统测试(无参)', 'DEFAULT', '0', 'simpleTask.doNoParams', '0/10 * * * * ? *', '3', '1', '0', 'admin', '2020-06-10 16:45:49', 'admin', '2021-01-25 16:01:41', NULL, 0);
INSERT INTO `sys_job` VALUES (2, '系统测试(有参)', 'DEFAULT', '0', 'simpleTask.doParams(\'spark\')', '0/15 * * * * ? *', '3', '1', '0', 'admin', '2020-06-10 16:45:51', 'admin', '2020-12-07 16:53:36', NULL, 0);
INSERT INTO `sys_job` VALUES (3, '系统测试(多参)', 'DEFAULT', '0', 'simpleTask.doMultipleParams(\'saprk\', true, 2000L, 316.50D, 100)', '0/20 * * * * ? *', '3', '1', '0', 'admin', '2020-06-10 16:45:53', 'admin', '2020-12-07 16:53:37', NULL, 0);
-- ----------------------------
-- Table structure for sys_job_log
-- ----------------------------
CREATE TABLE `sys_job_log` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '任务日志ID',
`job_id` int(10) DEFAULT NULL COMMENT '任务ID',
`job_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '任务名称',
`job_group` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '任务组名',
`invoke_target` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '调用目标字符串',
`times` int(10) DEFAULT NULL COMMENT '执行时间',
`status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '执行状态(0正常 1失败)',
`start_time` datetime(3) DEFAULT NULL COMMENT '开始时间',
`end_time` datetime(3) DEFAULT NULL COMMENT '结束时间',
`create_time` datetime(3) DEFAULT NULL COMMENT '创建时间',
`exception_info` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '异常信息',
`description` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '描述',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=658289 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='定时任务调度日志表';
-- ----------------------------
-- Table structure for sys_log_api
-- ----------------------------
CREATE TABLE `sys_log_api` (
`id` bigint(11) NOT NULL AUTO_INCREMENT,
`url` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'url',
`method` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '方法名',
`params` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '参数',
`create_time` datetime DEFAULT NULL COMMENT '访问时间',
`times` int(11) DEFAULT NULL COMMENT '耗时',
`creator` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '访问用户',
`ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '访问ip',
`location` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '地址',
`description` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '描述',
`status` int(3) DEFAULT NULL COMMENT '状态',
`error_log` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '错误日志',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1363016463782359043 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='日志表请求日志表';
-- ----------------------------
-- Table structure for sys_log_login
-- ----------------------------
CREATE TABLE `sys_log_login` (
`id` int(10) NOT NULL AUTO_INCREMENT COMMENT '主键',
`username` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '登录用户账号',
`os_type` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '登录系统',
`browser` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '登录浏览器',
`login_time` datetime DEFAULT NULL COMMENT '登录时间',
`location` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '登录地点',
`ip` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '登录ip',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2916 DEFAULT CHARSET=utf8 COMMENT='登录日志'; | the_stack |
-- Setup
\set QUIET on
SET client_min_messages TO error;
\set VERBOSITY terse
SET SESSION AUTHORIZATION postgres;
\set QUIET off
\echo '## Setup'
CREATE TABLE testtable (stable integer, c1 integer, c2 integer, c3 integer, c4 integer);
INSERT INTO testtable(stable,c1,c2,c3,c4) VALUES (1,2,3,4,5), (2,3,4,5,6), (3,4,5,6,7);
\d+ testtable
SELECT * FROM testtable ORDER BY stable ASC;
SELECT 'testtable'::regclass::oid as id INTO temp table original_oid;
CREATE FUNCTION cartodb.CDB_GetTableQueries_TestHelper(tableoid OID, ignore_cartodbfication BOOL DEFAULT false)
RETURNS text[]
AS
$$
DECLARE
queries TEXT[];
BEGIN
-- In older version of PG (pre 11), the syntax when creating triggers was
-- CREATE TRIGGER ... EXECUTE PROCEDURE ...
-- But in new ones it is
-- CREATE TRIGGER ... EXECUTE FUNCTION ...
-- To uniformize the tests, we replace it in the output of CDB_RegenerateTable
EXECUTE FORMAT('
SELECT array_agg(REGEXP_REPLACE(a, ''EXECUTE PROCEDURE'', ''EXECUTE FUNCTION''))
FROM unnest(cartodb.CDB_GetTableQueries(%L, %L)) a;', tableoid, ignore_cartodbfication) INTO queries;
RETURN queries;
END
$$
LANGUAGE PLPGSQL VOLATILE PARALLEL UNSAFE;
\echo '## Run cartodb.CDB_RegenerateTable and confirm the data and columns are the same'
SELECT cartodb.CDB_RegenerateTable('testtable'::regclass::oid);
\d+ testtable
SELECT * FROM testtable ORDER BY stable ASC;
\echo '## The table oid must have changed since the table itself changed'
SELECT 'testtable'::regclass::oid as id INTO temp table new_oid;
SELECT original_oid.id = new_oid.id FROM original_oid, new_oid;
\echo '## Check adding an index'
CREATE INDEX testtable_stable_idx ON testtable (stable NULLS FIRST) WITH (fillfactor = 80, vacuum_cleanup_index_scale_factor = 0.11);
SELECT tablename, indexname, indexdef FROM pg_indexes WHERE tablename = 'testtable' ORDER BY tablename, indexname;
SELECT cartodb.CDB_RegenerateTable('testtable'::regclass::oid);
SELECT tablename, indexname, indexdef FROM pg_indexes WHERE tablename = 'testtable' ORDER BY tablename, indexname;
\echo '## Check column properties'
ALTER TABLE testtable ADD UNIQUE (c2);
ALTER TABLE testtable ALTER COLUMN c3 SET NOT NULL;
\d+ testtable
SELECT tablename, indexname, indexdef FROM pg_indexes WHERE tablename = 'testtable' ORDER BY tablename, indexname;
SELECT cartodb.CDB_RegenerateTable('testtable'::regclass::oid);
\d+ testtable
SELECT tablename, indexname, indexdef FROM pg_indexes WHERE tablename = 'testtable' ORDER BY tablename, indexname;
\echo '## Check triggers'
CREATE OR REPLACE FUNCTION trigger_example_fn()
RETURNS TRIGGER
LANGUAGE PLPGSQL
AS
$$
BEGIN
RETURN NEW;
END;
$$;
CREATE TRIGGER testtable_trigger_example
BEFORE UPDATE
ON testtable
FOR EACH ROW
EXECUTE PROCEDURE trigger_example_fn();
SELECT event_object_schema as table_schema,
event_object_table as table_name,
trigger_schema,
trigger_name
FROM information_schema.triggers
WHERE event_object_table = 'testtable'
GROUP BY 1,2,3,4
ORDER BY table_schema,
table_name;
SELECT cartodb.CDB_RegenerateTable('testtable'::regclass::oid);
SELECT event_object_schema as table_schema,
event_object_table as table_name,
trigger_schema,
trigger_name
FROM information_schema.triggers
WHERE event_object_table = 'testtable'
GROUP BY 1,2,3,4
ORDER BY table_schema,
table_name,
trigger_name;
\echo '## Check Cartodbfycation'
DROP INDEX testtable_stable_idx;
DROP TRIGGER testtable_trigger_example ON testtable;
SELECT cartodb.CDB_GetTableQueries_TestHelper('testtable'::regclass::oid, ignore_cartodbfication := false);
SELECT cartodb.CDB_GetTableQueries_TestHelper('testtable'::regclass::oid, ignore_cartodbfication := true);
SELECT CDB_SetUserQuotaInBytes(0);
SELECT CDB_CartodbfyTable('testtable'::regclass);
SELECT cartodb.CDB_GetTableQueries_TestHelper('testtable'::regclass::oid, ignore_cartodbfication := false);
SELECT cartodb.CDB_GetTableQueries_TestHelper('testtable'::regclass::oid, ignore_cartodbfication := true);
\d+ testtable
SELECT tablename, indexname, indexdef FROM pg_indexes WHERE tablename = 'testtable' ORDER BY tablename, indexname;
SELECT event_object_schema as table_schema,
event_object_table as table_name,
trigger_schema,
trigger_name
FROM information_schema.triggers
WHERE event_object_table = 'testtable'
GROUP BY 1,2,3,4
ORDER BY table_schema,
table_name,
trigger_name;
SELECT cartodb.CDB_RegenerateTable('testtable'::regclass::oid);
SELECT cartodb.CDB_GetTableQueries_TestHelper('testtable'::regclass::oid, ignore_cartodbfication := false);
SELECT cartodb.CDB_GetTableQueries_TestHelper('testtable'::regclass::oid, ignore_cartodbfication := true);
\d+ testtable
SELECT tablename, indexname, indexdef FROM pg_indexes WHERE tablename = 'testtable' ORDER BY tablename, indexname;
SELECT event_object_schema as table_schema,
event_object_table as table_name,
trigger_schema,
trigger_name
FROM information_schema.triggers
WHERE event_object_table = 'testtable'
GROUP BY 1,2,3,4
ORDER BY table_schema,
table_name,
trigger_name;
\echo '## Test view / matview dependencies: It will not work but data will be the same'
CREATE VIEW testview AS SELECT * FROM testtable WHERE stable < 20;
SELECT * FROM testview ORDER BY stable ASC;
\d testtable
SELECT cartodb.CDB_RegenerateTable('testtable'::regclass::oid);
DROP VIEW testview;
SELECT cartodb.CDB_RegenerateTable('testtable'::regclass::oid);
CREATE MATERIALIZED VIEW testmatview AS SELECT * FROM testtable WHERE stable < 20;
SELECT * FROM testmatview ORDER BY stable ASC;
SELECT cartodb.CDB_RegenerateTable('testtable'::regclass::oid);
DROP MATERIALIZED VIEW testmatview;
SELECT cartodb.CDB_RegenerateTable('testtable'::regclass::oid);
\d testtable
\echo '## Test role access'
CREATE ROLE cdb_regenerate_tester LOGIN PASSWORD 'cdb_regenerate_pass';
GRANT CONNECT ON DATABASE contrib_regression TO cdb_regenerate_tester;
GRANT SELECT ON testtable TO cdb_regenerate_tester;
\c contrib_regression cdb_regenerate_tester
\set QUIET on
SET client_min_messages TO error;
\set VERBOSITY terse
\set QUIET off
SELECT * FROM testtable ORDER BY cartodb_id DESC;
\c contrib_regression postgres
\set QUIET on
SET client_min_messages TO error;
\set VERBOSITY terse
\set QUIET off
SELECT cartodb.CDB_RegenerateTable('testtable'::regclass::oid);
\c contrib_regression cdb_regenerate_tester
\set QUIET on
SET client_min_messages TO error;
\set VERBOSITY terse
\set QUIET off
SELECT * FROM testtable ORDER BY cartodb_id DESC;
\c contrib_regression postgres
\set QUIET on
SET client_min_messages TO error;
\set VERBOSITY terse
\set QUIET off
\echo '## Test calling with read only access (should fail)'
\c contrib_regression cdb_regenerate_tester
SELECT cartodb.CDB_RegenerateTable('testtable'::regclass::oid);
\c contrib_regression postgres
\set QUIET on
SET client_min_messages TO error;
\set VERBOSITY terse
\set QUIET off
\echo '## Test partitioned table'
CREATE TABLE measurement (
city_id int not null,
logdate date not null,
peaktemp int,
unitsales int
) PARTITION BY RANGE (logdate);
CREATE TABLE measurement_y2006m02 PARTITION OF measurement
FOR VALUES FROM ('2006-02-01') TO ('2006-03-01')
PARTITION BY RANGE (peaktemp);
CREATE TABLE measurement_y2006m03 PARTITION OF measurement
FOR VALUES FROM ('2006-03-01') TO ('2006-04-01');
CREATE INDEX ON measurement_y2006m02 (logdate);
CREATE INDEX ON measurement_y2006m03 (logdate);
\d measurement
SELECT c.oid::pg_catalog.regclass,
pg_catalog.pg_get_expr(c.relpartbound, c.oid),
c.relkind
FROM pg_catalog.pg_class c,
pg_catalog.pg_inherits i
WHERE c.oid=i.inhrelid AND i.inhparent = 'measurement'::regclass::oid
ORDER BY pg_catalog.pg_get_expr(c.relpartbound, c.oid) = 'DEFAULT', c.oid::pg_catalog.regclass::pg_catalog.text;
\d measurement_y2006m02
\d measurement_y2006m03
SELECT cartodb.CDB_RegenerateTable('measurement'::regclass::oid);
SELECT cartodb.CDB_RegenerateTable('measurement_y2006m02'::regclass::oid);
SELECT c.oid::pg_catalog.regclass,
pg_catalog.pg_get_expr(c.relpartbound, c.oid),
c.relkind
FROM pg_catalog.pg_class c,
pg_catalog.pg_inherits i
WHERE c.oid=i.inhrelid AND i.inhparent = 'measurement'::regclass::oid
ORDER BY pg_catalog.pg_get_expr(c.relpartbound, c.oid) = 'DEFAULT', c.oid::pg_catalog.regclass::pg_catalog.text;
\d measurement_y2006m02
\d measurement_y2006m03
SELECT cartodb.CDB_GetTableQueries_TestHelper('measurement'::regclass::oid, ignore_cartodbfication := false);
\echo '## Test transaction with truncate'
SET statement_timeout = 1000;
BEGIN;
TRUNCATE TABLE testtable;
SELECT CDB_RegenerateTable('public.testtable'::regclass);
COMMIT;
\echo '## Test transaction with delete'
BEGIN;
DELETE FROM testtable;
SELECT CDB_RegenerateTable('public.testtable'::regclass);
COMMIT;
\echo '## Test transaction with delete + cartodbfy'
BEGIN;
INSERT INTO testtable(stable,c1,c2,c3,c4) VALUES (1,2,3,4,5), (2,3,4,5,6), (3,4,5,6,7);
DELETE FROM testtable;
SELECT CDB_RegenerateTable('public.testtable'::regclass);
SELECT CDB_CartodbfyTable('public'::TEXT, 'public.testtable'::REGCLASS);
COMMIT;
\echo '## Test replacement in import (drop c3 and c4 columns)'
CREATE INDEX testtable_c4_idx ON testtable (c4 NULLS FIRST);
\d testtable
SELECT tablename, indexname, indexdef FROM pg_indexes WHERE tablename = 'testtable' ORDER BY tablename, indexname;
DO $$
DECLARE
queries TEXT[] := CDB_GetTableQueries_TestHelper('testtable'::regclass, true);
BEGIN
DROP TABLE testtable;
CREATE TABLE testtable (stable integer, c1 integer, c2 integer);
PERFORM CDB_CartodbfyTable('public.testtable');
PERFORM CDB_ApplyQueriesSafe(queries);
END$$;
\d testtable
SELECT tablename, indexname, indexdef FROM pg_indexes WHERE tablename = 'testtable' ORDER BY tablename, indexname;
\echo '## teardown'
DROP TABLE measurement CASCADE;
DROP TABLE testtable CASCADE;
REVOKE CONNECT ON DATABASE contrib_regression FROM cdb_regenerate_tester;
DROP ROLE cdb_regenerate_tester;
DROP FUNCTION cartodb.CDB_GetTableQueries_TestHelper; | the_stack |
-- 2018-05-16T14:49:35.740
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Bestell Schema',Updated=TO_TIMESTAMP('2018-05-16 14:49:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=541103
;
-- 2018-05-16T14:49:46.103
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Section (AD_Client_ID,AD_Org_ID,AD_Tab_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy,Value) VALUES (0,0,541103,540746,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100,'Y',10,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100,'main')
;
-- 2018-05-16T14:49:46.104
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Section_Trl (AD_Language,AD_UI_Section_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_UI_Section_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_UI_Section t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_UI_Section_ID=540746 AND NOT EXISTS (SELECT 1 FROM AD_UI_Section_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_UI_Section_ID=t.AD_UI_Section_ID)
;
-- 2018-05-16T14:49:46.138
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Column (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,0,540974,540746,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100,'Y',10,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-05-16T14:49:46.170
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,UIStyle,Updated,UpdatedBy) VALUES (0,0,540974,541604,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100,'Y','default',10,'primary',TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-05-16T14:49:46.215
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,564121,0,541103,541604,551998,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100,'Gültig ab inklusiv (erster Tag)','"Gültig ab" bezeichnet den ersten Tag eines Gültigkeitzeitraumes.','Y','N','N','Y','N','Gültig ab',0,10,0,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-05-16T14:49:46.249
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,564118,0,541103,541604,551999,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100,'Häufigkeitsart für Ereignisse','Die "Häufigkeitsart" wird zur Berechnung des Termins für das nächste Ereignis verwendet.','Y','N','N','Y','N','Häufigkeitsart',0,20,0,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-05-16T14:49:46.282
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,564119,0,541103,541604,552000,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100,'Häufigkeit von Ereignissen','The frequency is used in conjunction with the frequency type in determining an event. Example: If the Frequency Type is Week and the Frequency is 2 - it is every two weeks.','Y','N','N','Y','N','Häufigkeit',0,30,0,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-05-16T14:49:46.321
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,564103,0,541103,541604,552001,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100,'Day of the month 1 to 28/29/30/31','Y','N','N','Y','N','Day of the Month',0,40,0,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-05-16T14:49:46.367
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,564123,0,541103,541604,552002,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','Wiedervorlage (min)',0,50,0,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-05-16T14:49:46.399
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,564120,0,541103,541604,552003,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','Beschreibung',0,60,0,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-05-16T14:49:46.438
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,564105,0,541103,541604,552004,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100,'Montags verfügbar','Y','N','N','Y','N','Montag',0,70,0,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-05-16T14:49:46.475
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,564111,0,541103,541604,552005,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100,'Preparation time for monday','Y','N','N','Y','N','Bereitstellungszeit Mo',0,80,0,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-05-16T14:49:46.514
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,564109,0,541103,541604,552006,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100,'Dienstags verfügbar','Y','N','N','Y','N','Dienstag',0,90,0,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-05-16T14:49:46.547
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,564112,0,541103,541604,552007,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100,'Preparation time for tuesday','Y','N','N','Y','N','Bereitstellungszeit Di',0,100,0,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-05-16T14:49:46.593
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,564110,0,541103,541604,552008,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100,'Mittwochs verfügbar','Y','N','N','Y','N','Mittwoch',0,110,0,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-05-16T14:49:46.621
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,564113,0,541103,541604,552009,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100,'Preparation time for wednesday','Y','N','N','Y','N','Bereitstellungszeit Mi',0,120,0,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-05-16T14:49:46.651
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,564108,0,541103,541604,552010,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100,'Donnerstags verfügbar','Y','N','N','Y','N','Donnerstag',0,130,0,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-05-16T14:49:46.677
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,564114,0,541103,541604,552011,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100,'Preparation time for thursday','Y','N','N','Y','N','Bereitstellungszeit Do',0,140,0,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-05-16T14:49:46.704
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,564104,0,541103,541604,552012,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100,'Freitags verfügbar','Y','N','N','Y','N','Freitag',0,150,0,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-05-16T14:49:46.742
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,564115,0,541103,541604,552013,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100,'Preparation time for Friday','Y','N','N','Y','N','Bereitstellungszeit Fr',0,160,0,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-05-16T14:49:46.771
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,564106,0,541103,541604,552014,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100,'Samstags verfügbar','Y','N','N','Y','N','Samstag',0,170,0,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-05-16T14:49:46.802
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,564116,0,541103,541604,552015,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100,'Preparation time for Saturday','Y','N','N','Y','N','Bereitstellungszeit Sa',0,180,0,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-05-16T14:49:46.836
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,564107,0,541103,541604,552016,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100,'Sonntags verfügbar','Y','N','N','Y','N','Sonntag',0,190,0,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-05-16T14:49:46.869
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,564117,0,541103,541604,552017,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100,'Preparation time for Sunday','Y','N','N','Y','N','Bereitstellungszeit So',0,200,0,TO_TIMESTAMP('2018-05-16 14:49:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-05-16T14:52:16.889
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,564100,0,541103,541604,552018,'F',TO_TIMESTAMP('2018-05-16 14:52:16','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','Sektion',10,0,0,TO_TIMESTAMP('2018-05-16 14:52:16','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-05-16T14:52:27.017
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,564099,0,541103,541604,552019,'F',TO_TIMESTAMP('2018-05-16 14:52:26','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','Mandant',20,0,0,TO_TIMESTAMP('2018-05-16 14:52:26','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-05-16T14:52:30.279
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='N',Updated=TO_TIMESTAMP('2018-05-16 14:52:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552019
;
-- 2018-05-16T14:52:34.872
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='N', SeqNo=0,Updated=TO_TIMESTAMP('2018-05-16 14:52:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552018
;
-- 2018-05-16T14:52:43.245
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=0,Updated=TO_TIMESTAMP('2018-05-16 14:52:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552019
;
-- 2018-05-16T14:53:12.403
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2018-05-16 14:53:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552007
;
-- 2018-05-16T14:53:12.409
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2018-05-16 14:53:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552011
;
-- 2018-05-16T14:53:12.416
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2018-05-16 14:53:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552013
;
-- 2018-05-16T14:53:12.422
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2018-05-16 14:53:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552009
;
-- 2018-05-16T14:53:12.428
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2018-05-16 14:53:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552005
;
-- 2018-05-16T14:53:12.431
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2018-05-16 14:53:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552015
;
-- 2018-05-16T14:53:12.434
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2018-05-16 14:53:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552017
;
-- 2018-05-16T14:53:12.437
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=80,Updated=TO_TIMESTAMP('2018-05-16 14:53:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552006
;
-- 2018-05-16T14:53:12.439
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=90,Updated=TO_TIMESTAMP('2018-05-16 14:53:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552008
;
-- 2018-05-16T14:53:12.441
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=100,Updated=TO_TIMESTAMP('2018-05-16 14:53:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552010
;
-- 2018-05-16T14:53:12.443
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=110,Updated=TO_TIMESTAMP('2018-05-16 14:53:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552012
;
-- 2018-05-16T14:53:12.444
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=120,Updated=TO_TIMESTAMP('2018-05-16 14:53:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552014
;
-- 2018-05-16T14:53:12.445
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=130,Updated=TO_TIMESTAMP('2018-05-16 14:53:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552016
;
-- 2018-05-16T14:53:12.447
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=140,Updated=TO_TIMESTAMP('2018-05-16 14:53:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552018
;
-- 2018-05-16T15:00:10.133
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=10,Updated=TO_TIMESTAMP('2018-05-16 15:00:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551998
;
-- 2018-05-16T15:00:12.526
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=20,Updated=TO_TIMESTAMP('2018-05-16 15:00:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551999
;
-- 2018-05-16T15:25:28.323
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=30,Updated=TO_TIMESTAMP('2018-05-16 15:25:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552000
;
-- 2018-05-16T15:25:30.502
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=40,Updated=TO_TIMESTAMP('2018-05-16 15:25:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552001
;
-- 2018-05-16T15:25:36.628
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=50,Updated=TO_TIMESTAMP('2018-05-16 15:25:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552002
;
-- 2018-05-16T15:25:41.011
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=60,Updated=TO_TIMESTAMP('2018-05-16 15:25:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552003
;
-- 2018-05-16T15:26:00.063
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=70,Updated=TO_TIMESTAMP('2018-05-16 15:26:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552016
;
-- 2018-05-16T15:26:04.685
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=80,Updated=TO_TIMESTAMP('2018-05-16 15:26:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552017
;
-- 2018-05-16T15:26:19.944
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=0,Updated=TO_TIMESTAMP('2018-05-16 15:26:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552016
;
-- 2018-05-16T15:26:21.532
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=0,Updated=TO_TIMESTAMP('2018-05-16 15:26:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552017
;
-- 2018-05-16T15:26:30.073
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=70,Updated=TO_TIMESTAMP('2018-05-16 15:26:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552004
;
-- 2018-05-16T15:26:35.414
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=80,Updated=TO_TIMESTAMP('2018-05-16 15:26:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552005
;
-- 2018-05-16T15:26:41.545
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=90,Updated=TO_TIMESTAMP('2018-05-16 15:26:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552006
;
-- 2018-05-16T15:26:46.051
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=100,Updated=TO_TIMESTAMP('2018-05-16 15:26:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552007
;
-- 2018-05-16T15:26:53.283
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=110,Updated=TO_TIMESTAMP('2018-05-16 15:26:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552008
;
-- 2018-05-16T15:26:58.828
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=120,Updated=TO_TIMESTAMP('2018-05-16 15:26:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552009
;
-- 2018-05-16T15:27:44.743
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=130,Updated=TO_TIMESTAMP('2018-05-16 15:27:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552010
;
-- 2018-05-16T15:27:49.232
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=140,Updated=TO_TIMESTAMP('2018-05-16 15:27:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552011
;
-- 2018-05-16T15:27:56.071
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=150,Updated=TO_TIMESTAMP('2018-05-16 15:27:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552012
;
-- 2018-05-16T15:28:00.982
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=160,Updated=TO_TIMESTAMP('2018-05-16 15:28:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552013
;
-- 2018-05-16T15:28:11.383
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=170,Updated=TO_TIMESTAMP('2018-05-16 15:28:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552014
;
-- 2018-05-16T15:28:30.704
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=180,Updated=TO_TIMESTAMP('2018-05-16 15:28:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552015
;
-- 2018-05-16T15:28:37.914
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=190,Updated=TO_TIMESTAMP('2018-05-16 15:28:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552016
;
-- 2018-05-16T15:28:42.448
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=200,Updated=TO_TIMESTAMP('2018-05-16 15:28:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552017
;
-- 2018-05-16T15:28:45.469
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=210,Updated=TO_TIMESTAMP('2018-05-16 15:28:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552018
;
-- 2018-05-16T15:28:48.868
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=220,Updated=TO_TIMESTAMP('2018-05-16 15:28:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552019
;
-- 2018-05-16T15:29:32.675
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='Y',Updated=TO_TIMESTAMP('2018-05-16 15:29:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552017
;
-- 2018-05-16T15:29:33
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='Y',Updated=TO_TIMESTAMP('2018-05-16 15:29:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552015
;
-- 2018-05-16T15:29:33.347
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='Y',Updated=TO_TIMESTAMP('2018-05-16 15:29:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552013
;
-- 2018-05-16T15:29:34.299
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='Y',Updated=TO_TIMESTAMP('2018-05-16 15:29:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552011
;
-- 2018-05-16T15:29:34.713
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='Y',Updated=TO_TIMESTAMP('2018-05-16 15:29:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552009
;
-- 2018-05-16T15:29:35.097
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='Y',Updated=TO_TIMESTAMP('2018-05-16 15:29:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552007
;
-- 2018-05-16T15:29:35.656
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='Y',Updated=TO_TIMESTAMP('2018-05-16 15:29:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552005
;
-- 2018-05-16T15:29:36.224
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='Y',Updated=TO_TIMESTAMP('2018-05-16 15:29:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552019
;
-- 2018-05-16T15:29:36.669
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='Y',Updated=TO_TIMESTAMP('2018-05-16 15:29:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551998
;
-- 2018-05-16T15:29:37.156
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='Y',Updated=TO_TIMESTAMP('2018-05-16 15:29:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551999
;
-- 2018-05-16T15:29:37.710
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='Y',Updated=TO_TIMESTAMP('2018-05-16 15:29:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552000
;
-- 2018-05-16T15:29:38.330
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='Y',Updated=TO_TIMESTAMP('2018-05-16 15:29:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552001
;
-- 2018-05-16T15:29:38.848
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='Y',Updated=TO_TIMESTAMP('2018-05-16 15:29:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552002
;
-- 2018-05-16T15:29:39.445
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='Y',Updated=TO_TIMESTAMP('2018-05-16 15:29:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552003
;
-- 2018-05-16T15:29:40.174
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='Y',Updated=TO_TIMESTAMP('2018-05-16 15:29:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552004
;
-- 2018-05-16T15:29:41.101
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='Y',Updated=TO_TIMESTAMP('2018-05-16 15:29:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552006
;
-- 2018-05-16T15:29:41.760
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='Y',Updated=TO_TIMESTAMP('2018-05-16 15:29:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552008
;
-- 2018-05-16T15:29:42.350
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='Y',Updated=TO_TIMESTAMP('2018-05-16 15:29:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552010
;
-- 2018-05-16T15:29:42.991
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='Y',Updated=TO_TIMESTAMP('2018-05-16 15:29:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552012
;
-- 2018-05-16T15:29:43.453
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='Y',Updated=TO_TIMESTAMP('2018-05-16 15:29:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552014
;
-- 2018-05-16T15:29:43.916
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='Y',Updated=TO_TIMESTAMP('2018-05-16 15:29:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552016
;
-- 2018-05-16T15:29:45.172
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='Y',Updated=TO_TIMESTAMP('2018-05-16 15:29:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552018
;
-- 2018-05-16T15:32:01.989
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-05-16 15:32:01','YYYY-MM-DD HH24:MI:SS') WHERE AD_Tab_ID=541103 AND AD_Language='de_CH'
;
-- 2018-05-16T15:32:09.112
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-05-16 15:32:09','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Tab_ID=541103 AND AD_Language='en_US'
;
-- 2018-05-16T15:32:51.661
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-05-16 15:32:51','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Valid From',Description='',Help='' WHERE AD_Field_ID=564121 AND AD_Language='en_US'
;
-- 2018-05-16T15:33:06.961
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-05-16 15:33:06','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Frequency Type',Description='',Help='' WHERE AD_Field_ID=564118 AND AD_Language='en_US'
;
-- 2018-05-16T15:33:19.516
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-05-16 15:33:19','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Frequency',Description='',Help='' WHERE AD_Field_ID=564119 AND AD_Language='en_US'
;
-- 2018-05-16T15:33:27.056
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-05-16 15:33:27','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Field_ID=564103 AND AD_Language='en_US'
;
-- 2018-05-16T15:33:39.425
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-05-16 15:33:39','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Reminder Time in' WHERE AD_Field_ID=564123 AND AD_Language='en_US'
;
-- 2018-05-16T15:33:47.856
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-05-16 15:33:47','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Description' WHERE AD_Field_ID=564120 AND AD_Language='en_US'
;
-- 2018-05-16T15:33:56.911
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-05-16 15:33:56','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Monday',Description='' WHERE AD_Field_ID=564105 AND AD_Language='en_US'
;
-- 2018-05-16T15:34:16.542
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-05-16 15:34:16','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Monday Preparation Time' WHERE AD_Field_ID=564111 AND AD_Language='en_US'
;
-- 2018-05-16T15:34:25.570
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-05-16 15:34:25','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Tuesday',Description='' WHERE AD_Field_ID=564109 AND AD_Language='en_US'
;
-- 2018-05-16T15:34:35.793
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-05-16 15:34:35','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Tuesday Preparation Time' WHERE AD_Field_ID=564112 AND AD_Language='en_US'
;
-- 2018-05-16T15:34:45.793
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-05-16 15:34:45','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Wednesday',Description='' WHERE AD_Field_ID=564110 AND AD_Language='en_US'
;
-- 2018-05-16T15:35:00.862
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-05-16 15:35:00','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Wednesday Preparation Time' WHERE AD_Field_ID=564113 AND AD_Language='en_US'
;
-- 2018-05-16T15:35:15.117
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-05-16 15:35:15','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Thursday',Description='' WHERE AD_Field_ID=564108 AND AD_Language='en_US'
;
-- 2018-05-16T15:35:27.202
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-05-16 15:35:27','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Thursday Preparation Time' WHERE AD_Field_ID=564114 AND AD_Language='en_US'
;
-- 2018-05-16T15:35:36.351
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-05-16 15:35:36','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Friday',Description='' WHERE AD_Field_ID=564104 AND AD_Language='en_US'
;
-- 2018-05-16T15:35:47.381
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-05-16 15:35:47','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Friday Preparation Time' WHERE AD_Field_ID=564115 AND AD_Language='en_US'
;
-- 2018-05-16T15:35:57.927
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-05-16 15:35:57','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Saturday',Description='' WHERE AD_Field_ID=564106 AND AD_Language='en_US'
;
-- 2018-05-16T15:36:13.082
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-05-16 15:36:13','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Saturday Preparation Time' WHERE AD_Field_ID=564116 AND AD_Language='en_US'
;
-- 2018-05-16T15:36:22.897
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-05-16 15:36:22','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Sunday',Description='' WHERE AD_Field_ID=564107 AND AD_Language='en_US'
;
-- 2018-05-16T15:36:34.410
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-05-16 15:36:34','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Sunday Preparation Time' WHERE AD_Field_ID=564117 AND AD_Language='en_US'
;
-- 2018-05-16T15:36:44.084
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-05-16 15:36:44','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Client',Description='',Help='' WHERE AD_Field_ID=564099 AND AD_Language='en_US'
;
-- 2018-05-16T15:36:54.240
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-05-16 15:36:54','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Active',Description='',Help='' WHERE AD_Field_ID=564101 AND AD_Language='en_US'
;
-- 2018-05-16T15:37:05.379
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-05-16 15:37:05','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Business Partner',Description='',Help='' WHERE AD_Field_ID=564122 AND AD_Language='en_US'
;
-- 2018-05-16T15:37:17.746
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-05-16 15:37:17','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Organisation',Description='',Help='' WHERE AD_Field_ID=564100 AND AD_Language='en_US'
;
-- 2018-05-16T15:39:54.344
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Tag des Monats',Updated=TO_TIMESTAMP('2018-05-16 15:39:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=564103
;
-- 2018-05-16T15:40:13.100
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET WidgetSize='M',Updated=TO_TIMESTAMP('2018-05-16 15:40:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552018
;
-- 2018-05-16T15:40:17.743
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET WidgetSize='M',Updated=TO_TIMESTAMP('2018-05-16 15:40:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552019
;
-- 2018-05-16T15:40:23.821
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET WidgetSize='S',Updated=TO_TIMESTAMP('2018-05-16 15:40:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551998
;
-- 2018-05-16T15:40:27.450
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET WidgetSize='S',Updated=TO_TIMESTAMP('2018-05-16 15:40:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552000
;
-- 2018-05-16T15:40:32.892
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET WidgetSize='M',Updated=TO_TIMESTAMP('2018-05-16 15:40:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551999
; | the_stack |
;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`wstro` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `wstro`;
/*Table structure for table `sys_menu` */
DROP TABLE IF EXISTS `sys_menu`;
CREATE TABLE `sys_menu` (
`menu_id` bigint(20) NOT NULL AUTO_INCREMENT,
`parent_id` bigint(20) DEFAULT NULL COMMENT '父菜单ID,一级菜单为0',
`name` varchar(50) DEFAULT NULL COMMENT '菜单名称',
`url` varchar(200) DEFAULT NULL COMMENT '菜单URL',
`perms` varchar(500) DEFAULT NULL COMMENT '授权(多个用逗号分隔,如:user:list,user:create)',
`type` int(11) DEFAULT NULL COMMENT '类型 0:目录 1:菜单 2:按钮',
`icon` varchar(50) DEFAULT NULL COMMENT '菜单图标',
`order_num` int(11) DEFAULT NULL COMMENT '排序',
PRIMARY KEY (`menu_id`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8 COMMENT='菜单管理';
/*Data for the table `sys_menu` */
insert into `sys_menu`(`menu_id`,`parent_id`,`name`,`url`,`perms`,`type`,`icon`,`order_num`) values
(1,0,'系统管理','','',0,'fa fa-cog',0),
(2,1,'管理员列表','admin/sys/admin.html','',1,'fa fa-user',1),
(3,1,'角色管理','admin/sys/role.html',NULL,1,'fa fa-user-secret',2),
(4,1,'菜单管理','admin/sys/menu.html',NULL,1,'fa fa-th-list',3),
(5,2,'查看',NULL,'sys:user:list,sys:user:info',2,NULL,0),
(6,2,'新增','','sys:user:save,sys:role:select',2,'',0),
(7,2,'修改','','sys:user:update,sys:role:select',2,'',0),
(8,2,'删除',NULL,'sys:user:delete',2,NULL,0),
(9,3,'查看',NULL,'sys:role:list,sys:role:info',2,NULL,0),
(10,3,'新增',NULL,'sys:role:save,sys:menu:perms',2,NULL,0),
(11,3,'修改',NULL,'sys:role:update,sys:menu:perms',2,NULL,0),
(12,3,'删除',NULL,'sys:role:delete',2,NULL,0),
(13,4,'查看',NULL,'sys:menu:list,sys:menu:info',2,NULL,0),
(14,4,'新增',NULL,'sys:menu:save,sys:menu:select',2,NULL,0),
(15,4,'修改',NULL,'sys:menu:update,sys:menu:select',2,NULL,0),
(16,4,'删除',NULL,'sys:menu:delete',2,NULL,0),
(17,1,'监控管理','druid/index.html','druid:druid:manager',1,'fa fa-cogs',3),
(18,1,'Swagger管理','swagger-ui.html','swaggerui:swaggerui:manager',1,'fa fa-diamond',4);
/*Table structure for table `sys_role` */
DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role` (
`role_id` bigint(20) NOT NULL AUTO_INCREMENT,
`role_name` varchar(100) DEFAULT NULL COMMENT '角色名称',
`remark` varchar(100) DEFAULT NULL COMMENT '备注',
`create_time` int(11) DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`role_id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 COMMENT='角色';
/*Data for the table `sys_role` */
insert into `sys_role`(`role_id`,`role_name`,`remark`,`create_time`) values
(13,'admin','admina',1498801511);
/*Table structure for table `sys_role_menu` */
DROP TABLE IF EXISTS `sys_role_menu`;
CREATE TABLE `sys_role_menu` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`role_id` bigint(20) DEFAULT NULL COMMENT '角色ID',
`menu_id` bigint(20) DEFAULT NULL COMMENT '菜单ID',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=251 DEFAULT CHARSET=utf8 COMMENT='角色与菜单对应关系';
/*Data for the table `sys_role_menu` */
insert into `sys_role_menu`(`id`,`role_id`,`menu_id`) values
(241,13,1),
(242,13,2),
(243,13,5),
(244,13,6),
(245,13,3),
(246,13,9),
(247,13,4),
(248,13,13),
(249,13,17),
(250,13,18);
/*Table structure for table `sys_user` */
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user` (
`user_id` bigint(20) NOT NULL AUTO_INCREMENT,
`username` varchar(50) NOT NULL COMMENT '用户名',
`password` varchar(100) DEFAULT NULL COMMENT '密码',
`sex` tinyint(1) DEFAULT '0' COMMENT '性别 0=保密/1=男/2=女',
`email` varchar(100) DEFAULT NULL COMMENT '邮箱',
`mobile` varchar(100) DEFAULT NULL COMMENT '手机号',
`last_login_time` int(11) DEFAULT NULL COMMENT '最后登录时间',
`last_login_ip` varchar(20) DEFAULT NULL COMMENT '最后登录IP',
`avatar_url` varchar(255) DEFAULT NULL COMMENT '头像缩略图地址',
`status` tinyint(4) DEFAULT NULL COMMENT '状态 0:禁用 1:正常',
`create_time` int(11) DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`user_id`),
UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COMMENT='系统用户';
/*Data for the table `sys_user` */
insert into `sys_user`(`user_id`,`username`,`password`,`sex`,`email`,`mobile`,`last_login_time`,`last_login_ip`,`avatar_url`,`status`,`create_time`) values
(1,'admin','8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918',0,'2434387555@qq.com','13647910242',1500018856,'192.168.1.88','upload/adminAvatar/201707/1499675749475head.jpg',1,1498801511),
(7,'lastone','d50b4c0cab140a3310e256d86fd3cd33c02f145635df4694e71df062c1679a8f',2,'asd@qq.com','13456465465',1499069279,'192.168.1.88','upload/adminAvatar/201707/1499675749475head.jpg',1,1499069190),
(8,'joey','bfef4adc39f01b033fe749bb5f28f10b581fef319d34445d21a7bc63fe732fa3',2,'2434387555@qq.com','13647910412',1499670576,'192.168.1.88','upload/adminAvatar/201707/1499675749475head.jpg',0,1499410874);
/*Table structure for table `sys_user_login_log` */
DROP TABLE IF EXISTS `sys_user_login_log`;
CREATE TABLE `sys_user_login_log` (
`log_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '登录日志ID',
`login_time` int(11) DEFAULT NULL COMMENT '登录时间',
`login_ip` varchar(20) DEFAULT NULL COMMENT '登录IP',
`user_id` bigint(20) DEFAULT NULL COMMENT '用户ID',
`operating_system` varchar(50) DEFAULT NULL COMMENT '操作系统',
`browser` varchar(50) DEFAULT NULL COMMENT '浏览器',
PRIMARY KEY (`log_id`)
) ENGINE=InnoDB AUTO_INCREMENT=402 DEFAULT CHARSET=utf8 COMMENT='用户登录表';
/*Data for the table `sys_user_login_log` */
insert into `sys_user_login_log`(`log_id`,`login_time`,`login_ip`,`user_id`,`operating_system`,`browser`) values
(144,1498643487,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(145,1498643522,'192.168.1.13',1,'WINDOWS_7','CHROME'),
(146,1498644136,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(147,1498696770,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(148,1498696935,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(149,1498697948,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(150,1498698072,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(151,1498698196,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(152,1498699082,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(153,1498699432,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(154,1498699706,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(155,1498699646,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(156,1498699799,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(157,1498700536,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(158,1498703621,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(159,1498703553,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(160,1498703797,'192.168.1.26',1,'WINDOWS_7','CHROME39'),
(161,1498703941,'192.168.1.88',1,'WINDOWS_7','CHROME'),
(162,1498704012,'192.168.1.26',1,'WINDOWS_7','CHROME39'),
(163,1498704110,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(164,1498704322,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(165,1498704455,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(166,1498704533,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(167,1498704682,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(168,1498706068,'192.168.1.26',1,'WINDOWS_7','CHROME39'),
(169,1498707433,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(170,1498707589,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(171,1498708225,'192.168.1.88',1,'WINDOWS_7','CHROME'),
(172,1498714561,'192.168.1.13',1,'WINDOWS_7','CHROME'),
(173,1498714892,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(174,1498714912,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(175,1498717536,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(176,1498719628,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(177,1498719718,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(178,1498720250,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(179,1498721509,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(180,1498721472,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(181,1498721707,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(182,1498722682,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(183,1498722697,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(184,1498722774,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(185,1498722797,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(186,1498723998,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(187,1498724109,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(188,1498724427,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(189,1498724612,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(190,1498726269,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(191,1498726979,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(192,1498727250,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(193,1498729214,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(194,1498730522,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(195,1498730704,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(196,1498784021,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(197,1498784093,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(198,1498784793,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(199,1498785172,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(200,1498786010,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(201,1498786323,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(202,1498786548,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(203,1498786548,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(204,1498786716,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(205,1498786626,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(206,1498786988,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(207,1498787137,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(208,1498787414,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(209,1498787655,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(210,1498787901,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(211,1498788939,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(212,1498789243,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(213,1498792867,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(214,1498793558,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(215,1498793866,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(216,1498794052,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(217,1498794300,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(218,1498801042,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(219,1498800942,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(220,1498802396,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(221,1498802454,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(222,1498803515,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(223,1498804811,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(224,1498805228,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(225,1498805241,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(226,1498805469,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(227,1498805899,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(228,1498806813,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(229,1498806800,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(230,1498806995,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(231,1498807290,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(232,1498807203,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(233,1498807725,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(234,1498808125,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(235,1498809962,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(236,1498811173,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(237,1498811214,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(238,1498811582,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(239,1498811989,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(240,1498812194,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(241,1498812256,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(242,1498812373,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(243,1498812703,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(244,1498812751,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(245,1498814101,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(246,1498814281,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(247,1498814294,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(248,1498815015,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(249,1499042315,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(250,1499043527,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(251,1499049141,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(252,1499051653,'192.168.1.88',1,'WINDOWS_7','IE9'),
(253,1499051758,'192.168.1.88',1,'WINDOWS_7','CHROME51'),
(254,1499052573,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(255,1499052849,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(256,1499053115,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(257,1499060576,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(258,1499062246,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(259,1499066402,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(260,1499066583,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(261,1499066779,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(262,1499067338,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(263,1499069038,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(264,1499069279,'192.168.1.88',7,'WINDOWS_7','IE9'),
(265,1499069518,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(266,1499069582,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(267,1499070803,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(268,1499070825,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(269,1499071525,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(270,1499131270,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(271,1499134326,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(272,1499134791,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(273,1499153429,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(274,1499155324,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(275,1499155573,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(276,1499157566,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(277,1499157784,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(278,1499224438,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(279,1499224558,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(280,1499237804,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(281,1499238665,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(282,1499240768,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(283,1499240844,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(284,1499240927,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(285,1499241009,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(286,1499241689,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(287,1499241852,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(288,1499241940,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(289,1499242070,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(290,1499242204,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(291,1499242576,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(292,1499242686,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(293,1499242786,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(294,1499243019,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(295,1499243826,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(296,1499244330,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(297,1499244413,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(298,1499244893,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(299,1499245106,'0:0:0:0:0:0:0:1',1,'WINDOWS_7','CHROME49'),
(300,1499304924,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(301,1499305120,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(302,1499305230,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(303,1499305433,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(304,1499305555,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(305,1499305754,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(306,1499305988,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(307,1499306086,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(308,1499306206,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(309,1499306272,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(310,1499306446,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(311,1499323795,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(312,1499324004,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(313,1499325387,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(314,1499325470,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(315,1499325657,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(316,1499325738,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(317,1499325800,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(318,1499326940,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(319,1499326972,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(320,1499327095,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(321,1499327157,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(322,1499327897,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(323,1499328094,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(324,1499328214,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(325,1499333844,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(326,1499389330,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(327,1499392633,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(328,1499394310,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(329,1499394750,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(330,1499397025,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(331,1499397556,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(332,1499399214,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(333,1499407108,'192.168.1.88',1,'WINDOWS_7','CHROME51'),
(334,1499407181,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(335,1499410304,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(336,1499410387,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(337,1499410642,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(338,1499410906,'192.168.1.88',8,'WINDOWS_7','CHROME51'),
(339,1499410928,'192.168.1.88',8,'WINDOWS_7','CHROME51'),
(340,1499419066,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(341,1499649774,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(342,1499649874,'192.168.1.11',1,'WINDOWS_7','CHROME'),
(343,1499650352,'192.168.1.11',1,'WINDOWS_7','CHROME'),
(344,1499651147,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(345,1499651546,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(346,1499651696,'192.168.1.12',1,'WINDOWS_7','CHROME49'),
(347,1499652951,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(348,1499653330,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(349,1499656282,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(350,1499657144,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(351,1499665646,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(352,1499665846,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(353,1499666672,'192.168.1.12',1,'WINDOWS_7','CHROME49'),
(354,1499667521,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(355,1499668376,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(356,1499668738,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(357,1499668939,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(358,1499669915,'192.168.1.12',1,'WINDOWS_7','CHROME49'),
(359,1499670576,'192.168.1.88',8,'WINDOWS_7','CHROME49'),
(360,1499675439,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(361,1499675579,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(362,1499675677,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(363,1499675734,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(364,1499676954,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(365,1499678029,'192.168.1.12',1,'WINDOWS_7','CHROME49'),
(366,1499733831,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(367,1499736644,'192.168.1.12',1,'WINDOWS_7','CHROME49'),
(368,1499740053,'192.168.1.12',1,'WINDOWS_7','CHROME49'),
(369,1499739950,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(370,1499751595,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(371,1499754490,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(372,1499754532,'192.168.1.88',1,'WINDOWS_7','CHROME51'),
(373,1499754626,'192.168.1.88',1,'WINDOWS_7','CHROME'),
(374,1499754671,'192.168.1.88',1,'WINDOWS_7','IE9'),
(375,1499754889,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(376,1499755582,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(377,1499823697,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(378,1499824314,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(379,1499830448,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(380,1499830781,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(381,1499851241,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(382,1499911630,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(383,1499911942,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(384,1499912210,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(385,1499912417,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(386,1499912551,'192.168.1.88',1,'WINDOWS_7','IE9'),
(387,1499913005,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(388,1499914224,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(389,1499914472,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(390,1499915663,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(391,1499918084,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(392,1499925822,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(393,1499936087,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(394,1499938281,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(395,1499938450,'192.168.1.88',1,'WINDOWS_7','IE9'),
(396,1500012618,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(397,1500018058,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(398,1500018358,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(399,1500018527,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(400,1500018635,'192.168.1.88',1,'WINDOWS_7','CHROME49'),
(401,1500018856,'192.168.1.88',1,'WINDOWS_7','CHROME49');
/*Table structure for table `sys_user_role` */
DROP TABLE IF EXISTS `sys_user_role`;
CREATE TABLE `sys_user_role` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) DEFAULT NULL COMMENT '用户ID',
`role_id` bigint(20) DEFAULT NULL COMMENT '角色ID',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=74 DEFAULT CHARSET=utf8 COMMENT='用户与角色对应关系';
/*Data for the table `sys_user_role` */
insert into `sys_user_role`(`id`,`user_id`,`role_id`) values
(62,1,13),
(72,8,13),
(73,7,13);
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; | the_stack |
-- Copyright 2018 Tanel Poder. All rights reserved. More info at http://tanelpoder.com
-- Licensed under the Apache License, Version 2.0. See LICENSE.txt for terms & conditions.
--------------------------------------------------------------------------------
--
-- Author: Tanel Poder
-- Copyright: (c) http://www.tanelpoder.com
--
-- Notes: This software is provided AS IS and doesn't guarantee anything
-- Proofread before you execute it!
--
--------------------------------------------------------------------------------
create or replace package sesspack
authid definer -- using definer authid so executing users don't have to have explicit grants on
-- schema and V$ objects
-- authid current_user -- safer option, allows use of privileges granted through roles
is
function in_list( p_sql in varchar2 ) return sawr$SIDlist;
function valid_stat_modes return sawr$ModeList;
procedure snap_sidlist_internal( p_sidlist in sawr$SIDlist, p_session_stats in varchar2 default 'TYPICAL', p_snapid in number default null );
procedure snap_sidlist_internal( p_sql in varchar2, p_session_stats in varchar2 default 'TYPICAL', p_snapid in number default null );
-- snap current session
procedure snap_me ( p_session_stats in varchar2 default 'ALL', p_snapid in number default null );
-- snap session with given SID
procedure snap_sid ( p_sid in number, p_session_stats in varchar2 default 'TYPICAL', p_snapid in number default null );
procedure snap_sid ( p_sid in varchar2, p_session_stats in varchar2 default 'TYPICAL', p_snapid in number default null );
-- snap all sessions by oracle user
procedure snap_orauser( p_username in varchar2 default user, p_session_stats in varchar2 default 'TYPICAL', p_snapid in number default null );
-- snap all sessions by os user
procedure snap_osuser( p_username in varchar2, p_session_stats in varchar2 default 'TYPICAL', p_snapid in number default null );
-- snap all sessions by program name (v$session.program)
procedure snap_program( p_program in varchar2, p_session_stats in varchar2 default 'TYPICAL', p_snapid in number default null );
-- snap all sessions by terminal (v$session.terminal)
procedure snap_terminal( p_terminal in varchar2, p_session_stats in varchar2 default 'TYPICAL', p_snapid in number default null );
-- snap all sessions by machine (v$session.machine)
procedure snap_machine( p_machine in varchar2, p_session_stats in varchar2 default 'TYPICAL', p_snapid in number default null );
-- snap the session being served by SPID (v$process.spid)
procedure snap_spid( p_spid in varchar2, p_session_stats in varchar2 default 'TYPICAL', p_snapid in number default null );
procedure snap_spid( p_spid in number, p_session_stats in varchar2 default 'TYPICAL', p_snapid in number default null );
-- snap all sessions by client PID (v$session.process)
procedure snap_cpid( p_cpid in varchar2, p_session_stats in varchar2 default 'TYPICAL', p_snapid in number default null );
procedure snap_cpid( p_cpid in number, p_session_stats in varchar2 default 'TYPICAL', p_snapid in number default null );
-- snap all sessions
procedure snap_all ( p_session_stats in varchar2 default 'TYPICAL', p_snapid in number default null );
-- snap background sessions
procedure snap_bg ( p_session_stats in varchar2 default 'TYPICAL', p_snapid in number default null );
-- snap user sessions
procedure snap_fg ( p_session_stats in varchar2 default 'TYPICAL', p_snapid in number default null );
-- purge repository data
procedure purge_data ( p_days_threshold in number default 7, p_snapid in number default null );
end sesspack;
/
create or replace package body sesspack as
--==================================================================================================================
--==================================================================================================================
--
-- Global Variables
--
--==================================================================================================================
--==================================================================================================================
--------------------------------------------------------------------------------------------------------------------
-- g_snap_mode is inserted into sawr$snapshots table during first call to assign_snapid()
-- the global variable is changed in the beginning of each external procedure which can be
-- called directly. this means the directly-called procedure's g_snap_mode will be recorded
-- to sawr$snapshots table and its values will be ignored from there on
--------------------------------------------------------------------------------------------------------------------
g_snap_mode varchar2(100) := 'Undefined';
--==================================================================================================================
--==================================================================================================================
--
-- Internal Procs used by sesspack itself
--
--==================================================================================================================
--==================================================================================================================
--------------------------------------------------------------------------------------------------------------------
-- FUNCTION: assign_snapid
-- PURPOSE: generate new snapid if the the parent snap function is executed standalone.
-- if its executed from proper top-level function, a snapid to use should have been
-- passed down from there.
-- the reason for that is that we might need to run several different snap commands
-- for getting a snapshot (e.g. get all sessions where USERNAME = 'SYS' and all with
-- MODULE='HR')
--------------------------------------------------------------------------------------------------------------------
function assign_snapid (p_snapid in number, l_snap_comment varchar2 default '' ) return number
as
l_snapid number;
begin
if (p_snapid is null) then
-- insert a line for each distinct snapshot. primary method of entry for querying
-- snapshot data
--
-- TODO: update the snapshot row with snapshot end sysdate too
-- or put the number of milliseconds spent taking the snapshot
select sawr$snapid_seq.nextval into l_snapid from dual;
insert into sawr$snapshots values ( l_snapid, sysdate, user, g_snap_mode, l_snap_comment );
return l_snapid;
else
return p_snapid;
end if;
end assign_snapid;
--------------------------------------------------------------------------------------------------------------------
-- FUNCTION: in_list
-- PURPOSE: generic function for returning a collection of numbers from the dynamic query
-- passed in p_sql parameter.
-- for example, it's used for getting list of SIDs based on dynamic query
-- against v$session
-- PARAMETERS:
-- p_sql : SQL text string which should return a list of session IDs (in number format)
-- : no restriction where and how the list of SIDs is retrieved, such SIDs should
-- : just exist in V$SESSION, otherwise nothing is sampled
-- : for example, value can be 'select sid from v$session where username = '''APPS''''
-- : or 'select sid from v$session where status = '''ACTIVE''' and last_call_et > 5'
--------------------------------------------------------------------------------------------------------------------
function in_list( p_sql in varchar2 ) return sawr$SIDlist
as
type rc is ref cursor;
l_cursor rc;
l_tmp number;
l_data sawr$sidlist := sawr$SIDlist();
begin
open l_cursor for p_sql;
loop
fetch l_cursor into l_tmp;
exit when l_cursor%notfound;
l_data.extend;
l_data(l_data.count) := l_tmp;
end loop;
close l_cursor;
return l_data;
end in_list; -- ( p_sql in varchar2 )
--------------------------------------------------------------------------------------------------------------------
-- FUNCTION: valid_stat_modes
-- PURPOSE: Function for returning a collection of valid snap modes as determined by
-- the sawr$session_stat_mode table.
--------------------------------------------------------------------------------------------------------------------
function valid_stat_modes return sawr$ModeList is
l_modes sawr$ModeList;
begin
select distinct upper(mode_id) bulk collect into l_modes
from sawr$session_stat_mode;
return l_modes;
end valid_stat_modes;
--------------------------------------------------------------------------------------------------------------------
-- FUNCTION: snap_sidlist_internal (overloaded, p_sidlist as sawr$SIDlist type)
--
-- PURPOSE: this is the low-level procedure doing the actual sampling from V$ views
-- and inserting the result to SAWR$ tables
--
-- PARAMETERS:
-- p_sidlist : sawr$SIDlist collection, this is array of SIDs to be sampled from V$SESSION
-- p_snapid : snapshot ID to be inserted into SAWR$ tables. normally this comes from
-- parent functions, but is autogenerated when the low-level function is
-- executed manually and by leaving p_snapid as NULL.
--------------------------------------------------------------------------------------------------------------------
procedure snap_sidlist_internal( p_sidlist in sawr$SIDlist, p_session_stats in varchar2 default 'TYPICAL', p_snapid in number default null)
as
l_snapid number;
l_codeloc varchar2(200) := 'SNAP_SIDLIST_INTERNAL(P_SIDLIST): BEGIN';
begin
-- this variable is here for easier catching of exception sources in pre-10g dbs
l_codeloc:= 'SNAP_SIDLIST_INTERNAL(P_SIDLIST): CALL ASSIGN_SNAPID';
-- allocate a new snapid if a global one hasn't been passed down from caller
-- new snapid allocation inserts a line to SAWR$SNAPSHOTS table
l_snapid := assign_snapid(p_snapid);
------------------------------------------------------------------------------------------------------------
-- insert sessions matching parameter conditions into SAWR$SESSIONS table
------------------------------------------------------------------------------------------------------------
l_codeloc := 'SNAP_SIDLIST_INTERNAL(P_SIDLIST): INSERT INTO SAWR$SESSIONS';
insert into
sawr$sessions (
snapid
, snaptime
, program
, username
, machine
, osuser
, terminal
, module
, action
, audsid
, sid
, serial#
, process
, logon_time
)
select
l_snapid
, sysdate as snaptime
, nvl(s.program , '-')
, nvl(s.username , '-')
, nvl(s.machine , '-')
, nvl(s.osuser , '-')
, nvl(s.terminal , '-')
, nvl(module , '-')
, nvl(action , '-')
, s.audsid
, s.sid
, s.serial#
, s.process
, s.logon_time
from
v$session s
where
sid in (
select * from ( table(cast(p_sidlist as sawr$SIDlist)) )
);
------------------------------------------------------------------------------------------------------------
-- insert matching session wait events into SAWR$SESSION_EVENTS table
------------------------------------------------------------------------------------------------------------
l_codeloc := 'SNAP_SIDLIST_INTERNAL(P_SIDLIST): INSERT INTO SAWR$SESSION_EVENTS';
insert into
sawr$session_events (
snapid
, snaptime
, audsid
, sid
, serial#
, event#
, total_waits
, total_timeouts
, average_wait
, max_wait
, time_waited_micro
)
select --+ ORDERED tanel9
l_snapid,
sysdate as snaptime,
s.audsid,
e.sid,
s.serial#,
en.event#,
e.total_waits,
e.total_timeouts,
e.average_wait,
e.max_wait,
-- e.time_waited_micro + ( decode(e.event||w.state, w.event||'WAITING', w.seconds_in_wait, 0) * 1000000 ) time_waited_micro
e.time_waited_micro + NVL( CASE e.event||w.state
WHEN w.event||'WAITING' THEN
CASE
WHEN w.event IN ( select event from v$system_event where total_timeouts != 0 ) THEN 0
ELSE w.seconds_in_wait
END
ELSE 0
END
* 1000000, 0 ) time_waited_micro
from
v$session s,
v$session_event e,
v$session_wait w,
v$event_name en
where
e.sid = s.sid
and s.sid = w.sid
and w.sid = e.sid
and e.event = en.name
and s.sid in (
select * from ( table(cast(p_sidlist as sawr$SIDlist)) )
);
------------------------------------------------------------------------------------------------------------
-- insert used CPU time to session events table as well
-- in 9i V$SESSTAT (CPU used by this session) is used
-- from 10g V$SESS_TIME_MODEL is used as this is more accurate and is updated every 5 seconds
-- even during database CALL
--
-- note that the installer script automatically comments out the irrelevant part depending on db version
------------------------------------------------------------------------------------------------------------
-- the line below is substituted by "/*" by sqlplus during installation onto 9i database
&version_9_enable
-- 9i version for getting session CPU usage
insert into
sawr$session_events (
snapid
, snaptime
, audsid
, sid
, serial#
, event#
, total_waits
, time_waited_micro
)
select --+ ORDERED USE_NL(s st)
l_snapid,
sysdate as snaptime,
s.audsid,
s.sid,
s.serial#,
-1, -- naming CPU usage as event# -1
1, -- setting total waits for CPU to 1 for now (this can be got from perhaps number of calls or sum(events) later on)
st.value * 10000 -- x10000 makes microseconds out of centiseconds
from
v$session s,
v$sesstat st
where
st.statistic# = (select statistic# from v$statname where name = 'CPU used by this session')
and s.sid = st.sid
and s.sid in (
select * from ( table(cast(p_sidlist as sawr$SIDlist)) )
);
-- end: version_9_enable
-- */
-- the line below is substituted by "/*" by sqlplus during installation onto 10g and above database
&version_10_enable
-- 10g+ version for getting session CPU usage
insert into
sawr$session_events (
snapid
, snaptime
, audsid
, sid
, serial#
, event#
, total_waits
, time_waited_micro
)
select --+ ORDERED USE_NL(s st)
l_snapid,
sysdate as snaptime,
s.audsid,
s.sid,
s.serial#,
-1, -- naming CPU usage as event# -1
1, -- setting total waits for CPU to 1 for now (this can be got from perhaps number of calls or sum(events) later on)
st.value -- v$sess_time_model reports times in microseconds
from
v$session s,
v$sess_time_model st
where
st.stat_name = 'DB CPU'
and s.sid = st.sid
and s.sid in (
select * from ( table(cast(p_sidlist as sawr$SIDlist)) )
);
-- end: version_10_enable
-- */
------------------------------------------------------------------------------------------------------------
-- insert matching session statistics into SAWR$SESSION_STATS table
------------------------------------------------------------------------------------------------------------
l_codeloc := 'SNAP_SIDLIST_INTERNAL(P_SIDLIST): INSERT INTO SAWR$SESSION_STATS';
insert into
sawr$session_stats (
snapid
, snaptime
, audsid
, sid
, serial#
, statistic#
, value
)
select --+ ORDERED USE_NL(s ss) INDEX(s) tanel2
l_snapid,
sysdate as snaptime,
s.audsid,
s.sid,
s.serial#,
ss.statistic#,
ss.value
from
v$session s,
v$sesstat ss
where
s.sid = ss.sid
and s.sid in (
select * from ( table(cast(p_sidlist as sawr$SIDlist)) )
)
and ss.statistic# in (
select --+ ORDERED NO_UNNEST
statistic#
from
sawr$session_stat_mode cfg,
v$statname sn
where
sn.name = cfg.statistic_name
and cfg.mode_id = p_session_stats
)
and ss.value != 0;
l_codeloc := 'SNAP_SIDLIST_INTERNAL(P_SIDLIST): END';
exception
when NO_DATA_FOUND then null; -- its ok to find no matches for snapshot query
when others then raise_application_error(-20001, 'Error '||SQLCODE||': '||SQLERRM||' : FAILED AT '|| l_codeloc) ;
end snap_sidlist_internal; -- ( p_sidlist in sawr$SIDlist )
--------------------------------------------------------------------------------------------------------------------
-- FUNCTION: snap_sidlist_internal (overloaded, p_sidlist as VARCHAR2 type)
--
-- PURPOSE: this is a procedure accepting any SQL which returns array of
-- SIDs (NUMBER format) which are then used for calling the
-- snap_sidlist_internal sister function to extract session info
-- from V$SESSION
--
-- PARAMETERS:
-- p_sidlist : sawr$SIDlist collection, this is array of SIDs to be sampled from V$SESSION
-- p_snapid : snapshot ID to be inserted into SAWR$ tables. normally this comes from
-- parent functions, but is autogenerated when the low-level function is
-- executed manually and by leaving p_snapid as NULL.
--------------------------------------------------------------------------------------------------------------------
procedure snap_sidlist_internal(p_sql in varchar2, p_session_stats in varchar2 default 'TYPICAL', p_snapid in number default null)
is
l_snapid number;
begin
-- allocate a new snapid if a global one hasn't been passed down from caller
l_snapid := assign_snapid(p_snapid);
-- call the overloaded snap_sidlist_internal sister-function
-- which accepts sawr$SIDlist collection as a parameter
snap_sidlist_internal( in_list(p_sql), p_session_stats, l_snapid );
end snap_sidlist_internal; -- ( p_sql in varchar2 )
--==================================================================================================================
--==================================================================================================================
--
-- External Procs to be executed by users
--
--==================================================================================================================
--==================================================================================================================
--------------------------------------------------------------------------------------------------------------------
-- procedure for snapping current session
-- useful for ad-hoc instrumentation and performance diagnosis for SQL tuning
--------------------------------------------------------------------------------------------------------------------
procedure snap_me(p_session_stats in varchar2 default 'ALL', p_snapid in number default null) is
pragma autonomous_transaction;
begin
g_snap_mode:='SNAP_ME: '||user;
snap_sidlist_internal( 'select sid from v$mystat where rownum = 1', p_session_stats );
commit;
end snap_me;
--------------------------------------------------------------------------------------------------------------------
-- snap session with given SID
--------------------------------------------------------------------------------------------------------------------
procedure snap_sid ( p_sid in number, p_session_stats in varchar2 default 'TYPICAL', p_snapid in number default null ) is
pragma autonomous_transaction;
begin
g_snap_mode:='SNAP_SID: '||to_char(p_sid);
snap_sidlist_internal( 'select sid from v$session where sid in ('||to_char(p_sid)||')' , p_session_stats );
commit;
end snap_sid;
--------------------------------------------------------------------------------------------------------------------
-- snap session with given SID
--------------------------------------------------------------------------------------------------------------------
procedure snap_sid ( p_sid in varchar2, p_session_stats in varchar2 default 'TYPICAL', p_snapid in number default null ) is
pragma autonomous_transaction;
begin
g_snap_mode:='SNAP_SID: '||p_sid;
snap_sidlist_internal( 'select sid from v$session where sid in ('||p_sid||')' , p_session_stats );
commit;
end snap_sid;
--------------------------------------------------------------------------------------------------------------------
-- procedure for snapping all sessions
--------------------------------------------------------------------------------------------------------------------
procedure snap_all(p_session_stats in varchar2 default 'TYPICAL', p_snapid in number default null) is
pragma autonomous_transaction;
begin
g_snap_mode:='SNAP_ALL:';
snap_sidlist_internal( 'select sid from v$session' , p_session_stats );
commit;
end snap_all;
--------------------------------------------------------------------------------------------------------------------
-- procedure for snapping all BACKGROUND sessions
--------------------------------------------------------------------------------------------------------------------
procedure snap_bg(p_session_stats in varchar2 default 'TYPICAL', p_snapid in number default null) is
pragma autonomous_transaction;
begin
g_snap_mode:='SNAP_BG:';
snap_sidlist_internal( 'select sid from v$session where type = ''BACKGROUND''' , p_session_stats );
commit;
end snap_bg;
--------------------------------------------------------------------------------------------------------------------
-- procedure for snapping all USER sessions
--------------------------------------------------------------------------------------------------------------------
procedure snap_fg(p_session_stats in varchar2 default 'TYPICAL', p_snapid in number default null) is
pragma autonomous_transaction;
begin
g_snap_mode:='SNAP_FG:';
snap_sidlist_internal( 'select sid from v$session where type = ''USER''' , p_session_stats );
commit;
end snap_fg;
--------------------------------------------------------------------------------------------------------------------
-- procedure for snapping all sessions estabilished by specified Oracle user
-- default value null will snap all sessions by current user
--------------------------------------------------------------------------------------------------------------------
procedure snap_orauser(p_username in varchar2 default user, p_session_stats in varchar2 default 'TYPICAL', p_snapid in number default null) is
pragma autonomous_transaction;
begin
g_snap_mode:='SNAP_ORAUSER: '||p_username;
snap_sidlist_internal('select sid from v$session where username like '''|| p_username ||'''' , p_session_stats );
commit;
end snap_orauser;
--------------------------------------------------------------------------------------------------------------------
-- procedure for snapping all sessions estabilished by specified OS user
--------------------------------------------------------------------------------------------------------------------
procedure snap_osuser(p_username in varchar2, p_session_stats in varchar2 default 'TYPICAL', p_snapid in number default null) is
pragma autonomous_transaction;
begin
g_snap_mode:='SNAP_OSUSER: '||p_username;
snap_sidlist_internal('select sid from v$session where osuser like '''|| p_username ||'''' , p_session_stats );
commit;
end snap_osuser;
--------------------------------------------------------------------------------------------------------------------
-- snap all sessions by program name (v$session.program)
--------------------------------------------------------------------------------------------------------------------
procedure snap_program( p_program in varchar2, p_session_stats in varchar2 default 'TYPICAL', p_snapid in number default null ) is
pragma autonomous_transaction;
begin
g_snap_mode:='SNAP_PROGRAM: '||p_program;
snap_sidlist_internal('select sid from v$session where program like '''|| p_program ||'''' , p_session_stats );
commit;
end snap_program;
--------------------------------------------------------------------------------------------------------------------
-- snap all sessions by terminal (v$session.terminal)
--------------------------------------------------------------------------------------------------------------------
procedure snap_terminal( p_terminal in varchar2, p_session_stats in varchar2 default 'TYPICAL', p_snapid in number default null ) is
pragma autonomous_transaction;
begin
g_snap_mode:='SNAP_TERMINAL: '||p_terminal;
snap_sidlist_internal('select sid from v$session where terminal like '''|| p_terminal ||'''' , p_session_stats );
commit;
end snap_terminal;
--------------------------------------------------------------------------------------------------------------------
-- snap all sessions by machine (v$session.machine)
--------------------------------------------------------------------------------------------------------------------
procedure snap_machine( p_machine in varchar2, p_session_stats in varchar2 default 'TYPICAL', p_snapid in number default null ) is
pragma autonomous_transaction;
begin
g_snap_mode:='SNAP_MACHINE: '||p_machine;
snap_sidlist_internal('select sid from v$session where machine like '''|| p_machine ||'''' , p_session_stats);
commit;
end snap_machine;
--------------------------------------------------------------------------------------------------------------------
-- snap the session being served by SPID (v$process.spid)
--------------------------------------------------------------------------------------------------------------------
procedure snap_spid( p_spid in varchar2, p_session_stats in varchar2 default 'TYPICAL', p_snapid in number default null ) is
pragma autonomous_transaction;
begin
g_snap_mode:='SNAP_CPID: '||p_spid;
snap_sidlist_internal('select sid from v$session where paddr in ( select addr from v$process where spid in ('''|| p_spid ||'''))' , p_session_stats );
commit;
end snap_spid;
--------------------------------------------------------------------------------------------------------------------
-- snap the session being served by SPID (v$process.spid)
--------------------------------------------------------------------------------------------------------------------
procedure snap_spid( p_spid in number, p_session_stats in varchar2 default 'TYPICAL', p_snapid in number default null ) is
pragma autonomous_transaction;
begin
g_snap_mode:='SNAP_CPID: '||p_spid;
snap_sidlist_internal('select sid from v$session where paddr in ( select addr from v$process where spid in ('''|| to_char(p_spid) ||'''))' , p_session_stats );
commit;
end snap_spid;
--------------------------------------------------------------------------------------------------------------------
-- snap all sessions by client PID (v$session.process)
--------------------------------------------------------------------------------------------------------------------
procedure snap_cpid( p_cpid in varchar2, p_session_stats in varchar2 default 'TYPICAL', p_snapid in number default null ) is
pragma autonomous_transaction;
begin
g_snap_mode:='SNAP_CPID: '||p_cpid;
snap_sidlist_internal('select sid from v$session where process in ('''|| p_cpid ||''')' , p_session_stats );
commit;
end snap_cpid;
--------------------------------------------------------------------------------------------------------------------
-- snap all sessions by client PID (v$session.process)
--------------------------------------------------------------------------------------------------------------------
procedure snap_cpid( p_cpid in number, p_session_stats in varchar2 default 'TYPICAL', p_snapid in number default null ) is
pragma autonomous_transaction;
begin
g_snap_mode:='SNAP_CPID: '||to_char(p_cpid);
snap_sidlist_internal('select sid from v$session where process in ('''|| to_char(p_cpid) ||''')' , p_session_stats );
commit;
end snap_cpid;
--------------------------------------------------------------------------------------------------------------------
-- purge repository data over a certain age threshold
--------------------------------------------------------------------------------------------------------------------
procedure purge_data ( p_days_threshold in number default 7, p_snapid in number default null ) is
type sawr$TableList is table of varchar2(30);
l_tables sawr$TableList := sawr$TableList('SAWR$SNAPSHOTS',
'SAWR$SESSIONS',
'SAWR$SESSION_EVENTS',
'SAWR$SESSION_STATS');
l_snaptime date := trunc(sysdate)-nvl(p_days_threshold,7);
l_codeloc varchar2(200) := 'PURGE_DATA: BEGIN';
l_ddl varchar2(200);
pragma autonomous_transaction;
begin
l_codeloc := 'PURGE_DATA: DELETE DATA';
for i in 1 .. l_tables.count loop
l_codeloc := 'PURGE_DATA: DELETE ' || l_tables(i);
execute immediate ' delete from ' || l_tables(i) ||
' where snaptime < :snaptime ' ||
' and (snapid = :snapid or :snapid is null)'
using l_snaptime, p_snapid, p_snapid;
end loop;
l_codeloc := 'PURGE_DATA: REBUILD_TABLES';
for i in 1 .. l_tables.count loop
l_ddl := case l_tables(i)
when 'SAWR$SNAPSHOTS'
then 'alter index SAWR$SNAPSHOTS_PK coalesce'
else 'alter table ' || l_tables(i) || ' move online'
end;
l_codeloc := 'PURGE_DATA: REBUILD ' || l_tables(i);
execute immediate l_ddl;
end loop;
l_codeloc := 'PURGE_DATA: END';
exception
when others then
raise_application_error(-20001, 'Error '||SQLCODE||': '||SQLERRM||' : FAILED AT '|| l_codeloc) ;
end purge_data;
end sesspack;
/
show errors | the_stack |
GO
EXEC tSQLt.NewTestClass 'tSQLt_testutil_test_SA';
GO
CREATE PROCEDURE tSQLt_testutil_test_SA.[Create and fake tSQLt_testutil.PrepMultiRunLogTable]
AS
BEGIN
EXEC tSQLt_testutil.PrepMultiRunLogTable
EXEC tSQLt.FakeTable @TableName = 'tSQLt_testutil.MultiRunLog', @Identity = 1, @ComputedColumns = 0, @Defaults = 0;
END;
GO
CREATE PROCEDURE tSQLt_testutil_test_SA.[test BuildTestLog creates table with correct columns]
AS
BEGIN
DECLARE @TableName NVARCHAR(MAX) = 'dbo.['+CAST(NEWID() AS NVARCHAR(MAX))+']';
EXEC tSQLt_testutil.CreateBuildLog @TableName = @TableName;
CREATE TABLE tSQLt_testutil_test_SA.[testtable for comparison Expected]
(
[id] [int] NOT NULL IDENTITY(1, 1),
[Success] [int] NULL,
[Skipped] [int] NULL,
[Failure] [int] NULL,
[Error] [int] NULL,
[TestCaseSet] NVARCHAR(MAX) NULL,
[RunGroup] NVARCHAR(MAX) NULL,
[DatabaseName] NVARCHAR(MAX) NULL,
[Version] VARCHAR(14) NULL,
[ClrVersion] NVARCHAR(4000) NULL,
[ClrSigningKey] VARBINARY(8000) NULL,
[InstalledOnSqlVersion] NUMERIC(10, 2) NULL,
[SqlVersion] NUMERIC(10, 2) NULL,
[SqlBuild] NUMERIC(10, 2) NULL,
[SqlEdition] NVARCHAR(128) NULL,
[HostPlatform] NVARCHAR(256) NULL
);
EXEC('SELECT TOP(0) * INTO tSQLt_testutil_test_SA.[testtable for comparison Actual] FROM '+@TableName+';')
EXEC tSQLt.AssertEqualsTableSchema @Expected='tSQLt_testutil_test_SA.[testtable for comparison Expected]', @Actual = 'tSQLt_testutil_test_SA.[testtable for comparison Actual]';
END;
GO
CREATE PROCEDURE tSQLt_testutil_test_SA.[test StoreBuildLog transfers data from MultiRunLog and values RunGroup, DatabaseName]
AS
BEGIN
DECLARE @TableName NVARCHAR(MAX) = 'dbo.['+CAST(NEWID() AS NVARCHAR(MAX))+']';
EXEC tSQLt_testutil.CreateBuildLog @TableName = @TableName;
EXEC tSQLt_testutil_test_SA.[Create and fake tSQLt_testutil.PrepMultiRunLogTable];
SET IDENTITY_INSERT tSQLt_testutil.MultiRunLog ON;
INSERT INTO tSQLt_testutil.MultiRunLog(id,Success,Skipped,Failure,Error,TestCaseSet)
VALUES (101,123,456,678,101112,'testcaseset-101'),(102,98,76,54,32,'testcaseset-102'),(103,398,376,354,332,'testcaseset-103');
EXEC tSQLt_testutil.StoreBuildLog @TableName = @TableName, @RunGroup = 'SomeRunGroup';
SELECT ROW_NUMBER()OVER(ORDER BY MRL.id) AS id,
MRL.Success,
MRL.Skipped,
MRL.Failure,
MRL.Error,
MRL.TestCaseSet,
'SomeRunGroup' RunGroup,
DB_NAME() DatabaseName
INTO tSQLt_testutil_test_SA.[testtable for comparison Expected]
FROM tSQLt_testutil.MultiRunLog AS MRL;
EXEC(' SELECT ROW_NUMBER()OVER(ORDER BY MRL.id) AS id,
MRL.Success,
MRL.Skipped,
MRL.Failure,
MRL.Error,
MRL.TestCaseSet,
MRL.RunGroup,
MRL.DatabaseName
INTO tSQLt_testutil_test_SA.[testtable for comparison Actual]
FROM '+@TableName+' AS MRL;')
EXEC tSQLt.AssertEqualsTable 'tSQLt_testutil_test_SA.[testtable for comparison Expected]','tSQLt_testutil_test_SA.[testtable for comparison Actual]';
END;
GO
CREATE PROCEDURE tSQLt_testutil_test_SA.[test StoreBuildLog creates row if MultiRunLog is empty]
AS
BEGIN
DECLARE @TableName NVARCHAR(MAX) = 'dbo.['+CAST(NEWID() AS NVARCHAR(MAX))+']';
EXEC tSQLt_testutil.CreateBuildLog @TableName = @TableName;
EXEC tSQLt_testutil_test_SA.[Create and fake tSQLt_testutil.PrepMultiRunLogTable];
EXEC tSQLt_testutil.StoreBuildLog @TableName = @TableName, @RunGroup = 'AnotherRunGroup';
SELECT 1 id,
NULL Success,
NULL Skipped,
NULL Failure,
NULL Error,
NULL TestCaseSet,
'AnotherRunGroup' RunGroup,
DB_NAME() DatabaseName
INTO tSQLt_testutil_test_SA.[testtable for comparison Expected];
EXEC(' SELECT ROW_NUMBER()OVER(ORDER BY MRL.id) AS id,
MRL.Success,
MRL.Skipped,
MRL.Failure,
MRL.Error,
MRL.TestCaseSet,
MRL.RunGroup,
MRL.DatabaseName
INTO tSQLt_testutil_test_SA.[testtable for comparison Actual]
FROM '+@TableName+' AS MRL;')
EXEC tSQLt.AssertEqualsTable 'tSQLt_testutil_test_SA.[testtable for comparison Expected]','tSQLt_testutil_test_SA.[testtable for comparison Actual]';
END;
GO
-------------------------------------------------------------------------
GO
CREATE PROCEDURE tSQLt_testutil_test_SA.[test CheckBuildLog throws error if a test error exists in the log]
AS
BEGIN
EXEC tSQLt_testutil_test_SA.[Create and fake tSQLt_testutil.PrepMultiRunLogTable];
INSERT INTO tSQLt_testutil.MultiRunLog(Error)VALUES(1);
EXEC tSQLt_testutil.CreateBuildLog @TableName = 'tSQLt_testutil_test_SA.[Temp BuildLog Table]';
EXEC tSQLt_testutil.StoreBuildLog @TableName = 'tSQLt_testutil_test_SA.[Temp BuildLog Table]',@RunGroup='ATest';
SELECT TOP(0)MRL.*
INTO #ignore
FROM tSQLt_testutil_test_SA.[Temp BuildLog Table] X LEFT JOIN tSQLt_testutil_test_SA.[Temp BuildLog Table] AS MRL ON 0=1;
EXEC tSQLt.ExpectException @ExpectedMessage = 'tSQLt execution with failures or errors detected.', @ExpectedSeverity = 16, @ExpectedState = 10;
INSERT INTO #ignore
EXEC tSQLt_testutil.CheckBuildLog @TableName = 'tSQLt_testutil_test_SA.[Temp BuildLog Table]';
END
GO
CREATE PROCEDURE tSQLt_testutil_test_SA.[test CheckBuildLog throws error if a test failure exists in the log]
AS
BEGIN
EXEC tSQLt_testutil_test_SA.[Create and fake tSQLt_testutil.PrepMultiRunLogTable];
INSERT INTO tSQLt_testutil.MultiRunLog(Failure)VALUES(1);
EXEC tSQLt_testutil.CreateBuildLog @TableName = 'tSQLt_testutil_test_SA.[Temp BuildLog Table]';
EXEC tSQLt_testutil.StoreBuildLog @TableName = 'tSQLt_testutil_test_SA.[Temp BuildLog Table]',@RunGroup='ATest';
SELECT TOP(0)MRL.*
INTO #ignore
FROM tSQLt_testutil_test_SA.[Temp BuildLog Table] X LEFT JOIN tSQLt_testutil_test_SA.[Temp BuildLog Table] AS MRL ON 0=1;
EXEC tSQLt.ExpectException @ExpectedMessage = 'tSQLt execution with failures or errors detected.', @ExpectedSeverity = 16, @ExpectedState = 10;
INSERT INTO #ignore
EXEC tSQLt_testutil.CheckBuildLog @TableName = 'tSQLt_testutil_test_SA.[Temp BuildLog Table]';
END
GO
CREATE PROCEDURE tSQLt_testutil_test_SA.[test CheckBuildLog throws no error if all tests in the log succeeded]
AS
BEGIN
EXEC tSQLt_testutil_test_SA.[Create and fake tSQLt_testutil.PrepMultiRunLogTable];
INSERT INTO tSQLt_testutil.MultiRunLog(Success)VALUES(1);
EXEC tSQLt_testutil.CreateBuildLog @TableName = 'tSQLt_testutil_test_SA.[Temp BuildLog Table]';
EXEC tSQLt_testutil.StoreBuildLog @TableName = 'tSQLt_testutil_test_SA.[Temp BuildLog Table]',@RunGroup='ATest';
SELECT TOP(0)MRL.*
INTO #ignore
FROM tSQLt_testutil_test_SA.[Temp BuildLog Table] X LEFT JOIN tSQLt_testutil_test_SA.[Temp BuildLog Table] AS MRL ON 0=1;
EXEC tSQLt.ExpectNoException;
INSERT INTO #ignore
EXEC tSQLt_testutil.CheckBuildLog @TableName = 'tSQLt_testutil_test_SA.[Temp BuildLog Table]';
END
GO
CREATE PROCEDURE tSQLt_testutil_test_SA.[test CheckBuildLog can be called twice]
AS
BEGIN
EXEC tSQLt_testutil_test_SA.[Create and fake tSQLt_testutil.PrepMultiRunLogTable];
INSERT INTO tSQLt_testutil.MultiRunLog(Success)VALUES(1);
EXEC tSQLt_testutil.CreateBuildLog @TableName = 'tSQLt_testutil_test_SA.[Temp BuildLog Table]';
EXEC tSQLt_testutil.StoreBuildLog @TableName = 'tSQLt_testutil_test_SA.[Temp BuildLog Table]',@RunGroup='ATest';
SELECT TOP(0)MRL.*
INTO #ignore
FROM tSQLt_testutil_test_SA.[Temp BuildLog Table] X LEFT JOIN tSQLt_testutil_test_SA.[Temp BuildLog Table] AS MRL ON 0=1;
EXEC tSQLt.ExpectNoException;
INSERT INTO #ignore
EXEC tSQLt_testutil.CheckBuildLog @TableName = 'tSQLt_testutil_test_SA.[Temp BuildLog Table]';
INSERT INTO #ignore
EXEC tSQLt_testutil.CheckBuildLog @TableName = 'tSQLt_testutil_test_SA.[Temp BuildLog Table]';
END
GO
CREATE PROCEDURE tSQLt_testutil_test_SA.[test CheckBuildLog Private_Print is called with the result of TableToText]
AS
BEGIN
EXEC tSQLt.SpyProcedure @ProcedureName = 'tSQLt.Private_Print';
EXEC tSQLt.SpyProcedure @ProcedureName = 'tSQLt.TableToText', @CommandToExecute = 'SET @txt=''<recognizable text goes here>'';';
EXEC tSQLt_testutil.CreateBuildLog @TableName = 'tSQLt_testutil_test_SA.[Temp BuildLog Table]';
EXEC tSQLt_testutil.CheckBuildLog @TableName = 'tSQLt_testutil_test_SA.[Temp BuildLog Table]';
IF NOT EXISTS(SELECT 1 FROM tSQLt.Private_Print_SpyProcedureLog WHERE Message = '<recognizable text goes here>')
BEGIN
EXEC tSQLt.Fail 'tSQLt.Private_Print was not called with the output of tSQLt.TableToText';
END;
END;
GO
--TODO: This really needs an "undo" on the tSQLt.SpyProcedure, but we don't have time for it.
CREATE PROCEDURE tSQLt_testutil_test_SA.[test CheckBuildLog prints contents of Log]
AS
BEGIN
EXEC tSQLt.SpyProcedure @ProcedureName = 'tSQLt.Private_Print';
EXEC tSQLt.SpyProcedure @ProcedureName = 'tSQLt.TableToText';
EXEC tSQLt_testutil.CreateBuildLog @TableName = 'tSQLt_testutil_test_SA.[Temp BuildLog Table]';
EXEC tSQLt.FakeTable @TableName = 'tSQLt_testutil_test_SA.[Temp BuildLog Table]';
INSERT INTO tSQLt_testutil_test_SA.[Temp BuildLog Table](id, Success, Skipped, Failure, Error, TestCaseSet, RunGroup, DatabaseName)
VALUES
(101,17,9,1,3,'row 1','RG1','DB1'),(102,4,6,7,5,'row 2','RG2','DB2');
EXEC tSQLt_testutil.CheckBuildLog @TableName = 'tSQLt_testutil_test_SA.[Temp BuildLog Table]';
DECLARE @TableName NVARCHAR(MAX) = (SELECT TableName FROM tSQLt.TableToText_SpyProcedureLog);
SELECT CAST (MRL.id AS NVARCHAR(MAX)) AS id,
CAST (MRL.Success AS NVARCHAR(MAX)) AS Success,
CAST (MRL.Skipped AS NVARCHAR(MAX)) AS Skipped,
CAST (MRL.Failure AS NVARCHAR(MAX)) AS Failure,
CAST (MRL.Error AS NVARCHAR(MAX)) AS Error,
CAST (MRL.TestCaseSet AS NVARCHAR(MAX)) AS TestCaseSet,
CAST (RunGroup AS NVARCHAR(MAX)) AS RunGroup,
CAST (DatabaseName AS NVARCHAR(MAX)) AS DatabaseName
INTO tSQLt_testutil_test_SA.[testtable for comparison Expected]
FROM tSQLt_testutil_test_SA.[Temp BuildLog Table] AS MRL
EXEC('SELECT * INTO tSQLt_testutil_test_SA.[testtable for comparison Hold] FROM ' + @TableName + ';');
SELECT LTRIM(RTRIM(CAST (MRL.id AS NVARCHAR(MAX)))) AS id,
LTRIM(RTRIM(CAST (MRL.Success AS NVARCHAR(MAX)))) AS Success,
LTRIM(RTRIM(CAST (MRL.Skipped AS NVARCHAR(MAX)))) AS Skipped,
LTRIM(RTRIM(CAST (MRL.Failure AS NVARCHAR(MAX)))) AS Failure,
LTRIM(RTRIM(CAST (MRL.Error AS NVARCHAR(MAX)))) AS Error,
LTRIM(RTRIM(CAST (MRL.TestCaseSet AS NVARCHAR(MAX)))) AS TestCaseSet,
LTRIM(RTRIM(CAST (RunGroup AS NVARCHAR(MAX)))) AS RunGroup,
LTRIM(RTRIM(CAST (DatabaseName AS NVARCHAR(MAX)))) AS DatabaseName
INTO tSQLt_testutil_test_SA.[testtable for comparison Actual]
FROM tSQLt_testutil_test_SA.[testtable for comparison Hold] AS MRL
EXEC tSQLt.AssertEqualsTable 'tSQLt_testutil_test_SA.[testtable for comparison Expected]','tSQLt_testutil_test_SA.[testtable for comparison Actual]';
END
GO
CREATE PROCEDURE tSQLt_testutil_test_SA.[test CheckBuildLog throws error if the log is empty]
AS
BEGIN
EXEC tSQLt_testutil_test_SA.[Create and fake tSQLt_testutil.PrepMultiRunLogTable];
EXEC tSQLt_testutil.CreateBuildLog @TableName = 'tSQLt_testutil_test_SA.[Temp BuildLog Table]';
SELECT TOP(0)MRL.*
INTO #ignore
FROM tSQLt_testutil_test_SA.[Temp BuildLog Table] X LEFT JOIN tSQLt_testutil_test_SA.[Temp BuildLog Table] AS MRL ON 0=1;
EXEC tSQLt.ExpectException @ExpectedMessage = 'BuildLog is empty.', @ExpectedSeverity = 16, @ExpectedState = 10;
INSERT INTO #ignore
EXEC tSQLt_testutil.CheckBuildLog @TableName = 'tSQLt_testutil_test_SA.[Temp BuildLog Table]';
END
GO
CREATE PROCEDURE tSQLt_testutil_test_SA.[test CheckBuildLog throws error if the log contains empty run]
AS
BEGIN
EXEC tSQLt_testutil_test_SA.[Create and fake tSQLt_testutil.PrepMultiRunLogTable];
INSERT INTO tSQLt_testutil.MultiRunLog(Success,Skipped,Failure,Error,TestCaseSet)
VALUES(0,0,0,0,'some run');
EXEC tSQLt_testutil.CreateBuildLog @TableName = 'tSQLt_testutil_test_SA.[Temp BuildLog Table]';
EXEC tSQLt_testutil.StoreBuildLog @TableName = 'tSQLt_testutil_test_SA.[Temp BuildLog Table]',@RunGroup='ATest';
SELECT TOP(0)MRL.*
INTO #ignore
FROM tSQLt_testutil_test_SA.[Temp BuildLog Table] X LEFT JOIN tSQLt_testutil_test_SA.[Temp BuildLog Table] AS MRL ON 0=1;
EXEC tSQLt.ExpectException @ExpectedMessage = 'BuildLog contains Run without tests.', @ExpectedSeverity = 16, @ExpectedState = 10;
INSERT INTO #ignore
EXEC tSQLt_testutil.CheckBuildLog @TableName = 'tSQLt_testutil_test_SA.[Temp BuildLog Table]';
END
GO
CREATE PROCEDURE tSQLt_testutil_test_SA.[ptest CheckBuildLog doesn't throw error if]
@success INT = 0,
@skipped INT = 0,
@failed INT = 0,
@errored INT = 0
AS
BEGIN
EXEC tSQLt_testutil_test_SA.[Create and fake tSQLt_testutil.PrepMultiRunLogTable];
INSERT INTO tSQLt_testutil.MultiRunLog(Success,Skipped,Failure,Error)
VALUES(@success,@skipped,@failed,@errored);
EXEC tSQLt_testutil.CreateBuildLog @TableName = 'tSQLt_testutil_test_SA.[Temp BuildLog Table]';
EXEC tSQLt_testutil.StoreBuildLog @TableName = 'tSQLt_testutil_test_SA.[Temp BuildLog Table]',@RunGroup='ATest';
SELECT TOP(0)MRL.*
INTO #Actual
FROM tSQLt_testutil_test_SA.[Temp BuildLog Table] X LEFT JOIN tSQLt_testutil_test_SA.[Temp BuildLog Table] AS MRL ON 0=1;
EXEC tSQLt.ExpectNoException;
INSERT INTO #Actual
EXEC tSQLt_testutil.CheckBuildLog @TableName = 'tSQLt_testutil_test_SA.[Temp BuildLog Table]';
END
GO
CREATE PROCEDURE tSQLt_testutil_test_SA.[test CheckBuildLog doesn't throw error if a success exists]
AS
BEGIN
EXEC tSQLt_testutil_test_SA.[ptest CheckBuildLog doesn't throw error if] @success=1;
END
GO
CREATE PROCEDURE tSQLt_testutil_test_SA.[test CheckBuildLog doesn't throw error if a skip exists]
AS
BEGIN
EXEC tSQLt_testutil_test_SA.[ptest CheckBuildLog doesn't throw error if] @skipped=1;
END
GO | the_stack |
DELETE from snmp_metric_cfg;
DELETE from measurement_cfg;
DELETE from measurement_field_cfg;
DELETE from m_groups_cfg;
DELETE from m_groups_measurements;
DELETE from influx_cfg;
DELETE from snmp_device_cfg;
DELETE from snmp_dev_m_groups;
DELETE from meas_filter_cfg;
DELETE from snmp_dev_filters;
DELETE from oid_condition_cfg;
DELETE from custom_filter_cfg;
DELETE from custom_filter_items;
/*
=====================
metrics
======================
# [metrics."id"] => id for other structs
# fielname : name measurement
# Description : little description for user easy understand
# BaseOID : the real OID we need to query
# Datasrctype : any of GAUGE,INTEGER,COUNTER32,COUNTER64
# - GAUGE: with this type of data this tool will send direct value( float )
# - INTEGER: with this type of data this tool will send direct value( int)
# - COUNTER32: with this , this tool will compute the difference ( it takes care of posible counter overflow)
# - COUNTER64: with this , this tool will compute the difference ( it takes care of posible counter overflow)
#http://www.debianadmin.com/linux-snmp-oids-for-cpumemory-and-disk-statistics.html
#http://publib.boulder.ibm.com/tividd/td/ITMFNP/SC31-6364-00/en_US/HTML/MNPADMST84.htm
*/
/*
[metrics]
[metrics."Linux_user_CPU_percent"]
fieldname = "user"
description = "percentage of user CPU time"
baseOID = ".1.3.6.1.4.1.2021.11.9.0"
Datasrctype = "INTEGER"
IsTag = false
*/
INSERT INTO snmp_metric_cfg (id, field_name, baseoid, datasrctype, getrate, scale, shift, istag, description) VALUES ('Linux_user_CPU_percent','user','.1.3.6.1.4.1.2021.11.9.0','INTEGER',0,0.0,0.0,0,'percentage of user CPU time');
/*
[metrics."Linux_system_CPU_percent"]
fieldname = "system"
description = "percentage of System CPU time"
baseOID = ".1.3.6.1.4.1.2021.11.10.0"
Datasrctype = "INTEGER"
IsTag = false
*/
INSERT INTO snmp_metric_cfg (id, field_name, baseoid, datasrctype, getrate, scale, shift, istag, description) VALUES ('Linux_system_CPU_percent','system','.1.3.6.1.4.1.2021.11.10.0','INTEGER',0,0.0,0.0,0,'percentage of system CPU time');
/*
[metrics."Linux_idle_CPU_percent"]
fieldname = "idle"
description = "percentage of System CPU time"
baseOID = ".1.3.6.1.4.1.2021.11.11.0"
Datasrctype = "INTEGER"
IsTag = false
*/
INSERT INTO snmp_metric_cfg (id, field_name, baseoid, datasrctype, getrate, scale, shift, istag, description) VALUES ('Linux_idle_CPU_percent','idle','.1.3.6.1.4.1.2021.11.11.0','INTEGER',0,0.0,0.0,0,'percentage of Idle CPU time');
/*
[metrics."ifHCInOctets"]
fieldname = "In.bytes"
description = "Bytes In - 64-bit Counters"
baseOID = ".1.3.6.1.2.1.31.1.1.1.6"
DatasrcType = "COUNTER64"
getrate = false
IsTag = false
*/
INSERT INTO snmp_metric_cfg (id, field_name, baseoid, datasrctype, getrate, scale, shift, istag, description) VALUES ('ifHCInOctets','In.bytes','.1.3.6.1.2.1.31.1.1.1.6','COUNTER64',0,0.0,0.0,0,'Bytes In - 64-bit Counters');
/*
[metrics."ifHCOutOctets"]
fieldname = "Out.bytes"
description = "Bytes In - 64-bit Counters"
baseOID = ".1.3.6.1.2.1.31.1.1.1.10"
DatasrcType = "COUNTER64"
getRate = false
IsTag = false
*/
INSERT INTO snmp_metric_cfg (id, field_name, baseoid, datasrctype, getrate, scale, shift, istag, description) VALUES ('ifHCOutOctets','Out.bytes','.1.3.6.1.2.1.31.1.1.1.10','COUNTER64',0,0.0,0.0,0,'Bytes Out - 64-bit Counters');
/*
[metrics."ifHCInUcastPkts"]
fieldname = "In.packets"
description = "Bytes In - 64-bit Counters"
baseOID = ".1.3.6.1.2.1.31.1.1.1.7"
DatasrcType = "COUNTER64"
getRate = false
IsTag = false
*/
INSERT INTO snmp_metric_cfg (id, field_name, baseoid, datasrctype, getrate, scale, shift,istag, description) VALUES ('ifHCInUcastPkts','In.packets','.1.3.6.1.2.1.31.1.1.1.7','COUNTER64',0,0.0,0.0,0,'Packets In - 64-bit Counters');
/*
[metrics."ifHCOutUcastPkts"]
fieldname = "Out.packets"
description = "Packets - 64-bit Counters"
baseOID = ".1.3.6.1.2.1.31.1.1.1.11"
DatasrcType = "COUNTER64"
getRate = false
IsTag = false
*/
INSERT INTO snmp_metric_cfg (id, field_name, baseoid, datasrctype, getrate, scale, shift, istag, description) VALUES ('ifHCOutUcastPkts','Out.packets','.1.3.6.1.2.1.31.1.1.1.11','COUNTER64',0,0.0,0.0,0,'Packets Out - 64-bit Counters');
/*
[metrics."ifInOctets"]
fieldname = "In.bytes"
description = "Bytes In - 32-bit Counters"
baseOID = ".1.3.6.1.2.1.2.2.1.10"
DatasrcType = "COUNTER32"
getRate = false
IsTag = false
*/
INSERT INTO snmp_metric_cfg (id, field_name, baseoid, datasrctype, getrate, scale, shift, istag, description) VALUES ('ifInOctets','In.bytes','.1.3.6.1.2.1.2.2.1.10','COUNTER32',0,0.0,0.0,0,'Bytes In - 32-bit Counters');
/*
[metrics."ifOutOctets"]
fieldname = "Out.bytes"
description = "Bytes Out - 32-bit Counters"
baseOID = ".1.3.6.1.2.1.2.2.1.16"
DatasrcType = "COUNTER32"
getRate = false
IsTag = false
*/
INSERT INTO snmp_metric_cfg (id, field_name, baseoid, datasrctype, getrate, scale, shift, istag, description) VALUES ('ifOutOctets','Out.bytes','.1.3.6.1.2.1.2.2.1.16','COUNTER32',0,0.0,0.0,0,'Bytes Out - 32-bit Counters');
/*
[metrics."ifName"]
fieldname = "IfName"
description = "Tag for Name "
baseOID = ".1.3.6.1.2.1.31.1.1.1.1"
DatasrcType = "STRING"
getRate = false
IsTag = true
*/
INSERT INTO snmp_metric_cfg (id, field_name, baseoid, datasrctype, getrate, scale, shift, istag, description) VALUES ('ifName','IfName','.1.3.6.1.2.1.31.1.1.1.1','STRING',0,0.0,0.0,1,'Tags');
/*=======================================
OID Conditions
*=======================================
"id" : Text identificator
"cond_oid" : oid to apply the condition
"cond_type" : could be "file" or "OIDCondition"
"cond_value" : a valid filename contained in the conf/ directory (only valid if filter_type = "file")
"is_multiple" : "1" if enabled "0" if not ( allow get measurement tag from alias in the file)
"description" : a valid OID only valid for filter_type = "OIDCondition"
*/
INSERT INTO "oid_condition_cfg" (id, cond_oid, cond_type, cond_value, description, is_multiple) VALUES('cond_if_name_match_eth','.1.3.6.1.2.1.31.1.1.1.1','match','eth.*','Filter to get Ethernet interface with eth5',0);
INSERT INTO "oid_condition_cfg" (id, cond_oid, cond_type, cond_value, description, is_multiple) VALUES('cond_if_status_up','.1.3.6.1.2.1.2.2.1.8','neq','1','Filter to get UP Interfaces',0);
/*
===========================
measurements
===========================
# [measurements."id"] => id unique for this measurement.
# name : name for the measurement
# fields : array of metric id's to join as fields in the measurement
# getMode : posible values [ "value", "indexed" ]
# * value: will send direct the value from these metrics.
# * indexed: will send points for each found indexed values ( like intefaces ) => needs indexOID/indexTag parameters
# indexOID: the OID from we will get all real OID's to query data.
# indexTAG: the tag name that will be sent after data gathered.
*/
/*
[measurements]
[measurements."linux_cpu"]
name = "linux.cpu"
fields = [ "Linux_user_CPU_percent",
"Linux_system_CPU_percent",
"Linux_idle_CPU_percent",
]
getmode = "value"
*/
INSERT INTO measurement_cfg (id, name, getmode, indexoid, indextag,description) VALUES ('linux_cpu','linux.cpu','value','','','Linux CPU metric collection - non Indexed');
INSERT INTO measurement_field_cfg( id_measurement_cfg,id_metric_cfg) VALUES ('linux_cpu','Linux_user_CPU_percent');
INSERT INTO measurement_field_cfg( id_measurement_cfg,id_metric_cfg) VALUES ('linux_cpu','Linux_system_CPU_percent');
INSERT INTO measurement_field_cfg( id_measurement_cfg,id_metric_cfg) VALUES ('linux_cpu','Linux_idle_CPU_percent');
/*
[measurements."linux_ports"]
name = "linux.ports"
fields = [ "ifHCInOctets",
"ifHCOutOctets",
"ifHCInUcastPkts",
"ifHCOutUcastPkts"
]
getmode = "indexed"
indexOID = ".1.3.6.1.2.1.31.1.1.1.1" # ifName => needed to be "STRING"
IndexTAG = "portName"
*/
INSERT INTO measurement_cfg (id, name, getmode, indexoid, indextag, description) VALUES ('linux_ports','linux.ports','indexed','.1.3.6.1.2.1.31.1.1.1.1','portName','Linux Ports metric collection - indexed by ifName');
INSERT INTO measurement_field_cfg( id_measurement_cfg,id_metric_cfg) VALUES ('linux_ports','ifHCInOctets');
INSERT INTO measurement_field_cfg( id_measurement_cfg,id_metric_cfg) VALUES ('linux_ports','ifHCOutOctets');
INSERT INTO measurement_field_cfg( id_measurement_cfg,id_metric_cfg) VALUES ('linux_ports','ifHCInUcastPkts');
INSERT INTO measurement_field_cfg( id_measurement_cfg,id_metric_cfg) VALUES ('linux_ports','ifHCOutUcastPkts');
INSERT INTO measurement_field_cfg( id_measurement_cfg,id_metric_cfg) VALUES ('linux_ports','ifName');
/*Test to check issue */
INSERT INTO measurement_cfg (id, name, getmode, indexoid, indextag, description) VALUES ('linux_ports_by_index','linux.ports','indexed','.1.3.6.1.2.1.2.2.1.1','ifindex','Linux Ports metric collection - indexed by ifName');
INSERT INTO measurement_field_cfg( id_measurement_cfg,id_metric_cfg) VALUES ('linux_ports_by_index','ifHCInOctets');
INSERT INTO measurement_field_cfg( id_measurement_cfg,id_metric_cfg) VALUES ('linux_ports_by_index','ifHCOutOctets');
INSERT INTO measurement_field_cfg( id_measurement_cfg,id_metric_cfg) VALUES ('linux_ports_by_index','ifHCInUcastPkts');
INSERT INTO measurement_field_cfg( id_measurement_cfg,id_metric_cfg) VALUES ('linux_ports_by_index','ifHCOutUcastPkts');
/*
[measurements."network_32bits"]
name = "32bit-ports"
fields = [ "ifInOctets",
"ifOutOctets"
]
getmode = "indexed"
indexOID = ".1.3.6.1.2.1.31.1.1.1.1" # ifName => needed to be "STRING"
IndexTAG = "portName"
*/
INSERT INTO measurement_cfg (id, name, getmode, indexoid, indextag, description) VALUES ('network_32bits','32bits-ports','indexed','.1.3.6.1.2.1.31.1.1.1.1','portName', 'Traffic metric Collection - indexed by ifName');
INSERT INTO measurement_field_cfg( id_measurement_cfg,id_metric_cfg) VALUES ('network_32bits','ifInOctets');
INSERT INTO measurement_field_cfg( id_measurement_cfg,id_metric_cfg) VALUES ('network_32bits','ifOutOctets');
/*====================================
Measurement Groups
===================================*/
/*
[getgroups."Linux"]
measurements = [
"linux_cpu",
"linux_ports",
"network_32bits"
]
*/
INSERT INTO m_groups_cfg (id ) VALUES ('Linux');
INSERT INTO m_groups_measurements (id_mgroup_cfg,id_measurement_cfg) VALUES ('Linux','linux_cpu');
INSERT INTO m_groups_measurements (id_mgroup_cfg,id_measurement_cfg) VALUES ('Linux','linux_ports');
INSERT INTO m_groups_cfg (id ) VALUES ('Issue_index');
INSERT INTO m_groups_measurements (id_mgroup_cfg,id_measurement_cfg) VALUES ('Issue_index','linux_cpu');
INSERT INTO m_groups_measurements (id_mgroup_cfg,id_measurement_cfg) VALUES ('Issue_index','linux_ports_by_index');
/*INSERT INTO m_groups_measurements (id_mgroup_cfg,id_measurement_cfg) VALUES ('Linux','network_32bits');*/
/*=======================================
Measurement filters
*=======================================
"id" : Text identificator
"id_measurement_cfg" : related to a measurement
"filter_type" : could be "file" or "OIDCondition"
"filter_name" : a valid filename contained in the conf/ directory (only valid if filter_type = "file")
"enabla_alias" : "1" if enabled "0" if not ( allow get measurement tag from alias in the file)
"filter_name" : a valid OID only valid for filter_type = "OIDCondition"
*/
INSERT INTO meas_filter_cfg (id,id_measurement_cfg,filter_type,filter_name,enable_alias) VALUES ('filter_ports_file_a','linux_ports','file','lp_file_filter_a.txt',1);
INSERT INTO meas_filter_cfg (id,id_measurement_cfg,filter_type,filter_name,enable_alias) VALUES ('filter_ports_file_b','linux_ports','file','lp_file_filter_b.txt',1);
INSERT INTO meas_filter_cfg (id,id_measurement_cfg,filter_type,filter_name) VALUES ('filter_port_if_name_match_eth','linux_ports','OIDCondition','cond_if_name_match_eth');
INSERT INTO meas_filter_cfg (id,id_measurement_cfg,filter_type,filter_name) VALUES ('filter_port_if_status_up','linux_ports','OIDCondition','cond_if_status_up');
/*=======================================
Influx databases configuration
========================================*/
/*
[influxdb."*"]
host = "127.0.0.1"
port = 8086
db = "snmp"
user = "snmpuser"
password = "snmppass"
retention = "autogen"
*/
INSERT INTO influx_cfg (id,host,port,db,user,password,retention,description) VALUES ('default','127.0.0.1',8086,'snmp','snmpuser','snmppass','autogen', 'Default InfluxDB Server');
/*======================================
SNMP devices
=====================================
#--------------------------
# CONETION PARAMETERS
#--------------------------
# host : hostname or IP (no default)
# port : conection port (no default)
# timeout : Timeout is the timeout for the SNMP Query in seconds
# retries : Set the number of retries to attempt within timeout.
# repeat : (Not used yet)
# NOTE any device has an any unique indentificator "ID" string in the [snmpdevice."id"] field
#--------------------------------
# SNMP VERSION/AUTH PARAMETERS
#--------------------------------
# snmpversion : posible values values [ "1", "2c" , "3"] ( no default set)
# community : (por snmpv2 only) commumity for authentication (no default set)
#
# -- for SNMP v3 only --
#
# v3seclevel : posible values [ "NoAuthNoPriv" , "AuthNoPriv" , "AuthPriv" ] ( no default set)
# v3authuser : Authentication user
# v3authpass : Autentication password
# v3authprot : Autehtication Protocol => values [ "MD5", "SHA" ] ( default none)
#
# -- only needed if AuthPriv mode enabled ---
#
# v3privpass : Privacy Password
# v3privprot : Privacy Protocol => values [ "DES", "AES"] ( default none)
# ---------------------------
# RUNTIME OPTIONS
# --------------------------
#
# freq : Frequency of polling in seconds ( default none)
# devicetagname : The tag name that will identify the device (default : "device")
# devicetagvalue: the tag valude that will identify the device ( default : "id" ) [ posible values "id" --hostsnmpv2_1-- or "host" --127.0.0.1-- ]
# extratags : Array with extratags in format key = value will be sent to the influxdb database format [ "" , "" , ""]
# snmpdebug :
# filters : Array containing filter file per measurement.
*/
/*
[snmpdevice.hostsnmpv3a]
host = "hostsnmpv3a"
port = 161
timeout = 20
retries = 5
repeat = 0
snmpversion = "3"
v3seclevel = "NoAuthNoPriv"
#only needed if Auth v3 enabled
v3authuser = "v3usernoauth"
freq = 60
devicetagname = "router"
devicetagvalue = "id"
extratags = [ "tagA=4","tagB=5" ,"tagC=6" ]
outdb = "default"
loglevel = "debug"
snmpdebug = false
metricgroups = [ "Linux.*" ]
measfilters = [
[ "linux_ports" , "file" , "lp_file_filter_a.txt" ,"EnableAlias"],
]
*/
INSERT INTO snmp_device_cfg (id,host,port,retries,timeout,repeat,snmpversion,v3seclevel,v3authuser,freq,devicetagname,devicetagvalue,'extra-tags',loglevel,snmpdebug,description,outdb) VALUES ('hostsnmpv3a','hostsnmpv3a',161,5,20,0,'3','NoAuthNoPriv','v3usernoauth',60,'router','id','[ "tagA=4","tagB=5","tagC=6" ]','debug',0,'Test Host SNMPV3 a','default');
INSERT INTO snmp_dev_m_groups (id_snmpdev,id_mgroup_cfg) VALUES ('hostsnmpv3a','Issue_index');
/*INSERT INTO snmp_dev_m_groups (id_snmpdev,id_mgroup_cfg) VALUES ('hostsnmpv3a','Linux.*');
INSERT INTO snmp_dev_filters (id_snmpdev,id_filter) VALUES ('hostsnmpv3a','filter_ports_file_a');*/
/*
[snmpdevice.hostsnmpv3b]
#conection parameters
host = "hostsnmpv3b"
port = 161
timeout = 20
retries = 5
repeat = 0
#snmp version /auth params
snmpversion = "3"
v3seclevel = "AuthNoPriv"
#only needed if Auth v3 enabled
v3authuser = "v3userauth"
v3authpass = "v3passauth"
v3authprot = "MD5"
# runtime parameters
freq = 30
devicetagname = "router"
devicetagvalue = "id"
#extratags = [ "tagA=4","tagB=5" ,"tagC=6" ]
outdb = "default"
loglevel = "debug"
snmpdebug = false
metricgroups = [ ".*ux" ]
measfilters = [
[ "linux_ports" , "file", "lp_file_filter_b.txt","EnableAlias" ],
]
*/
INSERT INTO snmp_device_cfg (id,host,port,retries,timeout,repeat,snmpversion,v3seclevel,v3authuser,v3authpass,v3authprot,freq,devicetagname,devicetagvalue,'extra-tags',loglevel,snmpdebug,description, outdb) VALUES ('hostsnmpv3b','hostsnmpv3b',161,5,20,0,'3','AuthNoPriv','v3userauth','v3passauth','MD5', 30,'router','id','[ "tagA=14","tagB=15","tagC=16" ]','debug',0, 'Test Host SNMPV3 b','default');
INSERT INTO snmp_dev_m_groups (id_snmpdev,id_mgroup_cfg) VALUES ('hostsnmpv3b','Linux');
INSERT INTO snmp_dev_filters (id_snmpdev,id_filter) VALUES ('hostsnmpv3b','filter_ports_file_b');
/*
[snmpdevice.hostsnmpv3c]
#conection parameters
host = "hostsnmpv3c"
port = 161
timeout = 20
retries = 5
repeat = 0
snmpversion = "3"
v3seclevel = "AuthPriv"
v3authuser = "v3userpriv"
v3authpass = "v3privpass"
v3authprot = "MD5"
v3privpass = "v3passenc"
v3privprot = "DES"
freq = 30
devicetagname = "router"
devicetagvalue = "id"
extratags = [ "tagA=4","tagB=5" ,"tagC=6" ]
outdb = "default"
loglevel = "debug"
snmpdebug = false
metricgroups = [ "Lin.*"]
*/
INSERT INTO snmp_device_cfg (id,host,port,retries,timeout,repeat,snmpversion,v3seclevel,v3authuser,v3authpass,v3authprot, v3privprot, freq,devicetagname,devicetagvalue,'extra-tags',loglevel,snmpdebug,description, outdb) VALUES ('hostsnmpv3c','hostsnmpv3c',161,5,20,0,'3','AuthNoPriv','v3userauth','v3passauth','MD5', 'DES', 30,'router','id','[ "tagA=14","tagB=15","tagC=16"]','debug',0,'Test Host SNMPV3 c', 'default');
INSERT INTO snmp_dev_m_groups (id_snmpdev,id_mgroup_cfg) VALUES ('hostsnmpv3c','Linux');
/*INSERT INTO snmp_dev_filters (id_snmpdev,id_filter) VALUES ('hostsnmpv3c','filter_port_if_status_up');*/
INSERT INTO snmp_dev_filters (id_snmpdev,id_filter) VALUES ('hostsnmpv3c','filter_port_if_name_match_eth'); | the_stack |
--
-- INSERT UPDATE, test explain command, comes from merge_explain and merge_explain_pretty
--
-- initial
CREATE SCHEMA test_insert_update_008;
SET current_schema = test_insert_update_008;
CREATE TABLE products_base
(
product_id INTEGER DEFAULT 0,
product_name VARCHAR(60) DEFAULT 'null',
category VARCHAR(60) DEFAULT 'unknown',
total INTEGER DEFAULT '0'
) with(storage_type=ustore);
INSERT INTO products_base VALUES (1501, 'vivitar 35mm', 'electrncs', 100);
INSERT INTO products_base VALUES (1502, 'olympus is50', 'electrncs', 100);
INSERT INTO products_base VALUES (1600, 'play gym', 'toys', 100);
INSERT INTO products_base VALUES (1601, 'lamaze', 'toys', 100);
INSERT INTO products_base VALUES (1666, 'harry potter', 'dvd', 100);
CREATE TABLE newproducts_base
(
product_id INTEGER DEFAULT 0,
product_name VARCHAR(60) DEFAULT 'null',
category VARCHAR(60) DEFAULT 'unknown',
total INTEGER DEFAULT '0'
) with(storage_type=ustore);
INSERT INTO newproducts_base VALUES (1502, 'olympus camera', 'electrncs', 200);
INSERT INTO newproducts_base VALUES (1601, 'lamaze', 'toys', 200);
INSERT INTO newproducts_base VALUES (1666, 'harry potter', 'toys', 200);
INSERT INTO newproducts_base VALUES (1700, 'wait interface', 'books', 200);
ANALYZE products_base;
ANALYZE newproducts_base;
--
-- row table
--
CREATE TABLE products_row
(
product_id INTEGER DEFAULT 0 PRIMARY KEY,
product_name VARCHAR(60) DEFAULT 'null',
category VARCHAR(60) DEFAULT 'unknown',
total INTEGER DEFAULT '0'
) with(storage_type=ustore);
CREATE TABLE newproducts_row
(
product_id INTEGER DEFAULT 0 PRIMARY KEY,
product_name VARCHAR(60) DEFAULT 'null',
category VARCHAR(60) DEFAULT 'unknown',
total INTEGER DEFAULT '0'
) with(storage_type=ustore);
INSERT INTO products_row SELECT * FROM products_base;
INSERT INTO newproducts_row SELECT * FROM newproducts_base;
ANALYZE products_row;
ANALYZE newproducts_row;
SET explain_perf_mode = normal;
-- explain verbose
EXPLAIN (VERBOSE on, COSTS off)
INSERT INTO products_row
SELECT product_id, product_name, category, total FROM newproducts_row
ON DUPLICATE KEY UPDATE
product_name = excluded.product_name,
category = excluded.category,
total = excluded.total;
EXPLAIN (VERBOSE on, COSTS off)
INSERT INTO products_row
SELECT newproducts_row.product_id,
newproducts_row.product_name,
newproducts_row.category,
newproducts_row.total
FROM newproducts_row, products_row
WHERE products_row.total + newproducts_row.total < 1000
ON DUPLICATE KEY UPDATE
product_name = excluded.product_name,
category = excluded.category,
total = excluded.total;
EXPLAIN (VERBOSE on, COSTS off)
INSERT INTO products_row
SELECT product_id, product_name, category, total
FROM newproducts_row WHERE product_id IS NOT NULL AND product_name IS NOT NULL
ON DUPLICATE KEY UPDATE
product_name = excluded.product_name,
category = excluded.category,
total = excluded.total;
-- explain analyze
BEGIN;
EXPLAIN (ANALYZE on, COSTS off, TIMING off)
INSERT INTO products_row
SELECT product_id, product_name, category, total FROM newproducts_row
ON DUPLICATE KEY UPDATE
product_name = excluded.product_name,
category = excluded.category,
total = excluded.total;
ROLLBACK;
-- explain performance
\o insert_update_explain.txt
BEGIN;
EXPLAIN PERFORMANCE
INSERT INTO products_row
SELECT product_id, product_name, category, total FROM newproducts_row
ON DUPLICATE KEY UPDATE
product_name = excluded.product_name,
category = excluded.category,
total = excluded.total;
ROLLBACK;
\o
-- explain analyze
BEGIN;
EXPLAIN (ANALYZE on, COSTS off, TIMING off)
INSERT INTO products_row
SELECT product_id, product_name, category, total FROM newproducts_row
ON DUPLICATE KEY UPDATE
product_name = excluded.product_name,
category = excluded.category,
total = excluded.total;
ROLLBACK;
-- pretty mode performance
SET explain_perf_mode = pretty;
-- explain verbose
EXPLAIN (VERBOSE on, COSTS off)
INSERT INTO products_row
SELECT product_id, product_name, category, total FROM newproducts_row
ON DUPLICATE KEY UPDATE
product_name = excluded.product_name,
category = excluded.category,
total = excluded.total;
-- explain analyze
BEGIN;
EXPLAIN (ANALYZE on, COSTS off, TIMING off)
INSERT INTO products_row
SELECT product_id, product_name, category, total FROM newproducts_row
ON DUPLICATE KEY UPDATE
product_name = excluded.product_name,
category = excluded.category,
total = excluded.total;
ROLLBACK;
-- explain analyze
BEGIN;
EXPLAIN (ANALYZE on, COSTS off, TIMING off)
INSERT INTO products_row
SELECT product_id, product_name, category, total FROM newproducts_row
ON DUPLICATE KEY UPDATE
product_name = excluded.product_name,
category = excluded.category,
total = excluded.total;
ROLLBACK;
-- explain performance
\o insert_update_explain_pretty.txt
BEGIN;
EXPLAIN PERFORMANCE
INSERT INTO products_row
SELECT product_id, product_name, category, total FROM newproducts_row
ON DUPLICATE KEY UPDATE
product_name = excluded.product_name,
category = excluded.category,
total = excluded.total;
ROLLBACK;
SET explain_perf_mode = run;
BEGIN;
EXPLAIN PERFORMANCE
INSERT INTO products_row
SELECT product_id, product_name, category, total FROM newproducts_row
ON DUPLICATE KEY UPDATE
product_name = excluded.product_name,
category = excluded.category,
total = excluded.total;
ROLLBACK;
SET explain_perf_mode = summary;
BEGIN;
EXPLAIN PERFORMANCE
INSERT INTO products_row
SELECT product_id, product_name, category, total FROM newproducts_row
ON DUPLICATE KEY UPDATE
product_name = excluded.product_name,
category = excluded.category,
total = excluded.total;
ROLLBACK;
\o
CREATE TABLE item
(
a INT DEFAULT 3,
item_id NUMERIC(18,10),
item_name VARCHAR(100),
item_level NUMERIC(39,0),
item_desc VARCHAR(250),
item_subclass_cd VARCHAR(50),
item_type_cd VARCHAR(50),
inventory_ind CHAR(300),
vendor_party_id SMALLINT,
commodity_cd VARCHAR(50),
brand_cd VARCHAR(50),
item_available CHAR(100),
CONSTRAINT u_item_index UNIQUE (item_subclass_cd, vendor_party_id)
) with(storage_type=ustore)
PARTITION BY RANGE (vendor_party_id)
(
PARTITION item_1 VALUES LESS THAN (0),
PARTITION item_2 VALUES LESS THAN (1),
PARTITION item_3 VALUES LESS THAN (2),
PARTITION item_4 VALUES LESS THAN (3),
PARTITION item_5 VALUES LESS THAN (6),
PARTITION item_6 VALUES LESS THAN (8),
PARTITION item_7 VALUES LESS THAN (10),
PARTITION item_8 VALUES LESS THAN (15),
PARTITION item_9 VALUES LESS THAN (MAXVALUE)
) ENABLE ROW MOVEMENT;
CREATE TABLE region
(
a INT DEFAULT 8,
region_cd VARCHAR(50),
region_name VARCHAR(100),
division_cd VARCHAR(50),
region_mgr_associate_id number(18,9)
) with(storage_type=ustore);
CREATE TABLE associate_benefit_expense
(
a INT DEFAULT 44,
period_end_dt DATE,
associate_expns_type_cd VARCHAR(50),
associate_party_id INTEGER,
benefit_hours_qty decimal(38,11),
benefit_cost_amt number(38,4)
) with(storage_type=ustore)
PARTITION BY RANGE (associate_expns_type_cd)
(
PARTITION associate_benefit_expense_1 VALUES LESS THAN ('B'),
PARTITION associate_benefit_expense_2 VALUES LESS THAN ('E'),
PARTITION associate_benefit_expense_3 VALUES LESS THAN ('G'),
PARTITION associate_benefit_expense_4 VALUES LESS THAN ('I'),
PARTITION associate_benefit_expense_5 VALUES LESS THAN ('L'),
PARTITION associate_benefit_expense_6 VALUES LESS THAN ('N'),
PARTITION associate_benefit_expense_7 VALUES LESS THAN ('P'),
PARTITION associate_benefit_expense_8 VALUES LESS THAN ('Q'),
PARTITION associate_benefit_expense_9 VALUES LESS THAN ('R'),
PARTITION associate_benefit_expense_10 VALUES LESS THAN ('T'),
PARTITION associate_benefit_expense_11 VALUES LESS THAN ('U'),
PARTITION associate_benefit_expense_12 VALUES LESS THAN ('V'),
PARTITION associate_benefit_expense_13 VALUES LESS THAN (MAXVALUE)
) ENABLE ROW MOVEMENT;
INSERT INTO item (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (0.12, ' ' , 'A' , NULL, 'TGK' , 'A' , 2, 'A' , 'A' , 'Y');
INSERT INTO item (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (1.3, 'B' , NULL, 'B' , 'B' , NULL, 1, 'B' , NULL , 'N');
INSERT INTO item (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (2.23, 'C' , 'C' , NULL, 'C' , 'C' , 2, 'C' , 'C' , 'N');
INSERT INTO item (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (3.33, 'D' , 'D' , 'PT' , NULL, 'D' , 3, 'D' , 'D' , 'N');
INSERT INTO item (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (4.98, ' ' , NULL, 'E' , 'E' , 'E' , 4, 'E' , 'E' , 'Y');
INSERT INTO item (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (5.01, NULL, 'F' , ' ' , 'F' , 'F' , 5, 'F' , 'F' , 'N');
INSERT INTO item (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (6, 'G' , 'G' , 'G' , '_D' , 'G' , 6, 'G' , NULL ,'N');
INSERT INTO item (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (0.7, NULL, NULL, NULL, 'H' , 'H' , 7, NULL, 'G' , 'Y');
INSERT INTO item (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (0.08, 'I' , ' ' , ' T ' , NULL, 'I' , 8, 'I' , '' , 'N');
INSERT INTO item (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (9.12, ' ' , 'J' , ' PP' , 'J' , 'J' , 9, 'J' , NULL , 'Y');
INSERT INTO item (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (10.10, NULL, ' ' , 'A' , 'A' , 'A' , 2, NULL, 'A','Y');
--INSERT INTO item (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (11.11, 'B' , 'B' , 'B' , 'BCDAA' , NULL, 1, 'B' , 'B','N');
INSERT INTO item (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (12.02, 'D' , NULL, NULL, 'C' , 'C' , 2, 'C' , 'C','N');
INSERT INTO item (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (13.99, NULL, ' ' , 'D' , 'D' , 'D' , 3, 'D' , 'D','Y');
--INSERT INTO item (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (14, 'G' , 'E' , 'E' , NULL, 'E' , 4, 'E' , 'E','N');
INSERT INTO item (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (15, 'F' , ' ' , 'C' , 'CLEANING' , 'F' , 5, 'F' , 'F','Y');
INSERT INTO item (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (16, '' , 'Z' , NULL, 'G' , 'G' , 6, 'G' , NULL,'N');
INSERT INTO item (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (17, NULL, '' , ' PAPER' , 'H' , '' , 7, NULL, NULL,'Y');
INSERT INTO item (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (19, ' ' , 'B' , '' , '' , 'I' , 8, 'I' , NULL,'N');
INSERT INTO item (ITEM_ID, ITEM_NAME, ITEM_DESC, ITEM_SUBCLASS_CD, ITEM_TYPE_CD, INVENTORY_IND, VENDOR_PARTY_ID, COMMODITY_CD, BRAND_CD,ITEM_AVAILABLE) VALUES (20 , 'A' , 'J' , 'J' , 'J' , NULL, 9, 'J' , 'G','Y');
/*--REGION--*/
INSERT INTO REGION (REGION_CD, REGION_NAME, DIVISION_CD, REGION_MGR_ASSOCIATE_ID) VALUES ('A', 'A ', 'A', 0.123433);
INSERT INTO REGION (REGION_CD, REGION_NAME, DIVISION_CD, REGION_MGR_ASSOCIATE_ID) VALUES ('B', 'B', 'B', NULL);
INSERT INTO REGION (REGION_CD, REGION_NAME, DIVISION_CD, REGION_MGR_ASSOCIATE_ID) VALUES ('C', 'C', 'C', 2.232008908);
INSERT INTO REGION (REGION_CD, REGION_NAME, DIVISION_CD, REGION_MGR_ASSOCIATE_ID) VALUES ('D', ' DD', 'D', 3.878789);
INSERT INTO REGION (REGION_CD, REGION_NAME, DIVISION_CD, REGION_MGR_ASSOCIATE_ID) VALUES ('E', 'A', 'E', 4.89060603);
INSERT INTO REGION (REGION_CD, REGION_NAME, DIVISION_CD, REGION_MGR_ASSOCIATE_ID) VALUES ('F', 'F', 'F', 5.82703827);
INSERT INTO REGION (REGION_CD, REGION_NAME, DIVISION_CD, REGION_MGR_ASSOCIATE_ID) VALUES ('G', 'G', 'TTT', NULL);
INSERT INTO REGION (REGION_CD, REGION_NAME, DIVISION_CD, REGION_MGR_ASSOCIATE_ID) VALUES ('H', 'H', 'G', 7.3829083);
INSERT INTO REGION (REGION_CD, REGION_NAME, DIVISION_CD, REGION_MGR_ASSOCIATE_ID) VALUES ('I', 'C', 'M', 8.983989);
INSERT INTO REGION (REGION_CD, REGION_NAME, DIVISION_CD, REGION_MGR_ASSOCIATE_ID) VALUES ('J', 'J', 'G', NULL);
INSERT INTO REGION (REGION_CD, REGION_NAME, DIVISION_CD, REGION_MGR_ASSOCIATE_ID) VALUES ('K', ' ', 'C', 2.232008908);
INSERT INTO REGION (REGION_CD, REGION_NAME, DIVISION_CD, REGION_MGR_ASSOCIATE_ID) VALUES ('L', 'D', 'X', 3.878789);
INSERT INTO REGION (REGION_CD, REGION_NAME, DIVISION_CD, REGION_MGR_ASSOCIATE_ID) VALUES ('M', 'TTTTTT ', 'D' , 4.89060603);
INSERT INTO REGION (REGION_CD, REGION_NAME, DIVISION_CD, REGION_MGR_ASSOCIATE_ID) VALUES ('N', 'G' , 'B' , NULL);
INSERT INTO REGION (REGION_CD, REGION_NAME, DIVISION_CD, REGION_MGR_ASSOCIATE_ID) VALUES ('O' , 'G', 'F', 6.6703972);
INSERT INTO ASSOCIATE_BENEFIT_EXPENSE (PERIOD_END_DT, ASSOCIATE_EXPNS_TYPE_CD, ASSOCIATE_PARTY_ID, BENEFIT_HOURS_QTY, BENEFIT_COST_AMT) VALUES (DATE '1970-01-01', 'A', 5, 0.5 , 0.5);
INSERT INTO ASSOCIATE_BENEFIT_EXPENSE (PERIOD_END_DT, ASSOCIATE_EXPNS_TYPE_CD, ASSOCIATE_PARTY_ID, BENEFIT_HOURS_QTY, BENEFIT_COST_AMT) VALUES (DATE '1973-01-01', 'B', 1, NULL, 1.0);
INSERT INTO ASSOCIATE_BENEFIT_EXPENSE (PERIOD_END_DT, ASSOCIATE_EXPNS_TYPE_CD, ASSOCIATE_PARTY_ID, BENEFIT_HOURS_QTY, BENEFIT_COST_AMT) VALUES (DATE '1976-01-01', 'C', 2, 2.0 , NULL);
INSERT INTO ASSOCIATE_BENEFIT_EXPENSE (PERIOD_END_DT, ASSOCIATE_EXPNS_TYPE_CD, ASSOCIATE_PARTY_ID, BENEFIT_HOURS_QTY, BENEFIT_COST_AMT) VALUES (DATE '1979-01-01', 'D', 3, 3.0 , 3.0);
INSERT INTO ASSOCIATE_BENEFIT_EXPENSE (PERIOD_END_DT, ASSOCIATE_EXPNS_TYPE_CD, ASSOCIATE_PARTY_ID, BENEFIT_HOURS_QTY, BENEFIT_COST_AMT) VALUES (DATE '1982-01-01', 'E', 4, 4.0 , 4.0);
INSERT INTO ASSOCIATE_BENEFIT_EXPENSE (PERIOD_END_DT, ASSOCIATE_EXPNS_TYPE_CD, ASSOCIATE_PARTY_ID, BENEFIT_HOURS_QTY, BENEFIT_COST_AMT) VALUES (DATE '1985-01-01', 'F', 5, 5.0 , 5.0);
INSERT INTO ASSOCIATE_BENEFIT_EXPENSE (PERIOD_END_DT, ASSOCIATE_EXPNS_TYPE_CD, ASSOCIATE_PARTY_ID, BENEFIT_HOURS_QTY, BENEFIT_COST_AMT) VALUES (DATE '1988-01-01', 'F', 6, NULL, 6.0);
INSERT INTO ASSOCIATE_BENEFIT_EXPENSE (PERIOD_END_DT, ASSOCIATE_EXPNS_TYPE_CD, ASSOCIATE_PARTY_ID, BENEFIT_HOURS_QTY, BENEFIT_COST_AMT) VALUES (DATE '1991-01-01', 'G', 6, NULL, NULL);
INSERT INTO ASSOCIATE_BENEFIT_EXPENSE (PERIOD_END_DT, ASSOCIATE_EXPNS_TYPE_CD, ASSOCIATE_PARTY_ID, BENEFIT_HOURS_QTY, BENEFIT_COST_AMT) VALUES (DATE '1994-01-01', 'G', 15, 8.0 , 8.0);
INSERT INTO ASSOCIATE_BENEFIT_EXPENSE (PERIOD_END_DT, ASSOCIATE_EXPNS_TYPE_CD, ASSOCIATE_PARTY_ID, BENEFIT_HOURS_QTY, BENEFIT_COST_AMT) VALUES (DATE '1997-01-01', 'G', 16, 9.0 , 9.0);
INSERT INTO ASSOCIATE_BENEFIT_EXPENSE (PERIOD_END_DT, ASSOCIATE_EXPNS_TYPE_CD, ASSOCIATE_PARTY_ID, BENEFIT_HOURS_QTY, BENEFIT_COST_AMT) VALUES (DATE '1983-01-03', 'I', 14, 4.0 , 4.0);
INSERT INTO ASSOCIATE_BENEFIT_EXPENSE (PERIOD_END_DT, ASSOCIATE_EXPNS_TYPE_CD, ASSOCIATE_PARTY_ID, BENEFIT_HOURS_QTY, BENEFIT_COST_AMT) VALUES (DATE '1984-01-01', 'GO', 15, 5.0 , NULL);
INSERT INTO ASSOCIATE_BENEFIT_EXPENSE (PERIOD_END_DT, ASSOCIATE_EXPNS_TYPE_CD, ASSOCIATE_PARTY_ID, BENEFIT_HOURS_QTY, BENEFIT_COST_AMT) VALUES (DATE '1985-05-01', 'I', 16, 6.0 , 6.0);
INSERT INTO ASSOCIATE_BENEFIT_EXPENSE (PERIOD_END_DT, ASSOCIATE_EXPNS_TYPE_CD, ASSOCIATE_PARTY_ID, BENEFIT_HOURS_QTY, BENEFIT_COST_AMT) VALUES (DATE '1990-01-01', 'TTT', 16, NULL, 7.0);
INSERT INTO ASSOCIATE_BENEFIT_EXPENSE (PERIOD_END_DT, ASSOCIATE_EXPNS_TYPE_CD, ASSOCIATE_PARTY_ID, BENEFIT_HOURS_QTY, BENEFIT_COST_AMT) VALUES (DATE '1992-02-01', 'A', 15, 8.0 , 8.0);
INSERT INTO ASSOCIATE_BENEFIT_EXPENSE (PERIOD_END_DT, ASSOCIATE_EXPNS_TYPE_CD, ASSOCIATE_PARTY_ID, BENEFIT_HOURS_QTY, BENEFIT_COST_AMT) VALUES (DATE '1997-02-01', 'G', 17, 9.0 , NULL);
INSERT INTO ASSOCIATE_BENEFIT_EXPENSE (PERIOD_END_DT, ASSOCIATE_EXPNS_TYPE_CD, ASSOCIATE_PARTY_ID, BENEFIT_HOURS_QTY, BENEFIT_COST_AMT) VALUES (DATE '1997-05-01', 'G' , 17, 9.0 , NULL);
ANALYZE item;
ANALYZE region;
ANALYZE associate_benefit_expense;
EXPLAIN (VERBOSE ON, COSTS OFF)
INSERT INTO item (item_level, item_subclass_cd, item_desc, vendor_party_id)
SELECT Table_001.REGION_MGR_ASSOCIATE_ID Column_003,
Table_002.associate_expns_type_cd Column_004,
CAST(Table_001.region_name AS VARCHAR) Column_005,
10 Column_006
-- 'o' Column_007,
-- 'F' Column_008,
-- pg_client_encoding() Column_009
FROM region Table_001, associate_benefit_expense Table_002
ON DUPLICATE KEY UPDATE item_level = -1000;
EXPLAIN (VERBOSE ON, COSTS OFF)
INSERT INTO products_row VALUES(100)
ON DUPLICATE KEY UPDATE total=100;
SET enable_light_proxy=off;
EXPLAIN (VERBOSE ON, COSTS OFF)
INSERT INTO products_row VALUES(100)
ON DUPLICATE KEY UPDATE total=100;
EXPLAIN (VERBOSE ON, COSTS OFF)
INSERT INTO products_row VALUES(100)
ON DUPLICATE KEY UPDATE total=100;
EXPLAIN (VERBOSE ON, COSTS OFF)
INSERT INTO products_row VALUES(100)
ON DUPLICATE KEY UPDATE total=100;
RESET enable_light_proxy;
DROP SCHEMA test_insert_update_008 CASCADE; | the_stack |
-- 2017-09-03T12:31:45.223
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET AD_UI_Column_ID=540301, SeqNo=60,Updated=TO_TIMESTAMP('2017-09-03 12:31:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=540504
;
-- 2017-09-03T12:31:49.010
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Column WHERE AD_UI_Column_ID=540302
;
-- 2017-09-03T12:31:54.078
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Section_Trl WHERE AD_UI_Section_ID=540217
;
-- 2017-09-03T12:31:54.088
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Section WHERE AD_UI_Section_ID=540217
;
-- 2017-09-03T12:32:05.225
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Section SET Value='advanced edit',Updated=TO_TIMESTAMP('2017-09-03 12:32:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Section_ID=540216
;
-- 2017-09-03T12:33:13.530
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540499, SeqNo=80,Updated=TO_TIMESTAMP('2017-09-03 12:33:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544787
;
-- 2017-09-03T12:33:18.626
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540499, SeqNo=90,Updated=TO_TIMESTAMP('2017-09-03 12:33:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544788
;
-- 2017-09-03T12:33:24.088
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540499, SeqNo=100,Updated=TO_TIMESTAMP('2017-09-03 12:33:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544802
;
-- 2017-09-03T12:33:29.932
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540499, SeqNo=110,Updated=TO_TIMESTAMP('2017-09-03 12:33:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544803
;
-- 2017-09-03T12:33:34.500
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_ElementGroup WHERE AD_UI_ElementGroup_ID=540501
;
-- 2017-09-03T12:33:41.321
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540499, SeqNo=120,Updated=TO_TIMESTAMP('2017-09-03 12:33:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544769
;
-- 2017-09-03T12:33:45.785
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540499, SeqNo=130,Updated=TO_TIMESTAMP('2017-09-03 12:33:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544770
;
-- 2017-09-03T12:33:50.160
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540499, SeqNo=140,Updated=TO_TIMESTAMP('2017-09-03 12:33:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544771
;
-- 2017-09-03T12:33:54.985
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540499, SeqNo=150,Updated=TO_TIMESTAMP('2017-09-03 12:33:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544772
;
-- 2017-09-03T12:33:59.380
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540499, SeqNo=160,Updated=TO_TIMESTAMP('2017-09-03 12:33:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544773
;
-- 2017-09-03T12:34:03.933
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540499, SeqNo=170,Updated=TO_TIMESTAMP('2017-09-03 12:34:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544774
;
-- 2017-09-03T12:34:08.054
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540499, SeqNo=180,Updated=TO_TIMESTAMP('2017-09-03 12:34:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544775
;
-- 2017-09-03T12:34:12.402
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_ElementGroup WHERE AD_UI_ElementGroup_ID=540498
;
-- 2017-09-03T12:34:20.759
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540499, SeqNo=190,Updated=TO_TIMESTAMP('2017-09-03 12:34:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544783
;
-- 2017-09-03T12:34:25.630
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540499, SeqNo=200,Updated=TO_TIMESTAMP('2017-09-03 12:34:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544784
;
-- 2017-09-03T12:34:30.018
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540499, SeqNo=210,Updated=TO_TIMESTAMP('2017-09-03 12:34:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544785
;
-- 2017-09-03T12:34:34.750
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540499, SeqNo=220,Updated=TO_TIMESTAMP('2017-09-03 12:34:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544786
;
-- 2017-09-03T12:34:39.051
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540499, SeqNo=230,Updated=TO_TIMESTAMP('2017-09-03 12:34:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544800
;
-- 2017-09-03T12:34:43.266
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540499, SeqNo=240,Updated=TO_TIMESTAMP('2017-09-03 12:34:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544801
;
-- 2017-09-03T12:34:47.488
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_ElementGroup WHERE AD_UI_ElementGroup_ID=540500
;
-- 2017-09-03T12:34:54.930
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540499, SeqNo=250,Updated=TO_TIMESTAMP('2017-09-03 12:34:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544805
;
-- 2017-09-03T12:34:59.310
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540499, SeqNo=260,Updated=TO_TIMESTAMP('2017-09-03 12:34:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544806
;
-- 2017-09-03T12:35:03.841
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540499, SeqNo=270,Updated=TO_TIMESTAMP('2017-09-03 12:35:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544807
;
-- 2017-09-03T12:35:08.845
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540499, SeqNo=280,Updated=TO_TIMESTAMP('2017-09-03 12:35:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544808
;
-- 2017-09-03T12:35:13.480
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_ElementGroup WHERE AD_UI_ElementGroup_ID=540503
;
-- 2017-09-03T12:35:22.495
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540499, SeqNo=290,Updated=TO_TIMESTAMP('2017-09-03 12:35:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544813
;
-- 2017-09-03T12:35:27.497
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540499, SeqNo=300,Updated=TO_TIMESTAMP('2017-09-03 12:35:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544814
;
-- 2017-09-03T12:35:32.108
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540499, SeqNo=310,Updated=TO_TIMESTAMP('2017-09-03 12:35:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544815
;
-- 2017-09-03T12:35:36.297
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540499, SeqNo=320,Updated=TO_TIMESTAMP('2017-09-03 12:35:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544816
;
-- 2017-09-03T12:35:40.951
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540499, SeqNo=330,Updated=TO_TIMESTAMP('2017-09-03 12:35:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544817
;
-- 2017-09-03T12:35:45.651
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540499, SeqNo=340,Updated=TO_TIMESTAMP('2017-09-03 12:35:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544818
;
-- 2017-09-03T12:35:50.307
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540499, SeqNo=350,Updated=TO_TIMESTAMP('2017-09-03 12:35:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544824
;
-- 2017-09-03T12:35:54.775
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540499, SeqNo=360,Updated=TO_TIMESTAMP('2017-09-03 12:35:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544825
;
-- 2017-09-03T12:36:00.818
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540499, SeqNo=370,Updated=TO_TIMESTAMP('2017-09-03 12:36:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544826
;
-- 2017-09-03T12:36:05.540
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540499, SeqNo=380,Updated=TO_TIMESTAMP('2017-09-03 12:36:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544827
;
-- 2017-09-03T12:36:10.111
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=540499, SeqNo=390,Updated=TO_TIMESTAMP('2017-09-03 12:36:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544828
;
-- 2017-09-03T12:36:14.277
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_ElementGroup WHERE AD_UI_ElementGroup_ID=540504
;
-- 2017-09-03T12:36:29.760
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET Name='advanced edit',Updated=TO_TIMESTAMP('2017-09-03 12:36:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=540499
;
-- 2017-09-03T12:37:50.517
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-09-03 12:37:50','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Lines' WHERE AD_Field_ID=545267 AND AD_Language='en_US'
;
-- 2017-09-03T12:38:06.933
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-09-03 12:38:06','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Net Sum' WHERE AD_Field_ID=546256 AND AD_Language='en_US'
;
-- 2017-09-03T12:38:27.574
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-09-03 12:38:27','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Tax Sum' WHERE AD_Field_ID=545269 AND AD_Language='en_US'
;
-- 2017-09-03T12:38:57.280
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-09-03 12:38:57','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Bankaccount' WHERE AD_Field_ID=502200 AND AD_Language='en_US'
; | the_stack |
-- 04.12.2015 10:47
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,540617,TO_TIMESTAMP('2015-12-04 10:47:14','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.materialtracking','Y','N','QualityInvoiceLineGroupType',TO_TIMESTAMP('2015-12-04 10:47:14','YYYY-MM-DD HH24:MI:SS'),100,'L')
;
-- 04.12.2015 10:47
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=540617 AND NOT EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID)
;
-- 04.12.2015 10:48
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,540617,541132,TO_TIMESTAMP('2015-12-04 10:48:18','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.materialtracking','Y','Scrap',TO_TIMESTAMP('2015-12-04 10:48:18','YYYY-MM-DD HH24:MI:SS'),100,'001','Scrap')
;
-- 04.12.2015 10:48
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541132 AND NOT EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 04.12.2015 10:48
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,540617,541133,TO_TIMESTAMP('2015-12-04 10:48:28','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.materialtracking','Y','ProducedByProducts',TO_TIMESTAMP('2015-12-04 10:48:28','YYYY-MM-DD HH24:MI:SS'),100,'002','ProducedByProducts')
;
-- 04.12.2015 10:48
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541133 AND NOT EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 04.12.2015 10:48
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,540617,541134,TO_TIMESTAMP('2015-12-04 10:48:49','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.materialtracking','Y','AdditionalFee',TO_TIMESTAMP('2015-12-04 10:48:49','YYYY-MM-DD HH24:MI:SS'),100,'003','AdditionalFee')
;
-- 04.12.2015 10:48
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541134 AND NOT EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 04.12.2015 10:49
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,540617,541135,TO_TIMESTAMP('2015-12-04 10:49:03','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.materialtracking','Y','ProducedMainProduct',TO_TIMESTAMP('2015-12-04 10:49:03','YYYY-MM-DD HH24:MI:SS'),100,'004','ProducedMainProduct')
;
-- 04.12.2015 10:49
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541135 AND NOT EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 04.12.2015 10:49
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,540617,541136,TO_TIMESTAMP('2015-12-04 10:49:15','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.materialtracking','Y','ProducedCoProduct',TO_TIMESTAMP('2015-12-04 10:49:15','YYYY-MM-DD HH24:MI:SS'),100,'005','ProducedCoProduct')
;
-- 04.12.2015 10:49
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541136 AND NOT EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 04.12.2015 10:49
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,540617,541137,TO_TIMESTAMP('2015-12-04 10:49:26','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.materialtracking','Y','WithholdingAmount',TO_TIMESTAMP('2015-12-04 10:49:26','YYYY-MM-DD HH24:MI:SS'),100,'006','WithholdingAmount')
;
-- 04.12.2015 10:49
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541137 AND NOT EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 04.12.2015 10:49
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,540617,541138,TO_TIMESTAMP('2015-12-04 10:49:40','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.materialtracking','Y','PreceeedingRegularOrderDeduction',TO_TIMESTAMP('2015-12-04 10:49:40','YYYY-MM-DD HH24:MI:SS'),100,'007','PreceeedingRegularOrderDeduction')
;
-- 04.12.2015 10:49
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541138 AND NOT EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 04.12.2015 10:57
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List SET Value='01',Updated=TO_TIMESTAMP('2015-12-04 10:57:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=541132
;
-- 04.12.2015 10:57
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List SET Value='02',Updated=TO_TIMESTAMP('2015-12-04 10:57:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=541133
;
-- 04.12.2015 10:57
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List SET Value='03',Updated=TO_TIMESTAMP('2015-12-04 10:57:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=541134
;
-- 04.12.2015 10:57
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List SET Value='04',Updated=TO_TIMESTAMP('2015-12-04 10:57:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=541135
;
-- 04.12.2015 10:57
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List SET Value='05',Updated=TO_TIMESTAMP('2015-12-04 10:57:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=541136
;
-- 04.12.2015 10:58
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List SET Value='06',Updated=TO_TIMESTAMP('2015-12-04 10:58:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=541137
;
-- 04.12.2015 10:58
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List SET Value='07',Updated=TO_TIMESTAMP('2015-12-04 10:58:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=541138
;
-- 04.12.2015 11:00
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,542925,0,'QualityInvoiceLineGroupType',TO_TIMESTAMP('2015-12-04 11:00:31','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.materialtracking','Y','QualityInvoiceLineGroupType','QualityInvoiceLineGroupType',TO_TIMESTAMP('2015-12-04 11:00:31','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 04.12.2015 11:00
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=542925 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 04.12.2015 11:01
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,AllowZoomTo,ColumnName,Created,CreatedBy,DDL_NoForeignKey,EntityType,FieldLength,IsActive,IsAdvancedText,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsCalculated,IsDimension,IsEncrypted,IsGenericZoomKeyColumn,IsGenericZoomOrigin,IsIdentifier,IsKey,IsLazyLoading,IsMandatory,IsParent,IsSelectionColumn,IsStaleable,IsSyncDatabase,IsTranslated,IsUpdateable,IsUseDocSequence,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,552866,542925,0,17,540617,540270,'N','QualityInvoiceLineGroupType',TO_TIMESTAMP('2015-12-04 11:01:04','YYYY-MM-DD HH24:MI:SS'),100,'N','de.metas.invoicecandidate',2,'Y','N','Y','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','Y','N','QualityInvoiceLineGroupType',0,TO_TIMESTAMP('2015-12-04 11:01:04','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- 04.12.2015 11:01
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=552866 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 04.12.2015 11:01
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
ALTER TABLE C_Invoice_Candidate ADD QualityInvoiceLineGroupType VARCHAR(2) DEFAULT NULL
;
-- 04.12.2015 11:05
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element SET Name='Rechnungspositionsart', PrintName='Rechnungspositionsart',Updated=TO_TIMESTAMP('2015-12-04 11:05:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=542925
;
-- 04.12.2015 11:05
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=542925
;
-- 04.12.2015 11:05
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='QualityInvoiceLineGroupType', Name='Rechnungspositionsart', Description=NULL, Help=NULL WHERE AD_Element_ID=542925
;
-- 04.12.2015 11:05
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='QualityInvoiceLineGroupType', Name='Rechnungspositionsart', Description=NULL, Help=NULL, AD_Element_ID=542925 WHERE UPPER(ColumnName)='QUALITYINVOICELINEGROUPTYPE' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 04.12.2015 11:05
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='QualityInvoiceLineGroupType', Name='Rechnungspositionsart', Description=NULL, Help=NULL WHERE AD_Element_ID=542925 AND IsCentrallyMaintained='Y'
;
-- 04.12.2015 11:05
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Rechnungspositionsart', Description=NULL, Help=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=542925) AND IsCentrallyMaintained='Y'
;
-- 04.12.2015 11:05
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Rechnungspositionsart', Name='Rechnungspositionsart' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=542925)
; | the_stack |
--
---- TEST FOR PWJ
--
set enable_partitionwise = on;
-- PREPARE
-- CREATE TABLE partition_pwj_test_t1
CREATE TABLE partition_pwj_test_t1 (A INT4, B TEXT)
PARTITION BY RANGE (A)
(
PARTITION p1_partition_pwj_test_t1 VALUES LESS THAN (10),
PARTITION p2_partition_pwj_test_t1 VALUES LESS THAN (20),
PARTITION p3_partition_pwj_test_t1 VALUES LESS THAN (100),
PARTITION p4_partition_pwj_test_t1 VALUES LESS THAN (110)
);
-- CREATE TABLE partition_pwj_test_t2
CREATE TABLE partition_pwj_test_t2 (A INT4, B TEXT)
PARTITION BY RANGE (A)
(
PARTITION p1_partition_pwj_test_t2 VALUES LESS THAN (10),
PARTITION p2_partition_pwj_test_t2 VALUES LESS THAN (20),
PARTITION p3_partition_pwj_test_t2 VALUES LESS THAN (100),
PARTITION p4_partition_pwj_test_t2 VALUES LESS THAN (110)
);
-- CREATE TABLE partition_pwj_test_t3
CREATE TABLE partition_pwj_test_t3 (A INT4, B TEXT)
PARTITION BY RANGE (A)
(
PARTITION p1_partition_pwj_test_t3 VALUES LESS THAN (10),
PARTITION p2_partition_pwj_test_t3 VALUES LESS THAN (20),
PARTITION p3_partition_pwj_test_t3 VALUES LESS THAN (100),
PARTITION p4_partition_pwj_test_t3 VALUES LESS THAN (110)
);
-- CREATE TABLE partition_pwj_test_t4
CREATE TABLE partition_pwj_test_t4 (A INT4, B TEXT);
-- CREATE INDEX ON partition_pwj_test_t1
CREATE INDEX INDEX_ON_TEST_T1 ON partition_pwj_test_t1 (A) LOCAL;
-- CREATE INDEX ON partition_pwj_test_t2
CREATE INDEX INDEX_ON_TEST_T2 ON partition_pwj_test_t2 (A) LOCAL;
-- CREATE INDEX ON partition_pwj_test_t3
CREATE INDEX INDEX_ON_TEST_T3 ON partition_pwj_test_t3 (A) LOCAL;
-- CREATE INDEX ON partition_pwj_test_t4
CREATE INDEX INDEX_ON_TEST_T4 ON partition_pwj_test_t4 (A);
-- CREATE INDEX ON partition_pwj_test_t1
CREATE INDEX INDEX_ON_TEST_T1_1 ON partition_pwj_test_t1 (B) LOCAL;
-- CREATE INDEX ON partition_pwj_test_t2
CREATE INDEX INDEX_ON_TEST_T2_1 ON partition_pwj_test_t2 (B) LOCAL;
-- CREATE INDEX ON partition_pwj_test_t3
CREATE INDEX INDEX_ON_TEST_T3_1 ON partition_pwj_test_t3 (B) LOCAL;
-- CREATE INDEX ON partition_pwj_test_t4
CREATE INDEX INDEX_ON_TEST_T4_1 ON partition_pwj_test_t4 (B);
-- INSERT RECORD
INSERT INTO partition_pwj_test_t1 VALUES (1, 'TEST_T1_1'), (2, 'TEST_T1_2'), (11, 'TEST_T1_11'), (12, 'TEST_T1_12'), (91, 'TEST_T1_91'), (92, 'TEST_T1_92'), (101, 'TEST_T1_101'), (102, 'TEST_T1_102');
INSERT INTO partition_pwj_test_t2 VALUES (1, 'TEST_T2_1'), (2, 'TEST_T2_2'), (11, 'TEST_T2_11'), (12, 'TEST_T2_12'), (91, 'TEST_T2_91'), (92, 'TEST_T2_92'), (101, 'TEST_T2_101'), (102, 'TEST_T3_102');
INSERT INTO partition_pwj_test_t3 VALUES (1, 'TEST_T3_1'), (2, 'TEST_T3_2'), (11, 'TEST_T3_11'), (12, 'TEST_T3_12'), (91, 'TEST_T3_91'), (92, 'TEST_T3_92'), (101, 'TEST_T3_101'), (102, 'TEST_T3_102');
INSERT INTO partition_pwj_test_t4 VALUES (1, 'TEST_T4_1'), (2, 'TEST_T4_2'), (11, 'TEST_T4_11'), (12, 'TEST_T4_12'), (91, 'TEST_T4_91'), (92, 'TEST_T4_92'), (101, 'TEST_T4_101'), (102, 'TEST_T4_102');
SELECT REL.RELNAME, PART.RELNAME, PART.RANGENUM, PART.INTERVALNUM, PART.PARTKEY, PART.PARTKEY, PART.BOUNDARIES
FROM PG_PARTITION PART INNER JOIN PG_CLASS REL ON (REL.OID = PART.PARENTID)
WHERE REL.RELNAME IN('partition_pwj_test_t1', 'partition_pwj_test_t2', 'partition_pwj_test_t3', 'partition_pwj_test_t4') ORDER BY REL.RELNAME, PART.RELNAME;
SELECT * FROM partition_pwj_test_t1 order by 1, 2;
SELECT * FROM partition_pwj_test_t2 order by 1, 2;
SELECT * FROM partition_pwj_test_t3 order by 1, 2;
SELECT * FROM partition_pwj_test_t4 order by 1, 2;
--
---- MERGEJOIN + SEQSCAN
--
SET ENABLE_PARTITIONWISE = ON;
SET ENABLE_SEQSCAN = ON;
SET ENABLE_INDEXSCAN = OFF;
SET ENABLE_INDEXONLYSCAN = OFF;
SET ENABLE_BITMAPSCAN = OFF;
SET ENABLE_TIDSCAN = OFF;
SET ENABLE_SORT = ON;
SET ENABLE_MATERIAL = ON;
SET ENABLE_MERGEJOIN = ON;
SET ENABLE_NESTLOOP = OFF;
SET ENABLE_HASHJOIN = OFF;
-- JOINTYPE INNER JOIN -- TRY TO USE PARTITIONWISE JOIN
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2, 3;
-- CLOSE SORT + OPEN MATERIAL
SET ENABLE_SORT = OFF;
SET ENABLE_MATERIAL = ON;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2, 3;
-- OPEN SORT + CLOSE MATERIAL
SET ENABLE_SORT = ON;
SET ENABLE_MATERIAL = OFF;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2, 3;
-- CLOSE SORT + CLOSE MATERIAL
SET ENABLE_SORT = OFF;
SET ENABLE_MATERIAL = OFF;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2, 3;
-- CLOSE PARTITIONWISEJOIN
SET ENABLE_PARTITIONWISE = OFF;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2, 3;
--
---- MERGEJOIN + INDEXSCAN
--
SET ENABLE_PARTITIONWISE = ON;
SET ENABLE_SEQSCAN = OFF;
SET ENABLE_INDEXSCAN = ON;
SET ENABLE_INDEXONLYSCAN = OFF;
SET ENABLE_BITMAPSCAN = OFF;
SET ENABLE_TIDSCAN = OFF;
SET ENABLE_SORT = ON;
SET ENABLE_MATERIAL = ON;
SET ENABLE_MERGEJOIN = ON;
SET ENABLE_NESTLOOP = OFF;
SET ENABLE_HASHJOIN = OFF;
-- JOINTYPE INNER JOIN -- TRY TO USE PARTITIONWISE JOIN
-- OPEN SORT + OPEN MATERIAL
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2, 3;
-- CLOSE SORT + OPEN MATERIAL
SET ENABLE_SORT = OFF;
SET ENABLE_MATERIAL = ON;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2, 3;
-- OPEN SORT + CLOSE MATERIAL
SET ENABLE_SORT = ON;
SET ENABLE_MATERIAL = OFF;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2, 3;
-- CLOSE SORT + CLOSE MATERIAL
SET ENABLE_SORT = OFF;
SET ENABLE_MATERIAL = OFF;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2, 3;
-- CLOSE PARTITIONWISEJOIN
SET ENABLE_PARTITIONWISE = OFF;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2, 3;
--
---- MERGEJOIN + INDEXONLYSCAN
--
SET ENABLE_PARTITIONWISE = ON;
SET ENABLE_SEQSCAN = OFF;
SET ENABLE_INDEXSCAN = OFF;
SET ENABLE_INDEXONLYSCAN = ON;
SET ENABLE_BITMAPSCAN = OFF;
SET ENABLE_TIDSCAN = OFF;
SET ENABLE_SORT = ON;
SET ENABLE_MATERIAL = ON;
SET ENABLE_MERGEJOIN = ON;
SET ENABLE_NESTLOOP = OFF;
SET ENABLE_HASHJOIN = OFF;
-- JOINTYPE INNER JOIN -- TRY TO USE PARTITIONWISE JOIN
-- OPEN SORT + OPEN MATERIAL
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2;
-- CLOSE SORT + OPEN MATERIAL
SET ENABLE_SORT = OFF;
SET ENABLE_MATERIAL = ON;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2;
-- OPEN SORT + CLOSE MATERIAL
SET ENABLE_SORT = ON;
SET ENABLE_MATERIAL = OFF;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2;
-- CLOSE SORT + CLOSE MATERIAL
SET ENABLE_SORT = OFF;
SET ENABLE_MATERIAL = OFF;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2;
-- CLOSE PARTITIONWISEJOIN
SET ENABLE_PARTITIONWISE = OFF;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2, 3;
--
---- MERGEJOIN + BITMAPSCAN
--
SET ENABLE_PARTITIONWISE = ON;
SET ENABLE_SEQSCAN = OFF;
SET ENABLE_INDEXSCAN = OFF;
SET ENABLE_INDEXONLYSCAN = OFF;
SET ENABLE_BITMAPSCAN = ON;
SET ENABLE_TIDSCAN = OFF;
SET ENABLE_SORT = ON;
SET ENABLE_MATERIAL = ON;
SET ENABLE_MERGEJOIN = ON;
SET ENABLE_NESTLOOP = OFF;
SET ENABLE_HASHJOIN = OFF;
-- JOINTYPE INNER JOIN -- TRY TO USE PARTITIONWISE JOIN
-- OPEN SORT + OPEN MATERIAL
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t1.A in (1,2,11,12,91,92,101,102));
SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t1.A in (1,2,11,12,91,92,101,102)) order by 1, 2;
-- CLOSE SORT + OPEN MATERIAL
SET ENABLE_SORT = OFF;
SET ENABLE_MATERIAL = ON;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t1.A in (1,2,11,12,91,92,101,102));
SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t1.A in (1,2,11,12,91,92,101,102)) order by 1, 2;
-- OPEN SORT + CLOSE MATERIAL
SET ENABLE_SORT = ON;
SET ENABLE_MATERIAL = OFF;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t1.A in (1,2,11,12,91,92,101,102));
SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t1.A in (1,2,11,12,91,92,101,102)) order by 1, 2;
-- CLOSE SORT + CLOSE MATERIAL
SET ENABLE_SORT = OFF;
SET ENABLE_MATERIAL = OFF;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t1.A in (1,2,11,12,91,92,101,102));
SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t1.A in (1,2,11,12,91,92,101,102)) order by 1, 2;
-- CLOSE PARTITIONWISEJOIN
SET ENABLE_PARTITIONWISE = OFF;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2, 3;
--
---- NESTLOOP + SEQSCAN
--
SET ENABLE_PARTITIONWISE = TRUE;
SET ENABLE_SEQSCAN = ON;
SET ENABLE_INDEXSCAN = OFF;
SET ENABLE_INDEXONLYSCAN = OFF;
SET ENABLE_BITMAPSCAN = OFF;
SET ENABLE_TIDSCAN = OFF;
SET ENABLE_SORT = ON;
SET ENABLE_MATERIAL = ON;
SET ENABLE_MERGEJOIN = OFF;
SET ENABLE_NESTLOOP = ON;
SET ENABLE_HASHJOIN = OFF;
-- JOINTYPE INNER JOIN -- TRY TO USE PARTITIONWISE JOIN
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2, 3;
-- CLOSE SORT + OPEN MATERIAL
SET ENABLE_SORT = OFF;
SET ENABLE_MATERIAL = ON;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2, 3;
-- OPEN SORT + CLOSE MATERIAL
SET ENABLE_SORT = ON;
SET ENABLE_MATERIAL = OFF;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2, 3;
-- CLOSE SORT + CLOSE MATERIAL
SET ENABLE_SORT = OFF;
SET ENABLE_MATERIAL = OFF;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2, 3;
-- CLOSE PARTITIONWISEJOIN
SET ENABLE_PARTITIONWISE = OFF;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2, 3;
--
---- NESTLOOP + INDEX
--
SET ENABLE_PARTITIONWISE = TRUE;
SET ENABLE_SEQSCAN = OFF;
SET ENABLE_INDEXSCAN = ON;
SET ENABLE_INDEXONLYSCAN = OFF;
SET ENABLE_BITMAPSCAN = OFF;
SET ENABLE_TIDSCAN = OFF;
SET ENABLE_SORT = ON;
SET ENABLE_MATERIAL = ON;
SET ENABLE_MERGEJOIN = OFF;
SET ENABLE_NESTLOOP = ON;
SET ENABLE_HASHJOIN = OFF;
-- JOINTYPE INNER JOIN -- TRY TO USE PARTITIONWISE JOIN
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2, 3;
-- CLOSE SORT + OPEN MATERIAL
SET ENABLE_SORT = OFF;
SET ENABLE_MATERIAL = ON;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2, 3;
-- OPEN SORT + CLOSE MATERIAL
SET ENABLE_SORT = ON;
SET ENABLE_MATERIAL = OFF;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2, 3;
-- CLOSE SORT + CLOSE MATERIAL
SET ENABLE_SORT = OFF;
SET ENABLE_MATERIAL = OFF;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2, 3;
-- CLOSE PARTITIONWISEJOIN
SET ENABLE_PARTITIONWISE = OFF;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2, 3;
--
---- NESTLOOP + INDEXONLYSCAN
--
SET ENABLE_PARTITIONWISE = TRUE;
SET ENABLE_SEQSCAN = OFF;
SET ENABLE_INDEXSCAN = OFF;
SET ENABLE_INDEXONLYSCAN = ON;
SET ENABLE_BITMAPSCAN = OFF;
SET ENABLE_TIDSCAN = OFF;
SET ENABLE_SORT = ON;
SET ENABLE_MATERIAL = ON;
SET ENABLE_MERGEJOIN = OFF;
SET ENABLE_NESTLOOP = ON;
SET ENABLE_HASHJOIN = OFF;
-- JOINTYPE INNER JOIN -- TRY TO USE PARTITIONWISE JOIN
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2;
-- CLOSE SORT + OPEN MATERIAL
SET ENABLE_SORT = OFF;
SET ENABLE_MATERIAL = ON;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2;
-- OPEN SORT + CLOSE MATERIAL
SET ENABLE_SORT = ON;
SET ENABLE_MATERIAL = OFF;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2;
-- CLOSE SORT + CLOSE MATERIAL
SET ENABLE_SORT = OFF;
SET ENABLE_MATERIAL = OFF;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2;
-- CLOSE PARTITIONWISEJOIN
SET ENABLE_PARTITIONWISE = OFF;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2;
--
---- NESTLOOP + BITMAPSCAN
--
SET ENABLE_PARTITIONWISE = TRUE;
SET ENABLE_SEQSCAN = OFF;
SET ENABLE_INDEXSCAN = OFF;
SET ENABLE_INDEXONLYSCAN = OFF;
SET ENABLE_BITMAPSCAN = ON;
SET ENABLE_TIDSCAN = OFF;
SET ENABLE_SORT = ON;
SET ENABLE_MATERIAL = ON;
SET ENABLE_MERGEJOIN = OFF;
SET ENABLE_NESTLOOP = ON;
SET ENABLE_HASHJOIN = OFF;
-- JOINTYPE INNER JOIN -- TRY TO USE PARTITIONWISE JOIN
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t1.A in (1,2,11,12,91,92,101,102));
SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t1.A in (1,2,11,12,91,92,101,102)) order by 1, 2;
-- CLOSE SORT + OPEN MATERIAL
SET ENABLE_SORT = OFF;
SET ENABLE_MATERIAL = ON;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t1.A in (1,2,11,12,91,92,101,102));
SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t1.A in (1,2,11,12,91,92,101,102)) order by 1, 2;
-- OPEN SORT + CLOSE MATERIAL
SET ENABLE_SORT = ON;
SET ENABLE_MATERIAL = OFF;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t1.A in (1,2,11,12,91,92,101,102));
SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t1.A in (1,2,11,12,91,92,101,102)) order by 1, 2;
-- CLOSE SORT + CLOSE MATERIAL
SET ENABLE_SORT = OFF;
SET ENABLE_MATERIAL = OFF;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t1.A in (1,2,11,12,91,92,101,102));
SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t1.A in (1,2,11,12,91,92,101,102)) order by 1, 2;
-- CLOSE PARTITIONWISEJOIN
SET ENABLE_PARTITIONWISE = OFF;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t1.A in (1,2,11,12,91,92,101,102));
SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t1.A in (1,2,11,12,91,92,101,102)) order by 1, 2;
--
---- HASHJOIN + SEQSCAN
--
SET ENABLE_PARTITIONWISE = TRUE;
SET ENABLE_SEQSCAN = ON;
SET ENABLE_INDEXSCAN = OFF;
SET ENABLE_INDEXONLYSCAN = OFF;
SET ENABLE_BITMAPSCAN = OFF;
SET ENABLE_TIDSCAN = OFF;
SET ENABLE_SORT = ON;
SET ENABLE_MATERIAL = ON;
SET ENABLE_MERGEJOIN = OFF;
SET ENABLE_NESTLOOP = OFF;
SET ENABLE_HASHJOIN = ON;
-- JOINTYPE INNER JOIN -- TRY TO USE PARTITIONWISE JOIN
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2, 3;
-- CLOSE SORT + OPEN MATERIAL
SET ENABLE_SORT = OFF;
SET ENABLE_MATERIAL = ON;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2, 3;
-- OPEN SORT + CLOSE MATERIAL
SET ENABLE_SORT = ON;
SET ENABLE_MATERIAL = OFF;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2, 3;
-- CLOSE SORT + CLOSE MATERIAL
SET ENABLE_SORT = OFF;
SET ENABLE_MATERIAL = OFF;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2, 3;
-- CLOSE PARTITIONWISEJOIN
SET ENABLE_PARTITIONWISE = OFF;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2, 3;
--
---- HASHJOIN + INDEXSACN
--
SET ENABLE_PARTITIONWISE = TRUE;
SET ENABLE_SEQSCAN = OFF;
SET ENABLE_INDEXSCAN = ON;
SET ENABLE_INDEXONLYSCAN = OFF;
SET ENABLE_BITMAPSCAN = OFF;
SET ENABLE_TIDSCAN = OFF;
SET ENABLE_SORT = ON;
SET ENABLE_MATERIAL = ON;
SET ENABLE_MERGEJOIN = OFF;
SET ENABLE_NESTLOOP = OFF;
SET ENABLE_HASHJOIN = ON;
-- JOINTYPE INNER JOIN -- TRY TO USE PARTITIONWISE JOIN
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2, 3;
-- CLOSE SORT + OPEN MATERIAL
SET ENABLE_SORT = OFF;
SET ENABLE_MATERIAL = ON;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2, 3;
-- OPEN SORT + CLOSE MATERIAL
SET ENABLE_SORT = ON;
SET ENABLE_MATERIAL = OFF;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2, 3;
-- CLOSE SORT + CLOSE MATERIAL
SET ENABLE_SORT = OFF;
SET ENABLE_MATERIAL = OFF;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2, 3;
-- CLOSE PARTITIONWISEJOIN
SET ENABLE_PARTITIONWISE = OFF;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2, 3;
--
---- HASHJOIN + INDEXONLYSACN
--
SET ENABLE_PARTITIONWISE = TRUE;
SET ENABLE_SEQSCAN = OFF;
SET ENABLE_INDEXSCAN = OFF;
SET ENABLE_INDEXONLYSCAN = ON;
SET ENABLE_BITMAPSCAN = OFF;
SET ENABLE_TIDSCAN = OFF;
SET ENABLE_SORT = ON;
SET ENABLE_MATERIAL = ON;
SET ENABLE_MERGEJOIN = OFF;
SET ENABLE_NESTLOOP = OFF;
SET ENABLE_HASHJOIN = ON;
-- JOINTYPE INNER JOIN -- TRY TO USE PARTITIONWISE JOIN
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2;
-- CLOSE SORT + OPEN MATERIAL
SET ENABLE_SORT = OFF;
SET ENABLE_MATERIAL = ON;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2;
-- OPEN SORT + CLOSE MATERIAL
SET ENABLE_SORT = ON;
SET ENABLE_MATERIAL = OFF;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2;
-- CLOSE SORT + CLOSE MATERIAL
SET ENABLE_SORT = OFF;
SET ENABLE_MATERIAL = OFF;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2;
-- CLOSE PARTITIONWISEJOIN
SET ENABLE_PARTITIONWISE = OFF;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2;
--
---- HASHJOIN + BITMAPSCAN
--
SET ENABLE_PARTITIONWISE = TRUE;
SET ENABLE_SEQSCAN = OFF;
SET ENABLE_INDEXSCAN = OFF;
SET ENABLE_INDEXONLYSCAN = OFF;
SET ENABLE_BITMAPSCAN = ON;
SET ENABLE_TIDSCAN = OFF;
SET ENABLE_SORT = ON;
SET ENABLE_MATERIAL = ON;
SET ENABLE_MERGEJOIN = OFF;
SET ENABLE_NESTLOOP = OFF;
SET ENABLE_HASHJOIN = ON;
-- JOINTYPE INNER JOIN -- TRY TO USE PARTITIONWISE JOIN
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t1.A in (1,2,11,12,91,92,101,102));
SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t1.A in (1,2,11,12,91,92,101,102)) order by 1, 2;
-- CLOSE SORT + OPEN MATERIAL
SET ENABLE_SORT = OFF;
SET ENABLE_MATERIAL = ON;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t1.A in (1,2,11,12,91,92,101,102));
SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t1.A in (1,2,11,12,91,92,101,102)) order by 1, 2;
-- OPEN SORT + CLOSE MATERIAL
SET ENABLE_SORT = ON;
SET ENABLE_MATERIAL = OFF;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t1.A in (1,2,11,12,91,92,101,102));
SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t1.A in (1,2,11,12,91,92,101,102)) order by 1, 2;
-- CLOSE SORT + CLOSE MATERIAL
SET ENABLE_SORT = OFF;
SET ENABLE_MATERIAL = OFF;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t1.A in (1,2,11,12,91,92,101,102));
SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t1.A in (1,2,11,12,91,92,101,102)) order by 1, 2;
-- CLOSE PARTITIONWISEJOIN
SET ENABLE_PARTITIONWISE = OFF;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t1.A in (1,2,11,12,91,92,101,102));
SELECT partition_pwj_test_t1.A, partition_pwj_test_t2.A FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t1.A in (1,2,11,12,91,92,101,102)) order by 1, 2;
--
---- other cases
--
SET ENABLE_PARTITIONWISE = TRUE;
SET ENABLE_SEQSCAN = ON;
SET ENABLE_INDEXSCAN = ON;
SET ENABLE_INDEXONLYSCAN = ON;
SET ENABLE_BITMAPSCAN = ON;
SET ENABLE_TIDSCAN = ON;
SET ENABLE_SORT = ON;
SET ENABLE_MATERIAL = ON;
SET ENABLE_MERGEJOIN = ON;
SET ENABLE_NESTLOOP = ON;
SET ENABLE_HASHJOIN = ON;
--
---- jointype
--
-- JOINTYPE LEFT JOIN
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 LEFT JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 LEFT JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2, 3;
-- JOINTYPE FULL JOIN
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 FULL JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 FULL JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2, 3;
-- JOINTYPE RIGHT JOIN
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 RIGHT JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 RIGHT JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2, 3;
-- JOINTYPE CROSS JOIN
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 CROSS JOIN partition_pwj_test_t2;
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 CROSS JOIN partition_pwj_test_t2 order by 1, 2, 3;
-- JOINTYPE INNER JOIN -- TRY TO USE PARTITIONWISE JOIN
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2, 3;
-- PARTITIONED TABLE + ORDINARY TABLE
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t4.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t4 ON (partition_pwj_test_t1.A = partition_pwj_test_t4.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t4.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t4 ON (partition_pwj_test_t1.A = partition_pwj_test_t4.A) order by 1, 2, 3;
--
---- JOIN-CONDITION
--
-- JOIN-COLUMN IS NOT IN PARTITIONKEY
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.B = partition_pwj_test_t2.B);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.B = partition_pwj_test_t2.B);
-- JOIN-CONFITION IS NOT AN EQUAL EXPRESSION
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A > partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A > partition_pwj_test_t2.A) order by 1, 2, 3;
-- JOIN-CONFITION IS NOT OPERATOR
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (TRUE);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (TRUE) order by 1, 2, 3;
-- ONE JOIN-CONFITION MATCH PWJ
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A > 1 AND partition_pwj_test_t2.A > 2 AND partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A > 1 AND partition_pwj_test_t2.A > 2 AND partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2, 3;
--
---- PARITION NUM
--
-- THE NUM IS NOT EUQAL
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t1.A > 1 AND partition_pwj_test_t2.A > 12);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t1.A > 1 AND partition_pwj_test_t2.A > 12) order by 1, 2, 3;
-- THE NUM IS EUQAL, BUT THE BOUNDARY IS NOT EQUAL
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t2.A > 12 AND partition_pwj_test_t1.A < 100);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t2.A > 12 AND partition_pwj_test_t1.A < 100) order by 1, 2, 3;
-- THE NUM IS EUQAL, AND THE BOUNDARY IS EQUAL
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A) order by 1, 2, 3;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t1.A < 10 AND partition_pwj_test_t2.A < 10);
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B FROM partition_pwj_test_t1 INNER JOIN partition_pwj_test_t2 ON (partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t1.A < 10 AND partition_pwj_test_t2.A < 10) order by 1, 2, 3;
--
---- MUTLI-KEYPOINT TEST
--
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B, partition_pwj_test_t3.B FROM partition_pwj_test_t1, partition_pwj_test_t2, partition_pwj_test_t3 WHERE partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t2.A = partition_pwj_test_t3.A;
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B, partition_pwj_test_t3.B FROM partition_pwj_test_t1, partition_pwj_test_t2, partition_pwj_test_t3 WHERE partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t2.A = partition_pwj_test_t3.A order by 1, 2, 3;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B, partition_pwj_test_t3.B FROM partition_pwj_test_t1, partition_pwj_test_t2, partition_pwj_test_t3 WHERE partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t2.A = partition_pwj_test_t3.A AND partition_pwj_test_t1.A > 10;
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B, partition_pwj_test_t3.B FROM partition_pwj_test_t1, partition_pwj_test_t2, partition_pwj_test_t3 WHERE partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t2.A = partition_pwj_test_t3.A AND partition_pwj_test_t1.A > 10 order by 1, 2, 3, 4;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B, partition_pwj_test_t3.B FROM partition_pwj_test_t1, partition_pwj_test_t2, partition_pwj_test_t3 WHERE partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t2.A = partition_pwj_test_t3.A AND partition_pwj_test_t1.A > 10 AND partition_pwj_test_t2.A > 10;
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B, partition_pwj_test_t3.B FROM partition_pwj_test_t1, partition_pwj_test_t2, partition_pwj_test_t3 WHERE partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t2.A = partition_pwj_test_t3.A AND partition_pwj_test_t1.A > 10 AND partition_pwj_test_t2.A > 10 order by 1, 2, 3, 4;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B, partition_pwj_test_t3.B FROM partition_pwj_test_t1, partition_pwj_test_t2, partition_pwj_test_t3 WHERE partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t2.A = partition_pwj_test_t3.A AND partition_pwj_test_t1.A > 10 AND partition_pwj_test_t2.A > 20;
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B, partition_pwj_test_t3.B FROM partition_pwj_test_t1, partition_pwj_test_t2, partition_pwj_test_t3 WHERE partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t2.A = partition_pwj_test_t3.A AND partition_pwj_test_t1.A > 10 AND partition_pwj_test_t2.A > 20 order by 1, 2, 3, 4;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B, partition_pwj_test_t3.B, partition_pwj_test_t4.B FROM partition_pwj_test_t1, partition_pwj_test_t2, partition_pwj_test_t3, partition_pwj_test_t4 WHERE partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t2.A = partition_pwj_test_t3.A;
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B, partition_pwj_test_t3.B, partition_pwj_test_t4.B FROM partition_pwj_test_t1, partition_pwj_test_t2, partition_pwj_test_t3, partition_pwj_test_t4 WHERE partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t2.A = partition_pwj_test_t3.A order by 1, 2, 3, 4, 5;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B, partition_pwj_test_t3.B, partition_pwj_test_t4.B FROM partition_pwj_test_t1, partition_pwj_test_t2, partition_pwj_test_t3, partition_pwj_test_t4 WHERE partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t2.A = partition_pwj_test_t3.A AND partition_pwj_test_t4.A = partition_pwj_test_t1.A;
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B, partition_pwj_test_t3.B, partition_pwj_test_t4.B FROM partition_pwj_test_t1, partition_pwj_test_t2, partition_pwj_test_t3, partition_pwj_test_t4 WHERE partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t2.A = partition_pwj_test_t3.A AND partition_pwj_test_t4.A = partition_pwj_test_t1.A order by 1, 2, 3, 4, 5;
SET ENABLE_SORT = OFF;
EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B, partition_pwj_test_t3.B, partition_pwj_test_t4.B FROM partition_pwj_test_t1, partition_pwj_test_t2, partition_pwj_test_t3, partition_pwj_test_t4 WHERE partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t2.A = partition_pwj_test_t3.A AND partition_pwj_test_t4.A = partition_pwj_test_t1.A;
SELECT partition_pwj_test_t1.*, partition_pwj_test_t2.B, partition_pwj_test_t3.B, partition_pwj_test_t4.B FROM partition_pwj_test_t1, partition_pwj_test_t2, partition_pwj_test_t3, partition_pwj_test_t4 WHERE partition_pwj_test_t1.A = partition_pwj_test_t2.A AND partition_pwj_test_t2.A = partition_pwj_test_t3.A AND partition_pwj_test_t4.A = partition_pwj_test_t1.A order by 1, 2, 3, 4, 5;
--
---- CLEAN UP
--
DROP TABLE partition_pwj_test_t1;
DROP TABLE partition_pwj_test_t2;
DROP TABLE partition_pwj_test_t3;
DROP TABLE partition_pwj_test_t4;
RESET ENABLE_PARTITIONWISE;
RESET ENABLE_SEQSCAN;
RESET ENABLE_INDEXSCAN;
RESET ENABLE_INDEXONLYSCAN;
RESET ENABLE_BITMAPSCAN;
RESET ENABLE_TIDSCAN;
RESET ENABLE_SORT;
RESET ENABLE_MATERIAL;
RESET ENABLE_MERGEJOIN;
RESET ENABLE_NESTLOOP;
RESET ENABLE_HASHJOIN; | the_stack |
-- 2019-07-26T10:57:03.378Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element SET ColumnName='QtyToInvoiceInPriceUOM_Nominal',Updated=TO_TIMESTAMP('2019-07-26 12:57:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=542529
;
-- 2019-07-26T10:57:03.382Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='QtyToInvoiceInPriceUOM_Nominal', Name='Zu berechn. Menge In Preiseinheit', Description='Menge, die aktuell bei einem Rechnungslauf in Rechnung gestellt würde, umgerechnet in die Einheit auf die sich der Preis bezieht.', Help=NULL WHERE AD_Element_ID=542529
;
-- 2019-07-26T10:57:03.384Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='QtyToInvoiceInPriceUOM_Nominal', Name='Zu berechn. Menge In Preiseinheit', Description='Menge, die aktuell bei einem Rechnungslauf in Rechnung gestellt würde, umgerechnet in die Einheit auf die sich der Preis bezieht.', Help=NULL, AD_Element_ID=542529 WHERE UPPER(ColumnName)='QTYTOINVOICEINPRICEUOM_NOMINAL' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2019-07-26T10:57:03.386Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='QtyToInvoiceInPriceUOM_Nominal', Name='Zu berechn. Menge In Preiseinheit', Description='Menge, die aktuell bei einem Rechnungslauf in Rechnung gestellt würde, umgerechnet in die Einheit auf die sich der Preis bezieht.', Help=NULL WHERE AD_Element_ID=542529 AND IsCentrallyMaintained='Y'
;
-- 2019-07-26T10:58:48.396Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Description='Zu berechnende Nominalmenge in der Mengeneinheit des Preises.', IsTranslated='Y', Name='Zu berechn. Nominalmenge In Preiseinheit', PrintName='Zu berechn. Nominalmenge In Preiseinheit',Updated=TO_TIMESTAMP('2019-07-26 12:58:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=542529 AND AD_Language='de_CH'
;
-- 2019-07-26T10:58:48.398Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(542529,'de_CH')
;
-- 2019-07-26T10:59:17.988Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Name='Zu berechn. Nominalmenge in Preiseinheit', PrintName='Zu berechn. Nominalmenge in Preiseinheit',Updated=TO_TIMESTAMP('2019-07-26 12:59:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=542529 AND AD_Language='de_CH'
;
-- 2019-07-26T10:59:17.989Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(542529,'de_CH')
;
-- 2019-07-26T10:59:55.352Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Name='Zu ber. Nominalmenge in Preiseinheit', PrintName='Zu ber. Nominalmenge in Preiseinheit',Updated=TO_TIMESTAMP('2019-07-26 12:59:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=542529 AND AD_Language='de_CH'
;
-- 2019-07-26T10:59:55.353Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(542529,'de_CH')
;
-- 2019-07-26T11:00:10.291Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Name='Zu ber. Nominalmenge in Preiseinheit', PrintName='Zu ber. Nominalmenge in Preiseinheit',Updated=TO_TIMESTAMP('2019-07-26 13:00:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=542529 AND AD_Language='de_DE'
;
-- 2019-07-26T11:00:10.292Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(542529,'de_DE')
;
-- 2019-07-26T11:00:10.299Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(542529,'de_DE')
;
-- 2019-07-26T11:00:10.301Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='QtyToInvoiceInPriceUOM_Nominal', Name='Zu ber. Nominalmenge in Preiseinheit', Description='Menge, die aktuell bei einem Rechnungslauf in Rechnung gestellt würde, umgerechnet in die Einheit auf die sich der Preis bezieht.', Help=NULL WHERE AD_Element_ID=542529
;
-- 2019-07-26T11:00:10.302Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='QtyToInvoiceInPriceUOM_Nominal', Name='Zu ber. Nominalmenge in Preiseinheit', Description='Menge, die aktuell bei einem Rechnungslauf in Rechnung gestellt würde, umgerechnet in die Einheit auf die sich der Preis bezieht.', Help=NULL, AD_Element_ID=542529 WHERE UPPER(ColumnName)='QTYTOINVOICEINPRICEUOM_NOMINAL' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2019-07-26T11:00:10.303Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='QtyToInvoiceInPriceUOM_Nominal', Name='Zu ber. Nominalmenge in Preiseinheit', Description='Menge, die aktuell bei einem Rechnungslauf in Rechnung gestellt würde, umgerechnet in die Einheit auf die sich der Preis bezieht.', Help=NULL WHERE AD_Element_ID=542529 AND IsCentrallyMaintained='Y'
;
-- 2019-07-26T11:00:10.305Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Zu ber. Nominalmenge in Preiseinheit', Description='Menge, die aktuell bei einem Rechnungslauf in Rechnung gestellt würde, umgerechnet in die Einheit auf die sich der Preis bezieht.', Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=542529) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 542529)
;
-- 2019-07-26T11:00:10.315Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Zu ber. Nominalmenge in Preiseinheit', Name='Zu ber. Nominalmenge in Preiseinheit' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=542529)
;
-- 2019-07-26T11:00:10.320Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Zu ber. Nominalmenge in Preiseinheit', Description='Menge, die aktuell bei einem Rechnungslauf in Rechnung gestellt würde, umgerechnet in die Einheit auf die sich der Preis bezieht.', Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 542529
;
-- 2019-07-26T11:00:10.322Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Zu ber. Nominalmenge in Preiseinheit', Description='Menge, die aktuell bei einem Rechnungslauf in Rechnung gestellt würde, umgerechnet in die Einheit auf die sich der Preis bezieht.', Help=NULL WHERE AD_Element_ID = 542529
;
-- 2019-07-26T11:00:10.323Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name = 'Zu ber. Nominalmenge in Preiseinheit', Description = 'Menge, die aktuell bei einem Rechnungslauf in Rechnung gestellt würde, umgerechnet in die Einheit auf die sich der Preis bezieht.', WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 542529
;
-- 2019-07-26T11:00:30.621Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Description='Zu berechnende Nominalmenge in der Mengeneinheit des Preises.', IsTranslated='Y',Updated=TO_TIMESTAMP('2019-07-26 13:00:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=542529 AND AD_Language='de_DE'
;
-- 2019-07-26T11:00:30.622Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(542529,'de_DE')
;
-- 2019-07-26T11:00:30.628Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(542529,'de_DE')
;
-- 2019-07-26T11:00:30.629Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='QtyToInvoiceInPriceUOM_Nominal', Name='Zu ber. Nominalmenge in Preiseinheit', Description='Zu berechnende Nominalmenge in der Mengeneinheit des Preises.', Help=NULL WHERE AD_Element_ID=542529
;
-- 2019-07-26T11:00:30.631Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='QtyToInvoiceInPriceUOM_Nominal', Name='Zu ber. Nominalmenge in Preiseinheit', Description='Zu berechnende Nominalmenge in der Mengeneinheit des Preises.', Help=NULL, AD_Element_ID=542529 WHERE UPPER(ColumnName)='QTYTOINVOICEINPRICEUOM_NOMINAL' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2019-07-26T11:00:30.632Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='QtyToInvoiceInPriceUOM_Nominal', Name='Zu ber. Nominalmenge in Preiseinheit', Description='Zu berechnende Nominalmenge in der Mengeneinheit des Preises.', Help=NULL WHERE AD_Element_ID=542529 AND IsCentrallyMaintained='Y'
;
-- 2019-07-26T11:00:30.633Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Zu ber. Nominalmenge in Preiseinheit', Description='Zu berechnende Nominalmenge in der Mengeneinheit des Preises.', Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=542529) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 542529)
;
-- 2019-07-26T11:00:30.645Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Zu ber. Nominalmenge in Preiseinheit', Description='Zu berechnende Nominalmenge in der Mengeneinheit des Preises.', Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 542529
;
-- 2019-07-26T11:00:30.647Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Zu ber. Nominalmenge in Preiseinheit', Description='Zu berechnende Nominalmenge in der Mengeneinheit des Preises.', Help=NULL WHERE AD_Element_ID = 542529
;
-- 2019-07-26T11:00:30.649Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name = 'Zu ber. Nominalmenge in Preiseinheit', Description = 'Zu berechnende Nominalmenge in der Mengeneinheit des Preises.', WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 542529
;
-- 2019-07-26T11:01:18.996Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y', Name='Nominal invoicable quantity in price-UOM', PrintName='Nominal invoicable quantity in price-UOM',Updated=TO_TIMESTAMP('2019-07-26 13:01:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=542529 AND AD_Language='en_US'
;
-- 2019-07-26T11:01:18.997Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(542529,'en_US')
;
-- 2019-07-26T11:01:44.124Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Description='', Name='Nominal invoicable qty in price-UOM', PrintName='Nominal invoicable qty in price-UOM',Updated=TO_TIMESTAMP('2019-07-26 13:01:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=542529 AND AD_Language='en_US'
;
-- 2019-07-26T11:01:44.126Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(542529,'en_US')
;
-- we leave this physical column as it is; some migration scripts by the line it will once again be used
--ALTER TABLE C_Invoice_Candidate RENAME COLUMN QtyToInvoiceInPriceUOM TO QtyToInvoiceInPriceUOM_Nominal; | the_stack |
-- 1 day interval --
create table t_day_1(c1 int, c2 timestamp without time zone, c3 int)
partition by range(c2) begin(timestamp without time zone '2015-09-01') step(interval '1 day') partitions(23)
distribute by shard(c1);
create index t_day_1_c1 on t_day_1(c1);
create index t_day_1_c2 on t_day_1(c2);
insert into t_day_1 values(1, timestamp without time zone '2015-09-01 13:11:00', 1);
insert into t_day_1 select generate_series(2,3), timestamp without time zone '2015-09-02 13:11:00', 1;
insert into t_day_1 select generate_series(4,7), timestamp without time zone '2015-09-03 13:11:00', 1;
insert into t_day_1 select generate_series(8,15), timestamp without time zone '2015-09-04 13:11:00', 1;
insert into t_day_1 select generate_series(16,31), timestamp without time zone '2015-09-05 13:11:00', 1;
insert into t_day_1 select generate_series(32,63), timestamp without time zone '2015-09-06 13:11:00', 1;
insert into t_day_1 select generate_series(64,127), timestamp without time zone '2015-09-07 13:11:00', 1;
insert into t_day_1 select generate_series(128,255), timestamp without time zone '2015-09-08 13:11:00', 1;
insert into t_day_1 select generate_series(256,511), timestamp without time zone '2015-09-09 13:11:00', 1;
insert into t_day_1 select generate_series(512,1023), timestamp without time zone '2015-09-10 13:11:00', 1;
insert into t_day_1 select generate_series(1024,2047), timestamp without time zone '2015-09-11 13:11:00', 1;
insert into t_day_1 select generate_series(2048,4095), timestamp without time zone '2015-09-12 13:11:00', 1;
insert into t_day_1 select generate_series(4096,8191), timestamp without time zone '2015-09-13 13:11:00', 1;
insert into t_day_1 select generate_series(8192,16383), timestamp without time zone '2015-09-14 13:11:00', 1;
--create index when table is not empty--
create index t_day_1_c3_c2 on t_day_1(c3,c2);
--not-partition key --
select c1,c2 from t_day_1 where c2 < timestamp without time zone '2015-09-04' order by c1;
select c1,c2 from t_day_1 where c2 < timestamp without time zone '2015-09-04' order by c1 limit 5;
select shardid,c2 from t_day_1 where c2 < timestamp without time zone '2015-09-04' order by c1 limit 5;
select shardid,c1+c3 from t_day_1 where c2 < timestamp without time zone '2015-09-04' order by c1 limit 5;
--partition key --
select c1,c2 from t_day_1 where c2 < timestamp without time zone '2015-09-04' order by c2;
select c1,c2 from t_day_1 where c2 < timestamp without time zone '2015-09-04' order by c2 limit 5;
select c1,c2 from t_day_1 where c2 < timestamp without time zone '2015-09-04' order by c2 desc limit 5;
select shardid,c2 from t_day_1 where c2 < timestamp without time zone '2015-09-04' order by c2 limit 5;
select shardid,c1+c3 from t_day_1 where c2 < timestamp without time zone '2015-09-04' order by c2 limit 5;
select shardid,c1+c3 from t_day_1 where c2 < timestamp without time zone '2015-09-04' order by c3,c2 limit 5;
select shardid,c1 from t_day_1 where c2 < timestamp without time zone '2015-09-04' and mod(c1,2) = 1 order by c1 limit 5;
drop index t_day_1_c3_c2;
drop table t_day_1;
-- 1 week interval--
create table t_day_7(c1 int, c2 timestamp without time zone, c3 int)
partition by range(c2) begin(timestamp without time zone '2015-09-01') step(interval '7 day') partitions(10)
distribute by shard(c1);
create index t_day_7_c1 on t_day_7(c1);
create index t_day_7_c2 on t_day_7(c2);
insert into t_day_7 values(1, timestamp without time zone '2015-09-01 13:11:00', 1);
insert into t_day_7 select generate_series(2,3), timestamp without time zone '2015-09-08 13:11:00', 1;
insert into t_day_7 select generate_series(4,7), timestamp without time zone '2015-09-15 13:11:00', 1;
insert into t_day_7 select generate_series(8,15), timestamp without time zone '2015-09-22 13:11:00', 1;
insert into t_day_7 select generate_series(16,31), timestamp without time zone '2015-09-29 13:11:00', 1;
insert into t_day_7 select generate_series(32,63), timestamp without time zone '2015-10-06 13:11:00', 1;
insert into t_day_7 select generate_series(64,127), timestamp without time zone '2015-10-13 13:11:00', 1;
insert into t_day_7 select generate_series(128,255), timestamp without time zone '2015-10-20 13:11:00', 1;
insert into t_day_7 select generate_series(256,511), timestamp without time zone '2015-10-27 13:11:00', 1;
insert into t_day_7 select generate_series(512,1023), timestamp without time zone '2015-11-03 13:11:00', 1;
--create index when table is not empty--
create index t_day_7_c3_c2 on t_day_7(c3,c2);
--not-partition key --
select c1,c2 from t_day_7 where c2 < timestamp without time zone '2015-09-20' order by c1;
select c1,c2 from t_day_7 where c2 < timestamp without time zone '2015-09-20' order by c1 limit 5;
select shardid,c2 from t_day_7 where c2 < timestamp without time zone '2015-09-20' order by c1 limit 5;
select shardid,c1+c3 from t_day_7 where c2 < timestamp without time zone '2015-09-20' order by c1 limit 5;
--partition key --
select c1,c2 from t_day_7 where c2 < timestamp without time zone '2015-09-20' order by c2;
select c1,c2 from t_day_7 where c2 < timestamp without time zone '2015-09-20' order by c2 limit 5;
select c1,c2 from t_day_7 where c2 < timestamp without time zone '2015-09-20' order by c2 desc limit 5;
select shardid,c2 from t_day_7 where c2 < timestamp without time zone '2015-09-20' order by c2 limit 5;
select shardid,c1+c3 from t_day_7 where c2 < timestamp without time zone '2015-09-20' order by c2 limit 5;
select shardid,c1+c3 from t_day_7 where c2 < timestamp without time zone '2015-09-20' order by c3,c2 limit 5;
select shardid,c1 from t_day_7 where c2 < timestamp without time zone '2015-09-20' and mod(c1,2) = 1 order by c1 desc limit 5;
drop index t_day_7_c3_c2;
drop table t_day_7;
-- 3 month interval --
create table t_month_3(c1 int, c2 timestamp without time zone, c3 int)
partition by range(c2) begin(timestamp without time zone '2015-01-01') step(interval '3 month') partitions(8)
distribute by shard(c1);
create index t_month_3_c1 on t_month_3(c1);
create index t_month_3_c2 on t_month_3(c2);
insert into t_month_3 values(1, timestamp without time zone '2015-01-01 13:11:00', 1);
insert into t_month_3 select generate_series(2,3), timestamp without time zone '2015-04-01 13:11:00', 1;
insert into t_month_3 select generate_series(4,7), timestamp without time zone '2015-07-01 13:11:00', 1;
insert into t_month_3 select generate_series(8,15), timestamp without time zone '2015-10-01 13:11:00', 1;
insert into t_month_3 select generate_series(16,31), timestamp without time zone '2016-01-01 13:11:00', 1;
insert into t_month_3 select generate_series(32,63), timestamp without time zone '2016-04-01 13:11:00', 1;
insert into t_month_3 select generate_series(64,127), timestamp without time zone '2016-07-01 13:11:00', 1;
insert into t_month_3 select generate_series(128,255), timestamp without time zone '2016-10-01 13:11:00', 1;
--create index when table is not empty--
create index t_month_3_c3_c2 on t_month_3(c3,c2);
--not-partition key --
select c1,c2 from t_month_3 where c2 < timestamp without time zone '2016-02-01' order by c1;
select c1,c2 from t_month_3 where c2 < timestamp without time zone '2016-02-01' order by c1 limit 5;
select shardid,c2 from t_month_3 where c2 < timestamp without time zone '2016-02-01' order by c1 limit 5;
select shardid,c1+c3 from t_month_3 where c2 < timestamp without time zone '2016-02-01' order by c1 limit 5;
--partition key --
select c1,c2 from t_month_3 where c2 < timestamp without time zone '2015-10-01' order by c1;
select c1,c2 from t_month_3 where c2 < timestamp without time zone '2016-02-01' order by c2 limit 5;
select c1,c2 from t_month_3 where c2 < timestamp without time zone '2016-02-01' order by c2 desc limit 5;
select shardid,c2 from t_month_3 where c2 < timestamp without time zone '2016-02-01' order by c2 limit 5;
select shardid,c1+c3 from t_month_3 where c2 < timestamp without time zone '2016-02-01' order by c2 limit 5;
select shardid,c1+c3 from t_month_3 where c2 < timestamp without time zone '2016-02-01' order by c3,c2 limit 5;
select shardid,c1 from t_month_3 where c2 < timestamp without time zone '2016-02-01' and mod(c1,2) = 1 order by c1 desc limit 5;
drop index t_month_3_c3_c2;
drop table t_month_3;
--add partition & drop partiton--
create table t_drop(f1 int not null,f2 timestamp not null,f3 varchar(10),primary key(f1)) partition by range (f2) begin (timestamp without time zone '2019-01-01 0:0:0') step (interval '1 month') partitions (2) distribute by shard(f1) to group default_group;
ALTER TABLE t_drop ADD PARTITIONS 2;
insert into t_drop select generate_series(1,10), timestamp without time zone '2019-01-31 23:23:59', 'aaa';
insert into t_drop select generate_series(11,30), timestamp without time zone '2019-02-01 10:23:59', 'aaa';
insert into t_drop select generate_series(31,50), timestamp without time zone '2019-03-31 23:23:59', 'aaa';
insert into t_drop select generate_series(51,100), timestamp without time zone '2019-04-01 00:00:00', 'aaa';
drop table t_drop_part_0;
drop table t_drop_part_1;
drop table t_drop_part_3;
create index t_drop_f3 on t_drop(f3);
create index t_drop_f2 on t_drop(f2);
insert into t_drop select generate_series(101,150), timestamp without time zone '2019-03-01 00:00:00', 'bbb';
select count(1) from t_drop where f2 >= timestamp without time zone '2019-02-01 00:00:00';
select count(1) from t_drop where f3 = 'aaa';
select * from t_drop where f3 = 'aaa' order by f1 limit 5;
ALTER TABLE t_drop ADD PARTITIONS 1;
insert into t_drop select generate_series(201,250), timestamp without time zone '2019-05-01 00:00:00', 'ccc';
select * from t_drop where f3 = 'ccc' order by f1 limit 5;
drop index t_drop_f2;
drop index t_drop_f3;
select count(1) from t_drop where f2 >= timestamp without time zone '2019-02-01 00:00:00';
select count(1) from t_drop where f3 = 'ccc';
drop table t_drop;
--int add partition & drop partiton--
create table int_drop(f1 bigint,f2 timestamp default now(), f3 integer) partition by range (f3) begin (1) step (50) partitions (2) distribute by shard(f1) to group default_group;
ALTER TABLE int_drop ADD PARTITIONS 2;
insert into int_drop select generate_series(1,10), null, 10;
insert into int_drop select generate_series(51,70), null, 80;
insert into int_drop select generate_series(101,120), null, 130;
insert into int_drop select generate_series(151,200), null, 190;
drop table int_drop_part_0;
drop table int_drop_part_1;
drop table int_drop_part_3;
create index int_drop_f3 on int_drop(f3);
create index int_drop_f2 on int_drop(f2);
insert into int_drop select generate_series(121,150), timestamp without time zone '2019-03-01 00:00:00', 145;
select count(1) from int_drop where f2 >= timestamp without time zone '2019-02-01 00:00:00';
select count(1) from int_drop where f3 = 145;
select * from int_drop where f3 = 145 order by f1 limit 5;
ALTER TABLE int_drop ADD PARTITIONS 1;
insert into int_drop select generate_series(201,250), timestamp without time zone '2019-05-01 00:00:00', 234;
select * from int_drop where f3 = 234 order by f1 limit 6;
drop index int_drop_f2;
drop index int_drop_f3;
select count(1) from int_drop where f2 >= timestamp without time zone '2019-02-01 00:00:00';
select count(1) from int_drop where f3 = 234;
drop table int_drop; | the_stack |
-- -----------------------------------------------------
-- Table `user`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `user` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`name` VARCHAR(64) NULL,
`email` VARCHAR(64) NOT NULL,
`phone` VARCHAR(64) NULL,
`password` VARCHAR(64) NOT NULL,
`password_salt` VARCHAR(64) NULL,
`last_login_time` DATETIME NULL,
`last_login_ip` VARCHAR(128) NULL,
`fail_count` TINYINT(3) NOT NULL DEFAULT 0,
`status` TINYINT(3) NOT NULL DEFAULT 0,
`create_date` DATETIME NULL,
`last_update` DATETIME NULL,
`password_date` DATETIME NULL,
PRIMARY KEY (`id`))
ENGINE = InnoDB;
CREATE INDEX `user_email_idx` ON `user` (`email` ASC);
CREATE INDEX `user_name_idx` ON `user` (`name` ASC);
CREATE INDEX `user_phone_idx` ON `user` (`phone` ASC);
-- -----------------------------------------------------
-- Table `grp`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `grp` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(128) NULL,
`code` VARCHAR(128) NOT NULL,
`description` VARCHAR(512) NULL,
`status` TINYINT(3) NOT NULL DEFAULT 0,
`create_date` DATETIME NULL,
`last_update` DATETIME NULL,
PRIMARY KEY (`id`))
ENGINE = InnoDB;
CREATE INDEX `group_name_idx` ON `grp` (`name` ASC);
CREATE UNIQUE INDEX `code_UNIQUE` ON `grp` (`code` ASC);
-- -----------------------------------------------------
-- Table `grp_path`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `grp_path` (
`ancestor` INT NOT NULL,
`descendant` INT NOT NULL,
`deepth` TINYINT(3) NOT NULL,
PRIMARY KEY (`ancestor`, `descendant`),
CONSTRAINT `fk_grp_path_grp1`
FOREIGN KEY (`ancestor`)
REFERENCES `grp` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_grp_path_grp2`
FOREIGN KEY (`descendant`)
REFERENCES `grp` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
CREATE INDEX `fk_grp_path_grp2_idx` ON `grp_path` (`descendant` ASC);
-- -----------------------------------------------------
-- Table `user_grp`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `user_grp` (
`user_id` BIGINT(20) NOT NULL,
`grp_id` INT NOT NULL,
`type` TINYINT(3) NOT NULL DEFAULT 0,
PRIMARY KEY (`user_id`, `grp_id`),
CONSTRAINT `fk_user_group_grp1`
FOREIGN KEY (`grp_id`)
REFERENCES `grp` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_user_grp_user1`
FOREIGN KEY (`user_id`)
REFERENCES `user` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
CREATE INDEX `fk_user_group_grp1_idx` ON `user_grp` (`grp_id` ASC);
CREATE INDEX `fk_user_grp_user1_idx` ON `user_grp` (`user_id` ASC);
-- -----------------------------------------------------
-- Table `domain`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `domain` (
`id` INT NOT NULL AUTO_INCREMENT,
`code` VARCHAR(64) NOT NULL,
`display_name` VARCHAR(128) NOT NULL,
`description` VARCHAR(512) NULL,
`status` TINYINT(3) NOT NULL DEFAULT 0,
`create_date` DATETIME NULL,
`last_update` DATETIME NULL,
PRIMARY KEY (`id`))
ENGINE = InnoDB;
CREATE UNIQUE INDEX `name_UNIQUE` ON `domain` (`code` ASC);
CREATE UNIQUE INDEX `display_name_UNIQUE` ON `domain` (`display_name` ASC);
-- -----------------------------------------------------
-- Table `role_code`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `role_code` (
`id` INT NOT NULL AUTO_INCREMENT COMMENT 'ADMIN, USER, VIEW',
`code` VARCHAR(32) NOT NULL COMMENT 'ADMIN, USER, VIEW',
PRIMARY KEY (`id`))
ENGINE = InnoDB;
CREATE UNIQUE INDEX `code_UNIQUE` ON `role_code` (`code` ASC);
-- -----------------------------------------------------
-- Table `role`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `role` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(64) NULL,
`description` VARCHAR(512) NULL,
`status` TINYINT(3) NOT NULL DEFAULT 0,
`domain_id` INT NOT NULL,
`role_code_id` INT NOT NULL,
PRIMARY KEY (`id`),
CONSTRAINT `fk_role_domain1`
FOREIGN KEY (`domain_id`)
REFERENCES `domain` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_role_role_code1`
FOREIGN KEY (`role_code_id`)
REFERENCES `role_code` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
CREATE INDEX `fk_role_domain1_idx` ON `role` (`domain_id` ASC);
CREATE INDEX `fk_role_role_code1_idx` ON `role` (`role_code_id` ASC);
CREATE UNIQUE INDEX `domain_rolename_unique` ON `role` (`domain_id` ASC, `name` ASC);
-- -----------------------------------------------------
-- Table `user_role`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `user_role` (
`user_id` BIGINT(20) NOT NULL,
`role_id` INT NOT NULL,
PRIMARY KEY (`user_id`, `role_id`),
CONSTRAINT `fk_user_role_user1`
FOREIGN KEY (`user_id`)
REFERENCES `user` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_user_role_role1`
FOREIGN KEY (`role_id`)
REFERENCES `role` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
CREATE INDEX `fk_user_role_user1_idx` ON `user_role` (`user_id` ASC);
CREATE INDEX `fk_user_role_role1_idx` ON `user_role` (`role_id` ASC);
-- -----------------------------------------------------
-- Table `perm_type`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `perm_type` (
`id` INT NOT NULL AUTO_INCREMENT COMMENT 'URIPATTERN',
`type` VARCHAR(32) NOT NULL COMMENT 'URI_PATTERN',
PRIMARY KEY (`id`))
ENGINE = InnoDB;
CREATE UNIQUE INDEX `type_UNIQUE` ON `perm_type` (`type` ASC);
-- -----------------------------------------------------
-- Table `permission`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `permission` (
`id` INT NOT NULL AUTO_INCREMENT,
`value` VARCHAR(128) NULL,
`description` VARCHAR(512) NULL,
`status` TINYINT(3) NOT NULL DEFAULT 0,
`perm_type_id` INT NOT NULL,
`domain_id` INT NOT NULL,
PRIMARY KEY (`id`),
CONSTRAINT `fk_permission_perm_type1`
FOREIGN KEY (`perm_type_id`)
REFERENCES `perm_type` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_permission_domain1`
FOREIGN KEY (`domain_id`)
REFERENCES `domain` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
CREATE INDEX `fk_permission_perm_type1_idx` ON `permission` (`perm_type_id` ASC);
CREATE INDEX `fk_permission_domain1_idx` ON `permission` (`domain_id` ASC);
CREATE UNIQUE INDEX `perm_unique` ON `permission` (`value` ASC, `perm_type_id` ASC, `domain_id` ASC);
-- -----------------------------------------------------
-- Table `grp_role`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `grp_role` (
`grp_id` INT NOT NULL,
`role_id` INT NOT NULL,
PRIMARY KEY (`grp_id`, `role_id`),
CONSTRAINT `fk_group_domain_role_acl_role1`
FOREIGN KEY (`role_id`)
REFERENCES `role` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_group_role_grp1`
FOREIGN KEY (`grp_id`)
REFERENCES `grp` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
CREATE INDEX `fk_group_domain_role_acl_role1_idx` ON `grp_role` (`role_id` ASC);
CREATE INDEX `fk_group_role_grp1_idx` ON `grp_role` (`grp_id` ASC);
-- -----------------------------------------------------
-- Table `role_permission`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `role_permission` (
`role_id` INT NOT NULL,
`permission_id` INT NOT NULL,
PRIMARY KEY (`role_id`, `permission_id`),
CONSTRAINT `fk_role_permission_role1`
FOREIGN KEY (`role_id`)
REFERENCES `role` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_role_permission_permission1`
FOREIGN KEY (`permission_id`)
REFERENCES `permission` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
CREATE INDEX `fk_role_permission_role1_idx` ON `role_permission` (`role_id` ASC);
CREATE INDEX `fk_role_permission_permission1_idx` ON `role_permission` (`permission_id` ASC);
-- -----------------------------------------------------
-- Table `audit`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `audit` (
`id` INT NOT NULL AUTO_INCREMENT,
`user_id` BIGINT(20) NOT NULL,
`obj_id` BIGINT(20) NULL,
`obj_name` VARCHAR(32) NULL,
`action_date` DATETIME NULL,
`action` TINYINT(2) NULL COMMENT 'how',
`before_action` VARCHAR(1000) NULL,
`after_action` VARCHAR(1000) NULL,
`client_ip` VARCHAR(128) NULL,
PRIMARY KEY (`id`))
ENGINE = InnoDB;
CREATE INDEX `audit_userid_idx` ON `audit` (`user_id` ASC);
CREATE INDEX `audit_action_date` ON `audit` (`action_date` ASC);
-- -----------------------------------------------------
-- Table `stakeholder`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `stakeholder` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(64) NULL,
`email` VARCHAR(64) NULL,
`phone` VARCHAR(64) NULL,
`jobtitle` VARCHAR(64) NULL,
`domain_id` INT NOT NULL,
PRIMARY KEY (`id`),
CONSTRAINT `fk_stakeholder_domain1`
FOREIGN KEY (`domain_id`)
REFERENCES `domain` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
CREATE INDEX `fk_stakeholder_domain1_idx` ON `stakeholder` (`domain_id` ASC);
alter table `user` AUTO_INCREMENT=200000000;
alter table `role_code` add column `description` VARCHAR(512) NULL AFTER `code`;
insert into `role_code`(`code`, `description`) values ('ROLE_SUPER_ADMIN', '超级管理员');
insert into `role_code`(`code`, `description`) values ('ROLE_ADMIN', '管理员');
insert into `role_code`(`code`, `description`) values ('ROLE_NORMAL', '普通用户');
insert into `role_code`(`code`, `description`) values ('ROLE_GUEST', 'Guest用户');
insert into `perm_type`(`id`, `type`) values (1, 'DOMAIN');
insert into `perm_type`(`id`, `type`) values (2, 'URI_PATTERN');
insert into user(id, name, email, phone, password, password_salt, last_login_time, last_login_ip, fail_count, status, create_date, last_update, password_date)
values('200000001', 'guige', 'first.admin@test.com', '13011111111', 'GRodddDAZjK2tGZ6kT7ImP8ILwU=', 'I9JTzG2zzBAW3Q5NvP8lRg==', now(), '192.168.18.5', '0', '0', now(), now(), now());
insert into grp(id, name, code, description,status, create_date, last_update) values(1, '点融', 'GRP_ROOT','点融根组', 0, now(), now());
insert into grp(id, name, code, description,status, create_date, last_update) values(2, 'techops超级管理员组', 'GRP_TECHOPS_SUPER_ADMIN','techops超级管理员组,组内的人期拥有techops顶级权限', 0, now(), now());
insert into grp_path(ancestor, descendant, deepth) values(1, 1, 0);
insert into grp_path(ancestor, descendant, deepth) values(1, 2, 1);
insert into grp_path(ancestor, descendant, deepth) values(2, 2, 0);
insert into user_grp(user_id, grp_id, type) values(200000001, 2, 0);
insert into user_grp(user_id, grp_id, type) values(200000001, 1, 1);
insert into domain(id, code, display_name, description, status, create_date, last_update) values(1, 'techops', '权限管理系统', '点融权限管理系统,管理各个子系统的权限和资源访问', 0, now(), now());
insert into role(id, name,description, status, domain_id, role_code_id) values(1, 'techops超级管理员角色', 'techops超级管理员角色,管理所有其他域的权限', 0, 1, 1);
insert into permission(id, value, description, status, perm_type_id, domain_id) values(1, 'techops', '拥有techops整个域的permission,在techops上可进行任何操作(管理组需要额外配置)',0,1,1);
insert into role_permission(role_id, permission_id) values(1, 1);
insert into grp_role(grp_id, role_id) values(2, 1);
-- change the primarykey of user_grp
ALTER TABLE `user_grp` CHANGE COLUMN `type` `type` TINYINT(3) NOT NULL ,DROP PRIMARY KEY,ADD PRIMARY KEY (`user_id`, `grp_id`, `type`);
alter table `audit` add column `req_uuid` varchar(128) not null;
alter table `audit` add column `req_url` varchar(256) not null;
alter table `audit` add column `req_success` tinyint(3) not null;
alter table `audit` add column `req_exp` varchar(1024);
drop table if exists audit;
CREATE TABLE `audit` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) DEFAULT NULL,
`req_date` datetime DEFAULT NULL,
`domain_id` int(11) default null,
`req_ip` varchar(128) DEFAULT NULL,
`req_uuid` varchar(128) DEFAULT NULL,
`req_url` varchar(64) DEFAULT NULL,
`req_seq` bigint(20) DEFAULT NULL,
`req_class` varchar(64) DEFAULT NULL,
`req_method` varchar(64) DEFAULT NULL,
`req_success` tinyint(3) DEFAULT NULL,
`req_exp` varchar(3072) DEFAULT NULL,
`req_elapse` bigint(20) DEFAULT NULL,
`req_param` varchar(256) DEFAULT NULL,
`req_result` varchar(1024) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
delete from user_grp where user_id > 0;
delete from grp_role where grp_id > 0;
delete from grp_path where ancestor > 0;
alter table `user` AUTO_INCREMENT=300000010;
update user set id = 300000001 where id = 200000001;
alter table `grp` AUTO_INCREMENT=100010;
update grp set id = 100001 where id = 1;
update grp set id = 100002 where id = 2;
insert into grp_path(ancestor, descendant, deepth) values(100001, 100001, 0);
insert into grp_path(ancestor, descendant, deepth) values(100001, 100002, 1);
insert into grp_path(ancestor, descendant, deepth) values(100002, 100002, 0);
insert into user_grp(user_id, grp_id, type) values(300000001, 100002, 0);
insert into user_grp(user_id, grp_id, type) values(300000001, 100001, 1);
insert into grp_role(grp_id, role_id) values(100002, 1);
CREATE TABLE `cfg` (
`id` int(11) NOT NULL,
`key` varchar(64) NOT NULL,
`type` varchar(16) NOT NULL,
`value` varchar(512) DEFAULT NULL,
`file` blob,
PRIMARY KEY (`id`),
UNIQUE KEY `key_UNIQUE` (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- DDL BEGIN:
ALTER TABLE `grp` DROP INDEX `code_UNIQUE`;
ALTER TABLE `domain` DROP INDEX `name_UNIQUE`;
ALTER TABLE `domain` DROP INDEX `display_name_UNIQUE`;
ALTER TABLE `role` DROP INDEX `domain_rolename_unique`;
ALTER TABLE `permission` DROP INDEX `perm_unique`;
ALTER TABLE `cfg` CHANGE COLUMN `id` `id` INT(11) NOT NULL AUTO_INCREMENT ;
drop table `cfg`;
CREATE TABLE IF NOT EXISTS `cfg_type` (
`id` INT NOT NULL AUTO_INCREMENT COMMENT '数据库自动生成唯一id',
`code` VARCHAR(32) NOT NULL COMMENT '唯一的配置类型值',
PRIMARY KEY (`id`))
ENGINE = InnoDB DEFAULT CHARACTER SET = utf8;
CREATE UNIQUE INDEX `cfg_type_UNIQUE` ON `cfg_type` (`code` ASC);
CREATE TABLE IF NOT EXISTS `cfg` (
`id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '数据库自动生成唯一id',
`cfg_key` VARCHAR(64) NOT NULL COMMENT '唯一的配置值',
`value` VARCHAR(512) NOT NULL COMMENT '如果cfg_type code为FILE则该值为文件名, 如果cfg_type code为TEXT, 则该值为正常value',
`file` MEDIUMBLOB NULL DEFAULT NULL COMMENT '用于存放文件的字段, 最大16MB',
`cfg_type_id` INT NOT NULL COMMENT '用于表示存放的cfg的type, FILE或者TEXT',
PRIMARY KEY (`id`),
UNIQUE INDEX `cfg_key_UNIQUE` (`cfg_key` ASC),
INDEX `fk_cfg_cfg_type1_idx` (`cfg_type_id` ASC),
CONSTRAINT `fk_cfg_cfg_type1`
FOREIGN KEY (`cfg_type_id`)
REFERENCES `cfg_type` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
-- DDL END
-- DML BEGIN:
BEGIN;
insert into `role_code`(`code`, `description`) values ('ROLE_GRAND_MASTER', '宗师');
insert into `role_code`(`code`, `description`) values ('ROLE_MASTER', '大师');
insert into `role_code`(`code`, `description`) values ('ROLE_DIAMOND', '钻石');
insert into `role_code`(`code`, `description`) values ('ROLE_PLATINUM', '白金');
insert into `role_code`(`code`, `description`) values ('ROLE_GOLD', '黄金');
insert into `role_code`(`code`, `description`) values ('ROLE_SILVER', '白银');
insert into `role_code`(`code`, `description`) values ('ROLE_BRONZE', '青铜');
insert into `role_code`(`code`, `description`) values ('ROLE_STEEL', '钢铁');
insert into `cfg_type`(`code`) values ('FILE');
insert into `cfg_type`(`code`) values ('TEXT');
select @cfg_file_id := (select id from `cfg_type` where code='FILE');
select @cfg_text_id := (select id from `cfg_type` where code='TEXT');
insert into `cfg`(`cfg_key`,`value`,`file`,`cfg_type_id`) values ('TECHOPS_LOGO', 'logo.png', null, @cfg_file_id);
insert into `cfg`(`cfg_key`,`value`,`file`,`cfg_type_id`) values ('TECHOPS_ICON', 'favicon.png', null, @cfg_file_id);
insert into `cfg`(`cfg_key`,`value`,`file`,`cfg_type_id`) values ('TECHOPS_TITLE', '点融-权限运维系统', null, @cfg_text_id);
insert into `perm_type`(`id`, `type`) values (3, 'PRIVILEGE');
COMMIT;
ALTER TABLE `permission` ADD COLUMN `value_ext` VARCHAR(128) NULL AFTER `value`;
CREATE TABLE IF NOT EXISTS `tag_type` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`code` VARCHAR(32) NOT NULL,
`domain_id` INT(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `code_UNIQUE` (`code` ASC),
CONSTRAINT `fk_tag_type_domain`
FOREIGN KEY (`domain_id`)
REFERENCES `domain` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
CREATE TABLE IF NOT EXISTS `tag` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`code` VARCHAR(64) NULL,
`status` TINYINT(3) NOT NULL,
`description` VARCHAR(512) NULL,
`tag_type_id` INT(11) NOT NULL,
`create_date` DATETIME NULL,
`last_update` DATETIME NULL,
PRIMARY KEY (`id`),
INDEX `fk_tag_code_idx` (`code` ASC),
CONSTRAINT `fk_tag_type`
FOREIGN KEY (`tag_type_id`)
REFERENCES `tag_type` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
CREATE TABLE IF NOT EXISTS `user_tag` (
`tag_id` INT(11) NOT NULL,
`user_id` BIGINT(20) NOT NULL,
PRIMARY KEY (`tag_id`, `user_id`),
INDEX `fk_user_tag_user1_idx` (`user_id` ASC),
INDEX `fk_tag_user_tag1_idx` (`tag_id` ASC),
CONSTRAINT `fk_user_tag_tag1`
FOREIGN KEY (`tag_id`)
REFERENCES `tag` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_user_tag_user1`
FOREIGN KEY (`user_id`)
REFERENCES `user` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
ALTER TABLE `grp_path` ADD INDEX `fk_path_grp_path2_idx` (`ancestor` ASC);
-- insert into tag_type(`code`) values ('TITLE');
CREATE TABLE IF NOT EXISTS `grp_tag` (
`tag_id` INT(11) NOT NULL,
`grp_id` INT(11) NOT NULL,
INDEX `fk_tag_grp_tag1_idx` (`tag_id` ASC),
PRIMARY KEY (`grp_id`, `tag_id`),
INDEX `fk_grp_tag_grp1_idx` (`grp_id` ASC),
CONSTRAINT `fk_tag_grp_tag1`
FOREIGN KEY (`tag_id`)
REFERENCES `tag` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_tag_grp_grp1`
FOREIGN KEY (`grp_id`)
REFERENCES `grp` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
CREATE TABLE `user_extend` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '逻辑主键',
`code` varchar(50) NOT NULL COMMENT '扩展属性代码(名称)',
`description` varchar(200) NOT NULL DEFAULT '' COMMENT '扩展属性描述',
PRIMARY KEY (`id`)
) ENGINE=InnoDB COMMENT='用户扩展属性主表';
CREATE TABLE `user_extend_val` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '逻辑主键',
`user_id` bigint(20) NOT NULL COMMENT '用户id',
`extend_id` bigint(20) NOT NULL COMMENT '扩展属性id',
`value_` varchar(200) NOT NULL DEFAULT '' COMMENT '扩展属性值',
`status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '扩展属性状态:0-启用、1-禁用',
PRIMARY KEY (`id`),
KEY `fk_user_extend_val_user_id` (`user_id`),
KEY `fk_user_extend_val_user_extend_id` (`extend_id`),
CONSTRAINT `fk_user_extend_val_user_extend_id` FOREIGN KEY (`extend_id`) REFERENCES `user_extend` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_user_extend_val_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB COMMENT='用户扩展属性值表';
ALTER TABLE audit COMMENT='用于记录整个系统操作日志';
ALTER TABLE cfg COMMENT='系统产品定制化配置表';
ALTER TABLE cfg_type COMMENT='产品定制化配置的code';
ALTER TABLE `domain` COMMENT='被集成系统表';
ALTER TABLE grp COMMENT='组';
ALTER TABLE grp_path COMMENT='组与组之间层级关系表';
ALTER TABLE grp_role COMMENT='组与角色之间的多对多关联关系表';
ALTER TABLE grp_tag COMMENT='组与tag之间的多对多关联关系表';
ALTER TABLE permission COMMENT='权限表';
ALTER TABLE perm_type COMMENT='权限类别表';
ALTER TABLE role COMMENT='角色表';
ALTER TABLE role_code COMMENT='角色对应的code枚举表,用于springsecurity hasRole方法判断用户是否有权限';
ALTER TABLE role_permission COMMENT='角色与权限的多对多关联表';
ALTER TABLE stakeholder COMMENT='集成系统的利益相关者表';
ALTER TABLE tag COMMENT='标签';
ALTER TABLE `tag_type` COMMENT='标签类别';
ALTER TABLE `user` COMMENT='用户表';
ALTER TABLE user_grp COMMENT='用户与组的多对多关联关系表';
ALTER TABLE user_role COMMENT='用户与角色的多对多关联关系表';
ALTER TABLE user_tag COMMENT='用户与标签的多对多关联关系表';
INSERT INTO user_extend(code, description) SELECT 'cast_wechat_id','openid' FROM DUAL WHERE NOT EXISTS(SELECT id FROM user_extend WHERE code = 'cast_wechat_id');
alter table tag_type drop index `code_UNIQUE`;
alter table tag_type add unique key `code_domainid_UNIQUE` (`code`,`domain_id`) comment 'update table tag_type unique_key from code to code + domain_id';
ALTER TABLE `domain`
CHANGE COLUMN `id` `id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '主键,数据库自动生成' ,
CHANGE COLUMN `code` `code` VARCHAR(64) NOT NULL COMMENT '域编码' ,
CHANGE COLUMN `display_name` `display_name` VARCHAR(128) NOT NULL COMMENT '显示名称' ,
CHANGE COLUMN `description` `description` VARCHAR(512) NULL DEFAULT NULL COMMENT '域描述' ,
CHANGE COLUMN `status` `status` TINYINT(3) NOT NULL DEFAULT '0' COMMENT '状态' ,
CHANGE COLUMN `create_date` `create_date` DATETIME NULL DEFAULT NULL COMMENT '创建时间' ,
CHANGE COLUMN `last_update` `last_update` DATETIME NULL DEFAULT NULL COMMENT '最后更新时间' ;
ALTER TABLE `grp`
CHANGE COLUMN `id` `id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '组的id,唯一键' ,
CHANGE COLUMN `name` `name` VARCHAR(128) NULL DEFAULT NULL COMMENT '组名称' ,
CHANGE COLUMN `code` `code` VARCHAR(128) NOT NULL COMMENT '组编码' ,
CHANGE COLUMN `description` `description` VARCHAR(512) NULL DEFAULT NULL COMMENT '组描述' ,
CHANGE COLUMN `status` `status` TINYINT(3) NOT NULL DEFAULT '0' COMMENT '状态' ,
CHANGE COLUMN `create_date` `create_date` DATETIME NULL DEFAULT NULL COMMENT '创建时间' ,
CHANGE COLUMN `last_update` `last_update` DATETIME NULL DEFAULT NULL COMMENT '最后修改时间' ;
ALTER TABLE `grp_role`
CHANGE COLUMN `grp_id` `grp_id` INT(11) NOT NULL COMMENT '组的id' ,
CHANGE COLUMN `role_id` `role_id` INT(11) NOT NULL COMMENT '角色的id' ;
ALTER TABLE `grp_tag`
CHANGE COLUMN `tag_id` `tag_id` INT(11) NOT NULL COMMENT '标签的id' ,
CHANGE COLUMN `grp_id` `grp_id` INT(11) NOT NULL COMMENT '组的id' ;
ALTER TABLE `grp_path`
CHANGE COLUMN `ancestor` `ancestor` INT(11) NOT NULL COMMENT '父节点id' ,
CHANGE COLUMN `descendant` `descendant` INT(11) NOT NULL COMMENT '子节点id' ,
CHANGE COLUMN `deepth` `deepth` TINYINT(3) NOT NULL COMMENT '树的深度' ;
ALTER TABLE `grp_role`
CHANGE COLUMN `grp_id` `grp_id` INT(11) NOT NULL COMMENT '组id,外键' ,
CHANGE COLUMN `role_id` `role_id` INT(11) NOT NULL COMMENT '角色id,外键' ;
ALTER TABLE `grp_tag`
CHANGE COLUMN `tag_id` `tag_id` INT(11) NOT NULL COMMENT '标签id,外键' ,
CHANGE COLUMN `grp_id` `grp_id` INT(11) NOT NULL COMMENT '组id,外键' ;
ALTER TABLE `permission`
CHANGE COLUMN `id` `id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '主键' ,
CHANGE COLUMN `value` `value` VARCHAR(128) NULL DEFAULT NULL COMMENT '权限值' ,
CHANGE COLUMN `value_ext` `value_ext` VARCHAR(128) NULL DEFAULT NULL COMMENT '权限扩展值' ,
CHANGE COLUMN `description` `description` VARCHAR(512) NULL DEFAULT NULL COMMENT '权限描述' ,
CHANGE COLUMN `status` `status` TINYINT(3) NOT NULL DEFAULT '0' COMMENT '状态' ,
CHANGE COLUMN `perm_type_id` `perm_type_id` INT(11) NOT NULL COMMENT '权限类型,外键' ,
CHANGE COLUMN `domain_id` `domain_id` INT(11) NOT NULL COMMENT '域的id' ;
ALTER TABLE `perm_type`
CHANGE COLUMN `id` `id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '主键,数据库自动生成' ,
CHANGE COLUMN `type` `type` VARCHAR(32) NOT NULL COMMENT '权限类型' ;
ALTER TABLE `stakeholder`
CHANGE COLUMN `id` `id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '主键,数据库自动生成' ,
CHANGE COLUMN `name` `name` VARCHAR(64) NULL DEFAULT NULL COMMENT '名称' ,
CHANGE COLUMN `email` `email` VARCHAR(64) NULL DEFAULT NULL COMMENT '邮箱' ,
CHANGE COLUMN `phone` `phone` VARCHAR(64) NULL DEFAULT NULL COMMENT '电话号码' ,
CHANGE COLUMN `jobtitle` `jobtitle` VARCHAR(64) NULL DEFAULT NULL COMMENT '职位' ,
CHANGE COLUMN `domain_id` `domain_id` INT(11) NOT NULL COMMENT '域id,外键' ;
ALTER TABLE `role`
CHANGE COLUMN `id` `id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '主键' ,
CHANGE COLUMN `name` `name` VARCHAR(64) NULL DEFAULT NULL COMMENT '角色名称' ,
CHANGE COLUMN `description` `description` VARCHAR(512) NULL DEFAULT NULL COMMENT '角色描述' ,
CHANGE COLUMN `status` `status` TINYINT(3) NOT NULL DEFAULT '0' COMMENT '状态' ,
CHANGE COLUMN `domain_id` `domain_id` INT(11) NOT NULL COMMENT '域的id,外键' ,
CHANGE COLUMN `role_code_id` `role_code_id` INT(11) NOT NULL COMMENT '角色code,外键' ;
ALTER TABLE `role_code`
CHANGE COLUMN `id` `id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '主键' ,
CHANGE COLUMN `code` `code` VARCHAR(32) NOT NULL COMMENT '角色编码' ,
CHANGE COLUMN `description` `description` VARCHAR(512) NULL DEFAULT NULL COMMENT '描述' ;
ALTER TABLE `role_permission`
CHANGE COLUMN `role_id` `role_id` INT(11) NOT NULL COMMENT '角色id,外键' ,
CHANGE COLUMN `permission_id` `permission_id` INT(11) NOT NULL COMMENT '权限的id,外键' ;
ALTER TABLE `tag`
CHANGE COLUMN `id` `id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '主键' ,
CHANGE COLUMN `code` `code` VARCHAR(64) NULL DEFAULT NULL COMMENT '标签的编码' ,
CHANGE COLUMN `status` `status` TINYINT(3) NOT NULL COMMENT '标签的状态' ,
CHANGE COLUMN `description` `description` VARCHAR(512) NULL DEFAULT NULL COMMENT '标签描述' ,
CHANGE COLUMN `tag_type_id` `tag_type_id` INT(11) NOT NULL COMMENT '标签类型,外键' ,
CHANGE COLUMN `create_date` `create_date` DATETIME NULL DEFAULT NULL COMMENT '创建时间' ,
CHANGE COLUMN `last_update` `last_update` DATETIME NULL DEFAULT NULL COMMENT '最后更新时间' ;
ALTER TABLE `tag_type`
CHANGE COLUMN `id` `id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '主键' ,
CHANGE COLUMN `code` `code` VARCHAR(32) NOT NULL COMMENT '标签类型编码' ,
CHANGE COLUMN `domain_id` `domain_id` INT(11) NOT NULL COMMENT '关联的域,外键' ;
ALTER TABLE `user`
CHANGE COLUMN `id` `id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '主键' ,
CHANGE COLUMN `name` `name` VARCHAR(64) NULL DEFAULT NULL COMMENT '用户姓名' ,
CHANGE COLUMN `email` `email` VARCHAR(64) NOT NULL COMMENT '用户邮箱' ,
CHANGE COLUMN `phone` `phone` VARCHAR(64) NULL DEFAULT NULL COMMENT '电话号码' ,
CHANGE COLUMN `password` `password` VARCHAR(64) NOT NULL COMMENT '密码' ,
CHANGE COLUMN `last_login_time` `last_login_time` DATETIME NULL DEFAULT NULL COMMENT '最后一次登录的时间' ,
CHANGE COLUMN `last_login_ip` `last_login_ip` VARCHAR(128) NULL DEFAULT NULL COMMENT '最后一次登录然ip' ,
CHANGE COLUMN `fail_count` `fail_count` TINYINT(3) NOT NULL DEFAULT '0' COMMENT '失败的次数' ,
CHANGE COLUMN `status` `status` TINYINT(3) NOT NULL DEFAULT '0' COMMENT '状态' ,
CHANGE COLUMN `create_date` `create_date` DATETIME NULL DEFAULT NULL COMMENT '创建时间 ' ,
CHANGE COLUMN `last_update` `last_update` DATETIME NULL DEFAULT NULL COMMENT '最后更新时间' ,
CHANGE COLUMN `password_date` `password_date` DATETIME NULL DEFAULT NULL COMMENT '更新密码的时间' ;
ALTER TABLE `user_grp`
CHANGE COLUMN `user_id` `user_id` BIGINT(20) NOT NULL COMMENT '用户id,外键' ,
CHANGE COLUMN `grp_id` `grp_id` INT(11) NOT NULL COMMENT '对应组的id,外键' ,
CHANGE COLUMN `type` `type` TINYINT(3) NOT NULL COMMENT '类型,(0表示普通会员,1表示owner)' ;
ALTER TABLE `user_role`
CHANGE COLUMN `user_id` `user_id` BIGINT(20) NOT NULL COMMENT '用户id,外键' ,
CHANGE COLUMN `role_id` `role_id` INT(11) NOT NULL COMMENT '角色id,外键' ;
ALTER TABLE `audit`
CHANGE COLUMN `user_id` `user_id` BIGINT(20) NULL DEFAULT NULL COMMENT '用户id' ,
CHANGE COLUMN `req_date` `req_date` DATETIME NULL DEFAULT NULL COMMENT '访问时间' ,
CHANGE COLUMN `domain_id` `domain_id` INT(11) NULL DEFAULT NULL COMMENT '域id' ,
CHANGE COLUMN `req_ip` `req_ip` VARCHAR(128) NULL DEFAULT NULL COMMENT '访问者ip' ,
CHANGE COLUMN `req_url` `req_url` VARCHAR(64) NULL DEFAULT NULL COMMENT '访问的url' ,
CHANGE COLUMN `req_seq` `req_seq` BIGINT(20) NULL DEFAULT NULL COMMENT '访问的序号' ,
CHANGE COLUMN `req_class` `req_class` VARCHAR(64) NULL DEFAULT NULL COMMENT '访问对应的类' ,
CHANGE COLUMN `req_method` `req_method` VARCHAR(64) NULL DEFAULT NULL COMMENT '访问对应的方法' ,
CHANGE COLUMN `req_success` `req_success` TINYINT(3) NULL DEFAULT NULL COMMENT '请求是否成功' ,
CHANGE COLUMN `req_exp` `req_exp` VARCHAR(3072) NULL DEFAULT NULL COMMENT '请求产生的异常信息' ,
CHANGE COLUMN `req_elapse` `req_elapse` BIGINT(20) NULL DEFAULT NULL COMMENT '处理请求所用的时间(ms)' ,
CHANGE COLUMN `req_param` `req_param` VARCHAR(256) NULL DEFAULT NULL COMMENT '请求的参数' ,
CHANGE COLUMN `req_result` `req_result` VARCHAR(1024) NULL DEFAULT NULL COMMENT '请求的返回结果' ;
-- -----------------------------------------------------
-- Table `tenancy`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `tenancy` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT comment '租户主键id',
`code` VARCHAR(30) NOT NULL comment '每一个租户的唯一标识code',
`name` VARCHAR(64) NULL comment '租户名称,比如点融',
`contact_name` VARCHAR(30) NULL comment '租户联系人姓名',
`phone` VARCHAR(30) NULL comment '租户联系电话',
`description` VARCHAR(200) NULL comment '租户描述',
`status` TINYINT(3) NOT NULL comment '状态,0:启用,1:禁用' DEFAULT 0,
`create_date` DATETIME NULL comment '租户创建时间',
`last_update` DATETIME NULL comment '最新更新时间',
PRIMARY KEY (`id`)
)ENGINE = InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `tenancy` (`code`, `name`, `contact_name`, `phone`,`description`, `create_date`, `last_update` )
VALUES('DIANRONG-WEBSITE' , '点融', '点融', '400-921-9218', '点融', now(), now());
-- update table structure
alter table cfg add tenancy_id BIGINT(20) NOT NULL DEFAULT 0 comment '租户id' after cfg_type_id ;
alter table cfg add index cfg_tenancy_id (tenancy_id) comment '根据租户id查询的索引';
alter table domain add tenancy_id BIGINT(20) NOT NULL DEFAULT 0 comment '租户id' after status ;
alter table domain add index domain_tenancy_id (tenancy_id) comment '根据租户id查询的索引';
alter table grp add tenancy_id BIGINT(20) NOT NULL DEFAULT 0 comment '租户id' after status ;
alter table grp add index grp_tenancy_id (tenancy_id) comment '根据租户id查询的索引';
alter table permission add tenancy_id BIGINT(20) NOT NULL DEFAULT 0 comment '租户id' after domain_id ;
alter table permission add index permission_tenancy_id (tenancy_id) comment '根据租户id查询的索引';
alter table role add tenancy_id BIGINT(20) NOT NULL DEFAULT 0 comment '租户id' after role_code_id ;
alter table role add index role_tenancy_id (tenancy_id) comment '根据租户id查询的索引';
alter table stakeholder add tenancy_id BIGINT(20) NOT NULL DEFAULT 0 comment '租户id' after domain_id ;
alter table stakeholder add index stakeholder_tenancy_id (tenancy_id) comment '根据租户id查询的索引';
alter table tag add tenancy_id BIGINT(20) NOT NULL DEFAULT 0 comment '租户id' after tag_type_id ;
alter table tag add index tag_tenancy_id (tenancy_id) comment '根据租户id查询的索引';
alter table tag_type add tenancy_id BIGINT(20) NOT NULL DEFAULT 0 comment '租户id' after domain_id;
alter table tag_type add index tag_type_tenancy_id (tenancy_id) comment '根据租户id查询的索引';
alter table `user` add tenancy_id BIGINT(20) NOT NULL DEFAULT 0 comment '租户id' after status ;
alter table `user` add index user_tenancy_id (tenancy_id) comment '根据租户id查询的索引';
alter table user_extend add tenancy_id BIGINT(20) NOT NULL DEFAULT 0 comment '租户id' after description ;
alter table user_extend add index user_extend_tenancy_id (tenancy_id) comment '根据租户id查询的索引';
alter table user_extend_val add tenancy_id BIGINT(20) NOT NULL DEFAULT 0 comment '租户id' after status ;
alter table user_extend_val add index user_extend_val_tenancy_id (tenancy_id) comment '根据租户id查询的索引';
-- init data
set sql_safe_updates = 0;
update cfg INNER JOIN tenancy ON tenancy.code='DIANRONG-WEBSITE' SET cfg.tenancy_id = tenancy.id;
update domain INNER JOIN tenancy ON tenancy.code='DIANRONG-WEBSITE' SET domain.tenancy_id = tenancy.id;
update grp INNER JOIN tenancy ON tenancy.code='DIANRONG-WEBSITE' SET grp.tenancy_id = tenancy.id;
update permission INNER JOIN tenancy ON tenancy.code='DIANRONG-WEBSITE' SET permission.tenancy_id = tenancy.id;
update role INNER JOIN tenancy ON tenancy.code='DIANRONG-WEBSITE' SET role.tenancy_id = tenancy.id;
update stakeholder INNER JOIN tenancy ON tenancy.code='DIANRONG-WEBSITE' SET stakeholder.tenancy_id = tenancy.id;
update tag INNER JOIN tenancy ON tenancy.code='DIANRONG-WEBSITE' SET tag.tenancy_id = tenancy.id;
update tag_type INNER JOIN tenancy ON tenancy.code='DIANRONG-WEBSITE' SET tag_type.tenancy_id = tenancy.id;
update `user` INNER JOIN tenancy ON tenancy.code='DIANRONG-WEBSITE' SET `user`.tenancy_id = tenancy.id;
update user_extend INNER JOIN tenancy ON tenancy.code='DIANRONG-WEBSITE' SET user_extend.tenancy_id = tenancy.id;
update user_extend_val INNER JOIN tenancy ON tenancy.code='DIANRONG-WEBSITE' SET user_extend_val.tenancy_id = tenancy.id;
-- add foreign key
alter table cfg add constraint fk_cfg_tenancy foreign key(tenancy_id) references tenancy(id);
alter table domain add constraint fk_domain_tenancy foreign key(tenancy_id) references tenancy(id);
alter table grp add constraint fk_grp_tenancy foreign key(tenancy_id) references tenancy(id);
alter table permission add constraint fk_permission_tenancy foreign key(tenancy_id) references tenancy(id);
alter table role add constraint fk_role_tenancy foreign key(tenancy_id) references tenancy(id);
alter table stakeholder add constraint fk_stakeholder_tenancy foreign key(tenancy_id) references tenancy(id);
alter table tag add constraint fk_tag_tenancy foreign key(tenancy_id) references tenancy(id);
alter table tag_type add constraint fk_tag_type_tenancy foreign key(tenancy_id) references tenancy(id);
alter table `user` add constraint fk_user_tenancy foreign key(tenancy_id) references tenancy(id);
alter table user_extend add constraint fk_user_extend_tenancy foreign key(tenancy_id) references tenancy(id);
alter table user_extend_val add constraint fk_user_extend_val_tenancy foreign key(tenancy_id) references tenancy(id);
-- update index
alter table user drop index `user_email_idx`;
alter table user add index `user_email_idx` (`email`,`tenancy_id`) comment 'user index, email + tenancy_id';
alter table user drop index `user_name_idx`;
alter table user add index `user_name_idx` (`name`,`tenancy_id`) comment 'user index, name + tenancy_id';
alter table user drop index `user_phone_idx`;
alter table user add index `user_phone_idx` (`phone`,`tenancy_id`) comment 'user index, phone + tenancy_id';
alter table grp drop index `group_name_idx`;
alter table grp add index `group_name_idx` (`name`,`tenancy_id`) comment 'grp index, name + tenancy_id';
alter table cfg drop index `cfg_key_UNIQUE`;
alter table cfg add unique index `cfg_key_UNIQUE` (`cfg_key`,`tenancy_id`) comment 'cfg index, cfg_key + tenancy_id';
alter table tag_type drop index `code_domainid_UNIQUE`;
alter table tag_type add unique index `code_domainid_UNIQUE` (`code`,`domain_id`, `tenancy_id`) comment 'tag_type index: code + domain_id + tenancy_id';
-- for audit
alter table audit add tenancy_id BIGINT(20) NOT NULL DEFAULT 0 comment '租户id' after req_result ;
alter table audit add index audit_tenancy_id (tenancy_id) comment '根据租户id查询的索引';
#update audit INNER JOIN tenancy ON tenancy.code='DIANRONG-WEBSITE' SET audit.tenancy_id = tenancy.id;
-- 循环更新audit表的tenancy_id 字段
DROP procedure IF EXISTS `multi_tenancy_update_audit`;
DELIMITER $$
CREATE PROCEDURE `multi_tenancy_update_audit`()
BEGIN
declare audit_top_id int(10);
declare while_index int(10) default 0;
declare while_times int(10);
declare update_min_id int(10);
declare update_max_id int(10);
declare dest_tenancy_id int(10);
declare update_per_num int(10) default 500;
set sql_safe_updates = 0;
select max(id) into audit_top_id from audit;
select max(id) into dest_tenancy_id from tenancy where code='DIANRONG-WEBSITE' ;
set while_times = (audit_top_id DIV update_per_num) + 1;
-- drop index
IF EXISTS (SELECT * FROM information_schema.statistics WHERE table_name = 'audit' AND index_name = 'uniauth_audit_userid_idx' AND table_schema=database()) THEN
alter table audit drop index `uniauth_audit_userid_idx`;
END IF;
IF EXISTS (SELECT * FROM information_schema.statistics WHERE table_name = 'audit' AND index_name = 'uniauth_audit_action_date' AND table_schema=database()) THEN
alter table audit drop index`uniauth_audit_action_date`;
END IF;
while while_index<while_times do
SET update_min_id = while_index * update_per_num;
SET update_max_id = update_min_id + update_per_num;
update audit SET tenancy_id = dest_tenancy_id WHERE id >= update_min_id and id < update_max_id;
set while_index=while_index+1;
end while;
-- add index
alter table audit add index `uniauth_audit_userid_idx` (`user_id`,`tenancy_id`) comment 'audit index, user_id + tenancy_id';
alter table audit add index `uniauth_audit_action_date` (`req_date`,`tenancy_id`) comment 'audit index, req_date + tenancy_id';
END$$
DELIMITER ;
-- 耗时(幂等)
call multi_tenancy_update_audit();
-- 删除没用的存储过程
DROP procedure IF EXISTS `multi_tenancy_update_audit`;
alter table audit add constraint fk_audit_tenancy foreign key(tenancy_id) references tenancy(id);
-- -----------------------------------------------------
-- Table `user_pwd_log`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `user_pwd_log` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT comment '主键id',
`user_id` BIGINT(20) NOT NULL comment '用户id',
`password` VARCHAR(64) NOT NULL comment '用户密码',
`password_salt` VARCHAR(64) NOT NULL comment '用户密码钥',
`create_date` DATETIME NOT NULL comment '密码创建时间',
`tenancy_id` BIGINT(20) NOT NULL comment '租户id',
PRIMARY KEY (`id`) comment '主键' ,
INDEX user_pwd_log_userid(`user_id`) comment '用户id索引',
INDEX user_pwd_log_create_date(`create_date`) comment '密码创建时间索引',
FOREIGN KEY (`user_id`) REFERENCES `user` (`id`),
FOREIGN KEY (`tenancy_id`) REFERENCES `tenancy` (`id`)
)ENGINE = InnoDB DEFAULT CHARSET=utf8;
INSERT INTO perm_type(`type`) SELECT 'REGULAR_PATTERN' FROM DUAL WHERE NOT EXISTS(
SELECT 1 FROM perm_type WHERE `type` = 'REGULAR_PATTERN'
);
-- delete table foreign key constraint tenancy_id
alter table audit drop foreign key fk_audit_tenancy;
alter table domain drop foreign key fk_domain_tenancy;
alter table cfg drop foreign key fk_cfg_tenancy;
alter table stakeholder drop foreign key fk_stakeholder_tenancy;
-- update dianrong tenancyCode from DIANRONG-WEBSITE to DIANRONG
set sql_safe_updates = 0;
update tenancy set code = 'DIANRONG' where code = 'DIANRONG-WEBSITE';
-- update none tenancy related info, set tenancyId = -1(none tenancy related id)
update domain set tenancy_id = -1;
update cfg set tenancy_id = -1;
-- -----------------------------------------------------
-- Table `api_caller_info`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `api_caller_info` (
`id` INT(11) NOT NULL AUTO_INCREMENT comment '主键id',
`domain_id` INT(11) NOT NULL comment '对应的域id',
`password` VARCHAR(64) NOT NULL comment '密码',
`status` TINYINT(3) NOT NULL comment '状态:0:启用,1:禁用' DEFAULT 0,
`comment` VARCHAR(120) comment 'comment',
`create_date` DATETIME comment '创建时间',
`last_update` DATETIME comment '最近更新时间',
PRIMARY KEY (`id`) comment '主键' ,
FOREIGN KEY (`domain_id`) REFERENCES `domain` (`id`)
)ENGINE = InnoDB DEFAULT CHARSET=utf8;
-- -----------------------------------------------------
-- Table `api_permission`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `api_permission` (
`id` INT(11) NOT NULL AUTO_INCREMENT comment '主键id',
`uri` VARCHAR(80) NOT NULL comment '权限对应的请求uri',
`status` TINYINT(3) NOT NULL comment '状态:0:启用,1:禁用' DEFAULT 0,
`method` VARCHAR(10) NOT NULL comment '包括:GET,POST,ALL三种',
`type` TINYINT(3) NOT NULL comment '权限类型:0:私有权限类型(需要主动分配),1:共有权限类型(默认每个域都有)' DEFAULT 0,
`comment` VARCHAR(120) comment 'comment',
`create_date` DATETIME comment '创建时间',
`last_update` DATETIME comment '最近更新时间',
PRIMARY KEY (`id`) comment '主键'
)ENGINE = InnoDB DEFAULT CHARSET=utf8;
-- -----------------------------------------------------
-- Table `caller_permission`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `caller_permission` (
`api_caller_id` INT(11) NOT NULL comment 'api访问域的id',
`api_permission_id` INT(11) NOT NULL comment '访问权限id',
UNIQUE KEY `unique_caller_permission` (`api_caller_id`,`api_permission_id`) ,
FOREIGN KEY (`api_caller_id`) REFERENCES `api_caller_info` (`id`),
FOREIGN KEY (`api_permission_id`) REFERENCES `api_permission` (`id`)
)ENGINE = InnoDB DEFAULT CHARSET=utf8;
-- audit table update
alter table audit add request_domain_code varchar(64) default '' comment '请求访问者的域名code';
-- 插入数据
DROP procedure IF EXISTS `proc_insert_techops_ctl`;
-- 添加techops的api访问控制
DELIMITER $$
CREATE PROCEDURE `proc_insert_techops_ctl`()
BEGIN
declare techops_domain_id int(11);
declare techops_perm_id int(11);
declare techops_caller_id int(11);
select id into techops_domain_id from domain where code = 'techops' and status = 0;
-- insert permission
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^.*',0,'ALL',0,'uniauth内部专用权限',now(),now());
-- insert techops api_caller_info
insert into api_caller_info(domain_id,password,status,comment,create_date,last_update)
values(techops_domain_id, '=610{8(lxt42nslg*k9q9|5z!:3@~9e72#|rw1*6arz5zad@7+muh!e-w792', 0, 'techops和cas对应的caller', now(), now());
select id into techops_perm_id from api_permission limit 0, 1;
select id into techops_caller_id from api_caller_info limit 0, 1;
-- insert permission和caller的映射
insert into caller_permission(api_caller_id, api_permission_id) values(techops_caller_id, techops_perm_id);
END$$
DELIMITER ;
call proc_insert_techops_ctl();
DROP procedure IF EXISTS `proc_insert_techops_ctl`;
-- public permissions
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs$',0,'ALL',1,'',now(),now());
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^.*',0,'GET',1,'',now(),now());
-- audit
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/audit/query$',0,'POST',1,'',now(),now());
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/audit/delete$',0,'POST',1,'',now(),now());
-- config
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/config/query$',0,'POST',1,'',now(),now());
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/config/cfg-types$',0,'POST',1,'',now(),now());
-- domain
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/domain/login/alldomains$',0,'POST',1,'',now(),now());
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/domain/domaininfo$',0,'POST',1,'',now(),now());
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/domain/query$',0,'POST',1,'',now(),now());
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/domain/stakeholder/query$',0,'POST',1,'',now(),now());
-- group
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/group/tree$',0,'POST',1,'',now(),now());
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/group/query$',0,'POST',1,'',now(),now());
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/group/groupowners$',0,'POST',1,'',now(),now());
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/group/domain/roles$',0,'POST',1,'',now(),now());
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/group/checkowner$',0,'POST',1,'',now(),now());
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/group/querytagswithchecked$',0,'POST',1,'',now(),now());
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/group/userInGroupOrSub$',0,'POST',1,'',now(),now());
-- permission
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/permission/allpermtypecodes$',0,'POST',1,'',now(),now());
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/permission/searchperms$',0,'POST',1,'',now(),now());
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/permission/roles$',0,'POST',1,'',now(),now());
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/permission/urlrolemappings$',0,'POST',1,'',now(),now());
-- role
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/role/allrolecodes$',0,'POST',1,'',now(),now());
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/role/searchroles$',0,'POST',1,'',now(),now());
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/role/domain/perms$',0,'POST',1,'',now(),now());
-- tag
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/tag/query$',0,'POST',1,'',now(),now());
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/tag/tag-types$',0,'POST',1,'',now(),now());
-- tenancy
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/tenancy/query$',0,'POST',1,'',now(),now());
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/tenancy/queryDefault$',0,'POST',1,'',now(),now());
-- userextend
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/userextend/searchuserextend$',0,'POST',1,'',now(),now());
-- userextendval
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/userextendval/searchbyuseridandstatus$',0,'POST',1,'',now(),now());
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/userextendval/searchbyuseridandcode$',0,'POST',1,'',now(),now());
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/userextendval/searchbyuseridentity$',0,'POST',1,'',now(),now());
-- user
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/user/searchusers$',0,'POST',1,'',now(),now());
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/user/userswithrolechecked$',0,'POST',1,'',now(),now());
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/user/userswithtagchecked$',0,'POST',1,'',now(),now());
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/user/domain/roles$',0,'POST',1,'',now(),now());
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/user/login$',0,'POST',1,'',now(),now());
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/user/usedetailinfo$',0,'POST',1,'',now(),now());
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/user/usedetailinfobyid$',0,'POST',1,'',now(),now());
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/user/singleuser$',0,'POST',1,'',now(),now());
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/user/userInfobytag$',0,'POST',1,'',now(),now());
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/user/tagsWithUserChecked$',0,'POST',1,'',now(),now());
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/user/search-user-by-roleid$',0,'POST',1,'',now(),now());
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/user/search-user-by-tagid$',0,'POST',1,'',now(),now());
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/user/query-user/group-and-role$',0,'POST',1,'',now(),now());
-- userextend
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/userextend/adduserextend$',0,'POST',1,'',now(),now());
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/userextend/updateuserextend$',0,'POST',1,'',now(),now());
-- userextendval
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/userextendval/add$',0,'POST',1,'',now(),now());
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/userextendval/delbyid$',0,'POST',1,'',now(),now());
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/userextendval/updatebyid$',0,'POST',1,'',now(),now());
-- group
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/group/list-group-relate-to-user$',0,'POST',1,'',now(),now());
-- group
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/userextendval/search$',0,'POST',1,'',now(),now());
ALTER TABLE `audit`
ADD FULLTEXT INDEX `idx_audit_req_param_fulltext` (`req_param` ASC) COMMENT '查询用户在uniauth产生的所有历史记录';
-- tenancy
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/tenancy/query-enable-tenancy-by-code$',0,'POST',1,'',now(),now());
-- user
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/ws/rs/user/vpn-login$',0,'POST',1,'',now(),now());
-- update user table's email colomn
ALTER TABLE user MODIFY `email` VARCHAR(64) comment '用户邮箱';
-- -----------------------------------------------------
-- Table `user_third_account`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `user_third_account` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`user_id` BIGINT(20) NOT NULL COMMENT '与user表的主键id一一映射',
`third_account` VARCHAR(60) NOT NULL COMMENT '第三方账号',
`type` VARCHAR(10) NOT NULL COMMENT '字符串的类型,比如IPA,OA等',
`last_login_ip` DATETIME COMMENT '第三方账号通过Uniauth的最新登陆ip',
`last_login_time` DATETIME COMMENT '第三方账号通过Uniauth的最新登陆时间',
`create_date` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`last_update` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最近更新时间',
`tenancy_id` BIGINT(20) NOT NULL COMMENT'租户id',
PRIMARY KEY (`id`) COMMENT '主键',
UNIQUE INDEX unique_index_user_third_account_1(`user_id`, `third_account`, `type`, `tenancy_id`),
INDEX index_user_third_account_user_id_tenancy_id(`user_id`, `tenancy_id`) COMMENT '加快根据用户id查询速度',
INDEX index_user_third_account_third_account_type_tenancy_id(`third_account`, `type`, `tenancy_id`) COMMENT '加快根据根据第三方账号和类型反查用户id',
CONSTRAINT `fk_user_third_account_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_user_third_account_tenancy_id` FOREIGN KEY (`tenancy_id`) REFERENCES `tenancy` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
)ENGINE = InnoDB DEFAULT CHARSET=utf8;
-- Add new permission type - THIRD_ACCOUNT
insert into perm_type(`type`) values('THIRD_ACCOUNT');
-- Update table user_extend
ALTER TABLE user_extend MODIFY `description` VARCHAR(200) COMMENT '扩展属性描述';
ALTER TABLE user_extend ADD category VARCHAR(30) COMMENT '扩展属性类型' after code;
ALTER TABLE user_extend ADD subcategory VARCHAR(30) COMMENT '扩展属性子类型' after category;
ALTER TABLE user_extend ADD INDEX idx_user_extend_code_tenancy_id (`code`, `tenancy_id`) COMMENT '加快根据Code查询速度';
-- Rename table user_extend to attribute_extend
ALTER TABLE user_extend rename attribute_extend;
-- Update table user
ALTER TABLE user ADD staff_no VARCHAR(80) COMMENT '员工编号' after phone;
ALTER TABLE user ADD ldap_dn VARCHAR(100) COMMENT 'ldap账号' after staff_no;
ALTER TABLE user ADD user_guid VARCHAR(80) COMMENT '用户的guid' after ldap_dn;
ALTER TABLE user ADD INDEX idx_user_staff_no_tenancy_id (`staff_no`, `tenancy_id`) COMMENT '根据staff_no查询速度加快';
ALTER TABLE user ADD INDEX idx_user_ldap_dn_tenancy_id (`ldap_dn`, `tenancy_id`) COMMENT '根据ldap_dn查询速度加快';
ALTER TABLE user ADD INDEX idx_user_user_guid_tenancy_id (`user_guid`, `tenancy_id`) COMMENT '根据user_guid查询速度加快';
-- Update table user_extend_val
ALTER TABLE user_extend_val DROP COLUMN status;
ALTER TABLE user_extend_val change value_ `value` VARCHAR(200) COMMENT '扩展属性值';
ALTER TABLE user_extend_val ADD INDEX idx_user_extend_val_value_tenancy_id (`value`, `tenancy_id`) COMMENT '根据扩展属性值索引';
ALTER TABLE user_extend_val ADD create_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间';
ALTER TABLE user_extend_val ADD last_update DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最近更新时间';
-- -----------------------------------------------------
-- Table `user_detail`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `user_detail` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`user_id` BIGINT(20) NOT NULL COMMENT '与user表的主键id一一映射',
`first_name` VARCHAR(45) COMMENT '名',
`last_name` VARCHAR(45) COMMENT '姓',
`display_name` VARCHAR(80) COMMENT '显示的名称',
`nick_name` VARCHAR(80) COMMENT '别名',
`identity_no` VARCHAR(20) COMMENT '身份证号码',
`motto` VARCHAR(300) COMMENT '座右铭',
`image` VARCHAR(200) COMMENT '头像资源所在的地址',
`ssn` VARCHAR(40) COMMENT 'SSN号码',
`weibo` VARCHAR(200) COMMENT '微博',
`wechat_no` VARCHAR(60) COMMENT '微信号',
`address` VARCHAR(200) COMMENT '联系地址',
`birthday` Date COMMENT '生日',
`gender` VARCHAR(10) COMMENT '性别',
`position` VARCHAR(80) COMMENT '职位',
`department` VARCHAR(80) COMMENT '所在部门',
`title` VARCHAR(60) COMMENT '职称',
`aid` BIGINT(20) COMMENT '关联的Actor表id',
`last_position_modify_date` DATETIME COMMENT '上一次职位更新时间',
`entry_date` DATETIME COMMENT '入职时间',
`leave_date` DATETIME COMMENT '离职时间',
`remark` VARCHAR(200) COMMENT '备注',
`create_date` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`last_update` DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最近更新时间',
`tenancy_id` BIGINT(20) not null default -1 COMMENT'租户id',
PRIMARY KEY (`id`) COMMENT '主键',
CONSTRAINT `fk_user_detail_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_user_detail_tenancy_id` FOREIGN KEY (`tenancy_id`) REFERENCES `tenancy` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
)ENGINE = InnoDB DEFAULT CHARSET=utf8;
-- -----------------------------------------------------
-- Table `user_work_relationship`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `user_work_relationship` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`user_id` BIGINT(20) NOT NULL COMMENT '关联的用户id',
`manager_id` BIGINT(20) COMMENT '经理的id',
`supervisor_id` BIGINT(20) COMMENT '监管者的id',
`type` tinyint(4) NOT NULL COMMENT '类型' default 0,
`assignment_date` DATETIME COMMENT '分配时间',
`hire_date` DATETIME COMMENT '雇佣时间',
`business_unit_name` VARCHAR(60) COMMENT '所在业务部门名称',
`department_name` VARCHAR(60) COMMENT '所在部门名称',
`legal_entity_name` VARCHAR(60) COMMENT '法定实体名称',
`work_phone` VARCHAR(60) COMMENT '工作电话',
`work_location` VARCHAR(100) COMMENT '工作地点',
`work_address` VARCHAR(100) COMMENT '工作地点',
`create_date` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`last_update` DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最近更新时间',
`tenancy_id` BIGINT(20) not null default -1 COMMENT'租户id',
PRIMARY KEY (`id`) COMMENT '主键' ,
INDEX index_user_work_relationship_type_tenancy_id(`type`, `tenancy_id`) COMMENT '加快根据类型查询速度',
CONSTRAINT `fk_user_work_relationship_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_user_work_relationship_manager_id` FOREIGN KEY (`manager_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_user_work_relationship_supervisor_id` FOREIGN KEY (`supervisor_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_user_work_relationship_tenancy_id` FOREIGN KEY (`tenancy_id`) REFERENCES `tenancy` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
)ENGINE = InnoDB DEFAULT CHARSET=utf8;
-- -----------------------------------------------------
-- Table `user_attribute_records`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `user_attribute_records` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`user_id` BIGINT(20) NOT NULL COMMENT '关联的用户id',
`opt_type` VARCHAR(40) NOT NULL COMMENT '记录操作类型, 比如ADD,UPDATE,DELETE等',
`opt_id` BIGINT(20) COMMENT '操作人的id',
`opt_name` VARCHAR(64) COMMENT '操作人的姓名',
`opt_date` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '操作时间',
`extend_id` BIGINT(20) NOT NULL COMMENT '关联的扩展属性id',
`pre_val` VARCHAR(200) COMMENT '操作前的值',
`cur_val` VARCHAR(200) COMMENT '操作后的值',
`create_date` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`last_update` DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最近更新时间',
`tenancy_id` BIGINT(20) not null default -1 COMMENT'租户id',
PRIMARY KEY (`id`) COMMENT '主键',
INDEX idx_user_attribute_records_opt_type_tenancy_id(`opt_type`, `tenancy_id`) COMMENT '加快根据操作类型的查询速度',
INDEX idx_user_attribute_records_opt_date_tenancy_id(`opt_date`, `tenancy_id`) COMMENT '加快根据操作时间的查询速度',
INDEX idx_user_attribute_records_pre_val_tenancy_id(`pre_val`, `tenancy_id`) COMMENT '加快根据修改前的值的查询速度',
INDEX idx_user_attribute_records_cur_val_tenancy_id(`cur_val`, `tenancy_id`) COMMENT '加快根据修改后的值的查询速度',
CONSTRAINT `fk_user_attribute_records_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_user_attribute_records_tenancy_id` FOREIGN KEY (`tenancy_id`) REFERENCES `tenancy` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_user_attribute_records_extend_id` FOREIGN KEY (`extend_id`) REFERENCES `attribute_extend` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
)ENGINE = InnoDB DEFAULT CHARSET=utf8;
-- -----------------------------------------------------
-- Table `grp_extend_val`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `grp_extend_val` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`grp_id` INT(11) NOT NULL COMMENT '对应的组id',
`extend_id` BIGINT(20) NOT NULL COMMENT '关联的扩展属性id',
`value` VARCHAR(200) COMMENT '扩展属性值',
`tenancy_id` BIGINT(20) NOT NULL COMMENT '租户id',
`create_date` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`last_update` DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最近更新时间',
PRIMARY KEY (`id`) COMMENT '主键',
INDEX idx_grp_extend_val_value_tenancy_id(`value`, `tenancy_id`) COMMENT '加快根据扩展值查询速度',
CONSTRAINT `fk_grp_extend_val_grp_id` FOREIGN KEY (`grp_id`) REFERENCES `grp` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_grp_extend_val_tenancy_id` FOREIGN KEY (`tenancy_id`) REFERENCES `tenancy` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_grp_extend_val_extend_id` FOREIGN KEY (`extend_id`) REFERENCES `attribute_extend` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
)ENGINE = InnoDB DEFAULT CHARSET=utf8;
-- -----------------------------------------------------
-- Table `grp_attribute_records`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `grp_attribute_records` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`grp_id` INT(11) NOT NULL COMMENT '关联的组id',
`opt_type` VARCHAR(40) NOT NULL COMMENT '记录操作类型, 比如ADD,UPDATE,DELETE等',
`opt_id` BIGINT(20) COMMENT '操作人的id',
`opt_name` VARCHAR(64) COMMENT '操作人的姓名',
`opt_date` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '操作时间',
`extend_id` BIGINT(20) NOT NULL COMMENT '关联的扩展属性id',
`pre_val` VARCHAR(200) COMMENT '操作前的值',
`cur_val` VARCHAR(200) COMMENT '操作后的值',
`create_date` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`last_update` DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最近更新时间',
`tenancy_id` BIGINT(20) not null default -1 COMMENT'租户id',
PRIMARY KEY (`id`) COMMENT '主键',
INDEX idx_grp_attribute_records_opt_type_tenancy_id(`opt_type`, `tenancy_id`) COMMENT '加快根据操作类型的查询速度',
INDEX idx_grp_attribute_records_opt_date_tenancy_id(`opt_date`, `tenancy_id`) COMMENT '加快根据操作时间的查询速度',
INDEX idx_grp_attribute_records_pre_val_tenancy_id(`pre_val`, `tenancy_id`) COMMENT '加快根据修改前的值的查询速度',
INDEX idx_grp_attribute_records_cur_val_tenancy_id(`cur_val`, `tenancy_id`) COMMENT '加快根据修改后的值的查询速度',
CONSTRAINT `fk_grp_attribute_records_grp_id` FOREIGN KEY (`grp_id`) REFERENCES `grp` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_grp_attribute_records_tenancy_id` FOREIGN KEY (`tenancy_id`) REFERENCES `tenancy` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_grp_attribute_records_extend_id` FOREIGN KEY (`extend_id`) REFERENCES `attribute_extend` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
)ENGINE = InnoDB DEFAULT CHARSET=utf8;
-- init administrator account
UPDATE `user` set password_date = null WHERE email = 'first.admin@test.com';
-- metrics check
insert into api_permission(uri,status,method,type,comment,create_date,last_update)
values('^/metrics/.*$',0,'ALL',1,'',now(),now()); | the_stack |
-- 2017-12-11T14:39:34.805
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Window (AD_Client_ID,AD_Org_ID,AD_Window_ID,Created,CreatedBy,EntityType,IsActive,IsBetaFunctionality,IsDefault,IsOneInstanceOnly,IsSOTrx,Name,Processing,Updated,UpdatedBy,WindowType,WinHeight,WinWidth) VALUES (0,0,540386,TO_TIMESTAMP('2017-12-11 14:39:34','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','N','N','N','Y','Import Pharma Product','N',TO_TIMESTAMP('2017-12-11 14:39:34','YYYY-MM-DD HH24:MI:SS'),100,'M',0,0)
;
-- 2017-12-11T14:39:34.817
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Window_Trl (AD_Language,AD_Window_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Window_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Window t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Window_ID=540386 AND NOT EXISTS (SELECT 1 FROM AD_Window_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Window_ID=t.AD_Window_ID)
;
-- 2017-12-11T14:40:04.134
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Tab (AD_Client_ID,AD_Org_ID,AD_Tab_ID,AD_Table_ID,AD_Window_ID,Created,CreatedBy,EntityType,HasTree,ImportFields,IsActive,IsAdvancedTab,IsCheckParentsChanged,IsGenericZoomTarget,IsGridModeOnly,IsInfoTab,IsInsertRecord,IsQueryOnLoad,IsReadOnly,IsRefreshAllOnActivate,IsSearchActive,IsSearchCollapsed,IsSingleRow,IsSortTab,IsTranslationTab,MaxQueryRecords,Name,Processing,SeqNo,TabLevel,Updated,UpdatedBy) VALUES (0,0,540908,540880,540386,TO_TIMESTAMP('2017-12-11 14:40:04','YYYY-MM-DD HH24:MI:SS'),100,'U','N','N','Y','N','Y','N','N','N','Y','Y','N','N','Y','Y','N','N','N',0,'Import Pharma Product','N',10,0,TO_TIMESTAMP('2017-12-11 14:40:04','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:04.136
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Tab_Trl (AD_Language,AD_Tab_ID, CommitWarning,Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Tab_ID, t.CommitWarning,t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Tab t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Tab_ID=540908 AND NOT EXISTS (SELECT 1 FROM AD_Tab_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Tab_ID=t.AD_Tab_ID)
;
-- 2017-12-11T14:40:18.217
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558138,560804,0,540908,TO_TIMESTAMP('2017-12-11 14:40:18','YYYY-MM-DD HH24:MI:SS'),100,1,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A00SSATZ',TO_TIMESTAMP('2017-12-11 14:40:18','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:18.219
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560804 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:18.282
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558139,560805,0,540908,TO_TIMESTAMP('2017-12-11 14:40:18','YYYY-MM-DD HH24:MI:SS'),100,8,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A00PZN',TO_TIMESTAMP('2017-12-11 14:40:18','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:18.284
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560805 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:18.349
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558140,560806,0,540908,TO_TIMESTAMP('2017-12-11 14:40:18','YYYY-MM-DD HH24:MI:SS'),100,8,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A00GDAT',TO_TIMESTAMP('2017-12-11 14:40:18','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:18.350
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560806 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:18.414
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558141,560807,0,540908,TO_TIMESTAMP('2017-12-11 14:40:18','YYYY-MM-DD HH24:MI:SS'),100,26,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A00PBEZ',TO_TIMESTAMP('2017-12-11 14:40:18','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:18.415
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560807 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:18.477
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558142,560808,0,540908,TO_TIMESTAMP('2017-12-11 14:40:18','YYYY-MM-DD HH24:MI:SS'),100,7,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A00PGMENG',TO_TIMESTAMP('2017-12-11 14:40:18','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:18.478
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560808 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:18.539
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558143,560809,0,540908,TO_TIMESTAMP('2017-12-11 14:40:18','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A00PGEINH',TO_TIMESTAMP('2017-12-11 14:40:18','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:18.541
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560809 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:18.604
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558144,560810,0,540908,TO_TIMESTAMP('2017-12-11 14:40:18','YYYY-MM-DD HH24:MI:SS'),100,3,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A00DARFO',TO_TIMESTAMP('2017-12-11 14:40:18','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:18.605
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560810 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:18.680
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558145,560811,0,540908,TO_TIMESTAMP('2017-12-11 14:40:18','YYYY-MM-DD HH24:MI:SS'),100,5,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A00ANBNR4',TO_TIMESTAMP('2017-12-11 14:40:18','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:18.681
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560811 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:18.746
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558146,560812,0,540908,TO_TIMESTAMP('2017-12-11 14:40:18','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A00ATYP',TO_TIMESTAMP('2017-12-11 14:40:18','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:18.747
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560812 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:18.811
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558147,560813,0,540908,TO_TIMESTAMP('2017-12-11 14:40:18','YYYY-MM-DD HH24:MI:SS'),100,1,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A00LKZ',TO_TIMESTAMP('2017-12-11 14:40:18','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:18.812
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560813 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:18.874
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558148,560814,0,540908,TO_TIMESTAMP('2017-12-11 14:40:18','YYYY-MM-DD HH24:MI:SS'),100,14,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A00GTIN',TO_TIMESTAMP('2017-12-11 14:40:18','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:18.876
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560814 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:18.966
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558149,560815,0,540908,TO_TIMESTAMP('2017-12-11 14:40:18','YYYY-MM-DD HH24:MI:SS'),100,18,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A00ARTNR',TO_TIMESTAMP('2017-12-11 14:40:18','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:18.967
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560815 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:19.031
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558150,560816,0,540908,TO_TIMESTAMP('2017-12-11 14:40:18','YYYY-MM-DD HH24:MI:SS'),100,10,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A00HMNR',TO_TIMESTAMP('2017-12-11 14:40:18','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:19.032
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560816 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:19.092
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558151,560817,0,540908,TO_TIMESTAMP('2017-12-11 14:40:19','YYYY-MM-DD HH24:MI:SS'),100,50,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A00PNAM',TO_TIMESTAMP('2017-12-11 14:40:19','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:19.093
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560817 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:19.162
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558152,560818,0,540908,TO_TIMESTAMP('2017-12-11 14:40:19','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A00WGA',TO_TIMESTAMP('2017-12-11 14:40:19','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:19.164
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560818 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:19.230
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558153,560819,0,540908,TO_TIMESTAMP('2017-12-11 14:40:19','YYYY-MM-DD HH24:MI:SS'),100,12,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A00PPN',TO_TIMESTAMP('2017-12-11 14:40:19','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:19.231
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560819 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:19.297
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558154,560820,0,540908,TO_TIMESTAMP('2017-12-11 14:40:19','YYYY-MM-DD HH24:MI:SS'),100,8,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A05GDAT',TO_TIMESTAMP('2017-12-11 14:40:19','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:19.298
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560820 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:19.360
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558155,560821,0,540908,TO_TIMESTAMP('2017-12-11 14:40:19','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A05VFDAT',TO_TIMESTAMP('2017-12-11 14:40:19','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:19.361
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560821 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:19.424
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558156,560822,0,540908,TO_TIMESTAMP('2017-12-11 14:40:19','YYYY-MM-DD HH24:MI:SS'),100,3,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A05LZEIT',TO_TIMESTAMP('2017-12-11 14:40:19','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:19.425
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560822 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:19.492
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558157,560823,0,540908,TO_TIMESTAMP('2017-12-11 14:40:19','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A05KKETTE',TO_TIMESTAMP('2017-12-11 14:40:19','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:19.493
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560823 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:19.555
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558158,560824,0,540908,TO_TIMESTAMP('2017-12-11 14:40:19','YYYY-MM-DD HH24:MI:SS'),100,4,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A05TMAX',TO_TIMESTAMP('2017-12-11 14:40:19','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:19.556
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560824 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:19.619
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558159,560825,0,540908,TO_TIMESTAMP('2017-12-11 14:40:19','YYYY-MM-DD HH24:MI:SS'),100,4,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A05TMIN',TO_TIMESTAMP('2017-12-11 14:40:19','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:19.620
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560825 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:19.680
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558160,560826,0,540908,TO_TIMESTAMP('2017-12-11 14:40:19','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A05LICHT',TO_TIMESTAMP('2017-12-11 14:40:19','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:19.681
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560826 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:19.747
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558161,560827,0,540908,TO_TIMESTAMP('2017-12-11 14:40:19','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A05FEUCHT',TO_TIMESTAMP('2017-12-11 14:40:19','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:19.748
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560827 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:19.807
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558162,560828,0,540908,TO_TIMESTAMP('2017-12-11 14:40:19','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A05LAGE',TO_TIMESTAMP('2017-12-11 14:40:19','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:19.809
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560828 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:19.869
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558163,560829,0,540908,TO_TIMESTAMP('2017-12-11 14:40:19','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A05ZERBR',TO_TIMESTAMP('2017-12-11 14:40:19','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:19.870
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560829 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:19.934
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558164,560830,0,540908,TO_TIMESTAMP('2017-12-11 14:40:19','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A05EICH',TO_TIMESTAMP('2017-12-11 14:40:19','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:19.935
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560830 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:19.996
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558165,560831,0,540908,TO_TIMESTAMP('2017-12-11 14:40:19','YYYY-MM-DD HH24:MI:SS'),100,3,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A05LZEICH',TO_TIMESTAMP('2017-12-11 14:40:19','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:19.998
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560831 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:20.062
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558166,560832,0,540908,TO_TIMESTAMP('2017-12-11 14:40:19','YYYY-MM-DD HH24:MI:SS'),100,8,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A04GDAT',TO_TIMESTAMP('2017-12-11 14:40:19','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:20.063
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560832 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:20.125
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558167,560833,0,540908,TO_TIMESTAMP('2017-12-11 14:40:20','YYYY-MM-DD HH24:MI:SS'),100,6,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A04LAENGE',TO_TIMESTAMP('2017-12-11 14:40:20','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:20.126
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560833 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:20.188
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558168,560834,0,540908,TO_TIMESTAMP('2017-12-11 14:40:20','YYYY-MM-DD HH24:MI:SS'),100,6,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A04HOEHE',TO_TIMESTAMP('2017-12-11 14:40:20','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:20.189
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560834 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:20.371
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558169,560835,0,540908,TO_TIMESTAMP('2017-12-11 14:40:20','YYYY-MM-DD HH24:MI:SS'),100,6,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A04BREITE',TO_TIMESTAMP('2017-12-11 14:40:20','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:20.372
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560835 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:20.432
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558170,560836,0,540908,TO_TIMESTAMP('2017-12-11 14:40:20','YYYY-MM-DD HH24:MI:SS'),100,8,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A04GWCHT',TO_TIMESTAMP('2017-12-11 14:40:20','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:20.434
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560836 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:20.495
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558171,560837,0,540908,TO_TIMESTAMP('2017-12-11 14:40:20','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A04VPART',TO_TIMESTAMP('2017-12-11 14:40:20','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:20.496
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560837 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:20.563
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558172,560838,0,540908,TO_TIMESTAMP('2017-12-11 14:40:20','YYYY-MM-DD HH24:MI:SS'),100,6,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A04MBEST',TO_TIMESTAMP('2017-12-11 14:40:20','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:20.564
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560838 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:20.633
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558173,560839,0,540908,TO_TIMESTAMP('2017-12-11 14:40:20','YYYY-MM-DD HH24:MI:SS'),100,8,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A01GDAT',TO_TIMESTAMP('2017-12-11 14:40:20','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:20.634
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560839 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:20.695
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558174,560840,0,540908,TO_TIMESTAMP('2017-12-11 14:40:20','YYYY-MM-DD HH24:MI:SS'),100,1,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A01SKAEP',TO_TIMESTAMP('2017-12-11 14:40:20','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:20.697
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560840 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:20.761
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558175,560841,0,540908,TO_TIMESTAMP('2017-12-11 14:40:20','YYYY-MM-DD HH24:MI:SS'),100,1,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A01SAPU',TO_TIMESTAMP('2017-12-11 14:40:20','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:20.762
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560841 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:20.824
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558176,560842,0,540908,TO_TIMESTAMP('2017-12-11 14:40:20','YYYY-MM-DD HH24:MI:SS'),100,1,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A01SAEP',TO_TIMESTAMP('2017-12-11 14:40:20','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:20.824
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560842 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:20.921
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558177,560843,0,540908,TO_TIMESTAMP('2017-12-11 14:40:20','YYYY-MM-DD HH24:MI:SS'),100,1,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A01SAVP',TO_TIMESTAMP('2017-12-11 14:40:20','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:20.922
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560843 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:20.998
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558178,560844,0,540908,TO_TIMESTAMP('2017-12-11 14:40:20','YYYY-MM-DD HH24:MI:SS'),100,1,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A01SUVP',TO_TIMESTAMP('2017-12-11 14:40:20','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:21.001
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560844 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:21.152
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558179,560845,0,540908,TO_TIMESTAMP('2017-12-11 14:40:21','YYYY-MM-DD HH24:MI:SS'),100,1,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A01SZBV',TO_TIMESTAMP('2017-12-11 14:40:21','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:21.153
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560845 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:21.272
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558180,560846,0,540908,TO_TIMESTAMP('2017-12-11 14:40:21','YYYY-MM-DD HH24:MI:SS'),100,1,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A01SAB130A',TO_TIMESTAMP('2017-12-11 14:40:21','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:21.273
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560846 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:21.331
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558181,560847,0,540908,TO_TIMESTAMP('2017-12-11 14:40:21','YYYY-MM-DD HH24:MI:SS'),100,10,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A01KAEP',TO_TIMESTAMP('2017-12-11 14:40:21','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:21.332
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560847 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:21.390
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558182,560848,0,540908,TO_TIMESTAMP('2017-12-11 14:40:21','YYYY-MM-DD HH24:MI:SS'),100,10,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A01APU',TO_TIMESTAMP('2017-12-11 14:40:21','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:21.391
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560848 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:21.454
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558183,560849,0,540908,TO_TIMESTAMP('2017-12-11 14:40:21','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A01AMPVSGB',TO_TIMESTAMP('2017-12-11 14:40:21','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:21.455
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560849 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:21.642
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558184,560850,0,540908,TO_TIMESTAMP('2017-12-11 14:40:21','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A01AMPVAMG',TO_TIMESTAMP('2017-12-11 14:40:21','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:21.643
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560850 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:21.823
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558185,560851,0,540908,TO_TIMESTAMP('2017-12-11 14:40:21','YYYY-MM-DD HH24:MI:SS'),100,10,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A01AEP',TO_TIMESTAMP('2017-12-11 14:40:21','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:21.824
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560851 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:21.884
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558186,560852,0,540908,TO_TIMESTAMP('2017-12-11 14:40:21','YYYY-MM-DD HH24:MI:SS'),100,10,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A01AVP',TO_TIMESTAMP('2017-12-11 14:40:21','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:21.885
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560852 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:21.943
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558187,560853,0,540908,TO_TIMESTAMP('2017-12-11 14:40:21','YYYY-MM-DD HH24:MI:SS'),100,10,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A01UVP',TO_TIMESTAMP('2017-12-11 14:40:21','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:21.944
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560853 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:22.004
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558188,560854,0,540908,TO_TIMESTAMP('2017-12-11 14:40:21','YYYY-MM-DD HH24:MI:SS'),100,10,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A01ZBV',TO_TIMESTAMP('2017-12-11 14:40:21','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:22.005
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560854 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:22.064
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558189,560855,0,540908,TO_TIMESTAMP('2017-12-11 14:40:22','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A01MWST',TO_TIMESTAMP('2017-12-11 14:40:22','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:22.065
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560855 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:22.126
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558190,560856,0,540908,TO_TIMESTAMP('2017-12-11 14:40:22','YYYY-MM-DD HH24:MI:SS'),100,10,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A01PPU',TO_TIMESTAMP('2017-12-11 14:40:22','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:22.128
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560856 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:22.208
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558191,560857,0,540908,TO_TIMESTAMP('2017-12-11 14:40:22','YYYY-MM-DD HH24:MI:SS'),100,10,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A01AB130A2',TO_TIMESTAMP('2017-12-11 14:40:22','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:22.209
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560857 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:22.574
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558192,560858,0,540908,TO_TIMESTAMP('2017-12-11 14:40:22','YYYY-MM-DD HH24:MI:SS'),100,10,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A01APU783A',TO_TIMESTAMP('2017-12-11 14:40:22','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:22.575
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560858 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:23.234
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558193,560859,0,540908,TO_TIMESTAMP('2017-12-11 14:40:22','YYYY-MM-DD HH24:MI:SS'),100,10,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A01AEPPPU',TO_TIMESTAMP('2017-12-11 14:40:22','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:23.235
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560859 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:23.295
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558194,560860,0,540908,TO_TIMESTAMP('2017-12-11 14:40:23','YYYY-MM-DD HH24:MI:SS'),100,10,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A01AVPPPU',TO_TIMESTAMP('2017-12-11 14:40:23','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:23.296
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560860 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:23.356
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558195,560861,0,540908,TO_TIMESTAMP('2017-12-11 14:40:23','YYYY-MM-DD HH24:MI:SS'),100,11,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A01DPPUAPU',TO_TIMESTAMP('2017-12-11 14:40:23','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:23.356
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560861 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:23.418
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558196,560862,0,540908,TO_TIMESTAMP('2017-12-11 14:40:23','YYYY-MM-DD HH24:MI:SS'),100,10,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A01RESERV1',TO_TIMESTAMP('2017-12-11 14:40:23','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:23.419
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560862 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:23.490
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558197,560863,0,540908,TO_TIMESTAMP('2017-12-11 14:40:23','YYYY-MM-DD HH24:MI:SS'),100,10,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A01RESERV2',TO_TIMESTAMP('2017-12-11 14:40:23','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:23.491
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560863 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:23.553
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558198,560864,0,540908,TO_TIMESTAMP('2017-12-11 14:40:23','YYYY-MM-DD HH24:MI:SS'),100,10,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A01RESERV3',TO_TIMESTAMP('2017-12-11 14:40:23','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:23.554
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560864 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:23.612
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558199,560865,0,540908,TO_TIMESTAMP('2017-12-11 14:40:23','YYYY-MM-DD HH24:MI:SS'),100,8,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02GDAT',TO_TIMESTAMP('2017-12-11 14:40:23','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:23.613
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560865 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:23.675
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558200,560866,0,540908,TO_TIMESTAMP('2017-12-11 14:40:23','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02AM',TO_TIMESTAMP('2017-12-11 14:40:23','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:23.676
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560866 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:23.736
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558201,560867,0,540908,TO_TIMESTAMP('2017-12-11 14:40:23','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02MP',TO_TIMESTAMP('2017-12-11 14:40:23','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:23.737
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560867 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:23.799
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558202,560868,0,540908,TO_TIMESTAMP('2017-12-11 14:40:23','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02APPFL',TO_TIMESTAMP('2017-12-11 14:40:23','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:23.800
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560868 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:23.862
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558203,560869,0,540908,TO_TIMESTAMP('2017-12-11 14:40:23','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02VSPFL',TO_TIMESTAMP('2017-12-11 14:40:23','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:23.862
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560869 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:23.924
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558204,560870,0,540908,TO_TIMESTAMP('2017-12-11 14:40:23','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02BTM',TO_TIMESTAMP('2017-12-11 14:40:23','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:23.925
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560870 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:23.986
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558205,560871,0,540908,TO_TIMESTAMP('2017-12-11 14:40:23','YYYY-MM-DD HH24:MI:SS'),100,8,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02BOPST',TO_TIMESTAMP('2017-12-11 14:40:23','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:23.987
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560871 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:24.046
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558206,560872,0,540908,TO_TIMESTAMP('2017-12-11 14:40:23','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02TFG',TO_TIMESTAMP('2017-12-11 14:40:23','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:24.047
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560872 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:24.107
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558207,560873,0,540908,TO_TIMESTAMP('2017-12-11 14:40:24','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02DROCH',TO_TIMESTAMP('2017-12-11 14:40:24','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:24.108
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560873 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:24.169
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558208,560874,0,540908,TO_TIMESTAMP('2017-12-11 14:40:24','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02TIERAM',TO_TIMESTAMP('2017-12-11 14:40:24','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:24.170
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560874 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:24.229
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558209,560875,0,540908,TO_TIMESTAMP('2017-12-11 14:40:24','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02NEGLIS',TO_TIMESTAMP('2017-12-11 14:40:24','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:24.231
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560875 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:24.289
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558210,560876,0,540908,TO_TIMESTAMP('2017-12-11 14:40:24','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02HMZV',TO_TIMESTAMP('2017-12-11 14:40:24','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:24.290
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560876 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:24.349
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558211,560877,0,540908,TO_TIMESTAMP('2017-12-11 14:40:24','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02LIFSTYL',TO_TIMESTAMP('2017-12-11 14:40:24','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:24.350
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560877 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:24.421
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558212,560878,0,540908,TO_TIMESTAMP('2017-12-11 14:40:24','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02HOMOEO',TO_TIMESTAMP('2017-12-11 14:40:24','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:24.422
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560878 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:24.480
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558213,560879,0,540908,TO_TIMESTAMP('2017-12-11 14:40:24','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02ANTHRO',TO_TIMESTAMP('2017-12-11 14:40:24','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:24.481
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560879 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:24.539
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558214,560880,0,540908,TO_TIMESTAMP('2017-12-11 14:40:24','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02PHYTO',TO_TIMESTAMP('2017-12-11 14:40:24','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:24.540
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560880 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:24.599
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558215,560881,0,540908,TO_TIMESTAMP('2017-12-11 14:40:24','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02AUSNREI',TO_TIMESTAMP('2017-12-11 14:40:24','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:24.600
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560881 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:24.658
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558216,560882,0,540908,TO_TIMESTAMP('2017-12-11 14:40:24','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02GENER',TO_TIMESTAMP('2017-12-11 14:40:24','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:24.659
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560882 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:24.720
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558217,560883,0,540908,TO_TIMESTAMP('2017-12-11 14:40:24','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02SDB',TO_TIMESTAMP('2017-12-11 14:40:24','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:24.721
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560883 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:24.779
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558218,560884,0,540908,TO_TIMESTAMP('2017-12-11 14:40:24','YYYY-MM-DD HH24:MI:SS'),100,30,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02ZULREG',TO_TIMESTAMP('2017-12-11 14:40:24','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:24.781
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560884 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:24.842
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558219,560885,0,540908,TO_TIMESTAMP('2017-12-11 14:40:24','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02LEBENSM',TO_TIMESTAMP('2017-12-11 14:40:24','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:24.843
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560885 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:24.902
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558220,560886,0,540908,TO_TIMESTAMP('2017-12-11 14:40:24','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02NEM',TO_TIMESTAMP('2017-12-11 14:40:24','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:24.903
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560886 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:24.962
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558221,560887,0,540908,TO_TIMESTAMP('2017-12-11 14:40:24','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02DIAET',TO_TIMESTAMP('2017-12-11 14:40:24','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:24.963
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560887 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:25.024
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558222,560888,0,540908,TO_TIMESTAMP('2017-12-11 14:40:24','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02BIOZID',TO_TIMESTAMP('2017-12-11 14:40:24','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:25.025
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560888 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:25.086
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558223,560889,0,540908,TO_TIMESTAMP('2017-12-11 14:40:25','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02PSM',TO_TIMESTAMP('2017-12-11 14:40:25','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:25.087
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560889 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:25.146
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558224,560890,0,540908,TO_TIMESTAMP('2017-12-11 14:40:25','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02TREZEP',TO_TIMESTAMP('2017-12-11 14:40:25','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:25.147
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560890 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:25.208
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558225,560891,0,540908,TO_TIMESTAMP('2017-12-11 14:40:25','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A0247AMG',TO_TIMESTAMP('2017-12-11 14:40:25','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:25.209
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560891 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:25.270
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558226,560892,0,540908,TO_TIMESTAMP('2017-12-11 14:40:25','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02130A18',TO_TIMESTAMP('2017-12-11 14:40:25','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:25.271
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560892 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:25.333
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558227,560893,0,540908,TO_TIMESTAMP('2017-12-11 14:40:25','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02130A1A8',TO_TIMESTAMP('2017-12-11 14:40:25','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:25.334
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560893 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:25.394
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558228,560894,0,540908,TO_TIMESTAMP('2017-12-11 14:40:25','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A0252B',TO_TIMESTAMP('2017-12-11 14:40:25','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:25.395
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560894 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:25.457
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558229,560895,0,540908,TO_TIMESTAMP('2017-12-11 14:40:25','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02BIOSIEG',TO_TIMESTAMP('2017-12-11 14:40:25','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:25.458
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560895 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:25.519
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558230,560896,0,540908,TO_TIMESTAMP('2017-12-11 14:40:25','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02KOSMET',TO_TIMESTAMP('2017-12-11 14:40:25','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:25.520
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560896 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:25.578
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558231,560897,0,540908,TO_TIMESTAMP('2017-12-11 14:40:25','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02STERIL',TO_TIMESTAMP('2017-12-11 14:40:25','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:25.579
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560897 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:25.638
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558232,560898,0,540908,TO_TIMESTAMP('2017-12-11 14:40:25','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02EB130B',TO_TIMESTAMP('2017-12-11 14:40:25','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:25.639
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560898 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:25.700
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558233,560899,0,540908,TO_TIMESTAMP('2017-12-11 14:40:25','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02WIRKSTO',TO_TIMESTAMP('2017-12-11 14:40:25','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:25.701
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560899 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:25.763
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558234,560900,0,540908,TO_TIMESTAMP('2017-12-11 14:40:25','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02ELEKTRO',TO_TIMESTAMP('2017-12-11 14:40:25','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:25.764
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560900 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:26.125
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558235,560901,0,540908,TO_TIMESTAMP('2017-12-11 14:40:25','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02EXPLOS',TO_TIMESTAMP('2017-12-11 14:40:25','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:26.126
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560901 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:26.187
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558236,560902,0,540908,TO_TIMESTAMP('2017-12-11 14:40:26','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02BIOTECH',TO_TIMESTAMP('2017-12-11 14:40:26','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:26.188
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560902 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:26.246
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558237,560903,0,540908,TO_TIMESTAMP('2017-12-11 14:40:26','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02ELEKEAR',TO_TIMESTAMP('2017-12-11 14:40:26','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:26.247
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560903 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:26.338
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558238,560904,0,540908,TO_TIMESTAMP('2017-12-11 14:40:26','YYYY-MM-DD HH24:MI:SS'),100,8,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02WEEEREG',TO_TIMESTAMP('2017-12-11 14:40:26','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:26.339
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560904 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:26.398
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558239,560905,0,540908,TO_TIMESTAMP('2017-12-11 14:40:26','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02BATTG',TO_TIMESTAMP('2017-12-11 14:40:26','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:26.399
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560905 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:26.460
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558240,560906,0,540908,TO_TIMESTAMP('2017-12-11 14:40:26','YYYY-MM-DD HH24:MI:SS'),100,8,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02MELDENR',TO_TIMESTAMP('2017-12-11 14:40:26','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:26.461
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560906 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:26.520
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558241,560907,0,540908,TO_TIMESTAMP('2017-12-11 14:40:26','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02RESERV1',TO_TIMESTAMP('2017-12-11 14:40:26','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:26.521
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560907 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:26.579
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558242,560908,0,540908,TO_TIMESTAMP('2017-12-11 14:40:26','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02RESERV2',TO_TIMESTAMP('2017-12-11 14:40:26','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:26.580
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560908 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:26.640
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558243,560909,0,540908,TO_TIMESTAMP('2017-12-11 14:40:26','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A02RESERV3',TO_TIMESTAMP('2017-12-11 14:40:26','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:26.641
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560909 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:26.704
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558244,560910,0,540908,TO_TIMESTAMP('2017-12-11 14:40:26','YYYY-MM-DD HH24:MI:SS'),100,8,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A11GDAT',TO_TIMESTAMP('2017-12-11 14:40:26','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:26.705
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560910 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:26.766
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558245,560911,0,540908,TO_TIMESTAMP('2017-12-11 14:40:26','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A11VERIFIZ',TO_TIMESTAMP('2017-12-11 14:40:26','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:26.767
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560911 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:26.828
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558246,560912,0,540908,TO_TIMESTAMP('2017-12-11 14:40:26','YYYY-MM-DD HH24:MI:SS'),100,6,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A11VERITES',TO_TIMESTAMP('2017-12-11 14:40:26','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:26.829
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560912 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:26.890
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558247,560913,0,540908,TO_TIMESTAMP('2017-12-11 14:40:26','YYYY-MM-DD HH24:MI:SS'),100,6,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A11VERIREA',TO_TIMESTAMP('2017-12-11 14:40:26','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:26.891
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560913 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:26.950
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558248,560914,0,540908,TO_TIMESTAMP('2017-12-11 14:40:26','YYYY-MM-DD HH24:MI:SS'),100,6,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A11VERIPFL',TO_TIMESTAMP('2017-12-11 14:40:26','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:26.951
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560914 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:27.009
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558249,560915,0,540908,TO_TIMESTAMP('2017-12-11 14:40:26','YYYY-MM-DD HH24:MI:SS'),100,8,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A03GDAT',TO_TIMESTAMP('2017-12-11 14:40:26','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:27.011
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560915 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:27.072
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558250,560916,0,540908,TO_TIMESTAMP('2017-12-11 14:40:27','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A03VTSTAT',TO_TIMESTAMP('2017-12-11 14:40:27','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:27.073
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560916 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:27.133
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558251,560917,0,540908,TO_TIMESTAMP('2017-12-11 14:40:27','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A03VWGGH',TO_TIMESTAMP('2017-12-11 14:40:27','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:27.134
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560917 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:27.193
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558252,560918,0,540908,TO_TIMESTAMP('2017-12-11 14:40:27','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A03VWGAPO',TO_TIMESTAMP('2017-12-11 14:40:27','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:27.194
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560918 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:27.255
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558253,560919,0,540908,TO_TIMESTAMP('2017-12-11 14:40:27','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A03VWGKAP',TO_TIMESTAMP('2017-12-11 14:40:27','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:27.257
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560919 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:27.316
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558254,560920,0,540908,TO_TIMESTAMP('2017-12-11 14:40:27','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A03VWGSEH',TO_TIMESTAMP('2017-12-11 14:40:27','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:27.317
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560920 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:27.376
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558255,560921,0,540908,TO_TIMESTAMP('2017-12-11 14:40:27','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A03VKSTAT',TO_TIMESTAMP('2017-12-11 14:40:27','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:27.377
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560921 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:27.436
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558256,560922,0,540908,TO_TIMESTAMP('2017-12-11 14:40:27','YYYY-MM-DD HH24:MI:SS'),100,8,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A06GDAT',TO_TIMESTAMP('2017-12-11 14:40:27','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:27.437
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560922 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:27.502
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558257,560923,0,540908,TO_TIMESTAMP('2017-12-11 14:40:27','YYYY-MM-DD HH24:MI:SS'),100,8,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A06PZNNF',TO_TIMESTAMP('2017-12-11 14:40:27','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:27.503
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560923 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:27.563
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558258,560924,0,540908,TO_TIMESTAMP('2017-12-11 14:40:27','YYYY-MM-DD HH24:MI:SS'),100,8,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A06PZNORIG',TO_TIMESTAMP('2017-12-11 14:40:27','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:27.564
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560924 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:27.625
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558259,560925,0,540908,TO_TIMESTAMP('2017-12-11 14:40:27','YYYY-MM-DD HH24:MI:SS'),100,8,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A09GDAT',TO_TIMESTAMP('2017-12-11 14:40:27','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:27.626
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560925 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:27.685
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558260,560926,0,540908,TO_TIMESTAMP('2017-12-11 14:40:27','YYYY-MM-DD HH24:MI:SS'),100,2,'de.metas.vertical.pharma','Y','Y','Y','N','N','N','N','N','A09THGP',TO_TIMESTAMP('2017-12-11 14:40:27','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:27.686
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560926 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:27.746
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsDisplayedGrid,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558261,560927,0,540908,TO_TIMESTAMP('2017-12-11 14:40:27','YYYY-MM-DD HH24:MI:SS'),100,10,'de.metas.vertical.pharma','Y','Y','N','N','N','N','N','N','N','Pharma Product',TO_TIMESTAMP('2017-12-11 14:40:27','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:27.747
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560927 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:27.807
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558271,560928,0,540908,TO_TIMESTAMP('2017-12-11 14:40:27','YYYY-MM-DD HH24:MI:SS'),100,'Mandant für diese Installation.',10,'de.metas.vertical.pharma','Ein Mandant ist eine Firma oder eine juristische Person. Sie können keine Daten über Mandanten hinweg verwenden. .','Y','Y','Y','N','N','N','N','N','Mandant',TO_TIMESTAMP('2017-12-11 14:40:27','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:27.808
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560928 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:40:27.868
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,558272,560929,0,540908,TO_TIMESTAMP('2017-12-11 14:40:27','YYYY-MM-DD HH24:MI:SS'),100,'Organisatorische Einheit des Mandanten',10,'de.metas.vertical.pharma','Eine Organisation ist ein Bereich ihres Mandanten - z.B. Laden oder Abteilung. Sie können Daten über Organisationen hinweg gemeinsam verwenden.','Y','Y','Y','N','N','N','N','N','Sektion',TO_TIMESTAMP('2017-12-11 14:40:27','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:40:27.869
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560929 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T14:41:22.422
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=10,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560928
;
-- 2017-12-11T14:41:22.426
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=20,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560929
;
-- 2017-12-11T14:41:22.428
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=30,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560811
;
-- 2017-12-11T14:41:22.430
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=40,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560815
;
-- 2017-12-11T14:41:22.432
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=50,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560812
;
-- 2017-12-11T14:41:22.434
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=60,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560810
;
-- 2017-12-11T14:41:22.436
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=70,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560806
;
-- 2017-12-11T14:41:22.438
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=80,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560814
;
-- 2017-12-11T14:41:22.441
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=90,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560816
;
-- 2017-12-11T14:41:22.443
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=100,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560813
;
-- 2017-12-11T14:41:22.444
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=110,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560807
;
-- 2017-12-11T14:41:22.446
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=120,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560809
;
-- 2017-12-11T14:41:22.447
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=130,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560808
;
-- 2017-12-11T14:41:22.449
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=140,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560817
;
-- 2017-12-11T14:41:22.450
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=150,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560819
;
-- 2017-12-11T14:41:22.452
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=160,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560805
;
-- 2017-12-11T14:41:22.453
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=170,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560804
;
-- 2017-12-11T14:41:22.456
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=180,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560818
;
-- 2017-12-11T14:41:22.458
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=190,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560857
;
-- 2017-12-11T14:41:22.459
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=200,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560851
;
-- 2017-12-11T14:41:22.461
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=210,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560859
;
-- 2017-12-11T14:41:22.463
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=220,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560850
;
-- 2017-12-11T14:41:22.464
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=230,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560849
;
-- 2017-12-11T14:41:22.466
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=240,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560848
;
-- 2017-12-11T14:41:22.467
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=250,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560858
;
-- 2017-12-11T14:41:22.469
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=260,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560852
;
-- 2017-12-11T14:41:22.472
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=270,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560860
;
-- 2017-12-11T14:41:22.473
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=280,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560861
;
-- 2017-12-11T14:41:22.475
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=290,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560839
;
-- 2017-12-11T14:41:22.477
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=300,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560847
;
-- 2017-12-11T14:41:22.479
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=310,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560855
;
-- 2017-12-11T14:41:22.481
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=320,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560856
;
-- 2017-12-11T14:41:22.483
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=330,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560862
;
-- 2017-12-11T14:41:22.484
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=340,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560863
;
-- 2017-12-11T14:41:22.485
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=350,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560864
;
-- 2017-12-11T14:41:22.488
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=360,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560846
;
-- 2017-12-11T14:41:22.490
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=370,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560842
;
-- 2017-12-11T14:41:22.492
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=380,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560841
;
-- 2017-12-11T14:41:22.494
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=390,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560843
;
-- 2017-12-11T14:41:22.495
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=400,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560840
;
-- 2017-12-11T14:41:22.497
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=410,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560844
;
-- 2017-12-11T14:41:22.499
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=420,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560845
;
-- 2017-12-11T14:41:22.501
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=430,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560853
;
-- 2017-12-11T14:41:22.504
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=440,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560854
;
-- 2017-12-11T14:41:22.506
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=450,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560892
;
-- 2017-12-11T14:41:22.509
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=460,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560893
;
-- 2017-12-11T14:41:22.511
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=470,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560891
;
-- 2017-12-11T14:41:22.513
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=480,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560894
;
-- 2017-12-11T14:41:22.515
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=490,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560866
;
-- 2017-12-11T14:41:22.518
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=500,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560879
;
-- 2017-12-11T14:41:22.521
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=510,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560868
;
-- 2017-12-11T14:41:22.524
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=520,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560881
;
-- 2017-12-11T14:41:22.527
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=530,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560905
;
-- 2017-12-11T14:41:22.529
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=540,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560895
;
-- 2017-12-11T14:41:22.531
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=550,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560902
;
-- 2017-12-11T14:41:22.533
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=560,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560888
;
-- 2017-12-11T14:41:22.535
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=570,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560871
;
-- 2017-12-11T14:41:22.536
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=580,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560870
;
-- 2017-12-11T14:41:22.538
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=590,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560887
;
-- 2017-12-11T14:41:22.540
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=600,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560873
;
-- 2017-12-11T14:41:22.542
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=610,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560898
;
-- 2017-12-11T14:41:22.544
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=620,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560903
;
-- 2017-12-11T14:41:22.545
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=630,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560900
;
-- 2017-12-11T14:41:22.547
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=640,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560901
;
-- 2017-12-11T14:41:22.548
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=650,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560865
;
-- 2017-12-11T14:41:22.550
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=660,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560882
;
-- 2017-12-11T14:41:22.551
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=670,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560876
;
-- 2017-12-11T14:41:22.553
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=680,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560878
;
-- 2017-12-11T14:41:22.557
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=690,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560896
;
-- 2017-12-11T14:41:22.559
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=700,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560885
;
-- 2017-12-11T14:41:22.562
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=710,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560877
;
-- 2017-12-11T14:41:22.564
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=720,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560906
;
-- 2017-12-11T14:41:22.566
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=730,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560867
;
-- 2017-12-11T14:41:22.568
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=740,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560875
;
-- 2017-12-11T14:41:22.569
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=750,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560886
;
-- 2017-12-11T14:41:22.571
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=760,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560880
;
-- 2017-12-11T14:41:22.573
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=770,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560889
;
-- 2017-12-11T14:41:22.575
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=780,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560907
;
-- 2017-12-11T14:41:22.577
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=790,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560908
;
-- 2017-12-11T14:41:22.579
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=800,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560909
;
-- 2017-12-11T14:41:22.581
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=810,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560883
;
-- 2017-12-11T14:41:22.583
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=820,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560897
;
-- 2017-12-11T14:41:22.585
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=830,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560872
;
-- 2017-12-11T14:41:22.586
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=840,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560874
;
-- 2017-12-11T14:41:22.588
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=850,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560890
;
-- 2017-12-11T14:41:22.592
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=860,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560869
;
-- 2017-12-11T14:41:22.595
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=870,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560904
;
-- 2017-12-11T14:41:22.597
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=880,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560899
;
-- 2017-12-11T14:41:22.599
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=890,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560884
;
-- 2017-12-11T14:41:22.601
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=900,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560915
;
-- 2017-12-11T14:41:22.604
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=910,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560921
;
-- 2017-12-11T14:41:22.606
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=920,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560916
;
-- 2017-12-11T14:41:22.608
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=930,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560918
;
-- 2017-12-11T14:41:22.611
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=940,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560917
;
-- 2017-12-11T14:41:22.613
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=950,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560919
;
-- 2017-12-11T14:41:22.616
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=960,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560920
;
-- 2017-12-11T14:41:22.619
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=970,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560835
;
-- 2017-12-11T14:41:22.622
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=980,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560832
;
-- 2017-12-11T14:41:22.624
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=990,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560836
;
-- 2017-12-11T14:41:22.627
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=1000,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560834
;
-- 2017-12-11T14:41:22.629
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=1010,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560833
;
-- 2017-12-11T14:41:22.632
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=1020,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560838
;
-- 2017-12-11T14:41:22.635
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=1030,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560837
;
-- 2017-12-11T14:41:22.637
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=1040,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560830
;
-- 2017-12-11T14:41:22.639
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=1050,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560827
;
-- 2017-12-11T14:41:22.642
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=1060,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560820
;
-- 2017-12-11T14:41:22.643
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=1070,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560823
;
-- 2017-12-11T14:41:22.646
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=1080,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560828
;
-- 2017-12-11T14:41:22.648
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=1090,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560826
;
-- 2017-12-11T14:41:22.650
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=1100,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560831
;
-- 2017-12-11T14:41:22.652
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=1110,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560822
;
-- 2017-12-11T14:41:22.657
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=1120,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560824
;
-- 2017-12-11T14:41:22.660
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=1130,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560825
;
-- 2017-12-11T14:41:22.662
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=1140,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560821
;
-- 2017-12-11T14:41:22.664
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=1150,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560829
;
-- 2017-12-11T14:41:22.666
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=1160,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560922
;
-- 2017-12-11T14:41:22.668
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=1170,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560923
;
-- 2017-12-11T14:41:22.670
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=1180,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560924
;
-- 2017-12-11T14:41:22.673
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=1190,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560925
;
-- 2017-12-11T14:41:22.675
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=1200,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560926
;
-- 2017-12-11T14:41:22.677
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=1210,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560910
;
-- 2017-12-11T14:41:22.680
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=1220,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560911
;
-- 2017-12-11T14:41:22.682
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=1230,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560914
;
-- 2017-12-11T14:41:22.684
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=1240,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560913
;
-- 2017-12-11T14:41:22.686
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=1250,Updated=TO_TIMESTAMP('2017-12-11 14:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560912
;
-- 2017-12-11T14:41:27.364
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsSameLine='Y',Updated=TO_TIMESTAMP('2017-12-11 14:41:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560929
;
UPDATE AD_Field SET SeqNo = 5 WHERE Name = 'A00SSATZ';
UPDATE AD_Field SET SeqNo = 6 WHERE Name = 'A00PZN';
UPDATE AD_Field SET SeqNo = 7 WHERE Name = 'A00GDAT';
UPDATE AD_Field SET SeqNo = 8 WHERE Name = 'A00PBEZ';
UPDATE AD_Field SET SeqNo = 9 WHERE Name = 'A00PGMENG';
UPDATE AD_Field SET SeqNo = 10 WHERE Name = 'A00PGEINH';
UPDATE AD_Field SET SeqNo = 11 WHERE Name = 'A00DARFO';
UPDATE AD_Field SET SeqNo = 12 WHERE Name = 'A00ANBNR4';
UPDATE AD_Field SET SeqNo = 13 WHERE Name = 'A00ATYP';
UPDATE AD_Field SET SeqNo = 14 WHERE Name = 'A00LKZ';
UPDATE AD_Field SET SeqNo = 15 WHERE Name = 'A00GTIN';
UPDATE AD_Field SET SeqNo = 16 WHERE Name = 'A00ARTNR';
UPDATE AD_Field SET SeqNo = 17 WHERE Name = 'A00HMNR';
UPDATE AD_Field SET SeqNo = 18 WHERE Name = 'A00PNAM';
UPDATE AD_Field SET SeqNo = 19 WHERE Name = 'A00WGA';
UPDATE AD_Field SET SeqNo = 20 WHERE Name = 'A00PPN';
UPDATE AD_Field SET SeqNo = 21 WHERE Name = 'A05GDAT';
UPDATE AD_Field SET SeqNo = 22 WHERE Name = 'A05VFDAT';
UPDATE AD_Field SET SeqNo = 23 WHERE Name = 'A05LZEIT';
UPDATE AD_Field SET SeqNo = 24 WHERE Name = 'A05KKETTE';
UPDATE AD_Field SET SeqNo = 25 WHERE Name = 'A05TMAX';
UPDATE AD_Field SET SeqNo = 26 WHERE Name = 'A05TMIN';
UPDATE AD_Field SET SeqNo = 27 WHERE Name = 'A05LICHT';
UPDATE AD_Field SET SeqNo = 28 WHERE Name = 'A05FEUCHT';
UPDATE AD_Field SET SeqNo = 29 WHERE Name = 'A05LAGE';
UPDATE AD_Field SET SeqNo = 30 WHERE Name = 'A05ZERBR';
UPDATE AD_Field SET SeqNo = 31 WHERE Name = 'A05EICH';
UPDATE AD_Field SET SeqNo = 32 WHERE Name = 'A05LZEICH';
UPDATE AD_Field SET SeqNo = 33 WHERE Name = 'A04GDAT';
UPDATE AD_Field SET SeqNo = 34 WHERE Name = 'A04LAENGE';
UPDATE AD_Field SET SeqNo = 35 WHERE Name = 'A04HOEHE';
UPDATE AD_Field SET SeqNo = 36 WHERE Name = 'A04BREITE';
UPDATE AD_Field SET SeqNo = 37 WHERE Name = 'A04GWCHT';
UPDATE AD_Field SET SeqNo = 38 WHERE Name = 'A04VPART';
UPDATE AD_Field SET SeqNo = 39 WHERE Name = 'A04MBEST';
UPDATE AD_Field SET SeqNo = 40 WHERE Name = 'A01GDAT';
UPDATE AD_Field SET SeqNo = 41 WHERE Name = 'A01SKAEP';
UPDATE AD_Field SET SeqNo = 42 WHERE Name = 'A01SAPU';
UPDATE AD_Field SET SeqNo = 43 WHERE Name = 'A01SAEP';
UPDATE AD_Field SET SeqNo = 44 WHERE Name = 'A01SAVP';
UPDATE AD_Field SET SeqNo = 45 WHERE Name = 'A01SUVP';
UPDATE AD_Field SET SeqNo = 46 WHERE Name = 'A01SZBV';
UPDATE AD_Field SET SeqNo = 47 WHERE Name = 'A01SAB130A';
UPDATE AD_Field SET SeqNo = 48 WHERE Name = 'A01KAEP';
UPDATE AD_Field SET SeqNo = 49 WHERE Name = 'A01APU';
UPDATE AD_Field SET SeqNo = 50 WHERE Name = 'A01AMPVSGB';
UPDATE AD_Field SET SeqNo = 51 WHERE Name = 'A01AMPVAMG';
UPDATE AD_Field SET SeqNo = 52 WHERE Name = 'A01AEP';
UPDATE AD_Field SET SeqNo = 53 WHERE Name = 'A01AVP';
UPDATE AD_Field SET SeqNo = 54 WHERE Name = 'A01UVP';
UPDATE AD_Field SET SeqNo = 55 WHERE Name = 'A01ZBV';
UPDATE AD_Field SET SeqNo = 56 WHERE Name = 'A01MWST';
UPDATE AD_Field SET SeqNo = 57 WHERE Name = 'A01PPU';
UPDATE AD_Field SET SeqNo = 58 WHERE Name = 'A01AB130A2';
UPDATE AD_Field SET SeqNo = 59 WHERE Name = 'A01APU783A';
UPDATE AD_Field SET SeqNo = 60 WHERE Name = 'A01AEPPPU';
UPDATE AD_Field SET SeqNo = 61 WHERE Name = 'A01AVPPPU';
UPDATE AD_Field SET SeqNo = 62 WHERE Name = 'A01DPPUAPU';
UPDATE AD_Field SET SeqNo = 63 WHERE Name = 'A01RESERV1';
UPDATE AD_Field SET SeqNo = 64 WHERE Name = 'A01RESERV2';
UPDATE AD_Field SET SeqNo = 65 WHERE Name = 'A01RESERV3';
UPDATE AD_Field SET SeqNo = 66 WHERE Name = 'A02GDAT';
UPDATE AD_Field SET SeqNo = 67 WHERE Name = 'A02AM';
UPDATE AD_Field SET SeqNo = 68 WHERE Name = 'A02MP';
UPDATE AD_Field SET SeqNo = 69 WHERE Name = 'A02APPFL';
UPDATE AD_Field SET SeqNo = 70 WHERE Name = 'A02VSPFL';
UPDATE AD_Field SET SeqNo = 71 WHERE Name = 'A02BTM';
UPDATE AD_Field SET SeqNo = 72 WHERE Name = 'A02BOPST';
UPDATE AD_Field SET SeqNo = 73 WHERE Name = 'A02TFG';
UPDATE AD_Field SET SeqNo = 74 WHERE Name = 'A02DROCH';
UPDATE AD_Field SET SeqNo = 75 WHERE Name = 'A02TIERAM';
UPDATE AD_Field SET SeqNo = 76 WHERE Name = 'A02NEGLIS';
UPDATE AD_Field SET SeqNo = 77 WHERE Name = 'A02HMZV';
UPDATE AD_Field SET SeqNo = 78 WHERE Name = 'A02LIFSTYL';
UPDATE AD_Field SET SeqNo = 79 WHERE Name = 'A02HOMOEO';
UPDATE AD_Field SET SeqNo = 80 WHERE Name = 'A02ANTHRO';
UPDATE AD_Field SET SeqNo = 81 WHERE Name = 'A02PHYTO';
UPDATE AD_Field SET SeqNo = 82 WHERE Name = 'A02AUSNREI';
UPDATE AD_Field SET SeqNo = 83 WHERE Name = 'A02GENER';
UPDATE AD_Field SET SeqNo = 84 WHERE Name = 'A02SDB';
UPDATE AD_Field SET SeqNo = 85 WHERE Name = 'A02ZULREG';
UPDATE AD_Field SET SeqNo = 86 WHERE Name = 'A02LEBENSM';
UPDATE AD_Field SET SeqNo = 87 WHERE Name = 'A02NEM';
UPDATE AD_Field SET SeqNo = 88 WHERE Name = 'A02DIAET';
UPDATE AD_Field SET SeqNo = 89 WHERE Name = 'A02BIOZID';
UPDATE AD_Field SET SeqNo = 90 WHERE Name = 'A02PSM';
UPDATE AD_Field SET SeqNo = 91 WHERE Name = 'A02TREZEP';
UPDATE AD_Field SET SeqNo = 92 WHERE Name = 'A0247AMG';
UPDATE AD_Field SET SeqNo = 93 WHERE Name = 'A02130A18';
UPDATE AD_Field SET SeqNo = 94 WHERE Name = 'A02130A1A8';
UPDATE AD_Field SET SeqNo = 95 WHERE Name = 'A0252B';
UPDATE AD_Field SET SeqNo = 96 WHERE Name = 'A02BIOSIEG';
UPDATE AD_Field SET SeqNo = 97 WHERE Name = 'A02KOSMET';
UPDATE AD_Field SET SeqNo = 98 WHERE Name = 'A02STERIL';
UPDATE AD_Field SET SeqNo = 99 WHERE Name = 'A02EB130B';
UPDATE AD_Field SET SeqNo = 100 WHERE Name = 'A02WIRKSTO';
UPDATE AD_Field SET SeqNo = 101 WHERE Name = 'A02ELEKTRO';
UPDATE AD_Field SET SeqNo = 102 WHERE Name = 'A02EXPLOS';
UPDATE AD_Field SET SeqNo = 103 WHERE Name = 'A02BIOTECH';
UPDATE AD_Field SET SeqNo = 104 WHERE Name = 'A02ELEKEAR';
UPDATE AD_Field SET SeqNo = 105 WHERE Name = 'A02WEEEREG';
UPDATE AD_Field SET SeqNo = 106 WHERE Name = 'A02BATTG';
UPDATE AD_Field SET SeqNo = 107 WHERE Name = 'A02MELDENR';
UPDATE AD_Field SET SeqNo = 108 WHERE Name = 'A02RESERV1';
UPDATE AD_Field SET SeqNo = 109 WHERE Name = 'A02RESERV2';
UPDATE AD_Field SET SeqNo = 110 WHERE Name = 'A02RESERV3';
UPDATE AD_Field SET SeqNo = 111 WHERE Name = 'A11GDAT';
UPDATE AD_Field SET SeqNo = 112 WHERE Name = 'A11VERIFIZ';
UPDATE AD_Field SET SeqNo = 113 WHERE Name = 'A11VERITES';
UPDATE AD_Field SET SeqNo = 114 WHERE Name = 'A11VERIREA';
UPDATE AD_Field SET SeqNo = 115 WHERE Name = 'A11VERIPFL';
UPDATE AD_Field SET SeqNo = 116 WHERE Name = 'A03GDAT';
UPDATE AD_Field SET SeqNo = 117 WHERE Name = 'A03VTSTAT';
UPDATE AD_Field SET SeqNo = 118 WHERE Name = 'A03VWGGH';
UPDATE AD_Field SET SeqNo = 119 WHERE Name = 'A03VWGAPO';
UPDATE AD_Field SET SeqNo = 120 WHERE Name = 'A03VWGKAP';
UPDATE AD_Field SET SeqNo = 121 WHERE Name = 'A03VWGSEH';
UPDATE AD_Field SET SeqNo = 122 WHERE Name = 'A03VKSTAT';
UPDATE AD_Field SET SeqNo = 123 WHERE Name = 'A06GDAT';
UPDATE AD_Field SET SeqNo = 124 WHERE Name = 'A06PZNNF';
UPDATE AD_Field SET SeqNo = 125 WHERE Name = 'A06PZNORIG';
UPDATE AD_Field SET SeqNo = 126 WHERE Name = 'A09GDAT';
UPDATE AD_Field SET SeqNo = 127 WHERE Name = 'A09THGP';
-- 2017-12-11T14:48:28.967
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SeqNo=1,Updated=TO_TIMESTAMP('2017-12-11 14:48:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560928
;
-- 2017-12-11T14:48:37.746
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SeqNo=2,Updated=TO_TIMESTAMP('2017-12-11 14:48:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560929
;
-- 2017-12-11T14:49:24.113
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Menu (Action,AD_Client_ID,AD_Menu_ID,AD_Org_ID,AD_Window_ID,Created,CreatedBy,EntityType,InternalName,IsActive,IsCreateNew,IsReadOnly,IsSOTrx,IsSummary,Name,Updated,UpdatedBy) VALUES ('W',0,540999,0,540386,TO_TIMESTAMP('2017-12-11 14:49:23','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Import Pharma Product','Y','N','N','N','N','Import Pharma Product',TO_TIMESTAMP('2017-12-11 14:49:23','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:49:24.116
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Menu_Trl (AD_Language,AD_Menu_ID, Description,Name,WEBUI_NameBrowse,WEBUI_NameNew,WEBUI_NameNewBreadcrumb, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Menu_ID, t.Description,t.Name,t.WEBUI_NameBrowse,t.WEBUI_NameNew,t.WEBUI_NameNewBreadcrumb, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Menu t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Menu_ID=540999 AND NOT EXISTS (SELECT 1 FROM AD_Menu_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Menu_ID=t.AD_Menu_ID)
;
-- 2017-12-11T14:49:24.119
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_TreeNodeMM (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo) SELECT t.AD_Client_ID,0, 'Y', now(), 100, now(), 100,t.AD_Tree_ID, 540999, 0, 999 FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.AD_Table_ID=116 AND NOT EXISTS (SELECT * FROM AD_TreeNodeMM e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=540999)
;
-- 2017-12-11T15:58:15.593
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table SET AD_Window_ID=540386,Updated=TO_TIMESTAMP('2017-12-11 15:58:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=540880
;
-- 2017-12-11T15:58:53.372
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,ColumnDisplayLength,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IncludedTabHeight,IsActive,IsCentrallyMaintained,IsDisplayed,IsDisplayedGrid,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SeqNoGrid,SortNo,SpanX,SpanY,Updated,UpdatedBy) VALUES (0,558279,560930,0,540908,0,TO_TIMESTAMP('2017-12-11 15:58:53','YYYY-MM-DD HH24:MI:SS'),100,'Ist dieser Import verarbeitet worden?',0,'U','DasSelektionsfeld "Importiert" zeigt an, ob dieser Import verarbeitet worden ist.',0,'Y','Y','Y','Y','N','N','N','N','N','Importiert',137,10,0,1,1,TO_TIMESTAMP('2017-12-11 15:58:53','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T15:58:53.376
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560930 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-12-11T15:59:14.919
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,ColumnDisplayLength,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IncludedTabHeight,IsActive,IsCentrallyMaintained,IsDisplayed,IsDisplayedGrid,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SeqNoGrid,SortNo,SpanX,SpanY,Updated,UpdatedBy) VALUES (0,558278,560931,0,540908,0,TO_TIMESTAMP('2017-12-11 15:59:14','YYYY-MM-DD HH24:MI:SS'),100,'Meldungen, die durch den Importprozess generiert wurden',0,'U','"Import-Fehlermeldung" zeigt alle Fehlermeldungen an, die durch den Importprozess generiert wurden.',0,'Y','Y','Y','Y','N','N','N','N','Y','Import-Fehlermeldung',147,20,0,1,1,TO_TIMESTAMP('2017-12-11 15:59:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T15:59:14.923
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=560931 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
; | the_stack |
;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
# Dump of table group
# ------------------------------------------------------------
DROP TABLE IF EXISTS `group`;
CREATE TABLE `group` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL DEFAULT '',
`avatar` varchar(255) DEFAULT NULL,
`intrduce` text COMMENT '群介绍',
`limit` int(5) NOT NULL DEFAULT '100' COMMENT '群上限',
`create_uid` bigint(20) NOT NULL COMMENT '创建人',
`create_time` bigint(20) NOT NULL,
`status` int(2) NOT NULL DEFAULT '1' COMMENT '状态',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
LOCK TABLES `group` WRITE;
/*!40000 ALTER TABLE `group` DISABLE KEYS */;
INSERT INTO `group` (`id`, `name`, `avatar`, `intrduce`, `limit`, `create_uid`, `create_time`, `status`)
VALUES
(1000,'测试一群','https://im.wangcai.me/speedy_avatar_7.jpg','测试一群',100,1000,1591349594288,1);
/*!40000 ALTER TABLE `group` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table message
# ------------------------------------------------------------
DROP TABLE IF EXISTS `message`;
CREATE TABLE `message` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) NOT NULL,
`hash` varchar(40) NOT NULL DEFAULT '',
`dist_id` bigint(20) NOT NULL COMMENT '群聊是id是群的id',
`dist_type` tinyint(2) NOT NULL DEFAULT '1' COMMENT '1 - 私聊 2 - 群聊',
`is_received` tinyint(2) NOT NULL DEFAULT '0' COMMENT '对方是否收到',
`is_sent` tinyint(2) NOT NULL DEFAULT '0' COMMENT '是否已经发送给对方',
`content_type` varchar(20) NOT NULL DEFAULT 'text' COMMENT 'text,audio,image,video',
`content` text NOT NULL COMMENT '内容或者地址',
`create_time` bigint(20) NOT NULL,
`status` tinyint(2) NOT NULL DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
LOCK TABLES `message` WRITE;
/*!40000 ALTER TABLE `message` DISABLE KEYS */;
INSERT INTO `message` (`id`, `user_id`, `hash`, `dist_id`, `dist_type`, `is_received`, `is_sent`, `content_type`, `content`, `create_time`, `status`)
VALUES
(1,1000,'',1001,1,0,0,'text','你好',1591349594288,1),
(2,1000,'',1002,1,0,0,'text','你也好',1591349594288,1),
(3,1000,'',1001,1,0,0,'text','在吗?',1591355800809,1),
(4,1001,'',1000,1,0,1,'text','你好',1591349594288,1),
(5,1002,'',1000,1,0,1,'text','你好',1591349594288,1),
(6,1003,'',1000,1,0,1,'text','你好',1591349594288,1),
(7,1000,'a7dbd60473e1fad7e4a2cb12d15876d9',1002,1,0,0,'text','dada',1602592829490,1),
(8,1000,'b8ff71585ec8b878872718ebee9e401d',1002,1,0,0,'text','12',1602593358750,1);
/*!40000 ALTER TABLE `message` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table relation
# ------------------------------------------------------------
DROP TABLE IF EXISTS `relation`;
CREATE TABLE `relation` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`uid` bigint(20) NOT NULL,
`friend_id` bigint(20) NOT NULL,
`remark` varchar(255) NOT NULL DEFAULT '',
`status` int(2) NOT NULL DEFAULT '1' COMMENT '0 - 删除 1 - 正常 2 - 拉黑',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
LOCK TABLES `relation` WRITE;
/*!40000 ALTER TABLE `relation` DISABLE KEYS */;
INSERT INTO `relation` (`id`, `uid`, `friend_id`, `remark`, `status`)
VALUES
(1,1000,1001,'',1),
(2,1000,1002,'',1),
(3,1000,1003,'',1),
(4,1001,1000,'',1),
(5,1002,1000,'',1),
(6,1003,1000,'',1);
/*!40000 ALTER TABLE `relation` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table role
# ------------------------------------------------------------
DROP TABLE IF EXISTS `role`;
CREATE TABLE `role` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL DEFAULT '',
`status` tinyint(4) NOT NULL DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
LOCK TABLES `role` WRITE;
/*!40000 ALTER TABLE `role` DISABLE KEYS */;
INSERT INTO `role` (`id`, `name`, `status`)
VALUES
(1000,'管理员',1);
/*!40000 ALTER TABLE `role` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table user
# ------------------------------------------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`nickname` varchar(255) NOT NULL DEFAULT '',
`mobile` bigint(11) NOT NULL,
`password` varchar(255) NOT NULL DEFAULT '',
`avatar` varchar(255) DEFAULT '',
`sex` tinyint(3) NOT NULL DEFAULT '2' COMMENT '0 - 男 1 - 女 2 - 未知',
`token` varchar(255) DEFAULT NULL,
`client_id` varchar(255) DEFAULT NULL COMMENT 'socket_id',
`client_type` varchar(50) DEFAULT NULL COMMENT 'android/ios',
`create_time` bigint(20) NOT NULL,
`status` tinyint(2) NOT NULL DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
LOCK TABLES `user` WRITE;
/*!40000 ALTER TABLE `user` DISABLE KEYS */;
INSERT INTO `user` (`id`, `nickname`, `mobile`, `password`, `avatar`, `sex`, `token`, `client_id`, `client_type`, `create_time`, `status`)
VALUES
(1000,'罗老魔',13600000000,'81c4369bea82d8daafd75818497dc962033a1dcc','https://im.wangcai.me/speedy_avatar_6.jpg',0,'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjEwMDAsImlhdCI6MTYwMjU5MjI1NywiZXhwIjoxNjAzMTk3MDU3fQ.5n49dPHRqCf8i82rYlL1YknrIeCqSWhrNeUvFjEE9jA','/chat#sy6u7rmq0Ag-uxH-AAAC','android',1591349594288,1),
(1001,'小七',13600000001,'81c4369bea82d8daafd75818497dc962033a1dcc','https://im.wangcai.me/speedy_avatar_1.jpg',1,NULL,NULL,NULL,1591349594288,1),
(1002,'小白',13600000002,'81c4369bea82d8daafd75818497dc962033a1dcc','https://im.wangcai.me/speedy_avatar_2.jpg',1,NULL,NULL,NULL,1591349594288,1),
(1003,'小青',13600000003,'81c4369bea82d8daafd75818497dc962033a1dcc','https://im.wangcai.me/speedy_avatar_3.jpg',1,NULL,NULL,NULL,1591349594288,1);
/*!40000 ALTER TABLE `user` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table user_group
# ------------------------------------------------------------
DROP TABLE IF EXISTS `user_group`;
CREATE TABLE `user_group` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`uid` bigint(20) NOT NULL,
`group_id` bigint(20) NOT NULL,
`remark` varchar(255) DEFAULT NULL COMMENT '群备注,别名',
`role_id` int(11) DEFAULT NULL COMMENT '群角色',
`status` tinyint(4) NOT NULL DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
LOCK TABLES `user_group` WRITE;
/*!40000 ALTER TABLE `user_group` DISABLE KEYS */;
INSERT INTO `user_group` (`id`, `uid`, `group_id`, `remark`, `role_id`, `status`)
VALUES
(1000,1000,1000,NULL,1000,1);
/*!40000 ALTER TABLE `user_group` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table view_user_friends
# ------------------------------------------------------------
DROP VIEW IF EXISTS `view_user_friends`;
CREATE TABLE `view_user_friends` (
`id` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
`uid` BIGINT(20) NOT NULL,
`friend_id` BIGINT(20) NOT NULL,
`remark` VARCHAR(255) NOT NULL DEFAULT '',
`nickname` VARCHAR(255) NOT NULL DEFAULT '',
`mobile` BIGINT(11) NOT NULL,
`avatar` VARCHAR(255) NULL DEFAULT '',
`sex` TINYINT(3) NOT NULL DEFAULT '2',
`client_id` VARCHAR(255) NULL DEFAULT NULL,
`client_type` VARCHAR(50) NULL DEFAULT NULL,
`create_time` BIGINT(20) NOT NULL,
`status` INT(2) NOT NULL DEFAULT '1'
) ENGINE=MyISAM;
# Dump of table view_user_group
# ------------------------------------------------------------
DROP VIEW IF EXISTS `view_user_group`;
CREATE TABLE `view_user_group` (
`uid` BIGINT(20) NOT NULL,
`user_group_remark` VARCHAR(255) NULL DEFAULT NULL,
`user_group_status` TINYINT(4) NOT NULL DEFAULT '1',
`group_id` BIGINT(20) NOT NULL,
`name` VARCHAR(255) NULL DEFAULT '',
`avatar` VARCHAR(255) NULL DEFAULT NULL,
`intrduce` TEXT NULL DEFAULT NULL,
`limit` INT(5) NULL DEFAULT '100',
`group_status` INT(2) NULL DEFAULT '1',
`create_time` BIGINT(20) NULL DEFAULT NULL,
`role_name` VARCHAR(255) NULL DEFAULT '',
`role_id` INT(11) NULL DEFAULT NULL,
`role_status` TINYINT(4) NULL DEFAULT '1'
) ENGINE=MyISAM;
# Replace placeholder table for view_user_friends with correct view syntax
# ------------------------------------------------------------
DROP TABLE `view_user_friends`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `view_user_friends`
AS SELECT
`R`.`id` AS `id`,
`R`.`uid` AS `uid`,
`R`.`friend_id` AS `friend_id`,
`R`.`remark` AS `remark`,
`U`.`nickname` AS `nickname`,
`U`.`mobile` AS `mobile`,
`U`.`avatar` AS `avatar`,
`U`.`sex` AS `sex`,
`U`.`client_id` AS `client_id`,
`U`.`client_type` AS `client_type`,
`U`.`create_time` AS `create_time`,
`R`.`status` AS `status`
FROM (`user` `U` join `relation` `R` on((`U`.`id` = `R`.`friend_id`)));
# Replace placeholder table for view_user_group with correct view syntax
# ------------------------------------------------------------
DROP TABLE `view_user_group`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `view_user_group`
AS SELECT
`u`.`uid` AS `uid`,
`u`.`remark` AS `user_group_remark`,
`u`.`status` AS `user_group_status`,
`u`.`group_id` AS `group_id`,
`a`.`name` AS `name`,
`a`.`avatar` AS `avatar`,
`a`.`intrduce` AS `intrduce`,
`a`.`limit` AS `limit`,
`a`.`status` AS `group_status`,
`a`.`create_time` AS `create_time`,
`b`.`name` AS `role_name`,
`u`.`role_id` AS `role_id`,
`b`.`status` AS `role_status`
FROM ((`user_group` `u` left join `group` `a` on((`u`.`group_id` = `a`.`id`))) left join `role` `b` on((`u`.`role_id` = `b`.`id`)));
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; | the_stack |
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `mailscanner`
--
CREATE DATABASE IF NOT EXISTS `mailscanner` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
USE `mailscanner`;
-- --------------------------------------------------------
--
-- Table structure for table `audit_log`
--
CREATE TABLE IF NOT EXISTS `audit_log` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`user` varchar(191) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`ip_address` varchar(15) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`action` text COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `autorelease`
--
CREATE TABLE IF NOT EXISTS `autorelease` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`msg_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`uid` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `blacklist`
--
CREATE TABLE IF NOT EXISTS `blacklist` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`to_address` text COLLATE utf8_unicode_ci,
`to_domain` text COLLATE utf8_unicode_ci,
`from_address` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
UNIQUE KEY `blacklist_uniq` (`to_address`(100),`from_address`(100))
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `inq`
--
CREATE TABLE IF NOT EXISTS `inq` (
`inq_id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`id` mediumtext COLLATE utf8_unicode_ci,
`cdate` date DEFAULT NULL,
`ctime` time DEFAULT NULL,
`from_address` mediumtext COLLATE utf8_unicode_ci,
`to_address` mediumtext COLLATE utf8_unicode_ci,
`subject` mediumtext COLLATE utf8_unicode_ci,
`message` mediumtext COLLATE utf8_unicode_ci,
`size` mediumtext COLLATE utf8_unicode_ci,
`priority` mediumtext COLLATE utf8_unicode_ci,
`attempts` mediumtext COLLATE utf8_unicode_ci,
`lastattempt` mediumtext COLLATE utf8_unicode_ci,
`hostname` mediumtext COLLATE utf8_unicode_ci,
PRIMARY KEY (`inq_id`),
KEY `inq_hostname` (`hostname`(50))
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `maillog`
--
CREATE TABLE IF NOT EXISTS `maillog` (
`maillog_id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`timestamp` timestamp NULL,
`id` mediumtext COLLATE utf8_unicode_ci,
`size` bigint(20) DEFAULT '0',
`from_address` mediumtext COLLATE utf8_unicode_ci,
`from_domain` mediumtext COLLATE utf8_unicode_ci,
`to_address` mediumtext COLLATE utf8_unicode_ci,
`to_domain` mediumtext COLLATE utf8_unicode_ci,
`subject` mediumtext COLLATE utf8_unicode_ci,
`clientip` mediumtext COLLATE utf8_unicode_ci,
`archive` mediumtext COLLATE utf8_unicode_ci,
`isspam` tinyint(1) DEFAULT '0',
`ishighspam` tinyint(1) DEFAULT '0',
`issaspam` tinyint(1) DEFAULT '0',
`isrblspam` tinyint(1) DEFAULT '0',
`isfp` tinyint(1) DEFAULT '0',
`isfn` tinyint(1) DEFAULT '0',
`spamwhitelisted` tinyint(1) DEFAULT '0',
`spamblacklisted` tinyint(1) DEFAULT '0',
`sascore` decimal(7,2) DEFAULT '0.00',
`spamreport` mediumtext COLLATE utf8_unicode_ci,
`virusinfected` tinyint(1) DEFAULT '0',
`nameinfected` tinyint(2) DEFAULT '0',
`otherinfected` tinyint(1) DEFAULT '0',
`report` mediumtext COLLATE utf8_unicode_ci,
`ismcp` tinyint(1) DEFAULT '0',
`ishighmcp` tinyint(1) DEFAULT '0',
`issamcp` tinyint(1) DEFAULT '0',
`mcpwhitelisted` tinyint(1) DEFAULT '0',
`mcpblacklisted` tinyint(1) DEFAULT '0',
`mcpsascore` decimal(7,2) DEFAULT '0.00',
`mcpreport` mediumtext COLLATE utf8_unicode_ci,
`hostname` mediumtext COLLATE utf8_unicode_ci,
`date` date DEFAULT NULL,
`time` time DEFAULT NULL,
`headers` mediumtext COLLATE utf8_unicode_ci,
`quarantined` tinyint(1) DEFAULT '0',
`rblspamreport` mediumtext COLLATE utf8_unicode_ci DEFAULT NULL,
`token` CHAR(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`released` tinyint(1) DEFAULT '0',
`salearn` tinyint(1) DEFAULT '0',
`last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`maillog_id`),
KEY `maillog_datetime_idx` (`date`,`time`),
KEY `maillog_id_idx` (`id`(20)),
KEY `maillog_clientip_idx` (`clientip`(20)),
KEY `maillog_from_idx` (`from_address`(191)),
KEY `maillog_to_idx` (`to_address`(191)),
KEY `maillog_host` (`hostname`(30)),
KEY `from_domain_idx` (`from_domain`(50)),
KEY `to_domain_idx` (`to_domain`(50)),
KEY `maillog_quarantined` (`quarantined`),
KEY `timestamp_idx` (`timestamp`)
/*!50604 , FULLTEXT KEY `subject_idx` (`subject`) */
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `mcp_rules`
--
CREATE TABLE IF NOT EXISTS `mcp_rules` (
`rule` char(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`rule_desc` char(200) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
PRIMARY KEY (`rule`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `mtalog`
--
CREATE TABLE IF NOT EXISTS `mtalog` (
`mtalog_id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`timestamp` datetime DEFAULT NULL,
`host` mediumtext COLLATE utf8_unicode_ci,
`type` mediumtext COLLATE utf8_unicode_ci,
`msg_id` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
`relay` mediumtext COLLATE utf8_unicode_ci,
`dsn` mediumtext COLLATE utf8_unicode_ci,
`status` mediumtext COLLATE utf8_unicode_ci,
`delay` time DEFAULT NULL,
PRIMARY KEY (`mtalog_id`),
UNIQUE KEY `mtalog_uniq` (`timestamp`,`host`(10),`type`(10),`msg_id`,`relay`(20)),
KEY `mtalog_timestamp` (`timestamp`),
KEY `mtalog_type` (`type`(10)),
KEY `msg_id` (`msg_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `mtalog_ids`
--
CREATE TABLE IF NOT EXISTS `mtalog_ids` (
`smtpd_id` varchar(20) CHARACTER SET ascii DEFAULT NULL,
`smtp_id` varchar(20) CHARACTER SET ascii DEFAULT NULL,
UNIQUE KEY `mtalog_ids_idx` (`smtpd_id`,`smtp_id`),
KEY `smtpd_id` (`smtpd_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `outq`
--
CREATE TABLE IF NOT EXISTS `outq` (
`outq_id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`id` mediumtext COLLATE utf8_unicode_ci,
`cdate` date DEFAULT NULL,
`ctime` time DEFAULT NULL,
`from_address` mediumtext COLLATE utf8_unicode_ci,
`to_address` mediumtext COLLATE utf8_unicode_ci,
`subject` mediumtext COLLATE utf8_unicode_ci,
`message` mediumtext COLLATE utf8_unicode_ci,
`size` mediumtext COLLATE utf8_unicode_ci,
`priority` mediumtext COLLATE utf8_unicode_ci,
`attempts` mediumtext COLLATE utf8_unicode_ci,
`lastattempt` mediumtext COLLATE utf8_unicode_ci,
`hostname` mediumtext COLLATE utf8_unicode_ci,
PRIMARY KEY (`outq_id`),
KEY `outq_hostname` (`hostname`(50))
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `saved_filters`
--
CREATE TABLE IF NOT EXISTS `saved_filters` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`col` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`operator` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`value` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`username` mediumtext COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `unique_filters` (`name`(20),`col`(20),`operator`(20),`value`(20),`username`(20))
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `sa_rules`
--
CREATE TABLE IF NOT EXISTS `sa_rules` (
`rule` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`rule_desc` varchar(200) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
PRIMARY KEY (`rule`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE IF NOT EXISTS `users` (
`id` BIGINT NOT NULL AUTO_INCREMENT UNIQUE KEY,
`username` varchar(191) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`password` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`fullname` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`type` enum('A','D','U','R','H') COLLATE utf8_unicode_ci DEFAULT NULL,
`quarantine_report` tinyint(1) DEFAULT '0',
`spamscore` float DEFAULT '0',
`highspamscore` float DEFAULT '0',
`noscan` tinyint(1) DEFAULT '0',
`quarantine_rcpt` varchar(60) COLLATE utf8_unicode_ci DEFAULT NULL,
`resetid` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL,
`resetexpire` bigint(20) COLLATE utf8_unicode_ci DEFAULT NULL,
`lastreset` bigint(20) COLLATE utf8_unicode_ci DEFAULT NULL,
`login_expiry` bigint(20) COLLATE utf8_unicode_ci DEFAULT '-1',
`last_login` bigint(20) COLLATE utf8_unicode_ci DEFAULT '-1',
`login_timeout` smallint(5) COLLATE utf8_unicode_ci DEFAULT '-1',
PRIMARY KEY (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `user_filters`
--
CREATE TABLE IF NOT EXISTS `user_filters` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`username` varchar(191) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`filter` mediumtext COLLATE utf8_unicode_ci,
`verify_key` varchar(32) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`active` enum('N','Y') COLLATE utf8_unicode_ci DEFAULT 'N',
PRIMARY KEY (`id`),
KEY `user_filters_username_idx` (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `whitelist`
--
CREATE TABLE IF NOT EXISTS `whitelist` (
`id` bigint(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`to_address` mediumtext COLLATE utf8_unicode_ci,
`to_domain` mediumtext COLLATE utf8_unicode_ci,
`from_address` mediumtext COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
UNIQUE KEY `whitelist_uniq` (`to_address`(100),`from_address`(100))
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; | the_stack |
-- 2017-10-07T09:52:15.135
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET IsInsertRecord='Y',Updated=TO_TIMESTAMP('2017-10-07 09:52:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=540328
;
-- 2017-10-07T09:53:26.306
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 09:53:26','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Business Partner',Description='' WHERE AD_Field_ID=547795 AND AD_Language='en_US'
;
-- 2017-10-07T09:53:50.884
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 09:53:50','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Has Contracts',Description='',Help='' WHERE AD_Field_ID=548196 AND AD_Language='en_US'
;
-- 2017-10-07T09:54:43.699
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 09:54:43','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Flatrate Data' WHERE AD_Field_ID=547794 AND AD_Language='en_US'
;
-- 2017-10-07T09:54:56.554
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 09:54:56','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Data Entry' WHERE AD_Field_ID=548195 AND AD_Language='en_US'
;
-- 2017-10-07T09:55:27.130
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 09:55:27','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Contract Period',Description='',Help='' WHERE AD_Tab_ID=540340 AND AD_Language='en_US'
;
-- 2017-10-07T09:56:02.115
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 09:56:02','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Flatrate Data' WHERE AD_Field_ID=548126 AND AD_Language='en_US'
;
-- 2017-10-07T09:56:12.844
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 09:56:12','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Simulation' WHERE AD_Field_ID=548415 AND AD_Language='en_US'
;
-- 2017-10-07T09:56:33.660
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 09:56:33','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Flatrent Terms',Help='' WHERE AD_Field_ID=548132 AND AD_Language='en_US'
;
-- 2017-10-07T09:56:51.685
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 09:56:51','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Pricing System',Description='',Help='' WHERE AD_Field_ID=551055 AND AD_Language='en_US'
;
-- 2017-10-07T09:57:03.523
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 09:57:03','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Price',Description='',Help='' WHERE AD_Field_ID=551054 AND AD_Language='en_US'
;
-- 2017-10-07T09:57:15.556
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 09:57:15','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Currency',Description='',Help='' WHERE AD_Field_ID=551508 AND AD_Language='en_US'
;
-- 2017-10-07T09:57:29.532
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 09:57:29','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Sales Order',Description='' WHERE AD_Field_ID=550552 AND AD_Language='en_US'
;
-- 2017-10-07T09:57:47.989
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 09:57:47','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Sales Orderline',Description='' WHERE AD_Field_ID=550473 AND AD_Language='en_US'
;
-- 2017-10-07T09:58:10.477
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 09:58:10','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Change Sales Order',Description='' WHERE AD_Field_ID=550551 AND AD_Language='en_US'
;
-- 2017-10-07T09:58:33.998
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 09:58:33','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Change Sales Orderline',Description='' WHERE AD_Field_ID=550550 AND AD_Language='en_US'
;
-- 2017-10-07T10:01:35.296
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 10:01:35','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Bill Business Partner',Description='',Help='' WHERE AD_Field_ID=548492 AND AD_Language='en_US'
;
-- 2017-10-07T10:01:47.827
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 10:01:47','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Bill Location',Description='' WHERE AD_Field_ID=548493 AND AD_Language='en_US'
;
-- 2017-10-07T10:02:01.389
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 10:02:01','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Bill Contact',Description='' WHERE AD_Field_ID=548491 AND AD_Language='en_US'
;
-- 2017-10-07T10:02:16.458
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 10:02:16','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Ship Business Partner',Description='' WHERE AD_Field_ID=550480 AND AD_Language='en_US'
;
-- 2017-10-07T10:02:32.399
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 10:02:32','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Ship Location',Description='' WHERE AD_Field_ID=550481 AND AD_Language='en_US'
;
-- 2017-10-07T10:02:44.816
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 10:02:44','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Ship Contact',Description='' WHERE AD_Field_ID=550482 AND AD_Language='en_US'
;
-- 2017-10-07T10:03:18.771
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 10:03:18','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Contract Type' WHERE AD_Field_ID=548223 AND AD_Language='en_US'
;
-- 2017-10-07T10:03:28.911
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 10:03:28','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='UOM',Description='' WHERE AD_Field_ID=547798 AND AD_Language='en_US'
;
-- 2017-10-07T10:03:40.730
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 10:03:40','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Product',Description='',Help='' WHERE AD_Field_ID=550474 AND AD_Language='en_US'
;
-- 2017-10-07T10:03:52.659
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 10:03:52','YYYY-MM-DD HH24:MI:SS'),Name='UOM Type' WHERE AD_Field_ID=547798 AND AD_Language='en_US'
;
-- 2017-10-07T10:04:02.899
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 10:04:02','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='UOM',Description='',Help='' WHERE AD_Field_ID=548428 AND AD_Language='en_US'
;
-- 2017-10-07T10:04:18.888
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 10:04:18','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Qty per UOM',Description='' WHERE AD_Field_ID=548414 AND AD_Language='en_US'
;
-- 2017-10-07T10:04:43.887
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 10:04:43','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Closing Adjustment',Description='' WHERE AD_Field_ID=548162 AND AD_Language='en_US'
;
-- 2017-10-07T10:05:02.421
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 10:05:02','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Prepare Closing',Description='',Help='' WHERE AD_Field_ID=548168 AND AD_Language='en_US'
;
-- 2017-10-07T10:05:29.236
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 10:05:29','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Closing with actual Amounts',Description='',Help='' WHERE AD_Field_ID=548161 AND AD_Language='en_US'
;
-- 2017-10-07T10:05:47.179
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 10:05:47','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Flatrate Type',Description='',Help='' WHERE AD_Field_ID=548601 AND AD_Language='en_US'
;
-- 2017-10-07T10:05:57.865
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 10:05:57','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Note',Description='',Help='' WHERE AD_Field_ID=548437 AND AD_Language='en_US'
;
-- 2017-10-07T10:06:12.628
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 10:06:12','YYYY-MM-DD HH24:MI:SS'),Name='Delivery Rule',Description='',Help='' WHERE AD_Field_ID=550569 AND AD_Language='en_US'
;
-- 2017-10-07T10:08:11.912
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 10:08:11','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Field_ID=550569 AND AD_Language='en_US'
;
-- 2017-10-07T10:08:26.400
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 10:08:26','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Delivery Via Rule',Description='',Help='' WHERE AD_Field_ID=550570 AND AD_Language='en_US'
;
-- 2017-10-07T10:08:44.963
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 10:08:44','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Start Date' WHERE AD_Field_ID=548458 AND AD_Language='en_US'
;
-- 2017-10-07T10:09:00.440
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 10:09:00','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Contract Transition',Description='' WHERE AD_Field_ID=548464 AND AD_Language='en_US'
;
-- 2017-10-07T10:09:13.091
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 10:09:13','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Notice Date',Description='' WHERE AD_Field_ID=548461 AND AD_Language='en_US'
;
-- 2017-10-07T16:53:00.715
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 16:53:00','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='User In Charge',Description='',Help='' WHERE AD_Field_ID=548494 AND AD_Language='en_US'
;
-- 2017-10-07T16:53:16.771
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 16:53:16','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='End Date' WHERE AD_Field_ID=548460 AND AD_Language='en_US'
;
-- 2017-10-07T16:53:28.969
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 16:53:28','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Auto Renew',Description='' WHERE AD_Field_ID=548462 AND AD_Language='en_US'
;
-- 2017-10-07T16:53:42.095
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 16:53:42','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Extend Contract' WHERE AD_Field_ID=548465 AND AD_Language='en_US'
;
-- 2017-10-07T16:53:56.202
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 16:53:56','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Change or Cancel' WHERE AD_Field_ID=550529 AND AD_Language='en_US'
;
-- 2017-10-07T16:54:10.026
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 16:54:10','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='End of Term' WHERE AD_Field_ID=548459 AND AD_Language='en_US'
;
-- 2017-10-07T16:54:22.890
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 16:54:22','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Next Term' WHERE AD_Field_ID=548463 AND AD_Language='en_US'
;
-- 2017-10-07T16:55:20.832
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 16:55:20','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Shipping Product' WHERE AD_Field_ID=556868 AND AD_Language='en_US'
;
-- 2017-10-07T16:55:38.036
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 16:55:38','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Qty Next Year' WHERE AD_Field_ID=556855 AND AD_Language='en_US'
;
-- 2017-10-07T16:55:52.629
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 16:55:52','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Status',Description='' WHERE AD_Field_ID=548134 AND AD_Language='en_US'
;
-- 2017-10-07T16:56:05.820
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 16:56:05','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Docaction',Description='' WHERE AD_Field_ID=548135 AND AD_Language='en_US'
;
-- 2017-10-07T16:56:30.964
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 16:56:30','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Close Invoice Candidate' WHERE AD_Field_ID=554230 AND AD_Language='en_US'
;
-- 2017-10-07T16:56:54.070
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 16:56:54','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Processed',Description='',Help='' WHERE AD_Field_ID=548137 AND AD_Language='en_US'
;
-- 2017-10-07T16:57:13.214
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 16:57:13','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Field_ID=559886 AND AD_Language='en_US'
;
-- 2017-10-07T16:57:19.806
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 16:57:19','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Field_ID=559885 AND AD_Language='en_US'
;
-- 2017-10-07T16:57:51.135
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 16:57:51','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Field_ID=548136 AND AD_Language='en_US'
;
-- 2017-10-07T16:58:01.959
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 16:58:01','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Contract Status' WHERE AD_Field_ID=550488 AND AD_Language='en_US'
;
-- 2017-10-07T16:58:22.039
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-07 16:58:22','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Flatrate Term Priod' WHERE AD_Field_ID=548133 AND AD_Language='en_US'
;
-- 2017-10-07T16:59:01.296
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET IsInsertRecord='N',Updated=TO_TIMESTAMP('2017-10-07 16:59:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=540328
; | the_stack |
-- https://docs.oracle.com/en/database/oracle/oracle-database/12.2/adjsn/loading-external-json-data.html#GUID-52EFC452-5E65-4148-8070-1FA588A6E697
-- Costs Table - Updated in Aug/2018
-- Define custom oci360 functions
DEF oci360_collector = '&&moat369_sw_base./sh/oci_json_export.sh'
DEF oci360_tables = '&&moat369_sw_base./sh/oci_table_json.csv'
DEF oci360_columns = '&&moat369_sw_base./sh/oci_cols_json.csv'
DEF fc_table_loader = '&&moat369_sw_folder./oci360_fc_table_loader.sql'
DEF fc_json_metadata = '&&moat369_sw_folder./oci360_fc_json_metadata.sql'
DEF oci360_tzcolformat = 'YYYY-MM-DD"T"HH24:MI:SS.FF6TZH:TZM'
DEF moat369_sw_desc_linesize = 150
@@&&fc_def_output_file. oci360_log_json 'internal_json.log'
@@&&fc_seq_output_file. oci360_log_json
@@&&fc_clean_file_name. "oci360_log_json" "oci360_log_json_nopath" "PATH"
@@&&fc_def_output_file. oci360_log_csv 'internal_csv.log'
@@&&fc_seq_output_file. oci360_log_csv
@@&&fc_clean_file_name. "oci360_log_csv" "oci360_log_csv_nopath" "PATH"
-- Generate JSON Outputs
SET TERM ON
PRO Getting JSON Files
PRO Please wait ...
@@&&fc_set_term_off.
-- Check oci360_exec_mode variable
@@&&fc_def_empty_var. oci360_exec_mode
@@&&fc_set_value_var_nvl. 'oci360_exec_mode' '&&oci360_exec_mode.' 'REPORT_ONLY'
@@&&fc_validate_variable. oci360_exec_mode NOT_NULL
-- Check oci360_load_mode variable
-- Default value: PRE_LOAD if moat369_sections is unset, otherwise ON_DEMAND
@@&&fc_def_empty_var. oci360_load_mode
@@&&fc_set_value_var_nvl. 'oci360_load_mode' '&&oci360_load_mode_param.' '&&oci360_load_mode.'
COL oci360_load_mode NEW_V oci360_load_mode
SELECT DECODE('&&oci360_load_mode.',NULL,DECODE('&&moat369_sections.',NULL,'PRE_LOAD','ON_DEMAND'),'&&oci360_load_mode.') oci360_load_mode FROM DUAL;
COL oci360_load_mode clear
@@&&fc_validate_variable. oci360_load_mode NOT_NULL
-- Check oci360_clean_on_exit variable
-- Default value: OFF if oci360_load_mode is OFF, otherwise ON
@@&&fc_def_empty_var. oci360_clean_on_exit
-- COL oci360_clean_on_exit NEW_V oci360_clean_on_exit
-- SELECT DECODE('&&oci360_clean_on_exit.',NULL,DECODE('&&oci360_load_mode.','OFF','OFF','ON'),'&&oci360_clean_on_exit.') oci360_clean_on_exit FROM DUAL;
-- COL oci360_clean_on_exit clear
@@&&fc_set_value_var_nvl. 'oci360_clean_on_exit' '&&oci360_clean_on_exit.' 'OFF'
@@&&fc_validate_variable. oci360_clean_on_exit NOT_NULL
@@&&fc_validate_variable. oci360_clean_on_exit ON_OFF
-- Define ADB variables
@@&&fc_def_empty_var. oci360_adb_cred
@@&&fc_def_empty_var. oci360_adb_uri
-- Check oci360_skip_billing variable
@@&&fc_def_empty_var. oci360_skip_billing
@@&&fc_set_value_var_nvl. 'oci360_skip_billing' '&&oci360_skip_billing.' 'N'
@@&&fc_validate_variable. oci360_skip_billing NOT_NULL
@@&&fc_validate_variable. oci360_skip_billing Y_N
-- Check oci360_tables_override variable. This variable will replace oci360_tables default value.
@@&&fc_def_empty_var. oci360_tables_override
@@&&fc_set_value_var_nvl. 'oci360_tables' '&&oci360_tables_override.' '&&oci360_tables.'
SET TERM ON
WHENEVER SQLERROR EXIT SQL.SQLCODE
-- Check oci360_exec_mode variable
DECLARE
V_VAR VARCHAR2(30) := 'oci360_exec_mode';
V_VAR_CONTENT VARCHAR2(500) := '&&oci360_exec_mode.';
BEGIN
IF V_VAR_CONTENT NOT IN ('FULL','REPORT_ONLY','LOAD_ONLY') THEN
RAISE_APPLICATION_ERROR(-20000, 'Invalid value for ' || V_VAR || ': "' || V_VAR_CONTENT || '" in 00_config.sql. Valid values are "FULL", "REPORT_ONLY" or "LOAD_ONLY".');
END IF;
END;
/
-- Check oci360_load_mode variable
DECLARE
V_VAR VARCHAR2(30) := 'oci360_load_mode';
V_VAR_CONTENT VARCHAR2(500) := '&&oci360_load_mode.';
BEGIN
IF V_VAR_CONTENT NOT IN ('PRE_LOAD','ON_DEMAND', 'OFF') THEN
RAISE_APPLICATION_ERROR(-20000, 'Invalid value for ' || V_VAR || ': "' || V_VAR_CONTENT || '" in 00_config.sql. Valid values are "PRE_LOAD", "ON_DEMAND" or "OFF".');
END IF;
END;
/
-- Check oci360_exec_mode variable
DECLARE
V_VAR VARCHAR2(30) := 'oci360_exec_mode';
V_VAR_CONTENT VARCHAR2(500) := '&&oci360_exec_mode.';
BEGIN
IF '&&oci360_exec_mode.' = 'LOAD_ONLY' and '&&oci360_load_mode.' in ('OFF','ON_DEMAND') THEN
RAISE_APPLICATION_ERROR(-20000, 'Invalid combination. When oci360_exec_mode is "LOAD_ONLY", oci360_load_mode must be set as "PRE_LOAD". Found: "&&oci360_load_mode."');
END IF;
END;
/
-- Check oci360_exec_mode variable
BEGIN
IF ('&&oci360_adb_cred.' IS NULL and '&&oci360_adb_uri.' IS NOT NULL) OR
('&&oci360_adb_cred.' IS NOT NULL and '&&oci360_adb_uri.' IS NULL) THEN
RAISE_APPLICATION_ERROR(-20000, 'Invalid combination. When using Autonomous DB mode, both oci360_adb_cred and oci360_adb_uri must be defined."');
END IF;
END;
/
-- Check Database version
BEGIN
IF '&&is_ver_ge_12_2.' = 'N' AND '&&oci360_load_mode.' != 'OFF' THEN
RAISE_APPLICATION_ERROR(-20000, 'Database must be at least 12.2 as the tool uses DBMS_JSON.' || CHR(10) ||
'Check https://docs.oracle.com/en/database/oracle/oracle-database/12.2/newft/new-features.html#GUID-71B4582E-A6E2-425D-8D0C-A60D70F7050C');
END IF;
END;
/
-- Check "compatible" parameter
DECLARE
V_RESULT VARCHAR2(30);
V_1_DIG NUMBER;
V_2_DIG NUMBER;
BEGIN
select value into v_result from v$parameter where name='compatible';
V_1_DIG := SUBSTR(v_result,1,instr(v_result,'.'));
V_2_DIG := SUBSTR(v_result,instr(v_result,'.')+1,instr(v_result,'.',1,2)-instr(v_result,'.')-1);
IF NOT (V_1_DIG>12 OR (V_1_DIG=12 AND V_2_DIG>=2)) AND '&&oci360_load_mode.' != 'OFF' THEN
RAISE_APPLICATION_ERROR(-20000, 'Database compatible parameter must be at least 12.2 to run this tool (Long Identifiers).' || CHR(10) ||
'Check https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sqlrf/Database-Object-Names-and-Qualifiers.html#GUID-75337742-67FD-4EC0-985F-741C93D918DA');
END IF;
END;
/
-- Check "max_string_size" parameter
DECLARE
V_RESULT VARCHAR2(30);
BEGIN
select value into v_result from v$parameter where name='max_string_size';
IF UPPER(V_RESULT) != 'EXTENDED' AND '&&oci360_load_mode.' != 'OFF' THEN
RAISE_APPLICATION_ERROR(-20000, 'Database must have extended max_string_size parameter to work with this tool.' || CHR(10) ||
'Check https://docs.oracle.com/database/121/REFRN/GUID-D424D23B-0933-425F-BC69-9C0E6724693C.htm#REFRN10321');
END IF;
END;
/
-- Check UTL_FILE permission
DECLARE
V_RESULT NUMBER;
BEGIN
select count(*) into V_RESULT from all_procedures where owner='SYS' and object_name='UTL_FILE';
IF V_RESULT = 0 THEN
RAISE_APPLICATION_ERROR(-20000, 'SYS.UTL_FILE package is not visible by current user. Check if you have execute permissions.');
END IF;
END;
/
-- Check UTL_COMPRESS permission
DECLARE
V_RESULT NUMBER;
BEGIN
select count(*) into V_RESULT from all_procedures where owner='SYS' and object_name='UTL_COMPRESS';
IF V_RESULT = 0 THEN
RAISE_APPLICATION_ERROR(-20000, 'SYS.UTL_COMPRESS package is not visible by current user. Check if you have execute permissions.');
END IF;
END;
/
WHENEVER SQLERROR CONTINUE
@@&&fc_set_term_off.
----------------------------------------
-- Define Local or ADB skip variables
----------------------------------------
COL oci360_loc_skip NEW_V oci360_loc_skip
COL oci360_loc_code NEW_V oci360_loc_code
COL oci360_adb_skip NEW_V oci360_adb_skip
COL oci360_adb_code NEW_V oci360_adb_code
SELECT DECODE('&&oci360_adb_cred.','','','&&fc_skip_script.') oci360_loc_skip,
DECODE('&&oci360_adb_cred.','','&&fc_skip_script.','') oci360_adb_skip,
DECODE('&&oci360_adb_cred.','','','--') oci360_loc_code,
DECODE('&&oci360_adb_cred.','','--','') oci360_adb_code
FROM DUAL;
COL oci360_loc_skip clear
COL oci360_loc_code clear
COL oci360_adb_skip clear
COL oci360_adb_code clear
@@&&oci360_adb_skip.&&moat369_sw_folder./oci360_fc_validate_adb.sql
-- Print execution mode
@@&&fc_def_output_file. oci360_step_file 'oci360_step_file.sql'
@@&&fc_spool_start.
SPO &&oci360_step_file.
PRO SET TERM ON
PRO &&oci360_adb_code.PRO OCI360 running for Autonomous Database mode
PRO &&oci360_loc_code.PRO OCI360 running for Local Database mode
PRO @@&&fc_set_term_off.
SPO OFF
@@&&fc_spool_end.
@@&&oci360_step_file.
HOS rm -f "&&oci360_step_file."
UNDEF oci360_step_file
----------------------------------------
-- Load JSON list in oci360_json_files
----------------------------------------
@@&&fc_def_empty_var. oci360_json_zip
@@&&oci360_loc_skip.&&moat369_sw_folder./oci360_fc_json_extractor.sql
@@&&fc_def_output_file. oci360_json_files 'oci_json_export_list.txt'
@@&&fc_clean_file_name. oci360_json_files oci360_json_files_nopath "PATH"
-- If Local
@@&&fc_def_output_file. oci360_step_file 'oci360_step_zip_file.sql'
@@&&fc_spool_start.
SPO &&oci360_step_file.
PRO HOS unzip -Z -1 &&oci360_json_zip. | &&cmd_grep. -E '.json$' > &&oci360_json_files.
SPO OFF
@@&&fc_spool_end.
@@&&oci360_loc_skip.&&oci360_step_file.
@@&&fc_zip_driver_files. &&oci360_step_file.
UNDEF oci360_step_file
-- If ADB
@@&&fc_def_output_file. oci360_step_file 'oci360_step_zip_file.sql'
@@&&fc_spool_start.
SPO &&oci360_step_file.
PRO @@&&fc_spool_start.
PRO SPO &&oci360_json_files.
PRO SELECT object_name from
PRO table(DBMS_CLOUD.LIST_OBJECTS (
PRO credential_name => '&&oci360_adb_cred.',
PRO location_uri => '&&oci360_adb_uri.'))
PRO WHERE REGEXP_LIKE(object_name,'.json$') OR REGEXP_LIKE(object_name,'.json.gz$')
PRO ;;
PRO SPO OFF
PRO @@&&fc_spool_end.
SPO OFF
@@&&fc_spool_end.
@@&&oci360_adb_skip.&&oci360_step_file.
@@&&fc_zip_driver_files. &&oci360_step_file.
UNDEF oci360_step_file
----------------------------------------
-- Load CSV list in oci360_csv_files
----------------------------------------
@@&&fc_def_empty_var. oci360_csv_files
@@&&moat369_sw_folder./oci360_fc_csv_usage_extractor.sql
@@&&fc_def_output_file. oci360_csv_files 'oci_csv_export_list.txt'
@@&&fc_clean_file_name. oci360_csv_files oci360_csv_files_nopath "PATH"
-- If Local
@@&&fc_def_output_file. oci360_step_file 'oci360_step_csv_file.sql'
@@&&fc_spool_start.
SPO &&oci360_step_file.
PRO HOS unzip -Z -1 &&oci360_csv_report_zip. | &&cmd_grep. -E '.csv.gz$' > &&oci360_csv_files.
SPO OFF
@@&&fc_spool_end.
@@&&oci360_loc_skip.&&oci360_step_file.
@@&&fc_zip_driver_files. &&oci360_step_file.
UNDEF oci360_step_file
-- If ADB
@@&&fc_def_output_file. oci360_step_file 'oci360_step_csv_file.sql'
@@&&fc_spool_start.
SPO &&oci360_step_file.
PRO @@&&fc_spool_start.
PRO SPO &&oci360_csv_files.
PRO SELECT object_name from
PRO table(DBMS_CLOUD.LIST_OBJECTS (
PRO credential_name => '&&oci360_adb_cred.',
PRO location_uri => '&&oci360_adb_uri.'))
PRO WHERE REGEXP_LIKE(object_name,'.csv$') OR REGEXP_LIKE(object_name,'.csv.gz$')
PRO ;;
PRO SPO OFF
PRO @@&&fc_spool_end.
SPO OFF
@@&&fc_spool_end.
@@&&oci360_adb_skip.&&oci360_step_file.
@@&&fc_zip_driver_files. &&oci360_step_file.
UNDEF oci360_step_file
----------------------------------------
-- Compression Flag
----------------------------------------
@@&&fc_set_value_var_nvl2. 'oci360_tab_compression' '&&oci360_adb_skip.' 'COMPRESS' 'COMPRESS FOR QUERY HIGH'
----------------------------------------
-- The load of those tables inside the database is no longer using External Directories.
-- @@&&fc_def_output_file. oci360_jsoncol_file 'oci360_jsoncol_file.csv'
-- @@&&fc_clean_file_name. oci360_jsoncol_file oci360_jsoncol_file_nopath "PATH"
-- HOS cp -a &&oci360_columns. &&oci360_jsoncol_file.
-- @@&&fc_def_output_file. oci360_jsontab_file 'oci360_jsontab_file.csv'
-- @@&&fc_clean_file_name. oci360_jsontab_file oci360_jsontab_file_nopath "PATH"
-- HOS cp -a &&oci360_tables. &&oci360_jsontab_file.
----------------------------------------
-- Load ALL OCI360 tool tables
----------------------------------------
@@&&moat369_sw_folder./oci360_fc_exttables_create.sql
----------------------------------------
--
COL skip_billing_sql NEW_V skip_billing_sql
SELECT DECODE('&&oci360_skip_billing.','N','','&&fc_skip_script.') skip_billing_sql FROM DUAL;
COL skip_billing_sql clear
--
COL skip_section_json NEW_V skip_section_json
SELECT DECODE('&&oci360_load_mode.','OFF','&&fc_skip_script.','') skip_section_json FROM DUAL;
COL skip_section_json clear
--
COL skip_section_repusage NEW_V skip_section_repusage
SELECT DECODE(count(*),0,'&&fc_skip_script.','') skip_section_repusage
FROM ALL_TABLES
WHERE owner = SYS_CONTEXT('userenv','current_schema')
and table_name = 'OCI360_REPORTS_USAGE';
COL skip_section_repusage clear
--
COL skip_section_repcost NEW_V skip_section_repcost
SELECT DECODE(count(*),0,'&&fc_skip_script.','') skip_section_repcost
FROM ALL_TABLES
WHERE owner = SYS_CONTEXT('userenv','current_schema')
and table_name = 'OCI360_REPORTS_COST';
COL skip_section_repcost clear
--
COL skip_section_monit NEW_V skip_section_monit
SELECT DECODE(count(*),0,'&&fc_skip_script.','') skip_section_monit
FROM ALL_TABLES
WHERE owner = SYS_CONTEXT('userenv','current_schema')
and table_name = 'OCI360_MONIT_METRIC_LIST';
COL skip_section_monit clear
--
COL skip_section_audit NEW_V skip_section_audit
SELECT DECODE(count(*),0,'&&fc_skip_script.','') skip_section_audit
FROM ALL_TABLES
WHERE owner = SYS_CONTEXT('userenv','current_schema')
and table_name = 'OCI360_AUDIT_EVENTS';
COL skip_section_audit clear
--
COL skip_section_billing NEW_V skip_section_billing
SELECT DECODE(count(*),0,'&&fc_skip_script.','') skip_section_billing
FROM ALL_TABLES
WHERE owner = SYS_CONTEXT('userenv','current_schema')
and table_name = 'OCI360_SERV_ENTITLEMENTS';
COL skip_section_billing clear
--
COL skip_section_bigdata NEW_V skip_section_bigdata
SELECT DECODE(count(*),0,'&&fc_skip_script.','') skip_section_bigdata
FROM ALL_TAB_COLUMNS
WHERE owner = SYS_CONTEXT('userenv','current_schema')
and table_name = 'OCI360_BDS_INSTANCES'
AND column_name = 'ID';
COL skip_section_bigdata clear
--
----------------------------------------
-- Skip all sections if exec_mode is LOAD_ONLY.
----------------------------------------
BEGIN
IF '&&oci360_exec_mode.' = 'LOAD_ONLY' THEN
:moat369_sec_from := '9z';
:moat369_sec_to := '9z';
END IF;
END;
/
@@&&fc_def_empty_var. oci360_skip_reexec_secvar
@@&&fc_set_value_var_decode. 'oci360_skip_reexec_secvar' '&&oci360_exec_mode.' 'LOAD_ONLY' '' '&&fc_skip_script.'
@@&&oci360_skip_reexec_secvar.&&fc_section_variables.
---------------------------- | the_stack |
SET search_path = public, pg_catalog;
--
-- 1)Name: ofec_audit_case_mv; Type: MATERIALIZED VIEW; Schema: public; Owner: fec
--
DROP MATERIALIZED VIEW ofec_audit_case_mv;
CREATE MATERIALIZED VIEW ofec_audit_case_mv AS
WITH
cmte_info AS (
SELECT DISTINCT dc.cmte_id,
dc.cmte_nm,
dc.fec_election_yr,
dc.cmte_dsgn,
dc.cmte_tp,
b.FILED_CMTE_TP_DESC::text AS cmte_desc
FROM auditsearch.audit_case aa, disclosure.cmte_valid_fec_yr dc, staging.ref_filed_cmte_tp b
WHERE btrim(aa.cmte_id) = dc.cmte_id
AND aa.election_cycle = dc.fec_election_yr
AND dc.cmte_tp IN ('H', 'S', 'P', 'X', 'Y', 'Z', 'N', 'Q', 'I', 'O')
AND dc.cmte_tp = b.filed_cmte_tp_cd
),
cand_info AS (
SELECT DISTINCT dc.cand_id,
dc.cand_name,
"substring"(dc.cand_name::text, 1,
CASE
WHEN strpos(dc.cand_name::text, ','::text) > 0 THEN strpos(dc.cand_name::text, ','::text) - 1
ELSE strpos(dc.cand_name::text, ','::text)
END) AS last_name,
"substring"(dc.cand_name::text, strpos(dc.cand_name::text, ','::text) + 1) AS first_name,
dc.fec_election_yr
FROM auditsearch.audit_case aa JOIN disclosure.cand_valid_fec_yr dc
ON (btrim(aa.cand_id) = dc.cand_id AND aa.election_cycle = dc.fec_election_yr)
),
audit_case_finding_info AS (
SELECT
audit_case_finding.audit_case_id::integer AS audit_case_id,
audit_case_finding.parent_finding_pk::integer AS primary_category_id,
audit_case_finding.child_finding_pk::integer AS sub_category_id
FROM auditsearch.audit_case_finding
),
audit_case_init AS (
SELECT
'-1'::integer AS primary_category_id,
'-2'::integer AS sub_category_id,
ac.audit_case_id::integer AS audit_case_id,
ac.election_cycle::integer AS cycle,
ac.cmte_id AS committee_id,
cmte_info.cmte_nm AS committee_name,
cmte_info.cmte_dsgn AS committee_designation,
cmte_info.cmte_tp AS committee_type,
cmte_info.cmte_desc AS committee_description,
ac.far_release_date::date AS far_release_date,
ac.link_to_report,
ac.audit_id::integer AS audit_id,
ac.cand_id AS candidate_id,
coalesce(cand_info.cand_name, 'N/A'::text) AS candidate_name
FROM auditsearch.audit_case ac
LEFT JOIN cmte_info ON cmte_info.cmte_id::text = ac.cmte_id::text
AND cmte_info.fec_election_yr = ac.election_cycle
LEFT JOIN cand_info ON cand_info.cand_id::text = ac.cand_id::text
AND cand_info.fec_election_yr = ac.election_cycle
),
audit_case_sebset AS (
SELECT
audit_case_finding_info.primary_category_id,
audit_case_finding_info.sub_category_id,
audit_case_finding_info.audit_case_id,
auditsearch.audit_case.election_cycle::integer AS cycle,
auditsearch.audit_case.cmte_id AS committee_id,
cmte_info.cmte_nm AS committee_name,
cmte_info.cmte_dsgn AS committee_designation,
cmte_info.cmte_tp AS committee_type,
cmte_info.cmte_desc AS committee_description,
auditsearch.audit_case.far_release_date::date AS far_release_date,
auditsearch.audit_case.link_to_report,
auditsearch.audit_case.audit_id::integer AS audit_id,
auditsearch.audit_case.cand_id AS candidate_id,
coalesce(cand_info.cand_name, 'N/A'::text) AS candidate_name
FROM audit_case_finding_info
LEFT JOIN auditsearch.audit_case ON (audit_case_finding_info.audit_case_id = auditsearch.audit_case.audit_case_id::integer)
LEFT JOIN cmte_info ON (cmte_info.cmte_id::text = auditsearch.audit_case.cmte_id::text
AND cmte_info.fec_election_yr = auditsearch.audit_case.election_cycle)
LEFT JOIN cand_info ON (cand_info.cand_id::text = auditsearch.audit_case.cand_id::text
AND cand_info.fec_election_yr = auditsearch.audit_case.election_cycle)
),
audit_case_all AS (
SELECT
row_number() over () AS idx,
primary_category_id,
sub_category_id,
audit_case_id,
cycle,
committee_id,
committee_name,
committee_designation,
committee_type,
committee_description,
far_release_date,
link_to_report,
audit_id,
candidate_id,
candidate_name
FROM audit_case_init
UNION ALL
SELECT
3000+row_number() over () AS idx,
primary_category_id,
sub_category_id,
audit_case_id,
cycle,
committee_id,
committee_name,
committee_designation,
committee_type,
committee_description,
far_release_date,
link_to_report,
audit_id,
candidate_id,
candidate_name
FROM audit_case_sebset
)
SELECT
idx,
primary_category_id,
sub_category_id,
audit_case_id,
cycle,
committee_id,
committee_name,
committee_designation,
committee_type,
committee_description,
far_release_date,
link_to_report,
audit_id,
candidate_id,
candidate_name
FROM audit_case_all
ORDER BY cycle DESC, committee_name
WITH DATA;
ALTER TABLE ofec_audit_case_mv OWNER TO fec;
CREATE UNIQUE INDEX ON ofec_audit_case_mv(idx);
CREATE INDEX ON ofec_audit_case_mv(audit_case_id);
CREATE INDEX ON ofec_audit_case_mv(primary_category_id,sub_category_id,audit_case_id);
--
-- 2)Name: ofec_audit_case_category_rel_mv; Type: MATERIALIZED VIEW; Schema: auditsearch; Owner: fec
--
DROP MATERIALIZED VIEW ofec_audit_case_category_rel_mv;
CREATE MATERIALIZED VIEW ofec_audit_case_category_rel_mv AS
SELECT
DISTINCT acf.audit_case_id::integer AS audit_case_id,
acf.parent_finding_pk::integer AS primary_category_id,
btrim(f.finding) AS primary_category_name
FROM auditsearch.audit_case_finding acf
LEFT JOIN auditsearch.finding f
ON (acf.parent_finding_pk = f.finding_pk)
ORDER BY audit_case_id, primary_category_name
WITH DATA;
ALTER TABLE ofec_audit_case_category_rel_mv OWNER TO fec;
CREATE UNIQUE INDEX ON ofec_audit_case_category_rel_mv(audit_case_id,primary_category_id);
--
-- 3)Name: ofec_audit_case_sub_category_rel_mv; Type: MATERIALIZED VIEW; Schema: auditsearch; Owner: fec
--
DROP MATERIALIZED VIEW ofec_audit_case_sub_category_rel_mv;
CREATE MATERIALIZED VIEW ofec_audit_case_sub_category_rel_mv AS
SELECT
acf.audit_case_id::integer AS audit_case_id,
acf.parent_finding_pk::integer AS primary_category_id,
btrim(pf.finding) AS primary_category_name,
acf.child_finding_pk::integer AS sub_category_id,
btrim(cf.finding) AS sub_category_name
FROM auditsearch.audit_case_finding acf
LEFT JOIN auditsearch.finding pf ON (acf.parent_finding_pk = pf.finding_pK)
LEFT JOIN auditsearch.finding cf ON (acf.child_finding_pk = cf.finding_pK)
ORDER BY (acf.audit_case_id::integer), primary_category_name, sub_category_name
WITH DATA;
ALTER TABLE ofec_audit_case_sub_category_rel_mv OWNER TO fec;
CREATE UNIQUE INDEX ON ofec_audit_case_sub_category_rel_mv(audit_case_id,primary_category_id,sub_category_id);
--
-- 4)Name: ofec_committee_fulltext_audit_mv; Type: MATERIALIZED VIEW; Schema: auditsearch; Owner: fec
--
DROP MATERIALIZED VIEW ofec_committee_fulltext_audit_mv;
CREATE MATERIALIZED VIEW ofec_committee_fulltext_audit_mv AS
WITH
cmte_info AS (
SELECT DISTINCT dc.cmte_id,
dc.cmte_nm,
dc.fec_election_yr,
dc.cmte_dsgn,
dc.cmte_tp,
b.FILED_CMTE_TP_DESC::text AS cmte_desc
FROM auditsearch.audit_case aa, disclosure.cmte_valid_fec_yr dc, staging.ref_filed_cmte_tp b
WHERE btrim(aa.cmte_id) = dc.cmte_id
AND aa.election_cycle = dc.fec_election_yr
AND dc.cmte_tp IN ('H', 'S', 'P', 'X', 'Y', 'Z', 'N', 'Q', 'I', 'O')
AND dc.cmte_tp = b.filed_cmte_tp_cd
)
SELECT DISTINCT ON (cmte_id, cmte_nm)
row_number() over () AS idx,
cmte_id AS id,
cmte_nm AS name,
CASE
WHEN cmte_nm IS NOT NULL THEN
setweight(to_tsvector(cmte_nm), 'A') ||
setweight(to_tsvector(cmte_id), 'B')
ELSE NULL::tsvector
END AS fulltxt
FROM cmte_info
ORDER BY cmte_id
WITH DATA;
ALTER TABLE ofec_committee_fulltext_audit_mv OWNER TO fec;
CREATE UNIQUE INDEX ON ofec_committee_fulltext_audit_mv(idx);
CREATE INDEX ON ofec_committee_fulltext_audit_mv using gin(fulltxt);
--
-- 5)Name: ofec_candidate_fulltext_audit_mv; Type: MATERIALIZED VIEW; Schema: auditsearch; Owner: fec
--
DROP MATERIALIZED VIEW ofec_candidate_fulltext_audit_mv;
CREATE MATERIALIZED VIEW ofec_candidate_fulltext_audit_mv AS
WITH
cand_info AS (
SELECT DISTINCT dc.cand_id,
dc.cand_name,
"substring"(dc.cand_name::text, 1,
CASE
WHEN strpos(dc.cand_name::text, ','::text) > 0 THEN strpos(dc.cand_name::text, ','::text) - 1
ELSE strpos(dc.cand_name::text, ','::text)
END) AS last_name,
"substring"(dc.cand_name::text, strpos(dc.cand_name::text, ','::text) + 1) AS first_name,
dc.fec_election_yr
FROM auditsearch.audit_case aa JOIN disclosure.cand_valid_fec_yr dc
ON (btrim(aa.cand_id) = dc.cand_id AND aa.election_cycle = dc.fec_election_yr)
)
SELECT DISTINCT ON (cand_id, cand_name)
row_number() over () AS idx,
cand_id AS id,
cand_name AS name,
CASE
WHEN cand_name IS NOT NULL THEN
setweight(to_tsvector(cand_name), 'A') ||
setweight(to_tsvector(cand_id), 'B')
ELSE NULL::tsvector
END AS fulltxt
FROM cand_info
ORDER BY cand_id
WITH DATA;
ALTER TABLE ofec_candidate_fulltext_audit_mv OWNER TO fec;
CREATE UNIQUE INDEX ON ofec_candidate_fulltext_audit_mv(idx);
CREATE INDEX ON ofec_candidate_fulltext_audit_mv using gin(fulltxt);
GRANT ALL ON TABLE ofec_audit_case_mv TO fec;
GRANT SELECT ON TABLE ofec_audit_case_mv TO fec_read;
GRANT ALL ON TABLE ofec_audit_case_category_rel_mv TO fec;
GRANT SELECT ON TABLE ofec_audit_case_category_rel_mv TO fec_read;
GRANT ALL ON TABLE ofec_audit_case_sub_category_rel_mv TO fec;
GRANT SELECT ON TABLE ofec_audit_case_sub_category_rel_mv TO fec_read;
GRANT ALL ON TABLE ofec_committee_fulltext_audit_mv TO fec;
GRANT SELECT ON TABLE ofec_committee_fulltext_audit_mv TO fec_read;
GRANT ALL ON TABLE ofec_candidate_fulltext_audit_mv TO fec;
GRANT SELECT ON TABLE ofec_candidate_fulltext_audit_mv TO fec_read;
DROP VIEW auditsearch.cmte_audit_vw;
DROP VIEW auditsearch.cand_audit_vw; | the_stack |
-- 2017-12-11T13:49:21.936
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat (AD_Client_ID,AD_ImpFormat_ID,AD_Org_ID,AD_Table_ID,Created,CreatedBy,FormatType,IsActive,IsMultiLine,Name,Processing,Updated,UpdatedBy) VALUES (0,540018,0,540880,TO_TIMESTAMP('2017-12-11 13:49:21','YYYY-MM-DD HH24:MI:SS'),100,'C','Y','N','Pharma product IFA','N',TO_TIMESTAMP('2017-12-11 13:49:21','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:41.768
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558139,540018,540402,0,TO_TIMESTAMP('2017-12-11 14:06:41','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A00PZN',1,1,TO_TIMESTAMP('2017-12-11 14:06:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:41.837
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558138,540018,540403,0,TO_TIMESTAMP('2017-12-11 14:06:41','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A00SSATZ',2,2,TO_TIMESTAMP('2017-12-11 14:06:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:41.912
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558140,540018,540404,0,TO_TIMESTAMP('2017-12-11 14:06:41','YYYY-MM-DD HH24:MI:SS'),100,'D','.','N','Y','A00GDAT',3,3,TO_TIMESTAMP('2017-12-11 14:06:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:41.989
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558146,540018,540405,0,TO_TIMESTAMP('2017-12-11 14:06:41','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A00ATYP',4,4,TO_TIMESTAMP('2017-12-11 14:06:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:42.066
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558147,540018,540406,0,TO_TIMESTAMP('2017-12-11 14:06:41','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A00LKZ',5,5,TO_TIMESTAMP('2017-12-11 14:06:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:42.137
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558141,540018,540407,0,TO_TIMESTAMP('2017-12-11 14:06:42','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A00PBEZ',6,6,TO_TIMESTAMP('2017-12-11 14:06:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:42.210
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558143,540018,540408,0,TO_TIMESTAMP('2017-12-11 14:06:42','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A00PGEINH',7,7,TO_TIMESTAMP('2017-12-11 14:06:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:42.276
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558148,540018,540409,0,TO_TIMESTAMP('2017-12-11 14:06:42','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A00GTIN',8,8,TO_TIMESTAMP('2017-12-11 14:06:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:42.345
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558142,540018,540410,0,TO_TIMESTAMP('2017-12-11 14:06:42','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A00PGMENG',9,9,TO_TIMESTAMP('2017-12-11 14:06:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:42.417
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558145,540018,540411,0,TO_TIMESTAMP('2017-12-11 14:06:42','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A00ANBNR4',10,10,TO_TIMESTAMP('2017-12-11 14:06:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:42.494
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558144,540018,540412,0,TO_TIMESTAMP('2017-12-11 14:06:42','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A00DARFO',11,11,TO_TIMESTAMP('2017-12-11 14:06:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:42.561
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558154,540018,540413,0,TO_TIMESTAMP('2017-12-11 14:06:42','YYYY-MM-DD HH24:MI:SS'),100,'D','.','N','Y','A05GDAT',12,12,TO_TIMESTAMP('2017-12-11 14:06:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:42.635
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558156,540018,540414,0,TO_TIMESTAMP('2017-12-11 14:06:42','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A05LZEIT',13,13,TO_TIMESTAMP('2017-12-11 14:06:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:42.700
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558149,540018,540415,0,TO_TIMESTAMP('2017-12-11 14:06:42','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A00ARTNR',14,14,TO_TIMESTAMP('2017-12-11 14:06:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:42.767
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558151,540018,540416,0,TO_TIMESTAMP('2017-12-11 14:06:42','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A00PNAM',15,15,TO_TIMESTAMP('2017-12-11 14:06:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:42.838
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558153,540018,540417,0,TO_TIMESTAMP('2017-12-11 14:06:42','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A00PPN',16,16,TO_TIMESTAMP('2017-12-11 14:06:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:42.907
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558152,540018,540418,0,TO_TIMESTAMP('2017-12-11 14:06:42','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A00WGA',17,17,TO_TIMESTAMP('2017-12-11 14:06:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:42.978
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558155,540018,540419,0,TO_TIMESTAMP('2017-12-11 14:06:42','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A05VFDAT',18,18,TO_TIMESTAMP('2017-12-11 14:06:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:43.052
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558150,540018,540420,0,TO_TIMESTAMP('2017-12-11 14:06:42','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A00HMNR',19,19,TO_TIMESTAMP('2017-12-11 14:06:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:43.126
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558158,540018,540421,0,TO_TIMESTAMP('2017-12-11 14:06:43','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A05TMAX',20,20,TO_TIMESTAMP('2017-12-11 14:06:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:43.190
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558161,540018,540422,0,TO_TIMESTAMP('2017-12-11 14:06:43','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A05FEUCHT',21,21,TO_TIMESTAMP('2017-12-11 14:06:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:43.259
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558157,540018,540423,0,TO_TIMESTAMP('2017-12-11 14:06:43','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A05KKETTE',22,22,TO_TIMESTAMP('2017-12-11 14:06:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:43.334
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558160,540018,540424,0,TO_TIMESTAMP('2017-12-11 14:06:43','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A05LICHT',23,23,TO_TIMESTAMP('2017-12-11 14:06:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:43.404
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558159,540018,540425,0,TO_TIMESTAMP('2017-12-11 14:06:43','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A05TMIN',24,24,TO_TIMESTAMP('2017-12-11 14:06:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:43.478
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558166,540018,540426,0,TO_TIMESTAMP('2017-12-11 14:06:43','YYYY-MM-DD HH24:MI:SS'),100,'D','.','N','Y','A04GDAT',25,25,TO_TIMESTAMP('2017-12-11 14:06:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:43.660
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558169,540018,540427,0,TO_TIMESTAMP('2017-12-11 14:06:43','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A04BREITE',26,26,TO_TIMESTAMP('2017-12-11 14:06:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:43.728
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558163,540018,540428,0,TO_TIMESTAMP('2017-12-11 14:06:43','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A05ZERBR',27,27,TO_TIMESTAMP('2017-12-11 14:06:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:43.793
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558165,540018,540429,0,TO_TIMESTAMP('2017-12-11 14:06:43','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A05LZEICH',28,28,TO_TIMESTAMP('2017-12-11 14:06:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:43.864
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558162,540018,540430,0,TO_TIMESTAMP('2017-12-11 14:06:43','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A05LAGE',29,29,TO_TIMESTAMP('2017-12-11 14:06:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:43.935
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558164,540018,540431,0,TO_TIMESTAMP('2017-12-11 14:06:43','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A05EICH',30,30,TO_TIMESTAMP('2017-12-11 14:06:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:44.003
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558167,540018,540432,0,TO_TIMESTAMP('2017-12-11 14:06:43','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A04LAENGE',31,31,TO_TIMESTAMP('2017-12-11 14:06:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:44.076
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558168,540018,540433,0,TO_TIMESTAMP('2017-12-11 14:06:44','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A04HOEHE',32,32,TO_TIMESTAMP('2017-12-11 14:06:44','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:44.145
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558172,540018,540434,0,TO_TIMESTAMP('2017-12-11 14:06:44','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A04MBEST',33,33,TO_TIMESTAMP('2017-12-11 14:06:44','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:44.206
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558175,540018,540435,0,TO_TIMESTAMP('2017-12-11 14:06:44','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A01SAPU',34,34,TO_TIMESTAMP('2017-12-11 14:06:44','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:44.275
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558176,540018,540436,0,TO_TIMESTAMP('2017-12-11 14:06:44','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A01SAEP',35,35,TO_TIMESTAMP('2017-12-11 14:06:44','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:44.342
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558170,540018,540437,0,TO_TIMESTAMP('2017-12-11 14:06:44','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A04GWCHT',36,36,TO_TIMESTAMP('2017-12-11 14:06:44','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:44.413
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558173,540018,540438,0,TO_TIMESTAMP('2017-12-11 14:06:44','YYYY-MM-DD HH24:MI:SS'),100,'D','.','N','Y','A01GDAT',37,37,TO_TIMESTAMP('2017-12-11 14:06:44','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:44.485
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558174,540018,540439,0,TO_TIMESTAMP('2017-12-11 14:06:44','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A01SKAEP',38,38,TO_TIMESTAMP('2017-12-11 14:06:44','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:44.557
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558171,540018,540440,0,TO_TIMESTAMP('2017-12-11 14:06:44','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A04VPART',39,39,TO_TIMESTAMP('2017-12-11 14:06:44','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:44.624
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558184,540018,540441,0,TO_TIMESTAMP('2017-12-11 14:06:44','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A01AMPVAMG',40,40,TO_TIMESTAMP('2017-12-11 14:06:44','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:44.995
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558177,540018,540442,0,TO_TIMESTAMP('2017-12-11 14:06:44','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A01SAVP',41,41,TO_TIMESTAMP('2017-12-11 14:06:44','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:45.068
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558178,540018,540443,0,TO_TIMESTAMP('2017-12-11 14:06:44','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A01SUVP',42,42,TO_TIMESTAMP('2017-12-11 14:06:44','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:45.137
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558179,540018,540444,0,TO_TIMESTAMP('2017-12-11 14:06:45','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A01SZBV',43,43,TO_TIMESTAMP('2017-12-11 14:06:45','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:45.209
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558180,540018,540445,0,TO_TIMESTAMP('2017-12-11 14:06:45','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A01SAB130A',44,44,TO_TIMESTAMP('2017-12-11 14:06:45','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:45.282
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558182,540018,540446,0,TO_TIMESTAMP('2017-12-11 14:06:45','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A01APU',45,45,TO_TIMESTAMP('2017-12-11 14:06:45','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:45.349
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558181,540018,540447,0,TO_TIMESTAMP('2017-12-11 14:06:45','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A01KAEP',46,46,TO_TIMESTAMP('2017-12-11 14:06:45','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:45.420
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558183,540018,540448,0,TO_TIMESTAMP('2017-12-11 14:06:45','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A01AMPVSGB',47,47,TO_TIMESTAMP('2017-12-11 14:06:45','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:45.493
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558187,540018,540449,0,TO_TIMESTAMP('2017-12-11 14:06:45','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A01UVP',48,48,TO_TIMESTAMP('2017-12-11 14:06:45','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:45.551
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558189,540018,540450,0,TO_TIMESTAMP('2017-12-11 14:06:45','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A01MWST',49,49,TO_TIMESTAMP('2017-12-11 14:06:45','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:45.616
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558185,540018,540451,0,TO_TIMESTAMP('2017-12-11 14:06:45','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A01AEP',50,50,TO_TIMESTAMP('2017-12-11 14:06:45','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:45.680
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558191,540018,540452,0,TO_TIMESTAMP('2017-12-11 14:06:45','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A01AB130A2',51,51,TO_TIMESTAMP('2017-12-11 14:06:45','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:45.750
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558188,540018,540453,0,TO_TIMESTAMP('2017-12-11 14:06:45','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A01ZBV',52,52,TO_TIMESTAMP('2017-12-11 14:06:45','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:45.823
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558186,540018,540454,0,TO_TIMESTAMP('2017-12-11 14:06:45','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A01AVP',53,53,TO_TIMESTAMP('2017-12-11 14:06:45','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:45.889
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558190,540018,540455,0,TO_TIMESTAMP('2017-12-11 14:06:45','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A01PPU',54,54,TO_TIMESTAMP('2017-12-11 14:06:45','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:45.957
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558198,540018,540456,0,TO_TIMESTAMP('2017-12-11 14:06:45','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A01RESERV3',55,55,TO_TIMESTAMP('2017-12-11 14:06:45','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:46.029
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558195,540018,540457,0,TO_TIMESTAMP('2017-12-11 14:06:45','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A01DPPUAPU',56,56,TO_TIMESTAMP('2017-12-11 14:06:45','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:46.097
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558194,540018,540458,0,TO_TIMESTAMP('2017-12-11 14:06:46','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A01AVPPPU',57,57,TO_TIMESTAMP('2017-12-11 14:06:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:46.164
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558192,540018,540459,0,TO_TIMESTAMP('2017-12-11 14:06:46','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A01APU783A',58,58,TO_TIMESTAMP('2017-12-11 14:06:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:46.232
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558193,540018,540460,0,TO_TIMESTAMP('2017-12-11 14:06:46','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A01AEPPPU',59,59,TO_TIMESTAMP('2017-12-11 14:06:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:46.303
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558196,540018,540461,0,TO_TIMESTAMP('2017-12-11 14:06:46','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A01RESERV1',60,60,TO_TIMESTAMP('2017-12-11 14:06:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:46.368
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558197,540018,540462,0,TO_TIMESTAMP('2017-12-11 14:06:46','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A01RESERV2',61,61,TO_TIMESTAMP('2017-12-11 14:06:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:46.433
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558205,540018,540463,0,TO_TIMESTAMP('2017-12-11 14:06:46','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A02BOPST',62,62,TO_TIMESTAMP('2017-12-11 14:06:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:46.502
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558199,540018,540464,0,TO_TIMESTAMP('2017-12-11 14:06:46','YYYY-MM-DD HH24:MI:SS'),100,'D','.','N','Y','A02GDAT',63,63,TO_TIMESTAMP('2017-12-11 14:06:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:46.575
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558203,540018,540465,0,TO_TIMESTAMP('2017-12-11 14:06:46','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02VSPFL',64,64,TO_TIMESTAMP('2017-12-11 14:06:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:46.646
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558206,540018,540466,0,TO_TIMESTAMP('2017-12-11 14:06:46','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02TFG',65,65,TO_TIMESTAMP('2017-12-11 14:06:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:46.719
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558202,540018,540467,0,TO_TIMESTAMP('2017-12-11 14:06:46','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02APPFL',66,66,TO_TIMESTAMP('2017-12-11 14:06:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:46.780
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558200,540018,540468,0,TO_TIMESTAMP('2017-12-11 14:06:46','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02AM',67,67,TO_TIMESTAMP('2017-12-11 14:06:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:46.837
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558201,540018,540469,0,TO_TIMESTAMP('2017-12-11 14:06:46','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02MP',68,68,TO_TIMESTAMP('2017-12-11 14:06:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:46.896
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558204,540018,540470,0,TO_TIMESTAMP('2017-12-11 14:06:46','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02BTM',69,69,TO_TIMESTAMP('2017-12-11 14:06:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:46.954
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558208,540018,540471,0,TO_TIMESTAMP('2017-12-11 14:06:46','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02TIERAM',70,70,TO_TIMESTAMP('2017-12-11 14:06:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:47.010
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558213,540018,540472,0,TO_TIMESTAMP('2017-12-11 14:06:46','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02ANTHRO',71,71,TO_TIMESTAMP('2017-12-11 14:06:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:47.076
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558207,540018,540473,0,TO_TIMESTAMP('2017-12-11 14:06:47','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02DROCH',72,72,TO_TIMESTAMP('2017-12-11 14:06:47','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:47.146
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558210,540018,540474,0,TO_TIMESTAMP('2017-12-11 14:06:47','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02HMZV',73,73,TO_TIMESTAMP('2017-12-11 14:06:47','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:47.208
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558212,540018,540475,0,TO_TIMESTAMP('2017-12-11 14:06:47','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02HOMOEO',74,74,TO_TIMESTAMP('2017-12-11 14:06:47','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:47.271
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558211,540018,540476,0,TO_TIMESTAMP('2017-12-11 14:06:47','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02LIFSTYL',75,75,TO_TIMESTAMP('2017-12-11 14:06:47','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:47.343
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558209,540018,540477,0,TO_TIMESTAMP('2017-12-11 14:06:47','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02NEGLIS',76,76,TO_TIMESTAMP('2017-12-11 14:06:47','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:47.416
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558214,540018,540478,0,TO_TIMESTAMP('2017-12-11 14:06:47','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02PHYTO',77,77,TO_TIMESTAMP('2017-12-11 14:06:47','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:47.480
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558217,540018,540479,0,TO_TIMESTAMP('2017-12-11 14:06:47','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02SDB',78,78,TO_TIMESTAMP('2017-12-11 14:06:47','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:47.549
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558218,540018,540480,0,TO_TIMESTAMP('2017-12-11 14:06:47','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02ZULREG',79,79,TO_TIMESTAMP('2017-12-11 14:06:47','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:47.621
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558220,540018,540481,0,TO_TIMESTAMP('2017-12-11 14:06:47','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02NEM',80,80,TO_TIMESTAMP('2017-12-11 14:06:47','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:47.690
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558215,540018,540482,0,TO_TIMESTAMP('2017-12-11 14:06:47','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02AUSNREI',81,81,TO_TIMESTAMP('2017-12-11 14:06:47','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:47.759
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558216,540018,540483,0,TO_TIMESTAMP('2017-12-11 14:06:47','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02GENER',82,82,TO_TIMESTAMP('2017-12-11 14:06:47','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:47.830
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558219,540018,540484,0,TO_TIMESTAMP('2017-12-11 14:06:47','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02LEBENSM',83,83,TO_TIMESTAMP('2017-12-11 14:06:47','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:47.897
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558221,540018,540485,0,TO_TIMESTAMP('2017-12-11 14:06:47','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02DIAET',84,84,TO_TIMESTAMP('2017-12-11 14:06:47','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:47.963
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558223,540018,540486,0,TO_TIMESTAMP('2017-12-11 14:06:47','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02PSM',85,85,TO_TIMESTAMP('2017-12-11 14:06:47','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:48.035
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558224,540018,540487,0,TO_TIMESTAMP('2017-12-11 14:06:47','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02TREZEP',86,86,TO_TIMESTAMP('2017-12-11 14:06:47','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:48.106
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558226,540018,540488,0,TO_TIMESTAMP('2017-12-11 14:06:48','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02130A18',87,87,TO_TIMESTAMP('2017-12-11 14:06:48','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:48.175
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558227,540018,540489,0,TO_TIMESTAMP('2017-12-11 14:06:48','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02130A1A8',88,88,TO_TIMESTAMP('2017-12-11 14:06:48','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:48.245
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558225,540018,540490,0,TO_TIMESTAMP('2017-12-11 14:06:48','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A0247AMG',89,89,TO_TIMESTAMP('2017-12-11 14:06:48','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:48.309
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558228,540018,540491,0,TO_TIMESTAMP('2017-12-11 14:06:48','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A0252B',90,90,TO_TIMESTAMP('2017-12-11 14:06:48','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:48.372
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558222,540018,540492,0,TO_TIMESTAMP('2017-12-11 14:06:48','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02BIOZID',91,91,TO_TIMESTAMP('2017-12-11 14:06:48','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:48.435
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558232,540018,540493,0,TO_TIMESTAMP('2017-12-11 14:06:48','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02EB130B',92,92,TO_TIMESTAMP('2017-12-11 14:06:48','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:48.503
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558231,540018,540494,0,TO_TIMESTAMP('2017-12-11 14:06:48','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02STERIL',93,93,TO_TIMESTAMP('2017-12-11 14:06:48','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:48.576
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558229,540018,540495,0,TO_TIMESTAMP('2017-12-11 14:06:48','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02BIOSIEG',94,94,TO_TIMESTAMP('2017-12-11 14:06:48','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:48.646
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558230,540018,540496,0,TO_TIMESTAMP('2017-12-11 14:06:48','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02KOSMET',95,95,TO_TIMESTAMP('2017-12-11 14:06:48','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:48.716
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558233,540018,540497,0,TO_TIMESTAMP('2017-12-11 14:06:48','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02WIRKSTO',96,96,TO_TIMESTAMP('2017-12-11 14:06:48','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:48.780
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558235,540018,540498,0,TO_TIMESTAMP('2017-12-11 14:06:48','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02EXPLOS',97,97,TO_TIMESTAMP('2017-12-11 14:06:48','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:48.847
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558234,540018,540499,0,TO_TIMESTAMP('2017-12-11 14:06:48','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02ELEKTRO',98,98,TO_TIMESTAMP('2017-12-11 14:06:48','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:49.212
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558241,540018,540500,0,TO_TIMESTAMP('2017-12-11 14:06:48','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02RESERV1',99,99,TO_TIMESTAMP('2017-12-11 14:06:48','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:49.282
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558239,540018,540501,0,TO_TIMESTAMP('2017-12-11 14:06:49','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02BATTG',100,100,TO_TIMESTAMP('2017-12-11 14:06:49','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:49.382
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558236,540018,540502,0,TO_TIMESTAMP('2017-12-11 14:06:49','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02BIOTECH',101,101,TO_TIMESTAMP('2017-12-11 14:06:49','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:49.446
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558240,540018,540503,0,TO_TIMESTAMP('2017-12-11 14:06:49','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A02MELDENR',102,102,TO_TIMESTAMP('2017-12-11 14:06:49','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:49.505
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558237,540018,540504,0,TO_TIMESTAMP('2017-12-11 14:06:49','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02ELEKEAR',103,103,TO_TIMESTAMP('2017-12-11 14:06:49','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:49.564
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558238,540018,540505,0,TO_TIMESTAMP('2017-12-11 14:06:49','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A02WEEEREG',104,104,TO_TIMESTAMP('2017-12-11 14:06:49','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:49.626
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558242,540018,540506,0,TO_TIMESTAMP('2017-12-11 14:06:49','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02RESERV2',105,105,TO_TIMESTAMP('2017-12-11 14:06:49','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:49.685
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558243,540018,540507,0,TO_TIMESTAMP('2017-12-11 14:06:49','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A02RESERV3',106,106,TO_TIMESTAMP('2017-12-11 14:06:49','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:49.745
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558249,540018,540508,0,TO_TIMESTAMP('2017-12-11 14:06:49','YYYY-MM-DD HH24:MI:SS'),100,'D','.','N','Y','A03GDAT',107,107,TO_TIMESTAMP('2017-12-11 14:06:49','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:49.804
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558244,540018,540509,0,TO_TIMESTAMP('2017-12-11 14:06:49','YYYY-MM-DD HH24:MI:SS'),100,'D','.','N','Y','A11GDAT',108,108,TO_TIMESTAMP('2017-12-11 14:06:49','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:49.870
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558245,540018,540510,0,TO_TIMESTAMP('2017-12-11 14:06:49','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A11VERIFIZ',109,109,TO_TIMESTAMP('2017-12-11 14:06:49','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:49.932
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558248,540018,540511,0,TO_TIMESTAMP('2017-12-11 14:06:49','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A11VERIPFL',110,110,TO_TIMESTAMP('2017-12-11 14:06:49','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:49.997
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558247,540018,540512,0,TO_TIMESTAMP('2017-12-11 14:06:49','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A11VERIREA',111,111,TO_TIMESTAMP('2017-12-11 14:06:49','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:50.066
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558246,540018,540513,0,TO_TIMESTAMP('2017-12-11 14:06:49','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A11VERITES',112,112,TO_TIMESTAMP('2017-12-11 14:06:49','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:50.131
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558255,540018,540514,0,TO_TIMESTAMP('2017-12-11 14:06:50','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A03VKSTAT',113,113,TO_TIMESTAMP('2017-12-11 14:06:50','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:50.189
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558254,540018,540515,0,TO_TIMESTAMP('2017-12-11 14:06:50','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A03VWGSEH',114,114,TO_TIMESTAMP('2017-12-11 14:06:50','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:50.256
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558253,540018,540516,0,TO_TIMESTAMP('2017-12-11 14:06:50','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A03VWGKAP',115,115,TO_TIMESTAMP('2017-12-11 14:06:50','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:50.325
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558251,540018,540517,0,TO_TIMESTAMP('2017-12-11 14:06:50','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A03VWGGH',116,116,TO_TIMESTAMP('2017-12-11 14:06:50','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:50.415
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558252,540018,540518,0,TO_TIMESTAMP('2017-12-11 14:06:50','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A03VWGAPO',117,117,TO_TIMESTAMP('2017-12-11 14:06:50','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:50.483
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558250,540018,540519,0,TO_TIMESTAMP('2017-12-11 14:06:50','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A03VTSTAT',118,118,TO_TIMESTAMP('2017-12-11 14:06:50','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:50.554
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558259,540018,540520,0,TO_TIMESTAMP('2017-12-11 14:06:50','YYYY-MM-DD HH24:MI:SS'),100,'D','.','N','Y','A09GDAT',119,119,TO_TIMESTAMP('2017-12-11 14:06:50','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:50.622
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558260,540018,540521,0,TO_TIMESTAMP('2017-12-11 14:06:50','YYYY-MM-DD HH24:MI:SS'),100,'S','.','N','Y','A09THGP',120,120,TO_TIMESTAMP('2017-12-11 14:06:50','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:50.695
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558258,540018,540522,0,TO_TIMESTAMP('2017-12-11 14:06:50','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A06PZNORIG',121,121,TO_TIMESTAMP('2017-12-11 14:06:50','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:50.761
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558257,540018,540523,0,TO_TIMESTAMP('2017-12-11 14:06:50','YYYY-MM-DD HH24:MI:SS'),100,'N','.','N','Y','A06PZNNF',122,122,TO_TIMESTAMP('2017-12-11 14:06:50','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:50.820
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558256,540018,540524,0,TO_TIMESTAMP('2017-12-11 14:06:50','YYYY-MM-DD HH24:MI:SS'),100,'D','.','N','Y','A06GDAT',123,123,TO_TIMESTAMP('2017-12-11 14:06:50','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:50.885
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558261,540018,540525,0,TO_TIMESTAMP('2017-12-11 14:06:50','YYYY-MM-DD HH24:MI:SS'),100,'C','.','N','Y','Pharma Product',124,124,TO_TIMESTAMP('2017-12-11 14:06:50','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:50.957
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558273,540018,540526,0,TO_TIMESTAMP('2017-12-11 14:06:50','YYYY-MM-DD HH24:MI:SS'),100,'D','.','N','Y','Erstellt',125,125,TO_TIMESTAMP('2017-12-11 14:06:50','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:06:51.325
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_ImpFormat_Row (AD_Client_ID,AD_Column_ID,AD_ImpFormat_ID,AD_ImpFormat_Row_ID,AD_Org_ID,Created,CreatedBy,DataType,DecimalPoint,DivideBy100,IsActive,Name,SeqNo,StartNo,Updated,UpdatedBy) VALUES (0,558275,540018,540527,0,TO_TIMESTAMP('2017-12-11 14:06:50','YYYY-MM-DD HH24:MI:SS'),100,'D','.','N','Y','Aktualisiert',126,126,TO_TIMESTAMP('2017-12-11 14:06:50','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-12-11T14:07:39.032
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET StartNo=1,Updated=TO_TIMESTAMP('2017-12-11 14:07:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540403
;
-- 2017-12-11T14:07:45.237
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET StartNo=2,Updated=TO_TIMESTAMP('2017-12-11 14:07:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540402
;
-- 2017-12-11T14:08:05.919
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET StartNo=4,Updated=TO_TIMESTAMP('2017-12-11 14:08:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540407
;
-- 2017-12-11T14:08:13.442
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET StartNo=5,Updated=TO_TIMESTAMP('2017-12-11 14:08:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540410
;
-- 2017-12-11T14:08:32.232
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET StartNo=6,Updated=TO_TIMESTAMP('2017-12-11 14:08:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540408
;
-- 2017-12-11T14:08:39.799
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET StartNo=7,Updated=TO_TIMESTAMP('2017-12-11 14:08:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540412
;
-- 2017-12-11T14:09:00.056
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET StartNo=8,Updated=TO_TIMESTAMP('2017-12-11 14:09:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540411
;
-- 2017-12-11T14:09:24.898
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET StartNo=9,Updated=TO_TIMESTAMP('2017-12-11 14:09:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540405
;
-- 2017-12-11T14:09:43.206
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET StartNo=10,Updated=TO_TIMESTAMP('2017-12-11 14:09:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540406
;
-- 2017-12-11T14:11:44.231
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540525
;
-- 2017-12-11T14:11:47.139
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540526
;
-- 2017-12-11T14:11:49.161
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ImpFormat_Row WHERE AD_ImpFormat_Row_ID=540527
;
UPDATE AD_ImpFormat_Row SET StartNo = 1 WHERE Name = 'A00SSATZ';
UPDATE AD_ImpFormat_Row SET StartNo = 2 WHERE Name = 'A00PZN';
UPDATE AD_ImpFormat_Row SET StartNo = 3 WHERE Name = 'A00GDAT';
UPDATE AD_ImpFormat_Row SET StartNo = 4 WHERE Name = 'A00PBEZ';
UPDATE AD_ImpFormat_Row SET StartNo = 5 WHERE Name = 'A00PGMENG';
UPDATE AD_ImpFormat_Row SET StartNo = 6 WHERE Name = 'A00PGEINH';
UPDATE AD_ImpFormat_Row SET StartNo = 7 WHERE Name = 'A00DARFO';
UPDATE AD_ImpFormat_Row SET StartNo = 8 WHERE Name = 'A00ANBNR4';
UPDATE AD_ImpFormat_Row SET StartNo = 9 WHERE Name = 'A00ATYP';
UPDATE AD_ImpFormat_Row SET StartNo = 10 WHERE Name = 'A00LKZ';
UPDATE AD_ImpFormat_Row SET StartNo = 11 WHERE Name = 'A00GTIN';
UPDATE AD_ImpFormat_Row SET StartNo = 12 WHERE Name = 'A00ARTNR';
UPDATE AD_ImpFormat_Row SET StartNo = 13 WHERE Name = 'A00HMNR';
UPDATE AD_ImpFormat_Row SET StartNo = 14 WHERE Name = 'A00PNAM';
UPDATE AD_ImpFormat_Row SET StartNo = 15 WHERE Name = 'A00WGA';
UPDATE AD_ImpFormat_Row SET StartNo = 16 WHERE Name = 'A00PPN';
UPDATE AD_ImpFormat_Row SET StartNo = 17 WHERE Name = 'A05GDAT';
UPDATE AD_ImpFormat_Row SET StartNo = 18 WHERE Name = 'A05VFDAT';
UPDATE AD_ImpFormat_Row SET StartNo = 19 WHERE Name = 'A05LZEIT';
UPDATE AD_ImpFormat_Row SET StartNo = 20 WHERE Name = 'A05KKETTE';
UPDATE AD_ImpFormat_Row SET StartNo = 21 WHERE Name = 'A05TMAX';
UPDATE AD_ImpFormat_Row SET StartNo = 22 WHERE Name = 'A05TMIN';
UPDATE AD_ImpFormat_Row SET StartNo = 23 WHERE Name = 'A05LICHT';
UPDATE AD_ImpFormat_Row SET StartNo = 24 WHERE Name = 'A05FEUCHT';
UPDATE AD_ImpFormat_Row SET StartNo = 25 WHERE Name = 'A05LAGE';
UPDATE AD_ImpFormat_Row SET StartNo = 26 WHERE Name = 'A05ZERBR';
UPDATE AD_ImpFormat_Row SET StartNo = 27 WHERE Name = 'A05EICH';
UPDATE AD_ImpFormat_Row SET StartNo = 28 WHERE Name = 'A05LZEICH';
UPDATE AD_ImpFormat_Row SET StartNo = 29 WHERE Name = 'A04GDAT';
UPDATE AD_ImpFormat_Row SET StartNo = 30 WHERE Name = 'A04LAENGE';
UPDATE AD_ImpFormat_Row SET StartNo = 31 WHERE Name = 'A04HOEHE';
UPDATE AD_ImpFormat_Row SET StartNo = 32 WHERE Name = 'A04BREITE';
UPDATE AD_ImpFormat_Row SET StartNo = 33 WHERE Name = 'A04GWCHT';
UPDATE AD_ImpFormat_Row SET StartNo = 34 WHERE Name = 'A04VPART';
UPDATE AD_ImpFormat_Row SET StartNo = 35 WHERE Name = 'A04MBEST';
UPDATE AD_ImpFormat_Row SET StartNo = 36 WHERE Name = 'A01GDAT';
UPDATE AD_ImpFormat_Row SET StartNo = 37 WHERE Name = 'A01SKAEP';
UPDATE AD_ImpFormat_Row SET StartNo = 38 WHERE Name = 'A01SAPU';
UPDATE AD_ImpFormat_Row SET StartNo = 39 WHERE Name = 'A01SAEP';
UPDATE AD_ImpFormat_Row SET StartNo = 40 WHERE Name = 'A01SAVP';
UPDATE AD_ImpFormat_Row SET StartNo = 41 WHERE Name = 'A01SUVP';
UPDATE AD_ImpFormat_Row SET StartNo = 42 WHERE Name = 'A01SZBV';
UPDATE AD_ImpFormat_Row SET StartNo = 43 WHERE Name = 'A01SAB130A';
UPDATE AD_ImpFormat_Row SET StartNo = 44 WHERE Name = 'A01KAEP';
UPDATE AD_ImpFormat_Row SET StartNo = 45 WHERE Name = 'A01APU';
UPDATE AD_ImpFormat_Row SET StartNo = 46 WHERE Name = 'A01AMPVSGB';
UPDATE AD_ImpFormat_Row SET StartNo = 47 WHERE Name = 'A01AMPVAMG';
UPDATE AD_ImpFormat_Row SET StartNo = 48 WHERE Name = 'A01AEP';
UPDATE AD_ImpFormat_Row SET StartNo = 49 WHERE Name = 'A01AVP';
UPDATE AD_ImpFormat_Row SET StartNo = 50 WHERE Name = 'A01UVP';
UPDATE AD_ImpFormat_Row SET StartNo = 51 WHERE Name = 'A01ZBV';
UPDATE AD_ImpFormat_Row SET StartNo = 52 WHERE Name = 'A01MWST';
UPDATE AD_ImpFormat_Row SET StartNo = 53 WHERE Name = 'A01PPU';
UPDATE AD_ImpFormat_Row SET StartNo = 54 WHERE Name = 'A01AB130A2';
UPDATE AD_ImpFormat_Row SET StartNo = 55 WHERE Name = 'A01APU783A';
UPDATE AD_ImpFormat_Row SET StartNo = 56 WHERE Name = 'A01AEPPPU';
UPDATE AD_ImpFormat_Row SET StartNo = 57 WHERE Name = 'A01AVPPPU';
UPDATE AD_ImpFormat_Row SET StartNo = 58 WHERE Name = 'A01DPPUAPU';
UPDATE AD_ImpFormat_Row SET StartNo = 59 WHERE Name = 'A01RESERV1';
UPDATE AD_ImpFormat_Row SET StartNo = 60 WHERE Name = 'A01RESERV2';
UPDATE AD_ImpFormat_Row SET StartNo = 61 WHERE Name = 'A01RESERV3';
UPDATE AD_ImpFormat_Row SET StartNo = 62 WHERE Name = 'A02GDAT';
UPDATE AD_ImpFormat_Row SET StartNo = 63 WHERE Name = 'A02AM';
UPDATE AD_ImpFormat_Row SET StartNo = 64 WHERE Name = 'A02MP';
UPDATE AD_ImpFormat_Row SET StartNo = 65 WHERE Name = 'A02APPFL';
UPDATE AD_ImpFormat_Row SET StartNo = 66 WHERE Name = 'A02VSPFL';
UPDATE AD_ImpFormat_Row SET StartNo = 67 WHERE Name = 'A02BTM';
UPDATE AD_ImpFormat_Row SET StartNo = 68 WHERE Name = 'A02BOPST';
UPDATE AD_ImpFormat_Row SET StartNo = 69 WHERE Name = 'A02TFG';
UPDATE AD_ImpFormat_Row SET StartNo = 70 WHERE Name = 'A02DROCH';
UPDATE AD_ImpFormat_Row SET StartNo = 71 WHERE Name = 'A02TIERAM';
UPDATE AD_ImpFormat_Row SET StartNo = 72 WHERE Name = 'A02NEGLIS';
UPDATE AD_ImpFormat_Row SET StartNo = 73 WHERE Name = 'A02HMZV';
UPDATE AD_ImpFormat_Row SET StartNo = 74 WHERE Name = 'A02LIFSTYL';
UPDATE AD_ImpFormat_Row SET StartNo = 75 WHERE Name = 'A02HOMOEO';
UPDATE AD_ImpFormat_Row SET StartNo = 76 WHERE Name = 'A02ANTHRO';
UPDATE AD_ImpFormat_Row SET StartNo = 77 WHERE Name = 'A02PHYTO';
UPDATE AD_ImpFormat_Row SET StartNo = 78 WHERE Name = 'A02AUSNREI';
UPDATE AD_ImpFormat_Row SET StartNo = 79 WHERE Name = 'A02GENER';
UPDATE AD_ImpFormat_Row SET StartNo = 80 WHERE Name = 'A02SDB';
UPDATE AD_ImpFormat_Row SET StartNo = 81 WHERE Name = 'A02ZULREG';
UPDATE AD_ImpFormat_Row SET StartNo = 82 WHERE Name = 'A02LEBENSM';
UPDATE AD_ImpFormat_Row SET StartNo = 83 WHERE Name = 'A02NEM';
UPDATE AD_ImpFormat_Row SET StartNo = 84 WHERE Name = 'A02DIAET';
UPDATE AD_ImpFormat_Row SET StartNo = 85 WHERE Name = 'A02BIOZID';
UPDATE AD_ImpFormat_Row SET StartNo = 86 WHERE Name = 'A02PSM';
UPDATE AD_ImpFormat_Row SET StartNo = 87 WHERE Name = 'A02TREZEP';
UPDATE AD_ImpFormat_Row SET StartNo = 88 WHERE Name = 'A0247AMG';
UPDATE AD_ImpFormat_Row SET StartNo = 89 WHERE Name = 'A02130A18';
UPDATE AD_ImpFormat_Row SET StartNo = 90 WHERE Name = 'A02130A1A8';
UPDATE AD_ImpFormat_Row SET StartNo = 91 WHERE Name = 'A0252B';
UPDATE AD_ImpFormat_Row SET StartNo = 92 WHERE Name = 'A02BIOSIEG';
UPDATE AD_ImpFormat_Row SET StartNo = 93 WHERE Name = 'A02KOSMET';
UPDATE AD_ImpFormat_Row SET StartNo = 94 WHERE Name = 'A02STERIL';
UPDATE AD_ImpFormat_Row SET StartNo = 95 WHERE Name = 'A02EB130B';
UPDATE AD_ImpFormat_Row SET StartNo = 96 WHERE Name = 'A02WIRKSTO';
UPDATE AD_ImpFormat_Row SET StartNo = 97 WHERE Name = 'A02ELEKTRO';
UPDATE AD_ImpFormat_Row SET StartNo = 98 WHERE Name = 'A02EXPLOS';
UPDATE AD_ImpFormat_Row SET StartNo = 99 WHERE Name = 'A02BIOTECH';
UPDATE AD_ImpFormat_Row SET StartNo = 100 WHERE Name = 'A02ELEKEAR';
UPDATE AD_ImpFormat_Row SET StartNo = 101 WHERE Name = 'A02WEEEREG';
UPDATE AD_ImpFormat_Row SET StartNo = 102 WHERE Name = 'A02BATTG';
UPDATE AD_ImpFormat_Row SET StartNo = 103 WHERE Name = 'A02MELDENR';
UPDATE AD_ImpFormat_Row SET StartNo = 104 WHERE Name = 'A02RESERV1';
UPDATE AD_ImpFormat_Row SET StartNo = 105 WHERE Name = 'A02RESERV2';
UPDATE AD_ImpFormat_Row SET StartNo = 106 WHERE Name = 'A02RESERV3';
UPDATE AD_ImpFormat_Row SET StartNo = 107 WHERE Name = 'A11GDAT';
UPDATE AD_ImpFormat_Row SET StartNo = 108 WHERE Name = 'A11VERIFIZ';
UPDATE AD_ImpFormat_Row SET StartNo = 109 WHERE Name = 'A11VERITES';
UPDATE AD_ImpFormat_Row SET StartNo = 110 WHERE Name = 'A11VERIREA';
UPDATE AD_ImpFormat_Row SET StartNo = 111 WHERE Name = 'A11VERIPFL';
UPDATE AD_ImpFormat_Row SET StartNo = 112 WHERE Name = 'A03GDAT';
UPDATE AD_ImpFormat_Row SET StartNo = 113 WHERE Name = 'A03VTSTAT';
UPDATE AD_ImpFormat_Row SET StartNo = 114 WHERE Name = 'A03VWGGH';
UPDATE AD_ImpFormat_Row SET StartNo = 115 WHERE Name = 'A03VWGAPO';
UPDATE AD_ImpFormat_Row SET StartNo = 116 WHERE Name = 'A03VWGKAP';
UPDATE AD_ImpFormat_Row SET StartNo = 117 WHERE Name = 'A03VWGSEH';
UPDATE AD_ImpFormat_Row SET StartNo = 118 WHERE Name = 'A03VKSTAT';
UPDATE AD_ImpFormat_Row SET StartNo = 119 WHERE Name = 'A06GDAT';
UPDATE AD_ImpFormat_Row SET StartNo = 120 WHERE Name = 'A06PZNNF';
UPDATE AD_ImpFormat_Row SET StartNo = 121 WHERE Name = 'A06PZNORIG';
UPDATE AD_ImpFormat_Row SET StartNo = 122 WHERE Name = 'A09GDAT';
UPDATE AD_ImpFormat_Row SET StartNo = 123 WHERE Name = 'A09THGP';
UPDATE AD_ImpFormat_Row SET SeqNo = StartNo*10 WHERE AD_ImpFormat_ID = 540018;
UPDATE AD_ImpFormat_Row SET StartNo = StartNo+1 WHERE AD_ImpFormat_ID = 540018;
-- 2017-12-11T14:57:35.780
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET DataFormat='yyyy-MM-dd',Updated=TO_TIMESTAMP('2017-12-11 14:57:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540404
;
-- 2017-12-11T14:58:32.710
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET DataFormat='yyyy-MM-dd',Updated=TO_TIMESTAMP('2017-12-11 14:58:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540413
;
-- 2017-12-11T14:58:33.689
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET DataFormat='yyyy-MM-dd',Updated=TO_TIMESTAMP('2017-12-11 14:58:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540426
;
-- 2017-12-11T14:58:34.484
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET DataFormat='yyyy-MM-dd',Updated=TO_TIMESTAMP('2017-12-11 14:58:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540438
;
-- 2017-12-11T14:58:35.237
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET DataFormat='yyyy-MM-dd',Updated=TO_TIMESTAMP('2017-12-11 14:58:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540464
;
-- 2017-12-11T14:58:36.164
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET DataFormat='yyyy-MM-dd',Updated=TO_TIMESTAMP('2017-12-11 14:58:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540509
;
-- 2017-12-11T14:58:36.855
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET DataFormat='yyyy-MM-dd',Updated=TO_TIMESTAMP('2017-12-11 14:58:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540508
;
-- 2017-12-11T14:58:37.565
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET DataFormat='yyyy-MM-dd',Updated=TO_TIMESTAMP('2017-12-11 14:58:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540524
;
-- 2017-12-11T14:58:38.837
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET DataFormat='yyyy-MM-dd',Updated=TO_TIMESTAMP('2017-12-11 14:58:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540520
;
-- 2017-12-11T15:41:04.801
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET DataFormat='yyyyMMdd',Updated=TO_TIMESTAMP('2017-12-11 15:41:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540404
;
-- 2017-12-11T15:41:07.148
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET DataFormat='yyyyMMdd',Updated=TO_TIMESTAMP('2017-12-11 15:41:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540413
;
-- 2017-12-11T15:41:09.156
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET DataFormat='yyyyMMdd',Updated=TO_TIMESTAMP('2017-12-11 15:41:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540426
;
-- 2017-12-11T15:41:11.894
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET DataFormat='yyyyMMdd',Updated=TO_TIMESTAMP('2017-12-11 15:41:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540438
;
-- 2017-12-11T15:41:14.226
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET DataFormat='yyyyMMdd',Updated=TO_TIMESTAMP('2017-12-11 15:41:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540464
;
-- 2017-12-11T15:41:15.980
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET DataFormat='yyyyMMdd',Updated=TO_TIMESTAMP('2017-12-11 15:41:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540509
;
-- 2017-12-11T15:41:18.306
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET DataFormat='yyyyMMdd',Updated=TO_TIMESTAMP('2017-12-11 15:41:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540508
;
-- 2017-12-11T15:41:20.272
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET DataFormat='yyyyMMdd',Updated=TO_TIMESTAMP('2017-12-11 15:41:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540524
;
-- 2017-12-11T15:41:22.360
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_ImpFormat_Row SET DataFormat='yyyyMMdd',Updated=TO_TIMESTAMP('2017-12-11 15:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ImpFormat_Row_ID=540520
; | the_stack |
-- 26.01.2017 13:49
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process (AccessLevel,AD_Client_ID,AD_Org_ID,AD_Process_ID,AllowProcessReRun,Classname,CopyFromProcess,Created,CreatedBy,EntityType,IsActive,IsApplySecuritySettings,IsBetaFunctionality,IsDirectPrint,IsOneInstanceOnly,IsReport,IsServerProcess,IsUseBPartnerLanguage,JasperReport,JasperReport_Tabular,LockWaitTimeout,Name,RefreshAllAfterExecution,ShowHelp,Type,Updated,UpdatedBy,Value) VALUES ('3',0,0,540754,'Y','org.compiere.report.ReportStarter','N',TO_TIMESTAMP('2017-01-26 13:49:53','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.fresh','Y','N','N','N','N','Y','N','Y','@PREFIX@de/metas/reports/umsatzreport_week/report.jasper','@PREFIX@de/metas/reports/umsatzreport_week/report_TabularView.jasper',0,'Umsatzreport Woche','N','Y','Java',TO_TIMESTAMP('2017-01-26 13:49:53','YYYY-MM-DD HH24:MI:SS'),100,'Umsatzreport Woche (Jasper)')
;
-- 26.01.2017 13:49
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Trl (AD_Language,AD_Process_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_ID=540754 AND NOT EXISTS (SELECT * FROM AD_Process_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_ID=t.AD_Process_ID)
;
-- 26.01.2017 13:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,Help,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,ReadOnlyLogic,SeqNo,Updated,UpdatedBy) VALUES (0,113,0,540754,541140,19,'AD_Org_ID',TO_TIMESTAMP('2017-01-26 13:50:44','YYYY-MM-DD HH24:MI:SS'),100,'@AD_Org_ID@','Organisatorische Einheit des Mandanten','de.metas.fresh',0,'Eine Organisation ist ein Bereich ihres Mandanten - z.B. Laden oder Abteilung. Sie können Daten über Organisationen hinweg gemeinsam verwenden.','Y','N','Y','N','Y','N','Sektion','1=1',10,TO_TIMESTAMP('2017-01-26 13:50:44','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 26.01.2017 13:50
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=541140 AND NOT EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 26.01.2017 13:52
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,AD_Reference_Value_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,223,0,540754,541141,18,540133,'base_year',TO_TIMESTAMP('2017-01-26 13:52:33','YYYY-MM-DD HH24:MI:SS'),100,'Kalenderjahr','de.metas.fresh',0,'"Jahr" bezeichnet ein eindeutiges Jahr eines Kalenders.','Y','N','Y','N','N','N','Jahr',20,TO_TIMESTAMP('2017-01-26 13:52:33','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 26.01.2017 13:52
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=541141 AND NOT EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 26.01.2017 13:53
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy,ValueMax,ValueMin) VALUES (0,543077,0,540754,541142,11,'base_week',TO_TIMESTAMP('2017-01-26 13:53:14','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.fresh',0,'Y','N','Y','N','Y','N','Week',30,TO_TIMESTAMP('2017-01-26 13:53:14','YYYY-MM-DD HH24:MI:SS'),100,'53','1')
;
-- 26.01.2017 13:53
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=541142 AND NOT EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 26.01.2017 13:53
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET IsMandatory='Y',Updated=TO_TIMESTAMP('2017-01-26 13:53:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541141
;
-- 26.01.2017 13:54
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,AD_Reference_Value_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,223,0,540754,541143,18,540133,'comp_year',TO_TIMESTAMP('2017-01-26 13:54:10','YYYY-MM-DD HH24:MI:SS'),100,'Kalenderjahr','de.metas.fresh',0,'"Jahr" bezeichnet ein eindeutiges Jahr eines Kalenders.','Y','N','Y','N','Y','N','Vergleich Jahr',40,TO_TIMESTAMP('2017-01-26 13:54:10','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 26.01.2017 13:54
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=541143 AND NOT EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 26.01.2017 13:54
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy,ValueMax,ValueMin) VALUES (0,543077,0,540754,541144,11,'Comp_Week',TO_TIMESTAMP('2017-01-26 13:54:57','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.fresh',0,'Y','N','Y','N','Y','N','Week',50,TO_TIMESTAMP('2017-01-26 13:54:57','YYYY-MM-DD HH24:MI:SS'),100,'53','1')
;
-- 26.01.2017 13:54
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=541144 AND NOT EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 26.01.2017 13:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='Comp_Year',Updated=TO_TIMESTAMP('2017-01-26 13:55:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541143
;
-- 26.01.2017 13:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='Base_Week',Updated=TO_TIMESTAMP('2017-01-26 13:55:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541142
;
-- 26.01.2017 13:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='Base_Year',Updated=TO_TIMESTAMP('2017-01-26 13:55:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541141
;
-- 26.01.2017 13:56
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,1106,0,540754,541145,20,'IsSOTrx',TO_TIMESTAMP('2017-01-26 13:56:03','YYYY-MM-DD HH24:MI:SS'),100,'This is a Sales Transaction','de.metas.fresh',0,'The Sales Transaction checkbox indicates if this item is a Sales Transaction.','Y','N','Y','N','Y','N','Sales Transaction',60,TO_TIMESTAMP('2017-01-26 13:56:03','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 26.01.2017 13:56
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=541145 AND NOT EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 26.01.2017 13:58
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,2019,0,540754,541146,35,'M_AttributeSetInstance_ID',TO_TIMESTAMP('2017-01-26 13:58:07','YYYY-MM-DD HH24:MI:SS'),100,'Instanz des Merkmals-Satzes zum Produkt','de.metas.fresh',0,'The values of the actual Product Attribute Instances. The product level attributes are defined on Product level.','Y','N','Y','N','N','N','Ausprägung Merkmals-Satz',70,TO_TIMESTAMP('2017-01-26 13:58:07','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 26.01.2017 13:58
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=541146 AND NOT EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Menu (Action,AD_Client_ID,AD_Menu_ID,AD_Org_ID,AD_Process_ID,Created,CreatedBy,EntityType,InternalName,IsActive,IsCreateNew,IsReadOnly,IsSOTrx,IsSummary,Name,Updated,UpdatedBy) VALUES ('R',0,540750,0,540754,TO_TIMESTAMP('2017-01-26 13:59:28','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.fresh','Umsatzreport Woche (Jasper)','Y','N','N','N','N','Umsatzreport Woche',TO_TIMESTAMP('2017-01-26 13:59:28','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Menu_Trl (AD_Language,AD_Menu_ID, Description,Name,WEBUI_NameBrowse,WEBUI_NameNew,WEBUI_NameNewBreadcrumb, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Menu_ID, t.Description,t.Name,t.WEBUI_NameBrowse,t.WEBUI_NameNew,t.WEBUI_NameNewBreadcrumb, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Menu t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Menu_ID=540750 AND NOT EXISTS (SELECT * FROM AD_Menu_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Menu_ID=t.AD_Menu_ID)
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_TreeNodeMM (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo) SELECT t.AD_Client_ID,0, 'Y', now(), 100, now(), 100,t.AD_Tree_ID, 540750, 0, 999 FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.AD_Table_ID=116 AND NOT EXISTS (SELECT * FROM AD_TreeNodeMM e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=540750)
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=0, Updated=now(), UpdatedBy=100 WHERE Node_ID=540614 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=1, Updated=now(), UpdatedBy=100 WHERE Node_ID=540616 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=2, Updated=now(), UpdatedBy=100 WHERE Node_ID=540681 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=3, Updated=now(), UpdatedBy=100 WHERE Node_ID=540617 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=4, Updated=now(), UpdatedBy=100 WHERE Node_ID=540742 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=5, Updated=now(), UpdatedBy=100 WHERE Node_ID=540618 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=6, Updated=now(), UpdatedBy=100 WHERE Node_ID=540619 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=7, Updated=now(), UpdatedBy=100 WHERE Node_ID=540632 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=8, Updated=now(), UpdatedBy=100 WHERE Node_ID=540635 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=9, Updated=now(), UpdatedBy=100 WHERE Node_ID=540698 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=10, Updated=now(), UpdatedBy=100 WHERE Node_ID=540637 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=11, Updated=now(), UpdatedBy=100 WHERE Node_ID=540638 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=12, Updated=now(), UpdatedBy=100 WHERE Node_ID=540648 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=13, Updated=now(), UpdatedBy=100 WHERE Node_ID=540674 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=14, Updated=now(), UpdatedBy=100 WHERE Node_ID=540709 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=15, Updated=now(), UpdatedBy=100 WHERE Node_ID=540708 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=16, Updated=now(), UpdatedBy=100 WHERE Node_ID=540679 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=17, Updated=now(), UpdatedBy=100 WHERE Node_ID=540678 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=18, Updated=now(), UpdatedBy=100 WHERE Node_ID=540684 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=19, Updated=now(), UpdatedBy=100 WHERE Node_ID=540686 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=20, Updated=now(), UpdatedBy=100 WHERE Node_ID=540706 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=21, Updated=now(), UpdatedBy=100 WHERE Node_ID=540701 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=22, Updated=now(), UpdatedBy=100 WHERE Node_ID=540712 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=23, Updated=now(), UpdatedBy=100 WHERE Node_ID=540722 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=24, Updated=now(), UpdatedBy=100 WHERE Node_ID=540723 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=25, Updated=now(), UpdatedBy=100 WHERE Node_ID=540725 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=26, Updated=now(), UpdatedBy=100 WHERE Node_ID=540739 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=27, Updated=now(), UpdatedBy=100 WHERE Node_ID=540740 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=28, Updated=now(), UpdatedBy=100 WHERE Node_ID=540741 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=29, Updated=now(), UpdatedBy=100 WHERE Node_ID=540750 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=0, Updated=now(), UpdatedBy=100 WHERE Node_ID=540614 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=1, Updated=now(), UpdatedBy=100 WHERE Node_ID=540750 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=2, Updated=now(), UpdatedBy=100 WHERE Node_ID=540616 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=3, Updated=now(), UpdatedBy=100 WHERE Node_ID=540681 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=4, Updated=now(), UpdatedBy=100 WHERE Node_ID=540617 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=5, Updated=now(), UpdatedBy=100 WHERE Node_ID=540742 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=6, Updated=now(), UpdatedBy=100 WHERE Node_ID=540618 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=7, Updated=now(), UpdatedBy=100 WHERE Node_ID=540619 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=8, Updated=now(), UpdatedBy=100 WHERE Node_ID=540632 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=9, Updated=now(), UpdatedBy=100 WHERE Node_ID=540635 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=10, Updated=now(), UpdatedBy=100 WHERE Node_ID=540698 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=11, Updated=now(), UpdatedBy=100 WHERE Node_ID=540637 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=12, Updated=now(), UpdatedBy=100 WHERE Node_ID=540638 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=13, Updated=now(), UpdatedBy=100 WHERE Node_ID=540648 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=14, Updated=now(), UpdatedBy=100 WHERE Node_ID=540674 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=15, Updated=now(), UpdatedBy=100 WHERE Node_ID=540709 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=16, Updated=now(), UpdatedBy=100 WHERE Node_ID=540708 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=17, Updated=now(), UpdatedBy=100 WHERE Node_ID=540679 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=18, Updated=now(), UpdatedBy=100 WHERE Node_ID=540678 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=19, Updated=now(), UpdatedBy=100 WHERE Node_ID=540684 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=20, Updated=now(), UpdatedBy=100 WHERE Node_ID=540686 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=21, Updated=now(), UpdatedBy=100 WHERE Node_ID=540706 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=22, Updated=now(), UpdatedBy=100 WHERE Node_ID=540701 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=23, Updated=now(), UpdatedBy=100 WHERE Node_ID=540712 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=24, Updated=now(), UpdatedBy=100 WHERE Node_ID=540722 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=25, Updated=now(), UpdatedBy=100 WHERE Node_ID=540723 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=26, Updated=now(), UpdatedBy=100 WHERE Node_ID=540725 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=27, Updated=now(), UpdatedBy=100 WHERE Node_ID=540739 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=28, Updated=now(), UpdatedBy=100 WHERE Node_ID=540740 AND AD_Tree_ID=10
;
-- 26.01.2017 13:59
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=29, Updated=now(), UpdatedBy=100 WHERE Node_ID=540741 AND AD_Tree_ID=10
; | the_stack |
-- --------------------------------------------------
-- Entity Designer DDL Script for SQL Server Compact Edition
-- --------------------------------------------------
-- Date Created: 05/15/2014 22:06:38
-- Generated from EDMX file: D:\Projects\Git\Simple.OData.Client\Simple.OData.NorthwindModel\Northwind.edmx
-- --------------------------------------------------
-- --------------------------------------------------
-- Dropping existing FOREIGN KEY constraints
-- NOTE: if the constraint does not exist, an ignorable error will be reported.
-- --------------------------------------------------
ALTER TABLE [Order Details] DROP CONSTRAINT [FK_Order_Details_FK00];
GO
ALTER TABLE [Order Details] DROP CONSTRAINT [FK_Order_Details_FK01];
GO
ALTER TABLE [Orders] DROP CONSTRAINT [FK_Orders_FK00];
GO
ALTER TABLE [Orders] DROP CONSTRAINT [FK_Orders_FK01];
GO
ALTER TABLE [Orders] DROP CONSTRAINT [FK_Orders_FK02];
GO
ALTER TABLE [Products] DROP CONSTRAINT [FK_Products_FK00];
GO
ALTER TABLE [Products] DROP CONSTRAINT [FK_Products_FK01];
GO
-- --------------------------------------------------
-- Dropping existing tables
-- NOTE: if the table does not exist, an ignorable error will be reported.
-- --------------------------------------------------
DROP TABLE [Categories];
GO
DROP TABLE [Customers];
GO
DROP TABLE [Employees];
GO
DROP TABLE [Order Details];
GO
DROP TABLE [Orders];
GO
DROP TABLE [Products];
GO
DROP TABLE [Shippers];
GO
DROP TABLE [Suppliers];
GO
DROP TABLE [Transport_Ships];
GO
DROP TABLE [Transport_Trucks];
GO
DROP TABLE [Transport];
GO
-- --------------------------------------------------
-- Creating all tables
-- --------------------------------------------------
-- Creating table 'Categories'
CREATE TABLE [Categories] (
[CategoryID] int IDENTITY(1,1) NOT NULL,
[CategoryName] nvarchar(15) NOT NULL,
[Description] ntext NULL,
[Picture] image NULL
);
GO
-- Creating table 'Customers'
CREATE TABLE [Customers] (
[CustomerID] nvarchar(5) NOT NULL,
[CompanyName] nvarchar(40) NOT NULL,
[ContactName] nvarchar(30) NULL,
[ContactTitle] nvarchar(30) NULL,
[Address] nvarchar(60) NULL,
[City] nvarchar(15) NULL,
[Region] nvarchar(15) NULL,
[PostalCode] nvarchar(10) NULL,
[Country] nvarchar(15) NULL,
[Phone] nvarchar(24) NULL,
[Fax] nvarchar(24) NULL
);
GO
-- Creating table 'Employees'
CREATE TABLE [Employees] (
[EmployeeID] int IDENTITY(1,1) NOT NULL,
[LastName] nvarchar(20) NOT NULL,
[FirstName] nvarchar(10) NOT NULL,
[Title] nvarchar(30) NULL,
[BirthDate] datetime NULL,
[HireDate] datetime NULL,
[Address] nvarchar(60) NULL,
[City] nvarchar(15) NULL,
[Region] nvarchar(15) NULL,
[PostalCode] nvarchar(10) NULL,
[Country] nvarchar(15) NULL,
[HomePhone] nvarchar(24) NULL,
[Extension] nvarchar(4) NULL,
[Photo] image NULL,
[Notes] ntext NULL,
[ReportsTo] int NULL
);
GO
-- Creating table 'Order_Details'
CREATE TABLE [Order Details] (
[OrderID] int NOT NULL,
[ProductID] int NOT NULL,
[UnitPrice] decimal(19,4) NOT NULL,
[Quantity] smallint NOT NULL,
[Discount] real NOT NULL
);
GO
-- Creating table 'Orders'
CREATE TABLE [Orders] (
[OrderID] int NOT NULL,
[CustomerID] nvarchar(5) NOT NULL,
[EmployeeID] int NULL,
[ShipName] nvarchar(40) NULL,
[ShipAddress] nvarchar(60) NULL,
[ShipCity] nvarchar(15) NULL,
[ShipRegion] nvarchar(15) NULL,
[ShipPostalCode] nvarchar(10) NULL,
[ShipCountry] nvarchar(15) NULL,
[ShipVia] int NULL,
[OrderDate] datetime NULL,
[RequiredDate] datetime NULL,
[ShippedDate] datetime NULL,
[Freight] decimal(19,4) NULL
);
GO
-- Creating table 'Products'
CREATE TABLE [Products] (
[ProductID] int IDENTITY(1,1) NOT NULL,
[SupplierID] int NULL,
[CategoryID] int NULL,
[ProductName] nvarchar(40) NOT NULL,
[EnglishName] nvarchar(40) NULL,
[QuantityPerUnit] nvarchar(20) NULL,
[UnitPrice] decimal(19,4) NULL,
[UnitsInStock] smallint NULL,
[UnitsOnOrder] smallint NULL,
[ReorderLevel] smallint NULL,
[Discontinued] bit NOT NULL
);
GO
-- Creating table 'Shippers'
CREATE TABLE [Shippers] (
[ShipperID] int IDENTITY(1,1) NOT NULL,
[CompanyName] nvarchar(40) NOT NULL
);
GO
-- Creating table 'Suppliers'
CREATE TABLE [Suppliers] (
[SupplierID] int IDENTITY(1,1) NOT NULL,
[CompanyName] nvarchar(40) NOT NULL,
[ContactName] nvarchar(30) NULL,
[ContactTitle] nvarchar(30) NULL,
[Address] nvarchar(60) NULL,
[City] nvarchar(15) NULL,
[Region] nvarchar(15) NULL,
[PostalCode] nvarchar(10) NULL,
[Country] nvarchar(15) NULL,
[Phone] nvarchar(24) NULL,
[Fax] nvarchar(24) NULL
);
GO
-- Creating table 'Transport'
CREATE TABLE [Transport] (
[TransportID] int IDENTITY(1,1) NOT NULL
);
GO
-- Creating table 'Transport_Ships'
CREATE TABLE [Transport_Ships] (
[ShipName] nvarchar(100) NULL,
[TransportID] int NOT NULL
);
GO
-- Creating table 'Transport_Trucks'
CREATE TABLE [Transport_Trucks] (
[TruckNumber] nvarchar(100) NULL,
[TransportID] int NOT NULL
);
GO
-- --------------------------------------------------
-- Creating all PRIMARY KEY constraints
-- --------------------------------------------------
-- Creating primary key on [CategoryID] in table 'Categories'
ALTER TABLE [Categories]
ADD CONSTRAINT [PK_Categories]
PRIMARY KEY ([CategoryID] );
GO
-- Creating primary key on [CustomerID] in table 'Customers'
ALTER TABLE [Customers]
ADD CONSTRAINT [PK_Customers]
PRIMARY KEY ([CustomerID] );
GO
-- Creating primary key on [EmployeeID] in table 'Employees'
ALTER TABLE [Employees]
ADD CONSTRAINT [PK_Employees]
PRIMARY KEY ([EmployeeID] );
GO
-- Creating primary key on [OrderID], [ProductID] in table 'Order_Details'
ALTER TABLE [Order Details]
ADD CONSTRAINT [PK_Order_Details]
PRIMARY KEY ([OrderID], [ProductID] );
GO
-- Creating primary key on [OrderID] in table 'Orders'
ALTER TABLE [Orders]
ADD CONSTRAINT [PK_Orders]
PRIMARY KEY ([OrderID] );
GO
-- Creating primary key on [ProductID] in table 'Products'
ALTER TABLE [Products]
ADD CONSTRAINT [PK_Products]
PRIMARY KEY ([ProductID] );
GO
-- Creating primary key on [ShipperID] in table 'Shippers'
ALTER TABLE [Shippers]
ADD CONSTRAINT [PK_Shippers]
PRIMARY KEY ([ShipperID] );
GO
-- Creating primary key on [SupplierID] in table 'Suppliers'
ALTER TABLE [Suppliers]
ADD CONSTRAINT [PK_Suppliers]
PRIMARY KEY ([SupplierID] );
GO
-- Creating primary key on [TransportID] in table 'Transport'
ALTER TABLE [Transport]
ADD CONSTRAINT [PK_Transport]
PRIMARY KEY ([TransportID] );
GO
-- Creating primary key on [TransportID] in table 'Transport_Ships'
ALTER TABLE [Transport_Ships]
ADD CONSTRAINT [PK_Transport_Ships]
PRIMARY KEY ([TransportID] );
GO
-- Creating primary key on [TransportID] in table 'Transport_Trucks'
ALTER TABLE [Transport_Trucks]
ADD CONSTRAINT [PK_Transport_Trucks]
PRIMARY KEY ([TransportID] );
GO
-- --------------------------------------------------
-- Creating all FOREIGN KEY constraints
-- --------------------------------------------------
-- Creating foreign key on [CategoryID] in table 'Products'
ALTER TABLE [Products]
ADD CONSTRAINT [FK_Products_FK01]
FOREIGN KEY ([CategoryID])
REFERENCES [Categories]
([CategoryID])
ON DELETE NO ACTION ON UPDATE NO ACTION;
-- Creating non-clustered index for FOREIGN KEY 'FK_Products_FK01'
CREATE INDEX [IX_FK_Products_FK01]
ON [Products]
([CategoryID]);
GO
-- Creating foreign key on [CustomerID] in table 'Orders'
ALTER TABLE [Orders]
ADD CONSTRAINT [FK_Orders_FK00]
FOREIGN KEY ([CustomerID])
REFERENCES [Customers]
([CustomerID])
ON DELETE NO ACTION ON UPDATE NO ACTION;
-- Creating non-clustered index for FOREIGN KEY 'FK_Orders_FK00'
CREATE INDEX [IX_FK_Orders_FK00]
ON [Orders]
([CustomerID]);
GO
-- Creating foreign key on [EmployeeID] in table 'Orders'
ALTER TABLE [Orders]
ADD CONSTRAINT [FK_Orders_FK02]
FOREIGN KEY ([EmployeeID])
REFERENCES [Employees]
([EmployeeID])
ON DELETE NO ACTION ON UPDATE NO ACTION;
-- Creating non-clustered index for FOREIGN KEY 'FK_Orders_FK02'
CREATE INDEX [IX_FK_Orders_FK02]
ON [Orders]
([EmployeeID]);
GO
-- Creating foreign key on [ProductID] in table 'Order_Details'
ALTER TABLE [Order Details]
ADD CONSTRAINT [FK_Order_Details_FK00]
FOREIGN KEY ([ProductID])
REFERENCES [Products]
([ProductID])
ON DELETE NO ACTION ON UPDATE NO ACTION;
-- Creating non-clustered index for FOREIGN KEY 'FK_Order_Details_FK00'
CREATE INDEX [IX_FK_Order_Details_FK00]
ON [Order Details]
([ProductID]);
GO
-- Creating foreign key on [OrderID] in table 'Order_Details'
ALTER TABLE [Order Details]
ADD CONSTRAINT [FK_Order_Details_FK01]
FOREIGN KEY ([OrderID])
REFERENCES [Orders]
([OrderID])
ON DELETE CASCADE ON UPDATE NO ACTION;
GO
-- Creating foreign key on [ShipVia] in table 'Orders'
ALTER TABLE [Orders]
ADD CONSTRAINT [FK_Orders_FK01]
FOREIGN KEY ([ShipVia])
REFERENCES [Shippers]
([ShipperID])
ON DELETE NO ACTION ON UPDATE NO ACTION;
-- Creating non-clustered index for FOREIGN KEY 'FK_Orders_FK01'
CREATE INDEX [IX_FK_Orders_FK01]
ON [Orders]
([ShipVia]);
GO
-- Creating foreign key on [SupplierID] in table 'Products'
ALTER TABLE [Products]
ADD CONSTRAINT [FK_Products_FK00]
FOREIGN KEY ([SupplierID])
REFERENCES [Suppliers]
([SupplierID])
ON DELETE NO ACTION ON UPDATE NO ACTION;
-- Creating non-clustered index for FOREIGN KEY 'FK_Products_FK00'
CREATE INDEX [IX_FK_Products_FK00]
ON [Products]
([SupplierID]);
GO
-- Creating foreign key on [ReportsTo] in table 'Employees'
ALTER TABLE [Employees]
ADD CONSTRAINT [FK_Employees_FK00]
FOREIGN KEY ([ReportsTo])
REFERENCES [Employees]
([EmployeeID])
ON DELETE NO ACTION ON UPDATE NO ACTION;
-- Creating non-clustered index for FOREIGN KEY 'FK_Employees_FK00'
CREATE INDEX [IX_FK_Employees_FK00]
ON [Employees]
([ReportsTo]);
GO
-- Creating foreign key on [TransportID] in table 'Transport_Ships'
ALTER TABLE [Transport_Ships]
ADD CONSTRAINT [FK_Ships_inherits_Transport]
FOREIGN KEY ([TransportID])
REFERENCES [Transport]
([TransportID])
ON DELETE CASCADE ON UPDATE NO ACTION;
GO
-- Creating foreign key on [TransportID] in table 'Transport_Trucks'
ALTER TABLE [Transport_Trucks]
ADD CONSTRAINT [FK_Trucks_inherits_Transport]
FOREIGN KEY ([TransportID])
REFERENCES [Transport]
([TransportID])
ON DELETE CASCADE ON UPDATE NO ACTION;
GO
-- --------------------------------------------------
-- Script has ended
-- -------------------------------------------------- | the_stack |
-- Alter Concept Set table
CREATE PROCEDURE ${ohdsiSchema}.rename_cs_names AS
BEGIN
DECLARE @duplicate_names TABLE(id int IDENTITY (1, 1), duplicate_name varchar(255));
DECLARE @name_repeats TABLE (id int IDENTITY (1, 1), repeat_number int);
DECLARE @amount_of_duplicate_names int;
DECLARE @k int;
SET @k = (SELECT COUNT(*) FROM (SELECT concept_set_name FROM ${ohdsiSchema}.concept_set
GROUP BY concept_set_name
HAVING COUNT(*) > 1) AS temp);
WHILE @k > 0
BEGIN
INSERT INTO @duplicate_names
SELECT concept_set_name FROM ${ohdsiSchema}.concept_set
GROUP BY concept_set_name
HAVING COUNT(*) > 1;
INSERT INTO @name_repeats
SELECT COUNT(*) FROM ${ohdsiSchema}.concept_set
GROUP BY concept_set_name
HAVING COUNT(*) > 1;
SET @amount_of_duplicate_names = (SELECT COUNT(*) FROM @duplicate_names);
DECLARE @i int = 1;
DECLARE @j int = 1;
DECLARE @name_repeat int = 0;
DECLARE @dupl_name varchar(255);
WHILE @i <= coalesce(@amount_of_duplicate_names, 0)
BEGIN
SET @name_repeat = (SELECT repeat_number FROM @name_repeats WHERE id = @i);
WHILE @j <= coalesce(@name_repeat, 0)
BEGIN
SET @dupl_name = (SELECT duplicate_name FROM @duplicate_names WHERE id = @i);
UPDATE ${ohdsiSchema}.concept_set
SET concept_set_name = concept_set_name + ' (' + CAST(@j AS varchar(15)) + ')'
WHERE concept_set_id =
(SELECT TOP (1) concept_set_id FROM ${ohdsiSchema}.concept_set
WHERE concept_set_name = @dupl_name
);
SET @j = @j + 1;
END;
SET @i = @i + 1;
SET @j = 1;
END;
DELETE FROM @duplicate_names WHERE id = id;
DELETE FROM @name_repeats WHERE id = id;
SET @k = (SELECT COUNT(*) FROM (SELECT concept_set_name FROM ${ohdsiSchema}.concept_set
GROUP BY concept_set_name
HAVING COUNT(*) > 1) AS temp);
END;
ALTER TABLE ${ohdsiSchema}.concept_set ADD CONSTRAINT uq_cs_name UNIQUE (concept_set_name);
END;
GO
EXEC ${ohdsiSchema}.rename_cs_names;
GO
-- Alter Cohort Definition table
CREATE PROCEDURE ${ohdsiSchema}.rename_cd_names AS
BEGIN
DECLARE @duplicate_names TABLE(id int IDENTITY (1, 1), duplicate_name varchar(255));
DECLARE @name_repeats TABLE (id int IDENTITY (1, 1), repeat_number int);
DECLARE @amount_of_duplicate_names int;
DECLARE @k int;
SET @k = (SELECT COUNT(*) FROM (SELECT name FROM ${ohdsiSchema}.cohort_definition
GROUP BY name
HAVING COUNT(*) > 1) AS temp);
WHILE @k > 0
BEGIN
INSERT INTO @duplicate_names
SELECT name FROM ${ohdsiSchema}.cohort_definition
GROUP BY name
HAVING COUNT(*) > 1;
INSERT INTO @name_repeats
SELECT COUNT(*) FROM ${ohdsiSchema}.cohort_definition
GROUP BY name
HAVING COUNT(*) > 1;
SET @amount_of_duplicate_names = (SELECT COUNT(*) FROM @duplicate_names);
DECLARE @i int = 1;
DECLARE @j int = 1;
DECLARE @name_repeat int = 0;
DECLARE @dupl_name varchar(255);
WHILE @i <= coalesce(@amount_of_duplicate_names, 0)
BEGIN
SET @name_repeat = (SELECT repeat_number FROM @name_repeats WHERE id = @i);
WHILE @j <= coalesce(@name_repeat, 0)
BEGIN
SET @dupl_name = (SELECT duplicate_name FROM @duplicate_names WHERE id = @i);
UPDATE ${ohdsiSchema}.cohort_definition
SET name = name + ' (' + CAST(@j AS varchar(15)) + ')'
WHERE id =
(SELECT TOP (1) id FROM ${ohdsiSchema}.cohort_definition
WHERE name = @dupl_name
);
SET @j = @j + 1;
END;
SET @i = @i + 1;
SET @j = 1;
END;
DELETE FROM @duplicate_names WHERE id = id;
DELETE FROM @name_repeats WHERE id = id;
SET @k = (SELECT COUNT(*) FROM (SELECT name FROM ${ohdsiSchema}.cohort_definition
GROUP BY name
HAVING COUNT(*) > 1) AS temp);
END;
ALTER TABLE ${ohdsiSchema}.cohort_definition ADD CONSTRAINT uq_cd_name UNIQUE (name);
END;
GO
EXEC ${ohdsiSchema}.rename_cd_names;
GO
-- Alter Cohort Characterization table
CREATE PROCEDURE ${ohdsiSchema}.rename_cc_names AS
BEGIN
DECLARE @duplicate_names TABLE(id int IDENTITY (1, 1), duplicate_name varchar(255));
DECLARE @name_repeats TABLE (id int IDENTITY (1, 1), repeat_number int);
DECLARE @amount_of_duplicate_names int;
DECLARE @k int;
SET @k = (SELECT COUNT(*) FROM (SELECT name FROM ${ohdsiSchema}.cohort_characterization
GROUP BY name
HAVING COUNT(*) > 1) AS temp);
WHILE @k > 0
BEGIN
INSERT INTO @duplicate_names
SELECT name FROM ${ohdsiSchema}.cohort_characterization
GROUP BY name
HAVING COUNT(*) > 1;
INSERT INTO @name_repeats
SELECT COUNT(*) FROM ${ohdsiSchema}.cohort_characterization
GROUP BY name
HAVING COUNT(*) > 1;
SET @amount_of_duplicate_names = (SELECT COUNT(*) FROM @duplicate_names);
DECLARE @i int = 1;
DECLARE @j int = 1;
DECLARE @name_repeat int = 0;
DECLARE @dupl_name varchar(255);
WHILE @i <= coalesce(@amount_of_duplicate_names, 0)
BEGIN
SET @name_repeat = (SELECT repeat_number FROM @name_repeats WHERE id = @i);
WHILE @j <= coalesce(@name_repeat, 0)
BEGIN
SET @dupl_name = (SELECT duplicate_name FROM @duplicate_names WHERE id = @i);
UPDATE ${ohdsiSchema}.cohort_characterization
SET name = name + ' (' + CAST(@j AS varchar(15)) + ')'
WHERE id =
(SELECT TOP (1) id FROM ${ohdsiSchema}.cohort_characterization
WHERE name = @dupl_name
);
SET @j = @j + 1;
END;
SET @i = @i + 1;
SET @j = 1;
END;
DELETE FROM @duplicate_names WHERE id = id;
DELETE FROM @name_repeats WHERE id = id;
SET @k = (SELECT COUNT(*) FROM (SELECT name FROM ${ohdsiSchema}.cohort_characterization
GROUP BY name
HAVING COUNT(*) > 1) AS temp);
END;
ALTER TABLE ${ohdsiSchema}.cohort_characterization ADD CONSTRAINT uq_cc_name UNIQUE (name);
END;
GO
EXEC ${ohdsiSchema}.rename_cc_names;
GO
-- Alter Fe Analysis Table
CREATE PROCEDURE ${ohdsiSchema}.rename_fe_names AS
BEGIN
DECLARE @duplicate_names TABLE(id int IDENTITY (1, 1), duplicate_name varchar(255));
DECLARE @name_repeats TABLE (id int IDENTITY (1, 1), repeat_number int);
DECLARE @amount_of_duplicate_names int;
DECLARE @k int;
SET @k = (SELECT COUNT(*) FROM (SELECT name FROM ${ohdsiSchema}.fe_analysis
GROUP BY name
HAVING COUNT(*) > 1) AS temp);
WHILE @k > 0
BEGIN
INSERT INTO @duplicate_names
SELECT name FROM ${ohdsiSchema}.fe_analysis
GROUP BY name
HAVING COUNT(*) > 1;
INSERT INTO @name_repeats
SELECT COUNT(*) FROM ${ohdsiSchema}.fe_analysis
GROUP BY name
HAVING COUNT(*) > 1;
SET @amount_of_duplicate_names = (SELECT COUNT(*) FROM @duplicate_names);
DECLARE @i int = 1;
DECLARE @j int = 1;
DECLARE @name_repeat int = 0;
DECLARE @dupl_name varchar(255);
WHILE @i <= coalesce(@amount_of_duplicate_names, 0)
BEGIN
SET @name_repeat = (SELECT repeat_number FROM @name_repeats WHERE id = @i);
WHILE @j <= coalesce(@name_repeat, 0)
BEGIN
SET @dupl_name = (SELECT duplicate_name FROM @duplicate_names WHERE id = @i);
UPDATE ${ohdsiSchema}.fe_analysis
SET name = name + ' (' + CAST(@j AS varchar(15)) + ')'
WHERE id =
(SELECT TOP (1) id FROM ${ohdsiSchema}.fe_analysis
WHERE name = @dupl_name
);
SET @j = @j + 1;
END;
SET @i = @i + 1;
SET @j = 1;
END;
DELETE FROM @duplicate_names WHERE id = id;
DELETE FROM @name_repeats WHERE id = id;
SET @k = (SELECT COUNT(*) FROM (SELECT name FROM ${ohdsiSchema}.fe_analysis
GROUP BY name
HAVING COUNT(*) > 1) AS temp);
END;
ALTER TABLE ${ohdsiSchema}.fe_analysis ADD CONSTRAINT uq_fe_name UNIQUE (name);
END;
GO
EXEC ${ohdsiSchema}.rename_fe_names;
GO
-- Alter Pathway Analysis Table
CREATE PROCEDURE ${ohdsiSchema}.rename_pw_names AS
BEGIN
DECLARE @duplicate_names TABLE(id int IDENTITY (1, 1), duplicate_name varchar(255));
DECLARE @name_repeats TABLE (id int IDENTITY (1, 1), repeat_number int);
DECLARE @amount_of_duplicate_names int;
DECLARE @k int;
SET @k = (SELECT COUNT(*) FROM (SELECT name FROM ${ohdsiSchema}.pathway_analysis
GROUP BY name
HAVING COUNT(*) > 1) AS temp);
WHILE @k > 0
BEGIN
INSERT INTO @duplicate_names
SELECT name FROM ${ohdsiSchema}.pathway_analysis
GROUP BY name
HAVING COUNT(*) > 1;
INSERT INTO @name_repeats
SELECT COUNT(*) FROM ${ohdsiSchema}.pathway_analysis
GROUP BY name
HAVING COUNT(*) > 1;
SET @amount_of_duplicate_names = (SELECT COUNT(*) FROM @duplicate_names);
DECLARE @i int = 1;
DECLARE @j int = 1;
DECLARE @name_repeat int = 0;
DECLARE @dupl_name varchar(255);
WHILE @i <= coalesce(@amount_of_duplicate_names, 0)
BEGIN
SET @name_repeat = (SELECT repeat_number FROM @name_repeats WHERE id = @i);
WHILE @j <= coalesce(@name_repeat, 0)
BEGIN
SET @dupl_name = (SELECT duplicate_name FROM @duplicate_names WHERE id = @i);
UPDATE ${ohdsiSchema}.pathway_analysis
SET name = name + ' (' + CAST(@j AS varchar(15)) + ')'
WHERE id =
(SELECT TOP (1) id FROM ${ohdsiSchema}.pathway_analysis
WHERE name = @dupl_name
);
SET @j = @j + 1;
END;
SET @i = @i + 1;
SET @j = 1;
END;
DELETE FROM @duplicate_names WHERE id = id;
DELETE FROM @name_repeats WHERE id = id;
SET @k = (SELECT COUNT(*) FROM (SELECT name FROM ${ohdsiSchema}.pathway_analysis
GROUP BY name
HAVING COUNT(*) > 1) AS temp);
END;
ALTER TABLE ${ohdsiSchema}.pathway_analysis ADD CONSTRAINT uq_pw_name UNIQUE (name);
END;
GO
EXEC ${ohdsiSchema}.rename_pw_names;
GO
-- Alter IR Analysis Table
CREATE PROCEDURE ${ohdsiSchema}.rename_ir_names AS
BEGIN
DECLARE @duplicate_names TABLE(id int IDENTITY (1, 1), duplicate_name varchar(255));
DECLARE @name_repeats TABLE (id int IDENTITY (1, 1), repeat_number int);
DECLARE @amount_of_duplicate_names int;
DECLARE @k int;
SET @k = (SELECT COUNT(*) FROM (SELECT name FROM ${ohdsiSchema}.ir_analysis
GROUP BY name
HAVING COUNT(*) > 1) AS temp);
WHILE @k > 0
BEGIN
INSERT INTO @duplicate_names
SELECT name FROM ${ohdsiSchema}.ir_analysis
GROUP BY name
HAVING COUNT(*) > 1;
INSERT INTO @name_repeats
SELECT COUNT(*) FROM ${ohdsiSchema}.ir_analysis
GROUP BY name
HAVING COUNT(*) > 1;
SET @amount_of_duplicate_names = (SELECT COUNT(*) FROM @duplicate_names);
DECLARE @i int = 1;
DECLARE @j int = 1;
DECLARE @name_repeat int = 0;
DECLARE @dupl_name varchar(255);
WHILE @i <= coalesce(@amount_of_duplicate_names, 0)
BEGIN
SET @name_repeat = (SELECT repeat_number FROM @name_repeats WHERE id = @i);
WHILE @j <= coalesce(@name_repeat, 0)
BEGIN
SET @dupl_name = (SELECT duplicate_name FROM @duplicate_names WHERE id = @i);
UPDATE ${ohdsiSchema}.ir_analysis
SET name = name + ' (' + CAST(@j AS varchar(15)) + ')'
WHERE id =
(SELECT TOP (1) id FROM ${ohdsiSchema}.ir_analysis
WHERE name = @dupl_name
);
SET @j = @j + 1;
END;
SET @i = @i + 1;
SET @j = 1;
END;
DELETE FROM @duplicate_names WHERE id = id;
DELETE FROM @name_repeats WHERE id = id;
SET @k = (SELECT COUNT(*) FROM (SELECT name FROM ${ohdsiSchema}.ir_analysis
GROUP BY name
HAVING COUNT(*) > 1) AS temp);
END;
ALTER TABLE ${ohdsiSchema}.ir_analysis ADD CONSTRAINT uq_ir_name UNIQUE (name);
END;
GO
EXEC ${ohdsiSchema}.rename_ir_names;
GO
-- Alter Estimation table
CREATE PROCEDURE ${ohdsiSchema}.rename_estimation_names AS
BEGIN
DECLARE @duplicate_names TABLE(id int IDENTITY (1, 1), duplicate_name varchar(255));
DECLARE @name_repeats TABLE (id int IDENTITY (1, 1), repeat_number int);
DECLARE @amount_of_duplicate_names int;
DECLARE @k int;
SET @k = (SELECT COUNT(*) FROM (SELECT name FROM ${ohdsiSchema}.estimation
GROUP BY name
HAVING COUNT(*) > 1) AS temp);
WHILE @k > 0
BEGIN
INSERT INTO @duplicate_names
SELECT name FROM ${ohdsiSchema}.estimation
GROUP BY name
HAVING COUNT(*) > 1;
INSERT INTO @name_repeats
SELECT COUNT(*) FROM ${ohdsiSchema}.estimation
GROUP BY name
HAVING COUNT(*) > 1;
SET @amount_of_duplicate_names = (SELECT COUNT(*) FROM @duplicate_names);
DECLARE @i int = 1;
DECLARE @j int = 1;
DECLARE @name_repeat int = 0;
DECLARE @dupl_name varchar(255);
WHILE @i <= coalesce(@amount_of_duplicate_names, 0)
BEGIN
SET @name_repeat = (SELECT repeat_number FROM @name_repeats WHERE id = @i);
WHILE @j <= coalesce(@name_repeat, 0)
BEGIN
SET @dupl_name = (SELECT duplicate_name FROM @duplicate_names WHERE id = @i);
UPDATE ${ohdsiSchema}.estimation
SET name = name + ' (' + CAST(@j AS varchar(15)) + ')'
WHERE estimation_id =
(SELECT TOP (1) estimation_id FROM ${ohdsiSchema}.estimation
WHERE name = @dupl_name
);
SET @j = @j + 1;
END;
SET @i = @i + 1;
SET @j = 1;
END;
SET @k = (SELECT COUNT(*) FROM (SELECT name FROM ${ohdsiSchema}.estimation
GROUP BY name
HAVING COUNT(*) > 1) AS temp);
DELETE FROM @duplicate_names WHERE id = id;
DELETE FROM @name_repeats WHERE id = id;
END;
ALTER TABLE ${ohdsiSchema}.estimation ADD CONSTRAINT uq_es_name UNIQUE (name);
END;
GO
EXEC ${ohdsiSchema}.rename_estimation_names;
GO
-- Alter Prediction table
CREATE PROCEDURE ${ohdsiSchema}.rename_prediction_names AS
BEGIN
DECLARE @duplicate_names TABLE(id int IDENTITY (1, 1), duplicate_name varchar(255));
DECLARE @name_repeats TABLE (id int IDENTITY (1, 1), repeat_number int);
DECLARE @amount_of_duplicate_names int;
DECLARE @k int;
SET @k = (SELECT COUNT(*) FROM (SELECT name FROM ${ohdsiSchema}.prediction
GROUP BY name
HAVING COUNT(*) > 1) AS temp);
WHILE @k > 0
BEGIN
INSERT INTO @duplicate_names
SELECT name FROM ${ohdsiSchema}.prediction
GROUP BY name
HAVING COUNT(*) > 1;
INSERT INTO @name_repeats
SELECT COUNT(*) FROM ${ohdsiSchema}.prediction
GROUP BY name
HAVING COUNT(*) > 1;
SET @amount_of_duplicate_names = (SELECT COUNT(*) FROM @duplicate_names);
DECLARE @i int = 1;
DECLARE @j int = 1;
DECLARE @name_repeat int = 0;
DECLARE @dupl_name varchar(255);
WHILE @i <= coalesce(@amount_of_duplicate_names, 0)
BEGIN
SET @name_repeat = (SELECT repeat_number FROM @name_repeats WHERE id = @i);
WHILE @j <= coalesce(@name_repeat, 0)
BEGIN
SET @dupl_name = (SELECT duplicate_name FROM @duplicate_names WHERE id = @i);
UPDATE ${ohdsiSchema}.prediction
SET name = name + ' (' + CAST(@j AS varchar(15)) + ')'
WHERE prediction_id =
(SELECT TOP (1) prediction_id FROM ${ohdsiSchema}.prediction
WHERE name = @dupl_name
);
SET @j = @j + 1;
END;
SET @i = @i + 1;
SET @j = 1;
END;
SET @k = (SELECT COUNT(*) FROM (SELECT name FROM ${ohdsiSchema}.prediction
GROUP BY name
HAVING COUNT(*) > 1) AS temp);
DELETE FROM @duplicate_names WHERE id = id;
DELETE FROM @name_repeats WHERE id = id;
END;
ALTER TABLE ${ohdsiSchema}.prediction ADD CONSTRAINT uq_pd_name UNIQUE (name);
END;
GO
EXEC ${ohdsiSchema}.rename_prediction_names;
GO
DROP PROCEDURE ${ohdsiSchema}.rename_cs_names;
DROP PROCEDURE ${ohdsiSchema}.rename_cd_names;
DROP PROCEDURE ${ohdsiSchema}.rename_cc_names;
DROP PROCEDURE ${ohdsiSchema}.rename_fe_names;
DROP PROCEDURE ${ohdsiSchema}.rename_pw_names;
DROP PROCEDURE ${ohdsiSchema}.rename_ir_names;
DROP PROCEDURE ${ohdsiSchema}.rename_estimation_names;
DROP PROCEDURE ${ohdsiSchema}.rename_prediction_names; | the_stack |
-- 根据rectime排序从最近开始,给定用户ID,即查询用户推荐的电影; 其中recmovie表中是推荐的电影列表
select * from recmovie inner JOIN movie on recmovie.movieid = movie.id and recmovie.userid=1 and movie.enable = 1 ORDER BY rectime DESC, rat DESC limit 0, 30
-- delete from recmovie where movieid not in (select id from movie)
select * from comment_new limit 0, 100
select *,MD5(creator) as userid from comment limit 0,100
-- 更新userid语句
-- update comment_new,comment set comment_new.userid=md5(comment.creator) from comment where comment_new.id=comment.id
select count(*) from comment_new
-- 查看是否重复ID
select count(DISTINCT id) from comment
-- 处理userid
update comment_new s set userid = (select md5(creator) from comment where id = s.id);
-- 检查异常数据
select count(*) from comment where creator='' or creator is null
-- 检查数据处理的正确性
select count(*),MD5(creator) as userid_c,userid, MOVIEID, creator from comment_new where creator='windyxp' group by userid_c
select count(*),MD5(creator) as userid_c,userid, MOVIEID, creator from comment_new where creator='windyxp'
select MD5(creator) as userid_c,userid, MOVIEID, creator from comment_new where creator='windyxp'
-- 查看评分的幅度
select max(rating) from comment
-- 处理comment抓取的数据
select count(*) from comment where comment.MOVIEID in (select id from movie)
select count(*) from movie
-- 删除无用数据
-- delete from comment where comment.MOVIEID not in (select id from movie)
select count(*) as cnt,creator from comment where creator not like '%已注销%' group by creator order by cnt desc limit 0,100
select * from comment_new limit 0, 100
select * from movie limit 0, 100
select * from movie where id = 1294829
select count(*) from comment_new where creator='妖怪dodo'
select * from comment_new where creator='妖怪dodo'
select * from comment_new where creator='妖怪dodo' order by time
select * from comment_new where creator='妖怪dodo' group by content, movieid order by time
select * from comment_new where creator='米粒' order by time
select * from comment_new where creator='米粒' group by content, movieid order by time
select * from comment_new where creator='麦克阿瑟' group by content, movieid order by time
select * from comment_new where creator='麦克阿瑟' order by time
select sum(rating)/count(rating) from comment_new where creator='妖怪dodo'
select * from comment_new group by content, movieid limit 500,100
-- select avg(rating) from comment where creator = '麦克阿瑟'
-- 中位数,平均数,最大评分,最小评分
select count(DISTINCT userid) from comment_new
select * from movie limit 0,100
select count(*) from userproex where userid='12'
select DISTINCT userid from comment_new where userid is not null
select rating from comment_new where userid='0a87619cd22313468311d7077dd8a35c'
select max(rating) as rmax, min(rating) as rmin, avg(rating) as ravg, count(rating) as rcount, sum(rating) as rsum from comment_new where userid='0a87619cd22313468311d7077dd8a35c'
select count(*) from userproex
-- 统计特征
-- delete from userproex_new
-- INSERT INTO userproex_new (userid, rmax, rmin, ravg, rcount, rsum) (select userid, max(rating) as rmax, min(rating) as rmin, avg(rating) as ravg, count(rating) as rcount, sum(rating) as rsum from comment_new group by userid having userid is not null)
select * from userproex_new limit 0,100
select * from userproex where userid='00000bc601790de1bafd1914e2cd9abb'
select count(*) from userproex_new where rmedian>0
select userid from userproex_new where rmedian=0
select * from comment_new where movieid='10533913' and rating=3 limit 0,100
select count(*) from comment_new where rating = 3
select * from ibmovie order by movieid LIMIT 0,1000
select * from movie where id='1794438'
select cnt,movieid from (select count(*) as cnt,movieid from ibmovie group by movieid) as t where cnt < 200
select * from ibmovie order by time desc limit 0,1
insert into ibmovie (id, movieid, recmovieid, recmovierat, simrat, time, enable) values ('c29197ff-e469-4d7e-90cf-af5991ab87b2','1795628','1296049','7.7','0.466998209110974','2018-12-21 05:26:02.907768','1')
select id from movie
select count(*) from ibmovie
select * from comment_new limit 0, 100
select count(*) from comment_new
-- **************** 开发测试使用 ****************
select * from movie limit 0, 100
-- 查询一个电影的相似电影
select * from ibmovie left join movie on ibmovie.recmovieid = movie.id where ibmovie.movieid = '10521893'
select count(*) from ibmovie
select * from movie left join moviedetail on movie.id=moviedetail.id
select * from moviedetail
select max(cnt) from (select count(*) as cnt from comment_new group by movieid) t
select * from system_user
select * from comment_test where USERID='1'
select * from comment_new limit 0, 10
select * from comment_new left join movie on comment_new.MOVIEID = movie.id where userid='cf2349f9c01f9a5cd4050aebd30ab74f'
select * from movie where id = '10428476'
select id from system_user
select * from userproex_new where userid = 'cf2349f9c01f9a5cd4050aebd30ab74f'
select * from movie where id in (select DISTINCT movieid from recmovie where userid='cf2349f9c01f9a5cd4050aebd30ab74f')
select * from comment_new limit 0,1
select * from recmovie left join movie on movie.id=recmovie.movieid left join userproex_new on userproex_new.userid=recmovie.userid
where recmovie.userid = 'cf2349f9c01f9a5cd4050aebd30ab74f'
update recmovie set recmovie.fmrat = 0.1 where id = 1
select id from recmovie where userid='cf2349f9c01f9a5cd4050aebd30ab74f' and movieid='10430817'
select * from recmovie
select count(*) from recmovie
select * from recmovie left join movie on movie.id=recmovie.movieid left join userproex_new on userproex_new.userid=recmovie.userid
select * from comment_new where newdata = 1
select DISTINCT recmovieid from ibmovie where movieid = '10746430'
select * from system_user
select * from comment_new where userid = 'cf2349f9c01f9a5cd4050aebd30ab74f'
-- insert into comment_new (ID, TIME, MOVIEID, RATING, CONTENT, CREATOR, ADD_TIME, NEWDATA, USERID)
-- VALUES ('300004', '2018-12-29 13:09:21', '1296384', 4, '中等', 'wuenda', '2018-12-29 13:09:21', '1', 'cf2349f9c01f9a5cd4050aebd30ab74f')
-- update comment_new set newdata = 0 where id = '300001'
-- update comment_new set newdata = 2 where id = '300004'
-- insert into recmovie (id, userid, movieid, rectime) values ('7', 'cf2349f9c01f9a5cd4050aebd30ab74f', '10430817', '2018-12-27 21:09:21')
select count(*) from movie where description is null or description = ''
select * from movie limit 0,1000
select count(*) from movie
select * from system_user
select * from __comment_test limit 0, 1
select * from comment_new limit 0, 1
select * from mqlog where pulled = 0
-- select * from mqlog where logtype = 'u' and pulled = 0
-- update mqlog set pulled = 0 where pulled = 1 and logtype='u'
select * from userproex_new where userid = '7c561cbe-f463-4185-844c-a317bc02788a'
select * from userproex_new where userid = '1'
select count(*) from movie
select escape(description) from movie limit 0,1
select * from mqlog where logtype = 'm' and pulled = 0
update mqlog set pulled = 0 where logtype = 'm'
select * from movie where name like '%Aquaman%'
select * from comment_new where userid is null or userid = ''
select * from movie where id = '4301274'
select * from mqlog
select * from recmovie
select count(*) from ibmovie
select convert(simrat, DECIMAL(5,5)) from ibmovie limit 0, 1
select id,simrat,convert(simrat , DECIMAL(5,5)) as simrat_5 from ibmovie where movieid = '10746430' order by convert(simrat , DECIMAL(5,5)) desc limit 0,10
select * from ibmovie where simrat like '%e-%'
select * from movie where id = 'ce2ab2e8-4ee6-4b92-bdfe-3d40b6622b77'
select * from movie where id = '0849b8cb-a9e2-4c81-b1f3-04f699f002db'
select * from ibmovie where movieid = '0849b8cb-a9e2-4c81-b1f3-04f699f002db'
select max(convert(simrat, DECIMAL(5,5))) from ibmovie
select * from comment_new where id = 'add4da0e-86a1-411c-9411-7ac605a615c0'
select * from mqlog where logtype = 'c' and pulled = 0
select * from comment_new where newdata = 1
select * from comment_new where id in ('add4da0e-86a1-411c-9411-7ac605a615c0','9c9d2ffc-22a9-40ce-83ac-33400ead121d','b3f815c3-5d5f-4369-90db-590f06014ee0','4bcc19dc-2b9e-4e80-9748-665022db2508','dfce4112-cb1e-4ee6-9441-9211ee385e87')
('add4da0e-86a1-411c-9411-7ac605a615c0','9c9d2ffc-22a9-40ce-83ac-33400ead121d','b3f815c3-5d5f-4369-90db-590f06014ee0','4bcc19dc-2b9e-4e80-9748-665022db2508','dfce4112-cb1e-4ee6-9441-9211ee385e87')
select * from comment_new where id in ('add4da0e-86a1-411c-9411-7ac605a615c0','9c9d2ffc-22a9-40ce-83ac-33400ead121d','b3f815c3-5d5f-4369-90db-590f06014ee0','4bcc19dc-2b9e-4e80-9748-665022db2508','dfce4112-cb1e-4ee6-9441-9211ee385e87')
select * from config where type = 'csv_last_url'
-- delete from recmovie
select count(*) from recmovie where userid='7c561cbe-f463-4185-844c-a317bc02788a'
select * from recmovie inner JOIN movie on recmovie.movieid = movie.id and recmovie.userid=1 and movie.enable = 1 ORDER BY fmrat DESC, lrrat DESC,rectime DESC, rat DESC limit 48, 12
select count(*) from (select DISTINCT userid from comment_new)
select * from comment_new limit 1, 10
update recmovie set recmovie.fmrat = 1,rectime='2019-01-03 11:31:07.410736' where id = 1
update recmovie set recmovie.fmrat = 1 where id = '1'
select * from mqlog where pulled = 0
select * from comment_new where userid = 'cf2349f9c01f9a5cd4050aebd30ab74f'
select * from movie where id = '1293345'
select * from movie where id = '22939161'
select * from system_user
select * from movie where id = '46c1406a-fcc3-4746-8d7b-343abfa7fb48'
select * from mqlog where pulled = 0
select * from comment_new left join movie on comment_new.movieid = movie.id where userid='7c561cbe-f463-4185-844c-a317bc02788a' -- group by comment_new.movieid
update recmovie set recmovie.fmrat = 2.5249200000000003,rectime='2019-01-05 10:42:07' where id = '032d13e1-8bc6-440f-8e1f-accfa2fd13b1'
select * from comment_new where userid= 'b1580ce1-f9a3-4bfe-a50b-4a0c1fa752e7'
select DISTINCT userid from comment_new
select DISTINCT username from recmovie left join system_user on recmovie.userid=system_user.id where userid = '1'
select * from movie where id = '26344688'
select * from movie left join comment_new on comment_new.movieid = movie.id where comment_new.userid=1
select * from comment_new where userid=1
select * from system_user | the_stack |
-- +migrate Up notransaction
DROP TRIGGER IF EXISTS zz_99_alert_logs_change_log ON public.alert_logs;
DROP TRIGGER IF EXISTS zz_99_alerts_change_log ON public.alerts;
DROP TRIGGER IF EXISTS zz_99_auth_basic_users_change_log ON public.auth_basic_users;
DROP TRIGGER IF EXISTS zz_99_auth_nonce_change_log ON public.auth_nonce;
DROP TRIGGER IF EXISTS zz_99_auth_subjects_change_log ON public.auth_subjects;
DROP TRIGGER IF EXISTS zz_99_auth_user_sessions_change_log ON public.auth_user_sessions;
DROP TRIGGER IF EXISTS zz_99_config_change_log ON public.config;
DROP TRIGGER IF EXISTS zz_99_config_limits_change_log ON public.config_limits;
DROP TRIGGER IF EXISTS zz_99_ep_step_on_call_users_change_log ON public.ep_step_on_call_users;
DROP TRIGGER IF EXISTS zz_99_escalation_policies_change_log ON public.escalation_policies;
DROP TRIGGER IF EXISTS zz_99_escalation_policy_actions_change_log ON public.escalation_policy_actions;
DROP TRIGGER IF EXISTS zz_99_escalation_policy_state_change_log ON public.escalation_policy_state;
DROP TRIGGER IF EXISTS zz_99_escalation_policy_steps_change_log ON public.escalation_policy_steps;
DROP TRIGGER IF EXISTS zz_99_heartbeat_monitors_change_log ON public.heartbeat_monitors;
DROP TRIGGER IF EXISTS zz_99_integration_keys_change_log ON public.integration_keys;
DROP TRIGGER IF EXISTS zz_99_keyring_change_log ON public.keyring;
DROP TRIGGER IF EXISTS zz_99_labels_change_log ON public.labels;
DROP TRIGGER IF EXISTS zz_99_notification_policy_cycles_change_log ON public.notification_policy_cycles;
DROP TRIGGER IF EXISTS zz_99_outgoing_messages_change_log ON public.outgoing_messages;
DROP TRIGGER IF EXISTS zz_99_region_ids_change_log ON public.region_ids;
DROP TRIGGER IF EXISTS zz_99_rotation_participants_change_log ON public.rotation_participants;
DROP TRIGGER IF EXISTS zz_99_rotation_state_change_log ON public.rotation_state;
DROP TRIGGER IF EXISTS zz_99_rotations_change_log ON public.rotations;
DROP TRIGGER IF EXISTS zz_99_schedule_on_call_users_change_log ON public.schedule_on_call_users;
DROP TRIGGER IF EXISTS zz_99_schedule_rules_change_log ON public.schedule_rules;
DROP TRIGGER IF EXISTS zz_99_schedules_change_log ON public.schedules;
DROP TRIGGER IF EXISTS zz_99_services_change_log ON public.services;
DROP TRIGGER IF EXISTS zz_99_twilio_sms_callbacks_change_log ON public.twilio_sms_callbacks;
DROP TRIGGER IF EXISTS zz_99_twilio_sms_errors_change_log ON public.twilio_sms_errors;
DROP TRIGGER IF EXISTS zz_99_twilio_voice_errors_change_log ON public.twilio_voice_errors;
DROP TRIGGER IF EXISTS zz_99_user_contact_methods_change_log ON public.user_contact_methods;
DROP TRIGGER IF EXISTS zz_99_user_favorites_change_log ON public.user_favorites;
DROP TRIGGER IF EXISTS zz_99_user_last_alert_log_change_log ON public.user_last_alert_log;
DROP TRIGGER IF EXISTS zz_99_user_notification_rules_change_log ON public.user_notification_rules;
DROP TRIGGER IF EXISTS zz_99_user_overrides_change_log ON public.user_overrides;
DROP TRIGGER IF EXISTS zz_99_user_verification_codes_change_log ON public.user_verification_codes;
DROP TRIGGER IF EXISTS zz_99_users_change_log ON public.users;
-- +migrate Down notransaction
-- +migrate StatementBegin
DO $$ BEGIN
CREATE TRIGGER zz_99_alert_logs_change_log AFTER INSERT OR DELETE OR UPDATE ON public.alert_logs FOR EACH ROW EXECUTE PROCEDURE public.process_change();
EXCEPTION
WHEN duplicate_object
THEN null;
END $$;
-- +migrate StatementEnd
-- +migrate StatementBegin
DO $$ BEGIN
CREATE TRIGGER zz_99_alerts_change_log AFTER INSERT OR DELETE OR UPDATE ON public.alerts FOR EACH ROW EXECUTE PROCEDURE public.process_change();
EXCEPTION
WHEN duplicate_object
THEN null;
END $$;
-- +migrate StatementEnd
-- +migrate StatementBegin
DO $$ BEGIN
CREATE TRIGGER zz_99_auth_basic_users_change_log AFTER INSERT OR DELETE OR UPDATE ON public.auth_basic_users FOR EACH ROW EXECUTE PROCEDURE public.process_change();
EXCEPTION
WHEN duplicate_object
THEN null;
END $$;
-- +migrate StatementEnd
-- +migrate StatementBegin
DO $$ BEGIN
CREATE TRIGGER zz_99_auth_nonce_change_log AFTER INSERT OR DELETE OR UPDATE ON public.auth_nonce FOR EACH ROW EXECUTE PROCEDURE public.process_change();
EXCEPTION
WHEN duplicate_object
THEN null;
END $$;
-- +migrate StatementEnd
-- +migrate StatementBegin
DO $$ BEGIN
CREATE TRIGGER zz_99_auth_subjects_change_log AFTER INSERT OR DELETE OR UPDATE ON public.auth_subjects FOR EACH ROW EXECUTE PROCEDURE public.process_change();
EXCEPTION
WHEN duplicate_object
THEN null;
END $$;
-- +migrate StatementEnd
-- +migrate StatementBegin
DO $$ BEGIN
CREATE TRIGGER zz_99_auth_user_sessions_change_log AFTER INSERT OR DELETE OR UPDATE ON public.auth_user_sessions FOR EACH ROW EXECUTE PROCEDURE public.process_change();
EXCEPTION
WHEN duplicate_object
THEN null;
END $$;
-- +migrate StatementEnd
-- +migrate StatementBegin
DO $$ BEGIN
CREATE TRIGGER zz_99_config_change_log AFTER INSERT OR DELETE OR UPDATE ON public.config FOR EACH ROW EXECUTE PROCEDURE public.process_change();
EXCEPTION
WHEN duplicate_object
THEN null;
END $$;
-- +migrate StatementEnd
-- +migrate StatementBegin
DO $$ BEGIN
CREATE TRIGGER zz_99_config_limits_change_log AFTER INSERT OR DELETE OR UPDATE ON public.config_limits FOR EACH ROW EXECUTE PROCEDURE public.process_change();
EXCEPTION
WHEN duplicate_object
THEN null;
END $$;
-- +migrate StatementEnd
-- +migrate StatementBegin
DO $$ BEGIN
CREATE TRIGGER zz_99_ep_step_on_call_users_change_log AFTER INSERT OR DELETE OR UPDATE ON public.ep_step_on_call_users FOR EACH ROW EXECUTE PROCEDURE public.process_change();
EXCEPTION
WHEN duplicate_object
THEN null;
END $$;
-- +migrate StatementEnd
-- +migrate StatementBegin
DO $$ BEGIN
CREATE TRIGGER zz_99_escalation_policies_change_log AFTER INSERT OR DELETE OR UPDATE ON public.escalation_policies FOR EACH ROW EXECUTE PROCEDURE public.process_change();
EXCEPTION
WHEN duplicate_object
THEN null;
END $$;
-- +migrate StatementEnd
-- +migrate StatementBegin
DO $$ BEGIN
CREATE TRIGGER zz_99_escalation_policy_actions_change_log AFTER INSERT OR DELETE OR UPDATE ON public.escalation_policy_actions FOR EACH ROW EXECUTE PROCEDURE public.process_change();
EXCEPTION
WHEN duplicate_object
THEN null;
END $$;
-- +migrate StatementEnd
-- +migrate StatementBegin
DO $$ BEGIN
CREATE TRIGGER zz_99_escalation_policy_state_change_log AFTER INSERT OR DELETE OR UPDATE ON public.escalation_policy_state FOR EACH ROW EXECUTE PROCEDURE public.process_change();
EXCEPTION
WHEN duplicate_object
THEN null;
END $$;
-- +migrate StatementEnd
-- +migrate StatementBegin
DO $$ BEGIN
CREATE TRIGGER zz_99_escalation_policy_steps_change_log AFTER INSERT OR DELETE OR UPDATE ON public.escalation_policy_steps FOR EACH ROW EXECUTE PROCEDURE public.process_change();
EXCEPTION
WHEN duplicate_object
THEN null;
END $$;
-- +migrate StatementEnd
-- +migrate StatementBegin
DO $$ BEGIN
CREATE TRIGGER zz_99_heartbeat_monitors_change_log AFTER INSERT OR DELETE OR UPDATE ON public.heartbeat_monitors FOR EACH ROW EXECUTE PROCEDURE public.process_change();
EXCEPTION
WHEN duplicate_object
THEN null;
END $$;
-- +migrate StatementEnd
-- +migrate StatementBegin
DO $$ BEGIN
CREATE TRIGGER zz_99_integration_keys_change_log AFTER INSERT OR DELETE OR UPDATE ON public.integration_keys FOR EACH ROW EXECUTE PROCEDURE public.process_change();
EXCEPTION
WHEN duplicate_object
THEN null;
END $$;
-- +migrate StatementEnd
-- +migrate StatementBegin
DO $$ BEGIN
CREATE TRIGGER zz_99_keyring_change_log AFTER INSERT OR DELETE OR UPDATE ON public.keyring FOR EACH ROW EXECUTE PROCEDURE public.process_change();
EXCEPTION
WHEN duplicate_object
THEN null;
END $$;
-- +migrate StatementEnd
-- +migrate StatementBegin
DO $$ BEGIN
CREATE TRIGGER zz_99_labels_change_log AFTER INSERT OR DELETE OR UPDATE ON public.labels FOR EACH ROW EXECUTE PROCEDURE public.process_change();
EXCEPTION
WHEN duplicate_object
THEN null;
END $$;
-- +migrate StatementEnd
-- +migrate StatementBegin
DO $$ BEGIN
CREATE TRIGGER zz_99_notification_policy_cycles_change_log AFTER INSERT OR DELETE OR UPDATE ON public.notification_policy_cycles FOR EACH ROW EXECUTE PROCEDURE public.process_change();
EXCEPTION
WHEN duplicate_object
THEN null;
END $$;
-- +migrate StatementEnd
-- +migrate StatementBegin
DO $$ BEGIN
CREATE TRIGGER zz_99_outgoing_messages_change_log AFTER INSERT OR DELETE OR UPDATE ON public.outgoing_messages FOR EACH ROW EXECUTE PROCEDURE public.process_change();
EXCEPTION
WHEN duplicate_object
THEN null;
END $$;
-- +migrate StatementEnd
-- +migrate StatementBegin
DO $$ BEGIN
CREATE TRIGGER zz_99_region_ids_change_log AFTER INSERT OR DELETE OR UPDATE ON public.region_ids FOR EACH ROW EXECUTE PROCEDURE public.process_change();
EXCEPTION
WHEN duplicate_object
THEN null;
END $$;
-- +migrate StatementEnd
-- +migrate StatementBegin
DO $$ BEGIN
CREATE TRIGGER zz_99_rotation_participants_change_log AFTER INSERT OR DELETE OR UPDATE ON public.rotation_participants FOR EACH ROW EXECUTE PROCEDURE public.process_change();
EXCEPTION
WHEN duplicate_object
THEN null;
END $$;
-- +migrate StatementEnd
-- +migrate StatementBegin
DO $$ BEGIN
CREATE TRIGGER zz_99_rotation_state_change_log AFTER INSERT OR DELETE OR UPDATE ON public.rotation_state FOR EACH ROW EXECUTE PROCEDURE public.process_change();
EXCEPTION
WHEN duplicate_object
THEN null;
END $$;
-- +migrate StatementEnd
-- +migrate StatementBegin
DO $$ BEGIN
CREATE TRIGGER zz_99_rotations_change_log AFTER INSERT OR DELETE OR UPDATE ON public.rotations FOR EACH ROW EXECUTE PROCEDURE public.process_change();
EXCEPTION
WHEN duplicate_object
THEN null;
END $$;
-- +migrate StatementEnd
-- +migrate StatementBegin
DO $$ BEGIN
CREATE TRIGGER zz_99_schedule_on_call_users_change_log AFTER INSERT OR DELETE OR UPDATE ON public.schedule_on_call_users FOR EACH ROW EXECUTE PROCEDURE public.process_change();
EXCEPTION
WHEN duplicate_object
THEN null;
END $$;
-- +migrate StatementEnd
-- +migrate StatementBegin
DO $$ BEGIN
CREATE TRIGGER zz_99_schedule_rules_change_log AFTER INSERT OR DELETE OR UPDATE ON public.schedule_rules FOR EACH ROW EXECUTE PROCEDURE public.process_change();
EXCEPTION
WHEN duplicate_object
THEN null;
END $$;
-- +migrate StatementEnd
-- +migrate StatementBegin
DO $$ BEGIN
CREATE TRIGGER zz_99_schedules_change_log AFTER INSERT OR DELETE OR UPDATE ON public.schedules FOR EACH ROW EXECUTE PROCEDURE public.process_change();
EXCEPTION
WHEN duplicate_object
THEN null;
END $$;
-- +migrate StatementEnd
-- +migrate StatementBegin
DO $$ BEGIN
CREATE TRIGGER zz_99_services_change_log AFTER INSERT OR DELETE OR UPDATE ON public.services FOR EACH ROW EXECUTE PROCEDURE public.process_change();
EXCEPTION
WHEN duplicate_object
THEN null;
END $$;
-- +migrate StatementEnd
-- +migrate StatementBegin
DO $$ BEGIN
CREATE TRIGGER zz_99_twilio_sms_callbacks_change_log AFTER INSERT OR DELETE OR UPDATE ON public.twilio_sms_callbacks FOR EACH ROW EXECUTE PROCEDURE public.process_change();
EXCEPTION
WHEN duplicate_object
THEN null;
END $$;
-- +migrate StatementEnd
-- +migrate StatementBegin
DO $$ BEGIN
CREATE TRIGGER zz_99_twilio_sms_errors_change_log AFTER INSERT OR DELETE OR UPDATE ON public.twilio_sms_errors FOR EACH ROW EXECUTE PROCEDURE public.process_change();
EXCEPTION
WHEN duplicate_object
THEN null;
END $$;
-- +migrate StatementEnd
-- +migrate StatementBegin
DO $$ BEGIN
CREATE TRIGGER zz_99_twilio_voice_errors_change_log AFTER INSERT OR DELETE OR UPDATE ON public.twilio_voice_errors FOR EACH ROW EXECUTE PROCEDURE public.process_change();
EXCEPTION
WHEN duplicate_object
THEN null;
END $$;
-- +migrate StatementEnd
-- +migrate StatementBegin
DO $$ BEGIN
CREATE TRIGGER zz_99_user_contact_methods_change_log AFTER INSERT OR DELETE OR UPDATE ON public.user_contact_methods FOR EACH ROW EXECUTE PROCEDURE public.process_change();
EXCEPTION
WHEN duplicate_object
THEN null;
END $$;
-- +migrate StatementEnd
-- +migrate StatementBegin
DO $$ BEGIN
CREATE TRIGGER zz_99_user_favorites_change_log AFTER INSERT OR DELETE OR UPDATE ON public.user_favorites FOR EACH ROW EXECUTE PROCEDURE public.process_change();
EXCEPTION
WHEN duplicate_object
THEN null;
END $$;
-- +migrate StatementEnd
-- +migrate StatementBegin
DO $$ BEGIN
CREATE TRIGGER zz_99_user_last_alert_log_change_log AFTER INSERT OR DELETE OR UPDATE ON public.user_last_alert_log FOR EACH ROW EXECUTE PROCEDURE public.process_change();
EXCEPTION
WHEN duplicate_object
THEN null;
END $$;
-- +migrate StatementEnd
-- +migrate StatementBegin
DO $$ BEGIN
CREATE TRIGGER zz_99_user_notification_rules_change_log AFTER INSERT OR DELETE OR UPDATE ON public.user_notification_rules FOR EACH ROW EXECUTE PROCEDURE public.process_change();
EXCEPTION
WHEN duplicate_object
THEN null;
END $$;
-- +migrate StatementEnd
-- +migrate StatementBegin
DO $$ BEGIN
CREATE TRIGGER zz_99_user_overrides_change_log AFTER INSERT OR DELETE OR UPDATE ON public.user_overrides FOR EACH ROW EXECUTE PROCEDURE public.process_change();
EXCEPTION
WHEN duplicate_object
THEN null;
END $$;
-- +migrate StatementEnd
-- +migrate StatementBegin
DO $$ BEGIN
CREATE TRIGGER zz_99_user_verification_codes_change_log AFTER INSERT OR DELETE OR UPDATE ON public.user_verification_codes FOR EACH ROW EXECUTE PROCEDURE public.process_change();
EXCEPTION
WHEN duplicate_object
THEN null;
END $$;
-- +migrate StatementEnd
-- +migrate StatementBegin
DO $$ BEGIN
CREATE TRIGGER zz_99_users_change_log AFTER INSERT OR DELETE OR UPDATE ON public.users FOR EACH ROW EXECUTE PROCEDURE public.process_change();
EXCEPTION
WHEN duplicate_object
THEN null;
END $$;
-- +migrate StatementEnd | the_stack |
--
-- byteSize
--
select '';
select '# byteSize';
set allow_experimental_bigint_types = 1;
-- numbers #0 --
select '';
select 'byteSize for numbers #0';
drop table if exists test_byte_size_number0;
create table test_byte_size_number0
(
key Int32,
u8 UInt8,
u16 UInt16,
u32 UInt32,
u64 UInt64,
u256 UInt256,
i8 Int8,
i16 Int16,
i32 Int32,
i64 Int64,
i128 Int128,
i256 Int256,
f32 Float32,
f64 Float64
) engine MergeTree order by key;
insert into test_byte_size_number0 values(1, 8, 16, 32, 64, 256, -8, -16, -32, -64, -128, -256, 32.32, 64.64);
insert into test_byte_size_number0 values(2, 8, 16, 32, 64, 256, -8, -16, -32, -64, -128, -256, 32.32, 64.64);
select key, toTypeName(u8), byteSize(u8), toTypeName(u16), byteSize(u16), toTypeName(u32), byteSize(u32), toTypeName(u64), byteSize(u64), toTypeName(u256), byteSize(u256) from test_byte_size_number0 order by key;
select key, toTypeName(i8), byteSize(i8), toTypeName(i16), byteSize(i16), toTypeName(i32), byteSize(i32), toTypeName(i64), byteSize(i64), toTypeName(i128), byteSize(i128), toTypeName(u256), byteSize(u256) from test_byte_size_number0 order by key;
select key, toTypeName(f32), byteSize(f32), toTypeName(f64), byteSize(f64) from test_byte_size_number0 order by key;
drop table if exists test_byte_size_number0;
-- numbers #1 --
select '';
select 'byteSize for numbers #1';
drop table if exists test_byte_size_number1;
create table test_byte_size_number1
(
key Int32,
date Date,
dt DateTime,
dt64 DateTime64(3),
en8 Enum8('a'=1, 'b'=2, 'c'=3, 'd'=4),
en16 Enum16('c'=100, 'l'=101, 'i'=102, 'ck'=103, 'h'=104, 'o'=105, 'u'=106, 's'=107, 'e'=108),
dec32 Decimal32(4),
dec64 Decimal64(8),
dec128 Decimal128(16),
dec256 Decimal256(16),
uuid UUID
) engine MergeTree order by key;
insert into test_byte_size_number1 values(1, '2020-01-01', '2020-01-01 01:02:03', '2020-02-02 01:02:03', 'a', 'ck', 32.32, 64.64, 128.128, 256.256, generateUUIDv4());
insert into test_byte_size_number1 values(2, '2020-01-01', '2020-01-01 01:02:03', '2020-02-02 01:02:03', 'a', 'ck', 32.32, 64.64, 128.128, 256.256, generateUUIDv4());
select key, byteSize(*), toTypeName(date), byteSize(date), toTypeName(dt), byteSize(dt), toTypeName(dt64), byteSize(dt64), toTypeName(uuid), byteSize(uuid) from test_byte_size_number1 order by key;
drop table if exists test_byte_size_number1;
-- constant numbers --
select '';
select 'byteSize for constants';
select 0x1, byteSize(0x1), 0x100, byteSize(0x100), 0x10000, byteSize(0x10000), 0x100000000, byteSize(0x100000000), 0.5, byteSize(0.5), 1e-10, byteSize(1e-10);
select toDate('2020-01-01'), byteSize(toDate('2020-01-01')), toDateTime('2020-01-01 01:02:03'), byteSize(toDateTime('2020-01-01 01:02:03')), toDateTime64('2020-01-01 01:02:03',3), byteSize(toDateTime64('2020-01-01 01:02:03',3));
select toTypeName(generateUUIDv4()), byteSize(generateUUIDv4());
-- strings --
select '';
select 'byteSize for strings';
drop table if exists test_byte_size_string;
create table test_byte_size_string
(
key Int32,
str1 String,
str2 String,
fstr1 FixedString(8),
fstr2 FixedString(8)
) engine MergeTree order by key;
insert into test_byte_size_string values(1, '', 'a', '', 'abcde');
insert into test_byte_size_string values(2, 'abced', '', 'abcde', '');
select key, byteSize(*), str1, byteSize(str1), str2, byteSize(str2), fstr1, byteSize(fstr1), fstr2, byteSize(fstr2) from test_byte_size_string order by key;
select 'constants: ', '', byteSize(''), 'a', byteSize('a'), 'abcde', byteSize('abcde');
drop table if exists test_byte_size_string;
-- simple arrays --
drop table if exists test_byte_size_array;
create table test_byte_size_array
(
key Int32,
uints8 Array(UInt8),
ints8 Array(Int8),
ints32 Array(Int32),
floats32 Array(Float32),
decs32 Array(Decimal32(4)),
dates Array(Date),
uuids Array(UUID)
) engine MergeTree order by key;
insert into test_byte_size_array values(1, [], [], [], [], [], [], []);
insert into test_byte_size_array values(2, [1], [-1], [256], [1.1], [1.1], ['2020-01-01'], ['61f0c404-5cb3-11e7-907b-a6006ad3dba0']);
insert into test_byte_size_array values(3, [1,1], [-1,-1], [256,256], [1.1,1.1], [1.1,1.1], ['2020-01-01','2020-01-01'], ['61f0c404-5cb3-11e7-907b-a6006ad3dba0','61f0c404-5cb3-11e7-907b-a6006ad3dba0']);
insert into test_byte_size_array values(4, [1,1,1], [-1,-1,-1], [256,256,256], [1.1,1.1,1.1], [1.1,1.1,1.1], ['2020-01-01','2020-01-01','2020-01-01'], ['61f0c404-5cb3-11e7-907b-a6006ad3dba0','61f0c404-5cb3-11e7-907b-a6006ad3dba0','61f0c404-5cb3-11e7-907b-a6006ad3dba0']);
select '';
select 'byteSize for simple array';
select key, byteSize(*), uints8, byteSize(uints8), ints8, byteSize(ints8), ints32, byteSize(ints32), floats32, byteSize(floats32), decs32, byteSize(decs32), dates, byteSize(dates), uuids, byteSize(uuids) from test_byte_size_array order by key;
select 'constants:', [], byteSize([]), [1,1], byteSize([1,1]), [-1,-1], byteSize([-1,-1]), toTypeName([256,256]), byteSize([256,256]), toTypeName([1.1,1.1]), byteSize([1.1,1.1]);
select 'constants:', [toDecimal32(1.1,4),toDecimal32(1.1,4)], byteSize([toDecimal32(1.1,4),toDecimal32(1.1,4)]), [toDate('2020-01-01'),toDate('2020-01-01')], byteSize([toDate('2020-01-01'),toDate('2020-01-01')]);
select 'constants:', [toUUID('61f0c404-5cb3-11e7-907b-a6006ad3dba0'),toUUID('61f0c404-5cb3-11e7-907b-a6006ad3dba0')], byteSize([toUUID('61f0c404-5cb3-11e7-907b-a6006ad3dba0'),toUUID('61f0c404-5cb3-11e7-907b-a6006ad3dba0')]);
drop table if exists test_byte_size_array;
-- complex arrays --
drop table if exists test_byte_size_complex_array;
create table test_byte_size_complex_array
(
key Int32,
ints Array(Int32),
int_ints Array(Array(Int32)),
strs Array(String),
str_strs Array(Array(String))
) engine MergeTree order by key;
insert into test_byte_size_complex_array values(1, [], [[]], [], [[]]);
insert into test_byte_size_complex_array values(2, [1,2], [[], [1,2]], [''], [[], ['']]);
insert into test_byte_size_complex_array values(3, [0,256], [[], [1,2], [0,256]], ['','a'], [[], [''], ['','a']]);
insert into test_byte_size_complex_array values(4, [256,65536], [[], [1,2], [0,256], [256,65536]], ['','a','abced'], [[], [''], ['','a'], ['','a','abced']]);
select '';
select 'byteSize for int array of arrays';
select key, byteSize(*), ints, byteSize(ints), int_ints, byteSize(int_ints) from test_byte_size_complex_array order by key;
select 'constants:', [[], [1,2], [0,0x10000]],toTypeName([[], [1,2], [0,0x10000]]), byteSize([[], [1,2], [0,0x10000]]);
select '';
select 'byteSize for string array of arrays';
-- select key, byteSize(*), strs, byteSize(strs), str_strs, byteSize(str_strs) from test_byte_size_complex_array order by key;
select key, byteSize(*), strs, byteSize(strs), str_strs, byteSize(str_strs) from test_byte_size_complex_array order by key;
select 'constants:', [[], [''], ['','a']], byteSize([[], [''], ['','a']]);
drop table if exists test_byte_size_complex_array;
-- others --
drop table if exists test_byte_size_other;
create table test_byte_size_other
(
key Int32,
opt_int32 Nullable(Int32),
opt_str Nullable(String),
tuple Tuple(Int32, Nullable(String)),
strings LowCardinality(String)
) engine MergeTree order by key;
insert into test_byte_size_other values(1, NULL, NULL, tuple(1, NULL), '');
insert into test_byte_size_other values(2, 1, 'a', tuple(1, 'a'), 'a');
insert into test_byte_size_other values(3, 256, 'abcde', tuple(256, 'abcde'), 'abcde');
select '';
select 'byteSize for others: Nullable, Tuple, LowCardinality';
select key, byteSize(*), opt_int32, byteSize(opt_int32), opt_str, byteSize(opt_str), tuple, byteSize(tuple), strings, byteSize(strings) from test_byte_size_other order by key;
select 'constants:', NULL, byteSize(NULL), tuple(0x10000, NULL), byteSize(tuple(0x10000, NULL)), tuple(0x10000, toNullable('a')), byteSize(tuple(0x10000, toNullable('a')));
select 'constants:', toLowCardinality('abced'),toTypeName(toLowCardinality('abced')), byteSize(toLowCardinality('abced'));
drop table if exists test_byte_size_other;
-- more complex fields --
drop table if exists test_byte_size_more_complex;
create table test_byte_size_more_complex
(
key Int32,
complex1 Array(Tuple(Nullable(FixedString(4)), Array(Tuple(Nullable(String), String))))
) engine MergeTree order by key;
insert into test_byte_size_more_complex values(1, []);
insert into test_byte_size_more_complex values(2, [tuple(NULL, [])]);
insert into test_byte_size_more_complex values(3, [tuple('a', [])]);
insert into test_byte_size_more_complex values(4, [tuple('a', [tuple(NULL, 'a')])]);
insert into test_byte_size_more_complex values(5, [tuple('a', [tuple(NULL, 'a'), tuple(NULL, 'a')])]);
insert into test_byte_size_more_complex values(6, [tuple(NULL, []), tuple('a', []), tuple('a', [tuple(NULL, 'a')]), tuple('a', [tuple(NULL, 'a'), tuple(NULL, 'a')])]);
select '';
select 'byteSize for complex fields';
select key, byteSize(*), complex1, byteSize(complex1) from test_byte_size_more_complex order by key;
select 'constants:', tuple(NULL, []), byteSize(tuple(NULL, [])), tuple(toNullable(toFixedString('a',4)), []), byteSize(tuple(toNullable(toFixedString('a',4)), [])), tuple(toNullable(toFixedString('a',4)), [tuple(NULL, 'a')]), byteSize(tuple(toNullable(toFixedString('a',4)), [tuple(NULL, 'a')])), tuple(toFixedString('a',4), [tuple(NULL, 'a'), tuple(NULL, 'a')]), byteSize(tuple(toNullable(toFixedString('a',4)), [tuple(NULL, 'a'), tuple(NULL, 'a')]));
select 'constants:', [tuple(NULL, []), tuple(toNullable(toFixedString('a',4)), []), tuple(toNullable(toFixedString('a',4)), [tuple(NULL, 'a')]), tuple(toNullable(toFixedString('a',4)), [tuple(NULL, 'a'), tuple(NULL, 'a')])];
select 'constants:', toTypeName([tuple(NULL, []), tuple(toNullable(toFixedString('a',4)), []), tuple(toNullable(toFixedString('a',4)), [tuple(NULL, 'a')]), tuple(toNullable(toFixedString('a',4)), [tuple(NULL, 'a'), tuple(NULL, 'a')])]);
select 'constants:', byteSize([tuple(NULL, []), tuple(toNullable(toFixedString('a',4)), []), tuple(toNullable(toFixedString('a',4)), [tuple(NULL, 'a')]), tuple(toNullable(toFixedString('a',4)), [tuple(NULL, 'a'), tuple(NULL, 'a')])]);
drop table if exists test_byte_size_more_complex; | the_stack |
--
-- INTERVAL
--
SET DATESTYLE = 'ISO';
SET IntervalStyle to postgres;
-- check acceptance of "time zone style"
SELECT INTERVAL '01:00' AS "One hour";
SELECT INTERVAL '+02:00' AS "Two hours";
SELECT INTERVAL '-08:00' AS "Eight hours";
SELECT INTERVAL '-1 +02:03' AS "22 hours ago...";
SELECT INTERVAL '-1 days +02:03' AS "22 hours ago...";
SELECT INTERVAL '1.5 weeks' AS "Ten days twelve hours";
SELECT INTERVAL '1.5 months' AS "One month 15 days";
SELECT INTERVAL '10 years -11 month -12 days +13:14' AS "9 years...";
CREATE TABLE INTERVAL_TBL (f1 interval);
INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 1 minute');
INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 5 hour');
INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 10 day');
INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 34 year');
INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 3 months');
INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 14 seconds ago');
INSERT INTO INTERVAL_TBL (f1) VALUES ('1 day 2 hours 3 minutes 4 seconds');
INSERT INTO INTERVAL_TBL (f1) VALUES ('6 years');
INSERT INTO INTERVAL_TBL (f1) VALUES ('5 months');
INSERT INTO INTERVAL_TBL (f1) VALUES ('5 months 12 hours');
-- badly formatted interval
INSERT INTO INTERVAL_TBL (f1) VALUES ('badly formatted interval');
INSERT INTO INTERVAL_TBL (f1) VALUES ('@ 30 eons ago');
-- test interval operators
SELECT '' AS ten, * FROM INTERVAL_TBL;
SELECT '' AS nine, * FROM INTERVAL_TBL
WHERE INTERVAL_TBL.f1 <> interval '@ 10 days';
SELECT '' AS three, * FROM INTERVAL_TBL
WHERE INTERVAL_TBL.f1 <= interval '@ 5 hours';
SELECT '' AS three, * FROM INTERVAL_TBL
WHERE INTERVAL_TBL.f1 < interval '@ 1 day';
SELECT '' AS one, * FROM INTERVAL_TBL
WHERE INTERVAL_TBL.f1 = interval '@ 34 years';
SELECT '' AS five, * FROM INTERVAL_TBL
WHERE INTERVAL_TBL.f1 >= interval '@ 1 month';
SELECT '' AS nine, * FROM INTERVAL_TBL
WHERE INTERVAL_TBL.f1 > interval '@ 3 seconds ago';
SELECT '' AS fortyfive, r1.*, r2.*
FROM INTERVAL_TBL r1, INTERVAL_TBL r2
WHERE r1.f1 > r2.f1
ORDER BY r1.f1, r2.f1;
-- Test multiplication and division with intervals.
-- Floating point arithmetic rounding errors can lead to unexpected results,
-- though the code attempts to do the right thing and round up to days and
-- minutes to avoid results such as '3 days 24:00 hours' or '14:20:60'.
-- Note that it is expected for some day components to be greater than 29 and
-- some time components be greater than 23:59:59 due to how intervals are
-- stored internally.
CREATE TABLE INTERVAL_MULDIV_TBL (span interval);
SELECT span * 0.3 AS product
FROM INTERVAL_MULDIV_TBL;
SELECT span * 8.2 AS product
FROM INTERVAL_MULDIV_TBL;
SELECT span / 10 AS quotient
FROM INTERVAL_MULDIV_TBL;
SELECT span / 100 AS quotient
FROM INTERVAL_MULDIV_TBL;
DROP TABLE INTERVAL_MULDIV_TBL;
SET DATESTYLE = 'postgres';
SET IntervalStyle to postgres_verbose;
SELECT '' AS ten, * FROM INTERVAL_TBL;
-- test avg(interval), which is somewhat fragile since people have been
-- known to change the allowed input syntax for type interval without
-- updating pg_aggregate.agginitval
select avg(f1) from interval_tbl;
-- test long interval input
select '4 millenniums 5 centuries 4 decades 1 year 4 months 4 days 17 minutes 31 seconds'::interval;
-- test long interval output
-- Note: the actual maximum length of the interval output is longer,
-- but we need the test to work for both integer and floating-point
-- timestamps.
select '100000000y 10mon -1000000000d -100000h -10min -10.000001s ago'::interval;
-- test justify_hours() and justify_days()
SELECT justify_hours(interval '6 months 3 days 52 hours 3 minutes 2 seconds') as "6 mons 5 days 4 hours 3 mins 2 seconds";
SELECT justify_days(interval '6 months 36 days 5 hours 4 minutes 3 seconds') as "7 mons 6 days 5 hours 4 mins 3 seconds";
-- test justify_interval()
SELECT justify_interval(interval '1 month -1 hour') as "1 month -1 hour";
-- test fractional second input, and detection of duplicate units
SET DATESTYLE = 'ISO';
SET IntervalStyle TO postgres;
SELECT '1 millisecond'::interval, '1 microsecond'::interval,
'500 seconds 99 milliseconds 51 microseconds'::interval;
SELECT '3 days 5 milliseconds'::interval;
SELECT '1 second 2 seconds'::interval; -- error
SELECT '10 milliseconds 20 milliseconds'::interval; -- error
SELECT '5.5 seconds 3 milliseconds'::interval; -- error
SELECT '1:20:05 5 microseconds'::interval; -- error
SELECT '1 day 1 day'::interval; -- error
SELECT interval '1-2'; -- SQL year-month literal
SELECT interval '999' second; -- oversize leading field is ok
SELECT interval '999' minute;
SELECT interval '999' hour;
SELECT interval '999' day;
SELECT interval '999' month;
-- test SQL-spec syntaxes for restricted field sets
SELECT interval '1' year;
SELECT interval '2' month;
SELECT interval '3' day;
SELECT interval '4' hour;
SELECT interval '5' minute;
SELECT interval '6' second;
SELECT interval '1' year to month;
SELECT interval '1-2' year to month;
SELECT interval '1 2' day to hour;
SELECT interval '1 2:03' day to hour;
SELECT interval '1 2:03:04' day to hour;
SELECT interval '1 2' day to minute;
SELECT interval '1 2:03' day to minute;
SELECT interval '1 2:03:04' day to minute;
SELECT interval '1 2' day to second;
SELECT interval '1 2:03' day to second;
SELECT interval '1 2:03:04' day to second;
SELECT interval '1 2' hour to minute;
SELECT interval '1 2:03' hour to minute;
SELECT interval '1 2:03:04' hour to minute;
SELECT interval '1 2' hour to second;
SELECT interval '1 2:03' hour to second;
SELECT interval '1 2:03:04' hour to second;
SELECT interval '1 2' minute to second;
SELECT interval '1 2:03' minute to second;
SELECT interval '1 2:03:04' minute to second;
SELECT interval '1 +2:03' minute to second;
SELECT interval '1 +2:03:04' minute to second;
SELECT interval '1 -2:03' minute to second;
SELECT interval '1 -2:03:04' minute to second;
SELECT interval '123 11' day to hour; -- ok
SELECT interval '123 11' day; -- not ok
SELECT interval '123 11'; -- not ok, too ambiguous
SELECT interval '123 2:03 -2:04'; -- not ok, redundant hh:mm fields
-- test syntaxes for restricted precision
SELECT interval(0) '1 day 01:23:45.6789';
SELECT interval(2) '1 day 01:23:45.6789';
SELECT interval '12:34.5678' minute to second(2); -- per SQL spec
SELECT interval '1.234' second;
SELECT interval '1.234' second(2);
SELECT interval '1 2.345' day to second(2);
SELECT interval '1 2:03' day to second(2);
SELECT interval '1 2:03.4567' day to second(2);
SELECT interval '1 2:03:04.5678' day to second(2);
SELECT interval '1 2.345' hour to second(2);
SELECT interval '1 2:03.45678' hour to second(2);
SELECT interval '1 2:03:04.5678' hour to second(2);
SELECT interval '1 2.3456' minute to second(2);
SELECT interval '1 2:03.5678' minute to second(2);
SELECT interval '1 2:03:04.5678' minute to second(2);
-- test inputting and outputting SQL standard interval literals
SET IntervalStyle TO sql_standard;
SELECT interval '0' AS "zero",
interval '1-2' year to month AS "year-month",
interval '1 2:03:04' day to second AS "day-time",
- interval '1-2' AS "negative year-month",
- interval '1 2:03:04' AS "negative day-time";
-- test input of some not-quite-standard interval values in the sql style
SET IntervalStyle TO postgres;
SELECT interval '+1 -1:00:00',
interval '-1 +1:00:00',
interval '+1-2 -3 +4:05:06.789',
interval '-1-2 +3 -4:05:06.789';
-- test output of couple non-standard interval values in the sql style
SET IntervalStyle TO sql_standard;
SELECT interval '1 day -1 hours',
interval '-1 days +1 hours',
interval '1 years 2 months -3 days 4 hours 5 minutes 6.789 seconds',
- interval '1 years 2 months -3 days 4 hours 5 minutes 6.789 seconds';
-- test outputting iso8601 intervals
SET IntervalStyle to iso_8601;
select interval '0' AS "zero",
interval '1-2' AS "a year 2 months",
interval '1 2:03:04' AS "a bit over a day",
interval '2:03:04.45679' AS "a bit over 2 hours",
(interval '1-2' + interval '3 4:05:06.7') AS "all fields",
(interval '1-2' - interval '3 4:05:06.7') AS "mixed sign",
(- interval '1-2' + interval '3 4:05:06.7') AS "negative";
-- test inputting ISO 8601 4.4.2.1 "Format With Time Unit Designators"
SET IntervalStyle to sql_standard;
select interval 'P0Y' AS "zero",
interval 'P1Y2M' AS "a year 2 months",
interval 'P1W' AS "a week",
interval 'P1DT2H3M4S' AS "a bit over a day",
interval 'P1Y2M3DT4H5M6.7S' AS "all fields",
interval 'P-1Y-2M-3DT-4H-5M-6.7S' AS "negative",
interval 'PT-0.1S' AS "fractional second";
-- test inputting ISO 8601 4.4.2.2 "Alternative Format"
SET IntervalStyle to postgres;
select interval 'P00021015T103020' AS "ISO8601 Basic Format",
interval 'P0002-10-15T10:30:20' AS "ISO8601 Extended Format";
-- Make sure optional ISO8601 alternative format fields are optional.
select interval 'P0002' AS "year only",
interval 'P0002-10' AS "year month",
interval 'P0002-10-15' AS "year month day",
interval 'P0002T1S' AS "year only plus time",
interval 'P0002-10T1S' AS "year month plus time",
interval 'P0002-10-15T1S' AS "year month day plus time",
interval 'PT10' AS "hour only",
interval 'PT10:30' AS "hour minute";
-- test a couple rounding cases that changed since 8.3 w/ HAVE_INT64_TIMESTAMP.
SET IntervalStyle to postgres_verbose;
select interval '-10 mons -3 days +03:55:06.70';
select interval '1 year 2 mons 3 days 04:05:06.699999';
select interval '0:0:0.7', interval '@ 0.70 secs', interval '0.7 seconds';
-- check that '30 days' equals '1 month' according to the hash function
select '30 days'::interval = '1 month'::interval as t;
select interval_hash('30 days'::interval) = interval_hash('1 month'::interval) as t;
-- numeric constructor
select make_interval(years := 2);
select make_interval(years := 1, months := 6);
select make_interval(years := 1, months := -1, weeks := 5, days := -7, hours := 25, mins := -180);
select make_interval() = make_interval(years := 0, months := 0, weeks := 0, days := 0, mins := 0, secs := 0.0);
select make_interval(hours := -2, mins := -10, secs := -25.3);
select make_interval(years := 'inf'::float::int);
select make_interval(months := 'NaN'::float::int);
select make_interval(secs := 'inf');
select make_interval(secs := 'NaN');
select make_interval(secs := 7e12); | the_stack |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.