I'm trying to insert values in a table that resides in RedShift database. But when i insert the NULL value in an integer column i get the following error:
Amazon Invalid operation: column "INVC_RLS_LCTN " is of type integer but expression is of type character varying;
Here is the schema:
CREATE TABLE DM_TX_LINE_FCT
(
SRRGT_ID BIGINT NOT NULL,
IGT_RSRVTN_ID CHARACTER VARYING(40),
INVC_RLS_LCTN INTEGER,
)
distkey(TX_SRRGT_KEY)
SORTKEY(LCTN_ID, PRCSSNG_DT_KEY);
I'm inserting in the table like this
...
...
PT.CASHIER_NBR,
PT.MMBRSHP_CARD_ID,
MMBR.MMBRSHP_CARD_SRRGT_ID,
NULL as IGT_RSRVTN_ID,
NULL as INVC_RLS_LCTN,
...
...
Can anyone tell me, why can't i store NULL in integer value?