SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE OBJECTPROPERTY(OBJECT_ID(CONSTRAINT_SCHEMA + '.' + CONSTRAINT_NAME), 'IsPrimaryKey') = 1 AND TABLE_NAME = 'my_table_name' AND TABLE_SCHEMA = 'my_schema_name' See also: How to get primary key of a table from PostgreSQL How to get ... Read more
Author Archives: Shiji Pan
How to get primary key of a table from MySQL
select COLUMN_NAME,INDEX_NAME from INFORMATION_SCHEMA.STATISTICS where TABLE_SCHEMA = 'my_schema_name' and TABLE_NAME='my_table_name' and INDEX_NAME='PRIMARY' See also: How to get primary key of a table from PostgreSQL How to get primary key of a table from SQLite How to get primary key of a ... Read more
How to get primary key of a table from SQLite
Run PRAGMA table_info('my_table_name') find the record that column ‘pk’ is 1, it’s the primary key. See also: How to get primary key of a table from PostgreSQL How to get primary key of a table from MySQL How to get primary key of a table from SQL Server How to get primary key ... Read more
How to get primary key of a table from PostgreSQL
SELECT pg_attribute.attname, format_type(pg_attribute.atttypid, pg_attribute.atttypmod) FROM pg_index, pg_class, pg_attribute, pg_namespace WHERE pg_class.oid = 'my_table_name'::regclass AND indrelid = pg_class.oid AND nspname = 'my_schema_name' AND pg_class.relnamespace = pg_namespace.oid ... Read more
How to generate a CREATE TABLE statement for a given table in SQLite
select sql from sqlite_master where type='table' and tbl_name='country' See also: How to generate a CREATE TABLE statement for a given table in SQL Server How to generate a CREATE TABLE statement for a given table in Oracle How to generate a CREATE TABLE statement for a given table in ... Read more
How to get column names from SQLite table
PRAGMA table_info(table_name); see also: How to get column names from Sql Server table How to get column names from DB2 table How to get column names from Oracle table How to get column names from Mysql table How to get column names from PostgreSQL table Some SQLite tools you can try: ... Read more
How to get column names from PostgreSQL table
select column_name from information_schema.columns where table_name='my_table_name' see also: How to get column names from Sql Server table How to get column names from DB2 table How to get column names from Oracle table How to get column names from Mysql table How to get column names from SQLite ... Read more
About DB2 error “CLI0106E Connection is closed. SQLSTATE=08003”
Sometimes, you meet this error “”CLI0106E Connection is closed. SQLSTATE=08003” when you run DB2 tools. This error would be due to “The connection specified by the connection handle is no longer active.” You can add the following to your db2cli.ini file and restart the ... Read more
About “Unable to load odbcji32.dll”
Sometimes, you may get this error: To solve this problem, you can see this page: http://answers.microsoft.com/en-us/office/forum/office_2016-access/unable-to-load-odbcji32dll/de67abd0-f4d8-40af-8e5f-1922b8393d7e . ... Read more
missing msvcr110.dll
The Program can’t start because MSVCR110.dll is missing from your computer. Try reinstalling the program to fix this problem. See this ... Read more