I'm struggling a bit with a query I would expect to work, but errors both running it through my script and from the sqlplus prompt. I was hoping that anyone who had some Oracle experience could point out what it is I'm doing wrong:
Given this table schema for the table 'Promotions':Name Null? Type ------------------------------- -------- ---- ID NOT NULL NUMBER(5) DATE_CREATED NOT NULL DATE DATE_MODIFIED NOT NULL DATE TITLE NOT NULL VARCHAR2(64) PROMOTION_PHRASE NOT NULL VARCHAR2(255) DATE_START DATE DATE_END DATE STATUS NOT NULL NUMBER(2) TRIGGER_TYPE NOT NULL NUMBER(2) TRIGGER_VALUE NOT NULL VARCHAR2(12) TRIGGER_QUANTITY NOT NULL VARCHAR2(12) REWARD_TYPE NOT NULL NUMBER(2) REWARD_VALUE NOT NULL VARCHAR2(12) REWARD_QUANTITY NOT NULL VARCHAR2(12) USES_PERCUSTOMER NOT NULL NUMBER(5) USES_MAXIMUM NOT NULL NUMBER(10)
And my query:
insert into Promotions (ID,Date_Created,Date_Modified,Title, Promotion_Phrase,Date_Start,Date_End,Status, Trigger_Type,Trigger_Value,Trigger_Quantity, Reward_Type,Reward_Value,Reward_Quantity, Uses_PerCustomer,Uses_Maximum) values (1,SYSDATE,SYSDATE,'test promotion', 'phrase here',NULL,NULL,0,0,'','',0,'','',1,0);
in my perl code I'm using placeholders for all the values, and undef's for the two null values I do want
. The error I'm getting is this: ORA-01400: mandatory (NOT NULL) column is missing or NULL during insertOf course, Oracle doesn't take the courtesy to tell me *which* column it is referring to. Any insights would be much appreciated
In reply to OT: Oracle SQL issues by AidanLee
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |