MySQL distinction between e and é (e acute) – UNIQUE index

and collation is “utf8_general_ci”. And that’s the answer. If you’re using utf8_general_ci (actually it applies to all utf_…_[ci|cs]) collation then diacritics are bypassed in comarison, thus: SELECT “e” = “é” AND “O” = “Ó” AND “ä” = “a” Results in 1. Indexes also use collation. If you want to distinguish between ą and a then … Read more

Scrollview inside constraint layout does not scroll to the bottom of the parent constraint

This layout works in my app. The trick is to set these two attributes in ScrollView: android:layout_height=”0dp” app:layout_constraintBottom_toBottomOf=”parent” The simplified layout from my app: <?xml version=”1.0″ encoding=”utf-8″?> <android.support.constraint.ConstraintLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:app=”http://schemas.android.com/apk/res-auto” xmlns:tools=”http://schemas.android.com/tools” android:layout_width=”match_parent” android:layout_height=”match_parent” android:theme=”@style/ThemeOverlay.AppCompat.Light”> <RelativeLayout android:id=”@+id/linear” android:layout_width=”0dp” android:layout_height=”56dp” android:background=”@color/title” app:layout_constraintLeft_toLeftOf=”parent” app:layout_constraintRight_toRightOf=”parent” app:layout_constraintTop_toTopOf=”parent” /> <ScrollView android:layout_width=”0dp” android:layout_height=”0dp” app:layout_constraintBottom_toBottomOf=”parent” app:layout_constraintLeft_toLeftOf=”parent” app:layout_constraintRight_toRightOf=”parent” app:layout_constraintTop_toBottomOf=”@id/linear”> <android.support.constraint.ConstraintLayout android:layout_width=”match_parent” android:layout_height=”wrap_content”> <TextView android:id=”@+id/titleView” … Read more

SQL constraint minvalue / maxvalue?

SQL Server syntax for the check constraint: create table numbers ( number int not null check(number >= 1234 and number <= 4523), … ) create table numbers ( number int not null, check(number >= 1234 and number <= 4523), … ) create table numbers ( number int not null, constraint number_range_check check(number >= 1234 and … Read more

Temporarily disable all foreign key constraints

To disable foreign key constraints: DECLARE @sql nvarchar(max) = N”; ;WITH x AS ( SELECT DISTINCT obj = QUOTENAME(OBJECT_SCHEMA_NAME(parent_object_id)) + ‘.’ + QUOTENAME(OBJECT_NAME(parent_object_id)) FROM sys.foreign_keys ) SELECT @sql += N’ALTER TABLE ‘ + obj + N’ NOCHECK CONSTRAINT ALL; ‘ FROM x; EXEC sys.sp_executesql @sql; To re-enable: DECLARE @sql nvarchar(max) = N”; ;WITH x AS … Read more

Display names of all constraints for a table in Oracle SQL

You need to query the data dictionary, specifically the USER_CONS_COLUMNS view to see the table columns and corresponding constraints: SELECT * FROM user_cons_columns WHERE table_name=”<your table name>”; FYI, unless you specifically created your table with a lower case name (using double quotes) then the table name will be defaulted to upper case so ensure it … Read more