I'm trying to do multiple insert statements. The table looks like
this:
CREATE TABLE $table (CNTY_CNTRY_CD char(3),ST char(2),
CNTY_CNTRY_DESCR varchar(50),CNTY_CNTRY_IND char(1),
HOME_CNTRY_IND char(1),
CONSTRAINT cnty_key PRIMARY KEY (CNTY_CNTRY_CD, ST))
I'm using 2 fields for the primary key constraint
My insert statement looks like this:
INSERT INTO $table
(CNTY_CNTRY_CD,ST,CNTY_CNTRY_DESCR)
VALUES(?,?,?)
I've been through the list of values and none have both the same
CNTY_CNTRY_CD and ST and yet, this is the error message I'm getting:
DBD::ODBC::st execute failed: [Microsoft][ODBC SQL Server Driver][SQL
Server]Vio
lation of PRIMARY KEY constraint 'cnty_key'. Cannot insert duplicate
key in obje
ct 'event_CNTY_CNTRY_CD'. (SQL-23000)
[Microsoft][ODBC SQL Server Driver][SQL Server]The statement has been
terminated
.. (SQL-01000)(DBD: st_execute/SQLExecute err=-1)
Why is it looking for unique in just the one column instead of
referencing both? What do I need to do to get this to work? Help!