Quantcast
Channel: MySQL Forums - InnoDB
Viewing all articles
Browse latest Browse all 1957

1054 (42S22): Unknown column 'testType$testSubtypeid2' in 'where clause' at line 1 (1 reply)

$
0
0
I have the two following tables

CREATE TABLE `testType$testSubtype` (
`id1` bigint(20) NOT NULL,
`id2` bigint(20) NOT NULL,
PRIMARY KEY (`id1`,`id2`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci

CREATE TABLE `testType$testSubtype$testfield` (
`object_id1` bigint(20) NOT NULL,
`object_id2` bigint(20) NOT NULL,
`testfield` varchar(100) collate utf8_unicode_ci NOT NULL,
PRIMARY KEY (`object_uuid1`,`object_uuid2`,`testfield`),
CONSTRAINT `testType$testSubtype$testfield_id` FOREIGN KEY (`object_id1`, `object_id2`) REFERENCES `testType$testSubtype` (`id1`, `id2`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci

When I try to insert data into the child table "testType$testSubtype$testfield" I keep getting an error "1054 (42S22): Unknown column 'testType$testSubtypeid2' in 'where clause' at line 1".

Is there something wrong with the way I created the tables?

Any help would be great! thanks.

Viewing all articles
Browse latest Browse all 1957

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>