I have the following query. It fails I think on the CompanyBranch table_id=1122; varchar ,
statement, however I am not able to clearly identify the problem, mainly because it is InnoDB, which I lack experience with…
DROP TABLE IF EXISTS`firmaucet`; CREATE TABLE `firmaucet` ( `ID` bigint not null auto_increment , `RND` double , `Nazov` varchar(50) , `Pobocka` varchar(50) , `Ucet` varchar(50) , `Kod` varchar(50) , `UcetAndKod` varchar(50) , `UcetOsnova` bigint , `HomeBanking` double , `ExportLastFileName` varchar(250) , `CudziaMena` smallint , `IBAN` varchar(50) , `SWIFT` varchar(50) , `Pomenovanie` varchar(100) , `IDNum` bigint , `BankStatement_Format` bigint , `PaymentOrder_Format` bigint , `SortOrder` bigint , `CompanyBranch` table_id=1122; varchar , `ActiveToDate` datetime , `WebApiAddress` table_id=1122; varchar , `WebApiAuth1` table_id=1122; varchar , `WebApiAuth2` table_id=1122; varchar ,Primary key(`ID`) )ENGINE=InnoDB COLLATE=utf8_general_ci,DEFAULT CHARSET=utf8;
Advertisement
Answer
I’ve modified your code and it’s working.
I removed the table_id=1122
and changed varchar
to varchar(50)
on lines 20, 22, 23 & 24.
DROP TABLE IF EXISTS`firmaucet`; CREATE TABLE `firmaucet` ( `ID` bigint not null auto_increment , `RND` double , `Nazov` varchar(50) , `Pobocka` varchar(50) , `Ucet` varchar(50) , `Kod` varchar(50) , `UcetAndKod` varchar(50) , `UcetOsnova` bigint , `HomeBanking` double , `ExportLastFileName` varchar(250) , `CudziaMena` smallint , `IBAN` varchar(50) , `SWIFT` varchar(50) , `Pomenovanie` varchar(100) , `IDNum` bigint , `BankStatement_Format` bigint , `PaymentOrder_Format` bigint , `SortOrder` bigint , `CompanyBranch` varchar(50) , `ActiveToDate` datetime , `WebApiAddress` varchar(50) , `WebApiAuth1` varchar (50), `WebApiAuth2` varchar(50) , Primary key(`ID`) )ENGINE=InnoDB COLLATE=utf8_general_ci, DEFAULT CHARSET=utf8;
db<>fiddle here