text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
--4.7 real
create table t_pruning_datatype_real(c1 real,c2 int,c3 int,c4 text)
partition by range(c1)
(partition p1 values less than(100.11),
partition p2 values less than(200.22),
partition p3 values less than(300.33),
partition p4 values less than(500.55));
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFE... | the_stack |
-- 2018-06-20T18:20:20.762
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process (AD_Client_ID,IsActive,CreatedBy,IsReport,IsDirectPrint,Value,AccessLevel,EntityType,ShowHelp,IsBetaFunctionality,IsServerProcess,CopyFromProcess,AD_Process_ID,AllowProcessReRun,IsUseBPartnerLanguage,IsAp... | the_stack |
DROP FUNCTION IF EXISTS exportSalesInvoicesInDateRange(TIMESTAMP With Time Zone, TIMESTAMP With Time Zone, numeric);
CREATE OR REPLACE FUNCTION exportSalesInvoicesInDateRange(IN p_C_Invoice_dateinvoiced_start TIMESTAMP With Time Zone,
IN p_C_Invoice_dateinvoice... | the_stack |
--schema changes
ALTER TABLE Catalogue.ConfigPoSH
ALTER COLUMN ParameterValue VARCHAR(256)
GO
ALTER TABLE Catalogue.Logins_Stage
DROP CONSTRAINT PK_Logins_Stage
GO
ALTER TABLE Catalogue.Logins_Stage
DROP COLUMN ID
GO
ALTER TABLE Catalogue.Databases_Stage
ADD StateDesc NVARCHAR(60)
GO
ALTER TABLE Catalogue.Databases... | the_stack |
-- =============================================================================
-- Basic function: query_gv_views
-- =============================================================================
drop function query_gv_views cascade;
create or replace function query_gv_views (pi_schema varchar, pi_view_name varchar)
... | the_stack |
--netezza CDM DDL Specification for OMOP Common Data Model 5.4
--HINT DISTRIBUTE ON KEY (person_id)
CREATE TABLE @cdmDatabaseSchema.PERSON (
person_id integer NOT NULL,
gender_concept_id integer NOT NULL,
year_of_birth integer NOT NULL,
month_of_birth integer NULL,
day_of_birth integer NULL,
birth_da... | the_stack |
-- 2021-09-07T14:30:26.265Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List SET Name='Bestellvermittlung',Updated=TO_TIMESTAMP('2021-09-07 17:30:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=542678
;
-- 2021-09-07T14:43:16.945Z
-- I forgot to set the DICTIONARY_ID... | the_stack |
-- 2019-07-25T00:04:16.459Z
-- URL zum Konzept
UPDATE AD_Tab SET AD_Column_ID=1349,Updated=TO_TIMESTAMP('2019-07-25 02:04:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=541830
;
-- 2019-07-25T00:04:22.843Z
-- URL zum Konzept
UPDATE AD_Tab SET AD_Column_ID=559675,Updated=TO_TIMESTAMP('2019-07-25 02:04:22','... | the_stack |
--
-- Table structure for table `bookmarks`
--
DROP TABLE IF EXISTS `bookmarks`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bookmarks` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`created_at` timestamp NULL DEFAULT NULL,
`updated... | the_stack |
--
-- The contents of this file are subject to the license and copyright
-- detailed in the LICENSE and NOTICE files at the root of the source
-- tree and available online at
--
-- http://www.dspace.org/license/
--
------------------------------------------------------
-- DS-2701 Service based API / Hibernate integrat... | the_stack |
-- 21.01.2017 15:12
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-01-21 15:12:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540652
;
-- 21.01.2017 15:12
-- I forgot to set the DICTIONARY_ID_COMM... | the_stack |
-- These settings improves throughput of the database by reducing locking by better separating readers from writers.
-- SQL Server 2012 and newer can refer to itself as CURRENT. Older ones need a workaround.
DECLARE @current NVARCHAR(256);
DECLARE @snapshotSettings NVARCHAR(612);
SELECT @current = (SELECT DB_NAME());
... | 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")... | the_stack |
create or replace package tst_pkg_huge is
-- %suite
-- %displayname(huge package suite name)
-- %suitepath(all.tests)
-- %test
-- %displayname(Test number 1)
procedure test1;
-- %test
-- %displayname(Test number 2)
procedure test2;
-- %test
-- %displayname(Test number 3)
... | the_stack |
UPDATE configuration SET version = '0.17';
ALTER TABLE packages
ADD COLUMN description VARCHAR(200) DEFAULT '' NOT NULL;
ALTER TABLE versions
ADD COLUMN yanked BOOLEAN DEFAULT false NOT NULL,
DROP CONSTRAINT versions_package_fk,
ADD CONSTRAINT versions_package_fk FOREIGN KEY (package)
REFERENC... | the_stack |
-- Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
-- This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either l... | the_stack |
-- Copyright (C) from 2009 to Present EPAM Systems.
--
-- This file is part of Indigo toolkit.
--
-- 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/LICE... | the_stack |
module opentype;
struct Unknown {};
// TODO: Missing primitives:
struct VArray (A : Type) {};
struct U24Be {
value : Array 3 U8,
};
// FIXME: A tad hacky - add operators and proper bounds handling?
nat_eq : int {0 ..} -> int {0 ..} -> Bool;
nat_eq = extern "int-eq";
// FIXME: A tad hacky - add operators and ... | the_stack |
--
-- Invoke queries on each element of given collection.
--
-- This procedure will iterate a given collection. The collection is one of several
-- supported types as described below. For each element in the collection, the routine
-- invokes the given set (one or more) of queries.
--
-- Queries may relate to the parti... | the_stack |
CREATE TABLE bus_domain (
bus_domain_id SERIAL NOT NULL,
description varchar(256) NOT NULL,
bus_domain_name varchar(45) NOT NULL,
bus_domain_owner varchar(45) NOT NULL,
PRIMARY KEY (bus_domain_id)
);
/* etlmd_batch_status.sql */
CREATE TABLE batch_status (
batch_state_id INT NOT NULL,
description varc... | the_stack |
-- 2021-09-01T08:17:10.462Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET DisplayLogic='@Type_Conditions/''Refund''@!''Refund'' & @Type_Conditions/''Commission''@!''Commission'' & @Type_Conditions/''MarginCommission''@!''MarginCommission''',Updated=TO_TIMESTAMP('2021-09-01 11:17:... | 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 `ba... | the_stack |
-- default for superuser is false
CREATE ROLE regress_test_def_superuser;
SELECT
rolname,
rolsuper,
rolinherit,
rolcreaterole,
rolcreatedb,
rolcanlogin,
rolreplication,
rolbypassrls,
rolconnlimit,
rolpassword,
rolvaliduntil
FROM
pg_authid
WHERE
rolname = 'regress_tes... | the_stack |
----------------------------------------
/* ----------------------------------------
actionlogrecord indices (ActionLogRecord.java)
*/ ----------------------------------------
CREATE INDEX index_actionlogrecord_useridentifier ON actionlogrecord (useridentifier);
CREATE INDEX index_actionlogrecord_actiontype ON actio... | the_stack |
select module('Chaos.Server.Actions.MovePhase');
/*
== move
Individual Piece move notes
A piece may be 'selected' iff it can move or attack or has a ranged attack.
Once a piece is selected it must first move, then attack, then ranged
attack (skipping bits which don't apply).
The piece can forfeit any part of this (a... | the_stack |
-- 2019-04-04T16:49:30.870
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Description='Interval in Stunden bis zum Bereitstellungsdatum der aktuellen Auftrags, innerhalb dessen andere noch nicht fertig gestellte Auftragspositionen berücksichtigt werden sollen. Sollte abhängi... | the_stack |
CREATE DATABASE IF NOT EXISTS `kardio` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `kardio`;
-- MySQL dump 10.13 Distrib 5.6.17, for Win64 (x86_64)
--
-- Database: kardio
-- ------------------------------------------------------
-- Server version 5.6.40-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_... | the_stack |
--
---- test interval partitioned index
--
drop table if exists hw_partition_index_ip;
create table hw_partition_index_ip
(
c1 int,
c2 int,
logdate date not null
)
partition by range (logdate)
INTERVAL ('1 month')
(
PARTITION hw_partition_index_ip_p0 VALUES LESS THAN ('2020-03-01'),
PARTITION hw_partition_index_i... | the_stack |
-- 2018-08-29T18:16:11.835
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Menu (AD_Client_ID,IsActive,CreatedBy,IsSummary,IsSOTrx,IsReadOnly,EntityType,AD_Menu_ID,IsCreateNew,InternalName,AD_Org_ID,Name,UpdatedBy,Created,Updated) VALUES (0,'Y',100,'Y','N','N','D',541134,'N','EMail',0,'... | the_stack |
-- 2019-10-20T19:36:51.184Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Val_Rule SET Code='C_Flatrate_Conditions.Type_Conditions NOT IN (''FlatFee'',''HoldingFee'', ''Subscr'', ''Procuremnt'', ''Commission'')',Updated=TO_TIMESTAMP('2019-10-20 21:36:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=... | the_stack |
PRINT '-------------------------------------------'
PRINT '---- FullTextSearch Information Collector'
PRINT '---- $Revision: 1 $'
PRINT '---- $Date: 2010/4/19 09:30:05 $'
PRINT '---- $Comments: Only for SQL 2005 & above'
PRINT '---- Version: v3.0'
PRINT '-------------------------------------------'
PRINT ''
PRINT 'Sta... | the_stack |
-- 2017-10-21T11:37:32.773
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2017-10-21 11:37:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541350
;
-- 2017-10-21T11:37:32.782
-- I forgot to set the DIC... | the_stack |
------------------------------------------------------------------
-- magma protocol
------------------------------------------------------------------
DROP FUNCTION IF EXISTS pg_catalog.magma_validate();
DROP FUNCTION IF EXISTS pg_catalog.magma_blocklocation();
DROP FUNCTION IF EXISTS pg_catalog.magma_tablesize();
DRO... | the_stack |
DROP VIEW IF EXISTS "de_metas_acct".accountable_docs_and_lines_v
;
CREATE OR REPLACE VIEW "de_metas_acct".accountable_docs_and_lines_v AS
(
SELECT 'C_Order' AS TableName,
10::integer ... | the_stack |
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for admin_permission
-- ----------------------------
DROP TABLE IF EXISTS `admin_permission`;
CREATE TABLE `admin_permission` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`menu_name` varchar(255) CHARACTER SET utf8 COL... | the_stack |
CREATE TABLE `jobnavi_version_config` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`version` VARCHAR(128) NOT NULL
COMMENT '集群版本',
`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
COMMENT '创建时间',
`updated_at` TIMESTAMP NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP
COMMENT... | the_stack |
-- Wed Feb 10 03:56:50 EST 2016
INSERT INTO gw_requests (
rstart, rend, duration,
month, week, day, hour, minute,
api_org_id, api_id, api_version,
client_org_id, client_id, client_version, plan,
user_id, resp_type, bytes_up, bytes_down
) VALUES (
1455094610000, 1455094610100, 100,
1454284800000, 145480... | the_stack |
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for activities
-- ----------------------------
DROP TABLE IF EXISTS `activities`;
CREATE TABLE `activities` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) unsigned NOT NULL DEFAULT '0',
`module` varchar(100) DE... | the_stack |
-- 2018-08-03T09:25:55.706
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column_Trl SET Name='Customer Label Name' WHERE AD_Column_ID=557915 AND AD_Language='en_US'
;
-- 2018-08-03T09:25:58.889
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column_Trl SET IsTr... | the_stack |
CREATE OR REPLACE PACKAGE crossbar
AS
/**
* Crossbar.io Oracle PL/SQL API.
*
* Copyright (C) 2011-2014 Tavendo GmbH.
* Licensed under Apache 2.0 license (http://www.apache.org/licenses/LICENSE-2.0.html)
*
* Publish and Subscribe:
*
* The package provides functions to publish events ... | the_stack |
-- 2012-03-19 Pedro Lopes (Microsoft) pedro.lopes@microsoft.com (http://aka.ms/ezequiel)
--
-- All Databases index info, including duplicate, redundant, rarely used and unused indexes.
--
-- 4/5/2012 Simplified execution by subdividing input queries
-- 4/5/2012 Fixed some collation issues;
-- 4/6/2012 Split in separ... | the_stack |
--
-- AGTYPE data type regression tests
--
--
-- Load extension and set path
--
LOAD 'age';
SET search_path TO ag_catalog;
--
-- Create a table using the AGTYPE type
--
CREATE TABLE agtype_table (type text, agtype agtype);
--
-- Insert values to exercise agtype_in/agtype_out
--
INSERT INTO agtype_table VALUES ('bool... | the_stack |
DROP TABLE IF EXISTS grest.pool_info_cache;
CREATE TABLE grest.pool_info_cache (
id SERIAL PRIMARY KEY,
tx_id bigint NOT NULL,
tx_hash text,
block_time timestamp without time zone,
pool_hash_id bigint NOT NULL,
pool_id_bech32 character varying NOT NULL,
pool_id_hex text NOT NULL,
active... | the_stack |
use master
go
drop database if exists ncci
go
CREATE DATABASE [ncci]
CONTAINMENT = NONE
ON PRIMARY
( NAME = N'ncci_data', FILENAME = N'C:\data\ncci_Data.mdf' , SIZE = 102400KB , MAXSIZE = 5GB, FILEGROWTH = 1024000KB )
LOG ON
( NAME = N'ncci_log', FILENAME = N'C:\data\ncci_Log.ldf ' , SIZE = 52400KB , MAXSIZE ... | the_stack |
--
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_cata... | the_stack |
/*************************************************************
Resource Bulk Import feature
**************************************************************/
IF TYPE_ID(N'BulkImportResourceType_1') IS NULL
BEGIN
CREATE TYPE dbo.BulkImportResourceType_1 AS TABLE
(
ResourceTypeId smallint NOT NULL,
... | the_stack |
CREATE TABLE IF NOT EXISTS `activity` (
`id` int(11) unsigned NOT NULL auto_increment,
`description` varchar(255) character set UTF8 default NULL,
`DE` VARCHAR(255) character set UTF8 default NULL,
`EN` VARCHAR(255) character set UTF8 default NULL,
`ES` VARCHAR(255) character set UTF8 default NULL,
`FR` VAR... | 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... | the_stack |
AUTOCOMMIT OFF;
-- MODULE DML178
-- SQL Test Suite, V6.0, Interactive SQL, dml178.sql
-- 59-byte ID
-- TEd Version #
-- AUTHORIZATION FLATER
set schema FLATER;
--O SELECT USER FROM HU.ECCO;
VALUES USER;
-- RERUN if USER value does not match preceding AUTHORIZATION comment
ROLLBACK WORK;
-- date_time p... | the_stack |
CREATE VIEW basedosdados-dev.br_inep_saeb.escola_1995_2005 AS
SELECT
SAFE_CAST(ano AS INT64) ano,
SAFE_CAST(id_mascara AS STRING) id_mascara,
SAFE_CAST(sigla_uf AS STRING) sigla_uf,
SAFE_CAST(rede AS STRING) rede,
SAFE_CAST(localizacao AS STRING) localizacao,
SAFE_CAST(serie AS STRING) serie,
SAFE_CAST(peso AS FLOAT64... | the_stack |
-- original: e_fkey.test
-- credit: http://www.sqlite.org/src/tree?ci=trunk&name=test
PRAGMA foreign_keys = ON;
CREATE TABLE p(i PRIMARY KEY);
CREATE TABLE c(j REFERENCES p ON UPDATE CASCADE);
INSERT INTO p VALUES('hello');
INSERT INTO c VALUES('hello');
UPDATE p SET i = 'world';
... | the_stack |
CREATE VIEW basedosdados-dev.br_inep_saeb.aluno_ef_2007_2019 AS
SELECT
SAFE_CAST(ano AS INT64) ano,
SAFE_CAST(sigla_uf AS STRING) sigla_uf,
SAFE_CAST(id_municipio AS STRING) id_municipio,
SAFE_CAST(id_escola AS STRING) id_escola,
SAFE_CAST(rede AS STRING) rede,
SAFE_CAST(localizacao AS STRING) localizacao,
SAFE_CAST(s... | the_stack |
-- 2018-10-17T16:35:11.290
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Reference_ID,AD_Client_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Ref_List_ID,ValueName,AD_Org_ID,Name,Value,EntityType) VALUES (505210,0,'Y',TO_TIMESTAMP('2018-10-17 16:35:11','YYYY-MM-DD HH... | the_stack |
Known Issues & Limitations:
- Custom non-standard (non-CU & non-SP) versions are not targeted yet
*/
/*
Changes in 1.0.1
+ Added drops for the existing temp tables: #SQLColumnstoreImprovements, #SQLBranches, #SQLVersions
+ Added new parameter for Enables showing the SQL Server versions that are posterior the curr... | the_stack |
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for sys_dept
-- ----------------------------
DROP TABLE IF EXISTS `sys_dept`;
CREATE TABLE `sys_dept` (
`dept_id` int(11) NOT NULL AUTO_INCREMENT,
`parent_id` int(11) NOT NULL,
`name` varchar(50) CHARACTER SET utf8... | the_stack |
-- Upgrade SQL
-- Update amstrategies for old PostgreSQL
DO LANGUAGE plpgsql $$
BEGIN
UPDATE pg_am SET amstrategies = 27
WHERE amname = 'pgroonga';
EXCEPTION
WHEN undefined_column THEN -- Ignore
END;
$$;
-- Update pgroonga.text_full_text_search_ops_v2
DROP OPERATOR CLASS pgroonga.text_full_text_search_ops_v2 USIN... | the_stack |
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for admin
-- ----------------------------
DROP TABLE IF EXISTS `admin`;
CREATE TABLE `admin` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(60) COLLATE utf8_bin NOT NULL,
`password` varchar(60) COLLATE u... | the_stack |
-- MySQL dump 10.13 Distrib 5.6.24, for osx10.8 (x86_64)
--
-- Host: 127.0.0.1 Database: CFBroker
-- ------------------------------------------------------
-- Server version 5.6.26
/*!40101 SET @OLD_CHARACTER_SET_CLIENT = @@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS = @@CHARACTER_SET_RESULTS ... | the_stack |
-- 2019-03-12T09:43:51.806
-- 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,IsDisplayedGrid,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine... | the_stack |
set current_schema=vector_window_engine;
----
--- test 1: Basic Test: Rank()
----
select depname, salary, rank() over(partition by depname order by salary) from vector_window_table_01 order by 1, 2;
select depname, salary, dense_rank() over(partition by depname order by salary) from vector_window_table_01 order by 1, ... | the_stack |
CREATE OR REPLACE FUNCTION tomarrow()
RETURNS timestamptz
AS $$
BEGIN
RETURN now() + interval '1 day';
END;
$$ LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION remove_all_job()
RETURNS void
AS $$
DECLARE
sql text;
job_id int;
BEGIN
sql := 'select job_id from p... | the_stack |
ALTER TABLE :OMOP_SCHEMA.concept DISABLE TRIGGER ALL;
DELETE FROM :OMOP_SCHEMA.concept WHERE concept_id >= 200000000;
DELETE FROM :OMOP_SCHEMA.concept_synonym WHERE concept_id >= 200000000;
ALTER TABLE :OMOP_SCHEMA.concept ENABLE TRIGGER ALL;
--MIMIC-OMOP
--concept_
INSERT INTO :OMOP_SCHEMA.concept (
concept_id, conce... | the_stack |
--
-- Tests for common table expressions (WITH query, ... SELECT ...)
--
-- Basic WITH
WITH q1(x,y) AS (SELECT 1,2)
SELECT * FROM q1, q1 AS q2;
-- Multiple uses are evaluated only once
SELECT count(*) FROM (
WITH q1(x) AS (SELECT random() FROM generate_series(1, 5))
SELECT * FROM q1
UNION
SELECT * FROM q1... | the_stack |
-- 2017-07-12T17:04:32.663
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-07-12 17:04:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=1000273
;
-- 2017-07-12T17:04:32.670
-- I forgot to set the DIC... | the_stack |
-- This code calculates the Elixhauser comorbidities as defined in Quan et. al 2009:
-- Quan, Hude, et al. "Coding algorithms for defining comorbidities in
-- ICD-9-CM and ICD-10 administrative data." Medical care (2005): 1130-1139.
-- https://www.ncbi.nlm.nih.gov/pubmed/16224307
-- Quan defined an "Enhanced ICD-9" c... | the_stack |
DROP TRIGGER create_internal_recipe;
CREATE TRIGGER create_internal_recipe AFTER INSERT ON meal_plan
BEGIN
/* This contains practically the same logic as the trigger remove_internal_recipe */
-- Create a recipe per day
DELETE FROM recipes
WHERE name = NEW.day
AND type = 'mealplan-day';
INSERT OR REPLACE INTO r... | the_stack |
--
-- Most of the code in the Qalingo project is copyrighted Hoteia and licensed
-- under the Apache License Version 2.0 (release version 0.8.0)
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Copyright (c) Hoteia, 2012-2014
-- http://www.hoteia.com - http://twitter.com/hoteia - cont... | the_stack |
-- 2021-06-25T21:44:45.503Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table SET IsHighVolume='Y',Updated=TO_TIMESTAMP('2021-06-26 00:44:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=413
;
-- 2021-06-25T21:45:07.652Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System C... | the_stack |
CREATE FUNCTION dbo.udf_parseJSON( @JSON NVARCHAR(MAX))
RETURNS @hierarchy TABLE
(
element_id INT IDENTITY(1, 1) NOT NULL, /* internal surrogate primary key gives the order of parsing and the list order */
sequenceNo [int] NULL, /* the place in the sequence for the element */
parent_ID INT,/* if the ele... | the_stack |
--Add new vocabulary_id='OSM'
DO $_$
BEGIN
PERFORM VOCABULARY_PACK.AddNewVocabulary(
pVocabulary_id => 'OSM',
pVocabulary_name => 'OpenStreetMap',
pVocabulary_reference => 'https://www.openstreetmap.org/copyright/en, https://wambachers-osm.website/boundaries/',
pVocabulary_version => 'OSM 20190201 Release',
p... | the_stack |
DECLARE @Msg VARCHAR(MAX);SELECT @Msg = 'Compiled at '+CONVERT(VARCHAR,GETDATE(),121);RAISERROR(@Msg,0,1);
GO
IF OBJECT_ID('tSQLt_testutil.Private_Drop_tSQLtTestUtilCLR_objects') IS NOT NULL EXEC('EXEC tSQLt_testutil.Private_Drop_tSQLtTestUtilCLR_objects');
GO
EXEC tSQLt.DropClass tSQLt_testutil;
GO
CREATE SCHE... | the_stack |
-- fts3ac.test
--
-- db eval {
-- CREATE VIRTUAL TABLE email USING fts3([from],[to],subject,body);
-- BEGIN TRANSACTION;
-- INSERT INTO email([from],[to],subject,body) VALUES('savita.puthigai@enron.com', 'traders.eol@enron.com, traders.eol@enron.com', 'EnronOnline- Change to Autohedge', 'Effective Monday, Octo... | the_stack |
DROP TABLE IF EXISTS st_1;
CREATE TABLE st_1 AS
SELECT a.DRUG_CODE,
INGREDIENT_CODE,
AMOUNT_VALUE,
AMOUNT_UNIT,
NUMERATOR_VALUE,
NUMERATOR_UNIT,
DENOMINATOR_VALUE,
DENOMINATOR_UNIT,
AM,
BM1,
TPACK_1 AS TPACK
FROM STRENGTH_TMP a
JOIN DRUGS_AND_PACKS b ON a.drug_code = b.drug_code
WHERE TPACK_1 IS NOT NULL
UNI... | the_stack |
-- 2017-12-23T08:26:08.383
-- 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... | 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_regres... | the_stack |
create schema distribute_setop_2;
set current_schema = distribute_setop_2;
create table setop_hash_table_01( a int, b int ,c text) ;
create table setop_hash_table_02( a int, b numeric ,c text) ;
create table setop_hash_table_03( a int, b bigint ,c text) ;
create table setop_hash_table_04( a smallint, b bigint ,c text)... | the_stack |
-- Copyright (c) 2019 The DAML Authors. All rights reserved.
-- SPDX-License-Identifier: Apache-2.0
-- PART 1: copied and adapted from postgres/V1__Init.sql
-- Stores the history of the ledger -- mostly transactions. This table
-- is immutable in the sense that rows can never be modified, only
-- added.
CREATE TABLE ... | the_stack |
-------------------------------------------------------------------------------
-- (c) Copyright IBM Corp. 2008 All rights reserved.
--
-- The following sample of source code ("Sample") is owned by International
-- Business Machines Corporation or one of its subsidiaries ("IBM") and is
-- copyrighted and licensed, not ... | the_stack |
/* chinese simplified (China) charsets: */
/* GB (GB2312), GBK, MS936, APPLE_CHINSIMP */
/* GBK is a superset of GB2312, so we have only GBK tables. The offset is */
/* added in the lead byte tables. */
/* ======================================================================= */
static sal_uInt16 const aImplDBCSToU... | 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")... | the_stack |
USE [msdb]
GO
-- Set here the Operator name to receive notifications
DECLARE @customoper sysname
SET @customoper = 'SQLAdmins'
IF EXISTS (SELECT name FROM msdb.dbo.sysoperators WHERE name = @customoper)
BEGIN
IF NOT EXISTS (SELECT name FROM msdb.dbo.syscategories WHERE name=N'Agent Alerts Sev 10' AND category_class=... | 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... | the_stack |
CREATE OR REPLACE FUNCTION public.add_year_2019_if_not_exists()
RETURNS VOID
LANGUAGE 'plpgsql'
VOLATILE
AS $BODY$
DECLARE
v_year_exists BOOLEAN;
BEGIN
select exists(select 1 from C_Year where FiscalYear='2019' and IsActive='Y' and C_Calendar_ID=1000000) INTO v_year_exists;
IF (v_year_exists) ... | the_stack |
create table foo_bar
(
id bigint identity
constraint foo_bar_pk
primary key nonclustered,
name varchar(20) not null,
foo varchar(20),
bar varchar(20) not null,
remark varchar(200),
state int default 1 ... | the_stack |
--
-- Test foreign-data wrapper file_fdw.
--
-- directory paths are passed to us in environment variables
\getenv abs_srcdir PG_ABS_SRCDIR
-- Clean up in case a prior regression run failed
SET client_min_messages TO 'warning';
DROP ROLE IF EXISTS regress_file_fdw_superuser, regress_file_fdw_user, regress_no_priv_user... | the_stack |
/*
Run this script on:
(localdb)\v11.0.CSETWeb923 - This database will be modified
to synchronize it with:
(localdb)\v11.0.CSETWeb1000
You are recommended to back up your database before running this script
Script created by SQL Compare version 14.1.7.14336 from Red Gate Software Ltd at 4/21/... | the_stack |
-- 用户信息表
DROP TABLE if EXISTS lf_console_user;
CREATE TABLE lf_console_user (
id int NOT NULL AUTO_INCREMENT COMMENT '主键id',
user_name varchar(32) NOT NULL DEFAULT '' COMMENT '用户名',
email varchar(64) DEFAULT '' COMMENT '邮箱',
phone varchar(20) DEFAULT '' COMMENT '手机号',
password varchar(128) NOT NULL DEFAULT ''... | the_stack |
-- 2021-05-14T15:30:02.255Z
-- 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,541315,TO_TIMESTAMP('2021-05-14 18:30:02','YYYY-MM-DD HH2... | the_stack |
---- new product salesgroups ------
-- 05.02.2016 12:07
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List SET Name='Blumenkohl offen',Updated=TO_TIMESTAMP('2016-02-05 12:07:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=541147
;
-- 05.02.2016 12:07
-- I forgot to ... | the_stack |
-- array_sort function
DROP FUNCTION IF EXISTS array_sort(anyarray);
CREATE FUNCTION
array_sort(
array_vals_to_sort anyarray
)
RETURNS TABLE (
sorted_array anyarray
)
AS $BODY$
BEGIN
RETURN QUERY SELECT
ARRAY_AGG(val) AS sorted_array
FROM
(
SELECT
... | the_stack |
# ------------------------------------------------------
# Audit
# >>>>
# Auditing of application operations
CREATE TABLE `{core.audit}`
(
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`user` INT(10) UNSIGNED NOT NULL DEFAULT '0',
`ip` VARCHAR(15) NOT NULL DEFAULT '',
`secti... | the_stack |
DROP FUNCTION IF EXISTS de_metas_endcustomer_fresh_reports.Docs_Purchase_Invoice_Details ( IN C_Invoice_ID numeric, IN AD_Language Character Varying (6) );
CREATE OR REPLACE FUNCTION de_metas_endcustomer_fresh_reports.Docs_Purchase_Invoice_Details ( IN C_Invoice_ID numeric, IN AD_Language Character Varying (6) )
RETUR... | the_stack |
-- Constraint is not used dropping it to clean the dependency before dropping the function.
----------------------------------
-- create functions --
----------------------------------
DROP TYPE IF EXISTS idTextType CASCADE;
CREATE TYPE idtexttype AS (id TEXT);
DROP TYPE IF EXISTS idUuidType CASCADE;
CREAT... | the_stack |
if exists (select * from sysobjects where id = object_id('dbo.Employee Sales by Country') and sysstat & 0xf = 4)
drop procedure [dbo].[Employee Sales by Country]
GO
if exists (select * from sysobjects where id = object_id('dbo.Sales by Year') and sysstat & 0xf = 4)
drop procedure [dbo].[Sales by Year]
GO
if exists (s... | the_stack |
SET datestyle = "ISO, DMY";
-- Test heuristic to resolve unknown-type literals when there are ambiguous
-- functions, added in PostgreSQL commit 1a8b9fb549.
create function ambigargfunc(a int4, b int4) returns text as $$ select 'int variant chosen'::text $$ language sql;
create function ambigargfunc(a int4, b timestam... | the_stack |
EXEC tSQLt.NewTestClass 'InstallAssemblyKeyTests';
GO
DECLARE @cmd NVARCHAR(MAX);
SET @cmd = 'IF(SUSER_ID(''InstallAssemblyKeyTestsUser1'')) IS NOT NULL DROP LOGIN InstallAssemblyKeyTestsUser1;';
EXEC master.sys.sp_executesql @cmd;
SET @cmd = 'IF(SCHEMA_ID(''InstallAssemblyKeyTestsUser1'')) IS NOT NULL DROP SCHEMA Inst... | the_stack |
-- 2017-10-16T14:55:02.268
-- 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_Table_ID,AllowZoomTo,ColumnName,Created,CreatedBy,DDL_NoForeignKey,DefaultValue,Description,EntityType,FieldLength,Help,IsActive,IsAdva... | the_stack |
-- CHECK CONSTRAINT
CREATE TABLE TEST_CHECK_CONSTRAINT_A_1
(
A INT4 CHECK(A <> 0),
B INT
)
PARTITION BY RANGE (A)
(
PARTITION TEST_CHECK_CONSTRAINT_A_1_P0 VALUES LESS THAN (50),
PARTITION TEST_CHECK_CONSTRAINT_A_1_P1 VALUES LESS THAN (100),
PARTITION TEST_CHECK_CONSTRAINT_A_1_P2 VALUES LESS THAN (MAXVALUE)
);
DRO... | the_stack |
-- This script responsible for migrating required data to Visualization.
-- See Feature DHIS2-7946
-- It migrates:
-- 1) copy data from chart table into visualization;
-- 2) copy data from reporttable table into visualization;
-- 3) copy reporttable column into the visualizationid column in the dashboarditems table;
-... | the_stack |
create schema nodegroup_replication_test;
set current_schema = nodegroup_replication_test;
set enable_nodegroup_explain=true;
set expected_computing_nodegroup='group1';
create node group ng0 with (datanode1, datanode2, datanode3);
create node group ng1 with (datanode4, datanode5, datanode6);
create node group ng2 wit... | the_stack |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.