What is the Action keyword in MySQL? I'm converting a MySQL query into cockroachdb query and the MySQL query I'm seeing is:
CREATE TABLE tabDocType Action (
name varchar(140) COLLATE utf8mb4_unicode_ci NOT NULL,
creation TIMESTAMP(6) DEFAULT NULL,
modified TIMESTAMP(6) DEFAULT NULL,
modified_by varchar(140) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
owner varchar(140) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
docstatus INT NOT NULL DEFAULT 0,
parent varchar(140) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
parentfield varchar(140) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
parenttype varchar(140) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
idx INT NOT NULL DEFAULT 0,
label varchar(140) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
group varchar(140) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
action_type varchar(140) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
action text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (name)
);
Also is Link also a keyword? It's not in the docs but I'm not quite sure what it's actually doing here:
CREATE TABLE `tabDocType Link` (
`name` varchar(140) COLLATE utf8mb4_unicode_ci NOT NULL,
`creation` TIMESTAMP(6) DEFAULT NULL,
`modified` TIMESTAMP(6) DEFAULT NULL,
`modified_by` varchar(140) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`owner` varchar(140) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`docstatus` INT NOT NULL DEFAULT 0,
`parent` varchar(140) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`parentfield` varchar(140) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`parenttype` varchar(140) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`idx` INT NOT NULL DEFAULT 0,
`group` varchar(140) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`link_doctype` varchar(140) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`link_fieldname` varchar(140) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (`name`),
KEY `parent` (`parent`),
KEY `modified` (`modified`)
)
From the docs, https://dev.mysql.com/doc/refman/8.0/en/keywords.html, ACTION seems to be a keyword but it doesn't have details on it.
Perhaps they are not keywords at all but serves a different purpose? Thank you.
So looks like it's not a keyword, it's part of the table name. Spaces are allowed in a table name as long as the name is in the back tick.
https://www.tutorialspoint.com/can-we-create-a-table-with-a-space-in-name-in-mysql
It has nothing to do with reserved words, create table has no ACTION attribute
As you can read up on the home page about create table
Still group in your create table is a reserved word
CREATE TABLE tabDocType (
name varchar(140) COLLATE utf8mb4_unicode_ci NOT NULL,
creation TIMESTAMP(6) DEFAULT NULL,
modified TIMESTAMP(6) DEFAULT NULL,
modified_by varchar(140) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
owner varchar(140) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
docstatus INT NOT NULL DEFAULT 0,
parent varchar(140) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
parentfield varchar(140) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
parenttype varchar(140) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
idx INT NOT NULL DEFAULT 0,
`label` varchar(140) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`group` varchar(140) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
action_type varchar(140) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
action text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (name)
);
To answer your literal question, ACTION is a reserved word because one of the possible ON DELETE/ON UPDATE reference option values for a foreign key constraint is NO ACTION; see https://dev.mysql.com/doc/refman/8.0/en/create-table-foreign-keys.html
Related
I am trying to insert some datetime values and I came up with a non sense data truncation problem, and I have no idea how to solve and what is causing it. Hope someone helps!
I have the following table:
CREATE TABLE tb_cliente (
id bigint unsigned NOT NULL AUTO_INCREMENT,
st_servidor tinyint(1) NOT NULL,
nm_nome varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
nm_nome_social varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
cd_matricula varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
cd_siape varchar(255) CHARACTER SET utf8mb4
COLLATE utf8mb4_unicode_ci DEFAULT NULL,
dt_nascimento timestamp NOT NULL,
sexo varchar(1) COLLATE utf8mb4_unicode_ci NOT NULL,
nacionalidade varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
ano_chegada_no_pais varchar(255)
COLLATE utf8mb4_unicode_ci DEFAULT NULL,
naturalidade varchar(255) CHARACTER SET utf8mb4
COLLATE utf8mb4_unicode_ci DEFAULT NULL,
uf_nascimento varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
estado_civil varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
sn_conjuge_servidor tinyint(1) DEFAULT NULL,
nm_conjuge varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
nm_pai varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
nm_mae varchar(255) CHARACTER SET utf8mb4
COLLATE utf8mb4_unicode_ci DEFAULT NULL,
raca varchar(255) CHARACTER SET utf8mb4
COLLATE utf8mb4_unicode_ci DEFAULT NULL,
cor_dos_olhos varchar(255) CHARACTER SET utf8mb4
COLLATE utf8mb4_unicode_ci DEFAULT NULL,
cor_dos_cabelos varchar(255) CHARACTER SET utf8mb4
COLLATE utf8mb4_unicode_ci DEFAULT NULL,
sn_alergico tinyint(1) DEFAULT NULL,
grau_de_instrucao varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
dt_conclusao timestamp NULL DEFAULT NULL,
altura decimal(8,2) DEFAULT NULL,
tipo_sanguineo varchar(255) CHARACTER SET utf8mb4
COLLATE utf8mb4_unicode_ci DEFAULT NULL,
sn_doador_de_orgaos tinyint(1) DEFAULT NULL,
nome_anterior varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
endereco varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
nr_cep varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
nr_cpf varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
telefone varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
telefone_celular varchar(255)
COLLATE utf8mb4_unicode_ci DEFAULT NULL,
email_institucional varchar(255)
COLLATE utf8mb4_unicode_ci DEFAULT NULL,
email_externo varchar(255)
COLLATE utf8mb4_unicode_ci DEFAULT NULL,
email_comunicados varchar(255)
COLLATE utf8mb4_unicode_ci DEFAULT NULL,
endereco_correspondencia varchar(255)
COLLATE utf8mb4_unicode_ci DEFAULT NULL,
nr_cep_correspondencia varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
created_at timestamp NULL DEFAULT NULL,
updated_at timestamp NULL DEFAULT NULL,
user_id bigint unsigned DEFAULT NULL,
PRIMARY KEY (id),
UNIQUE KEY tb_servidor_nr_cpf_unique (nr_cpf),
KEY tb_servidor_user_id_index (user_id),
CONSTRAINT tb_servidor_user_id_foreign FOREIGN KEY (user_id)
REFERENCES tb_users (id) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
When I try to insert timestamp using year 1948, I get this error:
SQL Error [1292] [22001]: Data truncation: Incorrect datetime value: '1948-07-19 00:00:00' for column 'dt_nascimento' at row 1
But when I try to insert timestamp using year 1999, it inserts successfully using the following query:
insert into tb_cliente (
updated_at, created_at, st_servidor,
nm_nome, cd_matricula, dt_nascimento,
sexo, nacionalidade, uf_nascimento,
estado_civil, grau_de_instrucao, nr_cpf,
telefone, telefone_celular, email_institucional, email_externo)
values ('2022-10-25 00:00:00', '2022-10-25 00:00:00', '1',
'User name 1', '000000', '1999-07-19 00:00:00','M',
'1', 'AC', 'CASADO','ENSINO' , '000000', '000000', '000000',
'USER#UOL.COM.BR', 'USER#UOL.COM.BR' )
Mysql Server 8.0
https://dev.mysql.com/doc/refman/8.0/en/date-and-time-type-syntax.html says:
A timestamp. The range is '1970-01-01 00:00:01.000000' UTC to '2038-01-19 03:14:07.999999' UTC.
In other words, '1948-07-19 00:00:00' is more than 21 years earlier than the earliest date a TIMESTAMP can store.
You should use DATETIME if you want dates outside this range.
I am trying to import a csv file into a MySQL DB.
Said csv file is from a select * from the same table
LOAD DATA INFILE 'C:/ProgramData/MySQL/MySQL Server 5.7/Uploads/import.csv'
INTO TABLE fisc_hist_header
character set utf8
FIELDS TERMINATED BY ';'
LINES TERMINATED BY '\n'
(-- a whole lot of fields ...)
SET `CREATED_DATE`=STR_TO_DATE( #yourdatecolumn, '%d/%m/%Y %H:%i:%s' )
The file starts with
545752715002093599;3;1;503955117000124560;28/11/2019 14:38:51;0 -- all the other fields
What I get is
After searching here, all results are for
Incorrect integer value: ''
What is different and strange to me is that for me, it gets the value but does not inputs it as an integer ?
EDIT : As asked here is the create table statement:
CREATE TABLE `fisc_hist_header` (
`fiscal_idx` bigint(20) NOT NULL AUTO_INCREMENT,
`invc_sid` bigint(20) NOT NULL,
`sbs_no` int(11) NOT NULL,
`store_no` int(5) NOT NULL,
`workstation_id` bigint(20) NOT NULL,
`created_date` datetime NOT NULL,
`invc_type` int(11) NOT NULL,
`cashier_name` varchar(8) COLLATE utf8_bin DEFAULT NULL,
`associate_name` varchar(8) COLLATE utf8_bin DEFAULT NULL,
`store_code` varchar(5) COLLATE utf8_bin DEFAULT NULL,
`store_name` varchar(40) COLLATE utf8_bin DEFAULT NULL,
`store_address1` varchar(40) COLLATE utf8_bin DEFAULT NULL,
`store_address2` varchar(40) COLLATE utf8_bin DEFAULT NULL,
`store_address3` varchar(40) COLLATE utf8_bin DEFAULT NULL,
`store_address4` varchar(40) COLLATE utf8_bin DEFAULT NULL,
`store_address5` varchar(40) COLLATE utf8_bin DEFAULT NULL,
`store_address6` varchar(40) COLLATE utf8_bin DEFAULT NULL,
`store_zip` varchar(10) COLLATE utf8_bin DEFAULT NULL,
`customer_sid` bigint(20) DEFAULT NULL,
`customer_title` varchar(15) COLLATE utf8_bin DEFAULT NULL,
`customer_last_name` varchar(30) COLLATE utf8_bin DEFAULT NULL,
`customer_first_name` varchar(30) COLLATE utf8_bin DEFAULT NULL,
`customer_address1` varchar(40) COLLATE utf8_bin DEFAULT NULL,
`customer_address2` varchar(40) COLLATE utf8_bin DEFAULT NULL,
`customer_address3` varchar(40) COLLATE utf8_bin DEFAULT NULL,
`customer_address4` varchar(40) COLLATE utf8_bin DEFAULT NULL,
`customer_zip_code` varchar(10) COLLATE utf8_bin DEFAULT NULL,
`customer_country` varchar(35) COLLATE utf8_bin DEFAULT NULL,
`customer_phone` varchar(30) COLLATE utf8_bin DEFAULT NULL,
`customer_email` varchar(60) COLLATE utf8_bin DEFAULT NULL,
`item_count` int(5) NOT NULL,
`grand_total_receipt` decimal(10,0) NOT NULL,
`prism_version` varchar(19) COLLATE utf8_bin DEFAULT NULL,
`plugin_version` varchar(19) COLLATE utf8_bin DEFAULT NULL,
`flag_first_record` char(1) COLLATE utf8_bin DEFAULT NULL,
`signature_key` varchar(500) COLLATE utf8_bin DEFAULT NULL,
`signature` varchar(500) COLLATE utf8_bin DEFAULT NULL,
`signature_previous` varchar(500) COLLATE utf8_bin DEFAULT NULL,
`signature_short` varchar(10) COLLATE utf8_bin DEFAULT NULL,
PRIMARY KEY (`fiscal_idx`),
UNIQUE KEY `un_fhh` (`invc_sid`)
) ENGINE=InnoDB AUTO_INCREMENT=364 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
As per the documentation for integer values, the maximum value for an unsigned integer which can be held in an INT column is 4294967295. For a standard signed integer it's 2147483647.
Your number 545752715002093599 is larger than both of these. You'll need to declare the target column as BIGINT in your fisc_hist_header table - the max value for a signed integer in this column type is 9223372036854775807.
These restrictions exist because of the number of bytes used by MySQL to store each value in the database. If you know you won't need to store values above a certain limit, you can use a smaller integer type in order to save disk space and memory.
I have deleted a table from my server called 'companies' that has foreign keys and also has relationships with other tables. Now I'm trying to import the table again with a backup I download, but it throws an error of incorrectly formed foreign keys
I have tried to create just the table with 2 charts a name and an id, but it's not working it also throws the error of Foreign key constraint is incorrectly formed.
CREATE TABLE `companies` (
`id` int(10) UNSIGNED NOT NULL,
`company_name` varchar(191) COLLATE utf8_unicode_ci NOT NULL,
`company_email` varchar(191) COLLATE utf8_unicode_ci NOT NULL,
`company_phone` varchar(191) COLLATE utf8_unicode_ci NOT NULL,
`logo` varchar(191) COLLATE utf8_unicode_ci DEFAULT NULL,
`login_background` varchar(191) COLLATE utf8_unicode_ci DEFAULT NULL,
`address` text COLLATE utf8_unicode_ci NOT NULL,
`website` varchar(191) COLLATE utf8_unicode_ci DEFAULT NULL,
`currency_id` int(10) UNSIGNED DEFAULT NULL,
`package_id` int(10) UNSIGNED DEFAULT NULL,
`package_type` enum('monthly','annual') COLLATE utf8_unicode_ci NOT NULL
DEFAULT 'monthly',
`timezone` varchar(191) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Asia/Kolkata',
`date_format` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'd-m-Y',
`time_format` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'h:i a',
`locale` varchar(191) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'en',
`latitude` decimal(10,8) NOT NULL DEFAULT 26.91243360,
`longitude` decimal(11,8) NOT NULL DEFAULT 75.78727090,
`leaves_start_from` enum('joining_date','year_start') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'joining_date',
`active_theme` enum('default','custom') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'default',
`status` enum('active','inactive','license_expired') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'active',
`last_updated_by` int(10) UNSIGNED DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`stripe_id` varchar(191) COLLATE utf8_unicode_ci DEFAULT NULL,
`card_brand` varchar(191) COLLATE utf8_unicode_ci DEFAULT NULL,
`card_last_four` varchar(191) COLLATE utf8_unicode_ci DEFAULT NULL,
`trial_ends_at` timestamp NULL DEFAULT NULL,
`licence_expire_on` date DEFAULT NULL
)ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
Error Message:
(Error: 150 "Foreign key constraint is incorrectly formed")
First is to get all foreign keys of "Comapanies" table using this query.
Then drop all foreign keys
ALTER TABLE `companies`
DROP FOREIGN KEY `id_name_fk`;
Then execute your create table statement
I'm importing a new table as Users, into my database but it is showing an error
1709 - Index column size too large. The maximum column size is 767 bytes.
I am having
Server version: 10.1.16-MariaDB
PHP version: 7.2.14
phpmyAdmin Version : Version information: 4.8.4
DROP TABLE IF EXISTS `users`;
CREATE TABLE IF NOT EXISTS `users` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`first_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`last_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`username` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email_show` tinyint(1) NOT NULL DEFAULT '0',
`email_confirmed` tinyint(1) NOT NULL DEFAULT '0',
`iso2` varchar(5) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`phone` varchar(16) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`dob` date DEFAULT NULL,
`gender` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0=> Not Specified,1=> Male, 2=> Female',
`phone_show` tinyint(1) NOT NULL DEFAULT '0',
`phone_confirmed` tinyint(1) NOT NULL DEFAULT '0',
`country_id` int(10) UNSIGNED DEFAULT NULL,
`state_id` int(10) UNSIGNED DEFAULT NULL,
`city_id` int(11) DEFAULT NULL,
`confirmation_code` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_by` int(10) UNSIGNED DEFAULT NULL,
`updated_by` int(10) UNSIGNED DEFAULT NULL,
`password` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL,
`options` text COLLATE utf8mb4_unicode_ci,
`confirmed` tinyint(1) NOT NULL DEFAULT '0',
`active` tinyint(1) NOT NULL DEFAULT '0',
`phone_code` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`provider` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`provider_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`company_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`portfolio` text COLLATE utf8mb4_unicode_ci,
`opening_time` time DEFAULT NULL,
`closing_time` time DEFAULT NULL,
`address` text COLLATE utf8mb4_unicode_ci,
`education` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`notary_number` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`monday_opening_time` time DEFAULT NULL,
`monday_closing_time` time DEFAULT NULL,
`thuesday_opening_time` time DEFAULT NULL,
`thuesday_closing_time` time DEFAULT NULL,
`wednesday_opening_time` time DEFAULT NULL,
`wednesday_closing_time` time DEFAULT NULL,
`thursday_opening_time` time DEFAULT NULL,
`thursday_closing_time` time DEFAULT NULL,
`friday_opening_time` time DEFAULT NULL,
`friday_closing_time` time DEFAULT NULL,
`saturday_opening_time` time DEFAULT NULL,
`saturday_closing_time` time DEFAULT NULL,
`sunday_opening_time` time DEFAULT NULL,
`sunday_closing_time` time DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `users_email_unique` (`email`),
KEY `users_country_id_index` (`country_id`),
KEY `users_area_id_index` (`state_id`),
KEY `users_created_by_index` (`created_by`),
KEY `users_updated_by_index` (`updated_by`)
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
MySQL said:
1709 - Index column size too large. The maximum column size is 767 bytes.
In the last line of the creation table code try changing this:
ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
To this:
ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COLLATE=utf8mb4_unicode_ci;
I am struggling with a MySQL query. Here's the problem:
SELECT * from sf_forecasts WHERE contentid='1234' AND fulldate='2012-12-13'
There is one record in my table that matches this criteria, and this query finds it with no difficulty. However, when I move to update it using this query...
UPDATE sf_forecasts
SET listingTitle ='Some Snow Resort', location ='49.23, -115.22'
WHERE contentid='1234' AND fulldate='2012-12-13'
...I always get a notice of "0 rows affected." Strangely, the query is actually updating the record, but it's only touching fields that are NULL. If my example record has a 'location' value of NULL, the query will update the data, but if it already contains a non-NULL value, the query will not change it, even though the query clearly contains new information.
What gives?
P.S. I am using a PRIMARY key of contentid+fulldate (b-tree, unique) if this matters.
P.S.S. Here is the 'SHOW CREATE TABLE sf_forecasts' results as requested below:
sf_forecasts CREATE TABLE `sf_forecasts` (
`contentid` int(11) NOT NULL,
`fulldate` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
`listingTitle` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`location` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
`dayofmonth` smallint(2) NOT NULL,
`dayofweek` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
`minTempF` smallint(4) NOT NULL,
`maxTempF` smallint(4) NOT NULL,
`minTempC` smallint(4) NOT NULL,
`maxTempC` smallint(4) NOT NULL,
`skyCondition` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`precip` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`snowPotential` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`wind` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`minTempF_custom` smallint(4) DEFAULT NULL,
`maxTempF_custom` smallint(4) DEFAULT NULL,
`minTempC_custom` smallint(4) DEFAULT NULL,
`maxTempC_custom` smallint(4) DEFAULT NULL,
`baseH_custom` smallint(4) DEFAULT NULL,
`baseL_custom` smallint(4) DEFAULT NULL,
`topH_custom` smallint(4) DEFAULT NULL,
`topL_custom` smallint(4) DEFAULT NULL,
`skyCondition_custom` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
`precip_custom` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
`snowPotential_custom` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
`wind_custom` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
`icon` varchar(30) COLLATE utf8_unicode_ci NOT NULL,
`icon_custom` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL,
`shortrange_custom` varchar(5000) COLLATE utf8_unicode_ci DEFAULT NULL,
`longrange_custom` varchar(5000) COLLATE utf8_unicode_ci DEFAULT NULL,
`scCode` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
`scUpdate` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
`lastUpdate` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
`skys` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`contentid`,`fulldate`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
The issue is with difference in datatype length defined and length of data being updated
Your location is varchar(10) and you are trying to insert 14 characters
You can always check if there are errors after query execution:
SHOW ERRORS;
SHOW WARNINGS;